From 8a78b33ddea3b5759f809eb5036c7bc34a04523e Mon Sep 17 00:00:00 2001 From: pulumi-bot Date: Wed, 25 Oct 2023 02:32:08 +0000 Subject: [PATCH 1/2] make tfgen --- provider/go.mod | 2 +- provider/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/provider/go.mod b/provider/go.mod index 7521b7268a..cf4e95e834 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -7,7 +7,7 @@ require ( github.com/hashicorp/go-azure-sdk v0.20231012.1141427 github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 github.com/hashicorp/terraform-provider-azurerm v1.44.1-0.20220923005104-eaa801c358ff - github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.0 + github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.1 github.com/pulumi/pulumi/sdk/v3 v3.90.1 github.com/stretchr/testify v1.8.4 ) diff --git a/provider/go.sum b/provider/go.sum index 6f9f915da8..718746817e 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -2181,8 +2181,8 @@ github.com/pulumi/pulumi-java/pkg v0.9.8 h1:c8mYsalnRXA2Ibgvv6scefOn6mW1Vb0UT0mc github.com/pulumi/pulumi-java/pkg v0.9.8/go.mod h1:c6rSw/+q4O0IImgJ9axxoC6QesbPYWBaG5gimbHouUQ= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1 h1:SCg1gjfY9N4yn8U8peIUYATifjoDABkyR7H9lmefsfc= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1/go.mod h1:7OeUPH8rpt5ipyj9EFcnXpuzQ8SHL0dyqdfa8nOacdk= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.0 h1:otdmkNsMGyZ+proUZClznZo+cEchkSSkmaGcq+Gf+6s= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.0/go.mod h1:6YVbDo019OeHkQWo9MnUbBy6cCgCQeoXZDjmR9SYmUA= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.1 h1:hBgediyT2LdS5yfD5AMiCmBJ/TYP94Xxv6a4TcAfV0g= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.63.1/go.mod h1:6YVbDo019OeHkQWo9MnUbBy6cCgCQeoXZDjmR9SYmUA= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 h1:rIzMmtcVpPX8ynaz6/nW5AHNY63DiNfCohqmxWvMpM4= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4/go.mod h1:Kt8RIZWa/N8rW3+0g6NrqCBmF3o+HuIhFaZpssEkG6w= github.com/pulumi/pulumi-yaml v1.2.2 h1:W6BeUBLhDrJ2GSU0em1AUVelG9PBI4ABY61DdhJOO3E= From e326499712eb6e8910840e5179e725d4edbfe191 Mon Sep 17 00:00:00 2001 From: pulumi-bot Date: Wed, 25 Oct 2023 02:38:25 +0000 Subject: [PATCH 2/2] make build_sdks --- sdk/dotnet/AadB2C/Directory.cs | 23 + sdk/dotnet/AadB2C/GetDirectory.cs | 54 ++ sdk/dotnet/Advisor/GetRecommendations.cs | 68 ++ sdk/dotnet/AnalysisServices/Server.cs | 45 ++ sdk/dotnet/ApiManagement/Api.cs | 45 ++ sdk/dotnet/ApiManagement/ApiDiagnostic.cs | 116 ++++ sdk/dotnet/ApiManagement/ApiOperation.cs | 40 ++ .../ApiManagement/ApiOperationPolicy.cs | 59 ++ sdk/dotnet/ApiManagement/ApiOperationTag.cs | 46 ++ sdk/dotnet/ApiManagement/ApiPolicy.cs | 34 + sdk/dotnet/ApiManagement/ApiRelease.cs | 50 ++ sdk/dotnet/ApiManagement/ApiSchema.cs | 32 + sdk/dotnet/ApiManagement/ApiTag.cs | 41 ++ sdk/dotnet/ApiManagement/ApiVersionSet.cs | 35 + .../ApiManagement/AuthorizationServer.cs | 37 + sdk/dotnet/ApiManagement/Backend.cs | 35 + sdk/dotnet/ApiManagement/Certificate.cs | 135 ++++ sdk/dotnet/ApiManagement/CustomDomain.cs | 113 +++ sdk/dotnet/ApiManagement/Diagnostic.cs | 97 +++ sdk/dotnet/ApiManagement/EmailTemplate.cs | 46 ++ sdk/dotnet/ApiManagement/Gateway.cs | 40 ++ sdk/dotnet/ApiManagement/GatewayApi.cs | 39 ++ .../GatewayCertificateAuthority.cs | 61 ++ .../GatewayHostNameConfiguration.cs | 65 ++ sdk/dotnet/ApiManagement/GetApi.cs | 58 ++ sdk/dotnet/ApiManagement/GetApiVersionSet.cs | 56 ++ sdk/dotnet/ApiManagement/GetGateway.cs | 58 ++ .../GetGatewayHostNameConfiguration.cs | 80 +++ sdk/dotnet/ApiManagement/GetGroup.cs | 56 ++ sdk/dotnet/ApiManagement/GetProduct.cs | 56 ++ sdk/dotnet/ApiManagement/GetService.cs | 54 ++ sdk/dotnet/ApiManagement/GlobalSchema.cs | 37 + sdk/dotnet/ApiManagement/Group.cs | 35 + sdk/dotnet/ApiManagement/GroupUser.cs | 28 + .../ApiManagement/IdentityProviderAad.cs | 39 ++ .../ApiManagement/IdentityProviderAadb2c.cs | 58 ++ .../ApiManagement/IdentityProviderFacebook.cs | 35 + .../ApiManagement/IdentityProviderGoogle.cs | 35 + .../IdentityProviderMicrosoft.cs | 35 + .../ApiManagement/IdentityProviderTwitter.cs | 35 + sdk/dotnet/ApiManagement/Logger.cs | 45 ++ sdk/dotnet/ApiManagement/NamedValue.cs | 35 + .../NotificationRecipientEmail.cs | 34 + .../NotificationRecipientUser.cs | 45 ++ .../ApiManagement/OpenIdConnectProvider.cs | 37 + sdk/dotnet/ApiManagement/Policy.cs | 42 ++ sdk/dotnet/ApiManagement/Product.cs | 38 ++ sdk/dotnet/ApiManagement/ProductApi.cs | 42 ++ sdk/dotnet/ApiManagement/ProductGroup.cs | 41 ++ sdk/dotnet/ApiManagement/ProductPolicy.cs | 33 + sdk/dotnet/ApiManagement/ProductTag.cs | 50 ++ sdk/dotnet/ApiManagement/RedisCache.cs | 48 ++ sdk/dotnet/ApiManagement/Service.cs | 27 + sdk/dotnet/ApiManagement/Subscription.cs | 42 ++ sdk/dotnet/ApiManagement/Tag.cs | 32 + sdk/dotnet/ApiManagement/User.cs | 38 ++ .../AppConfiguration/ConfigurationFeature.cs | 41 ++ .../AppConfiguration/ConfigurationKey.cs | 129 ++++ .../AppConfiguration/ConfigurationStore.cs | 170 +++++ .../AppConfiguration/GetConfigurationKey.cs | 56 ++ .../AppConfiguration/GetConfigurationKeys.cs | 52 ++ .../AppConfiguration/GetConfigurationStore.cs | 54 ++ .../AppConfiguration/LicationLoadBalancer.cs | 24 + sdk/dotnet/AppInsights/AnalyticsItem.cs | 33 + sdk/dotnet/AppInsights/ApiKey.cs | 81 +++ sdk/dotnet/AppInsights/GetInsights.cs | 54 ++ sdk/dotnet/AppInsights/Insights.cs | 68 ++ sdk/dotnet/AppInsights/SmartDetectionRule.cs | 31 + sdk/dotnet/AppInsights/StandardWebTest.cs | 40 ++ sdk/dotnet/AppInsights/WebTest.cs | 52 ++ sdk/dotnet/AppInsights/Workbook.cs | 51 ++ sdk/dotnet/AppInsights/WorkbookTemplate.cs | 108 +++ sdk/dotnet/AppPlatform/GetSpringCloudApp.cs | 56 ++ .../AppPlatform/GetSpringCloudService.cs | 54 ++ .../AppPlatform/SpringCloudAccelerator.cs | 30 + .../SpringCloudActiveDeployment.cs | 57 ++ .../AppPlatform/SpringCloudApiPortal.cs | 52 ++ .../SpringCloudApiPortalCustomDomain.cs | 44 ++ sdk/dotnet/AppPlatform/SpringCloudApp.cs | 34 + .../SpringCloudAppCosmosDBAssociation.cs | 58 ++ .../SpringCloudAppMysqlAssociation.cs | 60 ++ .../SpringCloudAppRedisAssociation.cs | 48 ++ ...nsightsApplicationPerformanceMonitoring.cs | 43 ++ .../SpringCloudApplicationLiveView.cs | 30 + .../AppPlatform/SpringCloudBuildDeployment.cs | 48 ++ .../SpringCloudBuildPackBinding.cs | 65 ++ sdk/dotnet/AppPlatform/SpringCloudBuilder.cs | 46 ++ .../AppPlatform/SpringCloudCertificate.cs | 133 ++++ .../SpringCloudConfigurationService.cs | 51 ++ .../AppPlatform/SpringCloudConnection.cs | 86 +++ .../SpringCloudContainerDeployment.cs | 55 ++ .../SpringCloudCustomizedAccelerator.cs | 49 ++ .../AppPlatform/SpringCloudDevToolPortal.cs | 47 ++ sdk/dotnet/AppPlatform/SpringCloudGateway.cs | 77 +++ .../SpringCloudGatewayCustomDomain.cs | 35 + .../SpringCloudGatewayRouteConfig.cs | 69 ++ .../AppPlatform/SpringCloudJavaDeployment.cs | 52 ++ sdk/dotnet/AppPlatform/SpringCloudService.cs | 51 ++ sdk/dotnet/AppPlatform/SpringCloudStorage.cs | 39 ++ sdk/dotnet/AppService/ActiveSlot.cs | 36 + sdk/dotnet/AppService/AppConnection.cs | 90 +++ sdk/dotnet/AppService/AppService.cs | 56 ++ sdk/dotnet/AppService/Certificate.cs | 34 + sdk/dotnet/AppService/CertificateOrder.cs | 26 + sdk/dotnet/AppService/Connection.cs | 81 +++ .../AppService/CustomHostnameBinding.cs | 53 ++ sdk/dotnet/AppService/Environment.cs | 70 ++ sdk/dotnet/AppService/FunctionApp.cs | 142 ++++ .../AppService/FunctionAppActiveSlot.cs | 108 +++ sdk/dotnet/AppService/FunctionAppFunction.cs | 177 +++++ .../AppService/FunctionAppHybridConnection.cs | 73 ++ sdk/dotnet/AppService/FunctionAppSlot.cs | 55 ++ sdk/dotnet/AppService/GetAppService.cs | 54 ++ .../AppService/GetAppServiceEnvironment.cs | 54 ++ sdk/dotnet/AppService/GetAppServicePlan.cs | 54 ++ sdk/dotnet/AppService/GetCertificate.cs | 54 ++ sdk/dotnet/AppService/GetCertificateOrder.cs | 54 ++ sdk/dotnet/AppService/GetEnvironmentV3.cs | 54 ++ sdk/dotnet/AppService/GetFunctionApp.cs | 46 ++ .../AppService/GetFunctionAppHostKeys.cs | 46 ++ sdk/dotnet/AppService/GetLinuxFunctionApp.cs | 54 ++ sdk/dotnet/AppService/GetLinuxWebApp.cs | 54 ++ sdk/dotnet/AppService/GetServicePlan.cs | 54 ++ .../AppService/GetSourceControlToken.cs | 54 ++ .../AppService/GetWindowsFunctionApp.cs | 54 ++ sdk/dotnet/AppService/GetWindowsWebApp.cs | 54 ++ sdk/dotnet/AppService/HybridConnection.cs | 62 ++ sdk/dotnet/AppService/LinuxFunctionApp.cs | 44 ++ sdk/dotnet/AppService/LinuxFunctionAppSlot.cs | 50 ++ sdk/dotnet/AppService/LinuxWebApp.cs | 34 + sdk/dotnet/AppService/LinuxWebAppSlot.cs | 40 ++ sdk/dotnet/AppService/Plan.cs | 117 ++++ sdk/dotnet/AppService/PublicCertificate.cs | 51 ++ sdk/dotnet/AppService/ServicePlan.cs | 26 + sdk/dotnet/AppService/Slot.cs | 152 +++++ .../AppService/SlotCustomHostnameBinding.cs | 50 ++ .../SlotVirtualNetworkSwiftConnection.cs | 86 +++ sdk/dotnet/AppService/SourceCodeToken.cs | 19 + sdk/dotnet/AppService/SourceControl.cs | 41 ++ sdk/dotnet/AppService/SourceControlSlot.cs | 47 ++ sdk/dotnet/AppService/SourceControlToken.cs | 19 + sdk/dotnet/AppService/StaticSite.cs | 19 + .../AppService/StaticSiteCustomDomain.cs | 87 +++ .../VirtualNetworkSwiftConnection.cs | 162 +++++ sdk/dotnet/AppService/WebAppActiveSlot.cs | 44 ++ .../AppService/WebAppHybridConnection.cs | 55 ++ sdk/dotnet/AppService/WindowsFunctionApp.cs | 44 ++ .../AppService/WindowsFunctionAppSlot.cs | 50 ++ sdk/dotnet/AppService/WindowsWebApp.cs | 34 + sdk/dotnet/AppService/WindowsWebAppSlot.cs | 40 ++ sdk/dotnet/Arc/PrivateLinkScope.cs | 24 + sdk/dotnet/Arc/ResourceBridgeAppliance.cs | 34 + sdk/dotnet/ArcKubernetes/ClusterExtension.cs | 45 ++ sdk/dotnet/ArcKubernetes/FluxConfiguration.cs | 70 ++ sdk/dotnet/ArcMachine/Get.cs | 54 ++ sdk/dotnet/Attestation/Provider.cs | 26 + sdk/dotnet/Authorization/Assignment.cs | 163 +++++ .../Authorization/GetUserAssignedIdentity.cs | 52 ++ sdk/dotnet/Authorization/RoleDefinition.cs | 36 + .../Authorization/UserAssignedIdentity.cs | 24 + sdk/dotnet/Automanage/Configuration.cs | 100 +++ sdk/dotnet/Automation/Account.cs | 29 + sdk/dotnet/Automation/BoolVariable.cs | 32 + sdk/dotnet/Automation/Certificate.cs | 40 ++ sdk/dotnet/Automation/Connection.cs | 41 ++ .../Automation/ConnectionCertificate.cs | 48 ++ .../ConnectionClassicCertificate.cs | 36 + .../Automation/ConnectionServicePrincipal.cs | 38 ++ sdk/dotnet/Automation/ConnectionType.cs | 41 ++ sdk/dotnet/Automation/Credential.cs | 34 + sdk/dotnet/Automation/DateTimeVariable.cs | 32 + sdk/dotnet/Automation/DscConfiguration.cs | 33 + sdk/dotnet/Automation/DscNodeConfiguration.cs | 67 ++ sdk/dotnet/Automation/GetAccount.cs | 54 ++ sdk/dotnet/Automation/GetBoolVariable.cs | 56 ++ sdk/dotnet/Automation/GetDateTimeVariable.cs | 56 ++ sdk/dotnet/Automation/GetIntVariable.cs | 56 ++ sdk/dotnet/Automation/GetStringVariable.cs | 56 ++ sdk/dotnet/Automation/GetVariables.cs | 64 ++ sdk/dotnet/Automation/HybridRunbookWorker.cs | 102 +++ .../Automation/HybridRunbookWorkerGroup.cs | 31 + sdk/dotnet/Automation/IntVariable.cs | 32 + sdk/dotnet/Automation/JobSchedule.cs | 28 + sdk/dotnet/Automation/Module.cs | 35 + sdk/dotnet/Automation/Python3Package.cs | 39 ++ sdk/dotnet/Automation/RunBook.cs | 82 +++ sdk/dotnet/Automation/Schedule.cs | 40 ++ .../Automation/SoftwareUpdateConfiguration.cs | 77 +++ sdk/dotnet/Automation/SourceControl.cs | 39 ++ sdk/dotnet/Automation/StringVariable.cs | 32 + sdk/dotnet/Automation/VariableObject.cs | 37 + sdk/dotnet/Automation/Watcher.cs | 64 ++ sdk/dotnet/Automation/Webhook.cs | 53 ++ sdk/dotnet/Avs/Cluster.cs | 40 ++ sdk/dotnet/Avs/ExpressRouteAuthorization.cs | 38 ++ sdk/dotnet/Avs/GetPrivateCloud.cs | 58 ++ sdk/dotnet/Avs/PrivateCloud.cs | 35 + sdk/dotnet/Backup/ContainerStorageAccount.cs | 40 ++ sdk/dotnet/Backup/GetPolicyFileshare.cs | 48 ++ sdk/dotnet/Backup/GetPolicyVM.cs | 48 ++ sdk/dotnet/Backup/PolicyFileShare.cs | 82 +++ sdk/dotnet/Backup/PolicyVM.cs | 82 +++ sdk/dotnet/Backup/PolicyVMWorkload.cs | 66 ++ sdk/dotnet/Backup/ProtectedFileShare.cs | 70 ++ sdk/dotnet/Backup/ProtectedVM.cs | 54 ++ sdk/dotnet/Batch/Account.cs | 39 ++ sdk/dotnet/Batch/Application.cs | 41 ++ sdk/dotnet/Batch/Certificate.cs | 56 ++ sdk/dotnet/Batch/GetAccount.cs | 54 ++ sdk/dotnet/Batch/GetApplication.cs | 56 ++ sdk/dotnet/Batch/GetCertificate.cs | 56 ++ sdk/dotnet/Batch/GetPool.cs | 48 ++ sdk/dotnet/Batch/Job.cs | 48 ++ sdk/dotnet/Batch/Pool.cs | 124 ++++ .../Billing/AccountCostManagementExport.cs | 49 ++ .../Billing/GetEnrollmentAccountScope.cs | 54 ++ sdk/dotnet/Billing/GetMcaAccountScope.cs | 56 ++ sdk/dotnet/Billing/GetMpaAccountScope.cs | 54 ++ sdk/dotnet/Blueprint/Assignment.cs | 98 +++ sdk/dotnet/Blueprint/GetDefinition.cs | 60 ++ sdk/dotnet/Blueprint/GetPublishedVersion.cs | 52 ++ sdk/dotnet/Bot/ChannelAlexa.cs | 36 + sdk/dotnet/Bot/ChannelDirectLine.cs | 43 ++ sdk/dotnet/Bot/ChannelDirectLineSpeech.cs | 45 ++ sdk/dotnet/Bot/ChannelEmail.cs | 37 + sdk/dotnet/Bot/ChannelFacebook.cs | 45 ++ sdk/dotnet/Bot/ChannelLine.cs | 43 ++ sdk/dotnet/Bot/ChannelSlack.cs | 38 ++ sdk/dotnet/Bot/ChannelSms.cs | 38 ++ sdk/dotnet/Bot/ChannelTeams.cs | 35 + sdk/dotnet/Bot/ChannelWebChat.cs | 42 ++ sdk/dotnet/Bot/ChannelsRegistration.cs | 28 + sdk/dotnet/Bot/Connection.cs | 38 ++ sdk/dotnet/Bot/Healthbot.cs | 25 + sdk/dotnet/Bot/ServiceAzureBot.cs | 55 ++ sdk/dotnet/Bot/WebApp.cs | 28 + sdk/dotnet/Cdn/Endpoint.cs | 40 ++ sdk/dotnet/Cdn/EndpointCustomDomain.cs | 73 ++ sdk/dotnet/Cdn/FrontdoorCustomDomain.cs | 70 ++ sdk/dotnet/Cdn/FrontdoorEndpoint.cs | 33 + sdk/dotnet/Cdn/FrontdoorFirewallPolicy.cs | 170 +++++ sdk/dotnet/Cdn/FrontdoorOriginGroup.cs | 44 ++ sdk/dotnet/Cdn/FrontdoorProfile.cs | 28 + ...rontdoorRouteDisableLinkToDefaultDomain.cs | 23 + sdk/dotnet/Cdn/FrontdoorRuleSet.cs | 29 + sdk/dotnet/Cdn/FrontdoorSecret.cs | 108 +++ sdk/dotnet/Cdn/GetFrontdoorCustomDomain.cs | 48 ++ sdk/dotnet/Cdn/GetFrontdoorEndpoint.cs | 48 ++ sdk/dotnet/Cdn/GetFrontdoorFirewallPolicy.cs | 46 ++ sdk/dotnet/Cdn/GetFrontdoorOriginGroup.cs | 48 ++ sdk/dotnet/Cdn/GetFrontdoorProfile.cs | 46 ++ sdk/dotnet/Cdn/GetFrontdoorRuleSet.cs | 48 ++ sdk/dotnet/Cdn/GetFrontdoorSecret.cs | 48 ++ sdk/dotnet/Cdn/GetProfile.cs | 54 ++ sdk/dotnet/Cdn/Profile.cs | 30 + sdk/dotnet/Cognitive/Account.cs | 30 + .../Cognitive/AccountCustomerManagedKey.cs | 153 +++++ sdk/dotnet/Cognitive/Deployment.cs | 41 ++ sdk/dotnet/Cognitive/GetAccount.cs | 54 ++ sdk/dotnet/Communication/EmailService.cs | 24 + sdk/dotnet/Communication/GetService.cs | 54 ++ sdk/dotnet/Communication/Service.cs | 24 + sdk/dotnet/Compute/AvailabilitySet.cs | 28 + sdk/dotnet/Compute/BastionHost.cs | 60 ++ sdk/dotnet/Compute/CapacityReservation.cs | 34 + .../Compute/CapacityReservationGroup.cs | 24 + sdk/dotnet/Compute/DataDiskAttachment.cs | 109 +++ sdk/dotnet/Compute/DedicatedHost.cs | 33 + sdk/dotnet/Compute/DedicatedHostGroup.cs | 25 + sdk/dotnet/Compute/DiskAccess.cs | 19 + sdk/dotnet/Compute/DiskEncryptionSet.cs | 218 ++++++ sdk/dotnet/Compute/DiskPool.cs | 65 ++ sdk/dotnet/Compute/DiskPoolIscsiTarget.cs | 124 ++++ sdk/dotnet/Compute/DiskPoolIscsiTargetLun.cs | 130 ++++ .../Compute/DiskPoolManagedDiskAttachment.cs | 111 +++ sdk/dotnet/Compute/Extension.cs | 132 ++++ sdk/dotnet/Compute/GalleryApplication.cs | 31 + .../Compute/GalleryApplicationVersion.cs | 76 +++ sdk/dotnet/Compute/GetAvailabilitySet.cs | 54 ++ sdk/dotnet/Compute/GetBastionHost.cs | 54 ++ sdk/dotnet/Compute/GetConfidentialLedger.cs | 54 ++ sdk/dotnet/Compute/GetDedicatedHost.cs | 56 ++ sdk/dotnet/Compute/GetDedicatedHostGroup.cs | 54 ++ sdk/dotnet/Compute/GetDiskAccess.cs | 54 ++ sdk/dotnet/Compute/GetDiskEncryptionSet.cs | 54 ++ sdk/dotnet/Compute/GetImage.cs | 54 ++ sdk/dotnet/Compute/GetImages.cs | 44 ++ sdk/dotnet/Compute/GetManagedDisk.cs | 54 ++ .../GetOrchestratedVirtualMachineScaleSet.cs | 54 ++ sdk/dotnet/Compute/GetPlatformImage.cs | 58 ++ sdk/dotnet/Compute/GetSharedImage.cs | 48 ++ sdk/dotnet/Compute/GetSharedImageGallery.cs | 46 ++ sdk/dotnet/Compute/GetSharedImageVersion.cs | 50 ++ sdk/dotnet/Compute/GetSharedImageVersions.cs | 48 ++ sdk/dotnet/Compute/GetSnapshot.cs | 46 ++ sdk/dotnet/Compute/GetSshPublicKey.cs | 54 ++ sdk/dotnet/Compute/GetVirtualMachine.cs | 54 ++ .../Compute/GetVirtualMachineScaleSet.cs | 54 ++ .../Compute/Inputs/ScaleSetIdentityArgs.cs | 43 ++ .../Compute/Inputs/ScaleSetIdentityGetArgs.cs | 43 ++ sdk/dotnet/Compute/LinuxVirtualMachine.cs | 88 +++ .../Compute/LinuxVirtualMachineScaleSet.cs | 88 +++ sdk/dotnet/Compute/ManagedDisk.cs | 74 ++ sdk/dotnet/Compute/ManagedDiskSasToken.cs | 34 + .../OrchestratedVirtualMachineScaleSet.cs | 29 + .../Compute/Outputs/ScaleSetIdentity.cs | 43 ++ sdk/dotnet/Compute/PacketCapture.cs | 129 ++++ sdk/dotnet/Compute/ScaleSet.cs | 329 +++++++++ sdk/dotnet/Compute/ScaleSetPacketCapture.cs | 125 ++++ sdk/dotnet/Compute/SharedImage.cs | 44 ++ sdk/dotnet/Compute/SharedImageGallery.cs | 30 + sdk/dotnet/Compute/SharedImageVersion.cs | 44 ++ sdk/dotnet/Compute/Snapshot.cs | 35 + sdk/dotnet/Compute/SshPublicKey.cs | 21 + sdk/dotnet/Compute/VirtualMachine.cs | 95 +++ .../VirtualMachineScaleSetExtension.cs | 96 +++ sdk/dotnet/Compute/WindowsVirtualMachine.cs | 80 +++ .../Compute/WindowsVirtualMachineScaleSet.cs | 79 +++ sdk/dotnet/ConfidentialLedger/Ledger.cs | 36 + sdk/dotnet/Connections/ApiConnection.cs | 46 ++ sdk/dotnet/Connections/GetManagedApi.cs | 54 ++ .../Consumption/BudgetManagementGroup.cs | 87 +++ sdk/dotnet/Consumption/BudgetResourceGroup.cs | 96 +++ sdk/dotnet/Consumption/BudgetSubscription.cs | 98 +++ .../Consumption/GetBudgetResourceGroup.cs | 54 ++ .../Consumption/GetBudgetSubscription.cs | 54 ++ sdk/dotnet/ContainerApp/App.cs | 53 ++ sdk/dotnet/ContainerApp/Environment.cs | 33 + .../ContainerApp/EnvironmentDaprComponent.cs | 40 ++ sdk/dotnet/ContainerApp/EnvironmentStorage.cs | 56 ++ sdk/dotnet/ContainerApp/GetApp.cs | 46 ++ sdk/dotnet/ContainerApp/GetEnvironment.cs | 46 ++ .../ContainerApp/GetEnvironmentCertificate.cs | 58 ++ .../ClusterTrustedAccessRoleBinding.cs | 89 +++ .../ContainerService/ConnectedRegistry.cs | 57 ++ .../ContainerService/FluxConfiguration.cs | 66 ++ .../ContainerService/GetClusterNodePool.cs | 56 ++ sdk/dotnet/ContainerService/GetGroup.cs | 58 ++ .../ContainerService/GetKubernetesCluster.cs | 46 ++ .../GetKubernetesNodePoolSnapshot.cs | 46 ++ .../GetKubernetesServiceVersions.cs | 54 ++ sdk/dotnet/ContainerService/GetRegistry.cs | 54 ++ .../ContainerService/GetRegistryScopeMap.cs | 56 ++ .../ContainerService/GetRegistryToken.cs | 56 ++ sdk/dotnet/ContainerService/Group.cs | 58 ++ .../KubernetesClusterAciConnectorLinuxArgs.cs | 30 + ...bernetesClusterAciConnectorLinuxGetArgs.cs | 30 + .../ContainerService/KubernetesCluster.cs | 193 ++++++ .../KubernetesClusterExtension.cs | 41 ++ .../KubernetesClusterNodePool.cs | 49 ++ .../KubernetesFleetManager.cs | 23 + .../KubernetesClusterAciConnectorLinux.cs | 30 + sdk/dotnet/ContainerService/Registry.cs | 144 ++++ .../ContainerService/RegistryAgentPool.cs | 32 + .../ContainerService/RegistryScopeMap.cs | 46 ++ sdk/dotnet/ContainerService/RegistryTask.cs | 44 ++ .../RegistryTaskScheduleRunNow.cs | 49 ++ sdk/dotnet/ContainerService/RegistryToken.cs | 53 ++ .../ContainerService/RegistryWebhook.cs | 44 ++ sdk/dotnet/ContainerService/RegistryWebook.cs | 44 ++ sdk/dotnet/Core/CustomProvider.cs | 32 + sdk/dotnet/Core/GetClientConfig.cs | 46 ++ sdk/dotnet/Core/GetExtendedLocations.cs | 44 ++ sdk/dotnet/Core/GetResourceGroup.cs | 52 ++ sdk/dotnet/Core/GetSubscription.cs | 46 ++ sdk/dotnet/Core/GetSubscriptions.cs | 48 ++ sdk/dotnet/Core/GetTemplateSpecVersion.cs | 56 ++ sdk/dotnet/Core/GetUserAssignedIdentity.cs | 52 ++ sdk/dotnet/Core/PortalTenantConfiguration.cs | 18 + .../Core/ResourceDeploymentScriptAzureCli.cs | 50 ++ .../ResourceDeploymentScriptPowerShell.cs | 54 ++ sdk/dotnet/Core/ResourceGroup.cs | 18 + .../Core/ResourceGroupCostManagementExport.cs | 49 ++ .../Core/ResourceGroupCostManagementView.cs | 40 ++ .../Core/ResourceGroupPolicyAssignment.cs | 52 ++ .../Core/ResourceGroupPolicyExemption.cs | 47 ++ sdk/dotnet/Core/ResourcePolicyAssignment.cs | 44 ++ sdk/dotnet/Core/ResourcePolicyExemption.cs | 51 ++ .../Core/ResourceProviderRegistration.cs | 39 ++ sdk/dotnet/Core/Subscription.cs | 92 +++ .../Core/SubscriptionCostManagementExport.cs | 51 ++ .../Core/SubscriptionCostManagementView.cs | 35 + .../Core/SubscriptionPolicyAssignment.cs | 40 ++ .../Core/SubscriptionPolicyExemption.cs | 38 ++ .../Core/SubscriptionTemplateDeployment.cs | 35 + sdk/dotnet/Core/TemplateDeployment.cs | 89 +++ sdk/dotnet/Core/TenantTemplateDeployment.cs | 26 + sdk/dotnet/CosmosDB/Account.cs | 72 ++ sdk/dotnet/CosmosDB/CassandraCluster.cs | 75 ++ sdk/dotnet/CosmosDB/CassandraDatacenter.cs | 86 +++ sdk/dotnet/CosmosDB/CassandraKeyspace.cs | 51 ++ sdk/dotnet/CosmosDB/CassandraTable.cs | 79 +++ sdk/dotnet/CosmosDB/GetAccount.cs | 54 ++ sdk/dotnet/CosmosDB/GetMongoDatabase.cs | 56 ++ .../CosmosDB/GetRestorableDatabaseAccounts.cs | 54 ++ sdk/dotnet/CosmosDB/GetSqlDatabase.cs | 48 ++ sdk/dotnet/CosmosDB/GetSqlRoleDefinition.cs | 48 ++ sdk/dotnet/CosmosDB/GremlinDatabase.cs | 26 + sdk/dotnet/CosmosDB/GremlinGraph.cs | 65 ++ sdk/dotnet/CosmosDB/MongoCollection.cs | 46 ++ sdk/dotnet/CosmosDB/MongoDatabase.cs | 26 + sdk/dotnet/CosmosDB/MongoRoleDefinition.cs | 61 ++ sdk/dotnet/CosmosDB/MongoUserDefinition.cs | 62 ++ sdk/dotnet/CosmosDB/NotebookWorkspace.cs | 44 ++ sdk/dotnet/CosmosDB/PostgresqlCluster.cs | 28 + .../PostgresqlCoordinatorConfiguration.cs | 36 + sdk/dotnet/CosmosDB/PostgresqlFirewallRule.cs | 35 + .../CosmosDB/PostgresqlNodeConfiguration.cs | 36 + sdk/dotnet/CosmosDB/PostgresqlRole.cs | 34 + sdk/dotnet/CosmosDB/SqlContainer.cs | 68 ++ sdk/dotnet/CosmosDB/SqlDatabase.cs | 26 + sdk/dotnet/CosmosDB/SqlDedicatedGateway.cs | 45 ++ sdk/dotnet/CosmosDB/SqlFunction.cs | 40 ++ sdk/dotnet/CosmosDB/SqlRoleAssignment.cs | 70 ++ sdk/dotnet/CosmosDB/SqlRoleDefinition.cs | 61 ++ sdk/dotnet/CosmosDB/SqlStoredProcedure.cs | 44 ++ sdk/dotnet/CosmosDB/SqlTrigger.cs | 42 ++ sdk/dotnet/CosmosDB/Table.cs | 26 + sdk/dotnet/CostManagement/AnomalyAlert.cs | 23 + sdk/dotnet/CostManagement/ScheduledAction.cs | 29 + .../Dashboard/Azurerm_portal_dashboard.cs | 54 ++ sdk/dotnet/Dashboard/Dashboard.cs | 145 ++++ sdk/dotnet/Dashboard/Grafana.cs | 35 + sdk/dotnet/DataBricks/AccessConnector.cs | 32 + sdk/dotnet/DataBricks/GetWorkspace.cs | 54 ++ .../GetWorkspacePrivateEndpointConnection.cs | 54 ++ .../DataBricks/VirtualNetworkPeering.cs | 52 ++ sdk/dotnet/DataFactory/CustomDataset.cs | 115 ++++ sdk/dotnet/DataFactory/DataFlow.cs | 201 ++++++ sdk/dotnet/DataFactory/DatasetAzureBlob.cs | 44 ++ .../DataFactory/DatasetAzureSqlTable.cs | 36 + sdk/dotnet/DataFactory/DatasetBinary.cs | 45 ++ sdk/dotnet/DataFactory/DatasetCosmosDBApi.cs | 44 ++ .../DataFactory/DatasetDelimitedText.cs | 50 ++ sdk/dotnet/DataFactory/DatasetHttp.cs | 40 ++ sdk/dotnet/DataFactory/DatasetJson.cs | 44 ++ sdk/dotnet/DataFactory/DatasetMysql.cs | 36 + sdk/dotnet/DataFactory/DatasetParquet.cs | 43 ++ sdk/dotnet/DataFactory/DatasetPostgresql.cs | 36 + sdk/dotnet/DataFactory/DatasetSnowflake.cs | 38 ++ .../DataFactory/DatasetSqlServerTable.cs | 36 + sdk/dotnet/DataFactory/Factory.cs | 24 + sdk/dotnet/DataFactory/FlowletDataFlow.cs | 193 ++++++ sdk/dotnet/DataFactory/GetFactory.cs | 54 ++ .../DataFactory/IntegrationRuntimeManaged.cs | 31 + .../DataFactory/IntegrationRuntimeRule.cs | 30 + .../IntegrationRuntimeSelfHosted.cs | 29 + .../DataFactory/IntegrationRuntimeSsis.cs | 31 + sdk/dotnet/DataFactory/LinkedCustomService.cs | 59 ++ .../LinkedServiceAzureBlobStorage.cs | 99 +++ .../LinkedServiceAzureDatabricks.cs | 114 ++++ .../LinkedServiceAzureFileStorage.cs | 36 + .../DataFactory/LinkedServiceAzureFunction.cs | 37 + .../LinkedServiceAzureSqlDatabase.cs | 30 + .../LinkedServiceAzureTableStorage.cs | 36 + .../DataFactory/LinkedServiceCosmosDb.cs | 38 ++ .../LinkedServiceCosmosDbMongoApi.cs | 31 + .../LinkedServiceDataLakeStorageGen2.cs | 35 + .../DataFactory/LinkedServiceKeyVault.cs | 40 ++ sdk/dotnet/DataFactory/LinkedServiceKusto.cs | 65 ++ sdk/dotnet/DataFactory/LinkedServiceMysql.cs | 30 + sdk/dotnet/DataFactory/LinkedServiceOdata.cs | 41 ++ sdk/dotnet/DataFactory/LinkedServiceOdbc.cs | 41 ++ .../DataFactory/LinkedServicePostgresql.cs | 30 + sdk/dotnet/DataFactory/LinkedServiceSftp.cs | 34 + .../DataFactory/LinkedServiceSnowflake.cs | 80 +++ .../DataFactory/LinkedServiceSqlServer.cs | 80 +++ .../DataFactory/LinkedServiceSynapse.cs | 80 +++ sdk/dotnet/DataFactory/LinkedServiceWeb.cs | 31 + .../DataFactory/ManagedPrivateEndpoint.cs | 41 ++ sdk/dotnet/DataFactory/Pipeline.cs | 63 ++ sdk/dotnet/DataFactory/TriggerBlobEvent.cs | 74 ++ sdk/dotnet/DataFactory/TriggerCustomEvent.cs | 71 ++ sdk/dotnet/DataFactory/TriggerSchedule.cs | 37 + .../DataFactory/TriggerTumblingWindow.cs | 72 ++ .../BackupInstanceBlogStorage.cs | 65 ++ .../DataProtection/BackupInstanceDisk.cs | 72 ++ .../BackupInstancePostgresql.cs | 150 ++++ .../DataProtection/BackupPolicyBlobStorage.cs | 32 + sdk/dotnet/DataProtection/BackupPolicyDisk.cs | 59 ++ .../DataProtection/BackupPolicyPostgresql.cs | 89 +++ sdk/dotnet/DataProtection/BackupVault.cs | 26 + sdk/dotnet/DataProtection/GetBackupVault.cs | 56 ++ sdk/dotnet/DataProtection/ResourceGuard.cs | 24 + sdk/dotnet/DataShare/Account.cs | 32 + sdk/dotnet/DataShare/DatasetBlobStorage.cs | 80 +++ sdk/dotnet/DataShare/DatasetDataLakeGen2.cs | 75 ++ sdk/dotnet/DataShare/DatasetKustoCluster.cs | 64 ++ sdk/dotnet/DataShare/DatasetKustoDatabase.cs | 71 ++ sdk/dotnet/DataShare/GetAccount.cs | 54 ++ sdk/dotnet/DataShare/GetDatasetBlobStorage.cs | 54 ++ .../DataShare/GetDatasetDataLakeGen2.cs | 54 ++ .../DataShare/GetDatasetKustoCluster.cs | 54 ++ .../DataShare/GetDatasetKustoDatabase.cs | 54 ++ sdk/dotnet/DataShare/GetShare.cs | 66 ++ sdk/dotnet/DataShare/Share.cs | 46 ++ sdk/dotnet/DatabaseMigration/GetProject.cs | 56 ++ sdk/dotnet/DatabaseMigration/GetService.cs | 54 ++ sdk/dotnet/DatabaseMigration/Project.cs | 55 ++ sdk/dotnet/DatabaseMigration/Service.cs | 46 ++ sdk/dotnet/DataboxEdge/Device.cs | 25 + sdk/dotnet/DataboxEdge/GetDevice.cs | 46 ++ sdk/dotnet/DataboxEdge/Order.cs | 52 ++ sdk/dotnet/Datadog/Monitor.cs | 65 ++ sdk/dotnet/Datadog/MonitorSsoConfiguration.cs | 44 ++ sdk/dotnet/Datadog/MonitorTagRule.cs | 64 ++ .../DesktopVirtualization/Application.cs | 58 ++ .../DesktopVirtualization/ApplicationGroup.cs | 55 ++ .../DesktopVirtualization/GetHostPool.cs | 46 ++ .../GetHostPoolRegistrationInfo.cs | 33 + sdk/dotnet/DesktopVirtualization/HostPool.cs | 44 ++ .../DesktopVirtualization/ScalingPlan.cs | 127 ++++ sdk/dotnet/DesktopVirtualization/Workspace.cs | 26 + .../WorkspaceApplicationGroupAssociation.cs | 46 ++ sdk/dotnet/DevCenter/DevCenter.cs | 29 + sdk/dotnet/DevCenter/Project.cs | 35 + sdk/dotnet/DevTest/GetLab.cs | 54 ++ sdk/dotnet/DevTest/GetVirtualNetwork.cs | 56 ++ .../DevTest/GlobalVMShutdownSchedule.cs | 95 +++ sdk/dotnet/DevTest/Lab.cs | 28 + sdk/dotnet/DevTest/LinuxVirtualMachine.cs | 61 ++ sdk/dotnet/DevTest/Policy.cs | 42 ++ sdk/dotnet/DevTest/Schedule.cs | 47 ++ sdk/dotnet/DevTest/VirtualNetwork.cs | 39 ++ sdk/dotnet/DevTest/WindowsVirtualMachine.cs | 60 ++ sdk/dotnet/DigitalTwins/EndpointEventGrid.cs | 38 ++ sdk/dotnet/DigitalTwins/EndpointEventHub.cs | 56 ++ sdk/dotnet/DigitalTwins/EndpointServicebus.cs | 51 ++ sdk/dotnet/DigitalTwins/GetInstance.cs | 54 ++ sdk/dotnet/DigitalTwins/Instance.cs | 28 + .../TimeSeriesDatabaseConnection.cs | 114 ++++ sdk/dotnet/Dns/ARecord.cs | 72 ++ sdk/dotnet/Dns/AaaaRecord.cs | 72 ++ sdk/dotnet/Dns/CNameRecord.cs | 69 ++ sdk/dotnet/Dns/CaaRecord.cs | 61 ++ sdk/dotnet/Dns/GetAAAARecord.cs | 56 ++ sdk/dotnet/Dns/GetARecord.cs | 58 ++ sdk/dotnet/Dns/GetCAARecord.cs | 56 ++ sdk/dotnet/Dns/GetCnameRecord.cs | 56 ++ sdk/dotnet/Dns/GetMxRecord.cs | 56 ++ sdk/dotnet/Dns/GetNsRecord.cs | 56 ++ sdk/dotnet/Dns/GetPtrRecord.cs | 56 ++ sdk/dotnet/Dns/GetSrvRecord.cs | 56 ++ sdk/dotnet/Dns/GetTxtRecord.cs | 56 ++ sdk/dotnet/Dns/GetZone.cs | 54 ++ sdk/dotnet/Dns/MxRecord.cs | 47 ++ sdk/dotnet/Dns/NsRecord.cs | 39 ++ sdk/dotnet/Dns/PtrRecord.cs | 34 + sdk/dotnet/Dns/SrvRecord.cs | 44 ++ sdk/dotnet/Dns/TxtRecord.cs | 45 ++ sdk/dotnet/Dns/Zone.cs | 23 + sdk/dotnet/DomainServices/GetService.cs | 46 ++ sdk/dotnet/DomainServices/ReplicaSet.cs | 304 +++++++++ sdk/dotnet/DomainServices/Service.cs | 172 +++++ sdk/dotnet/DomainServices/ServiceTrust.cs | 31 + sdk/dotnet/ElasticCloud/Elasticsearch.cs | 26 + sdk/dotnet/ElasticCloud/GetElasticsearch.cs | 56 ++ sdk/dotnet/EventGrid/Domain.cs | 28 + sdk/dotnet/EventGrid/DomainTopic.cs | 34 + sdk/dotnet/EventGrid/EventSubscription.cs | 45 ++ sdk/dotnet/EventGrid/GetDomain.cs | 54 ++ sdk/dotnet/EventGrid/GetDomainTopic.cs | 46 ++ sdk/dotnet/EventGrid/GetSystemTopic.cs | 46 ++ sdk/dotnet/EventGrid/GetTopic.cs | 46 ++ sdk/dotnet/EventGrid/SystemTopic.cs | 38 ++ .../EventGrid/SystemTopicEventSubscription.cs | 54 ++ sdk/dotnet/EventGrid/Topic.cs | 28 + sdk/dotnet/EventHub/AuthorizationRule.cs | 48 ++ sdk/dotnet/EventHub/Cluster.cs | 25 + sdk/dotnet/EventHub/ConsumerGroup.cs | 46 ++ sdk/dotnet/EventHub/Domain.cs | 28 + sdk/dotnet/EventHub/EventGridTopic.cs | 28 + sdk/dotnet/EventHub/EventHub.cs | 38 ++ .../EventHub/EventHubAuthorizationRule.cs | 48 ++ sdk/dotnet/EventHub/EventHubConsumerGroup.cs | 46 ++ sdk/dotnet/EventHub/EventHubNamespace.cs | 30 + .../EventHubNamespaceAuthorizationRule.cs | 39 ++ sdk/dotnet/EventHub/EventSubscription.cs | 45 ++ ...EventhubNamespaceDisasterRecoveryConfig.cs | 39 ++ sdk/dotnet/EventHub/GetAuthorizationRule.cs | 50 ++ sdk/dotnet/EventHub/GetCluster.cs | 54 ++ sdk/dotnet/EventHub/GetConsumeGroup.cs | 50 ++ sdk/dotnet/EventHub/GetEventHub.cs | 56 ++ sdk/dotnet/EventHub/GetEventhubNamespace.cs | 54 ++ sdk/dotnet/EventHub/GetNamespace.cs | 54 ++ .../EventHub/GetNamespaceAuthorizationRule.cs | 56 ++ sdk/dotnet/EventHub/GetServiceBusNamespace.cs | 54 ++ sdk/dotnet/EventHub/Namespace.cs | 29 + .../EventHub/NamespaceAuthorizationRule.cs | 37 + .../EventHub/NamespaceCustomerManagedKey.cs | 110 +++ sdk/dotnet/EventHub/NamespaceSchemaGroup.cs | 32 + sdk/dotnet/EventHub/Queue.cs | 35 + sdk/dotnet/EventHub/QueueAuthorizationRule.cs | 43 ++ sdk/dotnet/EventHub/Subscription.cs | 41 ++ sdk/dotnet/EventHub/SubscriptionRule.cs | 102 +++ sdk/dotnet/EventHub/Topic.cs | 35 + sdk/dotnet/EventHub/TopicAuthorizationRule.cs | 42 ++ sdk/dotnet/FluidRelay/Server.cs | 24 + sdk/dotnet/FrontDoor/FirewallPolicy.cs | 162 +++++ sdk/dotnet/FrontDoor/Frontdoor.cs | 89 +++ sdk/dotnet/FrontDoor/RulesEngine.cs | 146 ++++ sdk/dotnet/Graph/Account.cs | 34 + sdk/dotnet/Graph/ServicesAccount.cs | 34 + sdk/dotnet/HDInsight/GetCluster.cs | 54 ++ sdk/dotnet/HDInsight/HBaseCluster.cs | 80 +++ sdk/dotnet/HDInsight/HadoopCluster.cs | 80 +++ .../HDInsight/InteractiveQueryCluster.cs | 80 +++ sdk/dotnet/HDInsight/KafkaCluster.cs | 81 +++ sdk/dotnet/HDInsight/SparkCluster.cs | 80 +++ sdk/dotnet/Healthcare/DicomService.cs | 33 + sdk/dotnet/Healthcare/FhirService.cs | 72 ++ sdk/dotnet/Healthcare/GetDicomService.cs | 54 ++ sdk/dotnet/Healthcare/GetMedtechService.cs | 54 ++ sdk/dotnet/Healthcare/GetService.cs | 56 ++ sdk/dotnet/Healthcare/GetWorkspace.cs | 54 ++ sdk/dotnet/Healthcare/MedtechService.cs | 65 ++ .../MedtechServiceFhirDestination.cs | 116 ++++ sdk/dotnet/Healthcare/Service.cs | 55 ++ sdk/dotnet/Healthcare/Workspace.cs | 19 + sdk/dotnet/Hpc/Cache.cs | 47 ++ sdk/dotnet/Hpc/CacheAccessPolicy.cs | 60 ++ sdk/dotnet/Hpc/CacheBlobTarget.cs | 88 +++ sdk/dotnet/Hsm/Module.cs | 133 ++++ sdk/dotnet/Hybrid/GetComputeMachine.cs | 54 ++ sdk/dotnet/Iot/Certificate.cs | 43 ++ sdk/dotnet/Iot/ConsumerGroup.cs | 40 ++ sdk/dotnet/Iot/DpsSharedAccessPolicy.cs | 37 + sdk/dotnet/Iot/EndpointCosmosdbAccount.cs | 78 +++ sdk/dotnet/Iot/EndpointEventhub.cs | 65 ++ sdk/dotnet/Iot/EndpointServicebusQueue.cs | 61 ++ sdk/dotnet/Iot/EndpointServicebusTopic.cs | 60 ++ sdk/dotnet/Iot/EndpointStorageContainer.cs | 55 ++ sdk/dotnet/Iot/FileUpload.cs | 50 ++ sdk/dotnet/Iot/GetDps.cs | 46 ++ sdk/dotnet/Iot/GetDpsSharedAccessPolicy.cs | 48 ++ sdk/dotnet/Iot/GetIotHub.cs | 54 ++ sdk/dotnet/Iot/GetSharedAccessPolicy.cs | 48 ++ sdk/dotnet/Iot/IoTHub.cs | 143 ++++ sdk/dotnet/Iot/IotHubCertificate.cs | 42 ++ sdk/dotnet/Iot/IotHubDeviceUpdateAccount.cs | 32 + sdk/dotnet/Iot/IotHubDeviceUpdateInstance.cs | 59 ++ sdk/dotnet/Iot/IotHubDps.cs | 30 + sdk/dotnet/Iot/SecurityDeviceGroup.cs | 68 ++ sdk/dotnet/Iot/SecuritySolution.cs | 40 ++ sdk/dotnet/Iot/SharedAccessPolicy.cs | 37 + .../Iot/TimeSeriesInsightsAccessPolicy.cs | 36 + .../TimeSeriesInsightsEventSourceEventhub.cs | 86 +++ .../TimeSeriesInsightsEventSourceIothub.cs | 71 ++ .../Iot/TimeSeriesInsightsGen2Environment.cs | 43 ++ .../Iot/TimeSeriesInsightsReferenceDataSet.cs | 40 ++ .../TimeSeriesInsightsStandardEnvironment.cs | 26 + sdk/dotnet/IotCentral/Application.cs | 32 + .../IotCentral/ApplicationNetworkRuleSet.cs | 49 ++ sdk/dotnet/KeyVault/AccessPolicy.cs | 63 ++ sdk/dotnet/KeyVault/Certifiate.cs | 243 +++++++ sdk/dotnet/KeyVault/Certificate.cs | 243 +++++++ sdk/dotnet/KeyVault/CertificateContacts.cs | 71 ++ sdk/dotnet/KeyVault/CertificateIssuer.cs | 37 + sdk/dotnet/KeyVault/GetAccessPolicy.cs | 52 ++ sdk/dotnet/KeyVault/GetCertificate.cs | 66 ++ sdk/dotnet/KeyVault/GetCertificateData.cs | 66 ++ sdk/dotnet/KeyVault/GetCertificateIssuer.cs | 66 ++ sdk/dotnet/KeyVault/GetKey.cs | 54 ++ sdk/dotnet/KeyVault/GetKeyVault.cs | 54 ++ .../GetManagedHardwareSecurityModule.cs | 54 ++ sdk/dotnet/KeyVault/GetSecret.cs | 54 ++ .../Inputs/CertifiateCertificateArgs.cs | 9 + .../Inputs/CertifiateCertificateGetArgs.cs | 9 + .../Inputs/CertificateCertificateArgs.cs | 9 + .../Inputs/CertificateCertificateGetArgs.cs | 9 + sdk/dotnet/KeyVault/Key.cs | 76 +++ sdk/dotnet/KeyVault/KeyVault.cs | 51 ++ .../KeyVault/ManagedHardwareSecurityModule.cs | 38 ++ sdk/dotnet/KeyVault/ManagedStorageAccount.cs | 156 +++++ ...ManagedStorageAccountSasTokenDefinition.cs | 111 +++ .../KeyVault/Outputs/CertifiateCertificate.cs | 9 + .../Outputs/CertificateCertificate.cs | 9 + sdk/dotnet/KeyVault/Secret.cs | 55 ++ .../Kusto/AttachedDatabaseConfiguration.cs | 90 +++ sdk/dotnet/Kusto/Cluster.cs | 33 + sdk/dotnet/Kusto/ClusterCustomerManagedKey.cs | 104 +++ .../Kusto/ClusterManagedPrivateEndpoint.cs | 49 ++ .../Kusto/ClusterPrincipalAssignment.cs | 41 ++ sdk/dotnet/Kusto/CosmosdbDataConnection.cs | 133 ++++ sdk/dotnet/Kusto/Database.cs | 38 ++ .../Kusto/DatabasePrincipalAssignment.cs | 51 ++ sdk/dotnet/Kusto/EventGridDataConnection.cs | 105 +++ sdk/dotnet/Kusto/EventhubDataConnection.cs | 74 ++ sdk/dotnet/Kusto/GetCluster.cs | 46 ++ sdk/dotnet/Kusto/GetDatabase.cs | 48 ++ sdk/dotnet/Kusto/IotHubDataConnection.cs | 83 +++ sdk/dotnet/Kusto/Script.cs | 85 +++ sdk/dotnet/Lab/Lab.cs | 49 ++ sdk/dotnet/Lab/Schedule.cs | 56 ++ sdk/dotnet/Lab/ServicePlan.cs | 28 + sdk/dotnet/Lab/User.cs | 55 ++ sdk/dotnet/Lb/BackendAddressPool.cs | 44 ++ sdk/dotnet/Lb/BackendAddressPoolAddress.cs | 56 ++ sdk/dotnet/Lb/GetBackendAddressPool.cs | 68 ++ sdk/dotnet/Lb/GetLB.cs | 54 ++ sdk/dotnet/Lb/GetLBOutboundRule.cs | 54 ++ sdk/dotnet/Lb/LoadBalancer.cs | 39 ++ sdk/dotnet/Lb/NatPool.cs | 50 ++ sdk/dotnet/Lb/OutboundRule.cs | 58 ++ sdk/dotnet/Lb/Probe.cs | 45 ++ sdk/dotnet/Lb/Rule.cs | 48 ++ sdk/dotnet/Lighthouse/Assignment.cs | 21 + sdk/dotnet/Lighthouse/Definition.cs | 34 + sdk/dotnet/LoadTest/LoadTest.cs | 29 + sdk/dotnet/LogAnalytics/Cluster.cs | 28 + .../LogAnalytics/ClusterCustomerManagedKey.cs | 93 +++ sdk/dotnet/LogAnalytics/DataExportRule.cs | 46 ++ .../LogAnalytics/DataSourceWindowsEvent.cs | 36 + .../DataSourceWindowsPerformanceCounter.cs | 35 + sdk/dotnet/LogAnalytics/LinkedService.cs | 44 ++ .../LogAnalytics/LinkedStorageAccount.cs | 44 ++ sdk/dotnet/LogAnalytics/QueryPack.cs | 24 + sdk/dotnet/LogAnalytics/SavedSearch.cs | 34 + sdk/dotnet/LogAnalytics/StorageInsights.cs | 42 ++ sdk/dotnet/LogicApps/ActionCustom.cs | 44 ++ sdk/dotnet/LogicApps/ActionHttp.cs | 31 + sdk/dotnet/LogicApps/GetIntegrationAccount.cs | 54 ++ sdk/dotnet/LogicApps/GetStandard.cs | 54 ++ sdk/dotnet/LogicApps/GetWorkflow.cs | 54 ++ sdk/dotnet/LogicApps/IntegrationAccount.cs | 29 + .../LogicApps/IntegrationAccountAgreement.cs | 74 ++ .../LogicApps/IntegrationAccountAssembly.cs | 39 ++ .../IntegrationAccountBatchConfiguration.cs | 36 + .../IntegrationAccountCertificate.cs | 32 + sdk/dotnet/LogicApps/IntegrationAccountMap.cs | 34 + .../LogicApps/IntegrationAccountPartner.cs | 39 ++ .../LogicApps/IntegrationAccountSchema.cs | 33 + .../LogicApps/IntegrationAccountSession.cs | 35 + .../LogicApps/InterationServiceEnvironment.cs | 98 +++ sdk/dotnet/LogicApps/Standard.cs | 110 +++ sdk/dotnet/LogicApps/TriggerCustom.cs | 37 + sdk/dotnet/LogicApps/TriggerHttpRequest.cs | 38 ++ sdk/dotnet/LogicApps/TriggerRecurrence.cs | 31 + sdk/dotnet/LogicApps/Workflow.cs | 24 + sdk/dotnet/MSSql/Database.cs | 50 ++ .../MSSql/DatabaseExtendedAuditingPolicy.cs | 49 ++ ...baseVulnerabilityAssessmentRuleBaseline.cs | 97 +++ sdk/dotnet/MSSql/ElasticPool.cs | 48 ++ sdk/dotnet/MSSql/FailoverGroup.cs | 70 ++ sdk/dotnet/MSSql/FirewallRule.cs | 34 + sdk/dotnet/MSSql/GetDatabase.cs | 82 +++ sdk/dotnet/MSSql/GetElasticPool.cs | 56 ++ sdk/dotnet/MSSql/GetManagedInstance.cs | 46 ++ sdk/dotnet/MSSql/GetServer.cs | 54 ++ sdk/dotnet/MSSql/JobAgent.cs | 40 ++ sdk/dotnet/MSSql/JobCredential.cs | 47 ++ sdk/dotnet/MSSql/ManagedDatabase.cs | 56 ++ sdk/dotnet/MSSql/ManagedInstance.cs | 230 +++++++ ...gedInstanceActiveDirectoryAdministrator.cs | 85 +++ .../ManagedInstanceSecurityAlertPolicy.cs | 245 +++++++ ...anagedInstanceTransparentDataEncryption.cs | 215 ++++++ .../ManagedInstanceVulnerabilityAssessment.cs | 103 +++ sdk/dotnet/MSSql/OutboundFirewallRule.cs | 33 + sdk/dotnet/MSSql/Server.cs | 147 ++++ sdk/dotnet/MSSql/ServerDnsAlias.cs | 32 + .../MSSql/ServerExtendedAuditingPolicy.cs | 173 +++++ .../ServerMicrosoftSupportAuditingPolicy.cs | 169 +++++ sdk/dotnet/MSSql/ServerSecurityAlertPolicy.cs | 50 ++ .../MSSql/ServerTransparentDataEncryption.cs | 149 ++++ .../MSSql/ServerVulnerabilityAssessment.cs | 70 ++ sdk/dotnet/MSSql/VirtualMachine.cs | 38 ++ sdk/dotnet/MSSql/VirtualMachineGroup.cs | 31 + sdk/dotnet/MSSql/VirtualNetworkRule.cs | 57 ++ sdk/dotnet/MachineLearning/ComputeCluster.cs | 100 +++ sdk/dotnet/MachineLearning/ComputeInstance.cs | 101 +++ .../MachineLearning/DatastoreBlobstorage.cs | 68 ++ .../MachineLearning/DatastoreDatalakeGen2.cs | 68 ++ sdk/dotnet/MachineLearning/GetWorkspace.cs | 54 ++ .../MachineLearning/InferenceCluster.cs | 112 +++ sdk/dotnet/MachineLearning/SynapseSpark.cs | 98 +++ sdk/dotnet/MachineLearning/Workspace.cs | 361 ++++++++++ .../Maintenance/AssignmentDedicatedHost.cs | 47 ++ .../Maintenance/AssignmentVirtualMachine.cs | 100 +++ .../AssignmentVirtualMachineScaleSet.cs | 199 ++++++ sdk/dotnet/Maintenance/Configuration.cs | 29 + sdk/dotnet/Maintenance/GetConfiguration.cs | 54 ++ .../Maintenance/GetPublicConfigurations.cs | 56 ++ sdk/dotnet/ManagedApplication/Application.cs | 73 ++ sdk/dotnet/ManagedApplication/Definition.cs | 38 ++ .../ManagedApplication/GetDefinition.cs | 54 ++ sdk/dotnet/Management/GetGroup.cs | 52 ++ sdk/dotnet/Management/Group.cs | 35 + .../Management/GroupPolicyAssignment.cs | 44 ++ sdk/dotnet/Management/GroupPolicyExemption.cs | 41 ++ .../GroupSubscriptionAssociation.cs | 29 + .../Management/GroupTemplateDeployment.cs | 120 ++++ sdk/dotnet/Management/Lock.cs | 77 +++ sdk/dotnet/Management/PrivateLink.cs | 24 + .../ManagementGroups/GetManagementGroup.cs | 52 ++ .../ManagementGroups/ManagementGroup.cs | 35 + .../ManagementResource/ManangementLock.cs | 77 +++ sdk/dotnet/Maps/Account.cs | 29 + sdk/dotnet/Maps/Creator.cs | 39 ++ sdk/dotnet/Maps/GetAccount.cs | 54 ++ sdk/dotnet/MariaDB/Configuration.cs | 37 + sdk/dotnet/MariaDB/Database.cs | 40 ++ sdk/dotnet/MariaDB/FirewallRule.cs | 40 ++ sdk/dotnet/MariaDB/GetMariaDbServer.cs | 54 ++ sdk/dotnet/MariaDB/Server.cs | 35 + sdk/dotnet/MariaDB/VirtualNetworkRule.cs | 60 ++ sdk/dotnet/Marketplace/Agreement.cs | 20 + sdk/dotnet/Marketplace/GetAgreement.cs | 56 ++ sdk/dotnet/Media/AccountFilter.cs | 101 +++ sdk/dotnet/Media/Asset.cs | 47 ++ sdk/dotnet/Media/AssetFilter.cs | 107 +++ sdk/dotnet/Media/ContentKeyPolicy.cs | 149 ++++ sdk/dotnet/Media/Job.cs | 93 +++ sdk/dotnet/Media/LiveEvent.cs | 90 +++ sdk/dotnet/Media/LiveEventOutput.cs | 80 +++ sdk/dotnet/Media/ServiceAccount.cs | 40 ++ sdk/dotnet/Media/StreamingEndpoint.cs | 126 ++++ sdk/dotnet/Media/StreamingLocator.cs | 65 ++ sdk/dotnet/Media/StreamingPolicy.cs | 119 ++++ sdk/dotnet/Media/Transform.cs | 450 ++++++++++++ sdk/dotnet/MediaServices/Account.cs | 40 ++ .../MixedReality/GetSpatialAnchorsAccount.cs | 54 ++ .../MixedReality/SpatialAnchorsAccount.cs | 24 + sdk/dotnet/Mobile/GetNetwork.cs | 46 ++ .../Mobile/GetNetworkAttachedDataNetwork.cs | 58 ++ sdk/dotnet/Mobile/GetNetworkDataNetwork.cs | 58 ++ .../GetNetworkPacketCoreControlPlane.cs | 46 ++ .../Mobile/GetNetworkPacketCoreDataPlane.cs | 58 ++ sdk/dotnet/Mobile/GetNetworkService.cs | 56 ++ sdk/dotnet/Mobile/GetNetworkSimGroup.cs | 58 ++ sdk/dotnet/Mobile/GetNetworkSimPolicy.cs | 58 ++ sdk/dotnet/Mobile/GetNetworkSite.cs | 58 ++ sdk/dotnet/Mobile/GetNetworkSlice.cs | 58 ++ sdk/dotnet/Mobile/Network.cs | 30 + sdk/dotnet/Mobile/NetworkDataNetwork.cs | 37 + .../Mobile/NetworkPacketCoreControlPlane.cs | 72 ++ sdk/dotnet/Mobile/NetworkService.cs | 92 +++ sdk/dotnet/Mobile/NetworkSim.cs | 83 +++ sdk/dotnet/Mobile/NetworkSimGroup.cs | 63 ++ sdk/dotnet/Mobile/NetworkSimPolicy.cs | 121 ++++ sdk/dotnet/Mobile/NetworkSite.cs | 43 ++ sdk/dotnet/Mobile/NetworkSlice.cs | 41 ++ sdk/dotnet/Monitoring/AadDiagnosticSetting.cs | 71 ++ sdk/dotnet/Monitoring/ActionGroup.cs | 151 ++++ .../Monitoring/ActionRuleActionGroup.cs | 42 ++ .../Monitoring/ActionRuleSuppression.cs | 51 ++ sdk/dotnet/Monitoring/ActivityLogAlert.cs | 67 ++ .../AlertProcessingRuleActionGroup.cs | 90 +++ .../AlertProcessingRuleSuppression.cs | 80 +++ sdk/dotnet/Monitoring/AutoscaleSetting.cs | 348 ++++++++++ .../Monitoring/DataCollectionEndpoint.cs | 31 + sdk/dotnet/Monitoring/DataCollectionRule.cs | 314 +++++++++ .../DataCollectionRuleAssociation.cs | 128 ++++ sdk/dotnet/Monitoring/DiagnosticSetting.cs | 66 ++ sdk/dotnet/Monitoring/GetActionGroup.cs | 54 ++ .../Monitoring/GetDataCollectionEndpoint.cs | 54 ++ .../Monitoring/GetDataCollectionRule.cs | 54 ++ .../Monitoring/GetDiagnosticCategories.cs | 56 ++ sdk/dotnet/Monitoring/GetLogProfile.cs | 52 ++ .../Monitoring/GetScheduledQueryRulesAlert.cs | 54 ++ .../Monitoring/GetScheduledQueryRulesLog.cs | 54 ++ sdk/dotnet/Monitoring/LogProfile.cs | 56 ++ sdk/dotnet/Monitoring/LogzMonitor.cs | 37 + sdk/dotnet/Monitoring/LogzSubAccount.cs | 49 ++ .../Monitoring/LogzSubAccountTagRule.cs | 72 ++ sdk/dotnet/Monitoring/LogzTagRule.cs | 60 ++ sdk/dotnet/Monitoring/MetricAlert.cs | 80 +++ sdk/dotnet/Monitoring/PrivateLinkScope.cs | 23 + .../Monitoring/PrivateLinkScopedService.cs | 37 + .../Monitoring/ScheduledQueryRulesLog.cs | 101 +++ .../Monitoring/SmartDetectorAlertRule.cs | 50 ++ sdk/dotnet/Monitoring/Workspace.cs | 28 + sdk/dotnet/Msi/UserAssignedIdentity.cs | 24 + .../MySql/ActiveDirectoryAdministrator.cs | 41 ++ sdk/dotnet/MySql/Configuration.cs | 44 ++ sdk/dotnet/MySql/Database.cs | 44 ++ sdk/dotnet/MySql/FirewallRule.cs | 90 +++ sdk/dotnet/MySql/FlexibleDatabase.cs | 35 + sdk/dotnet/MySql/FlexibleServer.cs | 87 +++ .../MySql/FlexibleServerConfiguration.cs | 34 + .../MySql/FlexibleServerFirewallRule.cs | 93 +++ sdk/dotnet/MySql/GetFlexibleServer.cs | 54 ++ sdk/dotnet/MySql/GetServer.cs | 54 ++ sdk/dotnet/MySql/Server.cs | 36 + sdk/dotnet/MySql/ServerKey.cs | 120 ++++ sdk/dotnet/MySql/VirtualNetworkRule.cs | 63 ++ sdk/dotnet/NetApp/Account.cs | 36 + sdk/dotnet/NetApp/GetAccount.cs | 46 ++ sdk/dotnet/NetApp/GetPool.cs | 48 ++ sdk/dotnet/NetApp/GetSnapshot.cs | 52 ++ sdk/dotnet/NetApp/GetSnapshotPolicy.cs | 60 ++ sdk/dotnet/NetApp/GetVolume.cs | 50 ++ sdk/dotnet/NetApp/GetVolumeGroupSapHana.cs | 56 ++ sdk/dotnet/NetApp/GetVolumeQuotaRule.cs | 54 ++ sdk/dotnet/NetApp/Pool.cs | 33 + sdk/dotnet/NetApp/Snapshot.cs | 90 +++ sdk/dotnet/NetApp/SnapshotPolicy.cs | 67 ++ sdk/dotnet/NetApp/VolumeQuotaRule.cs | 123 ++++ sdk/dotnet/Network/ApplicationGateway.cs | 146 ++++ .../Network/ApplicationSecurityGroup.cs | 28 + sdk/dotnet/Network/BgpConnection.cs | 75 ++ sdk/dotnet/Network/DdosProtectionPlan.cs | 24 + sdk/dotnet/Network/ExpressRouteCircuit.cs | 36 + .../ExpressRouteCircuitAuthorization.cs | 43 ++ .../Network/ExpressRouteCircuitConnection.cs | 94 +++ .../Network/ExpressRouteCircuitPeering.cs | 122 ++++ sdk/dotnet/Network/ExpressRouteConnection.cs | 80 +++ sdk/dotnet/Network/ExpressRouteGateway.cs | 44 ++ sdk/dotnet/Network/ExpressRoutePort.cs | 27 + .../Network/ExpressRoutePortAuthorization.cs | 33 + sdk/dotnet/Network/Firewall.cs | 63 ++ .../FirewallApplicationRuleCollection.cs | 94 +++ .../Network/FirewallNatRuleCollection.cs | 97 +++ .../Network/FirewallNetworkRuleCollection.cs | 96 +++ sdk/dotnet/Network/FirewallPolicy.cs | 24 + sdk/dotnet/Network/GetApplicationGateway.cs | 54 ++ .../Network/GetApplicationSecurityGroup.cs | 54 ++ sdk/dotnet/Network/GetExpressRouteCircuit.cs | 56 ++ sdk/dotnet/Network/GetFirewall.cs | 54 ++ sdk/dotnet/Network/GetFirewallPolicy.cs | 54 ++ sdk/dotnet/Network/GetGatewayConnection.cs | 54 ++ sdk/dotnet/Network/GetIpGroup.cs | 54 ++ sdk/dotnet/Network/GetLocalNetworkGateway.cs | 54 ++ .../Network/GetNetworkDdosProtectionPlan.cs | 54 ++ sdk/dotnet/Network/GetNetworkInterface.cs | 54 ++ sdk/dotnet/Network/GetNetworkSecurityGroup.cs | 54 ++ sdk/dotnet/Network/GetNetworkWatcher.cs | 54 ++ sdk/dotnet/Network/GetPublicIP.cs | 230 +++++++ sdk/dotnet/Network/GetPublicIPs.cs | 46 ++ sdk/dotnet/Network/GetPublicIpPrefix.cs | 48 ++ sdk/dotnet/Network/GetRouteFilter.cs | 54 ++ sdk/dotnet/Network/GetRouteTable.cs | 46 ++ sdk/dotnet/Network/GetServiceTags.cs | 58 ++ sdk/dotnet/Network/GetSubnet.cs | 56 ++ sdk/dotnet/Network/GetTrafficManager.cs | 46 ++ .../Network/GetTrafficManagerProfile.cs | 54 ++ sdk/dotnet/Network/GetVirtualHub.cs | 46 ++ sdk/dotnet/Network/GetVirtualHubConnection.cs | 48 ++ sdk/dotnet/Network/GetVirtualHubRouteTable.cs | 48 ++ sdk/dotnet/Network/GetVirtualNetwork.cs | 54 ++ .../Network/GetVirtualNetworkGateway.cs | 54 ++ sdk/dotnet/Network/GetVpnGateway.cs | 54 ++ sdk/dotnet/Network/IPGroup.cs | 34 + sdk/dotnet/Network/IPGroupCIDR.cs | 30 + ...tionGatewayPrivateLinkConfigurationArgs.cs | 10 + ...nGatewayPrivateLinkConfigurationGetArgs.cs | 10 + sdk/dotnet/Network/LocalNetworkGateway.cs | 29 + sdk/dotnet/Network/NatGateway.cs | 32 + .../Network/NatGatewayPublicIpAssociation.cs | 39 ++ .../NatGatewayPublicIpPrefixAssociation.cs | 42 ++ .../Network/NetworkConnectionMonitor.cs | 184 +++++ sdk/dotnet/Network/NetworkInterface.cs | 53 ++ ...faceApplicationSecurityGroupAssociation.cs | 65 ++ ...kInterfaceBackendAddressPoolAssociation.cs | 86 +++ .../NetworkInterfaceNatRuleAssociation.cs | 91 +++ ...etworkInterfaceSecurityGroupAssociation.cs | 65 ++ sdk/dotnet/Network/NetworkManager.cs | 43 ++ sdk/dotnet/Network/NetworkManagerAdminRule.cs | 98 +++ .../NetworkManagerAdminRuleCollection.cs | 58 ++ ...NetworkManagerConnectivityConfiguration.cs | 74 ++ .../Network/NetworkManagerDeployment.cs | 85 +++ ...NetworkManagerManagementGroupConnection.cs | 72 ++ .../Network/NetworkManagerNetworkGroup.cs | 44 ++ .../Network/NetworkManagerScopeConnection.cs | 52 ++ .../Network/NetworkManagerStaticMember.cs | 61 ++ .../NetworkManagerSubscriptionConnection.cs | 44 ++ sdk/dotnet/Network/NetworkPacketCapture.cs | 130 ++++ sdk/dotnet/Network/NetworkSecurityGroup.cs | 43 ++ sdk/dotnet/Network/NetworkSecurityRule.cs | 38 ++ sdk/dotnet/Network/NetworkWatcher.cs | 24 + sdk/dotnet/Network/NetworkWatcherFlowLog.cs | 69 ++ ...licationGatewayPrivateLinkConfiguration.cs | 10 + sdk/dotnet/Network/PointToPointVpnGateway.cs | 90 +++ sdk/dotnet/Network/Profile.cs | 71 ++ sdk/dotnet/Network/PublicIp.cs | 29 + sdk/dotnet/Network/PublicIpPrefix.cs | 29 + sdk/dotnet/Network/Route.cs | 32 + sdk/dotnet/Network/RouteFilter.cs | 29 + sdk/dotnet/Network/RouteMap.cs | 73 ++ sdk/dotnet/Network/RouteServer.cs | 60 ++ .../Network/RouteServerBgpConnection.cs | 67 ++ sdk/dotnet/Network/RouteTable.cs | 38 ++ sdk/dotnet/Network/RoutingIntent.cs | 62 ++ sdk/dotnet/Network/SecurityPartnerProvider.cs | 57 ++ sdk/dotnet/Network/Subnet.cs | 54 ++ .../Network/SubnetNatGatewayAssociation.cs | 50 ++ .../SubnetNetworkSecurityGroupAssociation.cs | 65 ++ .../Network/SubnetRouteTableAssociation.cs | 60 ++ .../Network/TrafficManagerAzureEndpoint.cs | 57 ++ .../Network/TrafficManagerExternalEndpoint.cs | 49 ++ .../Network/TrafficManagerNestedEndpoint.cs | 76 +++ sdk/dotnet/Network/TrafficManagerProfile.cs | 52 ++ sdk/dotnet/Network/VirtualHub.cs | 32 + sdk/dotnet/Network/VirtualHubConnection.cs | 48 ++ sdk/dotnet/Network/VirtualHubIp.cs | 62 ++ sdk/dotnet/Network/VirtualHubRouteTable.cs | 93 +++ .../Network/VirtualHubRouteTableRoute.cs | 95 +++ sdk/dotnet/Network/VirtualNetwork.cs | 57 ++ .../Network/VirtualNetworkDnsServers.cs | 47 ++ sdk/dotnet/Network/VirtualNetworkGateway.cs | 109 +++ .../VirtualNetworkGatewayConnection.cs | 223 ++++++ sdk/dotnet/Network/VirtualNetworkPeering.cs | 51 ++ sdk/dotnet/Network/VirtualWan.cs | 24 + sdk/dotnet/Network/VnpGatewayNatRule.cs | 59 ++ sdk/dotnet/Network/VpnGateway.cs | 49 ++ sdk/dotnet/Network/VpnGatewayConnection.cs | 78 +++ sdk/dotnet/Network/VpnServerConfiguration.cs | 56 ++ .../VpnServerConfigurationPolicyGroup.cs | 54 ++ sdk/dotnet/Network/VpnSite.cs | 43 ++ .../NetworkFunction/AzureTrafficCollector.cs | 28 + sdk/dotnet/NewRelic/Monitor.cs | 35 + sdk/dotnet/NewRelic/TagRule.cs | 62 ++ sdk/dotnet/Nginx/Certificate.cs | 145 ++++ sdk/dotnet/Nginx/Deployment.cs | 90 +++ .../NotificationHub/AuthorizationRule.cs | 43 ++ sdk/dotnet/NotificationHub/GetHub.cs | 56 ++ sdk/dotnet/NotificationHub/GetNamespace.cs | 54 ++ sdk/dotnet/NotificationHub/Hub.cs | 33 + sdk/dotnet/NotificationHub/Namespace.cs | 26 + .../OperationalInsights/AnalyticsSolution.cs | 49 ++ .../OperationalInsights/AnalyticsWorkspace.cs | 26 + .../GetAnalyticsWorkspace.cs | 54 ++ .../OperationalInsights/QueryPackQuery.cs | 43 ++ sdk/dotnet/Orbital/Contact.cs | 130 ++++ sdk/dotnet/Orbital/ContactProfile.cs | 93 +++ sdk/dotnet/Orbital/Spacecraft.cs | 46 ++ sdk/dotnet/PaloAlto/LocalRulestack.cs | 24 + .../PaloAlto/LocalRulestackCertificate.cs | 30 + sdk/dotnet/PaloAlto/LocalRulestackFqdnList.cs | 33 + ...tackOutboundTrustCertificateAssociation.cs | 35 + ...ckOutboundUntrustCertificateAssociation.cs | 35 + .../PaloAlto/LocalRulestackPrefixList.cs | 33 + sdk/dotnet/PaloAlto/LocalRulestackRule.cs | 49 ++ ...enerationFirewallVirtualNetworkPanorama.cs | 128 ++++ sdk/dotnet/Pim/ActiveRoleAssignment.cs | 95 +++ sdk/dotnet/Pim/EligibleRoleAssignment.cs | 95 +++ sdk/dotnet/Policy/Definition.cs | 51 ++ sdk/dotnet/Policy/GetPolicyAssignment.cs | 54 ++ sdk/dotnet/Policy/GetPolicyDefintion.cs | 52 ++ .../Policy/GetPolicyDefintionBuiltIn.cs | 52 ++ sdk/dotnet/Policy/GetPolicySetDefinition.cs | 52 ++ ...etVirtualMachineConfigurationAssignment.cs | 56 ++ sdk/dotnet/Policy/PolicySetDefinition.cs | 43 ++ .../VirtualMachineConfigurationAssignment.cs | 130 ++++ sdk/dotnet/Portal/Dashboard.cs | 145 ++++ sdk/dotnet/Portal/GetDashboard.cs | 54 ++ .../ActiveDirectoryAdministrator.cs | 40 ++ sdk/dotnet/PostgreSql/Configuration.cs | 41 ++ sdk/dotnet/PostgreSql/Database.cs | 41 ++ sdk/dotnet/PostgreSql/FirewallRule.cs | 62 ++ sdk/dotnet/PostgreSql/FlexibleServer.cs | 89 +++ ...xibleServerActiveDirectoryAdministrator.cs | 53 ++ .../PostgreSql/FlexibleServerConfiguration.cs | 69 ++ .../PostgreSql/FlexibleServerDatabase.cs | 36 + .../PostgreSql/FlexibleServerFirewallRule.cs | 36 + sdk/dotnet/PostgreSql/GetFlexibleServer.cs | 54 ++ sdk/dotnet/PostgreSql/GetServer.cs | 54 ++ sdk/dotnet/PostgreSql/Server.cs | 35 + sdk/dotnet/PostgreSql/ServerKey.cs | 119 ++++ sdk/dotnet/PostgreSql/VirtualNetworkRule.cs | 63 ++ sdk/dotnet/PowerBI/Embedded.cs | 29 + sdk/dotnet/PrivateDns/AAAARecord.cs | 35 + sdk/dotnet/PrivateDns/ARecord.cs | 34 + sdk/dotnet/PrivateDns/CnameRecord.cs | 31 + sdk/dotnet/PrivateDns/GetAAAARecord.cs | 56 ++ sdk/dotnet/PrivateDns/GetARecord.cs | 58 ++ sdk/dotnet/PrivateDns/GetCnameRecord.cs | 56 ++ sdk/dotnet/PrivateDns/GetDnsZone.cs | 54 ++ sdk/dotnet/PrivateDns/GetMxRecord.cs | 56 ++ sdk/dotnet/PrivateDns/GetPtrRecord.cs | 56 ++ sdk/dotnet/PrivateDns/GetResolver.cs | 46 ++ .../GetResolverDnsForwardingRuleset.cs | 46 ++ .../PrivateDns/GetResolverForwardingRule.cs | 46 ++ .../PrivateDns/GetResolverInboundEndpoint.cs | 46 ++ .../PrivateDns/GetResolverOutboundEndpoint.cs | 46 ++ .../GetResolverVirtualNetworkLink.cs | 46 ++ sdk/dotnet/PrivateDns/GetSrvRecord.cs | 56 ++ sdk/dotnet/PrivateDns/GetTxtRecord.cs | 56 ++ .../PrivateDns/GetZoneVirtualNetworkLink.cs | 56 ++ sdk/dotnet/PrivateDns/LinkService.cs | 99 +++ sdk/dotnet/PrivateDns/MxRecord.cs | 47 ++ sdk/dotnet/PrivateDns/PTRRecord.cs | 34 + sdk/dotnet/PrivateDns/Resolver.cs | 35 + .../ResolverDnsForwardingRuleset.cs | 85 +++ .../PrivateDns/ResolverForwardingRule.cs | 100 +++ .../PrivateDns/ResolverInboundEndpoint.cs | 78 +++ .../PrivateDns/ResolverOutboundEndpoint.cs | 71 ++ .../PrivateDns/ResolverVirtualNetworkLink.cs | 95 +++ sdk/dotnet/PrivateDns/SRVRecord.cs | 51 ++ sdk/dotnet/PrivateDns/TxtRecord.cs | 37 + sdk/dotnet/PrivateDns/Zone.cs | 23 + .../PrivateDns/ZoneVirtualNetworkLink.cs | 40 ++ .../ApplicationSecurityGroupAssociation.cs | 127 ++++ .../PrivateLink/GetEndpointConnection.cs | 54 ++ sdk/dotnet/PrivateLink/GetService.cs | 54 ++ .../GetServiceEndpointConnections.cs | 54 ++ sdk/dotnet/Proximity/GetPlacementGroup.cs | 54 ++ sdk/dotnet/Proximity/PlacementGroup.cs | 28 + sdk/dotnet/Purview/Account.cs | 28 + sdk/dotnet/RecoveryServices/GetVault.cs | 46 ++ sdk/dotnet/RecoveryServices/Vault.cs | 26 + .../VaultResourceGuardAssociation.cs | 38 ++ sdk/dotnet/Redis/Cache.cs | 32 + sdk/dotnet/Redis/EnterpriseCluster.cs | 25 + sdk/dotnet/Redis/EnterpriseDatabase.cs | 48 ++ sdk/dotnet/Redis/FirewallRule.cs | 52 ++ sdk/dotnet/Redis/GetCache.cs | 56 ++ sdk/dotnet/Redis/GetEnterpriseDatabase.cs | 58 ++ .../Inputs/CacheRedisConfigurationArgs.cs | 20 + .../Inputs/CacheRedisConfigurationGetArgs.cs | 20 + sdk/dotnet/Redis/LinkedServer.cs | 64 ++ .../Redis/Outputs/CacheRedisConfiguration.cs | 20 + sdk/dotnet/Relay/HybridConnection.cs | 37 + .../HybridConnectionAuthorizationRule.cs | 47 ++ sdk/dotnet/Relay/Namespace.cs | 29 + .../Relay/NamespaceAuthorizationRule.cs | 38 ++ sdk/dotnet/Role/Assignment.cs | 163 +++++ sdk/dotnet/Role/Definition.cs | 36 + sdk/dotnet/Search/GetService.cs | 56 ++ sdk/dotnet/Search/Service.cs | 75 ++ sdk/dotnet/Search/SharedPrivateLinkService.cs | 41 ++ .../AdvancedThreatProtection.cs | 36 + sdk/dotnet/SecurityCenter/Assessment.cs | 102 +++ sdk/dotnet/SecurityCenter/AssessmentPolicy.cs | 20 + sdk/dotnet/SecurityCenter/AutoProvisioning.cs | 18 + sdk/dotnet/SecurityCenter/Automation.cs | 88 +++ sdk/dotnet/SecurityCenter/Contact.cs | 21 + .../ServerVulnerabilityAssessment.cs | 84 +++ ...erVulnerabilityAssessmentVirtualMachine.cs | 84 +++ sdk/dotnet/SecurityCenter/Setting.cs | 19 + sdk/dotnet/SecurityCenter/StorageDefender.cs | 31 + .../SecurityCenter/SubscriptionPricing.cs | 59 ++ sdk/dotnet/SecurityCenter/Workspace.cs | 31 + .../Sentinel/AlertRuleAnomalyBuiltIn.cs | 45 ++ .../Sentinel/AlertRuleAnomalyDuplicate.cs | 54 ++ sdk/dotnet/Sentinel/AlertRuleFusion.cs | 45 ++ ...ertRuleMachineLearningBehaviorAnalytics.cs | 36 + .../Sentinel/AlertRuleMsSecurityIncident.cs | 41 ++ sdk/dotnet/Sentinel/AlertRuleNrt.cs | 42 ++ sdk/dotnet/Sentinel/AlertRuleScheduled.cs | 42 ++ .../Sentinel/AlertRuleThreatIntelligence.cs | 51 ++ sdk/dotnet/Sentinel/AuthomationRule.cs | 45 ++ sdk/dotnet/Sentinel/AutomationRule.cs | 45 ++ .../Sentinel/DataConnectorAwsCloudTrail.cs | 36 + sdk/dotnet/Sentinel/DataConnectorAwsS3.cs | 41 ++ .../DataConnectorAzureActiveDirectory.cs | 35 + ...aConnectorAzureAdvancedThreadProtection.cs | 35 + .../DataConnectorAzureSecurityCenter.cs | 35 + .../Sentinel/DataConnectorDynamics365.cs | 35 + sdk/dotnet/Sentinel/DataConnectorIot.cs | 35 + .../DataConnectorMicrosoftCloudAppSecurity.cs | 35 + ...crosoftDefenderAdvancedThreatProtection.cs | 35 + ...ataConnectorMicrosoftThreatIntelligence.cs | 36 + .../DataConnectorMicrosoftThreatProtection.cs | 35 + sdk/dotnet/Sentinel/DataConnectorOffice365.cs | 35 + .../Sentinel/DataConnectorOffice365Project.cs | 35 + sdk/dotnet/Sentinel/DataConnectorOfficeAtp.cs | 35 + sdk/dotnet/Sentinel/DataConnectorOfficeIrm.cs | 35 + .../Sentinel/DataConnectorOfficePowerBi.cs | 35 + .../DataConnectorThreatIntelligence.cs | 35 + .../DataConnectorThreatIntelligenceTaxii.cs | 38 ++ sdk/dotnet/Sentinel/GetAlertRule.cs | 66 ++ sdk/dotnet/Sentinel/GetAlertRuleAnomaly.cs | 90 +++ sdk/dotnet/Sentinel/GetAlertRuleTemplate.cs | 54 ++ .../LogAnalyticsWorkspaceOnboarding.cs | 32 + sdk/dotnet/Sentinel/Metadata.cs | 59 ++ .../Sentinel/ThreatIntelligenceIndicator.cs | 48 ++ sdk/dotnet/Sentinel/Watchlist.cs | 37 + sdk/dotnet/Sentinel/WatchlistItem.cs | 47 ++ sdk/dotnet/ServiceBus/GetNamespace.cs | 54 ++ .../GetNamespaceAuthorizationRule.cs | 54 ++ sdk/dotnet/ServiceBus/GetQueue.cs | 54 ++ .../ServiceBus/GetQueueAuthorizationRule.cs | 58 ++ sdk/dotnet/ServiceBus/GetSubscription.cs | 54 ++ sdk/dotnet/ServiceBus/GetTopic.cs | 54 ++ .../ServiceBus/GetTopicAuthorizationRule.cs | 58 ++ sdk/dotnet/ServiceBus/Namespace.cs | 29 + .../ServiceBus/NamespaceAuthorizationRule.cs | 37 + .../NamespaceDisasterRecoveryConfig.cs | 49 ++ .../ServiceBus/NamespaceNetworkRuleSet.cs | 74 ++ sdk/dotnet/ServiceBus/Queue.cs | 35 + .../ServiceBus/QueueAuthorizationRule.cs | 43 ++ sdk/dotnet/ServiceBus/Subscription.cs | 41 ++ sdk/dotnet/ServiceBus/SubscriptionRule.cs | 102 +++ sdk/dotnet/ServiceBus/Topic.cs | 35 + .../ServiceBus/TopicAuthorizationRule.cs | 42 ++ sdk/dotnet/ServiceFabric/Cluster.cs | 40 ++ sdk/dotnet/ServiceFabric/ManagedCluster.cs | 49 ++ sdk/dotnet/SignalR/GetService.cs | 46 ++ sdk/dotnet/SignalR/Service.cs | 63 ++ .../SignalR/ServiceCustomCertificate.cs | 106 +++ sdk/dotnet/SignalR/ServiceCustomDomain.cs | 113 +++ sdk/dotnet/SignalR/ServiceNetworkAcl.cs | 91 +++ .../SignalR/SharedPrivateLinkResource.cs | 67 ++ sdk/dotnet/SiteRecovery/Fabric.cs | 37 + sdk/dotnet/SiteRecovery/GetFabric.cs | 48 ++ .../SiteRecovery/GetProtectionContainer.cs | 50 ++ .../SiteRecovery/GetReplicationPolicy.cs | 48 ++ .../GetReplicationRecoveryPlan.cs | 58 ++ .../SiteRecovery/HyperVReplicationPolicy.cs | 33 + .../HyperVReplicationPolicyAssociation.cs | 44 ++ sdk/dotnet/SiteRecovery/HyperVSite.cs | 31 + .../SiteRecovery/HypervNetworkMapping.cs | 43 ++ sdk/dotnet/SiteRecovery/NetworkMapping.cs | 81 +++ .../SiteRecovery/ProtectionContainer.cs | 44 ++ .../ProtectionContainerMapping.cs | 76 +++ sdk/dotnet/SiteRecovery/ReplicatedVM.cs | 242 +++++++ sdk/dotnet/SiteRecovery/ReplicationPolicy.cs | 33 + .../SiteRecovery/ReplicationRecoveryPlan.cs | 261 +++++++ .../SiteRecovery/VMWareReplicationPolicy.cs | 34 + .../VmwareReplicationPolicyAssociation.cs | 38 ++ .../Sql/ActiveDirectoryAdministrator.cs | 38 ++ sdk/dotnet/Sql/Database.cs | 50 ++ sdk/dotnet/Sql/ElasticPool.cs | 41 ++ sdk/dotnet/Sql/FailoverGroup.cs | 65 ++ sdk/dotnet/Sql/FirewallRule.cs | 35 + sdk/dotnet/Sql/GetDatabase.cs | 56 ++ sdk/dotnet/Sql/GetServer.cs | 54 ++ sdk/dotnet/Sql/GetSqlManagedInstance.cs | 54 ++ sdk/dotnet/Sql/ManagedDatabase.cs | 57 ++ sdk/dotnet/Sql/ManagedInstance.cs | 230 +++++++ ...gedInstanceActiveDirectoryAdministrator.cs | 49 ++ sdk/dotnet/Sql/SqlServer.cs | 39 ++ sdk/dotnet/Sql/VirtualNetworkRule.cs | 58 ++ sdk/dotnet/Stack/HciCluster.cs | 34 + sdk/dotnet/Storage/Account.cs | 96 +++ sdk/dotnet/Storage/AccountNetworkRules.cs | 72 ++ sdk/dotnet/Storage/Blob.cs | 40 ++ sdk/dotnet/Storage/BlobInventoryPolicy.cs | 57 ++ sdk/dotnet/Storage/Container.cs | 36 + sdk/dotnet/Storage/CustomerManagedKey.cs | 117 ++++ sdk/dotnet/Storage/DataLakeGen2Filesystem.cs | 37 + sdk/dotnet/Storage/DataLakeGen2Path.cs | 41 ++ sdk/dotnet/Storage/EncryptionScope.cs | 36 + sdk/dotnet/Storage/GetAccount.cs | 54 ++ .../Storage/GetAccountBlobContainerSAS.cs | 128 ++++ sdk/dotnet/Storage/GetAccountSAS.cs | 146 ++++ sdk/dotnet/Storage/GetBlob.cs | 48 ++ sdk/dotnet/Storage/GetEncryptionScope.cs | 66 ++ sdk/dotnet/Storage/GetPolicy.cs | 56 ++ sdk/dotnet/Storage/GetShare.cs | 54 ++ sdk/dotnet/Storage/GetStorageContainer.cs | 46 ++ sdk/dotnet/Storage/GetSync.cs | 54 ++ sdk/dotnet/Storage/GetSyncGroup.cs | 54 ++ sdk/dotnet/Storage/GetTableEntity.cs | 50 ++ sdk/dotnet/Storage/LocalUser.cs | 67 ++ sdk/dotnet/Storage/ManagementPolicy.cs | 111 +++ sdk/dotnet/Storage/Mover.cs | 29 + sdk/dotnet/Storage/MoverAgent.cs | 31 + sdk/dotnet/Storage/MoverJobDefinition.cs | 76 +++ sdk/dotnet/Storage/MoverProject.cs | 30 + sdk/dotnet/Storage/MoverSourceEndpoint.cs | 32 + sdk/dotnet/Storage/MoverTargetEndpoint.cs | 47 ++ sdk/dotnet/Storage/ObjectReplication.cs | 75 ++ sdk/dotnet/Storage/Queue.cs | 31 + sdk/dotnet/Storage/Share.cs | 48 ++ sdk/dotnet/Storage/ShareDirectory.cs | 38 ++ sdk/dotnet/Storage/ShareFile.cs | 38 ++ sdk/dotnet/Storage/Sync.cs | 28 + sdk/dotnet/Storage/SyncCloudEndpoint.cs | 64 ++ sdk/dotnet/Storage/SyncGroup.cs | 29 + sdk/dotnet/Storage/Table.cs | 31 + sdk/dotnet/Storage/TableEntity.cs | 43 ++ sdk/dotnet/StreamAnalytics/Cluster.cs | 25 + .../StreamAnalytics/FunctionJavaScriptUDF.cs | 45 ++ .../StreamAnalytics/FunctionJavascriptUda.cs | 54 ++ sdk/dotnet/StreamAnalytics/GetJob.cs | 54 ++ sdk/dotnet/StreamAnalytics/Job.cs | 39 ++ sdk/dotnet/StreamAnalytics/JobSchedule.cs | 110 +++ .../StreamAnalytics/ManagedPrivateEndpoint.cs | 43 ++ sdk/dotnet/StreamAnalytics/OutputBlob.cs | 56 ++ sdk/dotnet/StreamAnalytics/OutputCosmosdb.cs | 70 ++ sdk/dotnet/StreamAnalytics/OutputEventHub.cs | 54 ++ sdk/dotnet/StreamAnalytics/OutputFunction.cs | 70 ++ sdk/dotnet/StreamAnalytics/OutputMssql.cs | 55 ++ sdk/dotnet/StreamAnalytics/OutputPowerbi.cs | 33 + .../StreamAnalytics/OutputServiceBusQueue.cs | 52 ++ .../StreamAnalytics/OutputServicebusTopic.cs | 57 ++ sdk/dotnet/StreamAnalytics/OutputSynapse.cs | 63 ++ sdk/dotnet/StreamAnalytics/OutputTable.cs | 49 ++ .../StreamAnalytics/ReferenceInputBlob.cs | 55 ++ .../StreamAnalytics/ReferenceInputMssql.cs | 54 ++ sdk/dotnet/StreamAnalytics/StreamInputBlob.cs | 55 ++ .../StreamAnalytics/StreamInputEventHub.cs | 63 ++ .../StreamAnalytics/StreamInputEventHubV2.cs | 62 ++ .../StreamAnalytics/StreamInputIotHub.cs | 51 ++ sdk/dotnet/Synapse/FirewallRule.cs | 53 ++ sdk/dotnet/Synapse/GetWorkspace.cs | 54 ++ sdk/dotnet/Synapse/IntegrationRuntimeAzure.cs | 64 ++ .../Synapse/IntegrationRuntimeSelfHosted.cs | 63 ++ sdk/dotnet/Synapse/LinkedService.cs | 79 +++ sdk/dotnet/Synapse/ManagedPrivateEndpoint.cs | 76 +++ sdk/dotnet/Synapse/PrivateLinkHub.cs | 19 + sdk/dotnet/Synapse/RoleAssignment.cs | 68 ++ sdk/dotnet/Synapse/SqlPool.cs | 53 ++ .../Synapse/SqlPoolExtendedAuditingPolicy.cs | 69 ++ .../Synapse/SqlPoolSecurityAlertPolicy.cs | 85 +++ .../Synapse/SqlPoolVulnerabilityAssessment.cs | 112 +++ .../SqlPoolVulnerabilityAssessmentBaseline.cs | 103 +++ .../Synapse/SqlPoolWorkloadClassifier.cs | 74 ++ sdk/dotnet/Synapse/SqlPoolWorkloadGroup.cs | 63 ++ sdk/dotnet/Synapse/Workspace.cs | 195 ++++++ sdk/dotnet/Synapse/WorkspaceAadAdmin.cs | 102 +++ .../WorkspaceExtendedAuditingPolicy.cs | 62 ++ sdk/dotnet/Synapse/WorkspaceKey.cs | 126 ++++ .../Synapse/WorkspaceSecurityAlertPolicy.cs | 78 +++ sdk/dotnet/Synapse/WorkspaceSqlAadAdmin.cs | 102 +++ .../WorkspaceVulnerabilityAssessment.cs | 105 +++ .../TrafficManager/GetGeographicalLocation.cs | 46 ++ sdk/dotnet/TrafficManager/Profile.cs | 52 ++ sdk/dotnet/VideoAnalyzer/Analyzer.cs | 76 +++ sdk/dotnet/VideoAnalyzer/EdgeModule.cs | 83 +++ .../Voice/ServicesCommunicationsGateway.cs | 91 +++ .../ServicesCommunicationsGatewayTestLine.cs | 35 + sdk/dotnet/Waf/GetFirewallPolicy.cs | 54 ++ sdk/dotnet/Waf/Policy.cs | 153 +++++ .../WebPubSub/GetPrivateLinkResource.cs | 70 ++ sdk/dotnet/WebPubSub/GetService.cs | 46 ++ sdk/dotnet/WebPubSub/Hub.cs | 113 +++ sdk/dotnet/WebPubSub/NetworkAcl.cs | 95 +++ sdk/dotnet/WebPubSub/Service.cs | 37 + .../WebPubSub/SharedPrivateLinkResource.cs | 64 ++ sdk/go/azure/aadb2c/directory.go | 31 + sdk/go/azure/aadb2c/getDirectory.go | 28 + sdk/go/azure/advisor/getRecommendations.go | 33 + sdk/go/azure/analysisservices/server.go | 51 ++ sdk/go/azure/apimanagement/api.go | 54 ++ sdk/go/azure/apimanagement/apiDiagnostic.go | 120 ++++ sdk/go/azure/apimanagement/apiOperation.go | 47 ++ .../azure/apimanagement/apiOperationPolicy.go | 74 ++ sdk/go/azure/apimanagement/apiOperationTag.go | 54 ++ sdk/go/azure/apimanagement/apiPolicy.go | 45 ++ sdk/go/azure/apimanagement/apiRelease.go | 60 ++ sdk/go/azure/apimanagement/apiSchema.go | 50 ++ sdk/go/azure/apimanagement/apiTag.go | 55 ++ sdk/go/azure/apimanagement/apiVersionSet.go | 46 ++ .../apimanagement/authorizationServer.go | 44 ++ sdk/go/azure/apimanagement/backend.go | 46 ++ sdk/go/azure/apimanagement/certificate.go | 169 +++++ sdk/go/azure/apimanagement/customDomain.go | 111 +++ sdk/go/azure/apimanagement/diagnostic.go | 102 +++ sdk/go/azure/apimanagement/emailTemplate.go | 63 ++ sdk/go/azure/apimanagement/gateway.go | 50 ++ sdk/go/azure/apimanagement/gatewayApi.go | 50 ++ .../gatewayCertificateAuthority.go | 78 +++ .../gatewayHostNameConfiguration.go | 82 +++ sdk/go/azure/apimanagement/getApi.go | 30 + .../azure/apimanagement/getApiVersionSet.go | 29 + sdk/go/azure/apimanagement/getGateway.go | 34 + .../getGatewayHostNameConfiguration.go | 43 ++ sdk/go/azure/apimanagement/getGroup.go | 29 + sdk/go/azure/apimanagement/getProduct.go | 29 + sdk/go/azure/apimanagement/getService.go | 28 + sdk/go/azure/apimanagement/globalSchema.go | 57 ++ sdk/go/azure/apimanagement/group.go | 46 ++ sdk/go/azure/apimanagement/groupUser.go | 37 + .../apimanagement/identityProviderAad.go | 49 ++ .../apimanagement/identityProviderAadb2c.go | 67 ++ .../apimanagement/identityProviderFacebook.go | 46 ++ .../apimanagement/identityProviderGoogle.go | 46 ++ .../identityProviderMicrosoft.go | 46 ++ .../apimanagement/identityProviderTwitter.go | 46 ++ sdk/go/azure/apimanagement/logger.go | 57 ++ sdk/go/azure/apimanagement/namedValue.go | 46 ++ .../notificationRecipientEmail.go | 45 ++ .../notificationRecipientUser.go | 57 ++ .../apimanagement/openIdConnectProvider.go | 48 ++ sdk/go/azure/apimanagement/policy.go | 63 ++ sdk/go/azure/apimanagement/product.go | 49 ++ sdk/go/azure/apimanagement/productApi.go | 53 ++ sdk/go/azure/apimanagement/productGroup.go | 52 ++ sdk/go/azure/apimanagement/productPolicy.go | 44 ++ sdk/go/azure/apimanagement/productTag.go | 63 ++ sdk/go/azure/apimanagement/redisCache.go | 61 ++ sdk/go/azure/apimanagement/service.go | 37 + sdk/go/azure/apimanagement/subscription.go | 53 ++ sdk/go/azure/apimanagement/tag.go | 43 ++ sdk/go/azure/apimanagement/user.go | 49 ++ .../appconfiguration/configurationFeature.go | 56 ++ .../appconfiguration/configurationKey.go | 150 ++++ .../appconfiguration/configurationStore.go | 180 +++++ .../appconfiguration/getConfigurationKey.go | 29 + .../appconfiguration/getConfigurationKeys.go | 27 + .../appconfiguration/getConfigurationStore.go | 28 + .../appconfiguration/licationLoadBalancer.go | 34 + sdk/go/azure/appinsights/analyticsItem.go | 44 ++ sdk/go/azure/appinsights/apiKey.go | 87 +++ sdk/go/azure/appinsights/getInsights.go | 28 + sdk/go/azure/appinsights/insights.go | 84 +++ .../azure/appinsights/smartDetectionRule.go | 42 ++ sdk/go/azure/appinsights/standardWebTest.go | 49 ++ sdk/go/azure/appinsights/webTest.go | 61 ++ sdk/go/azure/appinsights/workbook.go | 61 ++ sdk/go/azure/appinsights/workbookTemplate.go | 103 +++ sdk/go/azure/appplatform/getSpringCloudApp.go | 29 + .../appplatform/getSpringCloudService.go | 28 + .../appplatform/springCloudAccelerator.go | 41 ++ .../springCloudActiveDeployment.go | 67 ++ .../azure/appplatform/springCloudApiPortal.go | 61 ++ .../springCloudApiPortalCustomDomain.go | 56 ++ sdk/go/azure/appplatform/springCloudApp.go | 44 ++ .../springCloudAppCosmosDBAssociation.go | 69 ++ .../springCloudAppMysqlAssociation.go | 75 ++ .../springCloudAppRedisAssociation.go | 62 ++ ...nsightsApplicationPerformanceMonitoring.go | 56 ++ .../springCloudApplicationLiveView.go | 41 ++ .../appplatform/springCloudBuildDeployment.go | 58 ++ .../springCloudBuildPackBinding.go | 70 ++ .../azure/appplatform/springCloudBuilder.go | 53 ++ .../appplatform/springCloudCertificate.go | 133 ++++ .../springCloudConfigurationService.go | 58 ++ .../appplatform/springCloudConnection.go | 98 +++ .../springCloudContainerDeployment.go | 64 ++ .../springCloudCustomizedAccelerator.go | 59 ++ .../appplatform/springCloudDevToolPortal.go | 60 ++ .../azure/appplatform/springCloudGateway.go | 79 +++ .../springCloudGatewayCustomDomain.go | 47 ++ .../springCloudGatewayRouteConfig.go | 77 +++ .../appplatform/springCloudJavaDeployment.go | 61 ++ .../azure/appplatform/springCloudService.go | 59 ++ .../azure/appplatform/springCloudStorage.go | 52 ++ sdk/go/azure/appservice/activeSlot.go | 50 ++ sdk/go/azure/appservice/appConnection.go | 104 +++ sdk/go/azure/appservice/appService.go | 62 ++ sdk/go/azure/appservice/certificate.go | 49 ++ sdk/go/azure/appservice/certificateOrder.go | 36 + sdk/go/azure/appservice/connection.go | 93 +++ .../azure/appservice/customHostnameBinding.go | 64 ++ sdk/go/azure/appservice/environment.go | 78 +++ sdk/go/azure/appservice/functionApp.go | 178 +++++ .../azure/appservice/functionAppActiveSlot.go | 138 ++++ .../azure/appservice/functionAppFunction.go | 217 ++++++ .../appservice/functionAppHybridConnection.go | 91 +++ sdk/go/azure/appservice/functionAppSlot.go | 68 ++ sdk/go/azure/appservice/getAppService.go | 28 + .../appservice/getAppServiceEnvironment.go | 28 + sdk/go/azure/appservice/getAppServicePlan.go | 28 + sdk/go/azure/appservice/getCertificate.go | 28 + .../azure/appservice/getCertificateOrder.go | 28 + sdk/go/azure/appservice/getEnvironmentV3.go | 28 + sdk/go/azure/appservice/getFunctionApp.go | 27 + .../appservice/getFunctionAppHostKeys.go | 27 + .../azure/appservice/getLinuxFunctionApp.go | 28 + sdk/go/azure/appservice/getLinuxWebApp.go | 28 + sdk/go/azure/appservice/getServicePlan.go | 28 + .../azure/appservice/getSourceControlToken.go | 26 + .../azure/appservice/getWindowsFunctionApp.go | 28 + sdk/go/azure/appservice/getWindowsWebApp.go | 28 + sdk/go/azure/appservice/hybridConnection.go | 76 +++ sdk/go/azure/appservice/linuxFunctionApp.go | 57 ++ .../azure/appservice/linuxFunctionAppSlot.go | 64 ++ sdk/go/azure/appservice/linuxWebApp.go | 45 ++ sdk/go/azure/appservice/linuxWebAppSlot.go | 52 ++ sdk/go/azure/appservice/plan.go | 153 +++++ sdk/go/azure/appservice/publicCertificate.go | 67 ++ sdk/go/azure/appservice/servicePlan.go | 36 + sdk/go/azure/appservice/slot.go | 164 +++++ .../appservice/slotCustomHostnameBinding.go | 62 ++ .../slotVirtualNetworkSwiftConnection.go | 95 +++ sdk/go/azure/appservice/sourceCodeToken.go | 27 + sdk/go/azure/appservice/sourceControl.go | 53 ++ sdk/go/azure/appservice/sourceControlSlot.go | 60 ++ sdk/go/azure/appservice/sourceControlToken.go | 27 + sdk/go/azure/appservice/staticSite.go | 27 + .../appservice/staticSiteCustomDomain.go | 112 +++ .../virtualNetworkSwiftConnection.go | 180 +++++ sdk/go/azure/appservice/webAppActiveSlot.go | 57 ++ .../appservice/webAppHybridConnection.go | 70 ++ sdk/go/azure/appservice/windowsFunctionApp.go | 57 ++ .../appservice/windowsFunctionAppSlot.go | 64 ++ sdk/go/azure/appservice/windowsWebApp.go | 45 ++ sdk/go/azure/appservice/windowsWebAppSlot.go | 52 ++ sdk/go/azure/arc/privateLinkScope.go | 34 + sdk/go/azure/arc/resourceBridgeAppliance.go | 42 ++ .../azure/arckubernetes/clusterExtension.go | 59 ++ .../azure/arckubernetes/fluxConfiguration.go | 78 +++ sdk/go/azure/arcmachine/get.go | 28 + sdk/go/azure/attestation/provider.go | 45 ++ sdk/go/azure/authorization/assignment.go | 208 ++++++ .../authorization/getUserAssignedIdentity.go | 29 + sdk/go/azure/authorization/roleDefinition.go | 43 ++ .../authorization/userAssignedIdentity.go | 34 + sdk/go/azure/automanage/configuration.go | 95 +++ sdk/go/azure/automation/account.go | 38 ++ sdk/go/azure/automation/boolVariable.go | 43 ++ sdk/go/azure/automation/certificate.go | 56 ++ sdk/go/azure/automation/connection.go | 53 ++ .../azure/automation/connectionCertificate.go | 67 ++ .../connectionClassicCertificate.go | 49 ++ .../automation/connectionServicePrincipal.go | 60 ++ sdk/go/azure/automation/connectionType.go | 52 ++ sdk/go/azure/automation/credential.go | 45 ++ sdk/go/azure/automation/dateTimeVariable.go | 43 ++ sdk/go/azure/automation/dscConfiguration.go | 44 ++ .../azure/automation/dscNodeConfiguration.go | 80 +++ sdk/go/azure/automation/getAccount.go | 28 + sdk/go/azure/automation/getBoolVariable.go | 29 + .../azure/automation/getDateTimeVariable.go | 29 + sdk/go/azure/automation/getIntVariable.go | 29 + sdk/go/azure/automation/getStringVariable.go | 29 + sdk/go/azure/automation/getVariables.go | 34 + .../azure/automation/hybridRunbookWorker.go | 112 +++ .../automation/hybridRunbookWorkerGroup.go | 42 ++ sdk/go/azure/automation/intVariable.go | 43 ++ sdk/go/azure/automation/jobSchedule.go | 35 + sdk/go/azure/automation/module.go | 45 ++ sdk/go/azure/automation/python3Package.go | 49 ++ sdk/go/azure/automation/runBook.go | 106 +++ sdk/go/azure/automation/schedule.go | 50 ++ .../automation/softwareUpdateConfiguration.go | 79 +++ sdk/go/azure/automation/sourceControl.go | 49 ++ sdk/go/azure/automation/stringVariable.go | 43 ++ sdk/go/azure/automation/variableObject.go | 53 ++ sdk/go/azure/automation/watcher.go | 74 ++ sdk/go/azure/automation/webhook.go | 63 ++ sdk/go/azure/avs/cluster.go | 50 ++ sdk/go/azure/avs/expressRouteAuthorization.go | 48 ++ sdk/go/azure/avs/getPrivateCloud.go | 30 + sdk/go/azure/avs/privateCloud.go | 44 ++ .../azure/backup/containerStorageAccount.go | 54 ++ sdk/go/azure/backup/getPolicyFileshare.go | 28 + sdk/go/azure/backup/getPolicyVM.go | 28 + sdk/go/azure/backup/policyFileShare.go | 83 +++ sdk/go/azure/backup/policyVM.go | 83 +++ sdk/go/azure/backup/policyVMWorkload.go | 70 ++ sdk/go/azure/backup/protectedFileShare.go | 85 +++ sdk/go/azure/backup/protectedVM.go | 66 ++ sdk/go/azure/batch/account.go | 50 ++ sdk/go/azure/batch/application.go | 54 ++ sdk/go/azure/batch/certificate.go | 73 ++ sdk/go/azure/batch/getAccount.go | 28 + sdk/go/azure/batch/getApplication.go | 29 + sdk/go/azure/batch/getCertificate.go | 29 + sdk/go/azure/batch/getPool.go | 28 + sdk/go/azure/batch/job.go | 58 ++ sdk/go/azure/batch/pool.go | 132 ++++ .../billing/accountCostManagementExport.go | 60 ++ .../billing/getEnrollmentAccountScope.go | 28 + sdk/go/azure/billing/getMcaAccountScope.go | 29 + sdk/go/azure/billing/getMpaAccountScope.go | 28 + sdk/go/azure/blueprint/assignment.go | 114 ++++ sdk/go/azure/blueprint/getDefinition.go | 39 ++ sdk/go/azure/blueprint/getPublishedVersion.go | 33 + sdk/go/azure/bot/channelAlexa.go | 49 ++ sdk/go/azure/bot/channelDirectLine.go | 54 ++ sdk/go/azure/bot/channelDirectLineSpeech.go | 60 ++ sdk/go/azure/bot/channelEmail.go | 50 ++ sdk/go/azure/bot/channelFacebook.go | 56 ++ sdk/go/azure/bot/channelLine.go | 54 ++ sdk/go/azure/bot/channelSlack.go | 51 ++ sdk/go/azure/bot/channelSms.go | 51 ++ sdk/go/azure/bot/channelTeams.go | 48 ++ sdk/go/azure/bot/channelWebChat.go | 53 ++ sdk/go/azure/bot/channelsRegistration.go | 40 ++ sdk/go/azure/bot/connection.go | 51 ++ sdk/go/azure/bot/healthbot.go | 35 + sdk/go/azure/bot/serviceAzureBot.go | 68 ++ sdk/go/azure/bot/webApp.go | 40 ++ sdk/go/azure/cdn/endpoint.go | 49 ++ sdk/go/azure/cdn/endpointCustomDomain.go | 87 +++ sdk/go/azure/cdn/frontdoorCustomDomain.go | 86 +++ sdk/go/azure/cdn/frontdoorEndpoint.go | 43 ++ sdk/go/azure/cdn/frontdoorFirewallPolicy.go | 153 +++++ sdk/go/azure/cdn/frontdoorOriginGroup.go | 53 ++ sdk/go/azure/cdn/frontdoorProfile.go | 37 + ...rontdoorRouteDisableLinkToDefaultDomain.go | 30 + sdk/go/azure/cdn/frontdoorRuleSet.go | 40 ++ sdk/go/azure/cdn/frontdoorSecret.go | 118 ++++ sdk/go/azure/cdn/getFrontdoorCustomDomain.go | 28 + sdk/go/azure/cdn/getFrontdoorEndpoint.go | 28 + .../azure/cdn/getFrontdoorFirewallPolicy.go | 27 + sdk/go/azure/cdn/getFrontdoorOriginGroup.go | 28 + sdk/go/azure/cdn/getFrontdoorProfile.go | 27 + sdk/go/azure/cdn/getFrontdoorRuleSet.go | 28 + sdk/go/azure/cdn/getFrontdoorSecret.go | 28 + sdk/go/azure/cdn/getProfile.go | 28 + sdk/go/azure/cdn/profile.go | 39 ++ sdk/go/azure/cognitive/account.go | 39 ++ .../cognitive/accountCustomerManagedKey.go | 162 +++++ sdk/go/azure/cognitive/deployment.go | 50 ++ sdk/go/azure/cognitive/getAccount.go | 28 + sdk/go/azure/communication/emailService.go | 34 + sdk/go/azure/communication/getService.go | 28 + sdk/go/azure/communication/service.go | 34 + sdk/go/azure/compute/availabilitySet.go | 37 + sdk/go/azure/compute/bastionHost.go | 71 ++ sdk/go/azure/compute/capacityReservation.go | 44 ++ .../azure/compute/capacityReservationGroup.go | 34 + sdk/go/azure/compute/dataDiskAttachment.go | 121 ++++ sdk/go/azure/compute/dedicatedHost.go | 44 ++ sdk/go/azure/compute/dedicatedHostGroup.go | 35 + sdk/go/azure/compute/diskAccess.go | 27 + sdk/go/azure/compute/diskEncryptionSet.go | 252 +++++++ sdk/go/azure/compute/diskPool.go | 71 ++ sdk/go/azure/compute/diskPoolIscsiTarget.go | 128 ++++ .../azure/compute/diskPoolIscsiTargetLun.go | 135 ++++ .../compute/diskPoolManagedDiskAttachment.go | 118 ++++ sdk/go/azure/compute/extension.go | 200 ++++++ sdk/go/azure/compute/galleryApplication.go | 42 ++ .../compute/galleryApplicationVersion.go | 88 +++ sdk/go/azure/compute/getAvailabilitySet.go | 28 + sdk/go/azure/compute/getBastionHost.go | 28 + sdk/go/azure/compute/getConfidentialLedger.go | 28 + sdk/go/azure/compute/getDedicatedHost.go | 29 + sdk/go/azure/compute/getDedicatedHostGroup.go | 28 + sdk/go/azure/compute/getDiskAccess.go | 28 + sdk/go/azure/compute/getDiskEncryptionSet.go | 28 + sdk/go/azure/compute/getImage.go | 28 + sdk/go/azure/compute/getImages.go | 26 + sdk/go/azure/compute/getManagedDisk.go | 28 + .../getOrchestratedVirtualMachineScaleSet.go | 28 + sdk/go/azure/compute/getPlatformImage.go | 30 + sdk/go/azure/compute/getSharedImage.go | 28 + sdk/go/azure/compute/getSharedImageGallery.go | 27 + sdk/go/azure/compute/getSharedImageVersion.go | 29 + .../azure/compute/getSharedImageVersions.go | 28 + sdk/go/azure/compute/getSnapshot.go | 27 + sdk/go/azure/compute/getSshPublicKey.go | 28 + sdk/go/azure/compute/getVirtualMachine.go | 28 + .../compute/getVirtualMachineScaleSet.go | 28 + sdk/go/azure/compute/linuxVirtualMachine.go | 102 +++ .../compute/linuxVirtualMachineScaleSet.go | 90 +++ sdk/go/azure/compute/managedDisk.go | 92 +++ sdk/go/azure/compute/managedDiskSasToken.go | 45 ++ .../orchestratedVirtualMachineScaleSet.go | 38 ++ sdk/go/azure/compute/packetCapture.go | 134 ++++ sdk/go/azure/compute/pulumiTypes.go | 174 +++++ sdk/go/azure/compute/scaleSet.go | 352 ++++++++++ sdk/go/azure/compute/scaleSetPacketCapture.go | 125 ++++ sdk/go/azure/compute/sharedImage.go | 53 ++ sdk/go/azure/compute/sharedImageGallery.go | 39 ++ sdk/go/azure/compute/sharedImageVersion.go | 52 ++ sdk/go/azure/compute/snapshot.go | 46 ++ sdk/go/azure/compute/sshPublicKey.go | 38 ++ sdk/go/azure/compute/virtualMachine.go | 103 +++ .../virtualMachineScaleSetExtension.go | 163 +++++ sdk/go/azure/compute/windowsVirtualMachine.go | 87 +++ .../compute/windowsVirtualMachineScaleSet.go | 84 +++ sdk/go/azure/confidentialledger/ledger.go | 46 ++ sdk/go/azure/connections/apiConnection.go | 56 ++ sdk/go/azure/connections/getManagedApi.go | 28 + .../consumption/budgetManagementGroup.go | 86 +++ .../azure/consumption/budgetResourceGroup.go | 93 +++ .../azure/consumption/budgetSubscription.go | 97 +++ .../consumption/getBudgetResourceGroup.go | 28 + .../consumption/getBudgetSubscription.go | 28 + sdk/go/azure/containerapp/app.go | 63 ++ sdk/go/azure/containerapp/environment.go | 45 ++ .../containerapp/environmentDaprComponent.go | 53 ++ .../azure/containerapp/environmentStorage.go | 72 ++ sdk/go/azure/containerapp/getApp.go | 27 + sdk/go/azure/containerapp/getEnvironment.go | 27 + .../containerapp/getEnvironmentCertificate.go | 34 + .../clusterTrustedAccessRoleBinding.go | 108 +++ .../containerservice/connectedRegistry.go | 69 ++ .../containerservice/fluxConfiguration.go | 69 ++ .../containerservice/getClusterNodePool.go | 29 + sdk/go/azure/containerservice/getGroup.go | 30 + .../containerservice/getKubernetesCluster.go | 27 + .../getKubernetesNodePoolSnapshot.go | 27 + .../getKubernetesServiceVersions.go | 28 + sdk/go/azure/containerservice/getRegistry.go | 28 + .../containerservice/getRegistryScopeMap.go | 29 + .../containerservice/getRegistryToken.go | 29 + sdk/go/azure/containerservice/group.go | 62 ++ .../containerservice/kubernetesCluster.go | 397 +++++++++++ .../kubernetesClusterExtension.go | 50 ++ .../kubernetesClusterNodePool.go | 57 ++ .../kubernetesFleetManager.go | 33 + sdk/go/azure/containerservice/pulumiTypes.go | 130 ++++ sdk/go/azure/containerservice/registry.go | 174 +++++ .../containerservice/registryAgentPool.go | 43 ++ .../containerservice/registryScopeMap.go | 53 ++ sdk/go/azure/containerservice/registryTask.go | 52 ++ .../registryTaskScheduleRunNow.go | 58 ++ .../azure/containerservice/registryToken.go | 61 ++ .../azure/containerservice/registryWebhook.go | 53 ++ .../azure/containerservice/registryWebook.go | 53 ++ sdk/go/azure/core/customProvider.go | 39 ++ sdk/go/azure/core/getClientConfig.go | 25 + sdk/go/azure/core/getExtendedLocations.go | 26 + sdk/go/azure/core/getResourceGroup.go | 27 + sdk/go/azure/core/getSubscription.go | 25 + sdk/go/azure/core/getSubscriptions.go | 26 + sdk/go/azure/core/getTemplateSpecVersion.go | 29 + sdk/go/azure/core/getUserAssignedIdentity.go | 29 + .../azure/core/portalTenantConfiguration.go | 26 + .../core/resourceDeploymentScriptAzureCli.go | 57 ++ .../resourceDeploymentScriptPowerShell.go | 64 ++ sdk/go/azure/core/resourceGroup.go | 26 + .../core/resourceGroupCostManagementExport.go | 59 ++ .../core/resourceGroupCostManagementView.go | 46 ++ .../core/resourceGroupPolicyAssignment.go | 67 ++ .../core/resourceGroupPolicyExemption.go | 65 ++ sdk/go/azure/core/resourcePolicyAssignment.go | 58 ++ sdk/go/azure/core/resourcePolicyExemption.go | 63 ++ .../core/resourceProviderRegistration.go | 54 ++ sdk/go/azure/core/subscription.go | 130 ++++ .../core/subscriptionCostManagementExport.go | 63 ++ .../core/subscriptionCostManagementView.go | 40 ++ .../core/subscriptionPolicyAssignment.go | 54 ++ .../azure/core/subscriptionPolicyExemption.go | 50 ++ .../core/subscriptionTemplateDeployment.go | 44 ++ sdk/go/azure/core/templateDeployment.go | 98 +++ sdk/go/azure/core/tenantTemplateDeployment.go | 35 + sdk/go/azure/cosmosdb/account.go | 74 ++ sdk/go/azure/cosmosdb/cassandraCluster.go | 92 +++ sdk/go/azure/cosmosdb/cassandraDatacenter.go | 104 +++ sdk/go/azure/cosmosdb/cassandraKeyspace.go | 57 ++ sdk/go/azure/cosmosdb/cassandraTable.go | 80 +++ sdk/go/azure/cosmosdb/getAccount.go | 28 + sdk/go/azure/cosmosdb/getMongoDatabase.go | 29 + .../cosmosdb/getRestorableDatabaseAccounts.go | 28 + sdk/go/azure/cosmosdb/getSqlDatabase.go | 28 + sdk/go/azure/cosmosdb/getSqlRoleDefinition.go | 28 + sdk/go/azure/cosmosdb/gremlinDatabase.go | 35 + sdk/go/azure/cosmosdb/gremlinGraph.go | 68 ++ sdk/go/azure/cosmosdb/mongoCollection.go | 53 ++ sdk/go/azure/cosmosdb/mongoDatabase.go | 35 + sdk/go/azure/cosmosdb/mongoRoleDefinition.go | 67 ++ sdk/go/azure/cosmosdb/mongoUserDefinition.go | 68 ++ sdk/go/azure/cosmosdb/notebookWorkspace.go | 52 ++ sdk/go/azure/cosmosdb/postgresqlCluster.go | 38 ++ .../postgresqlCoordinatorConfiguration.go | 47 ++ .../azure/cosmosdb/postgresqlFirewallRule.go | 46 ++ .../cosmosdb/postgresqlNodeConfiguration.go | 47 ++ sdk/go/azure/cosmosdb/postgresqlRole.go | 45 ++ sdk/go/azure/cosmosdb/sqlContainer.go | 69 ++ sdk/go/azure/cosmosdb/sqlDatabase.go | 35 + sdk/go/azure/cosmosdb/sqlDedicatedGateway.go | 53 ++ sdk/go/azure/cosmosdb/sqlFunction.go | 51 ++ sdk/go/azure/cosmosdb/sqlRoleAssignment.go | 77 +++ sdk/go/azure/cosmosdb/sqlRoleDefinition.go | 71 ++ sdk/go/azure/cosmosdb/sqlStoredProcedure.go | 54 ++ sdk/go/azure/cosmosdb/sqlTrigger.go | 53 ++ sdk/go/azure/cosmosdb/table.go | 35 + sdk/go/azure/costmanagement/anomalyAlert.go | 30 + .../azure/costmanagement/scheduledAction.go | 36 + .../dashboard/azurerm_portal_dashboard.go | 28 + sdk/go/azure/dashboard/dashboard.go | 167 +++++ sdk/go/azure/dashboard/grafana.go | 43 ++ sdk/go/azure/databasemigration/getProject.go | 29 + sdk/go/azure/databasemigration/getService.go | 28 + sdk/go/azure/databasemigration/project.go | 67 ++ sdk/go/azure/databasemigration/service.go | 57 ++ sdk/go/azure/databoxedge/device.go | 35 + sdk/go/azure/databoxedge/getDevice.go | 27 + sdk/go/azure/databoxedge/order.go | 59 ++ sdk/go/azure/databricks/accessConnector.go | 40 ++ sdk/go/azure/databricks/getWorkspace.go | 28 + .../getWorkspacePrivateEndpointConnection.go | 28 + .../azure/databricks/virtualNetworkPeering.go | 65 ++ sdk/go/azure/datadog/monitor.go | 84 +++ .../azure/datadog/monitorSsoConfiguration.go | 52 ++ sdk/go/azure/datadog/monitorTagRule.go | 66 ++ sdk/go/azure/datafactory/customDataset.go | 131 ++++ sdk/go/azure/datafactory/dataFlow.go | 208 ++++++ sdk/go/azure/datafactory/datasetAzureBlob.go | 57 ++ .../azure/datafactory/datasetAzureSqlTable.go | 48 ++ sdk/go/azure/datafactory/datasetBinary.go | 56 ++ .../azure/datafactory/datasetCosmosDBApi.go | 58 ++ .../azure/datafactory/datasetDelimitedText.go | 61 ++ sdk/go/azure/datafactory/datasetHttp.go | 52 ++ sdk/go/azure/datafactory/datasetJson.go | 55 ++ sdk/go/azure/datafactory/datasetMysql.go | 48 ++ sdk/go/azure/datafactory/datasetParquet.go | 54 ++ sdk/go/azure/datafactory/datasetPostgresql.go | 48 ++ sdk/go/azure/datafactory/datasetSnowflake.go | 50 ++ .../datafactory/datasetSqlServerTable.go | 48 ++ sdk/go/azure/datafactory/factory.go | 34 + sdk/go/azure/datafactory/flowletDataFlow.go | 202 ++++++ sdk/go/azure/datafactory/getFactory.go | 28 + .../datafactory/integrationRuntimeManaged.go | 42 ++ .../datafactory/integrationRuntimeRule.go | 41 ++ .../integrationRuntimeSelfHosted.go | 40 ++ .../datafactory/integrationRuntimeSsis.go | 42 ++ .../azure/datafactory/linkedCustomService.go | 70 ++ .../linkedServiceAzureBlobStorage.go | 126 ++++ .../linkedServiceAzureDatabricks.go | 138 ++++ .../linkedServiceAzureFileStorage.go | 48 ++ .../datafactory/linkedServiceAzureFunction.go | 51 ++ .../linkedServiceAzureSqlDatabase.go | 41 ++ .../linkedServiceAzureTableStorage.go | 48 ++ .../datafactory/linkedServiceCosmosDb.go | 51 ++ .../linkedServiceCosmosDbMongoApi.go | 42 ++ .../linkedServiceDataLakeStorageGen2.go | 48 ++ .../datafactory/linkedServiceKeyVault.go | 55 ++ .../azure/datafactory/linkedServiceKusto.go | 82 +++ .../azure/datafactory/linkedServiceMysql.go | 41 ++ .../azure/datafactory/linkedServiceOdata.go | 52 ++ sdk/go/azure/datafactory/linkedServiceOdbc.go | 52 ++ .../datafactory/linkedServicePostgresql.go | 41 ++ sdk/go/azure/datafactory/linkedServiceSftp.go | 45 ++ .../datafactory/linkedServiceSnowflake.go | 106 +++ .../datafactory/linkedServiceSqlServer.go | 106 +++ .../azure/datafactory/linkedServiceSynapse.go | 106 +++ sdk/go/azure/datafactory/linkedServiceWeb.go | 42 ++ .../datafactory/managedPrivateEndpoint.go | 54 ++ sdk/go/azure/datafactory/pipeline.go | 83 +++ sdk/go/azure/datafactory/triggerBlobEvent.go | 82 +++ .../azure/datafactory/triggerCustomEvent.go | 79 +++ sdk/go/azure/datafactory/triggerSchedule.go | 49 ++ .../datafactory/triggerTumblingWindow.go | 77 +++ .../backupInstanceBlogStorage.go | 78 +++ .../dataprotection/backupInstanceDisk.go | 91 +++ .../backupInstancePostgresql.go | 171 +++++ .../dataprotection/backupPolicyBlobStorage.go | 43 ++ .../azure/dataprotection/backupPolicyDisk.go | 64 ++ .../dataprotection/backupPolicyPostgresql.go | 87 +++ sdk/go/azure/dataprotection/backupVault.go | 36 + sdk/go/azure/dataprotection/getBackupVault.go | 29 + sdk/go/azure/dataprotection/resourceGuard.go | 34 + sdk/go/azure/datashare/account.go | 40 ++ sdk/go/azure/datashare/datasetBlobStorage.go | 91 +++ sdk/go/azure/datashare/datasetDataLakeGen2.go | 87 +++ sdk/go/azure/datashare/datasetKustoCluster.go | 76 +++ .../azure/datashare/datasetKustoDatabase.go | 84 +++ sdk/go/azure/datashare/getAccount.go | 28 + .../azure/datashare/getDatasetBlobStorage.go | 28 + .../azure/datashare/getDatasetDataLakeGen2.go | 28 + .../azure/datashare/getDatasetKustoCluster.go | 28 + .../datashare/getDatasetKustoDatabase.go | 28 + sdk/go/azure/datashare/getShare.go | 35 + sdk/go/azure/datashare/share.go | 54 ++ .../desktopvirtualization/application.go | 71 ++ .../desktopvirtualization/applicationGroup.go | 68 ++ .../desktopvirtualization/getHostPool.go | 27 + .../getHostPoolRegistrationInfo.go | 44 ++ .../azure/desktopvirtualization/hostPool.go | 51 ++ .../desktopvirtualization/scalingPlan.go | 135 ++++ .../azure/desktopvirtualization/workspace.go | 36 + .../workspaceApplicationGroupAssociation.go | 59 ++ sdk/go/azure/devcenter/devCenter.go | 41 ++ sdk/go/azure/devcenter/project.go | 45 ++ sdk/go/azure/devtest/getLab.go | 28 + sdk/go/azure/devtest/getVirtualNetwork.go | 29 + .../azure/devtest/globalVMShutdownSchedule.go | 103 +++ sdk/go/azure/devtest/lab.go | 37 + sdk/go/azure/devtest/linuxVirtualMachine.go | 81 +++ sdk/go/azure/devtest/policy.go | 51 ++ sdk/go/azure/devtest/schedule.go | 55 ++ sdk/go/azure/devtest/virtualNetwork.go | 48 ++ sdk/go/azure/devtest/windowsVirtualMachine.go | 71 ++ .../azure/digitaltwins/endpointEventGrid.go | 51 ++ sdk/go/azure/digitaltwins/endpointEventHub.go | 71 ++ .../azure/digitaltwins/endpointServicebus.go | 66 ++ sdk/go/azure/digitaltwins/getInstance.go | 28 + sdk/go/azure/digitaltwins/instance.go | 37 + .../timeSeriesDatabaseConnection.go | 142 ++++ sdk/go/azure/dns/aaaaRecord.go | 95 +++ sdk/go/azure/dns/arecord.go | 95 +++ sdk/go/azure/dns/caaRecord.go | 66 ++ sdk/go/azure/dns/cnameRecord.go | 92 +++ sdk/go/azure/dns/getAAAARecord.go | 27 + sdk/go/azure/dns/getARecord.go | 28 + sdk/go/azure/dns/getCAARecord.go | 27 + sdk/go/azure/dns/getCnameRecord.go | 27 + sdk/go/azure/dns/getMxRecord.go | 27 + sdk/go/azure/dns/getNsRecord.go | 27 + sdk/go/azure/dns/getPtrRecord.go | 27 + sdk/go/azure/dns/getSrvRecord.go | 27 + sdk/go/azure/dns/getTxtRecord.go | 27 + sdk/go/azure/dns/getZone.go | 28 + sdk/go/azure/dns/mxRecord.go | 54 ++ sdk/go/azure/dns/nsRecord.go | 48 ++ sdk/go/azure/dns/ptrRecord.go | 44 ++ sdk/go/azure/dns/srvRecord.go | 52 ++ sdk/go/azure/dns/txtRecord.go | 52 ++ sdk/go/azure/dns/zone.go | 33 + sdk/go/azure/domainservices/getService.go | 27 + sdk/go/azure/domainservices/replicaSet.go | 305 +++++++++ sdk/go/azure/domainservices/service.go | 175 +++++ sdk/go/azure/domainservices/serviceTrust.go | 39 ++ sdk/go/azure/elasticcloud/elasticsearch.go | 36 + sdk/go/azure/elasticcloud/getElasticsearch.go | 29 + sdk/go/azure/eventgrid/domain.go | 37 + sdk/go/azure/eventgrid/domainTopic.go | 44 ++ sdk/go/azure/eventgrid/eventSubscription.go | 56 ++ sdk/go/azure/eventgrid/getDomain.go | 28 + sdk/go/azure/eventgrid/getDomainTopic.go | 27 + sdk/go/azure/eventgrid/getSystemTopic.go | 27 + sdk/go/azure/eventgrid/getTopic.go | 27 + sdk/go/azure/eventgrid/systemTopic.go | 49 ++ .../eventgrid/systemTopicEventSubscription.go | 66 ++ sdk/go/azure/eventgrid/topic.go | 37 + sdk/go/azure/eventhub/authorizationRule.go | 59 ++ sdk/go/azure/eventhub/cluster.go | 35 + sdk/go/azure/eventhub/consumerGroup.go | 57 ++ sdk/go/azure/eventhub/domain.go | 37 + sdk/go/azure/eventhub/eventGridTopic.go | 37 + sdk/go/azure/eventhub/eventHub.go | 48 ++ .../eventhub/eventHubAuthorizationRule.go | 59 ++ .../azure/eventhub/eventHubConsumerGroup.go | 57 ++ sdk/go/azure/eventhub/eventHubNamespace.go | 39 ++ .../eventHubNamespaceAuthorizationRule.go | 49 ++ sdk/go/azure/eventhub/eventSubscription.go | 56 ++ ...eventhubNamespaceDisasterRecoveryConfig.go | 51 ++ sdk/go/azure/eventhub/getAuthorizationRule.go | 29 + sdk/go/azure/eventhub/getCluster.go | 28 + sdk/go/azure/eventhub/getConsumeGroup.go | 29 + sdk/go/azure/eventhub/getEventHub.go | 29 + sdk/go/azure/eventhub/getEventhubNamespace.go | 28 + sdk/go/azure/eventhub/getNamespace.go | 28 + .../eventhub/getNamespaceAuthorizationRule.go | 29 + .../azure/eventhub/getServiceBusNamespace.go | 28 + sdk/go/azure/eventhub/namespace.go | 38 ++ .../eventhub/namespaceAuthorizationRule.go | 47 ++ .../eventhub/namespaceCustomerManagedKey.go | 124 ++++ sdk/go/azure/eventhub/namespaceSchemaGroup.go | 43 ++ sdk/go/azure/eventhub/queue.go | 45 ++ .../azure/eventhub/queueAuthorizationRule.go | 54 ++ sdk/go/azure/eventhub/subscription.go | 52 ++ sdk/go/azure/eventhub/subscriptionRule.go | 124 ++++ sdk/go/azure/eventhub/topic.go | 45 ++ .../azure/eventhub/topicAuthorizationRule.go | 53 ++ sdk/go/azure/fluidrelay/server.go | 34 + sdk/go/azure/frontdoor/firewallPolicy.go | 144 ++++ sdk/go/azure/frontdoor/frontdoor.go | 83 +++ sdk/go/azure/frontdoor/rulesEngine.go | 129 ++++ sdk/go/azure/graph/account.go | 44 ++ sdk/go/azure/graph/servicesAccount.go | 44 ++ sdk/go/azure/hdinsight/getCluster.go | 28 + sdk/go/azure/hdinsight/hadoopCluster.go | 85 +++ sdk/go/azure/hdinsight/hbaseCluster.go | 85 +++ .../hdinsight/interactiveQueryCluster.go | 85 +++ sdk/go/azure/hdinsight/kafkaCluster.go | 86 +++ sdk/go/azure/hdinsight/sparkCluster.go | 85 +++ sdk/go/azure/healthcare/dicomService.go | 40 ++ sdk/go/azure/healthcare/fhirService.go | 77 +++ sdk/go/azure/healthcare/getDicomService.go | 28 + sdk/go/azure/healthcare/getMedtechService.go | 28 + sdk/go/azure/healthcare/getService.go | 29 + sdk/go/azure/healthcare/getWorkspace.go | 28 + sdk/go/azure/healthcare/medtechService.go | 75 ++ .../medtechServiceFhirDestination.go | 135 ++++ sdk/go/azure/healthcare/service.go | 60 ++ sdk/go/azure/healthcare/workspace.go | 27 + sdk/go/azure/hpc/cache.go | 58 ++ sdk/go/azure/hpc/cacheAccessPolicy.go | 70 ++ sdk/go/azure/hpc/cacheBlobTarget.go | 107 +++ sdk/go/azure/hsm/module.go | 131 ++++ sdk/go/azure/hybrid/getComputeMachine.go | 28 + sdk/go/azure/iot/certificate.go | 58 ++ sdk/go/azure/iot/consumerGroup.go | 49 ++ sdk/go/azure/iot/dpsSharedAccessPolicy.go | 47 ++ sdk/go/azure/iot/endpointCosmosdbAccount.go | 88 +++ sdk/go/azure/iot/endpointEventhub.go | 78 +++ sdk/go/azure/iot/endpointServicebusQueue.go | 74 ++ sdk/go/azure/iot/endpointServicebusTopic.go | 73 ++ sdk/go/azure/iot/endpointStorageContainer.go | 68 ++ sdk/go/azure/iot/fileUpload.go | 63 ++ sdk/go/azure/iot/getDps.go | 27 + sdk/go/azure/iot/getDpsSharedAccessPolicy.go | 28 + sdk/go/azure/iot/getIotHub.go | 28 + sdk/go/azure/iot/getSharedAccessPolicy.go | 28 + sdk/go/azure/iot/ioTHub.go | 144 ++++ sdk/go/azure/iot/iotHubCertificate.go | 57 ++ sdk/go/azure/iot/iotHubDeviceUpdateAccount.go | 40 ++ .../azure/iot/iotHubDeviceUpdateInstance.go | 70 ++ sdk/go/azure/iot/iotHubDps.go | 39 ++ sdk/go/azure/iot/securityDeviceGroup.go | 70 ++ sdk/go/azure/iot/securitySolution.go | 49 ++ sdk/go/azure/iot/sharedAccessPolicy.go | 47 ++ .../iot/timeSeriesInsightsAccessPolicy.go | 46 ++ .../timeSeriesInsightsEventSourceEventhub.go | 102 +++ .../timeSeriesInsightsEventSourceIothub.go | 87 +++ .../iot/timeSeriesInsightsGen2Environment.go | 53 ++ .../iot/timeSeriesInsightsReferenceDataSet.go | 49 ++ .../timeSeriesInsightsStandardEnvironment.go | 36 + sdk/go/azure/iotcentral/application.go | 41 ++ .../iotcentral/applicationNetworkRuleSet.go | 56 ++ sdk/go/azure/keyvault/accessPolicy.go | 75 ++ sdk/go/azure/keyvault/certifiate.go | 250 +++++++ sdk/go/azure/keyvault/certificate.go | 250 +++++++ sdk/go/azure/keyvault/certificateContacts.go | 75 ++ sdk/go/azure/keyvault/certificateIssuer.go | 50 ++ sdk/go/azure/keyvault/getAccessPolicy.go | 27 + sdk/go/azure/keyvault/getCertificate.go | 35 + sdk/go/azure/keyvault/getCertificateData.go | 35 + sdk/go/azure/keyvault/getCertificateIssuer.go | 35 + sdk/go/azure/keyvault/getKey.go | 28 + sdk/go/azure/keyvault/getKeyVault.go | 28 + .../getManagedHardwareSecurityModule.go | 28 + sdk/go/azure/keyvault/getSecret.go | 28 + sdk/go/azure/keyvault/key.go | 82 +++ sdk/go/azure/keyvault/keyVault.go | 58 ++ .../keyvault/managedHardwareSecurityModule.go | 48 ++ .../azure/keyvault/managedStorageAccount.go | 177 +++++ ...managedStorageAccountSasTokenDefinition.go | 120 ++++ sdk/go/azure/keyvault/pulumiTypes.go | 116 ++++ sdk/go/azure/keyvault/secret.go | 64 ++ .../kusto/attachedDatabaseConfiguration.go | 95 +++ sdk/go/azure/kusto/cluster.go | 41 ++ .../azure/kusto/clusterCustomerManagedKey.go | 115 ++++ .../kusto/clusterManagedPrivateEndpoint.go | 63 ++ .../azure/kusto/clusterPrincipalAssignment.go | 53 ++ sdk/go/azure/kusto/cosmosdbDataConnection.go | 157 +++++ sdk/go/azure/kusto/database.go | 48 ++ .../kusto/databasePrincipalAssignment.go | 64 ++ sdk/go/azure/kusto/eventGridDataConnection.go | 118 ++++ sdk/go/azure/kusto/eventhubDataConnection.go | 88 +++ sdk/go/azure/kusto/getCluster.go | 27 + sdk/go/azure/kusto/getDatabase.go | 28 + sdk/go/azure/kusto/iotHubDataConnection.go | 96 +++ sdk/go/azure/kusto/script.go | 99 +++ sdk/go/azure/lab/lab.go | 54 ++ sdk/go/azure/lab/schedule.go | 62 ++ sdk/go/azure/lab/servicePlan.go | 37 + sdk/go/azure/lab/user.go | 61 ++ sdk/go/azure/lb/backendAddressPool.go | 55 ++ sdk/go/azure/lb/backendAddressPoolAddress.go | 71 ++ sdk/go/azure/lb/getBackendAddressPool.go | 40 ++ sdk/go/azure/lb/getLB.go | 28 + sdk/go/azure/lb/getLBOutboundRule.go | 28 + sdk/go/azure/lb/loadBalancer.go | 49 ++ sdk/go/azure/lb/natPool.go | 61 ++ sdk/go/azure/lb/outboundRule.go | 68 ++ sdk/go/azure/lb/probe.go | 56 ++ sdk/go/azure/lb/rule.go | 59 ++ sdk/go/azure/lighthouse/assignment.go | 32 + sdk/go/azure/lighthouse/definition.go | 42 ++ sdk/go/azure/loadtest/loadTest.go | 41 ++ sdk/go/azure/loganalytics/cluster.go | 37 + .../loganalytics/clusterCustomerManagedKey.go | 104 +++ sdk/go/azure/loganalytics/dataExportRule.go | 59 ++ .../loganalytics/dataSourceWindowsEvent.go | 47 ++ .../dataSourceWindowsPerformanceCounter.go | 47 ++ sdk/go/azure/loganalytics/linkedService.go | 57 ++ .../loganalytics/linkedStorageAccount.go | 57 ++ sdk/go/azure/loganalytics/queryPack.go | 34 + sdk/go/azure/loganalytics/savedSearch.go | 46 ++ sdk/go/azure/loganalytics/storageInsights.go | 56 ++ sdk/go/azure/logicapps/actionCustom.go | 57 ++ sdk/go/azure/logicapps/actionHttp.go | 42 ++ .../azure/logicapps/getIntegrationAccount.go | 28 + sdk/go/azure/logicapps/getStandard.go | 28 + sdk/go/azure/logicapps/getWorkflow.go | 28 + sdk/go/azure/logicapps/integrationAccount.go | 38 ++ .../logicapps/integrationAccountAgreement.go | 90 +++ .../logicapps/integrationAccountAssembly.go | 55 ++ .../integrationAccountBatchConfiguration.go | 46 ++ .../integrationAccountCertificate.go | 43 ++ .../azure/logicapps/integrationAccountMap.go | 54 ++ .../logicapps/integrationAccountPartner.go | 48 ++ .../logicapps/integrationAccountSchema.go | 53 ++ .../logicapps/integrationAccountSession.go | 43 ++ .../logicapps/interationServiceEnvironment.go | 104 +++ sdk/go/azure/logicapps/standard.go | 133 ++++ sdk/go/azure/logicapps/triggerCustom.go | 50 ++ sdk/go/azure/logicapps/triggerHttpRequest.go | 51 ++ sdk/go/azure/logicapps/triggerRecurrence.go | 42 ++ sdk/go/azure/logicapps/workflow.go | 34 + .../azure/machinelearning/computeCluster.go | 116 ++++ .../azure/machinelearning/computeInstance.go | 121 ++++ .../machinelearning/datastoreBlobstorage.go | 87 +++ .../machinelearning/datastoreDatalakeGen2.go | 87 +++ sdk/go/azure/machinelearning/getWorkspace.go | 28 + .../azure/machinelearning/inferenceCluster.go | 129 ++++ sdk/go/azure/machinelearning/synapseSpark.go | 117 ++++ sdk/go/azure/machinelearning/workspace.go | 399 +++++++++++ .../maintenance/assignmentDedicatedHost.go | 61 ++ .../maintenance/assignmentVirtualMachine.go | 117 ++++ .../assignmentVirtualMachineScaleSet.go | 201 ++++++ sdk/go/azure/maintenance/configuration.go | 38 ++ sdk/go/azure/maintenance/getConfiguration.go | 28 + .../maintenance/getPublicConfigurations.go | 29 + .../azure/managedapplication/application.go | 86 +++ sdk/go/azure/managedapplication/definition.go | 48 ++ .../azure/managedapplication/getDefinition.go | 28 + sdk/go/azure/management/getGroup.go | 27 + sdk/go/azure/management/group.go | 44 ++ .../azure/management/groupPolicyAssignment.go | 57 ++ .../azure/management/groupPolicyExemption.go | 52 ++ .../groupSubscriptionAssociation.go | 40 ++ .../management/groupTemplateDeployment.go | 162 +++++ sdk/go/azure/management/lock.go | 110 +++ sdk/go/azure/management/privateLink.go | 34 + .../managementgroups/getManagementGroup.go | 27 + .../azure/managementgroups/managementGroup.go | 44 ++ .../managementresource/manangementLock.go | 110 +++ sdk/go/azure/maps/account.go | 38 ++ sdk/go/azure/maps/creator.go | 48 ++ sdk/go/azure/maps/getAccount.go | 28 + sdk/go/azure/mariadb/configuration.go | 48 ++ sdk/go/azure/mariadb/database.go | 51 ++ sdk/go/azure/mariadb/firewallRule.go | 56 ++ sdk/go/azure/mariadb/getMariaDbServer.go | 28 + sdk/go/azure/mariadb/server.go | 45 ++ sdk/go/azure/mariadb/virtualNetworkRule.go | 71 ++ sdk/go/azure/marketplace/agreement.go | 28 + sdk/go/azure/marketplace/getAgreement.go | 29 + sdk/go/azure/media/accountFilter.go | 101 +++ sdk/go/azure/media/asset.go | 58 ++ sdk/go/azure/media/assetFilter.go | 108 +++ sdk/go/azure/media/contentKeyPolicy.go | 147 ++++ sdk/go/azure/media/job.go | 101 +++ sdk/go/azure/media/liveEvent.go | 92 +++ sdk/go/azure/media/liveEventOutput.go | 90 +++ sdk/go/azure/media/serviceAccount.go | 50 ++ sdk/go/azure/media/streamingEndpoint.go | 141 ++++ sdk/go/azure/media/streamingLocator.go | 77 +++ sdk/go/azure/media/streamingPolicy.go | 117 ++++ sdk/go/azure/media/transform.go | 403 +++++++++++ sdk/go/azure/mediaservices/account.go | 50 ++ .../mixedreality/getSpatialAnchorsAccount.go | 28 + .../mixedreality/spatialAnchorsAccount.go | 34 + sdk/go/azure/mobile/getNetwork.go | 27 + .../mobile/getNetworkAttachedDataNetwork.go | 34 + sdk/go/azure/mobile/getNetworkDataNetwork.go | 34 + .../getNetworkPacketCoreControlPlane.go | 27 + .../mobile/getNetworkPacketCoreDataPlane.go | 34 + sdk/go/azure/mobile/getNetworkService.go | 33 + sdk/go/azure/mobile/getNetworkSimGroup.go | 34 + sdk/go/azure/mobile/getNetworkSimPolicy.go | 34 + sdk/go/azure/mobile/getNetworkSite.go | 34 + sdk/go/azure/mobile/getNetworkSlice.go | 34 + sdk/go/azure/mobile/network.go | 39 ++ sdk/go/azure/mobile/networkDataNetwork.go | 47 ++ .../mobile/networkPacketCoreControlPlane.go | 87 +++ sdk/go/azure/mobile/networkService.go | 91 +++ sdk/go/azure/mobile/networkSim.go | 91 +++ sdk/go/azure/mobile/networkSimGroup.go | 76 +++ sdk/go/azure/mobile/networkSimPolicy.go | 120 ++++ sdk/go/azure/mobile/networkSite.go | 55 ++ sdk/go/azure/mobile/networkSlice.go | 50 ++ .../azure/monitoring/aadDiagnosticSetting.go | 74 ++ sdk/go/azure/monitoring/actionGroup.go | 141 ++++ .../azure/monitoring/actionRuleActionGroup.go | 50 ++ .../azure/monitoring/actionRuleSuppression.go | 55 ++ sdk/go/azure/monitoring/activityLogAlert.go | 73 ++ .../alertProcessingRuleActionGroup.go | 86 +++ .../alertProcessingRuleSuppression.go | 76 +++ sdk/go/azure/monitoring/autoscaleSetting.go | 327 +++++++++ .../monitoring/dataCollectionEndpoint.go | 40 ++ sdk/go/azure/monitoring/dataCollectionRule.go | 282 ++++++++ .../dataCollectionRuleAssociation.go | 132 ++++ sdk/go/azure/monitoring/diagnosticSetting.go | 76 +++ sdk/go/azure/monitoring/getActionGroup.go | 28 + .../monitoring/getDataCollectionEndpoint.go | 28 + .../azure/monitoring/getDataCollectionRule.go | 28 + .../monitoring/getDiagnosticCategories.go | 34 + sdk/go/azure/monitoring/getLogProfile.go | 27 + .../monitoring/getScheduledQueryRulesAlert.go | 28 + .../monitoring/getScheduledQueryRulesLog.go | 28 + sdk/go/azure/monitoring/logProfile.go | 71 ++ sdk/go/azure/monitoring/logzMonitor.go | 45 ++ sdk/go/azure/monitoring/logzSubAccount.go | 65 ++ .../azure/monitoring/logzSubAccountTagRule.go | 86 +++ sdk/go/azure/monitoring/logzTagRule.go | 66 ++ sdk/go/azure/monitoring/metricAlert.go | 83 +++ sdk/go/azure/monitoring/privateLinkScope.go | 33 + .../monitoring/privateLinkScopedService.go | 50 ++ .../monitoring/scheduledQueryRulesLog.go | 101 +++ .../monitoring/smartDetectorAlertRule.go | 60 ++ sdk/go/azure/monitoring/workspace.go | 37 + sdk/go/azure/msi/userAssignedIdentity.go | 34 + sdk/go/azure/mssql/database.go | 62 ++ .../mssql/databaseExtendedAuditingPolicy.go | 63 ++ ...baseVulnerabilityAssessmentRuleBaseline.go | 111 +++ sdk/go/azure/mssql/elasticPool.go | 57 ++ sdk/go/azure/mssql/failoverGroup.go | 78 +++ sdk/go/azure/mssql/firewallRule.go | 45 ++ sdk/go/azure/mssql/getDatabase.go | 44 ++ sdk/go/azure/mssql/getElasticPool.go | 29 + sdk/go/azure/mssql/getManagedInstance.go | 27 + sdk/go/azure/mssql/getServer.go | 28 + sdk/go/azure/mssql/jobAgent.go | 52 ++ sdk/go/azure/mssql/jobCredential.go | 60 ++ sdk/go/azure/mssql/managedDatabase.go | 68 ++ sdk/go/azure/mssql/managedInstance.go | 239 +++++++ ...gedInstanceActiveDirectoryAdministrator.go | 103 +++ .../managedInstanceSecurityAlertPolicy.go | 254 +++++++ ...anagedInstanceTransparentDataEncryption.go | 227 ++++++ .../managedInstanceVulnerabilityAssessment.go | 114 ++++ sdk/go/azure/mssql/outboundFirewallRule.go | 44 ++ sdk/go/azure/mssql/server.go | 158 +++++ sdk/go/azure/mssql/serverDnsAlias.go | 43 ++ .../mssql/serverExtendedAuditingPolicy.go | 200 ++++++ .../serverMicrosoftSupportAuditingPolicy.go | 196 ++++++ .../azure/mssql/serverSecurityAlertPolicy.go | 63 ++ .../mssql/serverTransparentDataEncryption.go | 164 +++++ .../mssql/serverVulnerabilityAssessment.go | 85 +++ sdk/go/azure/mssql/virtualMachine.go | 47 ++ sdk/go/azure/mssql/virtualMachineGroup.go | 40 ++ sdk/go/azure/mssql/virtualNetworkRule.go | 68 ++ .../mysql/activeDirectoryAdministrator.go | 54 ++ sdk/go/azure/mysql/configuration.go | 55 ++ sdk/go/azure/mysql/database.go | 55 ++ sdk/go/azure/mysql/firewallRule.go | 123 ++++ sdk/go/azure/mysql/flexibleDatabase.go | 46 ++ sdk/go/azure/mysql/flexibleServer.go | 92 +++ .../mysql/flexibleServerConfiguration.go | 45 ++ .../azure/mysql/flexibleServerFirewallRule.go | 126 ++++ sdk/go/azure/mysql/getFlexibleServer.go | 28 + sdk/go/azure/mysql/getServer.go | 28 + sdk/go/azure/mysql/server.go | 46 ++ sdk/go/azure/mysql/serverKey.go | 130 ++++ sdk/go/azure/mysql/virtualNetworkRule.go | 74 ++ sdk/go/azure/netapp/account.go | 44 ++ sdk/go/azure/netapp/getAccount.go | 28 + sdk/go/azure/netapp/getPool.go | 29 + sdk/go/azure/netapp/getSnapshot.go | 31 + sdk/go/azure/netapp/getSnapshotPolicy.go | 35 + sdk/go/azure/netapp/getVolume.go | 30 + sdk/go/azure/netapp/getVolumeGroupSapHana.go | 29 + sdk/go/azure/netapp/getVolumeQuotaRule.go | 28 + sdk/go/azure/netapp/pool.go | 44 ++ sdk/go/azure/netapp/snapshot.go | 100 +++ sdk/go/azure/netapp/snapshotPolicy.go | 72 ++ sdk/go/azure/netapp/volumeQuotaRule.go | 135 ++++ sdk/go/azure/network/applicationGateway.go | 151 ++++ .../azure/network/applicationSecurityGroup.go | 37 + sdk/go/azure/network/bgpConnection.go | 84 +++ sdk/go/azure/network/ddosProtectionPlan.go | 34 + sdk/go/azure/network/expressRouteCircuit.go | 44 ++ .../expressRouteCircuitAuthorization.go | 52 ++ .../network/expressRouteCircuitConnection.go | 108 +++ .../network/expressRouteCircuitPeering.go | 134 ++++ .../azure/network/expressRouteConnection.go | 95 +++ sdk/go/azure/network/expressRouteGateway.go | 55 ++ sdk/go/azure/network/expressRoutePort.go | 37 + .../network/expressRoutePortAuthorization.go | 44 ++ sdk/go/azure/network/firewall.go | 72 ++ .../firewallApplicationRuleCollection.go | 98 +++ .../network/firewallNatRuleCollection.go | 101 +++ .../network/firewallNetworkRuleCollection.go | 100 +++ sdk/go/azure/network/firewallPolicy.go | 34 + sdk/go/azure/network/getApplicationGateway.go | 28 + .../network/getApplicationSecurityGroup.go | 28 + .../azure/network/getExpressRouteCircuit.go | 29 + sdk/go/azure/network/getFirewall.go | 28 + sdk/go/azure/network/getFirewallPolicy.go | 28 + sdk/go/azure/network/getGatewayConnection.go | 28 + sdk/go/azure/network/getIpGroup.go | 28 + .../azure/network/getLocalNetworkGateway.go | 28 + .../network/getNetworkDdosProtectionPlan.go | 28 + sdk/go/azure/network/getNetworkInterface.go | 28 + .../azure/network/getNetworkSecurityGroup.go | 28 + sdk/go/azure/network/getNetworkWatcher.go | 28 + sdk/go/azure/network/getPublicIP.go | 118 ++++ sdk/go/azure/network/getPublicIPs.go | 27 + sdk/go/azure/network/getPublicIpPrefix.go | 27 + sdk/go/azure/network/getRouteFilter.go | 28 + sdk/go/azure/network/getRouteTable.go | 27 + sdk/go/azure/network/getServiceTags.go | 30 + sdk/go/azure/network/getSubnet.go | 29 + sdk/go/azure/network/getTrafficManager.go | 26 + .../azure/network/getTrafficManagerProfile.go | 28 + sdk/go/azure/network/getVirtualHub.go | 28 + .../azure/network/getVirtualHubConnection.go | 29 + .../azure/network/getVirtualHubRouteTable.go | 29 + sdk/go/azure/network/getVirtualNetwork.go | 28 + .../azure/network/getVirtualNetworkGateway.go | 28 + sdk/go/azure/network/getVpnGateway.go | 28 + sdk/go/azure/network/ipgroup.go | 42 ++ sdk/go/azure/network/ipgroupCIDR.go | 41 ++ sdk/go/azure/network/localNetworkGateway.go | 38 ++ sdk/go/azure/network/natGateway.go | 41 ++ .../network/natGatewayPublicIpAssociation.go | 51 ++ .../natGatewayPublicIpPrefixAssociation.go | 53 ++ .../azure/network/networkConnectionMonitor.go | 175 +++++ sdk/go/azure/network/networkInterface.go | 61 ++ ...faceApplicationSecurityGroupAssociation.go | 75 ++ ...kInterfaceBackendAddressPoolAssociation.go | 97 +++ .../networkInterfaceNatRuleAssociation.go | 102 +++ ...etworkInterfaceSecurityGroupAssociation.go | 75 ++ sdk/go/azure/network/networkManager.go | 51 ++ .../azure/network/networkManagerAdminRule.go | 103 +++ .../networkManagerAdminRuleCollection.go | 69 ++ ...networkManagerConnectivityConfiguration.go | 82 +++ .../azure/network/networkManagerDeployment.go | 93 +++ ...networkManagerManagementGroupConnection.go | 87 +++ .../network/networkManagerNetworkGroup.go | 54 ++ .../network/networkManagerScopeConnection.go | 65 ++ .../network/networkManagerStaticMember.go | 72 ++ .../networkManagerSubscriptionConnection.go | 54 ++ sdk/go/azure/network/networkPacketCapture.go | 135 ++++ sdk/go/azure/network/networkSecurityGroup.go | 50 ++ sdk/go/azure/network/networkSecurityRule.go | 49 ++ sdk/go/azure/network/networkWatcher.go | 34 + sdk/go/azure/network/networkWatcherFlowLog.go | 83 +++ .../azure/network/pointToPointVpnGateway.go | 99 +++ sdk/go/azure/network/profile.go | 74 ++ sdk/go/azure/network/publicIp.go | 38 ++ sdk/go/azure/network/publicIpPrefix.go | 38 ++ sdk/go/azure/network/pulumiTypes.go | 45 ++ sdk/go/azure/network/route.go | 43 ++ sdk/go/azure/network/routeFilter.go | 35 + sdk/go/azure/network/routeMap.go | 75 ++ sdk/go/azure/network/routeServer.go | 70 ++ .../azure/network/routeServerBgpConnection.go | 78 +++ sdk/go/azure/network/routeTable.go | 45 ++ sdk/go/azure/network/routingIntent.go | 71 ++ .../azure/network/securityPartnerProvider.go | 65 ++ sdk/go/azure/network/subnet.go | 59 ++ .../network/subnetNatGatewayAssociation.go | 61 ++ .../subnetNetworkSecurityGroupAssociation.go | 74 ++ .../network/subnetRouteTableAssociation.go | 69 ++ .../network/trafficManagerAzureEndpoint.go | 66 ++ .../network/trafficManagerExternalEndpoint.go | 57 ++ .../network/trafficManagerNestedEndpoint.go | 84 +++ sdk/go/azure/network/trafficManagerProfile.go | 59 ++ sdk/go/azure/network/virtualHub.go | 43 ++ sdk/go/azure/network/virtualHubConnection.go | 60 ++ sdk/go/azure/network/virtualHubIp.go | 74 ++ sdk/go/azure/network/virtualHubRouteTable.go | 104 +++ .../network/virtualHubRouteTableRoute.go | 108 +++ sdk/go/azure/network/virtualNetwork.go | 62 ++ .../azure/network/virtualNetworkDnsServers.go | 54 ++ sdk/go/azure/network/virtualNetworkGateway.go | 114 ++++ .../virtualNetworkGatewayConnection.go | 245 +++++++ sdk/go/azure/network/virtualNetworkPeering.go | 62 ++ sdk/go/azure/network/virtualWan.go | 34 + sdk/go/azure/network/vnpGatewayNatRule.go | 68 ++ sdk/go/azure/network/vpnGateway.go | 61 ++ sdk/go/azure/network/vpnGatewayConnection.go | 90 +++ .../azure/network/vpnServerConfiguration.go | 65 ++ .../vpnServerConfigurationPolicyGroup.go | 59 ++ sdk/go/azure/network/vpnSite.go | 51 ++ .../networkfunction/azureTrafficCollector.go | 37 + sdk/go/azure/newrelic/monitor.go | 43 ++ sdk/go/azure/newrelic/tagRule.go | 67 ++ sdk/go/azure/nginx/certificate.go | 155 +++++ sdk/go/azure/nginx/deployment.go | 93 +++ .../notificationhub/authorizationRule.go | 55 ++ sdk/go/azure/notificationhub/getHub.go | 29 + sdk/go/azure/notificationhub/getNamespace.go | 28 + sdk/go/azure/notificationhub/hub.go | 44 ++ sdk/go/azure/notificationhub/namespace.go | 36 + .../operationalinsights/analyticsSolution.go | 59 ++ .../operationalinsights/analyticsWorkspace.go | 36 + .../getAnalyticsWorkspace.go | 28 + .../operationalinsights/queryPackQuery.go | 57 ++ sdk/go/azure/orbital/contact.go | 129 ++++ sdk/go/azure/orbital/contactProfile.go | 94 +++ sdk/go/azure/orbital/spacecraft.go | 52 ++ sdk/go/azure/paloalto/localRulestack.go | 34 + .../paloalto/localRulestackCertificate.go | 41 ++ .../azure/paloalto/localRulestackFqdnList.go | 43 ++ ...tackOutboundTrustCertificateAssociation.go | 47 ++ ...ckOutboundUntrustCertificateAssociation.go | 47 ++ .../paloalto/localRulestackPrefixList.go | 43 ++ sdk/go/azure/paloalto/localRulestackRule.go | 55 ++ ...enerationFirewallVirtualNetworkPanorama.go | 131 ++++ sdk/go/azure/pim/activeRoleAssignment.go | 121 ++++ sdk/go/azure/pim/eligibleRoleAssignment.go | 121 ++++ sdk/go/azure/policy/definition.go | 56 ++ sdk/go/azure/policy/getPolicyAssignment.go | 28 + sdk/go/azure/policy/getPolicyDefintion.go | 27 + .../azure/policy/getPolicyDefintionBuiltIn.go | 27 + sdk/go/azure/policy/getPolicySetDefinition.go | 27 + ...etVirtualMachineConfigurationAssignment.go | 29 + sdk/go/azure/policy/policySetDefinition.go | 46 ++ .../virtualMachineConfigurationAssignment.go | 132 ++++ sdk/go/azure/portal/dashboard.go | 167 +++++ sdk/go/azure/portal/getDashboard.go | 28 + .../activeDirectoryAdministrator.go | 53 ++ sdk/go/azure/postgresql/configuration.go | 52 ++ sdk/go/azure/postgresql/database.go | 52 ++ sdk/go/azure/postgresql/firewallRule.go | 84 +++ sdk/go/azure/postgresql/flexibleServer.go | 94 +++ ...xibleServerActiveDirectoryAdministrator.go | 66 ++ .../postgresql/flexibleServerConfiguration.go | 91 +++ .../postgresql/flexibleServerDatabase.go | 47 ++ .../postgresql/flexibleServerFirewallRule.go | 47 ++ sdk/go/azure/postgresql/getFlexibleServer.go | 28 + sdk/go/azure/postgresql/getServer.go | 28 + sdk/go/azure/postgresql/server.go | 45 ++ sdk/go/azure/postgresql/serverKey.go | 129 ++++ sdk/go/azure/postgresql/virtualNetworkRule.go | 74 ++ sdk/go/azure/powerbi/embedded.go | 38 ++ sdk/go/azure/privatedns/aaaarecord.go | 45 ++ sdk/go/azure/privatedns/arecord.go | 44 ++ sdk/go/azure/privatedns/cnameRecord.go | 42 ++ sdk/go/azure/privatedns/getAAAARecord.go | 27 + sdk/go/azure/privatedns/getARecord.go | 28 + sdk/go/azure/privatedns/getCnameRecord.go | 27 + sdk/go/azure/privatedns/getDnsZone.go | 28 + sdk/go/azure/privatedns/getMxRecord.go | 27 + sdk/go/azure/privatedns/getPtrRecord.go | 27 + sdk/go/azure/privatedns/getResolver.go | 27 + .../getResolverDnsForwardingRuleset.go | 27 + .../privatedns/getResolverForwardingRule.go | 27 + .../privatedns/getResolverInboundEndpoint.go | 27 + .../privatedns/getResolverOutboundEndpoint.go | 27 + .../getResolverVirtualNetworkLink.go | 27 + sdk/go/azure/privatedns/getSrvRecord.go | 27 + sdk/go/azure/privatedns/getTxtRecord.go | 27 + .../privatedns/getZoneVirtualNetworkLink.go | 29 + sdk/go/azure/privatedns/linkService.go | 107 +++ sdk/go/azure/privatedns/mxRecord.go | 54 ++ sdk/go/azure/privatedns/ptrrecord.go | 44 ++ sdk/go/azure/privatedns/resolver.go | 46 ++ .../resolverDnsForwardingRuleset.go | 91 +++ .../privatedns/resolverForwardingRule.go | 105 +++ .../privatedns/resolverInboundEndpoint.go | 83 +++ .../privatedns/resolverOutboundEndpoint.go | 78 +++ .../privatedns/resolverVirtualNetworkLink.go | 101 +++ sdk/go/azure/privatedns/srvrecord.go | 58 ++ sdk/go/azure/privatedns/txtRecord.go | 46 ++ sdk/go/azure/privatedns/zone.go | 33 + .../privatedns/zoneVirtualNetworkLink.go | 52 ++ .../applicationSecurityGroupAssociation.go | 141 ++++ .../privatelink/getEndpointConnection.go | 28 + sdk/go/azure/privatelink/getService.go | 28 + .../getServiceEndpointConnections.go | 28 + sdk/go/azure/proximity/getPlacementGroup.go | 28 + sdk/go/azure/proximity/placementGroup.go | 37 + sdk/go/azure/purview/account.go | 37 + sdk/go/azure/recoveryservices/getVault.go | 27 + sdk/go/azure/recoveryservices/vault.go | 36 + .../vaultResourceGuardAssociation.go | 51 ++ sdk/go/azure/redis/cache.go | 41 ++ sdk/go/azure/redis/enterpriseCluster.go | 35 + sdk/go/azure/redis/enterpriseDatabase.go | 65 ++ sdk/go/azure/redis/firewallRule.go | 62 ++ sdk/go/azure/redis/getCache.go | 29 + sdk/go/azure/redis/getEnterpriseDatabase.go | 30 + sdk/go/azure/redis/linkedServer.go | 75 ++ sdk/go/azure/redis/pulumiTypes.go | 124 ++++ sdk/go/azure/relay/hybridConnection.go | 47 ++ .../hybridConnectionAuthorizationRule.go | 58 ++ sdk/go/azure/relay/namespace.go | 38 ++ .../azure/relay/namespaceAuthorizationRule.go | 48 ++ sdk/go/azure/role/assignment.go | 208 ++++++ sdk/go/azure/role/definition.go | 43 ++ sdk/go/azure/search/getService.go | 31 + sdk/go/azure/search/service.go | 105 +++ .../azure/search/sharedPrivateLinkService.go | 54 ++ .../advancedThreatProtection.go | 47 ++ sdk/go/azure/securitycenter/assessment.go | 116 ++++ .../azure/securitycenter/assessmentPolicy.go | 28 + .../azure/securitycenter/autoProvisioning.go | 26 + sdk/go/azure/securitycenter/automation.go | 97 +++ sdk/go/azure/securitycenter/contact.go | 29 + .../serverVulnerabilityAssessment.go | 93 +++ ...erVulnerabilityAssessmentVirtualMachine.go | 93 +++ sdk/go/azure/securitycenter/setting.go | 27 + .../azure/securitycenter/storageDefender.go | 43 ++ .../securitycenter/subscriptionPricing.go | 69 ++ sdk/go/azure/securitycenter/workspace.go | 43 ++ .../azure/sentinel/alertRuleAnomalyBuiltIn.go | 56 ++ .../sentinel/alertRuleAnomalyDuplicate.go | 65 ++ sdk/go/azure/sentinel/alertRuleFusion.go | 57 ++ ...ertRuleMachineLearningBehaviorAnalytics.go | 49 ++ .../sentinel/alertRuleMsSecurityIncident.go | 53 ++ sdk/go/azure/sentinel/alertRuleNrt.go | 51 ++ sdk/go/azure/sentinel/alertRuleScheduled.go | 51 ++ .../sentinel/alertRuleThreatIntelligence.go | 63 ++ sdk/go/azure/sentinel/authomationRule.go | 56 ++ sdk/go/azure/sentinel/automationRule.go | 56 ++ .../sentinel/dataConnectorAwsCloudTrail.go | 49 ++ sdk/go/azure/sentinel/dataConnectorAwsS3.go | 53 ++ .../dataConnectorAzureActiveDirectory.go | 48 ++ ...aConnectorAzureAdvancedThreadProtection.go | 48 ++ .../dataConnectorAzureSecurityCenter.go | 48 ++ .../sentinel/dataConnectorDynamics365.go | 48 ++ sdk/go/azure/sentinel/dataConnectorIot.go | 48 ++ .../dataConnectorMicrosoftCloudAppSecurity.go | 48 ++ ...crosoftDefenderAdvancedThreatProtection.go | 48 ++ ...ataConnectorMicrosoftThreatIntelligence.go | 49 ++ .../dataConnectorMicrosoftThreatProtection.go | 48 ++ .../azure/sentinel/dataConnectorOffice365.go | 48 ++ .../sentinel/dataConnectorOffice365Project.go | 48 ++ .../azure/sentinel/dataConnectorOfficeAtp.go | 48 ++ .../azure/sentinel/dataConnectorOfficeIrm.go | 48 ++ .../sentinel/dataConnectorOfficePowerBi.go | 48 ++ .../dataConnectorThreatIntelligence.go | 48 ++ .../dataConnectorThreatIntelligenceTaxii.go | 51 ++ sdk/go/azure/sentinel/getAlertRule.go | 36 + sdk/go/azure/sentinel/getAlertRuleAnomaly.go | 50 ++ sdk/go/azure/sentinel/getAlertRuleTemplate.go | 28 + .../logAnalyticsWorkspaceOnboarding.go | 44 ++ sdk/go/azure/sentinel/metadata.go | 68 ++ .../sentinel/threatIntelligenceIndicator.go | 57 ++ sdk/go/azure/sentinel/watchlist.go | 50 ++ sdk/go/azure/sentinel/watchlistItem.go | 60 ++ sdk/go/azure/servicebus/getNamespace.go | 28 + .../getNamespaceAuthorizationRule.go | 28 + sdk/go/azure/servicebus/getQueue.go | 28 + .../servicebus/getQueueAuthorizationRule.go | 30 + sdk/go/azure/servicebus/getSubscription.go | 28 + sdk/go/azure/servicebus/getTopic.go | 28 + .../servicebus/getTopicAuthorizationRule.go | 30 + sdk/go/azure/servicebus/namespace.go | 38 ++ .../servicebus/namespaceAuthorizationRule.go | 47 ++ .../namespaceDisasterRecoveryConfig.go | 62 ++ .../servicebus/namespaceNetworkRuleSet.go | 81 +++ sdk/go/azure/servicebus/queue.go | 45 ++ .../servicebus/queueAuthorizationRule.go | 54 ++ sdk/go/azure/servicebus/subscription.go | 52 ++ sdk/go/azure/servicebus/subscriptionRule.go | 124 ++++ sdk/go/azure/servicebus/topic.go | 45 ++ .../servicebus/topicAuthorizationRule.go | 53 ++ sdk/go/azure/servicefabric/cluster.go | 48 ++ sdk/go/azure/servicefabric/managedCluster.go | 53 ++ sdk/go/azure/signalr/getService.go | 27 + sdk/go/azure/signalr/service.go | 64 ++ .../azure/signalr/serviceCustomCertificate.go | 113 +++ sdk/go/azure/signalr/serviceCustomDomain.go | 121 ++++ sdk/go/azure/signalr/serviceNetworkAcl.go | 97 +++ .../signalr/sharedPrivateLinkResource.go | 76 +++ sdk/go/azure/siterecovery/fabric.go | 50 ++ sdk/go/azure/siterecovery/getFabric.go | 28 + .../siterecovery/getProtectionContainer.go | 29 + .../siterecovery/getReplicationPolicy.go | 28 + .../getReplicationRecoveryPlan.go | 35 + .../siterecovery/hyperVReplicationPolicy.go | 45 ++ .../hyperVReplicationPolicyAssociation.go | 58 ++ sdk/go/azure/siterecovery/hyperVSite.go | 43 ++ .../siterecovery/hypervNetworkMapping.go | 56 ++ sdk/go/azure/siterecovery/networkMapping.go | 92 +++ .../azure/siterecovery/protectionContainer.go | 58 ++ .../protectionContainerMapping.go | 94 +++ sdk/go/azure/siterecovery/replicatedVM.go | 257 +++++++ .../azure/siterecovery/replicationPolicy.go | 45 ++ .../siterecovery/replicationRecoveryPlan.go | 274 ++++++++ .../siterecovery/vmwareReplicationPolicy.go | 46 ++ .../vmwareReplicationPolicyAssociation.go | 51 ++ .../azure/sql/activeDirectoryAdministrator.go | 51 ++ sdk/go/azure/sql/database.go | 61 ++ sdk/go/azure/sql/elasticPool.go | 52 ++ sdk/go/azure/sql/failoverGroup.go | 74 ++ sdk/go/azure/sql/firewallRule.go | 46 ++ sdk/go/azure/sql/getDatabase.go | 29 + sdk/go/azure/sql/getServer.go | 28 + sdk/go/azure/sql/getSqlManagedInstance.go | 28 + sdk/go/azure/sql/managedDatabase.go | 69 ++ sdk/go/azure/sql/managedInstance.go | 239 +++++++ ...gedInstanceActiveDirectoryAdministrator.go | 58 ++ sdk/go/azure/sql/sqlServer.go | 50 ++ sdk/go/azure/sql/virtualNetworkRule.go | 69 ++ sdk/go/azure/stack/hciCluster.go | 47 ++ sdk/go/azure/storage/account.go | 111 +++ sdk/go/azure/storage/accountNetworkRules.go | 79 +++ sdk/go/azure/storage/blob.go | 52 ++ sdk/go/azure/storage/blobInventoryPolicy.go | 65 ++ sdk/go/azure/storage/container.go | 46 ++ sdk/go/azure/storage/customerManagedKey.go | 127 ++++ .../azure/storage/dataLakeGen2Filesystem.go | 47 ++ sdk/go/azure/storage/dataLakeGen2Path.go | 53 ++ sdk/go/azure/storage/encryptionScope.go | 46 ++ sdk/go/azure/storage/getAccount.go | 28 + .../storage/getAccountBlobContainerSAS.go | 67 ++ sdk/go/azure/storage/getAccountSAS.go | 72 ++ sdk/go/azure/storage/getBlob.go | 28 + sdk/go/azure/storage/getEncryptionScope.go | 35 + sdk/go/azure/storage/getPolicy.go | 33 + sdk/go/azure/storage/getShare.go | 28 + sdk/go/azure/storage/getStorageContainer.go | 27 + sdk/go/azure/storage/getSync.go | 28 + sdk/go/azure/storage/getSyncGroup.go | 28 + sdk/go/azure/storage/getTableEntity.go | 29 + sdk/go/azure/storage/localUser.go | 73 ++ sdk/go/azure/storage/managementPolicy.go | 104 +++ sdk/go/azure/storage/mover.go | 38 ++ sdk/go/azure/storage/moverAgent.go | 46 ++ sdk/go/azure/storage/moverJobDefinition.go | 97 +++ sdk/go/azure/storage/moverProject.go | 41 ++ sdk/go/azure/storage/moverSourceEndpoint.go | 43 ++ sdk/go/azure/storage/moverTargetEndpoint.go | 60 ++ sdk/go/azure/storage/objectReplication.go | 86 +++ sdk/go/azure/storage/queue.go | 42 ++ sdk/go/azure/storage/share.go | 55 ++ sdk/go/azure/storage/shareDirectory.go | 50 ++ sdk/go/azure/storage/shareFile.go | 50 ++ sdk/go/azure/storage/sync.go | 37 + sdk/go/azure/storage/syncCloudEndpoint.go | 74 ++ sdk/go/azure/storage/syncGroup.go | 40 ++ sdk/go/azure/storage/table.go | 42 ++ sdk/go/azure/storage/tableEntity.go | 54 ++ sdk/go/azure/streamanalytics/cluster.go | 35 + .../streamanalytics/functionJavaScriptUDF.go | 50 ++ .../streamanalytics/functionJavascriptUda.go | 64 ++ sdk/go/azure/streamanalytics/getJob.go | 28 + sdk/go/azure/streamanalytics/job.go | 45 ++ sdk/go/azure/streamanalytics/jobSchedule.go | 117 ++++ .../streamanalytics/managedPrivateEndpoint.go | 56 ++ sdk/go/azure/streamanalytics/outputBlob.go | 70 ++ .../azure/streamanalytics/outputCosmosdb.go | 81 +++ .../azure/streamanalytics/outputEventHub.go | 68 ++ .../azure/streamanalytics/outputFunction.go | 82 +++ sdk/go/azure/streamanalytics/outputMssql.go | 70 ++ sdk/go/azure/streamanalytics/outputPowerbi.go | 44 ++ .../streamanalytics/outputServiceBusQueue.go | 66 ++ .../streamanalytics/outputServicebusTopic.go | 70 ++ sdk/go/azure/streamanalytics/outputSynapse.go | 81 +++ sdk/go/azure/streamanalytics/outputTable.go | 64 ++ .../streamanalytics/referenceInputBlob.go | 69 ++ .../streamanalytics/referenceInputMssql.go | 66 ++ .../azure/streamanalytics/streamInputBlob.go | 69 ++ .../streamanalytics/streamInputEventHub.go | 78 +++ .../streamanalytics/streamInputEventHubV2.go | 75 ++ .../streamanalytics/streamInputIotHub.go | 65 ++ sdk/go/azure/synapse/firewallRule.go | 66 ++ sdk/go/azure/synapse/getWorkspace.go | 28 + .../azure/synapse/integrationRuntimeAzure.go | 79 +++ .../synapse/integrationRuntimeSelfHosted.go | 78 +++ sdk/go/azure/synapse/linkedService.go | 90 +++ .../azure/synapse/managedPrivateEndpoint.go | 87 +++ sdk/go/azure/synapse/privateLinkHub.go | 27 + sdk/go/azure/synapse/roleAssignment.go | 80 +++ sdk/go/azure/synapse/sqlPool.go | 66 ++ .../synapse/sqlPoolExtendedAuditingPolicy.go | 84 +++ .../synapse/sqlPoolSecurityAlertPolicy.go | 97 +++ .../synapse/sqlPoolVulnerabilityAssessment.go | 125 ++++ .../sqlPoolVulnerabilityAssessmentBaseline.go | 116 ++++ .../synapse/sqlPoolWorkloadClassifier.go | 89 +++ sdk/go/azure/synapse/sqlPoolWorkloadGroup.go | 77 +++ sdk/go/azure/synapse/workspace.go | 213 ++++++ sdk/go/azure/synapse/workspaceAadAdmin.go | 114 ++++ .../workspaceExtendedAuditingPolicy.go | 76 +++ sdk/go/azure/synapse/workspaceKey.go | 137 ++++ .../synapse/workspaceSecurityAlertPolicy.go | 89 +++ sdk/go/azure/synapse/workspaceSqlAadAdmin.go | 114 ++++ .../workspaceVulnerabilityAssessment.go | 117 ++++ .../trafficmanager/getGeographicalLocation.go | 26 + sdk/go/azure/trafficmanager/profile.go | 59 ++ sdk/go/azure/videoanalyzer/analyzer.go | 84 +++ sdk/go/azure/videoanalyzer/edgeModule.go | 92 +++ .../voice/servicesCommunicationsGateway.go | 91 +++ .../servicesCommunicationsGatewayTestLine.go | 45 ++ sdk/go/azure/waf/getFirewallPolicy.go | 28 + sdk/go/azure/waf/policy.go | 134 ++++ .../azure/webpubsub/getPrivateLinkResource.go | 39 ++ sdk/go/azure/webpubsub/getService.go | 27 + sdk/go/azure/webpubsub/hub.go | 106 +++ sdk/go/azure/webpubsub/networkAcl.go | 98 +++ sdk/go/azure/webpubsub/service.go | 45 ++ .../webpubsub/sharedPrivateLinkResource.go | 74 ++ sdk/nodejs/aadb2c/directory.ts | 16 + sdk/nodejs/aadb2c/getDirectory.ts | 26 + sdk/nodejs/advisor/getRecommendations.ts | 32 + sdk/nodejs/analysisservices/server.ts | 26 + sdk/nodejs/apimanagement/api.ts | 28 + sdk/nodejs/apimanagement/apiDiagnostic.ts | 84 +++ sdk/nodejs/apimanagement/apiOperation.ts | 27 + .../apimanagement/apiOperationPolicy.ts | 42 ++ sdk/nodejs/apimanagement/apiOperationTag.ts | 31 + sdk/nodejs/apimanagement/apiPolicy.ts | 25 + sdk/nodejs/apimanagement/apiRelease.ts | 29 + sdk/nodejs/apimanagement/apiSchema.ts | 23 + sdk/nodejs/apimanagement/apiTag.ts | 20 + sdk/nodejs/apimanagement/apiVersionSet.ts | 22 + .../apimanagement/authorizationServer.ts | 22 + sdk/nodejs/apimanagement/backend.ts | 22 + sdk/nodejs/apimanagement/certificate.ts | 80 +++ sdk/nodejs/apimanagement/customDomain.ts | 74 ++ sdk/nodejs/apimanagement/diagnostic.ts | 71 ++ sdk/nodejs/apimanagement/emailTemplate.ts | 33 + sdk/nodejs/apimanagement/gateway.ts | 26 + sdk/nodejs/apimanagement/gatewayApi.ts | 26 + .../gatewayCertificateAuthority.ts | 38 ++ .../gatewayHostNameConfiguration.ts | 42 ++ sdk/nodejs/apimanagement/getApi.ts | 30 + sdk/nodejs/apimanagement/getApiVersionSet.ts | 28 + sdk/nodejs/apimanagement/getGateway.ts | 32 + .../getGatewayHostNameConfiguration.ts | 44 ++ sdk/nodejs/apimanagement/getGroup.ts | 28 + sdk/nodejs/apimanagement/getProduct.ts | 28 + sdk/nodejs/apimanagement/getService.ts | 26 + sdk/nodejs/apimanagement/globalSchema.ts | 24 + sdk/nodejs/apimanagement/group.ts | 22 + sdk/nodejs/apimanagement/groupUser.ts | 19 + .../apimanagement/identityProviderAad.ts | 23 + .../apimanagement/identityProviderAadb2c.ts | 35 + .../apimanagement/identityProviderFacebook.ts | 22 + .../apimanagement/identityProviderGoogle.ts | 22 + .../identityProviderMicrosoft.ts | 22 + .../apimanagement/identityProviderTwitter.ts | 22 + sdk/nodejs/apimanagement/logger.ts | 29 + sdk/nodejs/apimanagement/namedValue.ts | 22 + .../notificationRecipientEmail.ts | 21 + .../notificationRecipientUser.ts | 30 + .../apimanagement/openIdConnectProvider.ts | 24 + sdk/nodejs/apimanagement/policy.ts | 27 + sdk/nodejs/apimanagement/product.ts | 25 + sdk/nodejs/apimanagement/productApi.ts | 29 + sdk/nodejs/apimanagement/productGroup.ts | 28 + sdk/nodejs/apimanagement/productPolicy.ts | 24 + sdk/nodejs/apimanagement/productTag.ts | 31 + sdk/nodejs/apimanagement/redisCache.ts | 33 + sdk/nodejs/apimanagement/service.ts | 16 + sdk/nodejs/apimanagement/subscription.ts | 29 + sdk/nodejs/apimanagement/tag.ts | 17 + sdk/nodejs/apimanagement/user.ts | 25 + .../appconfiguration/configurationFeature.ts | 25 + .../appconfiguration/configurationKey.ts | 79 +++ .../appconfiguration/configurationStore.ts | 114 ++++ .../appconfiguration/getConfigurationKey.ts | 28 + .../appconfiguration/getConfigurationKeys.ts | 24 + .../appconfiguration/getConfigurationStore.ts | 26 + .../appconfiguration/licationLoadBalancer.ts | 13 + sdk/nodejs/appinsights/analyticsItem.ts | 20 + sdk/nodejs/appinsights/apiKey.ts | 48 ++ sdk/nodejs/appinsights/getInsights.ts | 26 + sdk/nodejs/appinsights/insights.ts | 38 ++ sdk/nodejs/appinsights/smartDetectionRule.ts | 18 + sdk/nodejs/appinsights/standardWebTest.ts | 23 + sdk/nodejs/appinsights/webTest.ts | 35 + sdk/nodejs/appinsights/workbook.ts | 29 + sdk/nodejs/appinsights/workbookTemplate.ts | 66 ++ sdk/nodejs/appplatform/getSpringCloudApp.ts | 28 + .../appplatform/getSpringCloudService.ts | 26 + .../appplatform/springCloudAccelerator.ts | 15 + .../springCloudActiveDeployment.ts | 37 + .../appplatform/springCloudApiPortal.ts | 28 + .../springCloudApiPortalCustomDomain.ts | 20 + sdk/nodejs/appplatform/springCloudApp.ts | 20 + .../springCloudAppCosmosDBAssociation.ts | 36 + .../springCloudAppMysqlAssociation.ts | 41 ++ .../springCloudAppRedisAssociation.ts | 31 + ...nsightsApplicationPerformanceMonitoring.ts | 28 + .../springCloudApplicationLiveView.ts | 15 + .../appplatform/springCloudBuildDeployment.ts | 31 + .../springCloudBuildPackBinding.ts | 39 ++ sdk/nodejs/appplatform/springCloudBuilder.ts | 25 + .../appplatform/springCloudCertificate.ts | 92 +++ .../springCloudConfigurationService.ts | 30 + .../appplatform/springCloudConnection.ts | 54 ++ .../springCloudContainerDeployment.ts | 35 + .../springCloudCustomizedAccelerator.ts | 30 + .../appplatform/springCloudDevToolPortal.ts | 31 + sdk/nodejs/appplatform/springCloudGateway.ts | 45 ++ .../springCloudGatewayCustomDomain.ts | 16 + .../springCloudGatewayRouteConfig.ts | 41 ++ .../appplatform/springCloudJavaDeployment.ts | 34 + sdk/nodejs/appplatform/springCloudService.ts | 34 + sdk/nodejs/appplatform/springCloudStorage.ts | 24 + sdk/nodejs/appservice/activeSlot.ts | 24 + sdk/nodejs/appservice/appConnection.ts | 61 ++ sdk/nodejs/appservice/appService.ts | 36 + sdk/nodejs/appservice/certificate.ts | 18 + sdk/nodejs/appservice/certificateOrder.ts | 15 + sdk/nodejs/appservice/connection.ts | 54 ++ .../appservice/customHostnameBinding.ts | 34 + sdk/nodejs/appservice/environment.ts | 39 ++ sdk/nodejs/appservice/functionApp.ts | 94 +++ .../appservice/functionAppActiveSlot.ts | 66 ++ sdk/nodejs/appservice/functionAppFunction.ts | 121 ++++ .../appservice/functionAppHybridConnection.ts | 50 ++ sdk/nodejs/appservice/functionAppSlot.ts | 37 + sdk/nodejs/appservice/getAppService.ts | 26 + .../appservice/getAppServiceEnvironment.ts | 26 + sdk/nodejs/appservice/getAppServicePlan.ts | 26 + sdk/nodejs/appservice/getCertificate.ts | 26 + sdk/nodejs/appservice/getCertificateOrder.ts | 26 + sdk/nodejs/appservice/getEnvironmentV3.ts | 26 + sdk/nodejs/appservice/getFunctionApp.ts | 24 + .../appservice/getFunctionAppHostKeys.ts | 24 + sdk/nodejs/appservice/getLinuxFunctionApp.ts | 26 + sdk/nodejs/appservice/getLinuxWebApp.ts | 26 + sdk/nodejs/appservice/getServicePlan.ts | 26 + .../appservice/getSourceControlToken.ts | 26 + .../appservice/getWindowsFunctionApp.ts | 26 + sdk/nodejs/appservice/getWindowsWebApp.ts | 26 + sdk/nodejs/appservice/hybridConnection.ts | 42 ++ sdk/nodejs/appservice/linuxFunctionApp.ts | 29 + sdk/nodejs/appservice/linuxFunctionAppSlot.ts | 33 + sdk/nodejs/appservice/linuxWebApp.ts | 21 + sdk/nodejs/appservice/linuxWebAppSlot.ts | 25 + sdk/nodejs/appservice/plan.ts | 69 ++ sdk/nodejs/appservice/publicCertificate.ts | 30 + sdk/nodejs/appservice/servicePlan.ts | 15 + sdk/nodejs/appservice/slot.ts | 100 +++ .../appservice/slotCustomHostnameBinding.ts | 32 + .../slotVirtualNetworkSwiftConnection.ts | 50 ++ sdk/nodejs/appservice/sourceCodeToken.ts | 12 + sdk/nodejs/appservice/sourceControl.ts | 26 + sdk/nodejs/appservice/sourceControlSlot.ts | 30 + sdk/nodejs/appservice/sourceControlToken.ts | 12 + sdk/nodejs/appservice/staticSite.ts | 12 + .../appservice/staticSiteCustomDomain.ts | 48 ++ .../virtualNetworkSwiftConnection.ts | 92 +++ sdk/nodejs/appservice/webAppActiveSlot.ts | 25 + .../appservice/webAppHybridConnection.ts | 36 + sdk/nodejs/appservice/windowsFunctionApp.ts | 29 + .../appservice/windowsFunctionAppSlot.ts | 33 + sdk/nodejs/appservice/windowsWebApp.ts | 21 + sdk/nodejs/appservice/windowsWebAppSlot.ts | 25 + sdk/nodejs/arc/privateLinkScope.ts | 13 + sdk/nodejs/arc/resourceBridgeAppliance.ts | 21 + sdk/nodejs/arckubernetes/clusterExtension.ts | 25 + sdk/nodejs/arckubernetes/fluxConfiguration.ts | 39 ++ sdk/nodejs/arcmachine/get.ts | 26 + sdk/nodejs/attestation/provider.ts | 15 + sdk/nodejs/authorization/assignment.ts | 89 +++ .../authorization/getUserAssignedIdentity.ts | 28 + sdk/nodejs/authorization/roleDefinition.ts | 18 + .../authorization/userAssignedIdentity.ts | 13 + sdk/nodejs/automanage/configuration.ts | 68 ++ sdk/nodejs/automation/account.ts | 17 + sdk/nodejs/automation/boolVariable.ts | 19 + sdk/nodejs/automation/certificate.ts | 22 + sdk/nodejs/automation/connection.ts | 26 + .../automation/connectionCertificate.ts | 27 + .../connectionClassicCertificate.ts | 22 + .../automation/connectionServicePrincipal.ts | 24 + sdk/nodejs/automation/connectionType.ts | 23 + sdk/nodejs/automation/credential.ts | 21 + sdk/nodejs/automation/dateTimeVariable.ts | 19 + sdk/nodejs/automation/dscConfiguration.ts | 20 + sdk/nodejs/automation/dscNodeConfiguration.ts | 48 ++ sdk/nodejs/automation/getAccount.ts | 26 + sdk/nodejs/automation/getBoolVariable.ts | 28 + sdk/nodejs/automation/getDateTimeVariable.ts | 28 + sdk/nodejs/automation/getIntVariable.ts | 28 + sdk/nodejs/automation/getStringVariable.ts | 28 + sdk/nodejs/automation/getVariables.ts | 32 + sdk/nodejs/automation/hybridRunbookWorker.ts | 64 ++ .../automation/hybridRunbookWorkerGroup.ts | 18 + sdk/nodejs/automation/intVariable.ts | 19 + sdk/nodejs/automation/jobSchedule.ts | 20 + sdk/nodejs/automation/module.ts | 21 + sdk/nodejs/automation/python3Package.ts | 25 + sdk/nodejs/automation/runBook.ts | 53 ++ sdk/nodejs/automation/schedule.ts | 24 + .../automation/softwareUpdateConfiguration.ts | 46 ++ sdk/nodejs/automation/sourceControl.ts | 25 + sdk/nodejs/automation/stringVariable.ts | 19 + sdk/nodejs/automation/variableObject.ts | 22 + sdk/nodejs/automation/watcher.ts | 44 ++ sdk/nodejs/automation/webhook.ts | 36 + sdk/nodejs/avs/cluster.ts | 26 + sdk/nodejs/avs/expressRouteAuthorization.ts | 22 + sdk/nodejs/avs/getPrivateCloud.ts | 30 + sdk/nodejs/avs/privateCloud.ts | 23 + sdk/nodejs/backup/containerStorageAccount.ts | 25 + sdk/nodejs/backup/getPolicyFileshare.ts | 26 + sdk/nodejs/backup/getPolicyVM.ts | 26 + sdk/nodejs/backup/policyFileShare.ts | 52 ++ sdk/nodejs/backup/policyVM.ts | 52 ++ sdk/nodejs/backup/policyVMWorkload.ts | 45 ++ sdk/nodejs/backup/protectedFileShare.ts | 47 ++ sdk/nodejs/backup/protectedVM.ts | 35 + sdk/nodejs/batch/account.ts | 25 + sdk/nodejs/batch/application.ts | 26 + sdk/nodejs/batch/certificate.ts | 35 + sdk/nodejs/batch/getAccount.ts | 26 + sdk/nodejs/batch/getApplication.ts | 28 + sdk/nodejs/batch/getCertificate.ts | 28 + sdk/nodejs/batch/getPool.ts | 26 + sdk/nodejs/batch/job.ts | 29 + sdk/nodejs/batch/pool.ts | 83 +++ .../billing/accountCostManagementExport.ts | 30 + .../billing/getEnrollmentAccountScope.ts | 26 + sdk/nodejs/billing/getMcaAccountScope.ts | 28 + sdk/nodejs/billing/getMpaAccountScope.ts | 26 + sdk/nodejs/blueprint/assignment.ts | 67 ++ sdk/nodejs/blueprint/getDefinition.ts | 32 + sdk/nodejs/blueprint/getPublishedVersion.ts | 28 + sdk/nodejs/bot/channelAlexa.ts | 22 + sdk/nodejs/bot/channelDirectLine.ts | 25 + sdk/nodejs/bot/channelDirectLineSpeech.ts | 29 + sdk/nodejs/bot/channelEmail.ts | 23 + sdk/nodejs/bot/channelFacebook.ts | 27 + sdk/nodejs/bot/channelLine.ts | 25 + sdk/nodejs/bot/channelSlack.ts | 24 + sdk/nodejs/bot/channelSms.ts | 24 + sdk/nodejs/bot/channelTeams.ts | 21 + sdk/nodejs/bot/channelWebChat.ts | 24 + sdk/nodejs/bot/channelsRegistration.ts | 16 + sdk/nodejs/bot/connection.ts | 24 + sdk/nodejs/bot/healthbot.ts | 14 + sdk/nodejs/bot/serviceAzureBot.ts | 37 + sdk/nodejs/bot/webApp.ts | 16 + sdk/nodejs/cdn/endpoint.ts | 23 + sdk/nodejs/cdn/endpointCustomDomain.ts | 43 ++ sdk/nodejs/cdn/frontdoorCustomDomain.ts | 43 ++ sdk/nodejs/cdn/frontdoorEndpoint.ts | 19 + sdk/nodejs/cdn/frontdoorFirewallPolicy.ts | 113 +++ sdk/nodejs/cdn/frontdoorOriginGroup.ts | 29 + sdk/nodejs/cdn/frontdoorProfile.ts | 16 + ...rontdoorRouteDisableLinkToDefaultDomain.ts | 15 + sdk/nodejs/cdn/frontdoorRuleSet.ts | 14 + sdk/nodejs/cdn/frontdoorSecret.ts | 63 ++ sdk/nodejs/cdn/getFrontdoorCustomDomain.ts | 26 + sdk/nodejs/cdn/getFrontdoorEndpoint.ts | 26 + sdk/nodejs/cdn/getFrontdoorFirewallPolicy.ts | 24 + sdk/nodejs/cdn/getFrontdoorOriginGroup.ts | 26 + sdk/nodejs/cdn/getFrontdoorProfile.ts | 24 + sdk/nodejs/cdn/getFrontdoorRuleSet.ts | 26 + sdk/nodejs/cdn/getFrontdoorSecret.ts | 26 + sdk/nodejs/cdn/getProfile.ts | 26 + sdk/nodejs/cdn/profile.ts | 18 + sdk/nodejs/cognitive/account.ts | 18 + .../cognitive/accountCustomerManagedKey.ts | 112 +++ sdk/nodejs/cognitive/deployment.ts | 26 + sdk/nodejs/cognitive/getAccount.ts | 26 + sdk/nodejs/communication/emailService.ts | 13 + sdk/nodejs/communication/getService.ts | 26 + sdk/nodejs/communication/service.ts | 13 + sdk/nodejs/compute/availabilitySet.ts | 16 + sdk/nodejs/compute/bastionHost.ts | 36 + sdk/nodejs/compute/capacityReservation.ts | 20 + .../compute/capacityReservationGroup.ts | 13 + sdk/nodejs/compute/dataDiskAttachment.ts | 70 ++ sdk/nodejs/compute/dedicatedHost.ts | 20 + sdk/nodejs/compute/dedicatedHostGroup.ts | 14 + sdk/nodejs/compute/diskAccess.ts | 12 + sdk/nodejs/compute/diskEncryptionSet.ts | 158 +++++ sdk/nodejs/compute/diskPool.ts | 33 + sdk/nodejs/compute/diskPoolIscsiTarget.ts | 71 ++ sdk/nodejs/compute/diskPoolIscsiTargetLun.ts | 75 ++ .../compute/diskPoolManagedDiskAttachment.ts | 64 ++ sdk/nodejs/compute/extension.ts | 75 ++ sdk/nodejs/compute/galleryApplication.ts | 18 + .../compute/galleryApplicationVersion.ts | 49 ++ sdk/nodejs/compute/getAvailabilitySet.ts | 26 + sdk/nodejs/compute/getBastionHost.ts | 26 + sdk/nodejs/compute/getConfidentialLedger.ts | 26 + sdk/nodejs/compute/getDedicatedHost.ts | 28 + sdk/nodejs/compute/getDedicatedHostGroup.ts | 26 + sdk/nodejs/compute/getDiskAccess.ts | 26 + sdk/nodejs/compute/getDiskEncryptionSet.ts | 26 + sdk/nodejs/compute/getImage.ts | 26 + sdk/nodejs/compute/getImages.ts | 22 + sdk/nodejs/compute/getManagedDisk.ts | 26 + .../getOrchestratedVirtualMachineScaleSet.ts | 26 + sdk/nodejs/compute/getPlatformImage.ts | 30 + sdk/nodejs/compute/getSharedImage.ts | 26 + sdk/nodejs/compute/getSharedImageGallery.ts | 24 + sdk/nodejs/compute/getSharedImageVersion.ts | 28 + sdk/nodejs/compute/getSharedImageVersions.ts | 26 + sdk/nodejs/compute/getSnapshot.ts | 24 + sdk/nodejs/compute/getSshPublicKey.ts | 26 + sdk/nodejs/compute/getVirtualMachine.ts | 26 + .../compute/getVirtualMachineScaleSet.ts | 26 + sdk/nodejs/compute/linuxVirtualMachine.ts | 52 ++ .../compute/linuxVirtualMachineScaleSet.ts | 52 ++ sdk/nodejs/compute/managedDisk.ts | 47 ++ sdk/nodejs/compute/managedDiskSasToken.ts | 21 + .../orchestratedVirtualMachineScaleSet.ts | 15 + sdk/nodejs/compute/packetCapture.ts | 82 +++ sdk/nodejs/compute/scaleSet.ts | 200 ++++++ sdk/nodejs/compute/scaleSetPacketCapture.ts | 76 +++ sdk/nodejs/compute/sharedImage.ts | 29 + sdk/nodejs/compute/sharedImageGallery.ts | 18 + sdk/nodejs/compute/sharedImageVersion.ts | 29 + sdk/nodejs/compute/snapshot.ts | 22 + sdk/nodejs/compute/sshPublicKey.ts | 14 + sdk/nodejs/compute/virtualMachine.ts | 60 ++ .../virtualMachineScaleSetExtension.ts | 53 ++ sdk/nodejs/compute/windowsVirtualMachine.ts | 48 ++ .../compute/windowsVirtualMachineScaleSet.ts | 48 ++ sdk/nodejs/confidentialledger/ledger.ts | 20 + sdk/nodejs/connections/apiConnection.ts | 29 + sdk/nodejs/connections/getManagedApi.ts | 26 + .../consumption/budgetManagementGroup.ts | 53 ++ sdk/nodejs/consumption/budgetResourceGroup.ts | 58 ++ sdk/nodejs/consumption/budgetSubscription.ts | 59 ++ .../consumption/getBudgetResourceGroup.ts | 26 + .../consumption/getBudgetSubscription.ts | 26 + sdk/nodejs/containerapp/app.ts | 33 + sdk/nodejs/containerapp/environment.ts | 20 + .../containerapp/environmentDaprComponent.ts | 25 + sdk/nodejs/containerapp/environmentStorage.ts | 37 + sdk/nodejs/containerapp/getApp.ts | 24 + sdk/nodejs/containerapp/getEnvironment.ts | 24 + .../containerapp/getEnvironmentCertificate.ts | 32 + .../clusterTrustedAccessRoleBinding.ts | 62 ++ .../containerservice/connectedRegistry.ts | 39 ++ .../containerservice/fluxConfiguration.ts | 40 ++ .../containerservice/getClusterNodePool.ts | 28 + sdk/nodejs/containerservice/getGroup.ts | 30 + .../containerservice/getKubernetesCluster.ts | 24 + .../getKubernetesNodePoolSnapshot.ts | 24 + .../getKubernetesServiceVersions.ts | 26 + sdk/nodejs/containerservice/getRegistry.ts | 26 + .../containerservice/getRegistryScopeMap.ts | 28 + .../containerservice/getRegistryToken.ts | 28 + sdk/nodejs/containerservice/group.ts | 39 ++ .../containerservice/kubernetesCluster.ts | 107 +++ .../kubernetesClusterExtension.ts | 26 + .../kubernetesClusterNodePool.ts | 33 + .../kubernetesFleetManager.ts | 12 + sdk/nodejs/containerservice/registry.ts | 92 +++ .../containerservice/registryAgentPool.ts | 19 + .../containerservice/registryScopeMap.ts | 29 + sdk/nodejs/containerservice/registryTask.ts | 26 + .../registryTaskScheduleRunNow.ts | 27 + sdk/nodejs/containerservice/registryToken.ts | 34 + .../containerservice/registryWebhook.ts | 27 + sdk/nodejs/containerservice/registryWebook.ts | 27 + sdk/nodejs/core/customProvider.ts | 17 + sdk/nodejs/core/getClientConfig.ts | 20 + sdk/nodejs/core/getExtendedLocations.ts | 22 + sdk/nodejs/core/getResourceGroup.ts | 24 + sdk/nodejs/core/getSubscription.ts | 20 + sdk/nodejs/core/getSubscriptions.ts | 22 + sdk/nodejs/core/getTemplateSpecVersion.ts | 28 + sdk/nodejs/core/getUserAssignedIdentity.ts | 28 + sdk/nodejs/core/portalTenantConfiguration.ts | 9 + .../core/resourceDeploymentScriptAzureCli.ts | 31 + .../resourceDeploymentScriptPowerShell.ts | 36 + sdk/nodejs/core/resourceGroup.ts | 9 + .../core/resourceGroupCostManagementExport.ts | 30 + .../core/resourceGroupCostManagementView.ts | 24 + .../core/resourceGroupPolicyAssignment.ts | 39 ++ .../core/resourceGroupPolicyExemption.ts | 26 + sdk/nodejs/core/resourcePolicyAssignment.ts | 33 + sdk/nodejs/core/resourcePolicyExemption.ts | 30 + .../core/resourceProviderRegistration.ts | 20 + sdk/nodejs/core/subscription.ts | 58 ++ .../core/subscriptionCostManagementExport.ts | 31 + .../core/subscriptionCostManagementView.ts | 23 + .../core/subscriptionPolicyAssignment.ts | 30 + .../core/subscriptionPolicyExemption.ts | 25 + .../core/subscriptionTemplateDeployment.ts | 28 + sdk/nodejs/core/templateDeployment.ts | 74 ++ sdk/nodejs/core/tenantTemplateDeployment.ts | 17 + sdk/nodejs/cosmosdb/account.ts | 50 ++ sdk/nodejs/cosmosdb/cassandraCluster.ts | 40 ++ sdk/nodejs/cosmosdb/cassandraDatacenter.ts | 49 ++ sdk/nodejs/cosmosdb/cassandraKeyspace.ts | 29 + sdk/nodejs/cosmosdb/cassandraTable.ts | 47 ++ sdk/nodejs/cosmosdb/getAccount.ts | 26 + sdk/nodejs/cosmosdb/getMongoDatabase.ts | 28 + .../cosmosdb/getRestorableDatabaseAccounts.ts | 26 + sdk/nodejs/cosmosdb/getSqlDatabase.ts | 26 + sdk/nodejs/cosmosdb/getSqlRoleDefinition.ts | 26 + sdk/nodejs/cosmosdb/gremlinDatabase.ts | 17 + sdk/nodejs/cosmosdb/gremlinGraph.ts | 41 ++ sdk/nodejs/cosmosdb/mongoCollection.ts | 28 + sdk/nodejs/cosmosdb/mongoDatabase.ts | 17 + sdk/nodejs/cosmosdb/mongoRoleDefinition.ts | 38 ++ sdk/nodejs/cosmosdb/mongoUserDefinition.ts | 39 ++ sdk/nodejs/cosmosdb/notebookWorkspace.ts | 26 + sdk/nodejs/cosmosdb/postgresqlCluster.ts | 17 + .../postgresqlCoordinatorConfiguration.ts | 23 + sdk/nodejs/cosmosdb/postgresqlFirewallRule.ts | 22 + .../cosmosdb/postgresqlNodeConfiguration.ts | 23 + sdk/nodejs/cosmosdb/postgresqlRole.ts | 21 + sdk/nodejs/cosmosdb/sqlContainer.ts | 44 ++ sdk/nodejs/cosmosdb/sqlDatabase.ts | 17 + sdk/nodejs/cosmosdb/sqlDedicatedGateway.ts | 27 + sdk/nodejs/cosmosdb/sqlFunction.ts | 27 + sdk/nodejs/cosmosdb/sqlRoleAssignment.ts | 39 ++ sdk/nodejs/cosmosdb/sqlRoleDefinition.ts | 32 + sdk/nodejs/cosmosdb/sqlStoredProcedure.ts | 30 + sdk/nodejs/cosmosdb/sqlTrigger.ts | 29 + sdk/nodejs/cosmosdb/table.ts | 17 + sdk/nodejs/costmanagement/anomalyAlert.ts | 13 + sdk/nodejs/costmanagement/scheduledAction.ts | 19 + .../dashboard/azurerm_portal_dashboard.ts | 26 + sdk/nodejs/dashboard/dashboard.ts | 132 ++++ sdk/nodejs/dashboard/grafana.ts | 22 + sdk/nodejs/databasemigration/getProject.ts | 28 + sdk/nodejs/databasemigration/getService.ts | 26 + sdk/nodejs/databasemigration/project.ts | 32 + sdk/nodejs/databasemigration/service.ts | 25 + sdk/nodejs/databoxedge/device.ts | 14 + sdk/nodejs/databoxedge/getDevice.ts | 24 + sdk/nodejs/databoxedge/order.ts | 31 + sdk/nodejs/databricks/accessConnector.ts | 19 + sdk/nodejs/databricks/getWorkspace.ts | 26 + .../getWorkspacePrivateEndpointConnection.ts | 26 + .../databricks/virtualNetworkPeering.ts | 32 + sdk/nodejs/datadog/monitor.ts | 41 ++ sdk/nodejs/datadog/monitorSsoConfiguration.ts | 28 + sdk/nodejs/datadog/monitorTagRule.ts | 36 + sdk/nodejs/datafactory/customDataset.ts | 90 +++ sdk/nodejs/datafactory/dataFlow.ts | 140 ++++ sdk/nodejs/datafactory/datasetAzureBlob.ts | 27 + .../datafactory/datasetAzureSqlTable.ts | 21 + sdk/nodejs/datafactory/datasetBinary.ts | 29 + sdk/nodejs/datafactory/datasetCosmosDBApi.ts | 27 + .../datafactory/datasetDelimitedText.ts | 34 + sdk/nodejs/datafactory/datasetHttp.ts | 25 + sdk/nodejs/datafactory/datasetJson.ts | 28 + sdk/nodejs/datafactory/datasetMysql.ts | 21 + sdk/nodejs/datafactory/datasetParquet.ts | 27 + sdk/nodejs/datafactory/datasetPostgresql.ts | 21 + sdk/nodejs/datafactory/datasetSnowflake.ts | 23 + .../datafactory/datasetSqlServerTable.ts | 21 + sdk/nodejs/datafactory/factory.ts | 13 + sdk/nodejs/datafactory/flowletDataFlow.ts | 134 ++++ sdk/nodejs/datafactory/getFactory.ts | 26 + .../datafactory/integrationRuntimeManaged.ts | 18 + .../datafactory/integrationRuntimeRule.ts | 17 + .../integrationRuntimeSelfHosted.ts | 14 + .../datafactory/integrationRuntimeSsis.ts | 18 + sdk/nodejs/datafactory/linkedCustomService.ts | 41 ++ .../linkedServiceAzureBlobStorage.ts | 62 ++ .../linkedServiceAzureDatabricks.ts | 78 +++ .../linkedServiceAzureFileStorage.ts | 21 + .../datafactory/linkedServiceAzureFunction.ts | 22 + .../linkedServiceAzureSqlDatabase.ts | 17 + .../linkedServiceAzureTableStorage.ts | 21 + .../datafactory/linkedServiceCosmosDb.ts | 23 + .../linkedServiceCosmosDbMongoApi.ts | 18 + .../linkedServiceDataLakeStorageGen2.ts | 21 + .../datafactory/linkedServiceKeyVault.ts | 24 + sdk/nodejs/datafactory/linkedServiceKusto.ts | 44 ++ sdk/nodejs/datafactory/linkedServiceMysql.ts | 17 + sdk/nodejs/datafactory/linkedServiceOdata.ts | 25 + sdk/nodejs/datafactory/linkedServiceOdbc.ts | 25 + .../datafactory/linkedServicePostgresql.ts | 17 + sdk/nodejs/datafactory/linkedServiceSftp.ts | 21 + .../datafactory/linkedServiceSnowflake.ts | 48 ++ .../datafactory/linkedServiceSqlServer.ts | 48 ++ .../datafactory/linkedServiceSynapse.ts | 48 ++ sdk/nodejs/datafactory/linkedServiceWeb.ts | 18 + .../datafactory/managedPrivateEndpoint.ts | 26 + sdk/nodejs/datafactory/pipeline.ts | 40 ++ sdk/nodejs/datafactory/triggerBlobEvent.ts | 47 ++ sdk/nodejs/datafactory/triggerCustomEvent.ts | 44 ++ sdk/nodejs/datafactory/triggerSchedule.ts | 20 + .../datafactory/triggerTumblingWindow.ts | 46 ++ .../backupInstanceBlogStorage.ts | 41 ++ .../dataprotection/backupInstanceDisk.ts | 47 ++ .../backupInstancePostgresql.ts | 105 +++ .../dataprotection/backupPolicyBlobStorage.ts | 19 + sdk/nodejs/dataprotection/backupPolicyDisk.ts | 38 ++ .../dataprotection/backupPolicyPostgresql.ts | 53 ++ sdk/nodejs/dataprotection/backupVault.ts | 15 + sdk/nodejs/dataprotection/getBackupVault.ts | 28 + sdk/nodejs/dataprotection/resourceGuard.ts | 13 + sdk/nodejs/datashare/account.ts | 19 + sdk/nodejs/datashare/datasetBlobStorage.ts | 51 ++ sdk/nodejs/datashare/datasetDataLakeGen2.ts | 45 ++ sdk/nodejs/datashare/datasetKustoCluster.ts | 39 ++ sdk/nodejs/datashare/datasetKustoDatabase.ts | 44 ++ sdk/nodejs/datashare/getAccount.ts | 26 + sdk/nodejs/datashare/getDatasetBlobStorage.ts | 26 + .../datashare/getDatasetDataLakeGen2.ts | 26 + .../datashare/getDatasetKustoCluster.ts | 26 + .../datashare/getDatasetKustoDatabase.ts | 26 + sdk/nodejs/datashare/getShare.ts | 34 + sdk/nodejs/datashare/share.ts | 30 + .../desktopvirtualization/application.ts | 41 ++ .../desktopvirtualization/applicationGroup.ts | 38 ++ .../desktopvirtualization/getHostPool.ts | 24 + .../getHostPoolRegistrationInfo.ts | 20 + sdk/nodejs/desktopvirtualization/hostPool.ts | 28 + .../desktopvirtualization/scalingPlan.ts | 90 +++ sdk/nodejs/desktopvirtualization/workspace.ts | 15 + .../workspaceApplicationGroupAssociation.ts | 29 + sdk/nodejs/devcenter/devCenter.ts | 16 + sdk/nodejs/devcenter/project.ts | 21 + sdk/nodejs/devtest/getLab.ts | 26 + sdk/nodejs/devtest/getVirtualNetwork.ts | 28 + .../devtest/globalVMShutdownSchedule.ts | 60 ++ sdk/nodejs/devtest/lab.ts | 16 + sdk/nodejs/devtest/linuxVirtualMachine.ts | 43 ++ sdk/nodejs/devtest/policy.ts | 27 + sdk/nodejs/devtest/schedule.ts | 31 + sdk/nodejs/devtest/virtualNetwork.ts | 24 + sdk/nodejs/devtest/windowsVirtualMachine.ts | 42 ++ sdk/nodejs/digitaltwins/endpointEventGrid.ts | 23 + sdk/nodejs/digitaltwins/endpointEventHub.ts | 37 + sdk/nodejs/digitaltwins/endpointServicebus.ts | 30 + sdk/nodejs/digitaltwins/getInstance.ts | 26 + sdk/nodejs/digitaltwins/instance.ts | 16 + .../timeSeriesDatabaseConnection.ts | 81 +++ sdk/nodejs/dns/aaaaRecord.ts | 37 + sdk/nodejs/dns/arecord.ts | 37 + sdk/nodejs/dns/caaRecord.ts | 40 ++ sdk/nodejs/dns/cnameRecord.ts | 37 + sdk/nodejs/dns/getAAAARecord.ts | 28 + sdk/nodejs/dns/getARecord.ts | 30 + sdk/nodejs/dns/getCAARecord.ts | 28 + sdk/nodejs/dns/getCnameRecord.ts | 28 + sdk/nodejs/dns/getMxRecord.ts | 28 + sdk/nodejs/dns/getNsRecord.ts | 28 + sdk/nodejs/dns/getPtrRecord.ts | 28 + sdk/nodejs/dns/getSrvRecord.ts | 28 + sdk/nodejs/dns/getTxtRecord.ts | 28 + sdk/nodejs/dns/getZone.ts | 26 + sdk/nodejs/dns/mxRecord.ts | 28 + sdk/nodejs/dns/nsRecord.ts | 22 + sdk/nodejs/dns/ptrRecord.ts | 16 + sdk/nodejs/dns/srvRecord.ts | 24 + sdk/nodejs/dns/txtRecord.ts | 26 + sdk/nodejs/dns/zone.ts | 10 + sdk/nodejs/domainservices/getService.ts | 24 + sdk/nodejs/domainservices/replicaSet.ts | 220 ++++++ sdk/nodejs/domainservices/service.ts | 121 ++++ sdk/nodejs/domainservices/serviceTrust.ts | 21 + sdk/nodejs/elasticcloud/elasticsearch.ts | 15 + sdk/nodejs/elasticcloud/getElasticsearch.ts | 28 + sdk/nodejs/eventgrid/domain.ts | 16 + sdk/nodejs/eventgrid/domainTopic.ts | 20 + sdk/nodejs/eventgrid/eventSubscription.ts | 26 + sdk/nodejs/eventgrid/getDomain.ts | 26 + sdk/nodejs/eventgrid/getDomainTopic.ts | 24 + sdk/nodejs/eventgrid/getSystemTopic.ts | 24 + sdk/nodejs/eventgrid/getTopic.ts | 24 + sdk/nodejs/eventgrid/systemTopic.ts | 24 + .../eventgrid/systemTopicEventSubscription.ts | 33 + sdk/nodejs/eventgrid/topic.ts | 16 + sdk/nodejs/eventhub/authorizationRule.ts | 32 + sdk/nodejs/eventhub/cluster.ts | 14 + sdk/nodejs/eventhub/consumerGroup.ts | 30 + sdk/nodejs/eventhub/domain.ts | 16 + sdk/nodejs/eventhub/eventGridTopic.ts | 16 + sdk/nodejs/eventhub/eventHub.ts | 24 + .../eventhub/eventHubAuthorizationRule.ts | 32 + sdk/nodejs/eventhub/eventHubConsumerGroup.ts | 30 + sdk/nodejs/eventhub/eventHubNamespace.ts | 18 + .../eventHubNamespaceAuthorizationRule.ts | 25 + sdk/nodejs/eventhub/eventSubscription.ts | 26 + ...eventhubNamespaceDisasterRecoveryConfig.ts | 24 + sdk/nodejs/eventhub/getAuthorizationRule.ts | 28 + sdk/nodejs/eventhub/getCluster.ts | 26 + sdk/nodejs/eventhub/getConsumeGroup.ts | 28 + sdk/nodejs/eventhub/getEventHub.ts | 28 + sdk/nodejs/eventhub/getEventhubNamespace.ts | 26 + sdk/nodejs/eventhub/getNamespace.ts | 26 + .../eventhub/getNamespaceAuthorizationRule.ts | 28 + sdk/nodejs/eventhub/getServiceBusNamespace.ts | 26 + sdk/nodejs/eventhub/namespace.ts | 17 + .../eventhub/namespaceAuthorizationRule.ts | 23 + .../eventhub/namespaceCustomerManagedKey.ts | 77 +++ sdk/nodejs/eventhub/namespaceSchemaGroup.ts | 19 + sdk/nodejs/eventhub/queue.ts | 21 + sdk/nodejs/eventhub/queueAuthorizationRule.ts | 27 + sdk/nodejs/eventhub/subscription.ts | 25 + sdk/nodejs/eventhub/subscriptionRule.ts | 64 ++ sdk/nodejs/eventhub/topic.ts | 21 + sdk/nodejs/eventhub/topicAuthorizationRule.ts | 24 + sdk/nodejs/fluidrelay/server.ts | 13 + sdk/nodejs/frontdoor/firewallPolicy.ts | 107 +++ sdk/nodejs/frontdoor/frontdoor.ts | 46 ++ sdk/nodejs/frontdoor/rulesEngine.ts | 85 +++ sdk/nodejs/graph/account.ts | 18 + sdk/nodejs/graph/servicesAccount.ts | 18 + sdk/nodejs/hdinsight/getCluster.ts | 26 + sdk/nodejs/hdinsight/hadoopCluster.ts | 55 ++ sdk/nodejs/hdinsight/hbaseCluster.ts | 55 ++ .../hdinsight/interactiveQueryCluster.ts | 55 ++ sdk/nodejs/hdinsight/kafkaCluster.ts | 56 ++ sdk/nodejs/hdinsight/sparkCluster.ts | 55 ++ sdk/nodejs/healthcare/dicomService.ts | 22 + sdk/nodejs/healthcare/fhirService.ts | 44 ++ sdk/nodejs/healthcare/getDicomService.ts | 26 + sdk/nodejs/healthcare/getMedtechService.ts | 26 + sdk/nodejs/healthcare/getService.ts | 28 + sdk/nodejs/healthcare/getWorkspace.ts | 26 + sdk/nodejs/healthcare/medtechService.ts | 40 ++ .../medtechServiceFhirDestination.ts | 76 +++ sdk/nodejs/healthcare/service.ts | 41 ++ sdk/nodejs/healthcare/workspace.ts | 12 + sdk/nodejs/hpc/cache.ts | 26 + sdk/nodejs/hpc/cacheAccessPolicy.ts | 33 + sdk/nodejs/hpc/cacheBlobTarget.ts | 53 ++ sdk/nodejs/hsm/module.ts | 75 ++ sdk/nodejs/hybrid/getComputeMachine.ts | 26 + sdk/nodejs/iot/certificate.ts | 24 + sdk/nodejs/iot/consumerGroup.ts | 25 + sdk/nodejs/iot/dpsSharedAccessPolicy.ts | 23 + sdk/nodejs/iot/endpointCosmosdbAccount.ts | 52 ++ sdk/nodejs/iot/endpointEventhub.ts | 44 ++ sdk/nodejs/iot/endpointServicebusQueue.ts | 40 ++ sdk/nodejs/iot/endpointServicebusTopic.ts | 37 + sdk/nodejs/iot/endpointStorageContainer.ts | 37 + sdk/nodejs/iot/fileUpload.ts | 32 + sdk/nodejs/iot/getDps.ts | 24 + sdk/nodejs/iot/getDpsSharedAccessPolicy.ts | 26 + sdk/nodejs/iot/getIotHub.ts | 26 + sdk/nodejs/iot/getSharedAccessPolicy.ts | 26 + sdk/nodejs/iot/ioTHub.ts | 98 +++ sdk/nodejs/iot/iotHubCertificate.ts | 23 + sdk/nodejs/iot/iotHubDeviceUpdateAccount.ts | 19 + sdk/nodejs/iot/iotHubDeviceUpdateInstance.ts | 39 ++ sdk/nodejs/iot/iotHubDps.ts | 18 + sdk/nodejs/iot/securityDeviceGroup.ts | 37 + sdk/nodejs/iot/securitySolution.ts | 23 + sdk/nodejs/iot/sharedAccessPolicy.ts | 23 + .../iot/timeSeriesInsightsAccessPolicy.ts | 20 + .../timeSeriesInsightsEventSourceEventhub.ts | 59 ++ .../timeSeriesInsightsEventSourceIothub.ts | 47 ++ .../iot/timeSeriesInsightsGen2Environment.ts | 26 + .../iot/timeSeriesInsightsReferenceDataSet.ts | 23 + .../timeSeriesInsightsStandardEnvironment.ts | 15 + sdk/nodejs/iotcentral/application.ts | 20 + .../iotcentral/applicationNetworkRuleSet.ts | 32 + sdk/nodejs/keyvault/accessPolicy.ts | 38 ++ sdk/nodejs/keyvault/certifiate.ts | 178 +++++ sdk/nodejs/keyvault/certificate.ts | 178 +++++ sdk/nodejs/keyvault/certificateContacts.ts | 39 ++ sdk/nodejs/keyvault/certificateIssuer.ts | 23 + sdk/nodejs/keyvault/getAccessPolicy.ts | 24 + sdk/nodejs/keyvault/getCertificate.ts | 34 + sdk/nodejs/keyvault/getCertificateData.ts | 34 + sdk/nodejs/keyvault/getCertificateIssuer.ts | 34 + sdk/nodejs/keyvault/getKey.ts | 26 + sdk/nodejs/keyvault/getKeyVault.ts | 26 + .../getManagedHardwareSecurityModule.ts | 26 + sdk/nodejs/keyvault/getSecret.ts | 26 + sdk/nodejs/keyvault/key.ts | 51 ++ sdk/nodejs/keyvault/keyVault.ts | 26 + .../keyvault/managedHardwareSecurityModule.ts | 22 + sdk/nodejs/keyvault/managedStorageAccount.ts | 104 +++ ...managedStorageAccountSasTokenDefinition.ts | 82 +++ sdk/nodejs/keyvault/secret.ts | 35 + .../kusto/attachedDatabaseConfiguration.ts | 50 ++ sdk/nodejs/kusto/cluster.ts | 20 + sdk/nodejs/kusto/clusterCustomerManagedKey.ts | 75 ++ .../kusto/clusterManagedPrivateEndpoint.ts | 32 + .../kusto/clusterPrincipalAssignment.ts | 26 + sdk/nodejs/kusto/cosmosdbDataConnection.ts | 94 +++ sdk/nodejs/kusto/database.ts | 24 + .../kusto/databasePrincipalAssignment.ts | 34 + sdk/nodejs/kusto/eventGridDataConnection.ts | 73 ++ sdk/nodejs/kusto/eventhubDataConnection.ts | 52 ++ sdk/nodejs/kusto/getCluster.ts | 24 + sdk/nodejs/kusto/getDatabase.ts | 26 + sdk/nodejs/kusto/iotHubDataConnection.ts | 59 ++ sdk/nodejs/kusto/script.ts | 60 ++ sdk/nodejs/lab/lab.ts | 33 + sdk/nodejs/lab/schedule.ts | 38 ++ sdk/nodejs/lab/servicePlan.ts | 14 + sdk/nodejs/lab/user.ts | 37 + sdk/nodejs/lb/backendAddressPool.ts | 23 + sdk/nodejs/lb/backendAddressPoolAddress.ts | 37 + sdk/nodejs/lb/getBackendAddressPool.ts | 36 + sdk/nodejs/lb/getLB.ts | 26 + sdk/nodejs/lb/getLBOutboundRule.ts | 26 + sdk/nodejs/lb/loadBalancer.ts | 22 + sdk/nodejs/lb/natPool.ts | 31 + sdk/nodejs/lb/outboundRule.ts | 31 + sdk/nodejs/lb/probe.ts | 26 + sdk/nodejs/lb/rule.ts | 29 + sdk/nodejs/lighthouse/assignment.ts | 13 + sdk/nodejs/lighthouse/definition.ts | 21 + sdk/nodejs/loadtest/loadTest.ts | 16 + sdk/nodejs/loganalytics/cluster.ts | 16 + .../loganalytics/clusterCustomerManagedKey.ts | 64 ++ sdk/nodejs/loganalytics/dataExportRule.ts | 28 + .../loganalytics/dataSourceWindowsEvent.ts | 20 + .../dataSourceWindowsPerformanceCounter.ts | 22 + sdk/nodejs/loganalytics/linkedService.ts | 28 + .../loganalytics/linkedStorageAccount.ts | 26 + sdk/nodejs/loganalytics/queryPack.ts | 13 + sdk/nodejs/loganalytics/savedSearch.ts | 21 + sdk/nodejs/loganalytics/storageInsights.ts | 27 + sdk/nodejs/logicapps/actionCustom.ts | 31 + sdk/nodejs/logicapps/actionHttp.ts | 18 + sdk/nodejs/logicapps/getIntegrationAccount.ts | 26 + sdk/nodejs/logicapps/getStandard.ts | 26 + sdk/nodejs/logicapps/getWorkflow.ts | 26 + sdk/nodejs/logicapps/integrationAccount.ts | 17 + .../logicapps/integrationAccountAgreement.ts | 47 ++ .../logicapps/integrationAccountAssembly.ts | 21 + .../integrationAccountBatchConfiguration.ts | 22 + .../integrationAccountCertificate.ts | 19 + sdk/nodejs/logicapps/integrationAccountMap.ts | 21 + .../logicapps/integrationAccountPartner.ts | 22 + .../logicapps/integrationAccountSchema.ts | 20 + .../logicapps/integrationAccountSession.ts | 22 + .../logicapps/interationServiceEnvironment.ts | 55 ++ sdk/nodejs/logicapps/standard.ts | 75 ++ sdk/nodejs/logicapps/triggerCustom.ts | 24 + sdk/nodejs/logicapps/triggerHttpRequest.ts | 25 + sdk/nodejs/logicapps/triggerRecurrence.ts | 18 + sdk/nodejs/logicapps/workflow.ts | 13 + sdk/nodejs/machinelearning/computeCluster.ts | 68 ++ sdk/nodejs/machinelearning/computeInstance.ts | 69 ++ .../machinelearning/datastoreBlobstorage.ts | 45 ++ .../machinelearning/datastoreDatalakeGen2.ts | 45 ++ sdk/nodejs/machinelearning/getWorkspace.ts | 26 + .../machinelearning/inferenceCluster.ts | 77 +++ sdk/nodejs/machinelearning/synapseSpark.ts | 68 ++ sdk/nodejs/machinelearning/workspace.ts | 260 +++++++ .../maintenance/assignmentDedicatedHost.ts | 30 + .../maintenance/assignmentVirtualMachine.ts | 60 ++ .../assignmentVirtualMachineScaleSet.ts | 126 ++++ sdk/nodejs/maintenance/configuration.ts | 17 + sdk/nodejs/maintenance/getConfiguration.ts | 26 + .../maintenance/getPublicConfigurations.ts | 28 + sdk/nodejs/managedapplication/application.ts | 43 ++ sdk/nodejs/managedapplication/definition.ts | 22 + .../managedapplication/getDefinition.ts | 26 + sdk/nodejs/management/getGroup.ts | 24 + sdk/nodejs/management/group.ts | 19 + .../management/groupPolicyAssignment.ts | 31 + sdk/nodejs/management/groupPolicyExemption.ts | 25 + .../groupSubscriptionAssociation.ts | 18 + .../management/groupTemplateDeployment.ts | 91 +++ sdk/nodejs/management/lock.ts | 45 ++ sdk/nodejs/management/privateLink.ts | 13 + .../managementgroups/getManagementGroup.ts | 24 + .../managementgroups/managementGroup.ts | 19 + .../managementresource/manangementLock.ts | 45 ++ sdk/nodejs/maps/account.ts | 17 + sdk/nodejs/maps/creator.ts | 24 + sdk/nodejs/maps/getAccount.ts | 26 + sdk/nodejs/mariadb/configuration.ts | 24 + sdk/nodejs/mariadb/database.ts | 27 + sdk/nodejs/mariadb/firewallRule.ts | 26 + sdk/nodejs/mariadb/getMariaDbServer.ts | 26 + sdk/nodejs/mariadb/server.ts | 24 + sdk/nodejs/mariadb/virtualNetworkRule.ts | 34 + sdk/nodejs/marketplace/agreement.ts | 13 + sdk/nodejs/marketplace/getAgreement.ts | 28 + sdk/nodejs/media/accountFilter.ts | 71 ++ sdk/nodejs/media/asset.ts | 28 + sdk/nodejs/media/assetFilter.ts | 75 ++ sdk/nodejs/media/contentKeyPolicy.ts | 106 +++ sdk/nodejs/media/job.ts | 58 ++ sdk/nodejs/media/liveEvent.ts | 54 ++ sdk/nodejs/media/liveEventOutput.ts | 52 ++ sdk/nodejs/media/serviceAccount.ts | 23 + sdk/nodejs/media/streamingEndpoint.ts | 81 +++ sdk/nodejs/media/streamingLocator.ts | 39 ++ sdk/nodejs/media/streamingPolicy.ts | 78 +++ sdk/nodejs/media/transform.ts | 329 +++++++++ sdk/nodejs/mediaservices/account.ts | 23 + .../mixedreality/getSpatialAnchorsAccount.ts | 26 + .../mixedreality/spatialAnchorsAccount.ts | 13 + sdk/nodejs/mobile/getNetwork.ts | 24 + .../mobile/getNetworkAttachedDataNetwork.ts | 32 + sdk/nodejs/mobile/getNetworkDataNetwork.ts | 32 + .../getNetworkPacketCoreControlPlane.ts | 24 + .../mobile/getNetworkPacketCoreDataPlane.ts | 32 + sdk/nodejs/mobile/getNetworkService.ts | 26 + sdk/nodejs/mobile/getNetworkSimGroup.ts | 32 + sdk/nodejs/mobile/getNetworkSimPolicy.ts | 32 + sdk/nodejs/mobile/getNetworkSite.ts | 32 + sdk/nodejs/mobile/getNetworkSlice.ts | 32 + sdk/nodejs/mobile/network.ts | 18 + sdk/nodejs/mobile/networkDataNetwork.ts | 23 + .../mobile/networkPacketCoreControlPlane.ts | 47 ++ sdk/nodejs/mobile/networkService.ts | 59 ++ sdk/nodejs/mobile/networkSim.ts | 50 ++ sdk/nodejs/mobile/networkSimGroup.ts | 39 ++ sdk/nodejs/mobile/networkSimPolicy.ts | 73 ++ sdk/nodejs/mobile/networkSite.ts | 27 + sdk/nodejs/mobile/networkSlice.ts | 26 + sdk/nodejs/monitoring/aadDiagnosticSetting.ts | 49 ++ sdk/nodejs/monitoring/actionGroup.ts | 89 +++ .../monitoring/actionRuleActionGroup.ts | 24 + .../monitoring/actionRuleSuppression.ts | 32 + sdk/nodejs/monitoring/activityLogAlert.ts | 39 ++ .../alertProcessingRuleActionGroup.ts | 52 ++ .../alertProcessingRuleSuppression.ts | 47 ++ sdk/nodejs/monitoring/autoscaleSetting.ts | 231 +++++++ .../monitoring/dataCollectionEndpoint.ts | 19 + sdk/nodejs/monitoring/dataCollectionRule.ts | 172 +++++ .../dataCollectionRuleAssociation.ts | 76 +++ sdk/nodejs/monitoring/diagnosticSetting.ts | 40 ++ sdk/nodejs/monitoring/getActionGroup.ts | 26 + .../monitoring/getDataCollectionEndpoint.ts | 26 + .../monitoring/getDataCollectionRule.ts | 26 + .../monitoring/getDiagnosticCategories.ts | 30 + sdk/nodejs/monitoring/getLogProfile.ts | 24 + .../monitoring/getScheduledQueryRulesAlert.ts | 26 + .../monitoring/getScheduledQueryRulesLog.ts | 26 + sdk/nodejs/monitoring/logProfile.ts | 38 ++ sdk/nodejs/monitoring/logzMonitor.ts | 24 + sdk/nodejs/monitoring/logzSubAccount.ts | 33 + .../monitoring/logzSubAccountTagRule.ts | 51 ++ sdk/nodejs/monitoring/logzTagRule.ts | 42 ++ sdk/nodejs/monitoring/metricAlert.ts | 43 ++ sdk/nodejs/monitoring/privateLinkScope.ts | 10 + .../monitoring/privateLinkScopedService.ts | 20 + .../monitoring/scheduledQueryRulesLog.ts | 60 ++ .../monitoring/smartDetectorAlertRule.ts | 28 + sdk/nodejs/monitoring/workspace.ts | 16 + sdk/nodejs/msi/userAssignedIdentity.ts | 13 + sdk/nodejs/mssql/database.ts | 34 + .../mssql/databaseExtendedAuditingPolicy.ts | 30 + ...baseVulnerabilityAssessmentRuleBaseline.ts | 64 ++ sdk/nodejs/mssql/elasticPool.ts | 33 + sdk/nodejs/mssql/failoverGroup.ts | 44 ++ sdk/nodejs/mssql/firewallRule.ts | 21 + sdk/nodejs/mssql/getDatabase.ts | 42 ++ sdk/nodejs/mssql/getElasticPool.ts | 28 + sdk/nodejs/mssql/getManagedInstance.ts | 24 + sdk/nodejs/mssql/getServer.ts | 26 + sdk/nodejs/mssql/jobAgent.ts | 25 + sdk/nodejs/mssql/jobCredential.ts | 30 + sdk/nodejs/mssql/managedDatabase.ts | 31 + sdk/nodejs/mssql/managedInstance.ts | 171 +++++ ...gedInstanceActiveDirectoryAdministrator.ts | 52 ++ .../managedInstanceSecurityAlertPolicy.ts | 183 +++++ ...anagedInstanceTransparentDataEncryption.ts | 138 ++++ .../managedInstanceVulnerabilityAssessment.ts | 63 ++ sdk/nodejs/mssql/outboundFirewallRule.ts | 18 + sdk/nodejs/mssql/server.ts | 101 +++ sdk/nodejs/mssql/serverDnsAlias.ts | 17 + .../mssql/serverExtendedAuditingPolicy.ts | 110 +++ .../serverMicrosoftSupportAuditingPolicy.ts | 106 +++ sdk/nodejs/mssql/serverSecurityAlertPolicy.ts | 34 + .../mssql/serverTransparentDataEncryption.ts | 101 +++ .../mssql/serverVulnerabilityAssessment.ts | 44 ++ sdk/nodejs/mssql/virtualMachine.ts | 28 + sdk/nodejs/mssql/virtualMachineGroup.ts | 19 + sdk/nodejs/mssql/virtualNetworkRule.ts | 31 + .../mysql/activeDirectoryAdministrator.ts | 27 + sdk/nodejs/mysql/configuration.ts | 31 + sdk/nodejs/mysql/database.ts | 31 + sdk/nodejs/mysql/firewallRule.ts | 53 ++ sdk/nodejs/mysql/flexibleDatabase.ts | 22 + sdk/nodejs/mysql/flexibleServer.ts | 45 ++ .../mysql/flexibleServerConfiguration.ts | 21 + .../mysql/flexibleServerFirewallRule.ts | 54 ++ sdk/nodejs/mysql/getFlexibleServer.ts | 26 + sdk/nodejs/mysql/getServer.ts | 26 + sdk/nodejs/mysql/server.ts | 25 + sdk/nodejs/mysql/serverKey.ts | 86 +++ sdk/nodejs/mysql/virtualNetworkRule.ts | 37 + sdk/nodejs/netapp/account.ts | 21 + sdk/nodejs/netapp/getAccount.ts | 26 + sdk/nodejs/netapp/getPool.ts | 28 + sdk/nodejs/netapp/getSnapshot.ts | 32 + sdk/nodejs/netapp/getSnapshotPolicy.ts | 40 ++ sdk/nodejs/netapp/getVolume.ts | 30 + sdk/nodejs/netapp/getVolumeGroupSapHana.ts | 28 + sdk/nodejs/netapp/getVolumeQuotaRule.ts | 26 + sdk/nodejs/netapp/pool.ts | 20 + sdk/nodejs/netapp/snapshot.ts | 57 ++ sdk/nodejs/netapp/snapshotPolicy.ts | 48 ++ sdk/nodejs/netapp/volumeQuotaRule.ts | 81 +++ sdk/nodejs/network/applicationGateway.ts | 82 +++ .../network/applicationSecurityGroup.ts | 16 + sdk/nodejs/network/bgpConnection.ts | 44 ++ sdk/nodejs/network/ddosProtectionPlan.ts | 13 + sdk/nodejs/network/expressRouteCircuit.ts | 23 + .../expressRouteCircuitAuthorization.ts | 28 + .../network/expressRouteCircuitConnection.ts | 69 ++ .../network/expressRouteCircuitPeering.ts | 82 +++ sdk/nodejs/network/expressRouteConnection.ts | 56 ++ sdk/nodejs/network/expressRouteGateway.ts | 28 + sdk/nodejs/network/expressRoutePort.ts | 16 + .../network/expressRoutePortAuthorization.ts | 20 + sdk/nodejs/network/firewall.ts | 36 + .../firewallApplicationRuleCollection.ts | 51 ++ .../network/firewallNatRuleCollection.ts | 54 ++ .../network/firewallNetworkRuleCollection.ts | 55 ++ sdk/nodejs/network/firewallPolicy.ts | 13 + sdk/nodejs/network/getApplicationGateway.ts | 26 + .../network/getApplicationSecurityGroup.ts | 26 + sdk/nodejs/network/getExpressRouteCircuit.ts | 28 + sdk/nodejs/network/getFirewall.ts | 26 + sdk/nodejs/network/getFirewallPolicy.ts | 26 + sdk/nodejs/network/getGatewayConnection.ts | 26 + sdk/nodejs/network/getIpGroup.ts | 26 + sdk/nodejs/network/getLocalNetworkGateway.ts | 26 + .../network/getNetworkDdosProtectionPlan.ts | 26 + sdk/nodejs/network/getNetworkInterface.ts | 26 + sdk/nodejs/network/getNetworkSecurityGroup.ts | 26 + sdk/nodejs/network/getNetworkWatcher.ts | 26 + sdk/nodejs/network/getPublicIP.ts | 124 ++++ sdk/nodejs/network/getPublicIPs.ts | 24 + sdk/nodejs/network/getPublicIpPrefix.ts | 24 + sdk/nodejs/network/getRouteFilter.ts | 26 + sdk/nodejs/network/getRouteTable.ts | 24 + sdk/nodejs/network/getServiceTags.ts | 30 + sdk/nodejs/network/getSubnet.ts | 28 + sdk/nodejs/network/getTrafficManager.ts | 22 + .../network/getTrafficManagerProfile.ts | 26 + sdk/nodejs/network/getVirtualHub.ts | 26 + sdk/nodejs/network/getVirtualHubConnection.ts | 28 + sdk/nodejs/network/getVirtualHubRouteTable.ts | 28 + sdk/nodejs/network/getVirtualNetwork.ts | 26 + .../network/getVirtualNetworkGateway.ts | 26 + sdk/nodejs/network/getVpnGateway.ts | 26 + sdk/nodejs/network/ipgroup.ts | 21 + sdk/nodejs/network/ipgroupCIDR.ts | 17 + sdk/nodejs/network/localNetworkGateway.ts | 15 + sdk/nodejs/network/natGateway.ts | 18 + .../network/natGatewayPublicIpAssociation.ts | 24 + .../natGatewayPublicIpPrefixAssociation.ts | 24 + .../network/networkConnectionMonitor.ts | 109 +++ sdk/nodejs/network/networkInterface.ts | 28 + ...faceApplicationSecurityGroupAssociation.ts | 36 + ...kInterfaceBackendAddressPoolAssociation.ts | 47 ++ .../networkInterfaceNatRuleAssociation.ts | 54 ++ ...etworkInterfaceSecurityGroupAssociation.ts | 36 + sdk/nodejs/network/networkManager.ts | 25 + sdk/nodejs/network/networkManagerAdminRule.ts | 55 ++ .../networkManagerAdminRuleCollection.ts | 28 + ...networkManagerConnectivityConfiguration.ts | 41 ++ .../network/networkManagerDeployment.ts | 47 ++ ...networkManagerManagementGroupConnection.ts | 39 ++ .../network/networkManagerNetworkGroup.ts | 23 + .../network/networkManagerScopeConnection.ts | 28 + .../network/networkManagerStaticMember.ts | 35 + .../networkManagerSubscriptionConnection.ts | 23 + sdk/nodejs/network/networkPacketCapture.ts | 83 +++ sdk/nodejs/network/networkSecurityGroup.ts | 27 + sdk/nodejs/network/networkSecurityRule.ts | 25 + sdk/nodejs/network/networkWatcher.ts | 13 + sdk/nodejs/network/networkWatcherFlowLog.ts | 48 ++ sdk/nodejs/network/pointToPointVpnGateway.ts | 61 ++ sdk/nodejs/network/profile.ts | 37 + sdk/nodejs/network/publicIp.ts | 17 + sdk/nodejs/network/publicIpPrefix.ts | 17 + sdk/nodejs/network/route.ts | 19 + sdk/nodejs/network/routeFilter.ts | 18 + sdk/nodejs/network/routeMap.ts | 36 + sdk/nodejs/network/routeServer.ts | 36 + .../network/routeServerBgpConnection.ts | 41 ++ sdk/nodejs/network/routeTable.ts | 22 + sdk/nodejs/network/routingIntent.ts | 37 + sdk/nodejs/network/securityPartnerProvider.ts | 35 + sdk/nodejs/network/subnet.ts | 29 + .../network/subnetNatGatewayAssociation.ts | 27 + .../subnetNetworkSecurityGroupAssociation.ts | 38 ++ .../network/subnetRouteTableAssociation.ts | 33 + .../network/trafficManagerAzureEndpoint.ts | 39 ++ .../network/trafficManagerExternalEndpoint.ts | 33 + .../network/trafficManagerNestedEndpoint.ts | 54 ++ sdk/nodejs/network/trafficManagerProfile.ts | 35 + sdk/nodejs/network/virtualHub.ts | 19 + sdk/nodejs/network/virtualHubConnection.ts | 28 + sdk/nodejs/network/virtualHubIp.ts | 37 + sdk/nodejs/network/virtualHubRouteTable.ts | 52 ++ .../network/virtualHubRouteTableRoute.ts | 55 ++ sdk/nodejs/network/virtualNetwork.ts | 36 + .../network/virtualNetworkDnsServers.ts | 26 + sdk/nodejs/network/virtualNetworkGateway.ts | 70 ++ .../virtualNetworkGatewayConnection.ts | 136 ++++ sdk/nodejs/network/virtualNetworkPeering.ts | 28 + sdk/nodejs/network/virtualWan.ts | 13 + sdk/nodejs/network/vnpGatewayNatRule.ts | 34 + sdk/nodejs/network/vpnGateway.ts | 29 + sdk/nodejs/network/vpnGatewayConnection.ts | 53 ++ sdk/nodejs/network/vpnServerConfiguration.ts | 38 ++ .../vpnServerConfigurationPolicyGroup.ts | 29 + sdk/nodejs/network/vpnSite.ts | 23 + .../networkfunction/azureTrafficCollector.ts | 16 + sdk/nodejs/newrelic/monitor.ts | 22 + sdk/nodejs/newrelic/tagRule.ts | 39 ++ sdk/nodejs/nginx/certificate.ts | 87 +++ sdk/nodejs/nginx/deployment.ts | 50 ++ .../notificationhub/authorizationRule.ts | 28 + sdk/nodejs/notificationhub/getHub.ts | 28 + sdk/nodejs/notificationhub/getNamespace.ts | 26 + sdk/nodejs/notificationhub/hub.ts | 20 + sdk/nodejs/notificationhub/namespace.ts | 15 + .../operationalinsights/analyticsSolution.ts | 32 + .../operationalinsights/analyticsWorkspace.ts | 15 + .../getAnalyticsWorkspace.ts | 26 + .../operationalinsights/queryPackQuery.ts | 30 + sdk/nodejs/orbital/contact.ts | 81 +++ sdk/nodejs/orbital/contactProfile.ts | 54 ++ sdk/nodejs/orbital/spacecraft.ts | 29 + sdk/nodejs/paloalto/localRulestack.ts | 13 + .../paloalto/localRulestackCertificate.ts | 17 + sdk/nodejs/paloalto/localRulestackFqdnList.ts | 17 + ...tackOutboundTrustCertificateAssociation.ts | 18 + ...ckOutboundUntrustCertificateAssociation.ts | 18 + .../paloalto/localRulestackPrefixList.ts | 17 + sdk/nodejs/paloalto/localRulestackRule.ts | 25 + ...enerationFirewallVirtualNetworkPanorama.ts | 72 ++ sdk/nodejs/pim/activeRoleAssignment.ts | 60 ++ sdk/nodejs/pim/eligibleRoleAssignment.ts | 60 ++ sdk/nodejs/policy/definition.ts | 44 ++ sdk/nodejs/policy/getPolicyAssignment.ts | 26 + sdk/nodejs/policy/getPolicyDefintion.ts | 24 + .../policy/getPolicyDefintionBuiltIn.ts | 24 + sdk/nodejs/policy/getPolicySetDefinition.ts | 24 + ...etVirtualMachineConfigurationAssignment.ts | 28 + sdk/nodejs/policy/policySetDefinition.ts | 32 + .../virtualMachineConfigurationAssignment.ts | 86 +++ sdk/nodejs/portal/dashboard.ts | 132 ++++ sdk/nodejs/portal/getDashboard.ts | 26 + .../activeDirectoryAdministrator.ts | 26 + sdk/nodejs/postgresql/configuration.ts | 28 + sdk/nodejs/postgresql/database.ts | 28 + sdk/nodejs/postgresql/firewallRule.ts | 37 + sdk/nodejs/postgresql/flexibleServer.ts | 47 ++ ...xibleServerActiveDirectoryAdministrator.ts | 36 + .../postgresql/flexibleServerConfiguration.ts | 43 ++ .../postgresql/flexibleServerDatabase.ts | 23 + .../postgresql/flexibleServerFirewallRule.ts | 23 + sdk/nodejs/postgresql/getFlexibleServer.ts | 26 + sdk/nodejs/postgresql/getServer.ts | 26 + sdk/nodejs/postgresql/server.ts | 24 + sdk/nodejs/postgresql/serverKey.ts | 85 +++ sdk/nodejs/postgresql/virtualNetworkRule.ts | 37 + sdk/nodejs/powerbi/embedded.ts | 15 + sdk/nodejs/privatedns/aaaarecord.ts | 19 + sdk/nodejs/privatedns/arecord.ts | 16 + sdk/nodejs/privatedns/cnameRecord.ts | 16 + sdk/nodejs/privatedns/getAAAARecord.ts | 28 + sdk/nodejs/privatedns/getARecord.ts | 30 + sdk/nodejs/privatedns/getCnameRecord.ts | 28 + sdk/nodejs/privatedns/getDnsZone.ts | 26 + sdk/nodejs/privatedns/getMxRecord.ts | 28 + sdk/nodejs/privatedns/getPtrRecord.ts | 28 + sdk/nodejs/privatedns/getResolver.ts | 24 + .../getResolverDnsForwardingRuleset.ts | 24 + .../privatedns/getResolverForwardingRule.ts | 24 + .../privatedns/getResolverInboundEndpoint.ts | 24 + .../privatedns/getResolverOutboundEndpoint.ts | 24 + .../getResolverVirtualNetworkLink.ts | 24 + sdk/nodejs/privatedns/getSrvRecord.ts | 28 + sdk/nodejs/privatedns/getTxtRecord.ts | 28 + .../privatedns/getZoneVirtualNetworkLink.ts | 28 + sdk/nodejs/privatedns/linkService.ts | 58 ++ sdk/nodejs/privatedns/mxRecord.ts | 28 + sdk/nodejs/privatedns/ptrrecord.ts | 16 + sdk/nodejs/privatedns/resolver.ts | 19 + .../resolverDnsForwardingRuleset.ts | 47 ++ .../privatedns/resolverForwardingRule.ts | 56 ++ .../privatedns/resolverInboundEndpoint.ts | 42 ++ .../privatedns/resolverOutboundEndpoint.ts | 39 ++ .../privatedns/resolverVirtualNetworkLink.ts | 54 ++ sdk/nodejs/privatedns/srvrecord.ts | 32 + sdk/nodejs/privatedns/txtRecord.ts | 18 + sdk/nodejs/privatedns/zone.ts | 10 + .../privatedns/zoneVirtualNetworkLink.ts | 20 + .../applicationSecurityGroupAssociation.ts | 72 ++ .../privatelink/getEndpointConnection.ts | 26 + sdk/nodejs/privatelink/getService.ts | 26 + .../getServiceEndpointConnections.ts | 26 + sdk/nodejs/proximity/getPlacementGroup.ts | 26 + sdk/nodejs/proximity/placementGroup.ts | 16 + sdk/nodejs/purview/account.ts | 16 + sdk/nodejs/recoveryservices/getVault.ts | 24 + sdk/nodejs/recoveryservices/vault.ts | 15 + .../vaultResourceGuardAssociation.ts | 23 + sdk/nodejs/redis/cache.ts | 21 + sdk/nodejs/redis/enterpriseCluster.ts | 14 + sdk/nodejs/redis/enterpriseDatabase.ts | 32 + sdk/nodejs/redis/firewallRule.ts | 35 + sdk/nodejs/redis/getCache.ts | 28 + sdk/nodejs/redis/getEnterpriseDatabase.ts | 30 + sdk/nodejs/redis/linkedServer.ts | 43 ++ sdk/nodejs/relay/hybridConnection.ts | 23 + .../hybridConnectionAuthorizationRule.ts | 31 + sdk/nodejs/relay/namespace.ts | 17 + .../relay/namespaceAuthorizationRule.ts | 24 + sdk/nodejs/role/assignment.ts | 89 +++ sdk/nodejs/role/definition.ts | 18 + sdk/nodejs/search/getService.ts | 26 + sdk/nodejs/search/service.ts | 42 ++ sdk/nodejs/search/sharedPrivateLinkService.ts | 26 + .../advancedThreatProtection.ts | 22 + sdk/nodejs/securitycenter/assessment.ts | 62 ++ sdk/nodejs/securitycenter/assessmentPolicy.ts | 13 + sdk/nodejs/securitycenter/autoProvisioning.ts | 9 + sdk/nodejs/securitycenter/automation.ts | 51 ++ sdk/nodejs/securitycenter/contact.ts | 14 + .../serverVulnerabilityAssessment.ts | 48 ++ ...erVulnerabilityAssessmentVirtualMachine.ts | 48 ++ sdk/nodejs/securitycenter/setting.ts | 12 + sdk/nodejs/securitycenter/storageDefender.ts | 16 + .../securitycenter/subscriptionPricing.ts | 39 ++ sdk/nodejs/securitycenter/workspace.ts | 18 + .../sentinel/alertRuleAnomalyBuiltIn.ts | 28 + .../sentinel/alertRuleAnomalyDuplicate.ts | 33 + sdk/nodejs/sentinel/alertRuleFusion.ts | 29 + ...ertRuleMachineLearningBehaviorAnalytics.ts | 19 + .../sentinel/alertRuleMsSecurityIncident.ts | 21 + sdk/nodejs/sentinel/alertRuleNrt.ts | 25 + sdk/nodejs/sentinel/alertRuleScheduled.ts | 25 + .../sentinel/alertRuleThreatIntelligence.ts | 33 + sdk/nodejs/sentinel/authomationRule.ts | 24 + sdk/nodejs/sentinel/automationRule.ts | 24 + .../sentinel/dataConnectorAwsCloudTrail.ts | 19 + sdk/nodejs/sentinel/dataConnectorAwsS3.ts | 21 + .../dataConnectorAzureActiveDirectory.ts | 16 + ...aConnectorAzureAdvancedThreadProtection.ts | 16 + .../dataConnectorAzureSecurityCenter.ts | 16 + .../sentinel/dataConnectorDynamics365.ts | 16 + sdk/nodejs/sentinel/dataConnectorIot.ts | 16 + .../dataConnectorMicrosoftCloudAppSecurity.ts | 16 + ...crosoftDefenderAdvancedThreatProtection.ts | 16 + ...ataConnectorMicrosoftThreatIntelligence.ts | 19 + .../dataConnectorMicrosoftThreatProtection.ts | 16 + sdk/nodejs/sentinel/dataConnectorOffice365.ts | 16 + .../sentinel/dataConnectorOffice365Project.ts | 16 + sdk/nodejs/sentinel/dataConnectorOfficeAtp.ts | 16 + sdk/nodejs/sentinel/dataConnectorOfficeIrm.ts | 16 + .../sentinel/dataConnectorOfficePowerBi.ts | 16 + .../dataConnectorThreatIntelligence.ts | 16 + .../dataConnectorThreatIntelligenceTaxii.ts | 21 + sdk/nodejs/sentinel/getAlertRule.ts | 34 + sdk/nodejs/sentinel/getAlertRuleAnomaly.ts | 46 ++ sdk/nodejs/sentinel/getAlertRuleTemplate.ts | 26 + .../logAnalyticsWorkspaceOnboarding.ts | 19 + sdk/nodejs/sentinel/metadata.ts | 41 ++ .../sentinel/threatIntelligenceIndicator.ts | 29 + sdk/nodejs/sentinel/watchlist.ts | 20 + sdk/nodejs/sentinel/watchlistItem.ts | 27 + sdk/nodejs/servicebus/getNamespace.ts | 26 + .../getNamespaceAuthorizationRule.ts | 26 + sdk/nodejs/servicebus/getQueue.ts | 26 + .../servicebus/getQueueAuthorizationRule.ts | 30 + sdk/nodejs/servicebus/getSubscription.ts | 26 + sdk/nodejs/servicebus/getTopic.ts | 26 + .../servicebus/getTopicAuthorizationRule.ts | 30 + sdk/nodejs/servicebus/namespace.ts | 17 + .../servicebus/namespaceAuthorizationRule.ts | 23 + .../namespaceDisasterRecoveryConfig.ts | 32 + .../servicebus/namespaceNetworkRuleSet.ts | 40 ++ sdk/nodejs/servicebus/queue.ts | 21 + .../servicebus/queueAuthorizationRule.ts | 27 + sdk/nodejs/servicebus/subscription.ts | 25 + sdk/nodejs/servicebus/subscriptionRule.ts | 64 ++ sdk/nodejs/servicebus/topic.ts | 21 + .../servicebus/topicAuthorizationRule.ts | 24 + sdk/nodejs/servicefabric/cluster.ts | 25 + sdk/nodejs/servicefabric/managedCluster.ts | 34 + sdk/nodejs/signalr/getService.ts | 24 + sdk/nodejs/signalr/service.ts | 33 + .../signalr/serviceCustomCertificate.ts | 69 ++ sdk/nodejs/signalr/serviceCustomDomain.ts | 74 ++ sdk/nodejs/signalr/serviceNetworkAcl.ts | 50 ++ .../signalr/sharedPrivateLinkResource.ts | 37 + sdk/nodejs/siterecovery/fabric.ts | 20 + sdk/nodejs/siterecovery/getFabric.ts | 26 + .../siterecovery/getProtectionContainer.ts | 28 + .../siterecovery/getReplicationPolicy.ts | 26 + .../getReplicationRecoveryPlan.ts | 32 + .../siterecovery/hyperVReplicationPolicy.ts | 20 + .../hyperVReplicationPolicyAssociation.ts | 25 + sdk/nodejs/siterecovery/hyperVSite.ts | 16 + .../siterecovery/hypervNetworkMapping.ts | 25 + sdk/nodejs/siterecovery/networkMapping.ts | 46 ++ .../siterecovery/protectionContainer.ts | 25 + .../protectionContainerMapping.ts | 49 ++ sdk/nodejs/siterecovery/replicatedVM.ts | 160 +++++ sdk/nodejs/siterecovery/replicationPolicy.ts | 20 + .../siterecovery/replicationRecoveryPlan.ts | 170 +++++ .../siterecovery/vmwareReplicationPolicy.ts | 21 + .../vmwareReplicationPolicyAssociation.ts | 23 + .../sql/activeDirectoryAdministrator.ts | 24 + sdk/nodejs/sql/database.ts | 33 + sdk/nodejs/sql/elasticPool.ts | 28 + sdk/nodejs/sql/failoverGroup.ts | 40 ++ sdk/nodejs/sql/firewallRule.ts | 22 + sdk/nodejs/sql/getDatabase.ts | 28 + sdk/nodejs/sql/getServer.ts | 26 + sdk/nodejs/sql/getSqlManagedInstance.ts | 26 + sdk/nodejs/sql/managedDatabase.ts | 34 + sdk/nodejs/sql/managedInstance.ts | 171 +++++ ...gedInstanceActiveDirectoryAdministrator.ts | 33 + sdk/nodejs/sql/sqlServer.ts | 25 + sdk/nodejs/sql/virtualNetworkRule.ts | 32 + sdk/nodejs/stack/hciCluster.ts | 20 + sdk/nodejs/storage/account.ts | 54 ++ sdk/nodejs/storage/accountNetworkRules.ts | 36 + sdk/nodejs/storage/blob.ts | 25 + sdk/nodejs/storage/blobInventoryPolicy.ts | 36 + sdk/nodejs/storage/container.ts | 22 + sdk/nodejs/storage/customerManagedKey.ts | 83 +++ sdk/nodejs/storage/dataLakeGen2Filesystem.ts | 23 + sdk/nodejs/storage/dataLakeGen2Path.ts | 24 + sdk/nodejs/storage/encryptionScope.ts | 22 + sdk/nodejs/storage/getAccount.ts | 26 + .../storage/getAccountBlobContainerSAS.ts | 82 +++ sdk/nodejs/storage/getAccountSAS.ts | 98 +++ sdk/nodejs/storage/getBlob.ts | 26 + sdk/nodejs/storage/getEncryptionScope.ts | 34 + sdk/nodejs/storage/getPolicy.ts | 30 + sdk/nodejs/storage/getShare.ts | 26 + sdk/nodejs/storage/getStorageContainer.ts | 24 + sdk/nodejs/storage/getSync.ts | 26 + sdk/nodejs/storage/getSyncGroup.ts | 26 + sdk/nodejs/storage/getTableEntity.ts | 28 + sdk/nodejs/storage/localUser.ts | 42 ++ sdk/nodejs/storage/managementPolicy.ts | 72 ++ sdk/nodejs/storage/mover.ts | 17 + sdk/nodejs/storage/moverAgent.ts | 16 + sdk/nodejs/storage/moverJobDefinition.ts | 49 ++ sdk/nodejs/storage/moverProject.ts | 17 + sdk/nodejs/storage/moverSourceEndpoint.ts | 19 + sdk/nodejs/storage/moverTargetEndpoint.ts | 30 + sdk/nodejs/storage/objectReplication.ts | 46 ++ sdk/nodejs/storage/queue.ts | 16 + sdk/nodejs/storage/share.ts | 27 + sdk/nodejs/storage/shareDirectory.ts | 23 + sdk/nodejs/storage/shareFile.ts | 23 + sdk/nodejs/storage/sync.ts | 16 + sdk/nodejs/storage/syncCloudEndpoint.ts | 35 + sdk/nodejs/storage/syncGroup.ts | 14 + sdk/nodejs/storage/table.ts | 16 + sdk/nodejs/storage/tableEntity.ts | 25 + sdk/nodejs/streamanalytics/cluster.ts | 14 + .../streamanalytics/functionJavaScriptUDF.ts | 29 + .../streamanalytics/functionJavascriptUda.ts | 38 ++ sdk/nodejs/streamanalytics/getJob.ts | 26 + sdk/nodejs/streamanalytics/job.ts | 27 + sdk/nodejs/streamanalytics/jobSchedule.ts | 82 +++ .../streamanalytics/managedPrivateEndpoint.ts | 28 + sdk/nodejs/streamanalytics/outputBlob.ts | 38 ++ sdk/nodejs/streamanalytics/outputCosmosdb.ts | 46 ++ sdk/nodejs/streamanalytics/outputEventHub.ts | 36 + sdk/nodejs/streamanalytics/outputFunction.ts | 50 ++ sdk/nodejs/streamanalytics/outputMssql.ts | 38 ++ sdk/nodejs/streamanalytics/outputPowerbi.ts | 22 + .../streamanalytics/outputServiceBusQueue.ts | 34 + .../streamanalytics/outputServicebusTopic.ts | 38 ++ sdk/nodejs/streamanalytics/outputSynapse.ts | 41 ++ sdk/nodejs/streamanalytics/outputTable.ts | 30 + .../streamanalytics/referenceInputBlob.ts | 37 + .../streamanalytics/referenceInputMssql.ts | 35 + sdk/nodejs/streamanalytics/streamInputBlob.ts | 37 + .../streamanalytics/streamInputEventHub.ts | 43 ++ .../streamanalytics/streamInputEventHubV2.ts | 42 ++ .../streamanalytics/streamInputIotHub.ts | 34 + sdk/nodejs/synapse/firewallRule.ts | 33 + sdk/nodejs/synapse/getWorkspace.ts | 26 + sdk/nodejs/synapse/integrationRuntimeAzure.ts | 40 ++ .../synapse/integrationRuntimeSelfHosted.ts | 37 + sdk/nodejs/synapse/linkedService.ts | 50 ++ sdk/nodejs/synapse/managedPrivateEndpoint.ts | 48 ++ sdk/nodejs/synapse/privateLinkHub.ts | 12 + sdk/nodejs/synapse/roleAssignment.ts | 41 ++ sdk/nodejs/synapse/sqlPool.ts | 33 + .../synapse/sqlPoolExtendedAuditingPolicy.ts | 45 ++ .../synapse/sqlPoolSecurityAlertPolicy.ts | 58 ++ .../synapse/sqlPoolVulnerabilityAssessment.ts | 72 ++ .../sqlPoolVulnerabilityAssessmentBaseline.ts | 65 ++ .../synapse/sqlPoolWorkloadClassifier.ts | 50 ++ sdk/nodejs/synapse/sqlPoolWorkloadGroup.ts | 41 ++ sdk/nodejs/synapse/workspace.ts | 127 ++++ sdk/nodejs/synapse/workspaceAadAdmin.ts | 68 ++ .../workspaceExtendedAuditingPolicy.ts | 40 ++ sdk/nodejs/synapse/workspaceKey.ts | 84 +++ .../synapse/workspaceSecurityAlertPolicy.ts | 53 ++ sdk/nodejs/synapse/workspaceSqlAadAdmin.ts | 68 ++ .../workspaceVulnerabilityAssessment.ts | 67 ++ .../trafficmanager/getGeographicalLocation.ts | 22 + sdk/nodejs/trafficmanager/profile.ts | 35 + sdk/nodejs/types/input.ts | 58 ++ sdk/nodejs/types/output.ts | 58 ++ sdk/nodejs/videoanalyzer/analyzer.ts | 49 ++ sdk/nodejs/videoanalyzer/edgeModule.ts | 54 ++ .../voice/servicesCommunicationsGateway.ts | 47 ++ .../servicesCommunicationsGatewayTestLine.ts | 19 + sdk/nodejs/waf/getFirewallPolicy.ts | 26 + sdk/nodejs/waf/policy.ts | 97 +++ .../webpubsub/getPrivateLinkResource.ts | 36 + sdk/nodejs/webpubsub/getService.ts | 24 + sdk/nodejs/webpubsub/hub.ts | 66 ++ sdk/nodejs/webpubsub/networkAcl.ts | 53 ++ sdk/nodejs/webpubsub/service.ts | 24 + .../webpubsub/sharedPrivateLinkResource.ts | 35 + sdk/python/pulumi_azure/aadb2c/directory.py | 30 + .../pulumi_azure/aadb2c/get_directory.py | 22 + .../advisor/get_recommendations.py | 28 + .../pulumi_azure/analysisservices/server.py | 50 ++ sdk/python/pulumi_azure/apimanagement/api.py | 52 ++ .../apimanagement/api_diagnostic.py | 158 +++++ .../apimanagement/api_operation.py | 48 ++ .../apimanagement/api_operation_policy.py | 76 +++ .../apimanagement/api_operation_tag.py | 54 ++ .../pulumi_azure/apimanagement/api_policy.py | 44 ++ .../pulumi_azure/apimanagement/api_release.py | 54 ++ .../pulumi_azure/apimanagement/api_schema.py | 38 ++ .../pulumi_azure/apimanagement/api_tag.py | 34 + .../apimanagement/api_version_set.py | 40 ++ .../apimanagement/authorization_server.py | 38 ++ .../pulumi_azure/apimanagement/backend.py | 40 ++ .../pulumi_azure/apimanagement/certificate.py | 146 ++++ .../apimanagement/custom_domain.py | 138 ++++ .../pulumi_azure/apimanagement/diagnostic.py | 134 ++++ .../apimanagement/email_template.py | 62 ++ .../pulumi_azure/apimanagement/gateway.py | 48 ++ .../pulumi_azure/apimanagement/gateway_api.py | 38 ++ .../gateway_certificate_authority.py | 68 ++ .../gateway_host_name_configuration.py | 76 +++ .../pulumi_azure/apimanagement/get_api.py | 26 + .../apimanagement/get_api_version_set.py | 24 + .../pulumi_azure/apimanagement/get_gateway.py | 24 + .../get_gateway_host_name_configuration.py | 32 + .../pulumi_azure/apimanagement/get_group.py | 24 + .../pulumi_azure/apimanagement/get_product.py | 24 + .../pulumi_azure/apimanagement/get_service.py | 22 + .../apimanagement/global_schema.py | 42 ++ .../pulumi_azure/apimanagement/group.py | 40 ++ .../pulumi_azure/apimanagement/group_user.py | 32 + .../apimanagement/identity_provider_aad.py | 42 ++ .../apimanagement/identity_provider_aadb2c.py | 62 ++ .../identity_provider_facebook.py | 40 ++ .../apimanagement/identity_provider_google.py | 40 ++ .../identity_provider_microsoft.py | 40 ++ .../identity_provider_twitter.py | 40 ++ .../pulumi_azure/apimanagement/logger.py | 52 ++ .../pulumi_azure/apimanagement/named_value.py | 40 ++ .../notification_recipient_email.py | 38 ++ .../notification_recipient_user.py | 54 ++ .../apimanagement/open_id_connect_provider.py | 44 ++ .../pulumi_azure/apimanagement/policy.py | 46 ++ .../pulumi_azure/apimanagement/product.py | 46 ++ .../pulumi_azure/apimanagement/product_api.py | 44 ++ .../apimanagement/product_group.py | 42 ++ .../apimanagement/product_policy.py | 42 ++ .../pulumi_azure/apimanagement/product_tag.py | 56 ++ .../pulumi_azure/apimanagement/redis_cache.py | 60 ++ .../pulumi_azure/apimanagement/service.py | 30 + .../apimanagement/subscription.py | 44 ++ sdk/python/pulumi_azure/apimanagement/tag.py | 32 + sdk/python/pulumi_azure/apimanagement/user.py | 46 ++ .../appconfiguration/configuration_feature.py | 44 ++ .../appconfiguration/configuration_key.py | 138 ++++ .../appconfiguration/configuration_store.py | 210 ++++++ .../appconfiguration/get_configuration_key.py | 24 + .../get_configuration_keys.py | 20 + .../get_configuration_store.py | 22 + .../lication_load_balancer.py | 24 + .../appinsights/analytics_item.py | 36 + .../pulumi_azure/appinsights/api_key.py | 86 +++ .../pulumi_azure/appinsights/get_insights.py | 22 + .../pulumi_azure/appinsights/insights.py | 70 ++ .../appinsights/smart_detection_rule.py | 32 + .../appinsights/standard_web_test.py | 42 ++ .../pulumi_azure/appinsights/web_test.py | 66 ++ .../pulumi_azure/appinsights/workbook.py | 58 ++ .../appinsights/workbook_template.py | 132 ++++ .../appplatform/get_spring_cloud_app.py | 24 + .../appplatform/get_spring_cloud_service.py | 22 + .../appplatform/spring_cloud_accelerator.py | 28 + .../spring_cloud_active_deployment.py | 66 ++ .../appplatform/spring_cloud_api_portal.py | 52 ++ .../spring_cloud_api_portal_custom_domain.py | 36 + .../appplatform/spring_cloud_app.py | 36 + .../spring_cloud_app_cosmos_dbassociation.py | 64 ++ .../spring_cloud_app_mysql_association.py | 72 ++ .../spring_cloud_app_redis_association.py | 54 ++ ...ghts_application_performance_monitoring.py | 50 ++ .../spring_cloud_application_live_view.py | 28 + .../spring_cloud_build_deployment.py | 56 ++ .../spring_cloud_build_pack_binding.py | 72 ++ .../appplatform/spring_cloud_builder.py | 46 ++ .../appplatform/spring_cloud_certificate.py | 172 +++++ .../spring_cloud_configuration_service.py | 56 ++ .../appplatform/spring_cloud_connection.py | 96 +++ .../spring_cloud_container_deployment.py | 64 ++ .../spring_cloud_customized_accelerator.py | 56 ++ .../spring_cloud_dev_tool_portal.py | 58 ++ .../appplatform/spring_cloud_gateway.py | 86 +++ .../spring_cloud_gateway_custom_domain.py | 30 + .../spring_cloud_gateway_route_config.py | 76 +++ .../spring_cloud_java_deployment.py | 62 ++ .../appplatform/spring_cloud_service.py | 64 ++ .../appplatform/spring_cloud_storage.py | 42 ++ .../pulumi_azure/appservice/active_slot.py | 46 ++ .../pulumi_azure/appservice/app_connection.py | 108 +++ .../pulumi_azure/appservice/app_service.py | 68 ++ .../pulumi_azure/appservice/certificate.py | 34 + .../appservice/certificate_order.py | 28 + .../pulumi_azure/appservice/connection.py | 96 +++ .../appservice/custom_hostname_binding.py | 60 ++ .../pulumi_azure/appservice/environment.py | 70 ++ .../pulumi_azure/appservice/function_app.py | 170 +++++ .../appservice/function_app_active_slot.py | 116 ++++ .../appservice/function_app_function.py | 228 +++++++ .../function_app_hybrid_connection.py | 86 +++ .../appservice/function_app_slot.py | 66 ++ .../appservice/get_app_service.py | 22 + .../appservice/get_app_service_environment.py | 22 + .../appservice/get_app_service_plan.py | 22 + .../appservice/get_certificate.py | 22 + .../appservice/get_certificate_order.py | 22 + .../appservice/get_environment_v3.py | 22 + .../appservice/get_function_app.py | 20 + .../appservice/get_function_app_host_keys.py | 20 + .../appservice/get_linux_function_app.py | 22 + .../appservice/get_linux_web_app.py | 22 + .../appservice/get_service_plan.py | 22 + .../appservice/get_source_control_token.py | 22 +- .../appservice/get_windows_function_app.py | 22 + .../appservice/get_windows_web_app.py | 22 + .../appservice/hybrid_connection.py | 74 ++ .../appservice/linux_function_app.py | 52 ++ .../appservice/linux_function_app_slot.py | 58 ++ .../pulumi_azure/appservice/linux_web_app.py | 38 ++ .../appservice/linux_web_app_slot.py | 44 ++ sdk/python/pulumi_azure/appservice/plan.py | 130 ++++ .../appservice/public_certificate.py | 54 ++ .../pulumi_azure/appservice/service_plan.py | 28 + sdk/python/pulumi_azure/appservice/slot.py | 184 +++++ .../slot_custom_hostname_binding.py | 56 ++ .../slot_virtual_network_swift_connection.py | 88 +++ .../appservice/source_code_token.py | 22 + .../pulumi_azure/appservice/source_control.py | 46 ++ .../appservice/source_control_slot.py | 52 ++ .../appservice/source_control_token.py | 22 + .../pulumi_azure/appservice/static_site.py | 22 + .../appservice/static_site_custom_domain.py | 84 +++ .../virtual_network_swift_connection.py | 162 +++++ .../appservice/web_app_active_slot.py | 44 ++ .../appservice/web_app_hybrid_connection.py | 62 ++ .../appservice/windows_function_app.py | 52 ++ .../appservice/windows_function_app_slot.py | 58 ++ .../appservice/windows_web_app.py | 38 ++ .../appservice/windows_web_app_slot.py | 44 ++ .../pulumi_azure/arc/private_link_scope.py | 24 + .../arc/resource_bridge_appliance.py | 40 ++ .../arckubernetes/cluster_extension.py | 46 ++ .../arckubernetes/flux_configuration.py | 70 ++ sdk/python/pulumi_azure/arcmachine/get.py | 22 + .../pulumi_azure/attestation/provider.py | 26 + .../pulumi_azure/authorization/assignment.py | 160 +++++ .../get_user_assigned_identity.py | 24 + .../authorization/role_definition.py | 34 + .../authorization/user_assigned_identity.py | 24 + .../pulumi_azure/automanage/configuration.py | 134 ++++ sdk/python/pulumi_azure/automation/account.py | 32 + .../pulumi_azure/automation/bool_variable.py | 34 + .../pulumi_azure/automation/certificate.py | 40 ++ .../pulumi_azure/automation/connection.py | 48 ++ .../automation/connection_certificate.py | 48 ++ .../connection_classic_certificate.py | 40 ++ .../connection_service_principal.py | 42 ++ .../automation/connection_type.py | 42 ++ .../pulumi_azure/automation/credential.py | 38 ++ .../automation/date_time_variable.py | 34 + .../automation/dsc_configuration.py | 36 + .../automation/dsc_node_configuration.py | 88 +++ .../pulumi_azure/automation/get_account.py | 22 + .../automation/get_bool_variable.py | 24 + .../automation/get_date_time_variable.py | 24 + .../automation/get_int_variable.py | 24 + .../automation/get_string_variable.py | 24 + .../pulumi_azure/automation/get_variables.py | 24 + .../automation/hybrid_runbook_worker.py | 114 ++++ .../automation/hybrid_runbook_worker_group.py | 32 + .../pulumi_azure/automation/int_variable.py | 34 + .../pulumi_azure/automation/job_schedule.py | 38 ++ sdk/python/pulumi_azure/automation/module.py | 38 ++ .../automation/python3_package.py | 46 ++ .../pulumi_azure/automation/run_book.py | 94 +++ .../pulumi_azure/automation/schedule.py | 44 ++ .../software_update_configuration.py | 86 +++ .../pulumi_azure/automation/source_control.py | 46 ++ .../automation/string_variable.py | 34 + .../automation/variable_object.py | 42 ++ sdk/python/pulumi_azure/automation/watcher.py | 80 +++ sdk/python/pulumi_azure/automation/webhook.py | 66 ++ sdk/python/pulumi_azure/avs/cluster.py | 48 ++ .../avs/express_route_authorization.py | 42 ++ .../pulumi_azure/avs/get_private_cloud.py | 26 + sdk/python/pulumi_azure/avs/private_cloud.py | 44 ++ .../backup/container_storage_account.py | 44 ++ .../backup/get_policy_fileshare.py | 22 + .../pulumi_azure/backup/get_policy_vm.py | 22 + .../pulumi_azure/backup/policy_file_share.py | 100 +++ sdk/python/pulumi_azure/backup/policy_vm.py | 100 +++ .../pulumi_azure/backup/policy_vm_workload.py | 86 +++ .../backup/protected_file_share.py | 82 +++ .../pulumi_azure/backup/protected_vm.py | 60 ++ sdk/python/pulumi_azure/batch/account.py | 46 ++ sdk/python/pulumi_azure/batch/application.py | 46 ++ sdk/python/pulumi_azure/batch/certificate.py | 64 ++ sdk/python/pulumi_azure/batch/get_account.py | 22 + .../pulumi_azure/batch/get_application.py | 24 + .../pulumi_azure/batch/get_certificate.py | 24 + sdk/python/pulumi_azure/batch/get_pool.py | 22 + sdk/python/pulumi_azure/batch/job.py | 54 ++ sdk/python/pulumi_azure/batch/pool.py | 158 +++++ .../billing/account_cost_management_export.py | 56 ++ .../billing/get_enrollment_account_scope.py | 22 + .../billing/get_mca_account_scope.py | 24 + .../billing/get_mpa_account_scope.py | 22 + .../pulumi_azure/blueprint/assignment.py | 114 ++++ .../pulumi_azure/blueprint/get_definition.py | 24 + .../blueprint/get_published_version.py | 24 + sdk/python/pulumi_azure/bot/channel_alexa.py | 40 ++ .../pulumi_azure/bot/channel_direct_line.py | 46 ++ .../bot/channel_direct_line_speech.py | 52 ++ sdk/python/pulumi_azure/bot/channel_email.py | 42 ++ .../pulumi_azure/bot/channel_facebook.py | 50 ++ sdk/python/pulumi_azure/bot/channel_line.py | 46 ++ sdk/python/pulumi_azure/bot/channel_slack.py | 44 ++ sdk/python/pulumi_azure/bot/channel_sms.py | 44 ++ sdk/python/pulumi_azure/bot/channel_teams.py | 38 ++ .../pulumi_azure/bot/channel_web_chat.py | 44 ++ .../pulumi_azure/bot/channels_registration.py | 30 + sdk/python/pulumi_azure/bot/connection.py | 44 ++ sdk/python/pulumi_azure/bot/healthbot.py | 26 + .../pulumi_azure/bot/service_azure_bot.py | 68 ++ sdk/python/pulumi_azure/bot/web_app.py | 30 + sdk/python/pulumi_azure/cdn/endpoint.py | 42 ++ .../cdn/endpoint_custom_domain.py | 72 ++ .../cdn/frontdoor_custom_domain.py | 78 +++ .../pulumi_azure/cdn/frontdoor_endpoint.py | 34 + .../cdn/frontdoor_firewall_policy.py | 222 ++++++ .../cdn/frontdoor_origin_group.py | 54 ++ .../pulumi_azure/cdn/frontdoor_profile.py | 30 + ...or_route_disable_link_to_default_domain.py | 28 + .../pulumi_azure/cdn/frontdoor_rule_set.py | 26 + .../pulumi_azure/cdn/frontdoor_secret.py | 114 ++++ .../cdn/get_frontdoor_custom_domain.py | 22 + .../cdn/get_frontdoor_endpoint.py | 22 + .../cdn/get_frontdoor_firewall_policy.py | 20 + .../cdn/get_frontdoor_origin_group.py | 22 + .../pulumi_azure/cdn/get_frontdoor_profile.py | 20 + .../cdn/get_frontdoor_rule_set.py | 22 + .../pulumi_azure/cdn/get_frontdoor_secret.py | 22 + sdk/python/pulumi_azure/cdn/get_profile.py | 22 + sdk/python/pulumi_azure/cdn/profile.py | 34 + sdk/python/pulumi_azure/cognitive/account.py | 34 + .../cognitive/account_customer_managed_key.py | 214 ++++++ .../pulumi_azure/cognitive/deployment.py | 48 ++ .../pulumi_azure/cognitive/get_account.py | 22 + .../communication/email_service.py | 24 + .../pulumi_azure/communication/get_service.py | 22 + .../pulumi_azure/communication/service.py | 24 + sdk/python/pulumi_azure/compute/_inputs.py | 52 ++ .../pulumi_azure/compute/availability_set.py | 30 + .../pulumi_azure/compute/bastion_host.py | 64 ++ .../compute/capacity_reservation.py | 36 + .../compute/capacity_reservation_group.py | 24 + .../compute/data_disk_attachment.py | 132 ++++ .../pulumi_azure/compute/dedicated_host.py | 36 + .../compute/dedicated_host_group.py | 26 + .../pulumi_azure/compute/disk_access.py | 22 + .../compute/disk_encryption_set.py | 288 ++++++++ sdk/python/pulumi_azure/compute/disk_pool.py | 60 ++ .../compute/disk_pool_iscsi_target.py | 118 ++++ .../compute/disk_pool_iscsi_target_lun.py | 124 ++++ .../disk_pool_managed_disk_attachment.py | 108 +++ sdk/python/pulumi_azure/compute/extension.py | 142 ++++ .../compute/gallery_application.py | 32 + .../compute/gallery_application_version.py | 86 +++ .../compute/get_availability_set.py | 22 + .../pulumi_azure/compute/get_bastion_host.py | 22 + .../compute/get_confidential_ledger.py | 22 + .../compute/get_dedicated_host.py | 24 + .../compute/get_dedicated_host_group.py | 22 + .../pulumi_azure/compute/get_disk_access.py | 22 + .../compute/get_disk_encryption_set.py | 22 + sdk/python/pulumi_azure/compute/get_image.py | 22 + sdk/python/pulumi_azure/compute/get_images.py | 18 + .../pulumi_azure/compute/get_managed_disk.py | 22 + ..._orchestrated_virtual_machine_scale_set.py | 22 + .../compute/get_platform_image.py | 26 + .../pulumi_azure/compute/get_shared_image.py | 22 + .../compute/get_shared_image_gallery.py | 20 + .../compute/get_shared_image_version.py | 24 + .../compute/get_shared_image_versions.py | 22 + .../pulumi_azure/compute/get_snapshot.py | 20 + .../compute/get_ssh_public_key.py | 22 + .../compute/get_virtual_machine.py | 22 + .../compute/get_virtual_machine_scale_set.py | 22 + .../compute/linux_virtual_machine.py | 94 +++ .../linux_virtual_machine_scale_set.py | 98 +++ .../pulumi_azure/compute/managed_disk.py | 88 +++ .../compute/managed_disk_sas_token.py | 38 ++ .../orchestrated_virtual_machine_scale_set.py | 28 + sdk/python/pulumi_azure/compute/outputs.py | 52 ++ .../pulumi_azure/compute/packet_capture.py | 146 ++++ sdk/python/pulumi_azure/compute/scale_set.py | 372 ++++++++++ .../compute/scale_set_packet_capture.py | 138 ++++ .../pulumi_azure/compute/shared_image.py | 54 ++ .../compute/shared_image_gallery.py | 34 + .../compute/shared_image_version.py | 48 ++ sdk/python/pulumi_azure/compute/snapshot.py | 40 ++ .../pulumi_azure/compute/ssh_public_key.py | 24 + .../pulumi_azure/compute/virtual_machine.py | 116 ++++ .../virtual_machine_scale_set_extension.py | 108 +++ .../compute/windows_virtual_machine.py | 88 +++ .../windows_virtual_machine_scale_set.py | 90 +++ .../pulumi_azure/confidentialledger/ledger.py | 38 ++ .../connections/api_connection.py | 50 ++ .../connections/get_managed_api.py | 22 + .../consumption/budget_management_group.py | 104 +++ .../consumption/budget_resource_group.py | 112 +++ .../consumption/budget_subscription.py | 114 ++++ .../consumption/get_budget_resource_group.py | 22 + .../consumption/get_budget_subscription.py | 22 + sdk/python/pulumi_azure/containerapp/app.py | 60 ++ .../pulumi_azure/containerapp/environment.py | 36 + .../environment_dapr_component.py | 44 ++ .../containerapp/environment_storage.py | 64 ++ .../pulumi_azure/containerapp/get_app.py | 20 + .../containerapp/get_environment.py | 20 + .../get_environment_certificate.py | 24 + .../pulumi_azure/containerservice/_inputs.py | 26 + .../cluster_trusted_access_role_binding.py | 110 +++ .../containerservice/connected_registry.py | 70 ++ .../containerservice/flux_configuration.py | 72 ++ .../containerservice/get_cluster_node_pool.py | 24 + .../containerservice/get_group.py | 26 + .../get_kubernetes_cluster.py | 20 + .../get_kubernetes_node_pool_snapshot.py | 20 + .../get_kubernetes_service_versions.py | 22 + .../containerservice/get_registry.py | 22 + .../get_registry_scope_map.py | 24 + .../containerservice/get_registry_token.py | 24 + .../pulumi_azure/containerservice/group.py | 76 +++ .../containerservice/kubernetes_cluster.py | 210 ++++++ .../kubernetes_cluster_extension.py | 48 ++ .../kubernetes_cluster_node_pool.py | 62 ++ .../kubernetes_fleet_manager.py | 22 + .../pulumi_azure/containerservice/outputs.py | 26 + .../pulumi_azure/containerservice/registry.py | 168 +++++ .../containerservice/registry_agent_pool.py | 34 + .../containerservice/registry_scope_map.py | 54 ++ .../containerservice/registry_task.py | 48 ++ .../registry_task_schedule_run_now.py | 50 ++ .../containerservice/registry_token.py | 62 ++ .../containerservice/registry_webhook.py | 50 ++ .../containerservice/registry_webook.py | 50 ++ .../pulumi_azure/core/custom_provider.py | 32 + .../pulumi_azure/core/get_client_config.py | 20 + .../core/get_extended_locations.py | 18 + .../pulumi_azure/core/get_resource_group.py | 20 + .../pulumi_azure/core/get_subscription.py | 20 + .../pulumi_azure/core/get_subscriptions.py | 22 + .../core/get_template_spec_version.py | 24 + .../core/get_user_assigned_identity.py | 24 + .../core/portal_tenant_configuration.py | 18 + .../resource_deployment_script_azure_cli.py | 58 ++ .../resource_deployment_script_power_shell.py | 68 ++ .../pulumi_azure/core/resource_group.py | 18 + .../resource_group_cost_management_export.py | 56 ++ .../resource_group_cost_management_view.py | 46 ++ .../core/resource_group_policy_assignment.py | 74 ++ .../core/resource_group_policy_exemption.py | 46 ++ .../core/resource_policy_assignment.py | 58 ++ .../core/resource_policy_exemption.py | 50 ++ .../core/resource_provider_registration.py | 40 ++ sdk/python/pulumi_azure/core/subscription.py | 96 +++ .../subscription_cost_management_export.py | 58 ++ .../core/subscription_cost_management_view.py | 44 ++ .../core/subscription_policy_assignment.py | 56 ++ .../core/subscription_policy_exemption.py | 42 ++ .../core/subscription_template_deployment.py | 54 ++ .../pulumi_azure/core/template_deployment.py | 146 ++++ .../core/tenant_template_deployment.py | 28 + sdk/python/pulumi_azure/cosmosdb/account.py | 96 +++ .../cosmosdb/cassandra_cluster.py | 66 ++ .../cosmosdb/cassandra_datacenter.py | 82 +++ .../cosmosdb/cassandra_keyspace.py | 54 ++ .../pulumi_azure/cosmosdb/cassandra_table.py | 88 +++ .../pulumi_azure/cosmosdb/get_account.py | 22 + .../cosmosdb/get_mongo_database.py | 24 + .../get_restorable_database_accounts.py | 22 + .../pulumi_azure/cosmosdb/get_sql_database.py | 22 + .../cosmosdb/get_sql_role_definition.py | 22 + .../pulumi_azure/cosmosdb/gremlin_database.py | 28 + .../pulumi_azure/cosmosdb/gremlin_graph.py | 74 ++ .../pulumi_azure/cosmosdb/mongo_collection.py | 48 ++ .../pulumi_azure/cosmosdb/mongo_database.py | 28 + .../cosmosdb/mongo_role_definition.py | 70 ++ .../cosmosdb/mongo_user_definition.py | 72 ++ .../cosmosdb/notebook_workspace.py | 48 ++ .../cosmosdb/postgresql_cluster.py | 32 + .../postgresql_coordinator_configuration.py | 42 ++ .../cosmosdb/postgresql_firewall_rule.py | 40 ++ .../cosmosdb/postgresql_node_configuration.py | 42 ++ .../pulumi_azure/cosmosdb/postgresql_role.py | 38 ++ .../pulumi_azure/cosmosdb/sql_container.py | 80 +++ .../pulumi_azure/cosmosdb/sql_database.py | 28 + .../cosmosdb/sql_dedicated_gateway.py | 50 ++ .../pulumi_azure/cosmosdb/sql_function.py | 44 ++ .../cosmosdb/sql_role_assignment.py | 72 ++ .../cosmosdb/sql_role_definition.py | 60 ++ .../cosmosdb/sql_stored_procedure.py | 50 ++ .../pulumi_azure/cosmosdb/sql_trigger.py | 48 ++ sdk/python/pulumi_azure/cosmosdb/table.py | 28 + .../costmanagement/anomaly_alert.py | 24 + .../costmanagement/scheduled_action.py | 36 + .../dashboard/azurerm_portal_dashboard.py | 22 + .../pulumi_azure/dashboard/dashboard.py | 270 ++++++++ sdk/python/pulumi_azure/dashboard/grafana.py | 42 ++ .../databasemigration/get_project.py | 24 + .../databasemigration/get_service.py | 22 + .../pulumi_azure/databasemigration/project.py | 56 ++ .../pulumi_azure/databasemigration/service.py | 44 ++ sdk/python/pulumi_azure/databoxedge/device.py | 26 + .../pulumi_azure/databoxedge/get_device.py | 20 + sdk/python/pulumi_azure/databoxedge/order.py | 58 ++ .../databricks/access_connector.py | 36 + .../pulumi_azure/databricks/get_workspace.py | 22 + ...t_workspace_private_endpoint_connection.py | 22 + .../databricks/virtual_network_peering.py | 56 ++ sdk/python/pulumi_azure/datadog/monitor.py | 74 ++ .../datadog/monitor_sso_configuration.py | 52 ++ .../pulumi_azure/datadog/monitor_tag_rule.py | 68 ++ .../datafactory/custom_dataset.py | 170 +++++ .../pulumi_azure/datafactory/data_flow.py | 264 +++++++ .../datafactory/dataset_azure_blob.py | 44 ++ .../datafactory/dataset_azure_sql_table.py | 36 + .../datafactory/dataset_binary.py | 52 ++ .../datafactory/dataset_cosmos_db_api.py | 44 ++ .../datafactory/dataset_delimited_text.py | 62 ++ .../pulumi_azure/datafactory/dataset_http.py | 44 ++ .../pulumi_azure/datafactory/dataset_json.py | 50 ++ .../pulumi_azure/datafactory/dataset_mysql.py | 36 + .../datafactory/dataset_parquet.py | 48 ++ .../datafactory/dataset_postgresql.py | 36 + .../datafactory/dataset_snowflake.py | 40 ++ .../datafactory/dataset_sql_server_table.py | 36 + .../pulumi_azure/datafactory/factory.py | 24 + .../datafactory/flowlet_data_flow.py | 252 +++++++ .../pulumi_azure/datafactory/get_factory.py | 22 + .../integration_runtime_managed.py | 32 + .../datafactory/integration_runtime_rule.py | 30 + .../integration_runtime_self_hosted.py | 26 + .../datafactory/integration_runtime_ssis.py | 32 + .../datafactory/linked_custom_service.py | 76 +++ .../linked_service_azure_blob_storage.py | 106 +++ .../linked_service_azure_databricks.py | 144 ++++ .../linked_service_azure_file_storage.py | 34 + .../linked_service_azure_function.py | 36 + .../linked_service_azure_sql_database.py | 30 + .../linked_service_azure_table_storage.py | 34 + .../datafactory/linked_service_cosmos_db.py | 38 ++ .../linked_service_cosmos_db_mongo_api.py | 32 + .../linked_service_data_lake_storage_gen2.py | 38 ++ .../datafactory/linked_service_key_vault.py | 42 ++ .../datafactory/linked_service_kusto.py | 78 +++ .../datafactory/linked_service_mysql.py | 30 + .../datafactory/linked_service_odata.py | 44 ++ .../datafactory/linked_service_odbc.py | 44 ++ .../datafactory/linked_service_postgresql.py | 30 + .../datafactory/linked_service_sftp.py | 38 ++ .../datafactory/linked_service_snowflake.py | 84 +++ .../datafactory/linked_service_sql_server.py | 84 +++ .../datafactory/linked_service_synapse.py | 84 +++ .../datafactory/linked_service_web.py | 32 + .../datafactory/managed_private_endpoint.py | 46 ++ .../pulumi_azure/datafactory/pipeline.py | 76 +++ .../datafactory/trigger_blob_event.py | 88 +++ .../datafactory/trigger_custom_event.py | 82 +++ .../datafactory/trigger_schedule.py | 36 + .../datafactory/trigger_tumbling_window.py | 88 +++ .../backup_instance_blog_storage.py | 70 ++ .../dataprotection/backup_instance_disk.py | 82 +++ .../backup_instance_postgresql.py | 192 ++++++ .../backup_policy_blob_storage.py | 34 + .../dataprotection/backup_policy_disk.py | 72 ++ .../backup_policy_postgresql.py | 102 +++ .../dataprotection/backup_vault.py | 28 + .../dataprotection/get_backup_vault.py | 24 + .../dataprotection/resource_guard.py | 24 + sdk/python/pulumi_azure/datashare/account.py | 36 + .../datashare/dataset_blob_storage.py | 84 +++ .../datashare/dataset_data_lake_gen2.py | 74 ++ .../datashare/dataset_kusto_cluster.py | 66 ++ .../datashare/dataset_kusto_database.py | 74 ++ .../pulumi_azure/datashare/get_account.py | 22 + .../datashare/get_dataset_blob_storage.py | 22 + .../datashare/get_dataset_data_lake_gen2.py | 22 + .../datashare/get_dataset_kusto_cluster.py | 22 + .../datashare/get_dataset_kusto_database.py | 22 + .../pulumi_azure/datashare/get_share.py | 26 + sdk/python/pulumi_azure/datashare/share.py | 56 ++ .../desktopvirtualization/application.py | 74 ++ .../application_group.py | 68 ++ .../desktopvirtualization/get_host_pool.py | 20 + .../get_host_pool_registration_info.py | 36 + .../desktopvirtualization/host_pool.py | 54 ++ .../desktopvirtualization/scaling_plan.py | 168 +++++ .../desktopvirtualization/workspace.py | 28 + ...workspace_application_group_association.py | 50 ++ .../pulumi_azure/devcenter/dev_center.py | 28 + sdk/python/pulumi_azure/devcenter/project.py | 38 ++ sdk/python/pulumi_azure/devtest/get_lab.py | 22 + .../devtest/get_virtual_network.py | 24 + .../devtest/global_vm_shutdown_schedule.py | 110 +++ sdk/python/pulumi_azure/devtest/lab.py | 30 + .../devtest/linux_virtual_machine.py | 78 +++ sdk/python/pulumi_azure/devtest/policy.py | 50 ++ sdk/python/pulumi_azure/devtest/schedule.py | 58 ++ .../pulumi_azure/devtest/virtual_network.py | 44 ++ .../devtest/windows_virtual_machine.py | 78 +++ .../digitaltwins/endpoint_event_grid.py | 40 ++ .../digitaltwins/endpoint_event_hub.py | 64 ++ .../digitaltwins/endpoint_servicebus.py | 52 ++ .../pulumi_azure/digitaltwins/get_instance.py | 22 + .../pulumi_azure/digitaltwins/instance.py | 30 + .../time_series_database_connection.py | 140 ++++ sdk/python/pulumi_azure/dns/a_record.py | 68 ++ sdk/python/pulumi_azure/dns/aaaa_record.py | 68 ++ sdk/python/pulumi_azure/dns/c_name_record.py | 68 ++ sdk/python/pulumi_azure/dns/caa_record.py | 78 +++ sdk/python/pulumi_azure/dns/get_a_record.py | 26 +- .../pulumi_azure/dns/get_aaaa_record.py | 26 +- sdk/python/pulumi_azure/dns/get_caa_record.py | 26 +- .../pulumi_azure/dns/get_cname_record.py | 26 +- sdk/python/pulumi_azure/dns/get_mx_record.py | 26 +- sdk/python/pulumi_azure/dns/get_ns_record.py | 26 +- sdk/python/pulumi_azure/dns/get_ptr_record.py | 26 +- sdk/python/pulumi_azure/dns/get_srv_record.py | 26 +- sdk/python/pulumi_azure/dns/get_txt_record.py | 26 +- sdk/python/pulumi_azure/dns/get_zone.py | 22 + sdk/python/pulumi_azure/dns/mx_record.py | 54 ++ sdk/python/pulumi_azure/dns/ns_record.py | 42 ++ sdk/python/pulumi_azure/dns/ptr_record.py | 30 + sdk/python/pulumi_azure/dns/srv_record.py | 46 ++ sdk/python/pulumi_azure/dns/txt_record.py | 50 ++ sdk/python/pulumi_azure/dns/zone.py | 20 + .../domainservices/get_service.py | 20 + .../domainservices/replica_set.py | 404 +++++++++++ .../pulumi_azure/domainservices/service.py | 224 ++++++ .../domainservices/service_trust.py | 36 + .../elasticcloud/elasticsearch.py | 28 + .../elasticcloud/get_elasticsearch.py | 24 + sdk/python/pulumi_azure/eventgrid/domain.py | 30 + .../pulumi_azure/eventgrid/domain_topic.py | 36 + .../eventgrid/event_subscription.py | 48 ++ .../pulumi_azure/eventgrid/get_domain.py | 22 + .../eventgrid/get_domain_topic.py | 20 + .../eventgrid/get_system_topic.py | 20 + .../pulumi_azure/eventgrid/get_topic.py | 20 + .../pulumi_azure/eventgrid/system_topic.py | 44 ++ .../system_topic_event_subscription.py | 60 ++ sdk/python/pulumi_azure/eventgrid/topic.py | 30 + .../eventhub/authorization_rule.py | 58 ++ sdk/python/pulumi_azure/eventhub/cluster.py | 26 + .../pulumi_azure/eventhub/consumer_group.py | 54 ++ sdk/python/pulumi_azure/eventhub/domain.py | 30 + .../pulumi_azure/eventhub/event_grid_topic.py | 30 + sdk/python/pulumi_azure/eventhub/event_hub.py | 44 ++ .../eventhub/event_hub_authorization_rule.py | 58 ++ .../eventhub/event_hub_consumer_group.py | 54 ++ .../eventhub/event_hub_namespace.py | 34 + .../event_hub_namespace_authorization_rule.py | 46 ++ .../eventhub/event_subscription.py | 48 ++ ...thub_namespace_disaster_recovery_config.py | 42 ++ .../eventhub/get_authorization_rule.py | 24 + .../pulumi_azure/eventhub/get_cluster.py | 22 + .../eventhub/get_consume_group.py | 24 + .../pulumi_azure/eventhub/get_event_hub.py | 24 + .../eventhub/get_eventhub_namespace.py | 22 + .../pulumi_azure/eventhub/get_namespace.py | 22 + .../get_namespace_authorization_rule.py | 24 + .../eventhub/get_service_bus_namespace.py | 22 + sdk/python/pulumi_azure/eventhub/namespace.py | 32 + .../eventhub/namespace_authorization_rule.py | 42 ++ .../namespace_customer_managed_key.py | 138 ++++ .../eventhub/namespace_schema_group.py | 34 + sdk/python/pulumi_azure/eventhub/queue.py | 38 ++ .../eventhub/queue_authorization_rule.py | 48 ++ .../pulumi_azure/eventhub/subscription.py | 44 ++ .../eventhub/subscription_rule.py | 112 +++ sdk/python/pulumi_azure/eventhub/topic.py | 38 ++ .../eventhub/topic_authorization_rule.py | 44 ++ sdk/python/pulumi_azure/fluidrelay/server.py | 24 + .../pulumi_azure/frontdoor/firewall_policy.py | 212 ++++++ .../pulumi_azure/frontdoor/frontdoor.py | 90 +++ .../pulumi_azure/frontdoor/rules_engine.py | 166 +++++ sdk/python/pulumi_azure/graph/account.py | 34 + .../pulumi_azure/graph/services_account.py | 34 + .../pulumi_azure/hdinsight/get_cluster.py | 22 + .../pulumi_azure/hdinsight/h_base_cluster.py | 104 +++ .../pulumi_azure/hdinsight/hadoop_cluster.py | 104 +++ .../hdinsight/interactive_query_cluster.py | 104 +++ .../pulumi_azure/hdinsight/kafka_cluster.py | 106 +++ .../pulumi_azure/hdinsight/spark_cluster.py | 104 +++ .../pulumi_azure/healthcare/dicom_service.py | 40 ++ .../pulumi_azure/healthcare/fhir_service.py | 84 +++ .../healthcare/get_dicom_service.py | 22 + .../healthcare/get_medtech_service.py | 22 + .../pulumi_azure/healthcare/get_service.py | 24 + .../pulumi_azure/healthcare/get_workspace.py | 22 + .../healthcare/medtech_service.py | 78 +++ .../medtech_service_fhir_destination.py | 140 ++++ sdk/python/pulumi_azure/healthcare/service.py | 80 +++ .../pulumi_azure/healthcare/workspace.py | 22 + sdk/python/pulumi_azure/hpc/cache.py | 46 ++ .../pulumi_azure/hpc/cache_access_policy.py | 58 ++ .../pulumi_azure/hpc/cache_blob_target.py | 88 +++ sdk/python/pulumi_azure/hsm/module.py | 134 ++++ .../hybrid/get_compute_machine.py | 22 + sdk/python/pulumi_azure/iot/certificate.py | 44 ++ sdk/python/pulumi_azure/iot/consumer_group.py | 46 ++ .../iot/dps_shared_access_policy.py | 42 ++ .../iot/endpoint_cosmosdb_account.py | 94 +++ .../pulumi_azure/iot/endpoint_eventhub.py | 78 +++ .../iot/endpoint_servicebus_queue.py | 70 ++ .../iot/endpoint_servicebus_topic.py | 66 ++ .../iot/endpoint_storage_container.py | 66 ++ sdk/python/pulumi_azure/iot/file_upload.py | 56 ++ sdk/python/pulumi_azure/iot/get_dps.py | 20 + .../iot/get_dps_shared_access_policy.py | 22 + sdk/python/pulumi_azure/iot/get_iot_hub.py | 22 + .../iot/get_shared_access_policy.py | 22 + sdk/python/pulumi_azure/iot/io_t_hub.py | 184 +++++ .../pulumi_azure/iot/iot_hub_certificate.py | 42 ++ .../iot/iot_hub_device_update_account.py | 36 + .../iot/iot_hub_device_update_instance.py | 70 ++ sdk/python/pulumi_azure/iot/iot_hub_dps.py | 34 + .../pulumi_azure/iot/security_device_group.py | 66 ++ .../pulumi_azure/iot/security_solution.py | 42 ++ .../pulumi_azure/iot/shared_access_policy.py | 42 ++ .../iot/time_series_insights_access_policy.py | 36 + ...e_series_insights_event_source_eventhub.py | 104 +++ ...ime_series_insights_event_source_iothub.py | 84 +++ .../time_series_insights_gen2_environment.py | 48 ++ ...time_series_insights_reference_data_set.py | 42 ++ ...me_series_insights_standard_environment.py | 28 + .../pulumi_azure/iotcentral/application.py | 38 ++ .../application_network_rule_set.py | 60 ++ sdk/python/pulumi_azure/keyvault/_inputs.py | 12 + .../pulumi_azure/keyvault/access_policy.py | 66 ++ .../pulumi_azure/keyvault/certifiate.py | 348 ++++++++++ .../pulumi_azure/keyvault/certificate.py | 348 ++++++++++ .../keyvault/certificate_contacts.py | 70 ++ .../keyvault/certificate_issuer.py | 42 ++ .../keyvault/get_access_policy.py | 20 + .../pulumi_azure/keyvault/get_certificate.py | 26 + .../keyvault/get_certificate_data.py | 26 + .../keyvault/get_certificate_issuer.py | 26 + sdk/python/pulumi_azure/keyvault/get_key.py | 22 + .../pulumi_azure/keyvault/get_key_vault.py | 22 + .../get_managed_hardware_security_module.py | 22 + .../pulumi_azure/keyvault/get_secret.py | 22 + sdk/python/pulumi_azure/keyvault/key.py | 98 +++ sdk/python/pulumi_azure/keyvault/key_vault.py | 50 ++ .../managed_hardware_security_module.py | 42 ++ .../keyvault/managed_storage_account.py | 188 +++++ ...ed_storage_account_sas_token_definition.py | 152 +++++ sdk/python/pulumi_azure/keyvault/outputs.py | 12 + sdk/python/pulumi_azure/keyvault/secret.py | 66 ++ .../kusto/attached_database_configuration.py | 90 +++ sdk/python/pulumi_azure/kusto/cluster.py | 38 ++ .../kusto/cluster_customer_managed_key.py | 136 ++++ .../kusto/cluster_managed_private_endpoint.py | 58 ++ .../kusto/cluster_principal_assignment.py | 48 ++ .../kusto/cosmosdb_data_connection.py | 162 +++++ sdk/python/pulumi_azure/kusto/database.py | 44 ++ .../kusto/database_principal_assignment.py | 62 ++ .../kusto/event_grid_data_connection.py | 128 ++++ .../kusto/eventhub_data_connection.py | 92 +++ sdk/python/pulumi_azure/kusto/get_cluster.py | 20 + sdk/python/pulumi_azure/kusto/get_database.py | 22 + .../kusto/iot_hub_data_connection.py | 106 +++ sdk/python/pulumi_azure/kusto/script.py | 104 +++ sdk/python/pulumi_azure/lab/lab.py | 64 ++ sdk/python/pulumi_azure/lab/schedule.py | 72 ++ sdk/python/pulumi_azure/lab/service_plan.py | 26 + sdk/python/pulumi_azure/lab/user.py | 70 ++ .../pulumi_azure/lb/backend_address_pool.py | 42 ++ .../lb/backend_address_pool_address.py | 52 ++ .../lb/get_backend_address_pool.py | 28 + sdk/python/pulumi_azure/lb/get_lb.py | 22 + .../pulumi_azure/lb/get_lb_outbound_rule.py | 22 + sdk/python/pulumi_azure/lb/load_balancer.py | 40 ++ sdk/python/pulumi_azure/lb/nat_pool.py | 56 ++ sdk/python/pulumi_azure/lb/outbound_rule.py | 56 ++ sdk/python/pulumi_azure/lb/probe.py | 46 ++ sdk/python/pulumi_azure/lb/rule.py | 52 ++ .../pulumi_azure/lighthouse/assignment.py | 24 + .../pulumi_azure/lighthouse/definition.py | 36 + sdk/python/pulumi_azure/loadtest/load_test.py | 28 + .../pulumi_azure/loganalytics/cluster.py | 30 + .../cluster_customer_managed_key.py | 120 ++++ .../loganalytics/data_export_rule.py | 50 ++ .../loganalytics/data_source_windows_event.py | 36 + ...data_source_windows_performance_counter.py | 40 ++ .../loganalytics/linked_service.py | 50 ++ .../loganalytics/linked_storage_account.py | 46 ++ .../pulumi_azure/loganalytics/query_pack.py | 24 + .../pulumi_azure/loganalytics/saved_search.py | 38 ++ .../loganalytics/storage_insights.py | 48 ++ .../pulumi_azure/logicapps/action_custom.py | 58 ++ .../pulumi_azure/logicapps/action_http.py | 32 + .../logicapps/get_integration_account.py | 22 + .../pulumi_azure/logicapps/get_standard.py | 22 + .../pulumi_azure/logicapps/get_workflow.py | 22 + .../logicapps/integration_account.py | 32 + .../integration_account_agreement.py | 84 +++ .../logicapps/integration_account_assembly.py | 38 ++ ...integration_account_batch_configuration.py | 40 ++ .../integration_account_certificate.py | 34 + .../logicapps/integration_account_map.py | 36 + .../logicapps/integration_account_partner.py | 40 ++ .../logicapps/integration_account_schema.py | 34 + .../logicapps/integration_account_session.py | 40 ++ .../interation_service_environment.py | 98 +++ sdk/python/pulumi_azure/logicapps/standard.py | 138 ++++ .../pulumi_azure/logicapps/trigger_custom.py | 44 ++ .../logicapps/trigger_http_request.py | 46 ++ .../logicapps/trigger_recurrence.py | 32 + sdk/python/pulumi_azure/logicapps/workflow.py | 24 + .../machinelearning/compute_cluster.py | 120 ++++ .../machinelearning/compute_instance.py | 126 ++++ .../machinelearning/datastore_blobstorage.py | 78 +++ .../datastore_datalake_gen2.py | 78 +++ .../machinelearning/get_workspace.py | 22 + .../machinelearning/inference_cluster.py | 136 ++++ .../machinelearning/synapse_spark.py | 120 ++++ .../pulumi_azure/machinelearning/workspace.py | 462 +++++++++++++ .../maintenance/assignment_dedicated_host.py | 52 ++ .../maintenance/assignment_virtual_machine.py | 106 +++ .../assignment_virtual_machine_scale_set.py | 228 +++++++ .../pulumi_azure/maintenance/configuration.py | 32 + .../maintenance/get_configuration.py | 22 + .../maintenance/get_public_configurations.py | 24 + .../managedapplication/application.py | 80 +++ .../managedapplication/definition.py | 42 ++ .../managedapplication/get_definition.py | 22 + .../pulumi_azure/management/get_group.py | 20 + sdk/python/pulumi_azure/management/group.py | 34 + .../management/group_policy_assignment.py | 58 ++ .../management/group_policy_exemption.py | 42 ++ .../group_subscription_association.py | 26 + .../management/group_template_deployment.py | 158 +++++ sdk/python/pulumi_azure/management/lock.py | 82 +++ .../pulumi_azure/management/private_link.py | 24 + .../managementgroups/get_management_group.py | 20 + .../managementgroups/management_group.py | 34 + .../managementresource/manangement_lock.py | 82 +++ sdk/python/pulumi_azure/maps/account.py | 32 + sdk/python/pulumi_azure/maps/creator.py | 44 ++ sdk/python/pulumi_azure/maps/get_account.py | 22 + .../pulumi_azure/mariadb/configuration.py | 44 ++ sdk/python/pulumi_azure/mariadb/database.py | 50 ++ .../pulumi_azure/mariadb/firewall_rule.py | 48 ++ .../mariadb/get_maria_db_server.py | 22 + sdk/python/pulumi_azure/mariadb/server.py | 46 ++ .../mariadb/virtual_network_rule.py | 60 ++ .../pulumi_azure/marketplace/agreement.py | 24 + .../pulumi_azure/marketplace/get_agreement.py | 24 + .../pulumi_azure/media/account_filter.py | 136 ++++ sdk/python/pulumi_azure/media/asset.py | 50 ++ sdk/python/pulumi_azure/media/asset_filter.py | 142 ++++ .../pulumi_azure/media/content_key_policy.py | 208 ++++++ sdk/python/pulumi_azure/media/job.py | 104 +++ sdk/python/pulumi_azure/media/live_event.py | 102 +++ .../pulumi_azure/media/live_event_output.py | 94 +++ .../pulumi_azure/media/service_account.py | 42 ++ .../pulumi_azure/media/streaming_endpoint.py | 150 ++++ .../pulumi_azure/media/streaming_locator.py | 68 ++ .../pulumi_azure/media/streaming_policy.py | 148 ++++ sdk/python/pulumi_azure/media/transform.py | 646 ++++++++++++++++++ .../pulumi_azure/mediaservices/account.py | 42 ++ .../get_spatial_anchors_account.py | 22 + .../mixedreality/spatial_anchors_account.py | 24 + sdk/python/pulumi_azure/mobile/get_network.py | 20 + .../get_network_attached_data_network.py | 24 + .../mobile/get_network_data_network.py | 24 + .../get_network_packet_core_control_plane.py | 20 + .../get_network_packet_core_data_plane.py | 24 + .../mobile/get_network_service.py | 22 + .../mobile/get_network_sim_group.py | 24 + .../mobile/get_network_sim_policy.py | 24 + .../pulumi_azure/mobile/get_network_site.py | 24 + .../pulumi_azure/mobile/get_network_slice.py | 24 + sdk/python/pulumi_azure/mobile/network.py | 34 + .../mobile/network_data_network.py | 42 ++ .../network_packet_core_control_plane.py | 88 +++ .../pulumi_azure/mobile/network_service.py | 114 ++++ sdk/python/pulumi_azure/mobile/network_sim.py | 90 +++ .../pulumi_azure/mobile/network_sim_group.py | 62 ++ .../pulumi_azure/mobile/network_sim_policy.py | 136 ++++ .../pulumi_azure/mobile/network_site.py | 48 ++ .../pulumi_azure/mobile/network_slice.py | 48 ++ .../monitoring/aad_diagnostic_setting.py | 94 +++ .../pulumi_azure/monitoring/action_group.py | 174 +++++ .../monitoring/action_rule_action_group.py | 44 ++ .../monitoring/action_rule_suppression.py | 62 ++ .../monitoring/activity_log_alert.py | 72 ++ .../alert_processing_rule_action_group.py | 100 +++ .../alert_processing_rule_suppression.py | 92 +++ .../monitoring/autoscale_setting.py | 446 ++++++++++++ .../monitoring/data_collection_endpoint.py | 36 + .../monitoring/data_collection_rule.py | 326 +++++++++ .../data_collection_rule_association.py | 136 ++++ .../monitoring/diagnostic_setting.py | 74 ++ .../monitoring/get_action_group.py | 22 + .../get_data_collection_endpoint.py | 22 + .../monitoring/get_data_collection_rule.py | 22 + .../monitoring/get_diagnostic_categories.py | 22 + .../monitoring/get_log_profile.py | 20 + .../get_scheduled_query_rules_alert.py | 22 + .../get_scheduled_query_rules_log.py | 22 + .../pulumi_azure/monitoring/log_profile.py | 70 ++ .../pulumi_azure/monitoring/logz_monitor.py | 46 ++ .../monitoring/logz_sub_account.py | 62 ++ .../monitoring/logz_sub_account_tag_rule.py | 96 +++ .../pulumi_azure/monitoring/logz_tag_rule.py | 80 +++ .../pulumi_azure/monitoring/metric_alert.py | 80 +++ .../monitoring/private_link_scope.py | 20 + .../monitoring/private_link_scoped_service.py | 36 + .../monitoring/scheduled_query_rules_log.py | 112 +++ .../monitoring/smart_detector_alert_rule.py | 50 ++ .../pulumi_azure/monitoring/workspace.py | 30 + .../msi/user_assigned_identity.py | 24 + sdk/python/pulumi_azure/mssql/database.py | 62 ++ .../database_extended_auditing_policy.py | 54 ++ ..._vulnerability_assessment_rule_baseline.py | 114 ++++ sdk/python/pulumi_azure/mssql/elastic_pool.py | 62 ++ .../pulumi_azure/mssql/failover_group.py | 80 +++ .../pulumi_azure/mssql/firewall_rule.py | 38 ++ sdk/python/pulumi_azure/mssql/get_database.py | 36 + .../pulumi_azure/mssql/get_elastic_pool.py | 24 + .../mssql/get_managed_instance.py | 20 + sdk/python/pulumi_azure/mssql/get_server.py | 22 + sdk/python/pulumi_azure/mssql/job_agent.py | 44 ++ .../pulumi_azure/mssql/job_credential.py | 52 ++ .../pulumi_azure/mssql/managed_database.py | 56 ++ .../pulumi_azure/mssql/managed_instance.py | 308 +++++++++ ...instance_active_directory_administrator.py | 92 +++ .../managed_instance_security_alert_policy.py | 330 +++++++++ ...ed_instance_transparent_data_encryption.py | 256 +++++++ ...naged_instance_vulnerability_assessment.py | 110 +++ .../mssql/outbound_firewall_rule.py | 34 + sdk/python/pulumi_azure/mssql/server.py | 190 ++++++ .../pulumi_azure/mssql/server_dns_alias.py | 32 + .../mssql/server_extended_auditing_policy.py | 196 ++++++ ...erver_microsoft_support_auditing_policy.py | 188 +++++ .../mssql/server_security_alert_policy.py | 62 ++ .../server_transparent_data_encryption.py | 190 ++++++ .../mssql/server_vulnerability_assessment.py | 78 +++ .../pulumi_azure/mssql/virtual_machine.py | 50 ++ .../mssql/virtual_machine_group.py | 36 + .../mssql/virtual_network_rule.py | 54 ++ .../mysql/active_directory_administrator.py | 50 ++ .../pulumi_azure/mysql/configuration.py | 58 ++ sdk/python/pulumi_azure/mysql/database.py | 58 ++ .../pulumi_azure/mysql/firewall_rule.py | 98 +++ .../pulumi_azure/mysql/flexible_database.py | 40 ++ .../pulumi_azure/mysql/flexible_server.py | 80 +++ .../mysql/flexible_server_configuration.py | 38 ++ .../mysql/flexible_server_firewall_rule.py | 96 +++ .../pulumi_azure/mysql/get_flexible_server.py | 22 + sdk/python/pulumi_azure/mysql/get_server.py | 22 + sdk/python/pulumi_azure/mysql/server.py | 48 ++ sdk/python/pulumi_azure/mysql/server_key.py | 158 +++++ .../mysql/virtual_network_rule.py | 66 ++ sdk/python/pulumi_azure/netapp/account.py | 40 ++ sdk/python/pulumi_azure/netapp/get_account.py | 22 + sdk/python/pulumi_azure/netapp/get_pool.py | 24 + .../pulumi_azure/netapp/get_snapshot.py | 28 + .../netapp/get_snapshot_policy.py | 36 + sdk/python/pulumi_azure/netapp/get_volume.py | 26 + .../netapp/get_volume_group_sap_hana.py | 24 + .../netapp/get_volume_quota_rule.py | 22 + sdk/python/pulumi_azure/netapp/pool.py | 36 + sdk/python/pulumi_azure/netapp/snapshot.py | 102 +++ .../pulumi_azure/netapp/snapshot_policy.py | 92 +++ .../pulumi_azure/netapp/volume_quota_rule.py | 144 ++++ sdk/python/pulumi_azure/network/_inputs.py | 8 + .../network/application_gateway.py | 154 +++++ .../network/application_security_group.py | 30 + .../pulumi_azure/network/bgp_connection.py | 74 ++ .../network/ddos_protection_plan.py | 24 + .../network/express_route_circuit.py | 44 ++ .../express_route_circuit_authorization.py | 52 ++ .../express_route_circuit_connection.py | 124 ++++ .../network/express_route_circuit_peering.py | 156 +++++ .../network/express_route_connection.py | 98 +++ .../network/express_route_gateway.py | 50 ++ .../network/express_route_port.py | 30 + .../express_route_port_authorization.py | 36 + sdk/python/pulumi_azure/network/firewall.py | 64 ++ .../firewall_application_rule_collection.py | 92 +++ .../network/firewall_nat_rule_collection.py | 98 +++ .../firewall_network_rule_collection.py | 100 +++ .../pulumi_azure/network/firewall_policy.py | 24 + .../network/get_application_gateway.py | 22 + .../network/get_application_security_group.py | 22 + .../network/get_express_route_circuit.py | 24 + .../pulumi_azure/network/get_firewall.py | 22 + .../network/get_firewall_policy.py | 22 + .../network/get_gateway_connection.py | 22 + .../pulumi_azure/network/get_ip_group.py | 22 + .../network/get_local_network_gateway.py | 22 + .../get_network_ddos_protection_plan.py | 22 + .../network/get_network_interface.py | 22 + .../network/get_network_security_group.py | 22 + .../network/get_network_watcher.py | 22 + .../pulumi_azure/network/get_public_i_ps.py | 20 + .../pulumi_azure/network/get_public_ip.py | 106 +++ .../network/get_public_ip_prefix.py | 20 + .../pulumi_azure/network/get_route_filter.py | 22 + .../pulumi_azure/network/get_route_table.py | 20 + .../pulumi_azure/network/get_service_tags.py | 26 + sdk/python/pulumi_azure/network/get_subnet.py | 24 + .../network/get_traffic_manager.py | 18 + .../network/get_traffic_manager_profile.py | 22 + .../pulumi_azure/network/get_virtual_hub.py | 22 + .../network/get_virtual_hub_connection.py | 24 + .../network/get_virtual_hub_route_table.py | 24 + .../network/get_virtual_network.py | 22 + .../network/get_virtual_network_gateway.py | 22 + .../pulumi_azure/network/get_vpn_gateway.py | 22 + sdk/python/pulumi_azure/network/ip_group.py | 40 ++ .../pulumi_azure/network/ip_group_cidr.py | 30 + .../network/local_network_gateway.py | 28 + .../pulumi_azure/network/nat_gateway.py | 34 + .../nat_gateway_public_ip_association.py | 42 ++ ...at_gateway_public_ip_prefix_association.py | 42 ++ .../network/network_connection_monitor.py | 200 ++++++ .../pulumi_azure/network/network_interface.py | 50 ++ ..._application_security_group_association.py | 62 ++ ...erface_backend_address_pool_association.py | 82 +++ .../network_interface_nat_rule_association.py | 94 +++ ...rk_interface_security_group_association.py | 62 ++ .../pulumi_azure/network/network_manager.py | 48 ++ .../network/network_manager_admin_rule.py | 104 +++ .../network_manager_admin_rule_collection.py | 52 ++ ...work_manager_connectivity_configuration.py | 76 +++ .../network/network_manager_deployment.py | 86 +++ ...ork_manager_management_group_connection.py | 64 ++ .../network/network_manager_network_group.py | 44 ++ .../network_manager_scope_connection.py | 48 ++ .../network/network_manager_static_member.py | 62 ++ ...network_manager_subscription_connection.py | 42 ++ .../network/network_packet_capture.py | 148 ++++ .../network/network_security_group.py | 52 ++ .../network/network_security_rule.py | 46 ++ .../pulumi_azure/network/network_watcher.py | 24 + .../network/network_watcher_flow_log.py | 86 +++ sdk/python/pulumi_azure/network/outputs.py | 8 + .../network/point_to_point_vpn_gateway.py | 114 ++++ sdk/python/pulumi_azure/network/profile.py | 68 ++ sdk/python/pulumi_azure/network/public_ip.py | 32 + .../pulumi_azure/network/public_ip_prefix.py | 32 + sdk/python/pulumi_azure/network/route.py | 34 + .../pulumi_azure/network/route_filter.py | 34 + sdk/python/pulumi_azure/network/route_map.py | 66 ++ .../pulumi_azure/network/route_server.py | 64 ++ .../network/route_server_bgp_connection.py | 72 ++ .../pulumi_azure/network/route_table.py | 42 ++ .../pulumi_azure/network/routing_intent.py | 66 ++ .../network/security_partner_provider.py | 60 ++ sdk/python/pulumi_azure/network/subnet.py | 54 ++ .../network/subnet_nat_gateway_association.py | 46 ++ ...bnet_network_security_group_association.py | 68 ++ .../network/subnet_route_table_association.py | 58 ++ .../network/traffic_manager_azure_endpoint.py | 72 ++ .../traffic_manager_external_endpoint.py | 62 ++ .../traffic_manager_nested_endpoint.py | 100 +++ .../network/traffic_manager_profile.py | 66 ++ .../pulumi_azure/network/virtual_hub.py | 34 + .../network/virtual_hub_connection.py | 48 ++ .../pulumi_azure/network/virtual_hub_ip.py | 64 ++ .../network/virtual_hub_route_table.py | 88 +++ .../network/virtual_hub_route_table_route.py | 92 +++ .../pulumi_azure/network/virtual_network.py | 68 ++ .../network/virtual_network_dns_servers.py | 48 ++ .../network/virtual_network_gateway.py | 132 ++++ .../virtual_network_gateway_connection.py | 240 +++++++ .../network/virtual_network_peering.py | 48 ++ .../pulumi_azure/network/virtual_wan.py | 24 + .../network/vnp_gateway_nat_rule.py | 60 ++ .../pulumi_azure/network/vpn_gateway.py | 50 ++ .../network/vpn_gateway_connection.py | 96 +++ .../network/vpn_server_configuration.py | 74 ++ .../vpn_server_configuration_policy_group.py | 54 ++ sdk/python/pulumi_azure/network/vpn_site.py | 42 ++ .../azure_traffic_collector.py | 30 + sdk/python/pulumi_azure/newrelic/monitor.py | 42 ++ sdk/python/pulumi_azure/newrelic/tag_rule.py | 74 ++ sdk/python/pulumi_azure/nginx/certificate.py | 160 +++++ sdk/python/pulumi_azure/nginx/deployment.py | 92 +++ .../notificationhub/authorization_rule.py | 50 ++ .../pulumi_azure/notificationhub/get_hub.py | 24 + .../notificationhub/get_namespace.py | 22 + .../pulumi_azure/notificationhub/hub.py | 36 + .../pulumi_azure/notificationhub/namespace.py | 28 + .../operationalinsights/analytics_solution.py | 58 ++ .../analytics_workspace.py | 28 + .../get_analytics_workspace.py | 22 + .../operationalinsights/query_pack_query.py | 56 ++ sdk/python/pulumi_azure/orbital/contact.py | 152 +++++ .../pulumi_azure/orbital/contact_profile.py | 102 +++ sdk/python/pulumi_azure/orbital/spacecraft.py | 56 ++ .../pulumi_azure/paloalto/local_rulestack.py | 24 + .../paloalto/local_rulestack_certificate.py | 30 + .../paloalto/local_rulestack_fqdn_list.py | 30 + ..._outbound_trust_certificate_association.py | 32 + ...utbound_untrust_certificate_association.py | 32 + .../paloalto/local_rulestack_prefix_list.py | 30 + .../paloalto/local_rulestack_rule.py | 46 ++ ...ation_firewall_virtual_network_panorama.py | 128 ++++ .../pim/active_role_assignment.py | 108 +++ .../pim/eligible_role_assignment.py | 108 +++ sdk/python/pulumi_azure/policy/definition.py | 86 +++ .../policy/get_policy_assignment.py | 22 + .../policy/get_policy_defintion.py | 20 + .../policy/get_policy_defintion_built_in.py | 20 + .../policy/get_policy_set_definition.py | 20 + ...irtual_machine_configuration_assignment.py | 24 + .../policy/policy_set_definition.py | 62 ++ ...irtual_machine_configuration_assignment.py | 160 +++++ sdk/python/pulumi_azure/portal/dashboard.py | 270 ++++++++ .../pulumi_azure/portal/get_dashboard.py | 22 + .../active_directory_administrator.py | 48 ++ .../pulumi_azure/postgresql/configuration.py | 52 ++ .../pulumi_azure/postgresql/database.py | 52 ++ .../pulumi_azure/postgresql/firewall_rule.py | 68 ++ .../postgresql/flexible_server.py | 84 +++ ...e_server_active_directory_administrator.py | 64 ++ .../flexible_server_configuration.py | 78 +++ .../postgresql/flexible_server_database.py | 42 ++ .../flexible_server_firewall_rule.py | 42 ++ .../postgresql/get_flexible_server.py | 22 + .../pulumi_azure/postgresql/get_server.py | 22 + sdk/python/pulumi_azure/postgresql/server.py | 46 ++ .../pulumi_azure/postgresql/server_key.py | 156 +++++ .../postgresql/virtual_network_rule.py | 66 ++ sdk/python/pulumi_azure/powerbi/embedded.py | 28 + .../pulumi_azure/privatedns/a_record.py | 30 + .../pulumi_azure/privatedns/aaaa_record.py | 36 + .../pulumi_azure/privatedns/cname_record.py | 30 + .../pulumi_azure/privatedns/get_a_record.py | 26 +- .../privatedns/get_aaaa_record.py | 26 +- .../privatedns/get_cname_record.py | 26 +- .../pulumi_azure/privatedns/get_dns_zone.py | 22 + .../pulumi_azure/privatedns/get_mx_record.py | 26 +- .../pulumi_azure/privatedns/get_ptr_record.py | 26 +- .../pulumi_azure/privatedns/get_resolver.py | 20 + .../get_resolver_dns_forwarding_ruleset.py | 20 + .../get_resolver_forwarding_rule.py | 20 + .../get_resolver_inbound_endpoint.py | 20 + .../get_resolver_outbound_endpoint.py | 20 + .../get_resolver_virtual_network_link.py | 20 + .../pulumi_azure/privatedns/get_srv_record.py | 26 +- .../pulumi_azure/privatedns/get_txt_record.py | 26 +- .../get_zone_virtual_network_link.py | 24 + .../pulumi_azure/privatedns/link_service.py | 106 +++ .../pulumi_azure/privatedns/mx_record.py | 54 ++ .../pulumi_azure/privatedns/ptr_record.py | 30 + .../pulumi_azure/privatedns/resolver.py | 34 + .../resolver_dns_forwarding_ruleset.py | 84 +++ .../privatedns/resolver_forwarding_rule.py | 100 +++ .../privatedns/resolver_inbound_endpoint.py | 76 +++ .../privatedns/resolver_outbound_endpoint.py | 70 ++ .../resolver_virtual_network_link.py | 96 +++ .../pulumi_azure/privatedns/srv_record.py | 62 ++ .../pulumi_azure/privatedns/txt_record.py | 34 + sdk/python/pulumi_azure/privatedns/zone.py | 20 + .../privatedns/zone_virtual_network_link.py | 36 + .../application_security_group_association.py | 126 ++++ .../privatelink/get_endpoint_connection.py | 22 + .../pulumi_azure/privatelink/get_service.py | 22 + .../get_service_endpoint_connections.py | 22 + .../proximity/get_placement_group.py | 22 + .../pulumi_azure/proximity/placement_group.py | 30 + sdk/python/pulumi_azure/purview/account.py | 30 + .../recoveryservices/get_vault.py | 20 + .../pulumi_azure/recoveryservices/vault.py | 28 + .../vault_resource_guard_association.py | 40 ++ sdk/python/pulumi_azure/redis/_inputs.py | 16 + sdk/python/pulumi_azure/redis/cache.py | 40 ++ .../pulumi_azure/redis/enterprise_cluster.py | 26 + .../pulumi_azure/redis/enterprise_database.py | 58 ++ .../pulumi_azure/redis/firewall_rule.py | 64 ++ sdk/python/pulumi_azure/redis/get_cache.py | 24 + .../redis/get_enterprise_database.py | 26 + .../pulumi_azure/redis/linked_server.py | 80 +++ sdk/python/pulumi_azure/redis/outputs.py | 16 + .../pulumi_azure/relay/hybrid_connection.py | 42 ++ .../hybrid_connection_authorization_rule.py | 56 ++ sdk/python/pulumi_azure/relay/namespace.py | 32 + .../relay/namespace_authorization_rule.py | 44 ++ sdk/python/pulumi_azure/role/assignment.py | 160 +++++ sdk/python/pulumi_azure/role/definition.py | 34 + sdk/python/pulumi_azure/search/get_service.py | 22 + sdk/python/pulumi_azure/search/service.py | 78 +++ .../search/shared_private_link_service.py | 46 ++ .../advanced_threat_protection.py | 40 ++ .../pulumi_azure/securitycenter/assessment.py | 112 +++ .../securitycenter/assessment_policy.py | 24 + .../securitycenter/auto_provisioning.py | 18 + .../pulumi_azure/securitycenter/automation.py | 94 +++ .../pulumi_azure/securitycenter/contact.py | 26 + .../server_vulnerability_assessment.py | 88 +++ ...ulnerability_assessment_virtual_machine.py | 88 +++ .../pulumi_azure/securitycenter/setting.py | 22 + .../securitycenter/storage_defender.py | 30 + .../securitycenter/subscription_pricing.py | 74 ++ .../pulumi_azure/securitycenter/workspace.py | 32 + .../sentinel/alert_rule_anomaly_built_in.py | 46 ++ .../sentinel/alert_rule_anomaly_duplicate.py | 56 ++ .../sentinel/alert_rule_fusion.py | 52 ++ ...ule_machine_learning_behavior_analytics.py | 34 + .../alert_rule_ms_security_incident.py | 38 ++ .../pulumi_azure/sentinel/alert_rule_nrt.py | 46 ++ .../sentinel/alert_rule_scheduled.py | 46 ++ .../alert_rule_threat_intelligence.py | 56 ++ .../pulumi_azure/sentinel/authomation_rule.py | 44 ++ .../pulumi_azure/sentinel/automation_rule.py | 44 ++ .../data_connector_aws_cloud_trail.py | 34 + .../sentinel/data_connector_aws_s3.py | 38 ++ .../data_connector_azure_active_directory.py | 30 + ...nector_azure_advanced_thread_protection.py | 30 + .../data_connector_azure_security_center.py | 30 + .../sentinel/data_connector_dynamics365.py | 30 + .../sentinel/data_connector_iot.py | 30 + ..._connector_microsoft_cloud_app_security.py | 30 + ...oft_defender_advanced_threat_protection.py | 30 + ...connector_microsoft_threat_intelligence.py | 34 + ...a_connector_microsoft_threat_protection.py | 30 + .../sentinel/data_connector_office365.py | 30 + .../data_connector_office365_project.py | 30 + .../sentinel/data_connector_office_atp.py | 30 + .../sentinel/data_connector_office_irm.py | 30 + .../data_connector_office_power_bi.py | 30 + .../data_connector_threat_intelligence.py | 30 + ...ata_connector_threat_intelligence_taxii.py | 38 ++ .../pulumi_azure/sentinel/get_alert_rule.py | 26 + .../sentinel/get_alert_rule_anomaly.py | 38 ++ .../sentinel/get_alert_rule_template.py | 22 + .../log_analytics_workspace_onboarding.py | 34 + sdk/python/pulumi_azure/sentinel/metadata.py | 74 ++ .../sentinel/threat_intelligence_indicator.py | 50 ++ sdk/python/pulumi_azure/sentinel/watchlist.py | 36 + .../pulumi_azure/sentinel/watchlist_item.py | 48 ++ .../pulumi_azure/servicebus/get_namespace.py | 22 + .../get_namespace_authorization_rule.py | 22 + .../pulumi_azure/servicebus/get_queue.py | 22 + .../get_queue_authorization_rule.py | 26 + .../servicebus/get_subscription.py | 22 + .../pulumi_azure/servicebus/get_topic.py | 22 + .../get_topic_authorization_rule.py | 26 + .../pulumi_azure/servicebus/namespace.py | 32 + .../namespace_authorization_rule.py | 42 ++ .../namespace_disaster_recovery_config.py | 56 ++ .../servicebus/namespace_network_rule_set.py | 72 ++ sdk/python/pulumi_azure/servicebus/queue.py | 38 ++ .../servicebus/queue_authorization_rule.py | 48 ++ .../pulumi_azure/servicebus/subscription.py | 44 ++ .../servicebus/subscription_rule.py | 112 +++ sdk/python/pulumi_azure/servicebus/topic.py | 38 ++ .../servicebus/topic_authorization_rule.py | 44 ++ .../pulumi_azure/servicefabric/cluster.py | 48 ++ .../servicefabric/managed_cluster.py | 66 ++ .../pulumi_azure/signalr/get_service.py | 20 + sdk/python/pulumi_azure/signalr/service.py | 64 ++ .../signalr/service_custom_certificate.py | 128 ++++ .../signalr/service_custom_domain.py | 136 ++++ .../signalr/service_network_acl.py | 90 +++ .../signalr/shared_private_link_resource.py | 68 ++ .../pulumi_azure/siterecovery/fabric.py | 36 + .../pulumi_azure/siterecovery/get_fabric.py | 22 + .../siterecovery/get_protection_container.py | 24 + .../siterecovery/get_replication_policy.py | 22 + .../get_replication_recovery_plan.py | 24 + .../hyper_v_replication_policy.py | 36 + .../hyper_v_replication_policy_association.py | 44 ++ .../pulumi_azure/siterecovery/hyper_v_site.py | 30 + .../siterecovery/hyperv_network_mapping.py | 44 ++ .../siterecovery/network_mapping.py | 78 +++ .../siterecovery/protection_container.py | 44 ++ .../protection_container_mapping.py | 84 +++ .../siterecovery/replicated_vm.py | 282 ++++++++ .../siterecovery/replication_policy.py | 36 + .../siterecovery/replication_recovery_plan.py | 300 ++++++++ .../vm_ware_replication_policy.py | 38 ++ .../vmware_replication_policy_association.py | 40 ++ .../sql/active_directory_administrator.py | 44 ++ sdk/python/pulumi_azure/sql/database.py | 60 ++ sdk/python/pulumi_azure/sql/elastic_pool.py | 52 ++ sdk/python/pulumi_azure/sql/failover_group.py | 72 ++ sdk/python/pulumi_azure/sql/firewall_rule.py | 40 ++ sdk/python/pulumi_azure/sql/get_database.py | 24 + sdk/python/pulumi_azure/sql/get_server.py | 22 + .../sql/get_sql_managed_instance.py | 22 + .../pulumi_azure/sql/managed_database.py | 60 ++ .../pulumi_azure/sql/managed_instance.py | 308 +++++++++ ...instance_active_directory_administrator.py | 60 ++ sdk/python/pulumi_azure/sql/sql_server.py | 46 ++ .../pulumi_azure/sql/virtual_network_rule.py | 56 ++ sdk/python/pulumi_azure/stack/hci_cluster.py | 34 + sdk/python/pulumi_azure/storage/account.py | 100 +++ .../storage/account_network_rules.py | 64 ++ sdk/python/pulumi_azure/storage/blob.py | 44 ++ .../storage/blob_inventory_policy.py | 66 ++ sdk/python/pulumi_azure/storage/container.py | 40 ++ .../storage/customer_managed_key.py | 152 +++++ .../storage/data_lake_gen2_filesystem.py | 42 ++ .../storage/data_lake_gen2_path.py | 44 ++ .../pulumi_azure/storage/encryption_scope.py | 40 ++ .../pulumi_azure/storage/get_account.py | 22 + .../storage/get_account_blob_container_sas.py | 74 ++ .../pulumi_azure/storage/get_account_sas.py | 92 +++ sdk/python/pulumi_azure/storage/get_blob.py | 22 + .../storage/get_encryption_scope.py | 26 + sdk/python/pulumi_azure/storage/get_policy.py | 22 + sdk/python/pulumi_azure/storage/get_share.py | 22 + .../storage/get_storage_container.py | 20 + sdk/python/pulumi_azure/storage/get_sync.py | 22 + .../pulumi_azure/storage/get_sync_group.py | 22 + .../pulumi_azure/storage/get_table_entity.py | 24 + sdk/python/pulumi_azure/storage/local_user.py | 80 +++ .../pulumi_azure/storage/management_policy.py | 140 ++++ sdk/python/pulumi_azure/storage/mover.py | 32 + .../pulumi_azure/storage/mover_agent.py | 30 + .../storage/mover_job_definition.py | 84 +++ .../pulumi_azure/storage/mover_project.py | 30 + .../storage/mover_source_endpoint.py | 34 + .../storage/mover_target_endpoint.py | 52 ++ .../storage/object_replication.py | 82 +++ sdk/python/pulumi_azure/storage/queue.py | 30 + sdk/python/pulumi_azure/storage/share.py | 50 ++ .../pulumi_azure/storage/share_directory.py | 40 ++ sdk/python/pulumi_azure/storage/share_file.py | 40 ++ sdk/python/pulumi_azure/storage/sync.py | 30 + .../storage/sync_cloud_endpoint.py | 62 ++ sdk/python/pulumi_azure/storage/sync_group.py | 26 + sdk/python/pulumi_azure/storage/table.py | 30 + .../pulumi_azure/storage/table_entity.py | 46 ++ .../pulumi_azure/streamanalytics/cluster.py | 26 + .../function_java_script_udf.py | 48 ++ .../function_javascript_uda.py | 66 ++ .../pulumi_azure/streamanalytics/get_job.py | 22 + .../pulumi_azure/streamanalytics/job.py | 52 ++ .../streamanalytics/job_schedule.py | 148 ++++ .../managed_private_endpoint.py | 50 ++ .../streamanalytics/output_blob.py | 66 ++ .../streamanalytics/output_cosmosdb.py | 80 +++ .../streamanalytics/output_event_hub.py | 62 ++ .../streamanalytics/output_function.py | 90 +++ .../streamanalytics/output_mssql.py | 66 ++ .../streamanalytics/output_powerbi.py | 34 + .../output_service_bus_queue.py | 58 ++ .../output_servicebus_topic.py | 66 ++ .../streamanalytics/output_synapse.py | 72 ++ .../streamanalytics/output_table.py | 52 ++ .../streamanalytics/reference_input_blob.py | 64 ++ .../streamanalytics/reference_input_mssql.py | 62 ++ .../streamanalytics/stream_input_blob.py | 64 ++ .../streamanalytics/stream_input_event_hub.py | 74 ++ .../stream_input_event_hub_v2.py | 72 ++ .../streamanalytics/stream_input_iot_hub.py | 60 ++ .../pulumi_azure/synapse/firewall_rule.py | 60 ++ .../pulumi_azure/synapse/get_workspace.py | 22 + .../synapse/integration_runtime_azure.py | 70 ++ .../integration_runtime_self_hosted.py | 66 ++ .../pulumi_azure/synapse/linked_service.py | 88 +++ .../synapse/managed_private_endpoint.py | 84 +++ .../pulumi_azure/synapse/private_link_hub.py | 22 + .../pulumi_azure/synapse/role_assignment.py | 72 ++ sdk/python/pulumi_azure/synapse/sql_pool.py | 60 ++ .../sql_pool_extended_auditing_policy.py | 80 +++ .../synapse/sql_pool_security_alert_policy.py | 106 +++ .../sql_pool_vulnerability_assessment.py | 132 ++++ ..._pool_vulnerability_assessment_baseline.py | 116 ++++ .../synapse/sql_pool_workload_classifier.py | 90 +++ .../synapse/sql_pool_workload_group.py | 74 ++ sdk/python/pulumi_azure/synapse/workspace.py | 228 +++++++ .../synapse/workspace_aad_admin.py | 122 ++++ .../workspace_extended_auditing_policy.py | 72 ++ .../pulumi_azure/synapse/workspace_key.py | 150 ++++ .../workspace_security_alert_policy.py | 98 +++ .../synapse/workspace_sql_aad_admin.py | 122 ++++ .../workspace_vulnerability_assessment.py | 124 ++++ .../get_geographical_location.py | 18 + .../pulumi_azure/trafficmanager/profile.py | 66 ++ .../pulumi_azure/videoanalyzer/analyzer.py | 86 +++ .../pulumi_azure/videoanalyzer/edge_module.py | 94 +++ .../voice/services_communications_gateway.py | 94 +++ ...rvices_communications_gateway_test_line.py | 36 + .../pulumi_azure/waf/get_firewall_policy.py | 22 + sdk/python/pulumi_azure/waf/policy.py | 192 ++++++ .../webpubsub/get_private_link_resource.py | 30 + .../pulumi_azure/webpubsub/get_service.py | 20 + sdk/python/pulumi_azure/webpubsub/hub.py | 124 ++++ .../pulumi_azure/webpubsub/network_acl.py | 94 +++ sdk/python/pulumi_azure/webpubsub/service.py | 46 ++ .../webpubsub/shared_private_link_resource.py | 64 ++ 5247 files changed, 281351 insertions(+), 34 deletions(-) diff --git a/sdk/dotnet/AadB2C/Directory.cs b/sdk/dotnet/AadB2C/Directory.cs index 8fb65c4359..82f67c8833 100644 --- a/sdk/dotnet/AadB2C/Directory.cs +++ b/sdk/dotnet/AadB2C/Directory.cs @@ -12,6 +12,29 @@ namespace Pulumi.Azure.AadB2C /// /// Manages an AAD B2C Directory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.AadB2C.Directory("example", new() + /// { + /// CountryCode = "US", + /// DataResidencyLocation = "United States", + /// DisplayName = "example-b2c-tenant", + /// DomainName = "exampleb2ctenant.onmicrosoft.com", + /// ResourceGroupName = "example-rg", + /// SkuName = "PremiumP1", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// AAD B2C Directories can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AadB2C/GetDirectory.cs b/sdk/dotnet/AadB2C/GetDirectory.cs index a7a701085d..e66a807847 100644 --- a/sdk/dotnet/AadB2C/GetDirectory.cs +++ b/sdk/dotnet/AadB2C/GetDirectory.cs @@ -13,12 +13,66 @@ public static class GetDirectory { /// /// Use this data source to access information about an existing AAD B2C Directory. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AadB2C.GetDirectory.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// DomainName = "exampleb2ctenant.onmicrosoft.com", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["tenantId"] = example.Apply(getDirectoryResult => getDirectoryResult.TenantId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDirectoryArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:aadb2c/getDirectory:getDirectory", args ?? new GetDirectoryArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing AAD B2C Directory. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AadB2C.GetDirectory.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// DomainName = "exampleb2ctenant.onmicrosoft.com", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["tenantId"] = example.Apply(getDirectoryResult => getDirectoryResult.TenantId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDirectoryInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:aadb2c/getDirectory:getDirectory", args ?? new GetDirectoryInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Advisor/GetRecommendations.cs b/sdk/dotnet/Advisor/GetRecommendations.cs index 6e8e26dcc9..0bf4a328c3 100644 --- a/sdk/dotnet/Advisor/GetRecommendations.cs +++ b/sdk/dotnet/Advisor/GetRecommendations.cs @@ -13,12 +13,80 @@ public static class GetRecommendations { /// /// Use this data source to access information about an existing Advisor Recommendations. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Advisor.GetRecommendations.Invoke(new() + /// { + /// FilterByCategories = new[] + /// { + /// "security", + /// "cost", + /// }, + /// FilterByResourceGroups = new[] + /// { + /// "example-resgroups", + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["recommendations"] = example.Apply(getRecommendationsResult => getRecommendationsResult.Recommendations), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRecommendationsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:advisor/getRecommendations:getRecommendations", args ?? new GetRecommendationsArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Advisor Recommendations. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Advisor.GetRecommendations.Invoke(new() + /// { + /// FilterByCategories = new[] + /// { + /// "security", + /// "cost", + /// }, + /// FilterByResourceGroups = new[] + /// { + /// "example-resgroups", + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["recommendations"] = example.Apply(getRecommendationsResult => getRecommendationsResult.Recommendations), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRecommendationsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:advisor/getRecommendations:getRecommendations", args ?? new GetRecommendationsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AnalysisServices/Server.cs b/sdk/dotnet/AnalysisServices/Server.cs index 19de18e8f8..2f14f80d86 100644 --- a/sdk/dotnet/AnalysisServices/Server.cs +++ b/sdk/dotnet/AnalysisServices/Server.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.AnalysisServices /// /// Manages an Analysis Services Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var server = new Azure.AnalysisServices.Server("server", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = "S0", + /// AdminUsers = new[] + /// { + /// "myuser@domain.tld", + /// }, + /// EnablePowerBiService = true, + /// Ipv4FirewallRules = new[] + /// { + /// new Azure.AnalysisServices.Inputs.ServerIpv4FirewallRuleArgs + /// { + /// Name = "myRule1", + /// RangeStart = "210.117.252.0", + /// RangeEnd = "210.117.252.255", + /// }, + /// }, + /// Tags = + /// { + /// { "abc", "123" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// > **NOTE:** The server resource will automatically be started and stopped during an update if it is in `paused` state. + /// /// ## Import /// /// Analysis Services Server can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Api.cs b/sdk/dotnet/ApiManagement/Api.cs index 49a465662c..9c6c4d3042 100644 --- a/sdk/dotnet/ApiManagement/Api.cs +++ b/sdk/dotnet/ApiManagement/Api.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleApi = new Azure.ApiManagement.Api("exampleApi", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// Revision = "1", + /// DisplayName = "Example API", + /// Path = "example", + /// Protocols = new[] + /// { + /// "https", + /// }, + /// Import = new Azure.ApiManagement.Inputs.ApiImportArgs + /// { + /// ContentFormat = "swagger-link-json", + /// ContentValue = "http://conferenceapi.azurewebsites.net/?format=json", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiDiagnostic.cs b/sdk/dotnet/ApiManagement/ApiDiagnostic.cs index 9f8e040056..b36b335a5b 100644 --- a/sdk/dotnet/ApiManagement/ApiDiagnostic.cs +++ b/sdk/dotnet/ApiManagement/ApiDiagnostic.cs @@ -12,6 +12,122 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management Service API Diagnostics Logs. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@mycompany.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleApi = new Azure.ApiManagement.Api("exampleApi", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// Revision = "1", + /// DisplayName = "Example API", + /// Path = "example", + /// Protocols = new[] + /// { + /// "https", + /// }, + /// Import = new Azure.ApiManagement.Inputs.ApiImportArgs + /// { + /// ContentFormat = "swagger-link-json", + /// ContentValue = "http://conferenceapi.azurewebsites.net/?format=json", + /// }, + /// }); + /// + /// var exampleLogger = new Azure.ApiManagement.Logger("exampleLogger", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsights = new Azure.ApiManagement.Inputs.LoggerApplicationInsightsArgs + /// { + /// InstrumentationKey = exampleInsights.InstrumentationKey, + /// }, + /// }); + /// + /// var exampleApiDiagnostic = new Azure.ApiManagement.ApiDiagnostic("exampleApiDiagnostic", new() + /// { + /// Identifier = "applicationinsights", + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// ApiName = exampleApi.Name, + /// ApiManagementLoggerId = exampleLogger.Id, + /// SamplingPercentage = 5, + /// AlwaysLogErrors = true, + /// LogClientIp = true, + /// Verbosity = "verbose", + /// HttpCorrelationProtocol = "W3C", + /// FrontendRequest = new Azure.ApiManagement.Inputs.ApiDiagnosticFrontendRequestArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "accept", + /// "origin", + /// }, + /// }, + /// FrontendResponse = new Azure.ApiManagement.Inputs.ApiDiagnosticFrontendResponseArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "content-length", + /// "origin", + /// }, + /// }, + /// BackendRequest = new Azure.ApiManagement.Inputs.ApiDiagnosticBackendRequestArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "accept", + /// "origin", + /// }, + /// }, + /// BackendResponse = new Azure.ApiManagement.Inputs.ApiDiagnosticBackendResponseArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "content-length", + /// "origin", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Service API Diagnostics Logs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiOperation.cs b/sdk/dotnet/ApiManagement/ApiOperation.cs index 6ee2a50baa..08fd9df10d 100644 --- a/sdk/dotnet/ApiManagement/ApiOperation.cs +++ b/sdk/dotnet/ApiManagement/ApiOperation.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Operation within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleApi = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "search-api", + /// ApiManagementName = "search-api-management", + /// ResourceGroupName = "search-service", + /// Revision = "2", + /// }); + /// + /// var exampleApiOperation = new Azure.ApiManagement.ApiOperation("exampleApiOperation", new() + /// { + /// OperationId = "user-delete", + /// ApiName = exampleApi.Apply(getApiResult => getApiResult.Name), + /// ApiManagementName = exampleApi.Apply(getApiResult => getApiResult.ApiManagementName), + /// ResourceGroupName = exampleApi.Apply(getApiResult => getApiResult.ResourceGroupName), + /// DisplayName = "Delete User Operation", + /// Method = "DELETE", + /// UrlTemplate = "/users/{id}/delete", + /// Description = "This can only be done by the logged in user.", + /// Responses = new[] + /// { + /// new Azure.ApiManagement.Inputs.ApiOperationResponseArgs + /// { + /// StatusCode = 200, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Operation's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiOperationPolicy.cs b/sdk/dotnet/ApiManagement/ApiOperationPolicy.cs index de1f487986..7ac97932be 100644 --- a/sdk/dotnet/ApiManagement/ApiOperationPolicy.cs +++ b/sdk/dotnet/ApiManagement/ApiOperationPolicy.cs @@ -12,6 +12,65 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management API Operation Policy /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleApi = new Azure.ApiManagement.Api("exampleApi", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// Revision = "1", + /// }); + /// + /// var exampleApiOperation = new Azure.ApiManagement.ApiOperation("exampleApiOperation", new() + /// { + /// OperationId = "acctest-operation", + /// ApiName = exampleApi.Name, + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DisplayName = "DELETE Resource", + /// Method = "DELETE", + /// UrlTemplate = "/resource", + /// }); + /// + /// var exampleApiOperationPolicy = new Azure.ApiManagement.ApiOperationPolicy("exampleApiOperationPolicy", new() + /// { + /// ApiName = exampleApiOperation.ApiName, + /// ApiManagementName = exampleApiOperation.ApiManagementName, + /// ResourceGroupName = exampleApiOperation.ResourceGroupName, + /// OperationId = exampleApiOperation.OperationId, + /// XmlContent = @"<policies> + /// <inbound> + /// <find-and-replace from=""xyz"" to=""abc"" /> + /// </inbound> + /// </policies> + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Operation Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiOperationTag.cs b/sdk/dotnet/ApiManagement/ApiOperationTag.cs index 6709b971f0..c9c39f50a6 100644 --- a/sdk/dotnet/ApiManagement/ApiOperationTag.cs +++ b/sdk/dotnet/ApiManagement/ApiOperationTag.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management API Operation Tag. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleApi = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "search-api", + /// ApiManagementName = "search-api-management", + /// ResourceGroupName = "search-service", + /// Revision = "2", + /// }); + /// + /// var exampleApiOperation = new Azure.ApiManagement.ApiOperation("exampleApiOperation", new() + /// { + /// OperationId = "user-delete", + /// ApiName = exampleApi.Apply(getApiResult => getApiResult.Name), + /// ApiManagementName = exampleApi.Apply(getApiResult => getApiResult.ApiManagementName), + /// ResourceGroupName = exampleApi.Apply(getApiResult => getApiResult.ResourceGroupName), + /// DisplayName = "Delete User Operation", + /// Method = "DELETE", + /// UrlTemplate = "/users/{id}/delete", + /// Description = "This can only be done by the logged in user.", + /// Responses = new[] + /// { + /// new Azure.ApiManagement.Inputs.ApiOperationResponseArgs + /// { + /// StatusCode = 200, + /// }, + /// }, + /// }); + /// + /// var exampleApiOperationTag = new Azure.ApiManagement.ApiOperationTag("exampleApiOperationTag", new() + /// { + /// ApiOperationId = exampleApiOperation.Id, + /// DisplayName = "example-Tag", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Operation Tags can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiPolicy.cs b/sdk/dotnet/ApiManagement/ApiPolicy.cs index e344843a36..42934802e6 100644 --- a/sdk/dotnet/ApiManagement/ApiPolicy.cs +++ b/sdk/dotnet/ApiManagement/ApiPolicy.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management API Policy /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleApi = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "my-api", + /// ApiManagementName = "example-apim", + /// ResourceGroupName = "search-service", + /// Revision = "2", + /// }); + /// + /// var exampleApiPolicy = new Azure.ApiManagement.ApiPolicy("exampleApiPolicy", new() + /// { + /// ApiName = exampleApi.Apply(getApiResult => getApiResult.Name), + /// ApiManagementName = exampleApi.Apply(getApiResult => getApiResult.ApiManagementName), + /// ResourceGroupName = exampleApi.Apply(getApiResult => getApiResult.ResourceGroupName), + /// XmlContent = @"<policies> + /// <inbound> + /// <find-and-replace from=""xyz"" to=""abc"" /> + /// </inbound> + /// </policies> + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiRelease.cs b/sdk/dotnet/ApiManagement/ApiRelease.cs index 1f17c46f0b..bd918d8e19 100644 --- a/sdk/dotnet/ApiManagement/ApiRelease.cs +++ b/sdk/dotnet/ApiManagement/ApiRelease.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management API Release. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleApi = new Azure.ApiManagement.Api("exampleApi", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// Revision = "1", + /// DisplayName = "Example API", + /// Path = "example", + /// Protocols = new[] + /// { + /// "https", + /// }, + /// Import = new Azure.ApiManagement.Inputs.ApiImportArgs + /// { + /// ContentFormat = "swagger-link-json", + /// ContentValue = "http://conferenceapi.azurewebsites.net/?format=json", + /// }, + /// }); + /// + /// var exampleApiRelease = new Azure.ApiManagement.ApiRelease("exampleApiRelease", new() + /// { + /// ApiId = exampleApi.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Releases can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiSchema.cs b/sdk/dotnet/ApiManagement/ApiSchema.cs index ad67a88bec..25c61657e8 100644 --- a/sdk/dotnet/ApiManagement/ApiSchema.cs +++ b/sdk/dotnet/ApiManagement/ApiSchema.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Schema within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleApi = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "search-api", + /// ApiManagementName = "search-api-management", + /// ResourceGroupName = "search-service", + /// Revision = "2", + /// }); + /// + /// var exampleApiSchema = new Azure.ApiManagement.ApiSchema("exampleApiSchema", new() + /// { + /// ApiName = exampleApi.Apply(getApiResult => getApiResult.Name), + /// ApiManagementName = exampleApi.Apply(getApiResult => getApiResult.ApiManagementName), + /// ResourceGroupName = exampleApi.Apply(getApiResult => getApiResult.ResourceGroupName), + /// SchemaId = "example-schema", + /// ContentType = "application/vnd.ms-azure-apim.xsd+xml", + /// Value = File.ReadAllText("api_management_api_schema.xml"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiTag.cs b/sdk/dotnet/ApiManagement/ApiTag.cs index 609842d5e3..17cca96fb4 100644 --- a/sdk/dotnet/ApiManagement/ApiTag.cs +++ b/sdk/dotnet/ApiManagement/ApiTag.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages the Assignment of an API Management API Tag to an API. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-apim", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleApi = new Azure.ApiManagement.Api("exampleApi", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// Revision = "1", + /// }); + /// + /// var exampleTag = new Azure.ApiManagement.Tag("exampleTag", new() + /// { + /// ApiManagementId = exampleService.Apply(getServiceResult => getServiceResult.Id), + /// }); + /// + /// var exampleApiTag = new Azure.ApiManagement.ApiTag("exampleApiTag", new() + /// { + /// ApiId = exampleApi.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Tags can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ApiVersionSet.cs b/sdk/dotnet/ApiManagement/ApiVersionSet.cs index b30baec164..2c65616682 100644 --- a/sdk/dotnet/ApiManagement/ApiVersionSet.cs +++ b/sdk/dotnet/ApiManagement/ApiVersionSet.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Version Set within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleApiVersionSet = new Azure.ApiManagement.ApiVersionSet("exampleApiVersionSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// DisplayName = "ExampleAPIVersionSet", + /// VersioningScheme = "Segment", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Version Set can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/AuthorizationServer.cs b/sdk/dotnet/ApiManagement/AuthorizationServer.cs index 28dc7e8530..1bbd1abce3 100644 --- a/sdk/dotnet/ApiManagement/AuthorizationServer.cs +++ b/sdk/dotnet/ApiManagement/AuthorizationServer.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an Authorization Server within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "search-api", + /// ResourceGroupName = "search-service", + /// }); + /// + /// var exampleAuthorizationServer = new Azure.ApiManagement.AuthorizationServer("exampleAuthorizationServer", new() + /// { + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// DisplayName = "Test Server", + /// AuthorizationEndpoint = "https://example.mydomain.com/client/authorize", + /// ClientId = "42424242-4242-4242-4242-424242424242", + /// ClientRegistrationEndpoint = "https://example.mydomain.com/client/register", + /// GrantTypes = new[] + /// { + /// "authorizationCode", + /// }, + /// AuthorizationMethods = new[] + /// { + /// "GET", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Authorization Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Backend.cs b/sdk/dotnet/ApiManagement/Backend.cs index 86a89641a8..062f4d9ee1 100644 --- a/sdk/dotnet/ApiManagement/Backend.cs +++ b/sdk/dotnet/ApiManagement/Backend.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a backend within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleBackend = new Azure.ApiManagement.Backend("exampleBackend", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// Protocol = "http", + /// Url = "https://backend", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management backends can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Certificate.cs b/sdk/dotnet/ApiManagement/Certificate.cs index daa99a2e9e..de9836aa74 100644 --- a/sdk/dotnet/ApiManagement/Certificate.cs +++ b/sdk/dotnet/ApiManagement/Certificate.cs @@ -13,6 +13,141 @@ namespace Pulumi.Azure.ApiManagement /// Manages an Certificate within an API Management Service. /// /// ## Example Usage + /// ### With Base64 Certificate) + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleCertificate = new Azure.ApiManagement.Certificate("exampleCertificate", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Data = ReadFileBase64("example.pfx"), + /// }); + /// + /// }); + /// ``` + /// ### With Key Vault Certificate) + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// Identity = new Azure.ApiManagement.Inputs.ServiceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// }); + /// + /// var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("exampleAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = exampleService.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleService.Identity.Apply(identity => identity?.PrincipalId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// CertificatePermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs + /// { + /// Contents = ReadFileBase64("example_cert.pfx"), + /// Password = "terraform", + /// }, + /// CertificatePolicy = new Azure.KeyVault.Inputs.CertificateCertificatePolicyArgs + /// { + /// IssuerParameters = new Azure.KeyVault.Inputs.CertificateCertificatePolicyIssuerParametersArgs + /// { + /// Name = "Self", + /// }, + /// KeyProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyKeyPropertiesArgs + /// { + /// Exportable = true, + /// KeySize = 2048, + /// KeyType = "RSA", + /// ReuseKey = false, + /// }, + /// SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs + /// { + /// ContentType = "application/x-pkcs12", + /// }, + /// }, + /// }); + /// + /// var exampleApimanagement_certificateCertificate = new Azure.ApiManagement.Certificate("exampleApimanagement/certificateCertificate", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// KeyVaultSecretId = exampleCertificate.SecretId, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/ApiManagement/CustomDomain.cs b/sdk/dotnet/ApiManagement/CustomDomain.cs index 26cc6d7020..095407f60a 100644 --- a/sdk/dotnet/ApiManagement/CustomDomain.cs +++ b/sdk/dotnet/ApiManagement/CustomDomain.cs @@ -16,6 +16,119 @@ namespace Pulumi.Azure.ApiManagement /// /// > **Note:** It's possible to define Custom Domains both within the `azure.apimanagement.Service` resource via the `hostname_configurations` block and by using this resource. However it's not possible to use both methods to manage Custom Domains within an API Management Service, since there will be conflicts. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "mykeyvault", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// CertificatePolicy = new Azure.KeyVault.Inputs.CertificateCertificatePolicyArgs + /// { + /// IssuerParameters = new Azure.KeyVault.Inputs.CertificateCertificatePolicyIssuerParametersArgs + /// { + /// Name = "Self", + /// }, + /// KeyProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyKeyPropertiesArgs + /// { + /// Exportable = true, + /// KeySize = 2048, + /// KeyType = "RSA", + /// ReuseKey = true, + /// }, + /// LifetimeActions = new[] + /// { + /// new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionArgs + /// { + /// Action = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionActionArgs + /// { + /// ActionType = "AutoRenew", + /// }, + /// Trigger = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionTriggerArgs + /// { + /// DaysBeforeExpiry = 30, + /// }, + /// }, + /// }, + /// SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs + /// { + /// ContentType = "application/x-pkcs12", + /// }, + /// X509CertificateProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesArgs + /// { + /// KeyUsages = new[] + /// { + /// "cRLSign", + /// "dataEncipherment", + /// "digitalSignature", + /// "keyAgreement", + /// "keyCertSign", + /// "keyEncipherment", + /// }, + /// Subject = "CN=api.example.com", + /// ValidityInMonths = 12, + /// SubjectAlternativeNames = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs + /// { + /// DnsNames = new[] + /// { + /// "api.example.com", + /// "portal.example.com", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCustomDomain = new Azure.ApiManagement.CustomDomain("exampleCustomDomain", new() + /// { + /// ApiManagementId = exampleService.Id, + /// Gateways = new[] + /// { + /// new Azure.ApiManagement.Inputs.CustomDomainGatewayArgs + /// { + /// HostName = "api.example.com", + /// KeyVaultId = exampleCertificate.VersionlessSecretId, + /// }, + /// }, + /// DeveloperPortals = new[] + /// { + /// new Azure.ApiManagement.Inputs.CustomDomainDeveloperPortalArgs + /// { + /// HostName = "portal.example.com", + /// KeyVaultId = exampleCertificate.VersionlessSecretId, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Diagnostic.cs b/sdk/dotnet/ApiManagement/Diagnostic.cs index f49a2c3ddb..04765f9070 100644 --- a/sdk/dotnet/ApiManagement/Diagnostic.cs +++ b/sdk/dotnet/ApiManagement/Diagnostic.cs @@ -12,6 +12,103 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Service Diagnostic. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@mycompany.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleLogger = new Azure.ApiManagement.Logger("exampleLogger", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsights = new Azure.ApiManagement.Inputs.LoggerApplicationInsightsArgs + /// { + /// InstrumentationKey = exampleInsights.InstrumentationKey, + /// }, + /// }); + /// + /// var exampleDiagnostic = new Azure.ApiManagement.Diagnostic("exampleDiagnostic", new() + /// { + /// Identifier = "applicationinsights", + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// ApiManagementLoggerId = exampleLogger.Id, + /// SamplingPercentage = 5, + /// AlwaysLogErrors = true, + /// LogClientIp = true, + /// Verbosity = "verbose", + /// HttpCorrelationProtocol = "W3C", + /// FrontendRequest = new Azure.ApiManagement.Inputs.DiagnosticFrontendRequestArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "accept", + /// "origin", + /// }, + /// }, + /// FrontendResponse = new Azure.ApiManagement.Inputs.DiagnosticFrontendResponseArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "content-length", + /// "origin", + /// }, + /// }, + /// BackendRequest = new Azure.ApiManagement.Inputs.DiagnosticBackendRequestArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "accept", + /// "origin", + /// }, + /// }, + /// BackendResponse = new Azure.ApiManagement.Inputs.DiagnosticBackendResponseArgs + /// { + /// BodyBytes = 32, + /// HeadersToLogs = new[] + /// { + /// "content-type", + /// "content-length", + /// "origin", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Diagnostics can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/EmailTemplate.cs b/sdk/dotnet/ApiManagement/EmailTemplate.cs index 59b7e8c942..02260ee015 100644 --- a/sdk/dotnet/ApiManagement/EmailTemplate.cs +++ b/sdk/dotnet/ApiManagement/EmailTemplate.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management Email Template. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleEmailTemplate = new Azure.ApiManagement.EmailTemplate("exampleEmailTemplate", new() + /// { + /// TemplateName = "ConfirmSignUpIdentityDefault", + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// Subject = "Customized confirmation email for your new $OrganizationName API account", + /// Body = @"<!DOCTYPE html > + /// <html> + /// <head> + /// <meta charset=""UTF-8"" /> + /// <title>Customized Letter Title</title> + /// </head> + /// <body> + /// <p style=""font-size:12pt;font-family:'Segoe UI'"">Dear $DevFirstName $DevLastName,</p> + /// </body> + /// </html> + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Email Templates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Gateway.cs b/sdk/dotnet/ApiManagement/Gateway.cs index ac8bfd39c2..3620a40c99 100644 --- a/sdk/dotnet/ApiManagement/Gateway.cs +++ b/sdk/dotnet/ApiManagement/Gateway.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Gateway. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Consumption_0", + /// }); + /// + /// var exampleGateway = new Azure.ApiManagement.Gateway("exampleGateway", new() + /// { + /// ApiManagementId = exampleService.Id, + /// Description = "Example API Management gateway", + /// LocationData = new Azure.ApiManagement.Inputs.GatewayLocationDataArgs + /// { + /// Name = "example name", + /// City = "example city", + /// District = "example district", + /// Region = "example region", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/GatewayApi.cs b/sdk/dotnet/ApiManagement/GatewayApi.cs index ef9235c327..49144adcaf 100644 --- a/sdk/dotnet/ApiManagement/GatewayApi.cs +++ b/sdk/dotnet/ApiManagement/GatewayApi.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management Gateway API. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-api", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleApi = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "search-api", + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// Revision = "2", + /// }); + /// + /// var exampleGateway = Azure.ApiManagement.GetGateway.Invoke(new() + /// { + /// Name = "example-gateway", + /// ApiManagementId = exampleService.Apply(getServiceResult => getServiceResult.Id), + /// }); + /// + /// var exampleGatewayApi = new Azure.ApiManagement.GatewayApi("exampleGatewayApi", new() + /// { + /// GatewayId = exampleGateway.Apply(getGatewayResult => getGatewayResult.Id), + /// ApiId = exampleApi.Apply(getApiResult => getApiResult.Id), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Gateway APIs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/GatewayCertificateAuthority.cs b/sdk/dotnet/ApiManagement/GatewayCertificateAuthority.cs index 1e347bfcc3..85e5bcd3b4 100644 --- a/sdk/dotnet/ApiManagement/GatewayCertificateAuthority.cs +++ b/sdk/dotnet/ApiManagement/GatewayCertificateAuthority.cs @@ -12,6 +12,67 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Gateway Certificate Authority. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Consumption_0", + /// }); + /// + /// var exampleGateway = new Azure.ApiManagement.Gateway("exampleGateway", new() + /// { + /// ApiManagementId = exampleService.Id, + /// Description = "Example API Management gateway", + /// LocationData = new Azure.ApiManagement.Inputs.GatewayLocationDataArgs + /// { + /// Name = "example name", + /// City = "example city", + /// District = "example district", + /// Region = "example region", + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.ApiManagement.Certificate("exampleCertificate", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Data = ReadFileBase64("example.pfx"), + /// }); + /// + /// var exampleGatewayCertificateAuthority = new Azure.ApiManagement.GatewayCertificateAuthority("exampleGatewayCertificateAuthority", new() + /// { + /// ApiManagementId = exampleService.Id, + /// CertificateName = exampleCertificate.Name, + /// GatewayName = exampleGateway.Name, + /// IsTrusted = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Gateway Certificate Authority can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/GatewayHostNameConfiguration.cs b/sdk/dotnet/ApiManagement/GatewayHostNameConfiguration.cs index ea6492a3f3..2b506183d5 100644 --- a/sdk/dotnet/ApiManagement/GatewayHostNameConfiguration.cs +++ b/sdk/dotnet/ApiManagement/GatewayHostNameConfiguration.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Gateway Host Name Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Consumption_0", + /// }); + /// + /// var exampleGateway = new Azure.ApiManagement.Gateway("exampleGateway", new() + /// { + /// ApiManagementId = exampleService.Id, + /// Description = "Example API Management gateway", + /// LocationData = new Azure.ApiManagement.Inputs.GatewayLocationDataArgs + /// { + /// Name = "example name", + /// City = "example city", + /// District = "example district", + /// Region = "example region", + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.ApiManagement.Certificate("exampleCertificate", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Data = ReadFileBase64("example.pfx"), + /// }); + /// + /// var exampleGatewayHostNameConfiguration = new Azure.ApiManagement.GatewayHostNameConfiguration("exampleGatewayHostNameConfiguration", new() + /// { + /// ApiManagementId = exampleService.Id, + /// GatewayName = exampleGateway.Name, + /// CertificateId = exampleCertificate.Id, + /// HostName = "example-host-name", + /// RequestClientCertificateEnabled = true, + /// Http2Enabled = true, + /// Tls10Enabled = true, + /// Tls11Enabled = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Gateway Host Name Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/GetApi.cs b/sdk/dotnet/ApiManagement/GetApi.cs index ee66a7cecf..cdd97e22a6 100644 --- a/sdk/dotnet/ApiManagement/GetApi.cs +++ b/sdk/dotnet/ApiManagement/GetApi.cs @@ -13,12 +13,70 @@ public static class GetApi { /// /// Use this data source to access information about an existing API Management API. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "search-api", + /// ApiManagementName = "search-api-management", + /// ResourceGroupName = "search-service", + /// Revision = "2", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["apiManagementApiId"] = example.Apply(getApiResult => getApiResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetApiArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:apimanagement/getApi:getApi", args ?? new GetApiArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing API Management API. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "search-api", + /// ApiManagementName = "search-api-management", + /// ResourceGroupName = "search-service", + /// Revision = "2", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["apiManagementApiId"] = example.Apply(getApiResult => getApiResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetApiInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:apimanagement/getApi:getApi", args ?? new GetApiInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ApiManagement/GetApiVersionSet.cs b/sdk/dotnet/ApiManagement/GetApiVersionSet.cs index f95e430b0b..6b9cf0e1ed 100644 --- a/sdk/dotnet/ApiManagement/GetApiVersionSet.cs +++ b/sdk/dotnet/ApiManagement/GetApiVersionSet.cs @@ -13,12 +13,68 @@ public static class GetApiVersionSet { /// /// Uses this data source to access information about an API Version Set within an API Management Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetApiVersionSet.Invoke(new() + /// { + /// ResourceGroupName = "example-resources", + /// ApiManagementName = "example-api", + /// Name = "example-api-version-set", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["apiManagementApiVersionSetId"] = example.Apply(getApiVersionSetResult => getApiVersionSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetApiVersionSetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:apimanagement/getApiVersionSet:getApiVersionSet", args ?? new GetApiVersionSetArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an API Version Set within an API Management Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetApiVersionSet.Invoke(new() + /// { + /// ResourceGroupName = "example-resources", + /// ApiManagementName = "example-api", + /// Name = "example-api-version-set", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["apiManagementApiVersionSetId"] = example.Apply(getApiVersionSetResult => getApiVersionSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetApiVersionSetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:apimanagement/getApiVersionSet:getApiVersionSet", args ?? new GetApiVersionSetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ApiManagement/GetGateway.cs b/sdk/dotnet/ApiManagement/GetGateway.cs index e17cd2fb21..5eeccaab42 100644 --- a/sdk/dotnet/ApiManagement/GetGateway.cs +++ b/sdk/dotnet/ApiManagement/GetGateway.cs @@ -13,12 +13,70 @@ public static class GetGateway { /// /// Use this data source to access information about an existing API Management Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-apim", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleGateway = Azure.ApiManagement.GetGateway.Invoke(new() + /// { + /// Name = "example-api-gateway", + /// ApiManagementId = exampleService.Apply(getServiceResult => getServiceResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetGatewayArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:apimanagement/getGateway:getGateway", args ?? new GetGatewayArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing API Management Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-apim", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleGateway = Azure.ApiManagement.GetGateway.Invoke(new() + /// { + /// Name = "example-api-gateway", + /// ApiManagementId = exampleService.Apply(getServiceResult => getServiceResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetGatewayInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:apimanagement/getGateway:getGateway", args ?? new GetGatewayInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ApiManagement/GetGatewayHostNameConfiguration.cs b/sdk/dotnet/ApiManagement/GetGatewayHostNameConfiguration.cs index 18d3eff6e3..c8a6b0e80e 100644 --- a/sdk/dotnet/ApiManagement/GetGatewayHostNameConfiguration.cs +++ b/sdk/dotnet/ApiManagement/GetGatewayHostNameConfiguration.cs @@ -13,12 +13,92 @@ public static class GetGatewayHostNameConfiguration { /// /// Use this data source to access information about an existing API Management Gateway Host Configuration. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-apim", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleGateway = Azure.ApiManagement.GetGateway.Invoke(new() + /// { + /// Name = "example-gateway", + /// ApiManagementId = data.Azurerm_api_management.Main.Id, + /// }); + /// + /// var exampleGatewayHostNameConfiguration = Azure.ApiManagement.GetGatewayHostNameConfiguration.Invoke(new() + /// { + /// Name = "example-host-configuration", + /// ApiManagementId = exampleService.Apply(getServiceResult => getServiceResult.Id), + /// GatewayName = exampleGateway.Apply(getGatewayResult => getGatewayResult.Name), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["hostName"] = exampleGatewayHostNameConfiguration.Apply(getGatewayHostNameConfigurationResult => getGatewayHostNameConfigurationResult.HostName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetGatewayHostNameConfigurationArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:apimanagement/getGatewayHostNameConfiguration:getGatewayHostNameConfiguration", args ?? new GetGatewayHostNameConfigurationArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing API Management Gateway Host Configuration. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-apim", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleGateway = Azure.ApiManagement.GetGateway.Invoke(new() + /// { + /// Name = "example-gateway", + /// ApiManagementId = data.Azurerm_api_management.Main.Id, + /// }); + /// + /// var exampleGatewayHostNameConfiguration = Azure.ApiManagement.GetGatewayHostNameConfiguration.Invoke(new() + /// { + /// Name = "example-host-configuration", + /// ApiManagementId = exampleService.Apply(getServiceResult => getServiceResult.Id), + /// GatewayName = exampleGateway.Apply(getGatewayResult => getGatewayResult.Name), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["hostName"] = exampleGatewayHostNameConfiguration.Apply(getGatewayHostNameConfigurationResult => getGatewayHostNameConfigurationResult.HostName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetGatewayHostNameConfigurationInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:apimanagement/getGatewayHostNameConfiguration:getGatewayHostNameConfiguration", args ?? new GetGatewayHostNameConfigurationInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ApiManagement/GetGroup.cs b/sdk/dotnet/ApiManagement/GetGroup.cs index 7575dac842..58edda0c14 100644 --- a/sdk/dotnet/ApiManagement/GetGroup.cs +++ b/sdk/dotnet/ApiManagement/GetGroup.cs @@ -13,12 +13,68 @@ public static class GetGroup { /// /// Use this data source to access information about an existing API Management Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetGroup.Invoke(new() + /// { + /// Name = "my-group", + /// ApiManagementName = "example-apim", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["groupType"] = example.Apply(getGroupResult => getGroupResult.Type), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:apimanagement/getGroup:getGroup", args ?? new GetGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing API Management Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetGroup.Invoke(new() + /// { + /// Name = "my-group", + /// ApiManagementName = "example-apim", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["groupType"] = example.Apply(getGroupResult => getGroupResult.Type), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:apimanagement/getGroup:getGroup", args ?? new GetGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ApiManagement/GetProduct.cs b/sdk/dotnet/ApiManagement/GetProduct.cs index 7c03ab7150..11261e7bba 100644 --- a/sdk/dotnet/ApiManagement/GetProduct.cs +++ b/sdk/dotnet/ApiManagement/GetProduct.cs @@ -13,12 +13,68 @@ public static class GetProduct { /// /// Use this data source to access information about an existing API Management Product. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetProduct.Invoke(new() + /// { + /// ProductId = "my-product", + /// ApiManagementName = "example-apim", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["productTerms"] = example.Apply(getProductResult => getProductResult.Terms), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetProductArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:apimanagement/getProduct:getProduct", args ?? new GetProductArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing API Management Product. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetProduct.Invoke(new() + /// { + /// ProductId = "my-product", + /// ApiManagementName = "example-apim", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["productTerms"] = example.Apply(getProductResult => getProductResult.Terms), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetProductInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:apimanagement/getProduct:getProduct", args ?? new GetProductInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ApiManagement/GetService.cs b/sdk/dotnet/ApiManagement/GetService.cs index 62e55ac725..5217f9b33e 100644 --- a/sdk/dotnet/ApiManagement/GetService.cs +++ b/sdk/dotnet/ApiManagement/GetService.cs @@ -13,12 +13,66 @@ public static class GetService { /// /// Use this data source to access information about an existing API Management Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "search-api", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["apiManagementId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:apimanagement/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing API Management Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "search-api", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["apiManagementId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:apimanagement/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ApiManagement/GlobalSchema.cs b/sdk/dotnet/ApiManagement/GlobalSchema.cs index 98c17b8904..1ec41e002a 100644 --- a/sdk/dotnet/ApiManagement/GlobalSchema.cs +++ b/sdk/dotnet/ApiManagement/GlobalSchema.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a Global Schema within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Consumption_0", + /// }); + /// + /// var exampleGlobalSchema = new Azure.ApiManagement.GlobalSchema("exampleGlobalSchema", new() + /// { + /// SchemaId = "example-schema1", + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Type = "xml", + /// Value = File.ReadAllText("api_management_api_schema.xml"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Group.cs b/sdk/dotnet/ApiManagement/Group.cs index c88b6fdc1d..efd6ac25ad 100644 --- a/sdk/dotnet/ApiManagement/Group.cs +++ b/sdk/dotnet/ApiManagement/Group.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleGroup = new Azure.ApiManagement.Group("exampleGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// DisplayName = "Example Group", + /// Description = "This is an example API management group.", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/GroupUser.cs b/sdk/dotnet/ApiManagement/GroupUser.cs index 95e67e0a5d..e0c61cfc00 100644 --- a/sdk/dotnet/ApiManagement/GroupUser.cs +++ b/sdk/dotnet/ApiManagement/GroupUser.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management User Assignment to a Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleUser = Azure.ApiManagement.GetUser.Invoke(new() + /// { + /// UserId = "my-user", + /// ApiManagementName = "example-apim", + /// ResourceGroupName = "search-service", + /// }); + /// + /// var exampleGroupUser = new Azure.ApiManagement.GroupUser("exampleGroupUser", new() + /// { + /// UserId = exampleUser.Apply(getUserResult => getUserResult.Id), + /// GroupName = "example-group", + /// ResourceGroupName = exampleUser.Apply(getUserResult => getUserResult.ResourceGroupName), + /// ApiManagementName = exampleUser.Apply(getUserResult => getUserResult.ApiManagementName), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Group Users can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/IdentityProviderAad.cs b/sdk/dotnet/ApiManagement/IdentityProviderAad.cs index 477342e285..ceeec8f0be 100644 --- a/sdk/dotnet/ApiManagement/IdentityProviderAad.cs +++ b/sdk/dotnet/ApiManagement/IdentityProviderAad.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management AAD Identity Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@mycompany.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleIdentityProviderAad = new Azure.ApiManagement.IdentityProviderAad("exampleIdentityProviderAad", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// ClientId = "00000000-0000-0000-0000-000000000000", + /// ClientSecret = "00000000000000000000000000000000", + /// AllowedTenants = new[] + /// { + /// "00000000-0000-0000-0000-000000000000", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management AAD Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/IdentityProviderAadb2c.cs b/sdk/dotnet/ApiManagement/IdentityProviderAadb2c.cs index e7e39611f0..841167bb24 100644 --- a/sdk/dotnet/ApiManagement/IdentityProviderAadb2c.cs +++ b/sdk/dotnet/ApiManagement/IdentityProviderAadb2c.cs @@ -12,6 +12,64 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Azure AD B2C Identity Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleApplication = new AzureAD.Application("exampleApplication", new() + /// { + /// DisplayName = "acctestam-example", + /// }); + /// + /// var exampleApplicationPassword = new AzureAD.ApplicationPassword("exampleApplicationPassword", new() + /// { + /// ApplicationObjectId = exampleApplication.ObjectId, + /// EndDateRelative = "36h", + /// }); + /// + /// var exampleIdentityProviderAadb2c = new Azure.ApiManagement.IdentityProviderAadb2c("exampleIdentityProviderAadb2c", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// ClientId = exampleApplication.ApplicationId, + /// ClientSecret = "P@55w0rD!", + /// AllowedTenant = "myb2ctenant.onmicrosoft.com", + /// SigninTenant = "myb2ctenant.onmicrosoft.com", + /// Authority = "myb2ctenant.b2clogin.com", + /// SigninPolicy = "B2C_1_Login", + /// SignupPolicy = "B2C_1_Signup", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleApplicationPassword, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Azure AD B2C Identity Providers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/IdentityProviderFacebook.cs b/sdk/dotnet/ApiManagement/IdentityProviderFacebook.cs index 1aef4e70ab..5754086cc2 100644 --- a/sdk/dotnet/ApiManagement/IdentityProviderFacebook.cs +++ b/sdk/dotnet/ApiManagement/IdentityProviderFacebook.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Facebook Identity Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@mycompany.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleIdentityProviderFacebook = new Azure.ApiManagement.IdentityProviderFacebook("exampleIdentityProviderFacebook", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// AppId = "00000000000000000000000000000000", + /// AppSecret = "00000000000000000000000000000000", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Facebook Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/IdentityProviderGoogle.cs b/sdk/dotnet/ApiManagement/IdentityProviderGoogle.cs index 4a337eb04d..4ba49b5129 100644 --- a/sdk/dotnet/ApiManagement/IdentityProviderGoogle.cs +++ b/sdk/dotnet/ApiManagement/IdentityProviderGoogle.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Google Identity Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@mycompany.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleIdentityProviderGoogle = new Azure.ApiManagement.IdentityProviderGoogle("exampleIdentityProviderGoogle", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// ClientId = "00000000.apps.googleusercontent.com", + /// ClientSecret = "00000000000000000000000000000000", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Google Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/IdentityProviderMicrosoft.cs b/sdk/dotnet/ApiManagement/IdentityProviderMicrosoft.cs index abbb4332c7..84312c6361 100644 --- a/sdk/dotnet/ApiManagement/IdentityProviderMicrosoft.cs +++ b/sdk/dotnet/ApiManagement/IdentityProviderMicrosoft.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Microsoft Identity Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@mycompany.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleIdentityProviderMicrosoft = new Azure.ApiManagement.IdentityProviderMicrosoft("exampleIdentityProviderMicrosoft", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// ClientId = "00000000-0000-0000-0000-000000000000", + /// ClientSecret = "00000000000000000000000000000000", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Microsoft Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/IdentityProviderTwitter.cs b/sdk/dotnet/ApiManagement/IdentityProviderTwitter.cs index 4b700b101e..2fe98cb73a 100644 --- a/sdk/dotnet/ApiManagement/IdentityProviderTwitter.cs +++ b/sdk/dotnet/ApiManagement/IdentityProviderTwitter.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Twitter Identity Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@mycompany.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleIdentityProviderTwitter = new Azure.ApiManagement.IdentityProviderTwitter("exampleIdentityProviderTwitter", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// ApiKey = "00000000000000000000000000000000", + /// ApiSecretKey = "00000000000000000000000000000000", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Twitter Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Logger.cs b/sdk/dotnet/ApiManagement/Logger.cs index ef10a4ba6e..ba8b49ae17 100644 --- a/sdk/dotnet/ApiManagement/Logger.cs +++ b/sdk/dotnet/ApiManagement/Logger.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a Logger within an API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "other", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleLogger = new Azure.ApiManagement.Logger("exampleLogger", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ResourceId = exampleInsights.Id, + /// ApplicationInsights = new Azure.ApiManagement.Inputs.LoggerApplicationInsightsArgs + /// { + /// InstrumentationKey = exampleInsights.InstrumentationKey, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Loggers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/NamedValue.cs b/sdk/dotnet/ApiManagement/NamedValue.cs index c1bc0873fd..ec0c529a59 100644 --- a/sdk/dotnet/ApiManagement/NamedValue.cs +++ b/sdk/dotnet/ApiManagement/NamedValue.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Named Value. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleNamedValue = new Azure.ApiManagement.NamedValue("exampleNamedValue", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// DisplayName = "ExampleProperty", + /// Value = "Example Value", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Properties can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/NotificationRecipientEmail.cs b/sdk/dotnet/ApiManagement/NotificationRecipientEmail.cs index 690509bf58..cfc280673d 100644 --- a/sdk/dotnet/ApiManagement/NotificationRecipientEmail.cs +++ b/sdk/dotnet/ApiManagement/NotificationRecipientEmail.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management Notification Recipient Email. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleNotificationRecipientEmail = new Azure.ApiManagement.NotificationRecipientEmail("exampleNotificationRecipientEmail", new() + /// { + /// ApiManagementId = exampleService.Id, + /// NotificationType = "AccountClosedPublisher", + /// Email = "foo@bar.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Notification Recipient Emails can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/NotificationRecipientUser.cs b/sdk/dotnet/ApiManagement/NotificationRecipientUser.cs index b6d07ccbd1..865da1f020 100644 --- a/sdk/dotnet/ApiManagement/NotificationRecipientUser.cs +++ b/sdk/dotnet/ApiManagement/NotificationRecipientUser.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management Notification Recipient User. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleUser = new Azure.ApiManagement.User("exampleUser", new() + /// { + /// UserId = "123", + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FirstName = "Example", + /// LastName = "User", + /// Email = "foo@bar.com", + /// State = "active", + /// }); + /// + /// var exampleNotificationRecipientUser = new Azure.ApiManagement.NotificationRecipientUser("exampleNotificationRecipientUser", new() + /// { + /// ApiManagementId = exampleService.Id, + /// NotificationType = "AccountClosedPublisher", + /// UserId = exampleUser.UserId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Notification Recipient Users can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/OpenIdConnectProvider.cs b/sdk/dotnet/ApiManagement/OpenIdConnectProvider.cs index 590bbb5a83..b9f1622265 100644 --- a/sdk/dotnet/ApiManagement/OpenIdConnectProvider.cs +++ b/sdk/dotnet/ApiManagement/OpenIdConnectProvider.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an OpenID Connect Provider within a API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleOpenIdConnectProvider = new Azure.ApiManagement.OpenIdConnectProvider("exampleOpenIdConnectProvider", new() + /// { + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClientId = "00001111-2222-3333-4444-555566667777", + /// ClientSecret = "00001111-423egvwdcsjx-00001111", + /// DisplayName = "Example Provider", + /// MetadataEndpoint = "https://example.com/example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management OpenID Connect Providers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Policy.cs b/sdk/dotnet/ApiManagement/Policy.cs index 2a4d3aa7fb..475ece6a4b 100644 --- a/sdk/dotnet/ApiManagement/Policy.cs +++ b/sdk/dotnet/ApiManagement/Policy.cs @@ -14,6 +14,48 @@ namespace Pulumi.Azure.ApiManagement /// /// > **NOTE:** This resource will, upon creation, **overwrite any existing policy in the API Management service**, as there is no feasible way to test whether the policy has been modified from the default. Similarly, when this resource is destroyed, the API Management service will revert to its default policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleNamedValue = new Azure.ApiManagement.NamedValue("exampleNamedValue", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApiManagementName = exampleService.Name, + /// DisplayName = "ExampleProperty", + /// Value = "Example Value", + /// }); + /// + /// var examplePolicy = new Azure.ApiManagement.Policy("examplePolicy", new() + /// { + /// ApiManagementId = exampleService.Id, + /// XmlContent = File.ReadAllText("example.xml"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management service Policys can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Product.cs b/sdk/dotnet/ApiManagement/Product.cs index 3ad949a93d..e7d4db6a1c 100644 --- a/sdk/dotnet/ApiManagement/Product.cs +++ b/sdk/dotnet/ApiManagement/Product.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Product. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleProduct = new Azure.ApiManagement.Product("exampleProduct", new() + /// { + /// ProductId = "test-product", + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DisplayName = "Test Product", + /// SubscriptionRequired = true, + /// ApprovalRequired = true, + /// Published = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ProductApi.cs b/sdk/dotnet/ApiManagement/ProductApi.cs index 99b5f5308c..72a04a67fe 100644 --- a/sdk/dotnet/ApiManagement/ProductApi.cs +++ b/sdk/dotnet/ApiManagement/ProductApi.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management API Assignment to a Product. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-api", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleApi = Azure.ApiManagement.GetApi.Invoke(new() + /// { + /// Name = "search-api", + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// Revision = "2", + /// }); + /// + /// var exampleProduct = Azure.ApiManagement.GetProduct.Invoke(new() + /// { + /// ProductId = "my-product", + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// }); + /// + /// var exampleProductApi = new Azure.ApiManagement.ProductApi("exampleProductApi", new() + /// { + /// ApiName = exampleApi.Apply(getApiResult => getApiResult.Name), + /// ProductId = exampleProduct.Apply(getProductResult => getProductResult.ProductId), + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Product API's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ProductGroup.cs b/sdk/dotnet/ApiManagement/ProductGroup.cs index aabb37a163..ffedfcf689 100644 --- a/sdk/dotnet/ApiManagement/ProductGroup.cs +++ b/sdk/dotnet/ApiManagement/ProductGroup.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Product Assignment to a Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-api", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleProduct = Azure.ApiManagement.GetProduct.Invoke(new() + /// { + /// ProductId = "my-product", + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// }); + /// + /// var exampleGroup = Azure.ApiManagement.GetGroup.Invoke(new() + /// { + /// Name = "my-group", + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// }); + /// + /// var exampleProductGroup = new Azure.ApiManagement.ProductGroup("exampleProductGroup", new() + /// { + /// ProductId = exampleProduct.Apply(getProductResult => getProductResult.ProductId), + /// GroupName = exampleGroup.Apply(getGroupResult => getGroupResult.Name), + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Product Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ProductPolicy.cs b/sdk/dotnet/ApiManagement/ProductPolicy.cs index e2652a2d44..3c26188f10 100644 --- a/sdk/dotnet/ApiManagement/ProductPolicy.cs +++ b/sdk/dotnet/ApiManagement/ProductPolicy.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Product Policy /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleProduct = Azure.ApiManagement.GetProduct.Invoke(new() + /// { + /// ProductId = "my-product", + /// ApiManagementName = "example-apim", + /// ResourceGroupName = "search-service", + /// }); + /// + /// var exampleProductPolicy = new Azure.ApiManagement.ProductPolicy("exampleProductPolicy", new() + /// { + /// ProductId = exampleProduct.Apply(getProductResult => getProductResult.ProductId), + /// ApiManagementName = exampleProduct.Apply(getProductResult => getProductResult.ApiManagementName), + /// ResourceGroupName = exampleProduct.Apply(getProductResult => getProductResult.ResourceGroupName), + /// XmlContent = @"<policies> + /// <inbound> + /// <find-and-replace from=""xyz"" to=""abc"" /> + /// </inbound> + /// </policies> + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Product Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/ProductTag.cs b/sdk/dotnet/ApiManagement/ProductTag.cs index c5877054be..d96f736194 100644 --- a/sdk/dotnet/ApiManagement/ProductTag.cs +++ b/sdk/dotnet/ApiManagement/ProductTag.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management Product tag /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleProduct = new Azure.ApiManagement.Product("exampleProduct", new() + /// { + /// ProductId = "test-product", + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DisplayName = "Test Product", + /// SubscriptionRequired = true, + /// ApprovalRequired = true, + /// Published = true, + /// }); + /// + /// var exampleTag = new Azure.ApiManagement.Tag("exampleTag", new() + /// { + /// ApiManagementId = exampleService.Id, + /// }); + /// + /// var exampleProductTag = new Azure.ApiManagement.ProductTag("exampleProductTag", new() + /// { + /// ApiManagementProductId = exampleProduct.ProductId, + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/RedisCache.cs b/sdk/dotnet/ApiManagement/RedisCache.cs index 5b461a76bd..c7049f1168 100644 --- a/sdk/dotnet/ApiManagement/RedisCache.cs +++ b/sdk/dotnet/ApiManagement/RedisCache.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management Redis Cache. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "pub1", + /// PublisherEmail = "pub1@email.com", + /// SkuName = "Consumption_0", + /// }); + /// + /// var exampleCache = new Azure.Redis.Cache("exampleCache", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Capacity = 1, + /// Family = "C", + /// SkuName = "Basic", + /// EnableNonSslPort = false, + /// MinimumTlsVersion = "1.2", + /// RedisConfiguration = null, + /// }); + /// + /// var exampleRedisCache = new Azure.ApiManagement.RedisCache("exampleRedisCache", new() + /// { + /// ApiManagementId = exampleService.Id, + /// ConnectionString = exampleCache.PrimaryConnectionString, + /// Description = "Redis cache instances", + /// RedisCacheId = exampleCache.Id, + /// CacheLocation = "East Us", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Redis Caches can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Service.cs b/sdk/dotnet/ApiManagement/Service.cs index 7d942b1f26..607bb21759 100644 --- a/sdk/dotnet/ApiManagement/Service.cs +++ b/sdk/dotnet/ApiManagement/Service.cs @@ -10,6 +10,33 @@ namespace Pulumi.Azure.ApiManagement { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Subscription.cs b/sdk/dotnet/ApiManagement/Subscription.cs index 959b2171ee..ee9beb778c 100644 --- a/sdk/dotnet/ApiManagement/Subscription.cs +++ b/sdk/dotnet/ApiManagement/Subscription.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a Subscription within a API Management Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.ApiManagement.GetService.Invoke(new() + /// { + /// Name = "example-apim", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleProduct = Azure.ApiManagement.GetProduct.Invoke(new() + /// { + /// ProductId = "00000000-0000-0000-0000-000000000000", + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// }); + /// + /// var exampleUser = Azure.ApiManagement.GetUser.Invoke(new() + /// { + /// UserId = "11111111-1111-1111-1111-111111111111", + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// }); + /// + /// var exampleSubscription = new Azure.ApiManagement.Subscription("exampleSubscription", new() + /// { + /// ApiManagementName = exampleService.Apply(getServiceResult => getServiceResult.Name), + /// ResourceGroupName = exampleService.Apply(getServiceResult => getServiceResult.ResourceGroupName), + /// UserId = exampleUser.Apply(getUserResult => getUserResult.Id), + /// ProductId = exampleProduct.Apply(getProductResult => getProductResult.Id), + /// DisplayName = "Parser API", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/Tag.cs b/sdk/dotnet/ApiManagement/Tag.cs index c4616df6a2..5cffede984 100644 --- a/sdk/dotnet/ApiManagement/Tag.cs +++ b/sdk/dotnet/ApiManagement/Tag.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages a API Management Tag. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@terraform.io", + /// SkuName = "Consumption_0", + /// }); + /// + /// var exampleTag = new Azure.ApiManagement.Tag("exampleTag", new() + /// { + /// ApiManagementId = exampleService.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Tags can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ApiManagement/User.cs b/sdk/dotnet/ApiManagement/User.cs index f7e543f423..ace9f08032 100644 --- a/sdk/dotnet/ApiManagement/User.cs +++ b/sdk/dotnet/ApiManagement/User.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.ApiManagement /// /// Manages an API Management User. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.ApiManagement.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PublisherName = "My Company", + /// PublisherEmail = "company@exmaple.com", + /// SkuName = "Developer_1", + /// }); + /// + /// var exampleUser = new Azure.ApiManagement.User("exampleUser", new() + /// { + /// UserId = "5931a75ae4bbd512288c680b", + /// ApiManagementName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FirstName = "Example", + /// LastName = "User", + /// Email = "user@example.com", + /// State = "active", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Management Users can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppConfiguration/ConfigurationFeature.cs b/sdk/dotnet/AppConfiguration/ConfigurationFeature.cs index 9307dc5b93..2fce2b0b74 100644 --- a/sdk/dotnet/AppConfiguration/ConfigurationFeature.cs +++ b/sdk/dotnet/AppConfiguration/ConfigurationFeature.cs @@ -14,6 +14,47 @@ namespace Pulumi.Azure.AppConfiguration /// /// > **Note:** App Configuration Features are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). This is similar to providing App Configuration Keys. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var appconf = new Azure.AppConfiguration.ConfigurationStore("appconf", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var appconfDataowner = new Azure.Authorization.Assignment("appconfDataowner", new() + /// { + /// Scope = appconf.Id, + /// RoleDefinitionName = "App Configuration Data Owner", + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// var test = new Azure.AppConfiguration.ConfigurationFeature("test", new() + /// { + /// ConfigurationStoreId = appconf.Id, + /// Description = "test description", + /// Label = "test-ackeylabel", + /// Enabled = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Configuration Features can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppConfiguration/ConfigurationKey.cs b/sdk/dotnet/AppConfiguration/ConfigurationKey.cs index 7912027ad5..68a33b0ef3 100644 --- a/sdk/dotnet/AppConfiguration/ConfigurationKey.cs +++ b/sdk/dotnet/AppConfiguration/ConfigurationKey.cs @@ -15,6 +15,135 @@ namespace Pulumi.Azure.AppConfiguration /// > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). /// /// ## Example Usage + /// ### `Kv` Type + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var appconf = new Azure.AppConfiguration.ConfigurationStore("appconf", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var appconfDataowner = new Azure.Authorization.Assignment("appconfDataowner", new() + /// { + /// Scope = appconf.Id, + /// RoleDefinitionName = "App Configuration Data Owner", + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// var test = new Azure.AppConfiguration.ConfigurationKey("test", new() + /// { + /// ConfigurationStoreId = appconf.Id, + /// Key = "appConfKey1", + /// Label = "somelabel", + /// Value = "a test", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// appconfDataowner, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### `Vault` Type + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var appconf = new Azure.AppConfiguration.ConfigurationStore("appconf", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var kv = new Azure.KeyVault.KeyVault("kv", new() + /// { + /// Location = azurerm_resource_group.Test.Location, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// "Get", + /// "Delete", + /// "Purge", + /// "Recover", + /// }, + /// }, + /// }, + /// }); + /// + /// var kvs = new Azure.KeyVault.Secret("kvs", new() + /// { + /// Value = "szechuan", + /// KeyVaultId = kv.Id, + /// }); + /// + /// var appconfDataowner = new Azure.Authorization.Assignment("appconfDataowner", new() + /// { + /// Scope = appconf.Id, + /// RoleDefinitionName = "App Configuration Data Owner", + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// var test = new Azure.AppConfiguration.ConfigurationKey("test", new() + /// { + /// ConfigurationStoreId = azurerm_app_configuration.Test.Id, + /// Key = "key1", + /// Type = "vault", + /// Label = "label1", + /// VaultKeyReference = kvs.VersionlessId, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// appconfDataowner, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppConfiguration/ConfigurationStore.cs b/sdk/dotnet/AppConfiguration/ConfigurationStore.cs index 356757f9e4..5f94c9b0a5 100644 --- a/sdk/dotnet/AppConfiguration/ConfigurationStore.cs +++ b/sdk/dotnet/AppConfiguration/ConfigurationStore.cs @@ -10,6 +10,176 @@ namespace Pulumi.Azure.AppConfiguration { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var appconf = new Azure.AppConfiguration.ConfigurationStore("appconf", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// }); + /// + /// }); + /// ``` + /// ### Encryption) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// SoftDeleteRetentionDays = 7, + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var server = new Azure.KeyVault.AccessPolicy("server", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleUserAssignedIdentity.PrincipalId, + /// KeyPermissions = new[] + /// { + /// "Get", + /// "UnwrapKey", + /// "WrapKey", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var client = new Azure.KeyVault.AccessPolicy("client", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "Delete", + /// "List", + /// "Restore", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// "Purge", + /// "Encrypt", + /// "Decrypt", + /// "Sign", + /// "Verify", + /// "GetRotationPolicy", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// client, + /// server, + /// }, + /// }); + /// + /// var exampleConfigurationStore = new Azure.AppConfiguration.ConfigurationStore("exampleConfigurationStore", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "standard", + /// LocalAuthEnabled = true, + /// PublicNetworkAccess = "Enabled", + /// PurgeProtectionEnabled = false, + /// SoftDeleteRetentionDays = 1, + /// Identity = new Azure.AppConfiguration.Inputs.ConfigurationStoreIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Encryption = new Azure.AppConfiguration.Inputs.ConfigurationStoreEncryptionArgs + /// { + /// KeyVaultKeyIdentifier = exampleKey.Id, + /// IdentityClientId = exampleUserAssignedIdentity.ClientId, + /// }, + /// Replicas = new[] + /// { + /// new Azure.AppConfiguration.Inputs.ConfigurationStoreReplicaArgs + /// { + /// Name = "replica1", + /// Location = "West US", + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "development" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// client, + /// server, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppConfiguration/GetConfigurationKey.cs b/sdk/dotnet/AppConfiguration/GetConfigurationKey.cs index edb03638b0..d2889a5028 100644 --- a/sdk/dotnet/AppConfiguration/GetConfigurationKey.cs +++ b/sdk/dotnet/AppConfiguration/GetConfigurationKey.cs @@ -15,6 +15,34 @@ public static class GetConfigurationKey /// Use this data source to access information about an existing Azure App Configuration Key. /// /// > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.AppConfiguration.GetConfigurationKey.Invoke(new() + /// { + /// ConfigurationStoreId = azurerm_app_configuration.Appconf.Id, + /// Key = "appConfKey1", + /// Label = "somelabel", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["value"] = test.Apply(getConfigurationKeyResult => getConfigurationKeyResult.Value), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetConfigurationKeyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appconfiguration/getConfigurationKey:getConfigurationKey", args ?? new GetConfigurationKeyArgs(), options.WithDefaults()); @@ -23,6 +51,34 @@ public static Task InvokeAsync(GetConfigurationKeyArg /// Use this data source to access information about an existing Azure App Configuration Key. /// /// > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.AppConfiguration.GetConfigurationKey.Invoke(new() + /// { + /// ConfigurationStoreId = azurerm_app_configuration.Appconf.Id, + /// Key = "appConfKey1", + /// Label = "somelabel", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["value"] = test.Apply(getConfigurationKeyResult => getConfigurationKeyResult.Value), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetConfigurationKeyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appconfiguration/getConfigurationKey:getConfigurationKey", args ?? new GetConfigurationKeyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppConfiguration/GetConfigurationKeys.cs b/sdk/dotnet/AppConfiguration/GetConfigurationKeys.cs index a8fb8838df..538359cdbf 100644 --- a/sdk/dotnet/AppConfiguration/GetConfigurationKeys.cs +++ b/sdk/dotnet/AppConfiguration/GetConfigurationKeys.cs @@ -15,6 +15,32 @@ public static class GetConfigurationKeys /// Use this data source to access information about existing Azure App Configuration Keys. /// /// > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.AppConfiguration.GetConfigurationKeys.Invoke(new() + /// { + /// ConfigurationStoreId = azurerm_app_configuration.Appconf.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["value"] = test.Apply(getConfigurationKeysResult => getConfigurationKeysResult.Items), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetConfigurationKeysArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appconfiguration/getConfigurationKeys:getConfigurationKeys", args ?? new GetConfigurationKeysArgs(), options.WithDefaults()); @@ -23,6 +49,32 @@ public static Task InvokeAsync(GetConfigurationKeysA /// Use this data source to access information about existing Azure App Configuration Keys. /// /// > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.AppConfiguration.GetConfigurationKeys.Invoke(new() + /// { + /// ConfigurationStoreId = azurerm_app_configuration.Appconf.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["value"] = test.Apply(getConfigurationKeysResult => getConfigurationKeysResult.Items), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetConfigurationKeysInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appconfiguration/getConfigurationKeys:getConfigurationKeys", args ?? new GetConfigurationKeysInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppConfiguration/GetConfigurationStore.cs b/sdk/dotnet/AppConfiguration/GetConfigurationStore.cs index fdc00536aa..d3749a1eaa 100644 --- a/sdk/dotnet/AppConfiguration/GetConfigurationStore.cs +++ b/sdk/dotnet/AppConfiguration/GetConfigurationStore.cs @@ -13,12 +13,66 @@ public static class GetConfigurationStore { /// /// Use this data source to access information about an existing App Configuration. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppConfiguration.GetConfigurationStore.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getConfigurationStoreResult => getConfigurationStoreResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetConfigurationStoreArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appconfiguration/getConfigurationStore:getConfigurationStore", args ?? new GetConfigurationStoreArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing App Configuration. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppConfiguration.GetConfigurationStore.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getConfigurationStoreResult => getConfigurationStoreResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetConfigurationStoreInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appconfiguration/getConfigurationStore:getConfigurationStore", args ?? new GetConfigurationStoreInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppConfiguration/LicationLoadBalancer.cs b/sdk/dotnet/AppConfiguration/LicationLoadBalancer.cs index 3ebdab1cec..474572ac97 100644 --- a/sdk/dotnet/AppConfiguration/LicationLoadBalancer.cs +++ b/sdk/dotnet/AppConfiguration/LicationLoadBalancer.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.AppConfiguration /// /// Manages an Application Gateway for Containers (ALB). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLicationLoadBalancer = new Azure.AppConfiguration.LicationLoadBalancer("exampleLicationLoadBalancer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Application Gateway for Containers (ALB) can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/AnalyticsItem.cs b/sdk/dotnet/AppInsights/AnalyticsItem.cs index a1cabbc573..67fecff441 100644 --- a/sdk/dotnet/AppInsights/AnalyticsItem.cs +++ b/sdk/dotnet/AppInsights/AnalyticsItem.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.AppInsights /// /// Manages an Application Insights Analytics Item component. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleAnalyticsItem = new Azure.AppInsights.AnalyticsItem("exampleAnalyticsItem", new() + /// { + /// ApplicationInsightsId = exampleInsights.Id, + /// Content = "requests //simple example query", + /// Scope = "shared", + /// Type = "query", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Application Insights Analytics Items can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/ApiKey.cs b/sdk/dotnet/AppInsights/ApiKey.cs index 5e5ed84c47..e9fad5bc1a 100644 --- a/sdk/dotnet/AppInsights/ApiKey.cs +++ b/sdk/dotnet/AppInsights/ApiKey.cs @@ -12,6 +12,87 @@ namespace Pulumi.Azure.AppInsights /// /// Manages an Application Insights API key. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var readTelemetry = new Azure.AppInsights.ApiKey("readTelemetry", new() + /// { + /// ApplicationInsightsId = exampleInsights.Id, + /// ReadPermissions = new[] + /// { + /// "aggregate", + /// "api", + /// "draft", + /// "extendqueries", + /// "search", + /// }, + /// }); + /// + /// var writeAnnotations = new Azure.AppInsights.ApiKey("writeAnnotations", new() + /// { + /// ApplicationInsightsId = exampleInsights.Id, + /// WritePermissions = new[] + /// { + /// "annotations", + /// }, + /// }); + /// + /// var authenticateSdkControlChannelApiKey = new Azure.AppInsights.ApiKey("authenticateSdkControlChannelApiKey", new() + /// { + /// ApplicationInsightsId = exampleInsights.Id, + /// ReadPermissions = new[] + /// { + /// "agentconfig", + /// }, + /// }); + /// + /// var fullPermissions = new Azure.AppInsights.ApiKey("fullPermissions", new() + /// { + /// ApplicationInsightsId = exampleInsights.Id, + /// ReadPermissions = new[] + /// { + /// "agentconfig", + /// "aggregate", + /// "api", + /// "draft", + /// "extendqueries", + /// "search", + /// }, + /// WritePermissions = new[] + /// { + /// "annotations", + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["readTelemetryApiKey"] = readTelemetry.ApiKey, + /// ["writeAnnotationsApiKey"] = writeAnnotations.ApiKey, + /// ["authenticateSdkControlChannel"] = authenticateSdkControlChannelApiKey.ApiKey, + /// ["fullPermissionsApiKey"] = fullPermissions.ApiKey, + /// }; + /// }); + /// ``` + /// /// ## Import /// /// Application Insights API keys can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/GetInsights.cs b/sdk/dotnet/AppInsights/GetInsights.cs index e2dd4b260f..693af280ec 100644 --- a/sdk/dotnet/AppInsights/GetInsights.cs +++ b/sdk/dotnet/AppInsights/GetInsights.cs @@ -13,12 +13,66 @@ public static class GetInsights { /// /// Use this data source to access information about an existing Application Insights component. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppInsights.GetInsights.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["applicationInsightsInstrumentationKey"] = example.Apply(getInsightsResult => getInsightsResult.InstrumentationKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetInsightsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appinsights/getInsights:getInsights", args ?? new GetInsightsArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Application Insights component. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppInsights.GetInsights.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["applicationInsightsInstrumentationKey"] = example.Apply(getInsightsResult => getInsightsResult.InstrumentationKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetInsightsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appinsights/getInsights:getInsights", args ?? new GetInsightsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppInsights/Insights.cs b/sdk/dotnet/AppInsights/Insights.cs index 2dfdcc7289..7a01bea078 100644 --- a/sdk/dotnet/AppInsights/Insights.cs +++ b/sdk/dotnet/AppInsights/Insights.cs @@ -12,6 +12,74 @@ namespace Pulumi.Azure.AppInsights /// /// Manages an Application Insights component. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["instrumentationKey"] = exampleInsights.InstrumentationKey, + /// ["appId"] = exampleInsights.AppId, + /// }; + /// }); + /// ``` + /// ### Workspace Mode + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// ApplicationType = "web", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["instrumentationKey"] = exampleInsights.InstrumentationKey, + /// ["appId"] = exampleInsights.AppId, + /// }; + /// }); + /// ``` + /// /// ## Import /// /// Application Insights instances can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/SmartDetectionRule.cs b/sdk/dotnet/AppInsights/SmartDetectionRule.cs index 3d40c73229..6472d05d4b 100644 --- a/sdk/dotnet/AppInsights/SmartDetectionRule.cs +++ b/sdk/dotnet/AppInsights/SmartDetectionRule.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.AppInsights /// /// Manages an Application Insights Smart Detection Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleSmartDetectionRule = new Azure.AppInsights.SmartDetectionRule("exampleSmartDetectionRule", new() + /// { + /// ApplicationInsightsId = exampleInsights.Id, + /// Enabled = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Application Insights Smart Detection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/StandardWebTest.cs b/sdk/dotnet/AppInsights/StandardWebTest.cs index 2b46d211e1..0c098e621c 100644 --- a/sdk/dotnet/AppInsights/StandardWebTest.cs +++ b/sdk/dotnet/AppInsights/StandardWebTest.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.AppInsights /// /// Manages a Application Insights Standard WebTest. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleStandardWebTest = new Azure.AppInsights.StandardWebTest("exampleStandardWebTest", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// ApplicationInsightsId = exampleInsights.Id, + /// GeoLocations = new[] + /// { + /// "example", + /// }, + /// Request = new Azure.AppInsights.Inputs.StandardWebTestRequestArgs + /// { + /// Url = "http://www.example.com", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Application Insights Standard WebTests can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/WebTest.cs b/sdk/dotnet/AppInsights/WebTest.cs index 3c8ed735a7..ef8789535a 100644 --- a/sdk/dotnet/AppInsights/WebTest.cs +++ b/sdk/dotnet/AppInsights/WebTest.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.AppInsights /// /// Manages an Application Insights WebTest. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleWebTest = new Azure.AppInsights.WebTest("exampleWebTest", new() + /// { + /// Location = exampleInsights.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// Kind = "ping", + /// Frequency = 300, + /// Timeout = 60, + /// Enabled = true, + /// GeoLocations = new[] + /// { + /// "us-tx-sn1-azr", + /// "us-il-ch1-azr", + /// }, + /// Configuration = @"<WebTest Name=""WebTest1"" Id=""ABD48585-0831-40CB-9069-682EA6BB3583"" Enabled=""True"" CssProjectStructure="""" CssIteration="""" Timeout=""0"" WorkItemIds="""" xmlns=""http://microsoft.com/schemas/VisualStudio/TeamTest/2010"" Description="""" CredentialUserName="""" CredentialPassword="""" PreAuthenticate=""True"" Proxy=""default"" StopOnError=""False"" RecordedResultFile="""" ResultsLocale=""""> + /// <Items> + /// <Request Method=""GET"" Guid=""a5f10126-e4cd-570d-961c-cea43999a200"" Version=""1.1"" Url=""http://microsoft.com"" ThinkTime=""0"" Timeout=""300"" ParseDependentRequests=""True"" FollowRedirects=""True"" RecordResult=""True"" Cache=""False"" ResponseTimeGoal=""0"" Encoding=""utf-8"" ExpectedHttpStatusCode=""200"" ExpectedResponseUrl="""" ReportingName="""" IgnoreHttpStatusCode=""False"" /> + /// </Items> + /// </WebTest> + /// ", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["webtestId"] = exampleWebTest.Id, + /// ["webtestsSyntheticId"] = exampleWebTest.SyntheticMonitorId, + /// }; + /// }); + /// ``` + /// /// ## Import /// /// Application Insights Web Tests can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/Workbook.cs b/sdk/dotnet/AppInsights/Workbook.cs index 7fa09b9fc2..d99798bf5e 100644 --- a/sdk/dotnet/AppInsights/Workbook.cs +++ b/sdk/dotnet/AppInsights/Workbook.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.AppInsights /// /// Manages an Azure Workbook. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkbook = new Azure.AppInsights.Workbook("exampleWorkbook", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DisplayName = "workbook1", + /// DataJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["version"] = "Notebook/1.0", + /// ["items"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["type"] = 1, + /// ["content"] = new Dictionary<string, object?> + /// { + /// ["json"] = "Test2022", + /// }, + /// ["name"] = "text - 0", + /// }, + /// }, + /// ["isLocked"] = false, + /// ["fallbackResourceIds"] = new[] + /// { + /// "Azure Monitor", + /// }, + /// }), + /// Tags = + /// { + /// { "ENV", "Test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Workbooks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppInsights/WorkbookTemplate.cs b/sdk/dotnet/AppInsights/WorkbookTemplate.cs index 33636a08c6..374297693c 100644 --- a/sdk/dotnet/AppInsights/WorkbookTemplate.cs +++ b/sdk/dotnet/AppInsights/WorkbookTemplate.cs @@ -12,6 +12,114 @@ namespace Pulumi.Azure.AppInsights /// /// Manages an Application Insights Workbook Template. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkbookTemplate = new Azure.AppInsights.WorkbookTemplate("exampleWorkbookTemplate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// Author = "test author", + /// Priority = 1, + /// Galleries = new[] + /// { + /// new Azure.AppInsights.Inputs.WorkbookTemplateGalleryArgs + /// { + /// Category = "workbook", + /// Name = "test", + /// Order = 100, + /// ResourceType = "microsoft.insights/components", + /// Type = "tsg", + /// }, + /// }, + /// TemplateData = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["version"] = "Notebook/1.0", + /// ["items"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["type"] = 1, + /// ["content"] = new Dictionary<string, object?> + /// { + /// ["json"] = @"## New workbook + /// --- + /// + /// Welcome to your new workbook.", + /// }, + /// ["name"] = "text - 2", + /// }, + /// }, + /// ["styleSettings"] = new Dictionary<string, object?> + /// { + /// }, + /// ["$schema"] = "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + /// }), + /// Localized = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["ar"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["galleries"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["name"] = "test", + /// ["category"] = "Failures", + /// ["type"] = "tsg", + /// ["resourceType"] = "microsoft.insights/components", + /// ["order"] = 100, + /// }, + /// }, + /// ["templateData"] = new Dictionary<string, object?> + /// { + /// ["version"] = "Notebook/1.0", + /// ["items"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["type"] = 1, + /// ["content"] = new Dictionary<string, object?> + /// { + /// ["json"] = @"## New workbook + /// --- + /// + /// Welcome to your new workbook.", + /// }, + /// ["name"] = "text - 2", + /// }, + /// }, + /// ["styleSettings"] = new Dictionary<string, object?> + /// { + /// }, + /// ["$schema"] = "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + /// }, + /// }, + /// }, + /// }), + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Application Insights Workbook Template can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/GetSpringCloudApp.cs b/sdk/dotnet/AppPlatform/GetSpringCloudApp.cs index 1ff6969564..6a36e85410 100644 --- a/sdk/dotnet/AppPlatform/GetSpringCloudApp.cs +++ b/sdk/dotnet/AppPlatform/GetSpringCloudApp.cs @@ -13,12 +13,68 @@ public static class GetSpringCloudApp { /// /// Use this data source to access information about an existing Spring Cloud Application. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppPlatform.GetSpringCloudApp.Invoke(new() + /// { + /// Name = azurerm_spring_cloud_app.Example.Name, + /// ResourceGroupName = azurerm_spring_cloud_app.Example.Resource_group_name, + /// ServiceName = azurerm_spring_cloud_app.Example.Service_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["springCloudAppId"] = example.Apply(getSpringCloudAppResult => getSpringCloudAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSpringCloudAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appplatform/getSpringCloudApp:getSpringCloudApp", args ?? new GetSpringCloudAppArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Spring Cloud Application. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppPlatform.GetSpringCloudApp.Invoke(new() + /// { + /// Name = azurerm_spring_cloud_app.Example.Name, + /// ResourceGroupName = azurerm_spring_cloud_app.Example.Resource_group_name, + /// ServiceName = azurerm_spring_cloud_app.Example.Service_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["springCloudAppId"] = example.Apply(getSpringCloudAppResult => getSpringCloudAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSpringCloudAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appplatform/getSpringCloudApp:getSpringCloudApp", args ?? new GetSpringCloudAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppPlatform/GetSpringCloudService.cs b/sdk/dotnet/AppPlatform/GetSpringCloudService.cs index 9b0a130f90..1442030934 100644 --- a/sdk/dotnet/AppPlatform/GetSpringCloudService.cs +++ b/sdk/dotnet/AppPlatform/GetSpringCloudService.cs @@ -13,12 +13,66 @@ public static class GetSpringCloudService { /// /// Use this data source to access information about an existing Spring Cloud Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppPlatform.GetSpringCloudService.Invoke(new() + /// { + /// Name = azurerm_spring_cloud_service.Example.Name, + /// ResourceGroupName = azurerm_spring_cloud_service.Example.Resource_group_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["springCloudServiceId"] = example.Apply(getSpringCloudServiceResult => getSpringCloudServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSpringCloudServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appplatform/getSpringCloudService:getSpringCloudService", args ?? new GetSpringCloudServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Spring Cloud Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppPlatform.GetSpringCloudService.Invoke(new() + /// { + /// Name = azurerm_spring_cloud_service.Example.Name, + /// ResourceGroupName = azurerm_spring_cloud_service.Example.Resource_group_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["springCloudServiceId"] = example.Apply(getSpringCloudServiceResult => getSpringCloudServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSpringCloudServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appplatform/getSpringCloudService:getSpringCloudService", args ?? new GetSpringCloudServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppPlatform/SpringCloudAccelerator.cs b/sdk/dotnet/AppPlatform/SpringCloudAccelerator.cs index 9786feaeb2..828abec84f 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudAccelerator.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudAccelerator.cs @@ -14,6 +14,36 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Accelerator. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudAccelerator = new Azure.AppPlatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudActiveDeployment.cs b/sdk/dotnet/AppPlatform/SpringCloudActiveDeployment.cs index 8cfafca037..4861c2a5ed 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudActiveDeployment.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudActiveDeployment.cs @@ -12,6 +12,63 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages an Active Azure Spring Cloud Deployment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// Identity = new Azure.AppPlatform.Inputs.SpringCloudAppIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSpringCloudJavaDeployment = new Azure.AppPlatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// InstanceCount = 2, + /// JvmOptions = "-XX:+PrintGC", + /// RuntimeVersion = "Java_11", + /// Quota = new Azure.AppPlatform.Inputs.SpringCloudJavaDeploymentQuotaArgs + /// { + /// Cpu = "2", + /// Memory = "4Gi", + /// }, + /// EnvironmentVariables = + /// { + /// { "Env", "Staging" }, + /// }, + /// }); + /// + /// var exampleSpringCloudActiveDeployment = new Azure.AppPlatform.SpringCloudActiveDeployment("exampleSpringCloudActiveDeployment", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// DeploymentName = exampleSpringCloudJavaDeployment.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Active Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudApiPortal.cs b/sdk/dotnet/AppPlatform/SpringCloudApiPortal.cs index 81bcfe15ef..d3353efe5a 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudApiPortal.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudApiPortal.cs @@ -14,6 +14,58 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudGateway = new Azure.AppPlatform.SpringCloudGateway("exampleSpringCloudGateway", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// }); + /// + /// var exampleSpringCloudApiPortal = new Azure.AppPlatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// GatewayIds = new[] + /// { + /// exampleSpringCloudGateway.Id, + /// }, + /// HttpsOnlyEnabled = false, + /// PublicNetworkAccessEnabled = true, + /// InstanceCount = 1, + /// Sso = new Azure.AppPlatform.Inputs.SpringCloudApiPortalSsoArgs + /// { + /// ClientId = "test", + /// ClientSecret = "secret", + /// IssuerUri = "https://www.example.com/issueToken", + /// Scopes = new[] + /// { + /// "read", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud API Portals can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudApiPortalCustomDomain.cs b/sdk/dotnet/AppPlatform/SpringCloudApiPortalCustomDomain.cs index 5caf4e7485..cdf3bd3ac8 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudApiPortalCustomDomain.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudApiPortalCustomDomain.cs @@ -14,6 +14,50 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudGateway = new Azure.AppPlatform.SpringCloudGateway("exampleSpringCloudGateway", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// }); + /// + /// var exampleSpringCloudApiPortal = new Azure.AppPlatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// GatewayIds = new[] + /// { + /// exampleSpringCloudGateway.Id, + /// }, + /// }); + /// + /// var exampleSpringCloudApiPortalCustomDomain = new Azure.AppPlatform.SpringCloudApiPortalCustomDomain("exampleSpringCloudApiPortalCustomDomain", new() + /// { + /// SpringCloudApiPortalId = exampleSpringCloudApiPortal.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud API Portal Domains can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudApp.cs b/sdk/dotnet/AppPlatform/SpringCloudApp.cs index d2a80aa0b4..f7b19ebcf4 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudApp.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudApp.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.AppPlatform /// /// Manage an Azure Spring Cloud Application. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// Identity = new Azure.AppPlatform.Inputs.SpringCloudAppIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Application can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudAppCosmosDBAssociation.cs b/sdk/dotnet/AppPlatform/SpringCloudAppCosmosDBAssociation.cs index 241fb47152..4e39df21a9 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudAppCosmosDBAssociation.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudAppCosmosDBAssociation.cs @@ -12,6 +12,64 @@ namespace Pulumi.Azure.AppPlatform /// /// Associates a Spring Cloud Application with a CosmosDB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSpringCloudAppCosmosDBAssociation = new Azure.AppPlatform.SpringCloudAppCosmosDBAssociation("exampleSpringCloudAppCosmosDBAssociation", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// CosmosdbAccountId = exampleAccount.Id, + /// ApiType = "table", + /// CosmosdbAccessKey = exampleAccount.PrimaryKey, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Application CosmosDB Association can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudAppMysqlAssociation.cs b/sdk/dotnet/AppPlatform/SpringCloudAppMysqlAssociation.cs index 14e130ac30..c1987c685e 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudAppMysqlAssociation.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudAppMysqlAssociation.cs @@ -12,6 +12,66 @@ namespace Pulumi.Azure.AppPlatform /// /// Associates a Spring Cloud Application with a MySQL Database. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mysqladminun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// Version = "5.7", + /// SslEnforcementEnabled = true, + /// SslMinimalTlsVersionEnforced = "TLS1_2", + /// }); + /// + /// var exampleDatabase = new Azure.MySql.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Charset = "utf8", + /// Collation = "utf8_unicode_ci", + /// }); + /// + /// var exampleSpringCloudAppMysqlAssociation = new Azure.AppPlatform.SpringCloudAppMysqlAssociation("exampleSpringCloudAppMysqlAssociation", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// MysqlServerId = exampleServer.Id, + /// DatabaseName = exampleDatabase.Name, + /// Username = exampleServer.AdministratorLogin, + /// Password = exampleServer.AdministratorLoginPassword, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Application MySQL Association can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudAppRedisAssociation.cs b/sdk/dotnet/AppPlatform/SpringCloudAppRedisAssociation.cs index 1dcc284d1e..5ce338bb55 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudAppRedisAssociation.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudAppRedisAssociation.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.AppPlatform /// /// Associates a Spring Cloud Application with a Redis Cache. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// }); + /// + /// var exampleCache = new Azure.Redis.Cache("exampleCache", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Capacity = 0, + /// Family = "C", + /// SkuName = "Basic", + /// EnableNonSslPort = true, + /// }); + /// + /// var exampleSpringCloudAppRedisAssociation = new Azure.AppPlatform.SpringCloudAppRedisAssociation("exampleSpringCloudAppRedisAssociation", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// RedisCacheId = exampleCache.Id, + /// RedisAccessKey = exampleCache.PrimaryAccessKey, + /// SslEnabled = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Application Redis Association can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudApplicationInsightsApplicationPerformanceMonitoring.cs b/sdk/dotnet/AppPlatform/SpringCloudApplicationInsightsApplicationPerformanceMonitoring.cs index fb64ca8942..4ccab472af 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudApplicationInsightsApplicationPerformanceMonitoring.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudApplicationInsightsApplicationPerformanceMonitoring.cs @@ -14,6 +14,49 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Application Performance Monitoring resource for Application Insights. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudApplicationInsightsApplicationPerformanceMonitoring = new Azure.AppPlatform.SpringCloudApplicationInsightsApplicationPerformanceMonitoring("exampleSpringCloudApplicationInsightsApplicationPerformanceMonitoring", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// ConnectionString = exampleInsights.InstrumentationKey, + /// GloballyEnabled = true, + /// RoleName = "test-role", + /// RoleInstance = "test-instance", + /// SamplingPercentage = 50, + /// SamplingRequestsPerSecond = 10, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Application Performance Monitoring resource for Application Insights can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudApplicationLiveView.cs b/sdk/dotnet/AppPlatform/SpringCloudApplicationLiveView.cs index 595b7e3ded..6b572d15ab 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudApplicationLiveView.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudApplicationLiveView.cs @@ -14,6 +14,36 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Application Live View. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudApplicationLiveView = new Azure.AppPlatform.SpringCloudApplicationLiveView("exampleSpringCloudApplicationLiveView", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Application Live Views can be imported using the `resource id`, e.g. g diff --git a/sdk/dotnet/AppPlatform/SpringCloudBuildDeployment.cs b/sdk/dotnet/AppPlatform/SpringCloudBuildDeployment.cs index 49757f9ac4..b3c2220e11 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudBuildDeployment.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudBuildDeployment.cs @@ -14,6 +14,54 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleSpringCloudService.ResourceGroupName, + /// ServiceName = exampleSpringCloudService.Name, + /// }); + /// + /// var exampleSpringCloudBuildDeployment = new Azure.AppPlatform.SpringCloudBuildDeployment("exampleSpringCloudBuildDeployment", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// BuildResultId = "<default>", + /// InstanceCount = 2, + /// EnvironmentVariables = + /// { + /// { "Foo", "Bar" }, + /// { "Env", "Staging" }, + /// }, + /// Quota = new Azure.AppPlatform.Inputs.SpringCloudBuildDeploymentQuotaArgs + /// { + /// Cpu = "2", + /// Memory = "4Gi", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Build Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudBuildPackBinding.cs b/sdk/dotnet/AppPlatform/SpringCloudBuildPackBinding.cs index 3903975e92..53fd677609 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudBuildPackBinding.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudBuildPackBinding.cs @@ -14,6 +14,71 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudBuilder = new Azure.AppPlatform.SpringCloudBuilder("exampleSpringCloudBuilder", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// BuildPackGroups = new[] + /// { + /// new Azure.AppPlatform.Inputs.SpringCloudBuilderBuildPackGroupArgs + /// { + /// Name = "mix", + /// BuildPackIds = new[] + /// { + /// "tanzu-Build Packs/java-azure", + /// }, + /// }, + /// }, + /// Stack = new Azure.AppPlatform.Inputs.SpringCloudBuilderStackArgs + /// { + /// Id = "io.Build Packs.stacks.bionic", + /// Version = "base", + /// }, + /// }); + /// + /// var exampleSpringCloudBuildPackBinding = new Azure.AppPlatform.SpringCloudBuildPackBinding("exampleSpringCloudBuildPackBinding", new() + /// { + /// SpringCloudBuilderId = exampleSpringCloudBuilder.Id, + /// BindingType = "ApplicationInsights", + /// Launch = new Azure.AppPlatform.Inputs.SpringCloudBuildPackBindingLaunchArgs + /// { + /// Properties = + /// { + /// { "abc", "def" }, + /// { "any-string", "any-string" }, + /// { "sampling-rate", "12.0" }, + /// }, + /// Secrets = + /// { + /// { "connection-string", "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX" }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Build Pack Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudBuilder.cs b/sdk/dotnet/AppPlatform/SpringCloudBuilder.cs index 2898010a74..ad9614c389 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudBuilder.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudBuilder.cs @@ -14,6 +14,52 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudBuilder = new Azure.AppPlatform.SpringCloudBuilder("exampleSpringCloudBuilder", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// BuildPackGroups = new[] + /// { + /// new Azure.AppPlatform.Inputs.SpringCloudBuilderBuildPackGroupArgs + /// { + /// Name = "mix", + /// BuildPackIds = new[] + /// { + /// "tanzu-buildpacks/java-azure", + /// }, + /// }, + /// }, + /// Stack = new Azure.AppPlatform.Inputs.SpringCloudBuilderStackArgs + /// { + /// Id = "io.buildpacks.stacks.bionic", + /// Version = "base", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Builders can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudCertificate.cs b/sdk/dotnet/AppPlatform/SpringCloudCertificate.cs index faf680f585..787afa83e2 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudCertificate.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudCertificate.cs @@ -12,6 +12,139 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages an Azure Spring Cloud Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "Azure Spring Cloud Resource Provider", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// SecretPermissions = new[] + /// { + /// "Set", + /// }, + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "Get", + /// "Update", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// "List", + /// }, + /// CertificatePermissions = new[] + /// { + /// "Get", + /// "List", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// CertificatePolicy = new Azure.KeyVault.Inputs.CertificateCertificatePolicyArgs + /// { + /// IssuerParameters = new Azure.KeyVault.Inputs.CertificateCertificatePolicyIssuerParametersArgs + /// { + /// Name = "Self", + /// }, + /// KeyProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyKeyPropertiesArgs + /// { + /// Exportable = true, + /// KeySize = 2048, + /// KeyType = "RSA", + /// ReuseKey = true, + /// }, + /// LifetimeActions = new[] + /// { + /// new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionArgs + /// { + /// Action = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionActionArgs + /// { + /// ActionType = "AutoRenew", + /// }, + /// Trigger = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionTriggerArgs + /// { + /// DaysBeforeExpiry = 30, + /// }, + /// }, + /// }, + /// SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs + /// { + /// ContentType = "application/x-pkcs12", + /// }, + /// X509CertificateProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesArgs + /// { + /// KeyUsages = new[] + /// { + /// "cRLSign", + /// "dataEncipherment", + /// "digitalSignature", + /// "keyAgreement", + /// "keyCertSign", + /// "keyEncipherment", + /// }, + /// Subject = "CN=contoso.com", + /// ValidityInMonths = 12, + /// }, + /// }, + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudCertificate = new Azure.AppPlatform.SpringCloudCertificate("exampleSpringCloudCertificate", new() + /// { + /// ResourceGroupName = exampleSpringCloudService.ResourceGroupName, + /// ServiceName = exampleSpringCloudService.Name, + /// KeyVaultCertificateId = exampleCertificate.Id, + /// ExcludePrivateKey = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudConfigurationService.cs b/sdk/dotnet/AppPlatform/SpringCloudConfigurationService.cs index e8b31c210c..7b2d1090b8 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudConfigurationService.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudConfigurationService.cs @@ -14,6 +14,57 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudConfigurationService = new Azure.AppPlatform.SpringCloudConfigurationService("exampleSpringCloudConfigurationService", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// Repositories = new[] + /// { + /// new Azure.AppPlatform.Inputs.SpringCloudConfigurationServiceRepositoryArgs + /// { + /// Name = "fake", + /// Label = "master", + /// Patterns = new[] + /// { + /// "app/dev", + /// }, + /// Uri = "https://github.com/Azure-Samples/piggymetrics", + /// SearchPaths = new[] + /// { + /// "dir1", + /// "dir2", + /// }, + /// StrictHostKeyChecking = false, + /// Username = "adminuser", + /// Password = "H@Sh1CoR3!", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Configuration Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudConnection.cs b/sdk/dotnet/AppPlatform/SpringCloudConnection.cs index c8b378c7b0..2c39a4b399 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudConnection.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudConnection.cs @@ -12,6 +12,92 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a service connector for spring cloud app. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "BoundedStaleness", + /// MaxIntervalInSeconds = 10, + /// MaxStalenessPrefix = 200, + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// Throughput = 400, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/definition", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// Identity = new Azure.AppPlatform.Inputs.SpringCloudAppIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSpringCloudJavaDeployment = new Azure.AppPlatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// }); + /// + /// var exampleSpringCloudConnection = new Azure.AppPlatform.SpringCloudConnection("exampleSpringCloudConnection", new() + /// { + /// SpringCloudId = exampleSpringCloudJavaDeployment.Id, + /// TargetResourceId = exampleSqlDatabase.Id, + /// Authentication = new Azure.AppPlatform.Inputs.SpringCloudConnectionAuthenticationArgs + /// { + /// Type = "systemAssignedIdentity", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Connector for spring cloud can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudContainerDeployment.cs b/sdk/dotnet/AppPlatform/SpringCloudContainerDeployment.cs index 454472377a..0cf2185115 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudContainerDeployment.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudContainerDeployment.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Container Deployment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleSpringCloudService.ResourceGroupName, + /// ServiceName = exampleSpringCloudService.Name, + /// }); + /// + /// var exampleSpringCloudContainerDeployment = new Azure.AppPlatform.SpringCloudContainerDeployment("exampleSpringCloudContainerDeployment", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// InstanceCount = 2, + /// Arguments = new[] + /// { + /// "-cp", + /// "/app/resources:/app/classes:/app/libs/*", + /// "hello.Application", + /// }, + /// Commands = new[] + /// { + /// "java", + /// }, + /// EnvironmentVariables = + /// { + /// { "Foo", "Bar" }, + /// { "Env", "Staging" }, + /// }, + /// Server = "docker.io", + /// Image = "springio/gs-spring-boot-docker", + /// LanguageFramework = "springboot", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Container Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudCustomizedAccelerator.cs b/sdk/dotnet/AppPlatform/SpringCloudCustomizedAccelerator.cs index d30a3b1ff4..56818875b4 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudCustomizedAccelerator.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudCustomizedAccelerator.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Customized Accelerator. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudAccelerator = new Azure.AppPlatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// }); + /// + /// var exampleSpringCloudCustomizedAccelerator = new Azure.AppPlatform.SpringCloudCustomizedAccelerator("exampleSpringCloudCustomizedAccelerator", new() + /// { + /// SpringCloudAcceleratorId = exampleSpringCloudAccelerator.Id, + /// GitRepository = new Azure.AppPlatform.Inputs.SpringCloudCustomizedAcceleratorGitRepositoryArgs + /// { + /// Url = "https://github.com/Azure-Samples/piggymetrics", + /// GitTag = "spring.version.2.0.3", + /// IntervalInSeconds = 100, + /// }, + /// AcceleratorTags = new[] + /// { + /// "tag-a", + /// "tag-b", + /// }, + /// Description = "example description", + /// DisplayName = "example name", + /// IconUrl = "https://images.freecreatives.com/wp-content/uploads/2015/05/smiley-559124_640.jpg", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Customized Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudDevToolPortal.cs b/sdk/dotnet/AppPlatform/SpringCloudDevToolPortal.cs index bca6d7f207..79a091248b 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudDevToolPortal.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudDevToolPortal.cs @@ -14,6 +14,53 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Dev Tool Portal. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudDevToolPortal = new Azure.AppPlatform.SpringCloudDevToolPortal("exampleSpringCloudDevToolPortal", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// PublicNetworkAccessEnabled = true, + /// Sso = new Azure.AppPlatform.Inputs.SpringCloudDevToolPortalSsoArgs + /// { + /// ClientId = "example id", + /// ClientSecret = "example secret", + /// MetadataUrl = $"https://login.microsoftonline.com/{current.Apply(getClientConfigResult => getClientConfigResult.TenantId)}/v2.0/.well-known/openid-configuration", + /// Scopes = new[] + /// { + /// "openid", + /// "profile", + /// "email", + /// }, + /// }, + /// ApplicationAcceleratorEnabled = true, + /// ApplicationLiveViewEnabled = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Dev Tool Portals can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudGateway.cs b/sdk/dotnet/AppPlatform/SpringCloudGateway.cs index 88fcf76656..54ad0ef5f2 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudGateway.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudGateway.cs @@ -14,6 +14,83 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Gateway. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudGateway = new Azure.AppPlatform.SpringCloudGateway("exampleSpringCloudGateway", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// HttpsOnly = false, + /// PublicNetworkAccessEnabled = true, + /// InstanceCount = 2, + /// ApiMetadata = new Azure.AppPlatform.Inputs.SpringCloudGatewayApiMetadataArgs + /// { + /// Description = "example description", + /// DocumentationUrl = "https://www.example.com/docs", + /// ServerUrl = "https://wwww.example.com", + /// Title = "example title", + /// Version = "1.0", + /// }, + /// Cors = new Azure.AppPlatform.Inputs.SpringCloudGatewayCorsArgs + /// { + /// CredentialsAllowed = false, + /// AllowedHeaders = new[] + /// { + /// "*", + /// }, + /// AllowedMethods = new[] + /// { + /// "PUT", + /// }, + /// AllowedOrigins = new[] + /// { + /// "example.com", + /// }, + /// ExposedHeaders = new[] + /// { + /// "x-example-header", + /// }, + /// MaxAgeSeconds = 86400, + /// }, + /// Quota = new Azure.AppPlatform.Inputs.SpringCloudGatewayQuotaArgs + /// { + /// Cpu = "1", + /// Memory = "2Gi", + /// }, + /// Sso = new Azure.AppPlatform.Inputs.SpringCloudGatewaySsoArgs + /// { + /// ClientId = "example id", + /// ClientSecret = "example secret", + /// IssuerUri = "https://www.test.com/issueToken", + /// Scopes = new[] + /// { + /// "read", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudGatewayCustomDomain.cs b/sdk/dotnet/AppPlatform/SpringCloudGatewayCustomDomain.cs index cef7fc3d4d..7b74a7eb2d 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudGatewayCustomDomain.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudGatewayCustomDomain.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudGateway = new Azure.AppPlatform.SpringCloudGateway("exampleSpringCloudGateway", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// }); + /// + /// var exampleSpringCloudGatewayCustomDomain = new Azure.AppPlatform.SpringCloudGatewayCustomDomain("exampleSpringCloudGatewayCustomDomain", new() + /// { + /// SpringCloudGatewayId = exampleSpringCloudGateway.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Gateway Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudGatewayRouteConfig.cs b/sdk/dotnet/AppPlatform/SpringCloudGatewayRouteConfig.cs index 7281ca8b58..03a9720ca4 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudGatewayRouteConfig.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudGatewayRouteConfig.cs @@ -14,6 +14,75 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "E0", + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// }); + /// + /// var exampleSpringCloudGateway = new Azure.AppPlatform.SpringCloudGateway("exampleSpringCloudGateway", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// }); + /// + /// var exampleSpringCloudGatewayRouteConfig = new Azure.AppPlatform.SpringCloudGatewayRouteConfig("exampleSpringCloudGatewayRouteConfig", new() + /// { + /// SpringCloudGatewayId = exampleSpringCloudGateway.Id, + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// Protocol = "HTTPS", + /// Routes = new[] + /// { + /// new Azure.AppPlatform.Inputs.SpringCloudGatewayRouteConfigRouteArgs + /// { + /// Description = "example description", + /// Filters = new[] + /// { + /// "StripPrefix=2", + /// "RateLimit=1,1s", + /// }, + /// Order = 1, + /// Predicates = new[] + /// { + /// "Path=/api5/customer/**", + /// }, + /// SsoValidationEnabled = true, + /// Title = "myApp route config", + /// TokenRelay = true, + /// Uri = "https://www.example.com", + /// ClassificationTags = new[] + /// { + /// "tag1", + /// "tag2", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Gateway Route Configs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudJavaDeployment.cs b/sdk/dotnet/AppPlatform/SpringCloudJavaDeployment.cs index 61b249231e..67db2d55a5 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudJavaDeployment.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudJavaDeployment.cs @@ -14,6 +14,58 @@ namespace Pulumi.Azure.AppPlatform /// /// > **NOTE:** This resource is applicable only for Spring Cloud Service with basic and standard tier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("exampleSpringCloudApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceName = exampleSpringCloudService.Name, + /// Identity = new Azure.AppPlatform.Inputs.SpringCloudAppIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSpringCloudJavaDeployment = new Azure.AppPlatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", new() + /// { + /// SpringCloudAppId = exampleSpringCloudApp.Id, + /// InstanceCount = 2, + /// JvmOptions = "-XX:+PrintGC", + /// Quota = new Azure.AppPlatform.Inputs.SpringCloudJavaDeploymentQuotaArgs + /// { + /// Cpu = "2", + /// Memory = "4Gi", + /// }, + /// RuntimeVersion = "Java_11", + /// EnvironmentVariables = + /// { + /// { "Foo", "Bar" }, + /// { "Env", "Staging" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudService.cs b/sdk/dotnet/AppPlatform/SpringCloudService.cs index f30506fd32..bdd76c921e 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudService.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudService.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages an Azure Spring Cloud Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "S0", + /// ConfigServerGitSetting = new Azure.AppPlatform.Inputs.SpringCloudServiceConfigServerGitSettingArgs + /// { + /// Uri = "https://github.com/Azure-Samples/piggymetrics", + /// Label = "config", + /// SearchPaths = new[] + /// { + /// "dir1", + /// "dir2", + /// }, + /// }, + /// Trace = new Azure.AppPlatform.Inputs.SpringCloudServiceTraceArgs + /// { + /// ConnectionString = exampleInsights.ConnectionString, + /// SampleRate = 10, + /// }, + /// Tags = + /// { + /// { "Env", "staging" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppPlatform/SpringCloudStorage.cs b/sdk/dotnet/AppPlatform/SpringCloudStorage.cs index 017096bac5..0e56241247 100644 --- a/sdk/dotnet/AppPlatform/SpringCloudStorage.cs +++ b/sdk/dotnet/AppPlatform/SpringCloudStorage.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.AppPlatform /// /// Manages a Spring Cloud Storage. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("exampleSpringCloudService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSpringCloudStorage = new Azure.AppPlatform.SpringCloudStorage("exampleSpringCloudStorage", new() + /// { + /// SpringCloudServiceId = exampleSpringCloudService.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spring Cloud Storages can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/ActiveSlot.cs b/sdk/dotnet/AppService/ActiveSlot.cs index 5535af68ef..8ec276fb5b 100644 --- a/sdk/dotnet/AppService/ActiveSlot.cs +++ b/sdk/dotnet/AppService/ActiveSlot.cs @@ -15,6 +15,42 @@ namespace Pulumi.Azure.AppService /// !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.WebAppActiveSlot` resource instead. /// /// > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var server = new Random.RandomId("server"); + /// + /// // ... + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup"); + /// + /// // ... + /// var examplePlan = new Azure.AppService.Plan("examplePlan"); + /// + /// // ... + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService"); + /// + /// // ... + /// var exampleSlot = new Azure.AppService.Slot("exampleSlot"); + /// + /// // ... + /// var exampleActiveSlot = new Azure.AppService.ActiveSlot("exampleActiveSlot", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServiceName = exampleAppService.Name, + /// AppServiceSlotName = exampleSlot.Name, + /// }); + /// + /// }); + /// ``` /// [AzureResourceType("azure:appservice/activeSlot:ActiveSlot")] public partial class ActiveSlot : global::Pulumi.CustomResource diff --git a/sdk/dotnet/AppService/AppConnection.cs b/sdk/dotnet/AppService/AppConnection.cs index 99e7554382..8c3704e3ba 100644 --- a/sdk/dotnet/AppService/AppConnection.cs +++ b/sdk/dotnet/AppService/AppConnection.cs @@ -12,6 +12,96 @@ namespace Pulumi.Azure.AppService /// /// Manages a service connector for function app. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "BoundedStaleness", + /// MaxIntervalInSeconds = 10, + /// MaxStalenessPrefix = 200, + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// Throughput = 400, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/definition", + /// }); + /// + /// var exampleStorage_accountAccount = new Azure.Storage.Account("exampleStorage/accountAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "P1v2", + /// OsType = "Linux", + /// }); + /// + /// var test = new Azure.AppService.FunctionApp("test", new() + /// { + /// Location = azurerm_resource_group.Test.Location, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// AppServicePlanId = azurerm_app_service_plan.Test.Id, + /// StorageAccountName = azurerm_storage_account.Test.Name, + /// StorageAccountAccessKey = azurerm_storage_account.Test.Primary_access_key, + /// }); + /// + /// var exampleAppConnection = new Azure.AppService.AppConnection("exampleAppConnection", new() + /// { + /// FunctionAppId = azurerm_function_app.Example.Id, + /// TargetResourceId = azurerm_cosmosdb_account.Test.Id, + /// Authentication = new Azure.AppService.Inputs.AppConnectionAuthenticationArgs + /// { + /// Type = "systemAssignedIdentity", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/AppService.cs b/sdk/dotnet/AppService/AppService.cs index 74f0dc9c8f..de26e7871c 100644 --- a/sdk/dotnet/AppService/AppService.cs +++ b/sdk/dotnet/AppService/AppService.cs @@ -16,6 +16,62 @@ namespace Pulumi.Azure.AppService /// /// > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource. /// + /// ## Example Usage + /// + /// This example provisions a Windows App Service. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// SiteConfig = new Azure.AppService.Inputs.AppServiceSiteConfigArgs + /// { + /// DotnetFrameworkVersion = "v4.0", + /// ScmType = "LocalGit", + /// }, + /// AppSettings = + /// { + /// { "SOME_KEY", "some-value" }, + /// }, + /// ConnectionStrings = new[] + /// { + /// new Azure.AppService.Inputs.AppServiceConnectionStringArgs + /// { + /// Name = "Database", + /// Type = "SQLServer", + /// Value = "Server=some-server.mydomain.com;Integrated Security=SSPI", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/Certificate.cs b/sdk/dotnet/AppService/Certificate.cs index da85b68c08..424b04e966 100644 --- a/sdk/dotnet/AppService/Certificate.cs +++ b/sdk/dotnet/AppService/Certificate.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service certificate. /// + /// ## Example Usage + /// + /// This example provisions an App Service Certificate from a Local File. + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCertificate = new Azure.AppService.Certificate("exampleCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PfxBlob = ReadFileBase64("certificate.pfx"), + /// Password = "password123!", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/CertificateOrder.cs b/sdk/dotnet/AppService/CertificateOrder.cs index aa73508fb6..a753aeb61b 100644 --- a/sdk/dotnet/AppService/CertificateOrder.cs +++ b/sdk/dotnet/AppService/CertificateOrder.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service Certificate Order. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCertificateOrder = new Azure.AppService.CertificateOrder("exampleCertificateOrder", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "global", + /// DistinguishedName = "CN=example.com", + /// ProductType = "Standard", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Certificate Orders can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/Connection.cs b/sdk/dotnet/AppService/Connection.cs index e631bd974b..8c1863a9c7 100644 --- a/sdk/dotnet/AppService/Connection.cs +++ b/sdk/dotnet/AppService/Connection.cs @@ -12,6 +12,87 @@ namespace Pulumi.Azure.AppService /// /// Manages a service connector for app service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "BoundedStaleness", + /// MaxIntervalInSeconds = 10, + /// MaxStalenessPrefix = 200, + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// Throughput = 400, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/definition", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "P1v2", + /// OsType = "Linux", + /// }); + /// + /// var exampleLinuxWebApp = new Azure.AppService.LinuxWebApp("exampleLinuxWebApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleConnection = new Azure.AppService.Connection("exampleConnection", new() + /// { + /// AppServiceId = exampleLinuxWebApp.Id, + /// TargetResourceId = exampleSqlDatabase.Id, + /// Authentication = new Azure.AppService.Inputs.ConnectionAuthenticationArgs + /// { + /// Type = "systemAssignedIdentity", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/CustomHostnameBinding.cs b/sdk/dotnet/AppService/CustomHostnameBinding.cs index c409dc0d80..584e7e5b2c 100644 --- a/sdk/dotnet/AppService/CustomHostnameBinding.cs +++ b/sdk/dotnet/AppService/CustomHostnameBinding.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.AppService /// /// Manages a Hostname Binding within an App Service (or Function App). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var server = new Random.RandomId("server", new() + /// { + /// Keepers = + /// { + /// { "azi_id", 1 }, + /// }, + /// ByteLength = 8, + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var exampleCustomHostnameBinding = new Azure.AppService.CustomHostnameBinding("exampleCustomHostnameBinding", new() + /// { + /// Hostname = "www.mywebsite.com", + /// AppServiceName = exampleAppService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/Environment.cs b/sdk/dotnet/AppService/Environment.cs index e82e072e55..8bad12cfb6 100644 --- a/sdk/dotnet/AppService/Environment.cs +++ b/sdk/dotnet/AppService/Environment.cs @@ -12,6 +12,76 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service Environment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var ase = new Azure.Network.Subnet("ase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var gateway = new Azure.Network.Subnet("gateway", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleEnvironment = new Azure.AppService.Environment("exampleEnvironment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SubnetId = ase.Id, + /// PricingTier = "I2", + /// FrontEndScaleFactor = 10, + /// InternalLoadBalancingMode = "Web, Publishing", + /// AllowedUserIpCidrs = new[] + /// { + /// "11.22.33.44/32", + /// "55.66.77.0/24", + /// }, + /// ClusterSettings = new[] + /// { + /// new Azure.AppService.Inputs.EnvironmentClusterSettingArgs + /// { + /// Name = "DisableTls1.0", + /// Value = "1", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The App Service Environment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/FunctionApp.cs b/sdk/dotnet/AppService/FunctionApp.cs index 074ff40c9b..1f1b63efae 100644 --- a/sdk/dotnet/AppService/FunctionApp.cs +++ b/sdk/dotnet/AppService/FunctionApp.cs @@ -18,6 +18,148 @@ namespace Pulumi.Azure.AppService /// For an example, check the `azure.appservice.VirtualNetworkSwiftConnection` documentation. /// /// ## Example Usage + /// ### With App Service Plan) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleFunctionApp = new Azure.AppService.FunctionApp("exampleFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` + /// ### In A Consumption Plan) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "FunctionApp", + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Dynamic", + /// Size = "Y1", + /// }, + /// }); + /// + /// var exampleFunctionApp = new Azure.AppService.FunctionApp("exampleFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` + /// ### Linux) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "Linux", + /// Reserved = true, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Dynamic", + /// Size = "Y1", + /// }, + /// }); + /// + /// var exampleFunctionApp = new Azure.AppService.FunctionApp("exampleFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// OsType = "linux", + /// Version = "~3", + /// }); + /// + /// }); + /// ``` + /// + /// > **Note:** Version `~3` or `~4` is required for Linux Function Apps. /// /// ## Import /// diff --git a/sdk/dotnet/AppService/FunctionAppActiveSlot.cs b/sdk/dotnet/AppService/FunctionAppActiveSlot.cs index 7787e111a7..1dd4490159 100644 --- a/sdk/dotnet/AppService/FunctionAppActiveSlot.cs +++ b/sdk/dotnet/AppService/FunctionAppActiveSlot.cs @@ -13,6 +13,114 @@ namespace Pulumi.Azure.AppService /// Manages a Function App Active Slot. /// /// ## Example Usage + /// ### Windows Function App + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Windows", + /// SkuName = "Y1", + /// }); + /// + /// var exampleWindowsFunctionApp = new Azure.AppService.WindowsFunctionApp("exampleWindowsFunctionApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageAccountName = exampleAccount.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleWindowsFunctionAppSlot = new Azure.AppService.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", new() + /// { + /// FunctionAppId = exampleWindowsFunctionApp.Id, + /// StorageAccountName = exampleAccount.Name, + /// SiteConfig = null, + /// }); + /// + /// var exampleFunctionAppActiveSlot = new Azure.AppService.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", new() + /// { + /// SlotId = exampleWindowsFunctionAppSlot.Id, + /// }); + /// + /// }); + /// ``` + /// ### Linux Function App + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "Y1", + /// }); + /// + /// var exampleLinuxFunctionApp = new Azure.AppService.LinuxFunctionApp("exampleLinuxFunctionApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// SiteConfig = null, + /// }); + /// + /// var exampleLinuxFunctionAppSlot = new Azure.AppService.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", new() + /// { + /// FunctionAppId = exampleLinuxFunctionApp.Name, + /// StorageAccountName = exampleAccount.Name, + /// SiteConfig = null, + /// }); + /// + /// var exampleFunctionAppActiveSlot = new Azure.AppService.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", new() + /// { + /// SlotId = exampleLinuxFunctionAppSlot.Id, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/FunctionAppFunction.cs b/sdk/dotnet/AppService/FunctionAppFunction.cs index e4fa878b2d..ec35ca1b04 100644 --- a/sdk/dotnet/AppService/FunctionAppFunction.cs +++ b/sdk/dotnet/AppService/FunctionAppFunction.cs @@ -13,6 +13,183 @@ namespace Pulumi.Azure.AppService /// Manages a Function App Function. /// /// ## Example Usage + /// ### Basic HTTP Trigger + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OsType = "Linux", + /// SkuName = "S1", + /// }); + /// + /// var exampleLinuxFunctionApp = new Azure.AppService.LinuxFunctionApp("exampleLinuxFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// SiteConfig = new Azure.AppService.Inputs.LinuxFunctionAppSiteConfigArgs + /// { + /// ApplicationStack = new Azure.AppService.Inputs.LinuxFunctionAppSiteConfigApplicationStackArgs + /// { + /// PythonVersion = "3.9", + /// }, + /// }, + /// }); + /// + /// var exampleFunctionAppFunction = new Azure.AppService.FunctionAppFunction("exampleFunctionAppFunction", new() + /// { + /// FunctionAppId = exampleLinuxFunctionApp.Id, + /// Language = "Python", + /// TestData = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["name"] = "Azure", + /// }), + /// ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["bindings"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["authLevel"] = "function", + /// ["direction"] = "in", + /// ["methods"] = new[] + /// { + /// "get", + /// "post", + /// }, + /// ["name"] = "req", + /// ["type"] = "httpTrigger", + /// }, + /// new Dictionary<string, object?> + /// { + /// ["direction"] = "out", + /// ["name"] = "$return", + /// ["type"] = "http", + /// }, + /// }, + /// }), + /// }); + /// + /// }); + /// ``` + /// ### HTTP Trigger With Code Upload + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OsType = "Windows", + /// SkuName = "S1", + /// }); + /// + /// var exampleWindowsFunctionApp = new Azure.AppService.WindowsFunctionApp("exampleWindowsFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// SiteConfig = new Azure.AppService.Inputs.WindowsFunctionAppSiteConfigArgs + /// { + /// ApplicationStack = new Azure.AppService.Inputs.WindowsFunctionAppSiteConfigApplicationStackArgs + /// { + /// DotnetVersion = "6", + /// }, + /// }, + /// }); + /// + /// var exampleFunctionAppFunction = new Azure.AppService.FunctionAppFunction("exampleFunctionAppFunction", new() + /// { + /// FunctionAppId = exampleWindowsFunctionApp.Id, + /// Language = "CSharp", + /// Files = new[] + /// { + /// new Azure.AppService.Inputs.FunctionAppFunctionFileArgs + /// { + /// Name = "run.csx", + /// Content = File.ReadAllText("exampledata/run.csx"), + /// }, + /// }, + /// TestData = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["name"] = "Azure", + /// }), + /// ConfigJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["bindings"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["authLevel"] = "function", + /// ["direction"] = "in", + /// ["methods"] = new[] + /// { + /// "get", + /// "post", + /// }, + /// ["name"] = "req", + /// ["type"] = "httpTrigger", + /// }, + /// new Dictionary<string, object?> + /// { + /// ["direction"] = "out", + /// ["name"] = "$return", + /// ["type"] = "http", + /// }, + /// }, + /// }), + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/FunctionAppHybridConnection.cs b/sdk/dotnet/AppService/FunctionAppHybridConnection.cs index 10603a29d3..393e4f370c 100644 --- a/sdk/dotnet/AppService/FunctionAppHybridConnection.cs +++ b/sdk/dotnet/AppService/FunctionAppHybridConnection.cs @@ -12,6 +12,79 @@ namespace Pulumi.Azure.AppService /// /// Manages a Function App Hybrid Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OsType = "Windows", + /// SkuName = "S1", + /// }); + /// + /// var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleHybridConnection = new Azure.Relay.HybridConnection("exampleHybridConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RelayNamespaceName = exampleNamespace.Name, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleWindowsWebApp = new Azure.AppService.WindowsWebApp("exampleWindowsWebApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleWindowsFunctionApp = new Azure.AppService.WindowsFunctionApp("exampleWindowsFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// SiteConfig = null, + /// }); + /// + /// var exampleFunctionAppHybridConnection = new Azure.AppService.FunctionAppHybridConnection("exampleFunctionAppHybridConnection", new() + /// { + /// FunctionAppId = exampleWindowsWebApp.Id, + /// RelayId = exampleHybridConnection.Id, + /// Hostname = "myhostname.example", + /// Port = 8081, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// a Function App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/FunctionAppSlot.cs b/sdk/dotnet/AppService/FunctionAppSlot.cs index adb6205c83..fa67275d13 100644 --- a/sdk/dotnet/AppService/FunctionAppSlot.cs +++ b/sdk/dotnet/AppService/FunctionAppSlot.cs @@ -15,6 +15,61 @@ namespace Pulumi.Azure.AppService /// !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.LinuxFunctionAppSlot` resources instead. /// /// ## Example Usage + /// ### With App Service Plan) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleFunctionApp = new Azure.AppService.FunctionApp("exampleFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// var exampleFunctionAppSlot = new Azure.AppService.FunctionAppSlot("exampleFunctionAppSlot", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// FunctionAppName = exampleFunctionApp.Name, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/GetAppService.cs b/sdk/dotnet/AppService/GetAppService.cs index ca90ac1e4f..dc318a794a 100644 --- a/sdk/dotnet/AppService/GetAppService.cs +++ b/sdk/dotnet/AppService/GetAppService.cs @@ -15,6 +15,33 @@ public static class GetAppService /// Use this data source to access information about an existing App Service. /// /// !> **Note:** The `azure.appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxWebApp` data sources instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetAppService.Invoke(new() + /// { + /// Name = "search-app-service", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["appServiceId"] = example.Apply(getAppServiceResult => getAppServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAppServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getAppService:getAppService", args ?? new GetAppServiceArgs(), options.WithDefaults()); @@ -23,6 +50,33 @@ public static Task InvokeAsync(GetAppServiceArgs args, Invo /// Use this data source to access information about an existing App Service. /// /// !> **Note:** The `azure.appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxWebApp` data sources instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetAppService.Invoke(new() + /// { + /// Name = "search-app-service", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["appServiceId"] = example.Apply(getAppServiceResult => getAppServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAppServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getAppService:getAppService", args ?? new GetAppServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetAppServiceEnvironment.cs b/sdk/dotnet/AppService/GetAppServiceEnvironment.cs index 7c0bf743e6..f0ebd44918 100644 --- a/sdk/dotnet/AppService/GetAppServiceEnvironment.cs +++ b/sdk/dotnet/AppService/GetAppServiceEnvironment.cs @@ -13,12 +13,66 @@ public static class GetAppServiceEnvironment { /// /// Use this data source to access information about an existing App Service Environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetAppServiceEnvironment.Invoke(new() + /// { + /// Name = "existing-ase", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getAppServiceEnvironmentResult => getAppServiceEnvironmentResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAppServiceEnvironmentArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getAppServiceEnvironment:getAppServiceEnvironment", args ?? new GetAppServiceEnvironmentArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing App Service Environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetAppServiceEnvironment.Invoke(new() + /// { + /// Name = "existing-ase", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getAppServiceEnvironmentResult => getAppServiceEnvironmentResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAppServiceEnvironmentInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getAppServiceEnvironment:getAppServiceEnvironment", args ?? new GetAppServiceEnvironmentInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetAppServicePlan.cs b/sdk/dotnet/AppService/GetAppServicePlan.cs index 28e5358da3..f7b5f1833a 100644 --- a/sdk/dotnet/AppService/GetAppServicePlan.cs +++ b/sdk/dotnet/AppService/GetAppServicePlan.cs @@ -15,6 +15,33 @@ public static class GetAppServicePlan /// Use this data source to access information about an existing App Service Plan (formerly known as a `Server Farm`). /// /// !> **Note:** The `azure.appservice.Plan` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.ServicePlan` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetAppServicePlan.Invoke(new() + /// { + /// Name = "search-app-service-plan", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["appServicePlanId"] = example.Apply(getAppServicePlanResult => getAppServicePlanResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAppServicePlanArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getAppServicePlan:getAppServicePlan", args ?? new GetAppServicePlanArgs(), options.WithDefaults()); @@ -23,6 +50,33 @@ public static Task InvokeAsync(GetAppServicePlanArgs ar /// Use this data source to access information about an existing App Service Plan (formerly known as a `Server Farm`). /// /// !> **Note:** The `azure.appservice.Plan` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.ServicePlan` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetAppServicePlan.Invoke(new() + /// { + /// Name = "search-app-service-plan", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["appServicePlanId"] = example.Apply(getAppServicePlanResult => getAppServicePlanResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAppServicePlanInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getAppServicePlan:getAppServicePlan", args ?? new GetAppServicePlanInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetCertificate.cs b/sdk/dotnet/AppService/GetCertificate.cs index 30bf5de45b..6e81daf494 100644 --- a/sdk/dotnet/AppService/GetCertificate.cs +++ b/sdk/dotnet/AppService/GetCertificate.cs @@ -13,12 +13,66 @@ public static class GetCertificate { /// /// Use this data source to access information about an App Service Certificate. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetCertificate.Invoke(new() + /// { + /// Name = "example-app-service-certificate", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["appServiceCertificateId"] = example.Apply(getCertificateResult => getCertificateResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCertificateArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getCertificate:getCertificate", args ?? new GetCertificateArgs(), options.WithDefaults()); /// /// Use this data source to access information about an App Service Certificate. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetCertificate.Invoke(new() + /// { + /// Name = "example-app-service-certificate", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["appServiceCertificateId"] = example.Apply(getCertificateResult => getCertificateResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCertificateInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getCertificate:getCertificate", args ?? new GetCertificateInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetCertificateOrder.cs b/sdk/dotnet/AppService/GetCertificateOrder.cs index dcd9de2be9..4ee19b1d55 100644 --- a/sdk/dotnet/AppService/GetCertificateOrder.cs +++ b/sdk/dotnet/AppService/GetCertificateOrder.cs @@ -13,12 +13,66 @@ public static class GetCertificateOrder { /// /// Use this data source to access information about an existing App Service Certificate Order. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetCertificateOrder.Invoke(new() + /// { + /// Name = "example-cert-order", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["certificateOrderId"] = example.Apply(getCertificateOrderResult => getCertificateOrderResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCertificateOrderArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getCertificateOrder:getCertificateOrder", args ?? new GetCertificateOrderArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing App Service Certificate Order. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetCertificateOrder.Invoke(new() + /// { + /// Name = "example-cert-order", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["certificateOrderId"] = example.Apply(getCertificateOrderResult => getCertificateOrderResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCertificateOrderInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getCertificateOrder:getCertificateOrder", args ?? new GetCertificateOrderInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetEnvironmentV3.cs b/sdk/dotnet/AppService/GetEnvironmentV3.cs index 3caeeaf663..8523c73f0b 100644 --- a/sdk/dotnet/AppService/GetEnvironmentV3.cs +++ b/sdk/dotnet/AppService/GetEnvironmentV3.cs @@ -13,12 +13,66 @@ public static class GetEnvironmentV3 { /// /// Use this data source to access information about an existing 3rd Generation (v3) App Service Environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetEnvironmentV3.Invoke(new() + /// { + /// Name = "example-ASE", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getEnvironmentV3Result => getEnvironmentV3Result.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEnvironmentV3Args args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getEnvironmentV3:getEnvironmentV3", args ?? new GetEnvironmentV3Args(), options.WithDefaults()); /// /// Use this data source to access information about an existing 3rd Generation (v3) App Service Environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetEnvironmentV3.Invoke(new() + /// { + /// Name = "example-ASE", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getEnvironmentV3Result => getEnvironmentV3Result.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEnvironmentV3InvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getEnvironmentV3:getEnvironmentV3", args ?? new GetEnvironmentV3InvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetFunctionApp.cs b/sdk/dotnet/AppService/GetFunctionApp.cs index 0d9905ece8..5394856225 100644 --- a/sdk/dotnet/AppService/GetFunctionApp.cs +++ b/sdk/dotnet/AppService/GetFunctionApp.cs @@ -15,6 +15,29 @@ public static class GetFunctionApp /// Use this data source to access information about a Function App. /// /// !> **Note:** The `azure.appservice.FunctionApp` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxFunctionApp` data sources instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetFunctionApp.Invoke(new() + /// { + /// Name = "test-azure-functions", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFunctionAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getFunctionApp:getFunctionApp", args ?? new GetFunctionAppArgs(), options.WithDefaults()); @@ -23,6 +46,29 @@ public static Task InvokeAsync(GetFunctionAppArgs args, In /// Use this data source to access information about a Function App. /// /// !> **Note:** The `azure.appservice.FunctionApp` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxFunctionApp` data sources instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetFunctionApp.Invoke(new() + /// { + /// Name = "test-azure-functions", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFunctionAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getFunctionApp:getFunctionApp", args ?? new GetFunctionAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetFunctionAppHostKeys.cs b/sdk/dotnet/AppService/GetFunctionAppHostKeys.cs index aced2ed109..98e414f596 100644 --- a/sdk/dotnet/AppService/GetFunctionAppHostKeys.cs +++ b/sdk/dotnet/AppService/GetFunctionAppHostKeys.cs @@ -13,12 +13,58 @@ public static class GetFunctionAppHostKeys { /// /// Use this data source to fetch the Host Keys of an existing Function App + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetFunctionAppHostKeys.Invoke(new() + /// { + /// Name = "example-function", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFunctionAppHostKeysArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getFunctionAppHostKeys:getFunctionAppHostKeys", args ?? new GetFunctionAppHostKeysArgs(), options.WithDefaults()); /// /// Use this data source to fetch the Host Keys of an existing Function App + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetFunctionAppHostKeys.Invoke(new() + /// { + /// Name = "example-function", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFunctionAppHostKeysInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getFunctionAppHostKeys:getFunctionAppHostKeys", args ?? new GetFunctionAppHostKeysInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetLinuxFunctionApp.cs b/sdk/dotnet/AppService/GetLinuxFunctionApp.cs index 9bda84badf..42da5e8e39 100644 --- a/sdk/dotnet/AppService/GetLinuxFunctionApp.cs +++ b/sdk/dotnet/AppService/GetLinuxFunctionApp.cs @@ -13,12 +13,66 @@ public static class GetLinuxFunctionApp { /// /// Use this data source to access information about an existing Linux Function App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetLinuxFunctionApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLinuxFunctionAppResult => getLinuxFunctionAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetLinuxFunctionAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getLinuxFunctionApp:getLinuxFunctionApp", args ?? new GetLinuxFunctionAppArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Linux Function App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetLinuxFunctionApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLinuxFunctionAppResult => getLinuxFunctionAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetLinuxFunctionAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getLinuxFunctionApp:getLinuxFunctionApp", args ?? new GetLinuxFunctionAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetLinuxWebApp.cs b/sdk/dotnet/AppService/GetLinuxWebApp.cs index 79c26cbe01..2851fa79ca 100644 --- a/sdk/dotnet/AppService/GetLinuxWebApp.cs +++ b/sdk/dotnet/AppService/GetLinuxWebApp.cs @@ -13,12 +13,66 @@ public static class GetLinuxWebApp { /// /// Use this data source to access information about an existing Linux Web App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetLinuxWebApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLinuxWebAppResult => getLinuxWebAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetLinuxWebAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getLinuxWebApp:getLinuxWebApp", args ?? new GetLinuxWebAppArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Linux Web App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetLinuxWebApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLinuxWebAppResult => getLinuxWebAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetLinuxWebAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getLinuxWebApp:getLinuxWebApp", args ?? new GetLinuxWebAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetServicePlan.cs b/sdk/dotnet/AppService/GetServicePlan.cs index f676f37e56..7b3ffc80a5 100644 --- a/sdk/dotnet/AppService/GetServicePlan.cs +++ b/sdk/dotnet/AppService/GetServicePlan.cs @@ -13,12 +13,66 @@ public static class GetServicePlan { /// /// Use this data source to access information about an existing Service Plan. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetServicePlan.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServicePlanResult => getServicePlanResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServicePlanArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getServicePlan:getServicePlan", args ?? new GetServicePlanArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Service Plan. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetServicePlan.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServicePlanResult => getServicePlanResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServicePlanInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getServicePlan:getServicePlan", args ?? new GetServicePlanInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetSourceControlToken.cs b/sdk/dotnet/AppService/GetSourceControlToken.cs index eab124d5a8..445156589c 100644 --- a/sdk/dotnet/AppService/GetSourceControlToken.cs +++ b/sdk/dotnet/AppService/GetSourceControlToken.cs @@ -11,9 +11,63 @@ namespace Pulumi.Azure.AppService { public static class GetSourceControlToken { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetSourceControlToken.Invoke(new() + /// { + /// Type = "GitHub", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_app_service_github_token.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetSourceControlTokenArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getSourceControlToken:getSourceControlToken", args ?? new GetSourceControlTokenArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetSourceControlToken.Invoke(new() + /// { + /// Type = "GitHub", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_app_service_github_token.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetSourceControlTokenInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getSourceControlToken:getSourceControlToken", args ?? new GetSourceControlTokenInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/AppService/GetWindowsFunctionApp.cs b/sdk/dotnet/AppService/GetWindowsFunctionApp.cs index e14ccf635e..e6601aa8b0 100644 --- a/sdk/dotnet/AppService/GetWindowsFunctionApp.cs +++ b/sdk/dotnet/AppService/GetWindowsFunctionApp.cs @@ -13,12 +13,66 @@ public static class GetWindowsFunctionApp { /// /// Use this data source to access information about an existing Windows Function App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetWindowsFunctionApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getWindowsFunctionAppResult => getWindowsFunctionAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWindowsFunctionAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getWindowsFunctionApp:getWindowsFunctionApp", args ?? new GetWindowsFunctionAppArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Windows Function App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetWindowsFunctionApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getWindowsFunctionAppResult => getWindowsFunctionAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWindowsFunctionAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getWindowsFunctionApp:getWindowsFunctionApp", args ?? new GetWindowsFunctionAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/GetWindowsWebApp.cs b/sdk/dotnet/AppService/GetWindowsWebApp.cs index 8586014067..8fdb44a631 100644 --- a/sdk/dotnet/AppService/GetWindowsWebApp.cs +++ b/sdk/dotnet/AppService/GetWindowsWebApp.cs @@ -13,12 +13,66 @@ public static class GetWindowsWebApp { /// /// Use this data source to access information about an existing Windows Web App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetWindowsWebApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getWindowsWebAppResult => getWindowsWebAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWindowsWebAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:appservice/getWindowsWebApp:getWindowsWebApp", args ?? new GetWindowsWebAppArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Windows Web App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.AppService.GetWindowsWebApp.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getWindowsWebAppResult => getWindowsWebAppResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWindowsWebAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:appservice/getWindowsWebApp:getWindowsWebApp", args ?? new GetWindowsWebAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/AppService/HybridConnection.cs b/sdk/dotnet/AppService/HybridConnection.cs index 61e72c4982..d68b7ca20f 100644 --- a/sdk/dotnet/AppService/HybridConnection.cs +++ b/sdk/dotnet/AppService/HybridConnection.cs @@ -14,6 +14,68 @@ namespace Pulumi.Azure.AppService /// /// !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.FunctionAppHybridConnection` resources instead. /// + /// ## Example Usage + /// + /// This example provisions an App Service, a Relay Hybrid Connection, and a Service Bus using their outputs to create the App Service Hybrid Connection. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleHybridConnection = new Azure.Relay.HybridConnection("exampleHybridConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RelayNamespaceName = exampleNamespace.Name, + /// UserMetadata = "examplemetadata", + /// }); + /// + /// var exampleAppservice_hybridConnectionHybridConnection = new Azure.AppService.HybridConnection("exampleAppservice/hybridConnectionHybridConnection", new() + /// { + /// AppServiceName = exampleAppService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// RelayId = exampleHybridConnection.Id, + /// Hostname = "testhostname.example", + /// Port = 8080, + /// SendKeyName = "exampleSharedAccessKey", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Hybrid Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/LinuxFunctionApp.cs b/sdk/dotnet/AppService/LinuxFunctionApp.cs index 8f1261705b..b4c220dd7c 100644 --- a/sdk/dotnet/AppService/LinuxFunctionApp.cs +++ b/sdk/dotnet/AppService/LinuxFunctionApp.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.AppService /// /// Manages a Linux Function App. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "Y1", + /// }); + /// + /// var exampleLinuxFunctionApp = new Azure.AppService.LinuxFunctionApp("exampleLinuxFunctionApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Linux Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/LinuxFunctionAppSlot.cs b/sdk/dotnet/AppService/LinuxFunctionAppSlot.cs index d5ce1c31e7..9176f7189d 100644 --- a/sdk/dotnet/AppService/LinuxFunctionAppSlot.cs +++ b/sdk/dotnet/AppService/LinuxFunctionAppSlot.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.AppService /// /// Manages a Linux Function App Slot. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "Y1", + /// }); + /// + /// var exampleLinuxFunctionApp = new Azure.AppService.LinuxFunctionApp("exampleLinuxFunctionApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// SiteConfig = null, + /// }); + /// + /// var exampleLinuxFunctionAppSlot = new Azure.AppService.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", new() + /// { + /// FunctionAppId = exampleLinuxFunctionApp.Id, + /// StorageAccountName = exampleAccount.Name, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Linux Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/LinuxWebApp.cs b/sdk/dotnet/AppService/LinuxWebApp.cs index 8e9120c284..e750b7354d 100644 --- a/sdk/dotnet/AppService/LinuxWebApp.cs +++ b/sdk/dotnet/AppService/LinuxWebApp.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.AppService /// /// Manages a Linux Web App. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "P1v2", + /// }); + /// + /// var exampleLinuxWebApp = new Azure.AppService.LinuxWebApp("exampleLinuxWebApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleServicePlan.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/LinuxWebAppSlot.cs b/sdk/dotnet/AppService/LinuxWebAppSlot.cs index 3845e1430b..48856eddb2 100644 --- a/sdk/dotnet/AppService/LinuxWebAppSlot.cs +++ b/sdk/dotnet/AppService/LinuxWebAppSlot.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.AppService /// /// Manages a Linux Web App Slot. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "P1v2", + /// }); + /// + /// var exampleLinuxWebApp = new Azure.AppService.LinuxWebApp("exampleLinuxWebApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleServicePlan.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleLinuxWebAppSlot = new Azure.AppService.LinuxWebAppSlot("exampleLinuxWebAppSlot", new() + /// { + /// AppServiceId = exampleLinuxWebApp.Id, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/Plan.cs b/sdk/dotnet/AppService/Plan.cs index 5fc86456c6..9c01e86bc0 100644 --- a/sdk/dotnet/AppService/Plan.cs +++ b/sdk/dotnet/AppService/Plan.cs @@ -15,6 +15,123 @@ namespace Pulumi.Azure.AppService /// !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.ServicePlan` resource instead. /// /// ## Example Usage + /// ### Dedicated) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Shared / Consumption Plan) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "FunctionApp", + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Dynamic", + /// Size = "Y1", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Linux) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "Linux", + /// Reserved = true, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Windows Container) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "xenon", + /// IsXenon = true, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "PremiumContainer", + /// Size = "PC2", + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/PublicCertificate.cs b/sdk/dotnet/AppService/PublicCertificate.cs index ca0d11f66f..345b96bfc9 100644 --- a/sdk/dotnet/AppService/PublicCertificate.cs +++ b/sdk/dotnet/AppService/PublicCertificate.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service Public Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var examplePublicCertificate = new Azure.AppService.PublicCertificate("examplePublicCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServiceName = exampleAppService.Name, + /// CertificateName = "example-public-certificate", + /// CertificateLocation = "Unknown", + /// Blob = ReadFileBase64("app_service_public_certificate.cer"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Public Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/ServicePlan.cs b/sdk/dotnet/AppService/ServicePlan.cs index 9e6db83512..c6e64b8c69 100644 --- a/sdk/dotnet/AppService/ServicePlan.cs +++ b/sdk/dotnet/AppService/ServicePlan.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service: Service Plan. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "P1v2", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// AppServices can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/Slot.cs b/sdk/dotnet/AppService/Slot.cs index 1cee31b50c..9dce1736ae 100644 --- a/sdk/dotnet/AppService/Slot.cs +++ b/sdk/dotnet/AppService/Slot.cs @@ -17,6 +17,158 @@ namespace Pulumi.Azure.AppService /// > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource. /// /// ## Example Usage + /// ### NET 4.X) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var server = new Random.RandomId("server", new() + /// { + /// Keepers = + /// { + /// { "azi_id", 1 }, + /// }, + /// ByteLength = 8, + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// SiteConfig = new Azure.AppService.Inputs.AppServiceSiteConfigArgs + /// { + /// DotnetFrameworkVersion = "v4.0", + /// }, + /// AppSettings = + /// { + /// { "SOME_KEY", "some-value" }, + /// }, + /// ConnectionStrings = new[] + /// { + /// new Azure.AppService.Inputs.AppServiceConnectionStringArgs + /// { + /// Name = "Database", + /// Type = "SQLServer", + /// Value = "Server=some-server.mydomain.com;Integrated Security=SSPI", + /// }, + /// }, + /// }); + /// + /// var exampleSlot = new Azure.AppService.Slot("exampleSlot", new() + /// { + /// AppServiceName = exampleAppService.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// SiteConfig = new Azure.AppService.Inputs.SlotSiteConfigArgs + /// { + /// DotnetFrameworkVersion = "v4.0", + /// }, + /// AppSettings = + /// { + /// { "SOME_KEY", "some-value" }, + /// }, + /// ConnectionStrings = new[] + /// { + /// new Azure.AppService.Inputs.SlotConnectionStringArgs + /// { + /// Name = "Database", + /// Type = "SQLServer", + /// Value = "Server=some-server.mydomain.com;Integrated Security=SSPI", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Java 1.8) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var server = new Random.RandomId("server", new() + /// { + /// Keepers = + /// { + /// { "azi_id", 1 }, + /// }, + /// ByteLength = 8, + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// SiteConfig = new Azure.AppService.Inputs.AppServiceSiteConfigArgs + /// { + /// JavaVersion = "1.8", + /// JavaContainer = "JETTY", + /// JavaContainerVersion = "9.3", + /// }, + /// }); + /// + /// var exampleSlot = new Azure.AppService.Slot("exampleSlot", new() + /// { + /// AppServiceName = exampleAppService.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// SiteConfig = new Azure.AppService.Inputs.SlotSiteConfigArgs + /// { + /// JavaVersion = "1.8", + /// JavaContainer = "JETTY", + /// JavaContainerVersion = "9.3", + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/SlotCustomHostnameBinding.cs b/sdk/dotnet/AppService/SlotCustomHostnameBinding.cs index 6fcd841f7e..15ab17eaa7 100644 --- a/sdk/dotnet/AppService/SlotCustomHostnameBinding.cs +++ b/sdk/dotnet/AppService/SlotCustomHostnameBinding.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.AppService /// /// Manages a Hostname Binding within an App Service Slot. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var exampleSlot = new Azure.AppService.Slot("exampleSlot", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServiceName = exampleAppService.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var exampleSlotCustomHostnameBinding = new Azure.AppService.SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", new() + /// { + /// AppServiceSlotId = exampleSlot.Id, + /// Hostname = "www.mywebsite.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/SlotVirtualNetworkSwiftConnection.cs b/sdk/dotnet/AppService/SlotVirtualNetworkSwiftConnection.cs index bf0beb65c9..0395ba0858 100644 --- a/sdk/dotnet/AppService/SlotVirtualNetworkSwiftConnection.cs +++ b/sdk/dotnet/AppService/SlotVirtualNetworkSwiftConnection.cs @@ -12,6 +12,92 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service Slot's Virtual Network Association (this is for the [Regional VNet Integration](https://docs.microsoft.com/azure/app-service/web-sites-integrate-with-vnet#regional-vnet-integration) which is still in preview). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "example-delegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Web/serverFarms", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var example_staging = new Azure.AppService.Slot("example-staging", new() + /// { + /// AppServiceName = exampleAppService.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var exampleSlotVirtualNetworkSwiftConnection = new Azure.AppService.SlotVirtualNetworkSwiftConnection("exampleSlotVirtualNetworkSwiftConnection", new() + /// { + /// SlotName = example_staging.Name, + /// AppServiceId = exampleAppService.Id, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Slot Virtual Network Associations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/SourceCodeToken.cs b/sdk/dotnet/AppService/SourceCodeToken.cs index 1eadfa6c07..22b645c08a 100644 --- a/sdk/dotnet/AppService/SourceCodeToken.cs +++ b/sdk/dotnet/AppService/SourceCodeToken.cs @@ -16,6 +16,25 @@ namespace Pulumi.Azure.AppService /// /// > **NOTE:** Source Control Tokens are configured at the subscription level, not on each App Service - as such this can only be configured Subscription-wide /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.AppService.SourceCodeToken("example", new() + /// { + /// Token = "7e57735e77e577e57", + /// Type = "GitHub", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Source Control Token's can be imported using the `type`, e.g. diff --git a/sdk/dotnet/AppService/SourceControl.cs b/sdk/dotnet/AppService/SourceControl.cs index b597f4e91f..ffb6b7903d 100644 --- a/sdk/dotnet/AppService/SourceControl.cs +++ b/sdk/dotnet/AppService/SourceControl.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service Web App or Function App Source Control Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "P1v2", + /// }); + /// + /// var exampleLinuxWebApp = new Azure.AppService.LinuxWebApp("exampleLinuxWebApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleServicePlan.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleSourceControl = new Azure.AppService.SourceControl("exampleSourceControl", new() + /// { + /// AppId = exampleLinuxWebApp.Id, + /// RepoUrl = "https://github.com/Azure-Samples/python-docs-hello-world", + /// Branch = "master", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Source Controls can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/SourceControlSlot.cs b/sdk/dotnet/AppService/SourceControlSlot.cs index 58a511fec9..0ed76dc95c 100644 --- a/sdk/dotnet/AppService/SourceControlSlot.cs +++ b/sdk/dotnet/AppService/SourceControlSlot.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.AppService /// /// Manages an App Service Source Control Slot. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// SkuName = "P1v2", + /// }); + /// + /// var exampleLinuxWebApp = new Azure.AppService.LinuxWebApp("exampleLinuxWebApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleServicePlan.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleLinuxWebAppSlot = new Azure.AppService.LinuxWebAppSlot("exampleLinuxWebAppSlot", new() + /// { + /// AppServiceId = exampleLinuxWebApp.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleSourceControlSlot = new Azure.AppService.SourceControlSlot("exampleSourceControlSlot", new() + /// { + /// SlotId = exampleLinuxWebAppSlot.Id, + /// RepoUrl = "https://github.com/Azure-Samples/python-docs-hello-world", + /// Branch = "master", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// an App Service Source Control Slot can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/SourceControlToken.cs b/sdk/dotnet/AppService/SourceControlToken.cs index b270d21367..d5a2344a15 100644 --- a/sdk/dotnet/AppService/SourceControlToken.cs +++ b/sdk/dotnet/AppService/SourceControlToken.cs @@ -10,6 +10,25 @@ namespace Pulumi.Azure.AppService { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.AppService.SourceControlToken("example", new() + /// { + /// Token = "ghp_sometokenvaluesecretsauce", + /// Type = "GitHub", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// App Service Source GitHub Tokens can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/StaticSite.cs b/sdk/dotnet/AppService/StaticSite.cs index d36680c4d5..e86a46144b 100644 --- a/sdk/dotnet/AppService/StaticSite.cs +++ b/sdk/dotnet/AppService/StaticSite.cs @@ -14,6 +14,25 @@ namespace Pulumi.Azure.AppService /// /// ->**NOTE:** After the Static Site is provisioned, you'll need to associate your target repository, which contains your web app, to the Static Site, by following the [Azure Static Site document](https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.AppService.StaticSite("example", new() + /// { + /// Location = "West Europe", + /// ResourceGroupName = "example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Static Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/StaticSiteCustomDomain.cs b/sdk/dotnet/AppService/StaticSiteCustomDomain.cs index 647e4b8aaa..fe3f9ba063 100644 --- a/sdk/dotnet/AppService/StaticSiteCustomDomain.cs +++ b/sdk/dotnet/AppService/StaticSiteCustomDomain.cs @@ -11,6 +11,93 @@ namespace Pulumi.Azure.AppService { /// /// ## Example Usage + /// ### CNAME validation + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleStaticSite = new Azure.AppService.StaticSite("exampleStaticSite", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleCNameRecord = new Azure.Dns.CNameRecord("exampleCNameRecord", new() + /// { + /// ZoneName = "contoso.com", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Record = exampleStaticSite.DefaultHostName, + /// }); + /// + /// var exampleStaticSiteCustomDomain = new Azure.AppService.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", new() + /// { + /// StaticSiteId = exampleStaticSite.Id, + /// DomainName = Output.Tuple(exampleCNameRecord.Name, exampleCNameRecord.ZoneName).Apply(values => + /// { + /// var name = values.Item1; + /// var zoneName = values.Item2; + /// return $"{name}.{zoneName}"; + /// }), + /// ValidationType = "cname-delegation", + /// }); + /// + /// }); + /// ``` + /// ### TXT validation + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleStaticSite = new Azure.AppService.StaticSite("exampleStaticSite", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleStaticSiteCustomDomain = new Azure.AppService.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", new() + /// { + /// StaticSiteId = exampleStaticSite.Id, + /// DomainName = "my-domain.contoso.com", + /// ValidationType = "dns-txt-token", + /// }); + /// + /// var exampleTxtRecord = new Azure.Dns.TxtRecord("exampleTxtRecord", new() + /// { + /// ZoneName = "contoso.com", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.Dns.Inputs.TxtRecordRecordArgs + /// { + /// Value = exampleStaticSiteCustomDomain.ValidationToken, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/VirtualNetworkSwiftConnection.cs b/sdk/dotnet/AppService/VirtualNetworkSwiftConnection.cs index 8ac6f01ef1..10c369e187 100644 --- a/sdk/dotnet/AppService/VirtualNetworkSwiftConnection.cs +++ b/sdk/dotnet/AppService/VirtualNetworkSwiftConnection.cs @@ -34,6 +34,168 @@ namespace Pulumi.Azure.AppService /// Multiple apps in the same App Service plan can use the same VNet. /// /// ## Example Usage + /// ### With App Service) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "example-delegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Web/serverFarms", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAppService = new Azure.AppService.AppService("exampleAppService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// }); + /// + /// var exampleVirtualNetworkSwiftConnection = new Azure.AppService.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", new() + /// { + /// AppServiceId = exampleAppService.Id, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// }); + /// ``` + /// ### With Function App) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "example-delegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Web/serverFarms", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Standard", + /// Size = "S1", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleFunctionApp = new Azure.AppService.FunctionApp("exampleFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// var exampleVirtualNetworkSwiftConnection = new Azure.AppService.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", new() + /// { + /// AppServiceId = exampleFunctionApp.Id, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/WebAppActiveSlot.cs b/sdk/dotnet/AppService/WebAppActiveSlot.cs index dc5e94d7e1..ffe808cdfe 100644 --- a/sdk/dotnet/AppService/WebAppActiveSlot.cs +++ b/sdk/dotnet/AppService/WebAppActiveSlot.cs @@ -13,6 +13,50 @@ namespace Pulumi.Azure.AppService /// Manages a Web App Active Slot. /// /// ## Example Usage + /// ### Windows Web App + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Windows", + /// SkuName = "P1v2", + /// }); + /// + /// var exampleWindowsWebApp = new Azure.AppService.WindowsWebApp("exampleWindowsWebApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleServicePlan.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleWindowsWebAppSlot = new Azure.AppService.WindowsWebAppSlot("exampleWindowsWebAppSlot", new() + /// { + /// AppServiceId = exampleWindowsWebApp.Name, + /// SiteConfig = null, + /// }); + /// + /// var exampleWebAppActiveSlot = new Azure.AppService.WebAppActiveSlot("exampleWebAppActiveSlot", new() + /// { + /// SlotId = exampleWindowsWebAppSlot.Id, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/AppService/WebAppHybridConnection.cs b/sdk/dotnet/AppService/WebAppHybridConnection.cs index 954432a8ea..076751ede4 100644 --- a/sdk/dotnet/AppService/WebAppHybridConnection.cs +++ b/sdk/dotnet/AppService/WebAppHybridConnection.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.AppService /// /// Manages a Web App Hybrid Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OsType = "Windows", + /// SkuName = "S1", + /// }); + /// + /// var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleHybridConnection = new Azure.Relay.HybridConnection("exampleHybridConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RelayNamespaceName = exampleNamespace.Name, + /// }); + /// + /// var exampleWindowsWebApp = new Azure.AppService.WindowsWebApp("exampleWindowsWebApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleWebAppHybridConnection = new Azure.AppService.WebAppHybridConnection("exampleWebAppHybridConnection", new() + /// { + /// WebAppId = exampleWindowsWebApp.Id, + /// RelayId = exampleHybridConnection.Id, + /// Hostname = "myhostname.example", + /// Port = 8081, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// a Web App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/WindowsFunctionApp.cs b/sdk/dotnet/AppService/WindowsFunctionApp.cs index e50046dbf5..93756954cc 100644 --- a/sdk/dotnet/AppService/WindowsFunctionApp.cs +++ b/sdk/dotnet/AppService/WindowsFunctionApp.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.AppService /// /// Manages a Windows Function App. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Windows", + /// SkuName = "Y1", + /// }); + /// + /// var exampleWindowsFunctionApp = new Azure.AppService.WindowsFunctionApp("exampleWindowsFunctionApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Windows Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/WindowsFunctionAppSlot.cs b/sdk/dotnet/AppService/WindowsFunctionAppSlot.cs index 0a3bca187a..8505f1b7f0 100644 --- a/sdk/dotnet/AppService/WindowsFunctionAppSlot.cs +++ b/sdk/dotnet/AppService/WindowsFunctionAppSlot.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.AppService /// /// Manages a Windows Function App Slot. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Windows", + /// SkuName = "Y1", + /// }); + /// + /// var exampleWindowsFunctionApp = new Azure.AppService.WindowsFunctionApp("exampleWindowsFunctionApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageAccountName = exampleAccount.Name, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleWindowsFunctionAppSlot = new Azure.AppService.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", new() + /// { + /// FunctionAppId = exampleWindowsFunctionApp.Id, + /// StorageAccountName = exampleAccount.Name, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Windows Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/WindowsWebApp.cs b/sdk/dotnet/AppService/WindowsWebApp.cs index 00a5729a53..0177955712 100644 --- a/sdk/dotnet/AppService/WindowsWebApp.cs +++ b/sdk/dotnet/AppService/WindowsWebApp.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.AppService /// /// Manages a Windows Web App. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "P1v2", + /// OsType = "Windows", + /// }); + /// + /// var exampleWindowsWebApp = new Azure.AppService.WindowsWebApp("exampleWindowsWebApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleServicePlan.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/AppService/WindowsWebAppSlot.cs b/sdk/dotnet/AppService/WindowsWebAppSlot.cs index 7e443210a0..316c1ace9b 100644 --- a/sdk/dotnet/AppService/WindowsWebAppSlot.cs +++ b/sdk/dotnet/AppService/WindowsWebAppSlot.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.AppService /// /// Manages a Windows Web App Slot. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.AppService.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Windows", + /// SkuName = "P1v2", + /// }); + /// + /// var exampleWindowsWebApp = new Azure.AppService.WindowsWebApp("exampleWindowsWebApp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleServicePlan.Location, + /// ServicePlanId = exampleServicePlan.Id, + /// SiteConfig = null, + /// }); + /// + /// var exampleWindowsWebAppSlot = new Azure.AppService.WindowsWebAppSlot("exampleWindowsWebAppSlot", new() + /// { + /// AppServiceId = exampleWindowsWebApp.Id, + /// SiteConfig = null, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Arc/PrivateLinkScope.cs b/sdk/dotnet/Arc/PrivateLinkScope.cs index 76575caac6..4ffc10e7ac 100644 --- a/sdk/dotnet/Arc/PrivateLinkScope.cs +++ b/sdk/dotnet/Arc/PrivateLinkScope.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Arc /// /// Manages an Azure Arc Private Link Scope. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var examplePrivateLinkScope = new Azure.Arc.PrivateLinkScope("examplePrivateLinkScope", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Arc Private Link Scope can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Arc/ResourceBridgeAppliance.cs b/sdk/dotnet/Arc/ResourceBridgeAppliance.cs index 43538ab887..e3de571d4a 100644 --- a/sdk/dotnet/Arc/ResourceBridgeAppliance.cs +++ b/sdk/dotnet/Arc/ResourceBridgeAppliance.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.Arc /// /// Manages an Arc Resource Bridge Appliance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleResourceBridgeAppliance = new Azure.Arc.ResourceBridgeAppliance("exampleResourceBridgeAppliance", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Distro = "AKSEdge", + /// InfrastructureProvider = "VMWare", + /// Identity = new Azure.Arc.Inputs.ResourceBridgeApplianceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "hello", "world" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Arc Resource Bridge Appliance can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ArcKubernetes/ClusterExtension.cs b/sdk/dotnet/ArcKubernetes/ClusterExtension.cs index 723973d78d..5e7423c4c3 100644 --- a/sdk/dotnet/ArcKubernetes/ClusterExtension.cs +++ b/sdk/dotnet/ArcKubernetes/ClusterExtension.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.ArcKubernetes /// /// Manages an Arc Kubernetes Cluster Extension. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.ArcKubernetes.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// AgentPublicKeyCertificate = ReadFileBase64("testdata/public.cer"), + /// Identity = new Azure.ArcKubernetes.Inputs.ClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "ENV", "Test" }, + /// }, + /// }); + /// + /// var exampleClusterExtension = new Azure.ArcKubernetes.ClusterExtension("exampleClusterExtension", new() + /// { + /// ClusterId = exampleCluster.Id, + /// ExtensionType = "microsoft.flux", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Arc Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/dotnet/ArcKubernetes/FluxConfiguration.cs b/sdk/dotnet/ArcKubernetes/FluxConfiguration.cs index 21cdb7084e..4beb7b411a 100644 --- a/sdk/dotnet/ArcKubernetes/FluxConfiguration.cs +++ b/sdk/dotnet/ArcKubernetes/FluxConfiguration.cs @@ -12,6 +12,76 @@ namespace Pulumi.Azure.ArcKubernetes /// /// Manages an Arc Kubernetes Flux Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.ArcKubernetes.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// AgentPublicKeyCertificate = ReadFileBase64("testdata/public.cer"), + /// Identity = new Azure.ArcKubernetes.Inputs.ClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "ENV", "Test" }, + /// }, + /// }); + /// + /// var exampleClusterExtension = new Azure.ArcKubernetes.ClusterExtension("exampleClusterExtension", new() + /// { + /// ClusterId = azurerm_arc_kubernetes_cluster.Test.Id, + /// ExtensionType = "microsoft.flux", + /// }); + /// + /// var exampleFluxConfiguration = new Azure.ArcKubernetes.FluxConfiguration("exampleFluxConfiguration", new() + /// { + /// ClusterId = azurerm_arc_kubernetes_cluster.Test.Id, + /// Namespace = "flux", + /// GitRepository = new Azure.ArcKubernetes.Inputs.FluxConfigurationGitRepositoryArgs + /// { + /// Url = "https://github.com/Azure/arc-k8s-demo", + /// ReferenceType = "branch", + /// ReferenceValue = "main", + /// }, + /// Kustomizations = new[] + /// { + /// new Azure.ArcKubernetes.Inputs.FluxConfigurationKustomizationArgs + /// { + /// Name = "kustomization-1", + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleClusterExtension, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Arc Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/dotnet/ArcMachine/Get.cs b/sdk/dotnet/ArcMachine/Get.cs index 20d9cfeb75..99769c744b 100644 --- a/sdk/dotnet/ArcMachine/Get.cs +++ b/sdk/dotnet/ArcMachine/Get.cs @@ -13,12 +13,66 @@ public static class Get { /// /// Use this data source to access information about an existing Azure Arc machine. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ArcMachine.Get.Invoke(new() + /// { + /// Name = "existing-hcmachine", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getResult => getResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:arcmachine/get:get", args ?? new GetArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure Arc machine. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ArcMachine.Get.Invoke(new() + /// { + /// Name = "existing-hcmachine", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getResult => getResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:arcmachine/get:get", args ?? new GetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Attestation/Provider.cs b/sdk/dotnet/Attestation/Provider.cs index 660f62ed26..ab7bab624b 100644 --- a/sdk/dotnet/Attestation/Provider.cs +++ b/sdk/dotnet/Attestation/Provider.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.Attestation /// /// Manages an Attestation Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleProvider = new Azure.Attestation.Provider("exampleProvider", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PolicySigningCertificateData = File.ReadAllText("./example/cert.pem"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Attestation Providers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Authorization/Assignment.cs b/sdk/dotnet/Authorization/Assignment.cs index 8362cf3610..826c9a12d1 100644 --- a/sdk/dotnet/Authorization/Assignment.cs +++ b/sdk/dotnet/Authorization/Assignment.cs @@ -13,6 +13,169 @@ namespace Pulumi.Azure.Authorization /// Assigns a given Principal (User or Group) to a given Role. /// /// ## Example Usage + /// ### Using A Built-In Role) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionName = "Reader", + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// ### Custom Role & Service Principal) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = new Azure.Authorization.RoleDefinition("exampleRoleDefinition", new() + /// { + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Resources/subscriptions/resourceGroups/read", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionId = exampleRoleDefinition.RoleDefinitionResourceId, + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// ### Custom Role & User) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = new Azure.Authorization.RoleDefinition("exampleRoleDefinition", new() + /// { + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Resources/subscriptions/resourceGroups/read", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionId = exampleRoleDefinition.RoleDefinitionResourceId, + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// ### Custom Role & Management Group) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleGroup = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// var exampleRoleDefinition = new Azure.Authorization.RoleDefinition("exampleRoleDefinition", new() + /// { + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Resources/subscriptions/resourceGroups/read", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// Scope = data.Azurerm_management_group.Primary.Id, + /// RoleDefinitionId = exampleRoleDefinition.RoleDefinitionResourceId, + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Authorization/GetUserAssignedIdentity.cs b/sdk/dotnet/Authorization/GetUserAssignedIdentity.cs index 716245351d..16a44dd956 100644 --- a/sdk/dotnet/Authorization/GetUserAssignedIdentity.cs +++ b/sdk/dotnet/Authorization/GetUserAssignedIdentity.cs @@ -16,6 +16,32 @@ public static class GetUserAssignedIdentity /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Authorization.GetUserAssignedIdentity.Invoke(new() + /// { + /// Name = "name_of_user_assigned_identity", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["uaiClientId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.ClientId), + /// ["uaiPrincipalId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.PrincipalId), + /// ["uaiTenantId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.TenantId), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Task InvokeAsync(GetUserAssignedIdentityArgs args, InvokeOptions? options = null) @@ -26,6 +52,32 @@ public static Task InvokeAsync(GetUserAssignedIde /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Authorization.GetUserAssignedIdentity.Invoke(new() + /// { + /// Name = "name_of_user_assigned_identity", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["uaiClientId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.ClientId), + /// ["uaiPrincipalId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.PrincipalId), + /// ["uaiTenantId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.TenantId), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Output Invoke(GetUserAssignedIdentityInvokeArgs args, InvokeOptions? options = null) diff --git a/sdk/dotnet/Authorization/RoleDefinition.cs b/sdk/dotnet/Authorization/RoleDefinition.cs index 65519531ae..88eed7f791 100644 --- a/sdk/dotnet/Authorization/RoleDefinition.cs +++ b/sdk/dotnet/Authorization/RoleDefinition.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Authorization /// /// Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var example = new Azure.Authorization.RoleDefinition("example", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Description = "This is a custom role created", + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "*", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Authorization/UserAssignedIdentity.cs b/sdk/dotnet/Authorization/UserAssignedIdentity.cs index 3cde3f756d..d4b03a35ea 100644 --- a/sdk/dotnet/Authorization/UserAssignedIdentity.cs +++ b/sdk/dotnet/Authorization/UserAssignedIdentity.cs @@ -14,6 +14,30 @@ namespace Pulumi.Azure.Authorization /// /// Manages a User Assigned Identity. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/dotnet/Automanage/Configuration.cs b/sdk/dotnet/Automanage/Configuration.cs index dd40b0296a..489c1501e9 100644 --- a/sdk/dotnet/Automanage/Configuration.cs +++ b/sdk/dotnet/Automanage/Configuration.cs @@ -12,6 +12,106 @@ namespace Pulumi.Azure.Automanage /// /// Manages an Automanage Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleConfiguration = new Azure.Automanage.Configuration("exampleConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Antimalware = new Azure.Automanage.Inputs.ConfigurationAntimalwareArgs + /// { + /// Exclusions = new Azure.Automanage.Inputs.ConfigurationAntimalwareExclusionsArgs + /// { + /// Extensions = "exe;dll", + /// Paths = "C:\\Windows\\Temp;D:\\Temp", + /// Processes = "svchost.exe;notepad.exe", + /// }, + /// RealTimeProtectionEnabled = true, + /// ScheduledScanEnabled = true, + /// ScheduledScanType = "Quick", + /// ScheduledScanDay = 1, + /// ScheduledScanTimeInMinutes = 1339, + /// }, + /// AzureSecurityBaseline = new Azure.Automanage.Inputs.ConfigurationAzureSecurityBaselineArgs + /// { + /// AssignmentType = "ApplyAndAutoCorrect", + /// }, + /// AutomationAccountEnabled = true, + /// Backup = new Azure.Automanage.Inputs.ConfigurationBackupArgs + /// { + /// PolicyName = "acctest-backup-policy-%d", + /// TimeZone = "UTC", + /// InstantRpRetentionRangeInDays = 2, + /// SchedulePolicy = new Azure.Automanage.Inputs.ConfigurationBackupSchedulePolicyArgs + /// { + /// ScheduleRunFrequency = "Daily", + /// ScheduleRunDays = new[] + /// { + /// "Monday", + /// "Tuesday", + /// }, + /// ScheduleRunTimes = new[] + /// { + /// "12:00", + /// }, + /// SchedulePolicyType = "SimpleSchedulePolicy", + /// }, + /// RetentionPolicy = new Azure.Automanage.Inputs.ConfigurationBackupRetentionPolicyArgs + /// { + /// RetentionPolicyType = "LongTermRetentionPolicy", + /// DailySchedule = new Azure.Automanage.Inputs.ConfigurationBackupRetentionPolicyDailyScheduleArgs + /// { + /// RetentionTimes = new[] + /// { + /// "12:00", + /// }, + /// RetentionDuration = new Azure.Automanage.Inputs.ConfigurationBackupRetentionPolicyDailyScheduleRetentionDurationArgs + /// { + /// Count = 7, + /// DurationType = "Days", + /// }, + /// }, + /// WeeklySchedule = new Azure.Automanage.Inputs.ConfigurationBackupRetentionPolicyWeeklyScheduleArgs + /// { + /// RetentionTimes = new[] + /// { + /// "14:00", + /// }, + /// RetentionDuration = new Azure.Automanage.Inputs.ConfigurationBackupRetentionPolicyWeeklyScheduleRetentionDurationArgs + /// { + /// Count = 4, + /// DurationType = "Weeks", + /// }, + /// }, + /// }, + /// }, + /// BootDiagnosticsEnabled = true, + /// DefenderForCloudEnabled = true, + /// GuestConfigurationEnabled = true, + /// LogAnalyticsEnabled = true, + /// StatusChangeAlertEnabled = true, + /// Tags = + /// { + /// { "env", "test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automanage Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Account.cs b/sdk/dotnet/Automation/Account.cs index ab33ec52fc..6274c0f24d 100644 --- a/sdk/dotnet/Automation/Account.cs +++ b/sdk/dotnet/Automation/Account.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// Tags = + /// { + /// { "environment", "development" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/BoolVariable.cs b/sdk/dotnet/Automation/BoolVariable.cs index ebf2e850b0..40dba4f1e7 100644 --- a/sdk/dotnet/Automation/BoolVariable.cs +++ b/sdk/dotnet/Automation/BoolVariable.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Automation /// /// Manages a boolean variable in Azure Automation /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleBoolVariable = new Azure.Automation.BoolVariable("exampleBoolVariable", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Value = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Bool Variable can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Certificate.cs b/sdk/dotnet/Automation/Certificate.cs index 348bbd184f..08d3f7d96d 100644 --- a/sdk/dotnet/Automation/Certificate.cs +++ b/sdk/dotnet/Automation/Certificate.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleCertificate = new Azure.Automation.Certificate("exampleCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Description = "This is an example certificate", + /// Base64 = ReadFileBase64("certificate.pfx"), + /// Exportable = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Connection.cs b/sdk/dotnet/Automation/Connection.cs index cc4cc72c91..a9915d422a 100644 --- a/sdk/dotnet/Automation/Connection.cs +++ b/sdk/dotnet/Automation/Connection.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleConnection = new Azure.Automation.Connection("exampleConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Type = "AzureServicePrincipal", + /// Values = + /// { + /// { "ApplicationId", "00000000-0000-0000-0000-000000000000" }, + /// { "TenantId", exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.TenantId) }, + /// { "SubscriptionId", exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId) }, + /// { "CertificateThumbprint", "sample-certificate-thumbprint" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/ConnectionCertificate.cs b/sdk/dotnet/Automation/ConnectionCertificate.cs index 5c00a43bf3..2bc32c1b82 100644 --- a/sdk/dotnet/Automation/ConnectionCertificate.cs +++ b/sdk/dotnet/Automation/ConnectionCertificate.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Connection with type `Azure`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleCertificate = new Azure.Automation.Certificate("exampleCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Base64 = ReadFileBase64("certificate.pfx"), + /// }); + /// + /// var exampleConnectionCertificate = new Azure.Automation.ConnectionCertificate("exampleConnectionCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// AutomationCertificateName = exampleCertificate.Name, + /// SubscriptionId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/ConnectionClassicCertificate.cs b/sdk/dotnet/Automation/ConnectionClassicCertificate.cs index 0c53a173a1..85bfe18235 100644 --- a/sdk/dotnet/Automation/ConnectionClassicCertificate.cs +++ b/sdk/dotnet/Automation/ConnectionClassicCertificate.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Connection with type `AzureClassicCertificate`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleConnectionClassicCertificate = new Azure.Automation.ConnectionClassicCertificate("exampleConnectionClassicCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// CertificateAssetName = "cert1", + /// SubscriptionName = "subs1", + /// SubscriptionId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/ConnectionServicePrincipal.cs b/sdk/dotnet/Automation/ConnectionServicePrincipal.cs index fae12333a2..feeaad984c 100644 --- a/sdk/dotnet/Automation/ConnectionServicePrincipal.cs +++ b/sdk/dotnet/Automation/ConnectionServicePrincipal.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Connection with type `AzureServicePrincipal`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleConnectionServicePrincipal = new Azure.Automation.ConnectionServicePrincipal("exampleConnectionServicePrincipal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// ApplicationId = "00000000-0000-0000-0000-000000000000", + /// TenantId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SubscriptionId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId), + /// CertificateThumbprint = File.ReadAllText("automation_certificate_test.thumb"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/ConnectionType.cs b/sdk/dotnet/Automation/ConnectionType.cs index 52dd4205c8..d886f54b5f 100644 --- a/sdk/dotnet/Automation/ConnectionType.cs +++ b/sdk/dotnet/Automation/ConnectionType.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Automation /// /// Manages anAutomation Connection Type. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleConnectionType = new Azure.Automation.ConnectionType("exampleConnectionType", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Fields = new[] + /// { + /// new Azure.Automation.Inputs.ConnectionTypeFieldArgs + /// { + /// Name = "example", + /// Type = "string", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Credential.cs b/sdk/dotnet/Automation/Credential.cs index 96067f83e4..8c23d63958 100644 --- a/sdk/dotnet/Automation/Credential.cs +++ b/sdk/dotnet/Automation/Credential.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Credential. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleCredential = new Azure.Automation.Credential("exampleCredential", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Username = "example_user", + /// Password = "example_pwd", + /// Description = "This is an example credential", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/DateTimeVariable.cs b/sdk/dotnet/Automation/DateTimeVariable.cs index b2ef979352..d84e65f54f 100644 --- a/sdk/dotnet/Automation/DateTimeVariable.cs +++ b/sdk/dotnet/Automation/DateTimeVariable.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Automation /// /// Manages a DateTime variable in Azure Automation /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleDateTimeVariable = new Azure.Automation.DateTimeVariable("exampleDateTimeVariable", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Value = "2019-04-24T21:40:54.074Z", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation DateTime Variable can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/DscConfiguration.cs b/sdk/dotnet/Automation/DscConfiguration.cs index df32d8884a..bf3023d779 100644 --- a/sdk/dotnet/Automation/DscConfiguration.cs +++ b/sdk/dotnet/Automation/DscConfiguration.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation DSC Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleDscConfiguration = new Azure.Automation.DscConfiguration("exampleDscConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Location = exampleResourceGroup.Location, + /// ContentEmbedded = "configuration test {}", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation DSC Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/DscNodeConfiguration.cs b/sdk/dotnet/Automation/DscNodeConfiguration.cs index 37ea2d407d..9dfd0c3c3f 100644 --- a/sdk/dotnet/Automation/DscNodeConfiguration.cs +++ b/sdk/dotnet/Automation/DscNodeConfiguration.cs @@ -12,6 +12,73 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation DSC Node Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleDscConfiguration = new Azure.Automation.DscConfiguration("exampleDscConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Location = exampleResourceGroup.Location, + /// ContentEmbedded = "configuration test {}", + /// }); + /// + /// var exampleDscNodeConfiguration = new Azure.Automation.DscNodeConfiguration("exampleDscNodeConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// ContentEmbedded = @"instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref + /// { + /// ResourceID = ""[File]bla""; + /// Ensure = ""Present""; + /// Contents = ""bogus Content""; + /// DestinationPath = ""c:\\bogus.txt""; + /// ModuleName = ""PSDesiredStateConfiguration""; + /// SourceInfo = ""::3::9::file""; + /// ModuleVersion = ""1.0""; + /// ConfigurationName = ""bla""; + /// }; + /// instance of OMI_ConfigurationDocument + /// { + /// Version=""2.0.0""; + /// MinimumCompatibleVersion = ""1.0.0""; + /// CompatibleVersionAdditionalProperties= {""Omi_BaseResource:ConfigurationName""}; + /// Author=""bogusAuthor""; + /// GenerationDate=""06/15/2018 14:06:24""; + /// GenerationHost=""bogusComputer""; + /// Name=""test""; + /// }; + /// ", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleDscConfiguration, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation DSC Node Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/GetAccount.cs b/sdk/dotnet/Automation/GetAccount.cs index 9318be5056..04b00f412f 100644 --- a/sdk/dotnet/Automation/GetAccount.cs +++ b/sdk/dotnet/Automation/GetAccount.cs @@ -13,12 +13,66 @@ public static class GetAccount { /// /// Use this data source to access information about an existing Automation Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["automationAccountId"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:automation/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Automation Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["automationAccountId"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:automation/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Automation/GetBoolVariable.cs b/sdk/dotnet/Automation/GetBoolVariable.cs index bd614a6ed4..e893f341ad 100644 --- a/sdk/dotnet/Automation/GetBoolVariable.cs +++ b/sdk/dotnet/Automation/GetBoolVariable.cs @@ -13,12 +13,68 @@ public static class GetBoolVariable { /// /// Use this data source to access information about an existing Automation Bool Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetBoolVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getBoolVariableResult => getBoolVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBoolVariableArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:automation/getBoolVariable:getBoolVariable", args ?? new GetBoolVariableArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Automation Bool Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetBoolVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getBoolVariableResult => getBoolVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBoolVariableInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:automation/getBoolVariable:getBoolVariable", args ?? new GetBoolVariableInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Automation/GetDateTimeVariable.cs b/sdk/dotnet/Automation/GetDateTimeVariable.cs index 4d7a1340be..77afa44fcd 100644 --- a/sdk/dotnet/Automation/GetDateTimeVariable.cs +++ b/sdk/dotnet/Automation/GetDateTimeVariable.cs @@ -13,12 +13,68 @@ public static class GetDateTimeVariable { /// /// Use this data source to access information about an existing Automation Datetime Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetDateTimeVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getDateTimeVariableResult => getDateTimeVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDateTimeVariableArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:automation/getDateTimeVariable:getDateTimeVariable", args ?? new GetDateTimeVariableArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Automation Datetime Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetDateTimeVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getDateTimeVariableResult => getDateTimeVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDateTimeVariableInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:automation/getDateTimeVariable:getDateTimeVariable", args ?? new GetDateTimeVariableInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Automation/GetIntVariable.cs b/sdk/dotnet/Automation/GetIntVariable.cs index f8549e40ed..8baea3ef07 100644 --- a/sdk/dotnet/Automation/GetIntVariable.cs +++ b/sdk/dotnet/Automation/GetIntVariable.cs @@ -13,12 +13,68 @@ public static class GetIntVariable { /// /// Use this data source to access information about an existing Automation Int Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetIntVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getIntVariableResult => getIntVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetIntVariableArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:automation/getIntVariable:getIntVariable", args ?? new GetIntVariableArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Automation Int Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetIntVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getIntVariableResult => getIntVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetIntVariableInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:automation/getIntVariable:getIntVariable", args ?? new GetIntVariableInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Automation/GetStringVariable.cs b/sdk/dotnet/Automation/GetStringVariable.cs index 4b9db7a51f..b9a15ee135 100644 --- a/sdk/dotnet/Automation/GetStringVariable.cs +++ b/sdk/dotnet/Automation/GetStringVariable.cs @@ -13,12 +13,68 @@ public static class GetStringVariable { /// /// Use this data source to access information about an existing Automation String Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetStringVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getStringVariableResult => getStringVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetStringVariableArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:automation/getStringVariable:getStringVariable", args ?? new GetStringVariableArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Automation String Variable. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Automation.GetStringVariable.Invoke(new() + /// { + /// Name = "tfex-example-var", + /// ResourceGroupName = "tfex-example-rg", + /// AutomationAccountName = "tfex-example-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["variableId"] = example.Apply(getStringVariableResult => getStringVariableResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetStringVariableInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:automation/getStringVariable:getStringVariable", args ?? new GetStringVariableInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Automation/GetVariables.cs b/sdk/dotnet/Automation/GetVariables.cs index 4d0d8b7d15..a5d7cdab79 100644 --- a/sdk/dotnet/Automation/GetVariables.cs +++ b/sdk/dotnet/Automation/GetVariables.cs @@ -13,12 +13,76 @@ public static class GetVariables { /// /// Use this data source to get all variables in an Automation Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.Automation.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleVariables = Azure.Automation.GetVariables.Invoke(new() + /// { + /// AutomationAccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["stringVars"] = data.Azurerm_automation_variable_string.Example.String, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVariablesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:automation/getVariables:getVariables", args ?? new GetVariablesArgs(), options.WithDefaults()); /// /// Use this data source to get all variables in an Automation Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.Automation.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleVariables = Azure.Automation.GetVariables.Invoke(new() + /// { + /// AutomationAccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["stringVars"] = data.Azurerm_automation_variable_string.Example.String, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVariablesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:automation/getVariables:getVariables", args ?? new GetVariablesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Automation/HybridRunbookWorker.cs b/sdk/dotnet/Automation/HybridRunbookWorker.cs index 800c305511..78331da945 100644 --- a/sdk/dotnet/Automation/HybridRunbookWorker.cs +++ b/sdk/dotnet/Automation/HybridRunbookWorker.cs @@ -12,6 +12,108 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Hybrid Runbook Worker. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleHybridRunbookWorkerGroup = new Azure.Automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "vm-example", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Size = "Standard_B1s", + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// DisablePasswordAuthentication = false, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "OpenLogic", + /// Offer = "CentOS", + /// Sku = "7.5", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// }); + /// + /// var exampleHybridRunbookWorker = new Azure.Automation.HybridRunbookWorker("exampleHybridRunbookWorker", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// WorkerGroupName = exampleHybridRunbookWorkerGroup.Name, + /// VmResourceId = exampleLinuxVirtualMachine.Id, + /// WorkerId = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// //unique uuid + /// }); + /// ``` + /// /// ## Import /// /// Automations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/HybridRunbookWorkerGroup.cs b/sdk/dotnet/Automation/HybridRunbookWorkerGroup.cs index ba41dc5a86..ed01cd642c 100644 --- a/sdk/dotnet/Automation/HybridRunbookWorkerGroup.cs +++ b/sdk/dotnet/Automation/HybridRunbookWorkerGroup.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Hybrid Runbook Worker Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleHybridRunbookWorkerGroup = new Azure.Automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/IntVariable.cs b/sdk/dotnet/Automation/IntVariable.cs index 989e5125eb..9c702aeb79 100644 --- a/sdk/dotnet/Automation/IntVariable.cs +++ b/sdk/dotnet/Automation/IntVariable.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Automation /// /// Manages a integer variable in Azure Automation /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleIntVariable = new Azure.Automation.IntVariable("exampleIntVariable", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Value = 1234, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Int Variable can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/JobSchedule.cs b/sdk/dotnet/Automation/JobSchedule.cs index 1fc176a0d0..25b2c45d05 100644 --- a/sdk/dotnet/Automation/JobSchedule.cs +++ b/sdk/dotnet/Automation/JobSchedule.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Automation /// /// Links an Automation Runbook and Schedule. /// + /// ## Example Usage + /// + /// This is an example of just the Job Schedule. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Automation.JobSchedule("example", new() + /// { + /// AutomationAccountName = "tf-automation-account", + /// Parameters = + /// { + /// { "resourcegroup", "tf-rgr-vm" }, + /// { "vmname", "TF-VM-01" }, + /// }, + /// ResourceGroupName = "tf-rgr-automation", + /// RunbookName = "Get-VirtualMachine", + /// ScheduleName = "hour", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Job Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Module.cs b/sdk/dotnet/Automation/Module.cs index d21b11329e..09c42e0754 100644 --- a/sdk/dotnet/Automation/Module.cs +++ b/sdk/dotnet/Automation/Module.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Module. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleModule = new Azure.Automation.Module("exampleModule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// ModuleLink = new Azure.Automation.Inputs.ModuleModuleLinkArgs + /// { + /// Uri = "https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Modules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Python3Package.cs b/sdk/dotnet/Automation/Python3Package.cs index 0f0d144d20..131f7b2e31 100644 --- a/sdk/dotnet/Automation/Python3Package.cs +++ b/sdk/dotnet/Automation/Python3Package.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Python3 Package. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "%[2]s", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var examplePython3Package = new Azure.Automation.Python3Package("examplePython3Package", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// ContentUri = "https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz", + /// ContentVersion = "2.31.0", + /// HashAlgorithm = "sha256", + /// HashValue = "942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1", + /// Tags = + /// { + /// { "key", "foo" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Python3 Packages can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/RunBook.cs b/sdk/dotnet/Automation/RunBook.cs index 688c4c3e46..055b8655f6 100644 --- a/sdk/dotnet/Automation/RunBook.cs +++ b/sdk/dotnet/Automation/RunBook.cs @@ -12,6 +12,88 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Runbook. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleRunBook = new Azure.Automation.RunBook("exampleRunBook", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// LogVerbose = true, + /// LogProgress = true, + /// Description = "This is an example runbook", + /// RunbookType = "PowerShellWorkflow", + /// PublishContentLink = new Azure.Automation.Inputs.RunBookPublishContentLinkArgs + /// { + /// Uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Custom Content + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Local = Pulumi.Local; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleFile = Local.GetFile.Invoke(new() + /// { + /// Filename = $"{path.Module}/example.ps1", + /// }); + /// + /// var exampleRunBook = new Azure.Automation.RunBook("exampleRunBook", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// LogVerbose = true, + /// LogProgress = true, + /// Description = "This is an example runbook", + /// RunbookType = "PowerShell", + /// Content = exampleFile.Apply(getFileResult => getFileResult.Content), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Runbooks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Schedule.cs b/sdk/dotnet/Automation/Schedule.cs index 6a5132779c..249928dcbf 100644 --- a/sdk/dotnet/Automation/Schedule.cs +++ b/sdk/dotnet/Automation/Schedule.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Automation /// /// Manages a Automation Schedule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleSchedule = new Azure.Automation.Schedule("exampleSchedule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Frequency = "Week", + /// Interval = 1, + /// Timezone = "Australia/Perth", + /// StartTime = "2014-04-15T18:00:15+02:00", + /// Description = "This is an example schedule", + /// WeekDays = new[] + /// { + /// "Friday", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/SoftwareUpdateConfiguration.cs b/sdk/dotnet/Automation/SoftwareUpdateConfiguration.cs index 3d10fcd038..8c8b096c2b 100644 --- a/sdk/dotnet/Automation/SoftwareUpdateConfiguration.cs +++ b/sdk/dotnet/Automation/SoftwareUpdateConfiguration.cs @@ -12,6 +12,83 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Software Update Configuraion. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleRunBook = new Azure.Automation.RunBook("exampleRunBook", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// LogVerbose = true, + /// LogProgress = true, + /// Description = "This is a example runbook for terraform acceptance example", + /// RunbookType = "Python3", + /// Content = @"# Some example content + /// # for Terraform acceptance example + /// ", + /// Tags = + /// { + /// { "ENV", "runbook_test" }, + /// }, + /// }); + /// + /// var exampleSoftwareUpdateConfiguration = new Azure.Automation.SoftwareUpdateConfiguration("exampleSoftwareUpdateConfiguration", new() + /// { + /// AutomationAccountId = exampleAccount.Id, + /// OperatingSystem = "Linux", + /// Linuxes = new[] + /// { + /// new Azure.Automation.Inputs.SoftwareUpdateConfigurationLinuxArgs + /// { + /// ClassificationIncluded = "Security", + /// ExcludedPackages = new[] + /// { + /// "apt", + /// }, + /// IncludedPackages = new[] + /// { + /// "vim", + /// }, + /// Reboot = "IfRequired", + /// }, + /// }, + /// PreTasks = new[] + /// { + /// new Azure.Automation.Inputs.SoftwareUpdateConfigurationPreTaskArgs + /// { + /// Source = exampleRunBook.Name, + /// Parameters = + /// { + /// { "COMPUTER_NAME", "Foo" }, + /// }, + /// }, + /// }, + /// Duration = "PT2H2M2S", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automations Software Update Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/SourceControl.cs b/sdk/dotnet/Automation/SourceControl.cs index 7cfaa563c1..db6906de46 100644 --- a/sdk/dotnet/Automation/SourceControl.cs +++ b/sdk/dotnet/Automation/SourceControl.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Source Control. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleSourceControl = new Azure.Automation.SourceControl("exampleSourceControl", new() + /// { + /// AutomationAccountId = exampleAccount.Id, + /// FolderPath = "runbook", + /// Security = new Azure.Automation.Inputs.SourceControlSecurityArgs + /// { + /// Token = "ghp_xxx", + /// TokenType = "PersonalAccessToken", + /// }, + /// RepositoryUrl = "https://github.com/foo/bat.git", + /// SourceControlType = "GitHub", + /// Branch = "main", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/StringVariable.cs b/sdk/dotnet/Automation/StringVariable.cs index 03174c791d..822d9fb077 100644 --- a/sdk/dotnet/Automation/StringVariable.cs +++ b/sdk/dotnet/Automation/StringVariable.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Automation /// /// Manages a string variable in Azure Automation /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleStringVariable = new Azure.Automation.StringVariable("exampleStringVariable", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Value = "Hello, Basic Test.", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation String Variable can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/VariableObject.cs b/sdk/dotnet/Automation/VariableObject.cs index 1a172b8906..4ddefa2e85 100644 --- a/sdk/dotnet/Automation/VariableObject.cs +++ b/sdk/dotnet/Automation/VariableObject.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Automation /// /// Manages an object variable in Azure Automation /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleVariableObject = new Azure.Automation.VariableObject("exampleVariableObject", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// Value = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["greeting"] = "Hello, Terraform Basic Test.", + /// ["language"] = "en", + /// }), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Object Variable can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Watcher.cs b/sdk/dotnet/Automation/Watcher.cs index 4152c1fcde..0a0c799c82 100644 --- a/sdk/dotnet/Automation/Watcher.cs +++ b/sdk/dotnet/Automation/Watcher.cs @@ -12,6 +12,70 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Wacher. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleHybridRunbookWorkerGroup = new Azure.Automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleRunBook = new Azure.Automation.RunBook("exampleRunBook", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// LogVerbose = true, + /// LogProgress = true, + /// Description = "This is an example runbook", + /// RunbookType = "PowerShellWorkflow", + /// PublishContentLink = new Azure.Automation.Inputs.RunBookPublishContentLinkArgs + /// { + /// Uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + /// }, + /// }); + /// + /// var exampleWatcher = new Azure.Automation.Watcher("exampleWatcher", new() + /// { + /// AutomationAccountId = exampleAccount.Id, + /// Location = "West Europe", + /// ScriptName = exampleRunBook.Name, + /// ScriptRunOn = exampleHybridRunbookWorkerGroup.Name, + /// Description = "example-watcher desc", + /// ExecutionFrequencyInSeconds = 42, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// ScriptParameters = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Automation/Webhook.cs b/sdk/dotnet/Automation/Webhook.cs index 42f6b20735..734a0a526b 100644 --- a/sdk/dotnet/Automation/Webhook.cs +++ b/sdk/dotnet/Automation/Webhook.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.Automation /// /// Manages an Automation Runbook's Webhook. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleRunBook = new Azure.Automation.RunBook("exampleRunBook", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// LogVerbose = true, + /// LogProgress = true, + /// Description = "This is an example runbook", + /// RunbookType = "PowerShellWorkflow", + /// PublishContentLink = new Azure.Automation.Inputs.RunBookPublishContentLinkArgs + /// { + /// Uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + /// }, + /// }); + /// + /// var exampleWebhook = new Azure.Automation.Webhook("exampleWebhook", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomationAccountName = exampleAccount.Name, + /// ExpiryTime = "2021-12-31T00:00:00Z", + /// Enabled = true, + /// RunbookName = exampleRunBook.Name, + /// Parameters = + /// { + /// { "input", "parameter" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Automation Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Avs/Cluster.cs b/sdk/dotnet/Avs/Cluster.cs index 873d8ca3d6..9326fed19d 100644 --- a/sdk/dotnet/Avs/Cluster.cs +++ b/sdk/dotnet/Avs/Cluster.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Avs /// /// Manages a VMware Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePrivateCloud = new Azure.Avs.PrivateCloud("examplePrivateCloud", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "av36", + /// ManagementCluster = new Azure.Avs.Inputs.PrivateCloudManagementClusterArgs + /// { + /// Size = 3, + /// }, + /// NetworkSubnetCidr = "192.168.48.0/22", + /// InternetConnectionEnabled = false, + /// NsxtPassword = "QazWsx13$Edc", + /// VcenterPassword = "WsxEdc23$Rfv", + /// }); + /// + /// var exampleCluster = new Azure.Avs.Cluster("exampleCluster", new() + /// { + /// VmwareCloudId = examplePrivateCloud.Id, + /// ClusterNodeCount = 3, + /// SkuName = "av36", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VMware Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Avs/ExpressRouteAuthorization.cs b/sdk/dotnet/Avs/ExpressRouteAuthorization.cs index 8d41ff5dad..0cfe563a9a 100644 --- a/sdk/dotnet/Avs/ExpressRouteAuthorization.cs +++ b/sdk/dotnet/Avs/ExpressRouteAuthorization.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Avs /// /// Manages an Express Route VMware Authorization. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePrivateCloud = new Azure.Avs.PrivateCloud("examplePrivateCloud", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "av36", + /// ManagementCluster = new Azure.Avs.Inputs.PrivateCloudManagementClusterArgs + /// { + /// Size = 3, + /// }, + /// NetworkSubnetCidr = "192.168.48.0/22", + /// InternetConnectionEnabled = false, + /// NsxtPassword = "QazWsx13$Edc", + /// VcenterPassword = "WsxEdc23$Rfv", + /// }); + /// + /// var exampleExpressRouteAuthorization = new Azure.Avs.ExpressRouteAuthorization("exampleExpressRouteAuthorization", new() + /// { + /// PrivateCloudId = examplePrivateCloud.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VMware Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Avs/GetPrivateCloud.cs b/sdk/dotnet/Avs/GetPrivateCloud.cs index 8ad0609439..590b17d3b2 100644 --- a/sdk/dotnet/Avs/GetPrivateCloud.cs +++ b/sdk/dotnet/Avs/GetPrivateCloud.cs @@ -13,12 +13,70 @@ public static class GetPrivateCloud { /// /// Use this data source to access information about an existing VMware Private Cloud. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Avs.GetPrivateCloud.Invoke(new() + /// { + /// Name = "existing-vmware-private-cloud", + /// ResourceGroupName = "existing-resgroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPrivateCloudResult => getPrivateCloudResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPrivateCloudArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:avs/getPrivateCloud:getPrivateCloud", args ?? new GetPrivateCloudArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing VMware Private Cloud. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Avs.GetPrivateCloud.Invoke(new() + /// { + /// Name = "existing-vmware-private-cloud", + /// ResourceGroupName = "existing-resgroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPrivateCloudResult => getPrivateCloudResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPrivateCloudInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:avs/getPrivateCloud:getPrivateCloud", args ?? new GetPrivateCloudInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Avs/PrivateCloud.cs b/sdk/dotnet/Avs/PrivateCloud.cs index 23a42d287a..db7f916dd2 100644 --- a/sdk/dotnet/Avs/PrivateCloud.cs +++ b/sdk/dotnet/Avs/PrivateCloud.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Avs /// /// Manages a VMware Private Cloud. /// + /// ## Example Usage + /// + /// > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePrivateCloud = new Azure.Avs.PrivateCloud("examplePrivateCloud", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "av36", + /// ManagementCluster = new Azure.Avs.Inputs.PrivateCloudManagementClusterArgs + /// { + /// Size = 3, + /// }, + /// NetworkSubnetCidr = "192.168.48.0/22", + /// InternetConnectionEnabled = false, + /// NsxtPassword = "QazWsx13$Edc", + /// VcenterPassword = "WsxEdc23$Rfv", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VMware Private Clouds can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Backup/ContainerStorageAccount.cs b/sdk/dotnet/Backup/ContainerStorageAccount.cs index d45bdb2f9b..11af5d992b 100644 --- a/sdk/dotnet/Backup/ContainerStorageAccount.cs +++ b/sdk/dotnet/Backup/ContainerStorageAccount.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Backup /// /// Manages registration of a storage account with Azure Backup. Storage accounts must be registered with an Azure Recovery Vault in order to backup file shares within the storage account. Registering a storage account with a vault creates what is known as a protection container within Azure Recovery Services. Once the container is created, Azure file shares within the storage account can be backed up using the `azure.backup.ProtectedFileShare` resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = "Standard", + /// }); + /// + /// var sa = new Azure.Storage.Account("sa", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var container = new Azure.Backup.ContainerStorageAccount("container", new() + /// { + /// ResourceGroupName = example.Name, + /// RecoveryVaultName = vault.Name, + /// StorageAccountId = sa.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Storage Account Containers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Backup/GetPolicyFileshare.cs b/sdk/dotnet/Backup/GetPolicyFileshare.cs index 1e93215959..d2e11815d4 100644 --- a/sdk/dotnet/Backup/GetPolicyFileshare.cs +++ b/sdk/dotnet/Backup/GetPolicyFileshare.cs @@ -13,12 +13,60 @@ public static class GetPolicyFileshare { /// /// Use this data source to access information about an existing File Share Backup Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var policy = Azure.Backup.GetPolicyFileshare.Invoke(new() + /// { + /// Name = "policy", + /// RecoveryVaultName = "recovery_vault", + /// ResourceGroupName = "resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPolicyFileshareArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:backup/getPolicyFileshare:getPolicyFileshare", args ?? new GetPolicyFileshareArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing File Share Backup Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var policy = Azure.Backup.GetPolicyFileshare.Invoke(new() + /// { + /// Name = "policy", + /// RecoveryVaultName = "recovery_vault", + /// ResourceGroupName = "resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPolicyFileshareInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:backup/getPolicyFileshare:getPolicyFileshare", args ?? new GetPolicyFileshareInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Backup/GetPolicyVM.cs b/sdk/dotnet/Backup/GetPolicyVM.cs index 984a73d736..0a042f9006 100644 --- a/sdk/dotnet/Backup/GetPolicyVM.cs +++ b/sdk/dotnet/Backup/GetPolicyVM.cs @@ -13,12 +13,60 @@ public static class GetPolicyVM { /// /// Use this data source to access information about an existing VM Backup Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var policy = Azure.Backup.GetPolicyVM.Invoke(new() + /// { + /// Name = "policy", + /// RecoveryVaultName = "recovery_vault", + /// ResourceGroupName = "resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPolicyVMArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:backup/getPolicyVM:getPolicyVM", args ?? new GetPolicyVMArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing VM Backup Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var policy = Azure.Backup.GetPolicyVM.Invoke(new() + /// { + /// Name = "policy", + /// RecoveryVaultName = "recovery_vault", + /// ResourceGroupName = "resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPolicyVMInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:backup/getPolicyVM:getPolicyVM", args ?? new GetPolicyVMInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Backup/PolicyFileShare.cs b/sdk/dotnet/Backup/PolicyFileShare.cs index 479ccc4069..572b8f77d4 100644 --- a/sdk/dotnet/Backup/PolicyFileShare.cs +++ b/sdk/dotnet/Backup/PolicyFileShare.cs @@ -12,6 +12,88 @@ namespace Pulumi.Azure.Backup /// /// Manages an Azure File Share Backup Policy within a Recovery Services vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var policy = new Azure.Backup.PolicyFileShare("policy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = exampleVault.Name, + /// Timezone = "UTC", + /// Backup = new Azure.Backup.Inputs.PolicyFileShareBackupArgs + /// { + /// Frequency = "Daily", + /// Time = "23:00", + /// }, + /// RetentionDaily = new Azure.Backup.Inputs.PolicyFileShareRetentionDailyArgs + /// { + /// Count = 10, + /// }, + /// RetentionWeekly = new Azure.Backup.Inputs.PolicyFileShareRetentionWeeklyArgs + /// { + /// Count = 7, + /// Weekdays = new[] + /// { + /// "Sunday", + /// "Wednesday", + /// "Friday", + /// "Saturday", + /// }, + /// }, + /// RetentionMonthly = new Azure.Backup.Inputs.PolicyFileShareRetentionMonthlyArgs + /// { + /// Count = 7, + /// Weekdays = new[] + /// { + /// "Sunday", + /// "Wednesday", + /// }, + /// Weeks = new[] + /// { + /// "First", + /// "Last", + /// }, + /// }, + /// RetentionYearly = new Azure.Backup.Inputs.PolicyFileShareRetentionYearlyArgs + /// { + /// Count = 7, + /// Weekdays = new[] + /// { + /// "Sunday", + /// }, + /// Weeks = new[] + /// { + /// "Last", + /// }, + /// Months = new[] + /// { + /// "January", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure File Share Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Backup/PolicyVM.cs b/sdk/dotnet/Backup/PolicyVM.cs index bed6cddbcf..9a3bf5ea1e 100644 --- a/sdk/dotnet/Backup/PolicyVM.cs +++ b/sdk/dotnet/Backup/PolicyVM.cs @@ -12,6 +12,88 @@ namespace Pulumi.Azure.Backup /// /// Manages an Azure Backup VM Backup Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var examplePolicyVM = new Azure.Backup.PolicyVM("examplePolicyVM", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = exampleVault.Name, + /// Timezone = "UTC", + /// Backup = new Azure.Backup.Inputs.PolicyVMBackupArgs + /// { + /// Frequency = "Daily", + /// Time = "23:00", + /// }, + /// RetentionDaily = new Azure.Backup.Inputs.PolicyVMRetentionDailyArgs + /// { + /// Count = 10, + /// }, + /// RetentionWeekly = new Azure.Backup.Inputs.PolicyVMRetentionWeeklyArgs + /// { + /// Count = 42, + /// Weekdays = new[] + /// { + /// "Sunday", + /// "Wednesday", + /// "Friday", + /// "Saturday", + /// }, + /// }, + /// RetentionMonthly = new Azure.Backup.Inputs.PolicyVMRetentionMonthlyArgs + /// { + /// Count = 7, + /// Weekdays = new[] + /// { + /// "Sunday", + /// "Wednesday", + /// }, + /// Weeks = new[] + /// { + /// "First", + /// "Last", + /// }, + /// }, + /// RetentionYearly = new Azure.Backup.Inputs.PolicyVMRetentionYearlyArgs + /// { + /// Count = 77, + /// Weekdays = new[] + /// { + /// "Sunday", + /// }, + /// Weeks = new[] + /// { + /// "Last", + /// }, + /// Months = new[] + /// { + /// "January", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VM Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Backup/PolicyVMWorkload.cs b/sdk/dotnet/Backup/PolicyVMWorkload.cs index 37c8e40089..73b012d021 100644 --- a/sdk/dotnet/Backup/PolicyVMWorkload.cs +++ b/sdk/dotnet/Backup/PolicyVMWorkload.cs @@ -12,6 +12,72 @@ namespace Pulumi.Azure.Backup /// /// Manages an Azure VM Workload Backup Policy within a Recovery Services vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// SoftDeleteEnabled = false, + /// }); + /// + /// var examplePolicyVMWorkload = new Azure.Backup.PolicyVMWorkload("examplePolicyVMWorkload", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = exampleVault.Name, + /// WorkloadType = "SQLDataBase", + /// Settings = new Azure.Backup.Inputs.PolicyVMWorkloadSettingsArgs + /// { + /// TimeZone = "UTC", + /// CompressionEnabled = false, + /// }, + /// ProtectionPolicies = new[] + /// { + /// new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyArgs + /// { + /// PolicyType = "Full", + /// Backup = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyBackupArgs + /// { + /// Frequency = "Daily", + /// Time = "15:00", + /// }, + /// RetentionDaily = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs + /// { + /// Count = 8, + /// }, + /// }, + /// new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyArgs + /// { + /// PolicyType = "Log", + /// Backup = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyBackupArgs + /// { + /// FrequencyInMinutes = 15, + /// }, + /// SimpleRetention = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs + /// { + /// Count = 8, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure VM Workload Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Backup/ProtectedFileShare.cs b/sdk/dotnet/Backup/ProtectedFileShare.cs index 072c57a70c..8a05a5178b 100644 --- a/sdk/dotnet/Backup/ProtectedFileShare.cs +++ b/sdk/dotnet/Backup/ProtectedFileShare.cs @@ -12,6 +12,76 @@ namespace Pulumi.Azure.Backup /// /// Manages an Azure Backup Protected File Share to enable backups for file shares within an Azure Storage Account /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var sa = new Azure.Storage.Account("sa", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleShare = new Azure.Storage.Share("exampleShare", new() + /// { + /// StorageAccountName = sa.Name, + /// Quota = 1, + /// }); + /// + /// var protection_container = new Azure.Backup.ContainerStorageAccount("protection-container", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// StorageAccountId = sa.Id, + /// }); + /// + /// var examplePolicyFileShare = new Azure.Backup.PolicyFileShare("examplePolicyFileShare", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Backup = new Azure.Backup.Inputs.PolicyFileShareBackupArgs + /// { + /// Frequency = "Daily", + /// Time = "23:00", + /// }, + /// RetentionDaily = new Azure.Backup.Inputs.PolicyFileShareRetentionDailyArgs + /// { + /// Count = 10, + /// }, + /// }); + /// + /// var share1 = new Azure.Backup.ProtectedFileShare("share1", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// SourceStorageAccountId = protection_container.StorageAccountId, + /// SourceFileShareName = exampleShare.Name, + /// BackupPolicyId = examplePolicyFileShare.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Backup Protected File Shares can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Backup/ProtectedVM.cs b/sdk/dotnet/Backup/ProtectedVM.cs index 3312be607e..4063252de5 100644 --- a/sdk/dotnet/Backup/ProtectedVM.cs +++ b/sdk/dotnet/Backup/ProtectedVM.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.Backup /// /// Manages Azure Backup for an Azure VM /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var examplePolicyVM = new Azure.Backup.PolicyVM("examplePolicyVM", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = exampleVault.Name, + /// Backup = new Azure.Backup.Inputs.PolicyVMBackupArgs + /// { + /// Frequency = "Daily", + /// Time = "23:00", + /// }, + /// RetentionDaily = new Azure.Backup.Inputs.PolicyVMRetentionDailyArgs + /// { + /// Count = 10, + /// }, + /// }); + /// + /// var exampleVirtualMachine = Azure.Compute.GetVirtualMachine.Invoke(new() + /// { + /// Name = "example-vm", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var vm1 = new Azure.Backup.ProtectedVM("vm1", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RecoveryVaultName = exampleVault.Name, + /// SourceVmId = exampleVirtualMachine.Apply(getVirtualMachineResult => getVirtualMachineResult.Id), + /// BackupPolicyId = examplePolicyVM.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Recovery Services Protected VMs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Batch/Account.cs b/sdk/dotnet/Batch/Account.cs index b50eadc6cc..b5b17eb3d5 100644 --- a/sdk/dotnet/Batch/Account.cs +++ b/sdk/dotnet/Batch/Account.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.Batch /// /// Manages an Azure Batch account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleBatch_accountAccount = new Azure.Batch.Account("exampleBatch/accountAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PoolAllocationMode = "BatchService", + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountAuthenticationMode = "StorageKeys", + /// Tags = + /// { + /// { "env", "test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Batch Account can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Batch/Application.cs b/sdk/dotnet/Batch/Application.cs index 35f54369e9..6a28fd874a 100644 --- a/sdk/dotnet/Batch/Application.cs +++ b/sdk/dotnet/Batch/Application.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Batch /// /// Manages Azure Batch Application instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleBatch_accountAccount = new Azure.Batch.Account("exampleBatch/accountAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PoolAllocationMode = "BatchService", + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountAuthenticationMode = "StorageKeys", + /// }); + /// + /// var exampleApplication = new Azure.Batch.Application("exampleApplication", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleBatch / accountAccount.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Batch Applications can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Batch/Certificate.cs b/sdk/dotnet/Batch/Certificate.cs index 3cf48ea64b..b83dbe54c2 100644 --- a/sdk/dotnet/Batch/Certificate.cs +++ b/sdk/dotnet/Batch/Certificate.cs @@ -12,6 +12,62 @@ namespace Pulumi.Azure.Batch /// /// Manages a certificate in an Azure Batch account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleBatch_accountAccount = new Azure.Batch.Account("exampleBatch/accountAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PoolAllocationMode = "BatchService", + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountAuthenticationMode = "StorageKeys", + /// Tags = + /// { + /// { "env", "test" }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.Batch.Certificate("exampleCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleBatch / accountAccount.Name, + /// BatchCertificate = ReadFileBase64("certificate.pfx"), + /// Format = "Pfx", + /// Password = "password", + /// Thumbprint = "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + /// ThumbprintAlgorithm = "SHA1", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Batch Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Batch/GetAccount.cs b/sdk/dotnet/Batch/GetAccount.cs index 7c92d4c344..963fa3e70f 100644 --- a/sdk/dotnet/Batch/GetAccount.cs +++ b/sdk/dotnet/Batch/GetAccount.cs @@ -13,12 +13,66 @@ public static class GetAccount { /// /// Use this data source to access information about an existing Batch Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetAccount.Invoke(new() + /// { + /// Name = "testbatchaccount", + /// ResourceGroupName = "test", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["poolAllocationMode"] = example.Apply(getAccountResult => getAccountResult.PoolAllocationMode), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:batch/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Batch Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetAccount.Invoke(new() + /// { + /// Name = "testbatchaccount", + /// ResourceGroupName = "test", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["poolAllocationMode"] = example.Apply(getAccountResult => getAccountResult.PoolAllocationMode), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:batch/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Batch/GetApplication.cs b/sdk/dotnet/Batch/GetApplication.cs index 193f3c0138..d9783b228b 100644 --- a/sdk/dotnet/Batch/GetApplication.cs +++ b/sdk/dotnet/Batch/GetApplication.cs @@ -13,12 +13,68 @@ public static class GetApplication { /// /// Use this data source to access information about an existing Batch Application instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetApplication.Invoke(new() + /// { + /// Name = "testapplication", + /// ResourceGroupName = "test", + /// AccountName = "testbatchaccount", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["batchApplicationId"] = example.Apply(getApplicationResult => getApplicationResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetApplicationArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:batch/getApplication:getApplication", args ?? new GetApplicationArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Batch Application instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetApplication.Invoke(new() + /// { + /// Name = "testapplication", + /// ResourceGroupName = "test", + /// AccountName = "testbatchaccount", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["batchApplicationId"] = example.Apply(getApplicationResult => getApplicationResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetApplicationInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:batch/getApplication:getApplication", args ?? new GetApplicationInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Batch/GetCertificate.cs b/sdk/dotnet/Batch/GetCertificate.cs index f2f8c2547e..1b98072789 100644 --- a/sdk/dotnet/Batch/GetCertificate.cs +++ b/sdk/dotnet/Batch/GetCertificate.cs @@ -13,12 +13,68 @@ public static class GetCertificate { /// /// Use this data source to access information about an existing certificate in a Batch Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetCertificate.Invoke(new() + /// { + /// Name = "SHA1-42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + /// AccountName = "examplebatchaccount", + /// ResourceGroupName = "example", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["thumbprint"] = example.Apply(getCertificateResult => getCertificateResult.Thumbprint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCertificateArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:batch/getCertificate:getCertificate", args ?? new GetCertificateArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing certificate in a Batch Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetCertificate.Invoke(new() + /// { + /// Name = "SHA1-42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + /// AccountName = "examplebatchaccount", + /// ResourceGroupName = "example", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["thumbprint"] = example.Apply(getCertificateResult => getCertificateResult.Thumbprint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCertificateInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:batch/getCertificate:getCertificate", args ?? new GetCertificateInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Batch/GetPool.cs b/sdk/dotnet/Batch/GetPool.cs index fb57be0769..53e3c8f09e 100644 --- a/sdk/dotnet/Batch/GetPool.cs +++ b/sdk/dotnet/Batch/GetPool.cs @@ -13,12 +13,60 @@ public static class GetPool { /// /// Use this data source to access information about an existing Batch pool + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetPool.Invoke(new() + /// { + /// AccountName = "testbatchaccount", + /// Name = "testbatchpool", + /// ResourceGroupName = "test", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPoolArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:batch/getPool:getPool", args ?? new GetPoolArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Batch pool + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Batch.GetPool.Invoke(new() + /// { + /// AccountName = "testbatchaccount", + /// Name = "testbatchpool", + /// ResourceGroupName = "test", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPoolInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:batch/getPool:getPool", args ?? new GetPoolInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Batch/Job.cs b/sdk/dotnet/Batch/Job.cs index 4f507d30d0..1b82077272 100644 --- a/sdk/dotnet/Batch/Job.cs +++ b/sdk/dotnet/Batch/Job.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.Batch /// /// Manages a Batch Job. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAccount = new Azure.Batch.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var examplePool = new Azure.Batch.Pool("examplePool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// NodeAgentSkuId = "batch.node.ubuntu 16.04", + /// VmSize = "Standard_A1", + /// FixedScale = new Azure.Batch.Inputs.PoolFixedScaleArgs + /// { + /// TargetDedicatedNodes = 1, + /// }, + /// StorageImageReference = new Azure.Batch.Inputs.PoolStorageImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "UbuntuServer", + /// Sku = "16.04.0-LTS", + /// Version = "latest", + /// }, + /// }); + /// + /// var exampleJob = new Azure.Batch.Job("exampleJob", new() + /// { + /// BatchPoolId = examplePool.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Batch Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Batch/Pool.cs b/sdk/dotnet/Batch/Pool.cs index 0120c9f4d9..172abfa760 100644 --- a/sdk/dotnet/Batch/Pool.cs +++ b/sdk/dotnet/Batch/Pool.cs @@ -12,6 +12,130 @@ namespace Pulumi.Azure.Batch /// /// Manages an Azure Batch pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleBatch_accountAccount = new Azure.Batch.Account("exampleBatch/accountAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PoolAllocationMode = "BatchService", + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountAuthenticationMode = "StorageKeys", + /// Tags = + /// { + /// { "env", "test" }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.Batch.Certificate("exampleCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleBatch / accountAccount.Name, + /// BatchCertificate = ReadFileBase64("certificate.cer"), + /// Format = "Cer", + /// Thumbprint = "312d31a79fa0cef49c00f769afc2b73e9f4edf34", + /// ThumbprintAlgorithm = "SHA1", + /// }); + /// + /// var examplePool = new Azure.Batch.Pool("examplePool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleBatch / accountAccount.Name, + /// DisplayName = "Test Acc Pool Auto", + /// VmSize = "Standard_A1", + /// NodeAgentSkuId = "batch.node.ubuntu 20.04", + /// AutoScale = new Azure.Batch.Inputs.PoolAutoScaleArgs + /// { + /// EvaluationInterval = "PT15M", + /// Formula = @" startingNumberOfVMs = 1; + /// maxNumberofVMs = 25; + /// pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(180 * TimeInterval_Second); + /// pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(180 * TimeInterval_Second)); + /// $TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples); + /// ", + /// }, + /// StorageImageReference = new Azure.Batch.Inputs.PoolStorageImageReferenceArgs + /// { + /// Publisher = "microsoft-azure-batch", + /// Offer = "ubuntu-server-container", + /// Sku = "20-04-lts", + /// Version = "latest", + /// }, + /// ContainerConfiguration = new Azure.Batch.Inputs.PoolContainerConfigurationArgs + /// { + /// Type = "DockerCompatible", + /// ContainerRegistries = new[] + /// { + /// new Azure.Batch.Inputs.PoolContainerConfigurationContainerRegistryArgs + /// { + /// RegistryServer = "docker.io", + /// UserName = "login", + /// Password = "apassword", + /// }, + /// }, + /// }, + /// StartTask = new Azure.Batch.Inputs.PoolStartTaskArgs + /// { + /// CommandLine = "echo 'Hello World from $env'", + /// TaskRetryMaximum = 1, + /// WaitForSuccess = true, + /// CommonEnvironmentProperties = + /// { + /// { "env", "TEST" }, + /// }, + /// UserIdentity = new Azure.Batch.Inputs.PoolStartTaskUserIdentityArgs + /// { + /// AutoUser = new Azure.Batch.Inputs.PoolStartTaskUserIdentityAutoUserArgs + /// { + /// ElevationLevel = "NonAdmin", + /// Scope = "Task", + /// }, + /// }, + /// }, + /// Certificates = new[] + /// { + /// new Azure.Batch.Inputs.PoolCertificateArgs + /// { + /// Id = exampleCertificate.Id, + /// StoreLocation = "CurrentUser", + /// Visibilities = new[] + /// { + /// "StartTask", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Batch Pools can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Billing/AccountCostManagementExport.cs b/sdk/dotnet/Billing/AccountCostManagementExport.cs index b57d1a3071..74cccee82f 100644 --- a/sdk/dotnet/Billing/AccountCostManagementExport.cs +++ b/sdk/dotnet/Billing/AccountCostManagementExport.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.Billing /// /// Manages a Cost Management Export for a Billing Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleAccountCostManagementExport = new Azure.Billing.AccountCostManagementExport("exampleAccountCostManagementExport", new() + /// { + /// BillingAccountId = "example", + /// RecurrenceType = "Monthly", + /// RecurrencePeriodStartDate = "2020-08-18T00:00:00Z", + /// RecurrencePeriodEndDate = "2020-09-18T00:00:00Z", + /// ExportDataStorageLocation = new Azure.Billing.Inputs.AccountCostManagementExportExportDataStorageLocationArgs + /// { + /// ContainerId = exampleContainer.ResourceManagerId, + /// RootFolderPath = "/root/updated", + /// }, + /// ExportDataOptions = new Azure.Billing.Inputs.AccountCostManagementExportExportDataOptionsArgs + /// { + /// Type = "Usage", + /// TimeFrame = "WeekToDate", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Billing Account Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Billing/GetEnrollmentAccountScope.cs b/sdk/dotnet/Billing/GetEnrollmentAccountScope.cs index cee3e5361c..d6212d7b62 100644 --- a/sdk/dotnet/Billing/GetEnrollmentAccountScope.cs +++ b/sdk/dotnet/Billing/GetEnrollmentAccountScope.cs @@ -13,12 +13,66 @@ public static class GetEnrollmentAccountScope { /// /// Use this data source to access information about an existing Enrollment Account Billing Scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Billing.GetEnrollmentAccountScope.Invoke(new() + /// { + /// BillingAccountName = "existing", + /// EnrollmentAccountName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getEnrollmentAccountScopeResult => getEnrollmentAccountScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEnrollmentAccountScopeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:billing/getEnrollmentAccountScope:getEnrollmentAccountScope", args ?? new GetEnrollmentAccountScopeArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Enrollment Account Billing Scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Billing.GetEnrollmentAccountScope.Invoke(new() + /// { + /// BillingAccountName = "existing", + /// EnrollmentAccountName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getEnrollmentAccountScopeResult => getEnrollmentAccountScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEnrollmentAccountScopeInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:billing/getEnrollmentAccountScope:getEnrollmentAccountScope", args ?? new GetEnrollmentAccountScopeInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Billing/GetMcaAccountScope.cs b/sdk/dotnet/Billing/GetMcaAccountScope.cs index d98dd78039..56b19be23f 100644 --- a/sdk/dotnet/Billing/GetMcaAccountScope.cs +++ b/sdk/dotnet/Billing/GetMcaAccountScope.cs @@ -13,12 +13,68 @@ public static class GetMcaAccountScope { /// /// Use this data source to access an ID for your MCA Account billing scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Billing.GetMcaAccountScope.Invoke(new() + /// { + /// BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + /// BillingProfileName = "PE2Q-NOIT-BG7-TGB", + /// InvoiceSectionName = "MTT4-OBS7-PJA-TGB", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getMcaAccountScopeResult => getMcaAccountScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetMcaAccountScopeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:billing/getMcaAccountScope:getMcaAccountScope", args ?? new GetMcaAccountScopeArgs(), options.WithDefaults()); /// /// Use this data source to access an ID for your MCA Account billing scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Billing.GetMcaAccountScope.Invoke(new() + /// { + /// BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + /// BillingProfileName = "PE2Q-NOIT-BG7-TGB", + /// InvoiceSectionName = "MTT4-OBS7-PJA-TGB", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getMcaAccountScopeResult => getMcaAccountScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetMcaAccountScopeInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:billing/getMcaAccountScope:getMcaAccountScope", args ?? new GetMcaAccountScopeInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Billing/GetMpaAccountScope.cs b/sdk/dotnet/Billing/GetMpaAccountScope.cs index 7d89deaf9d..ded3556dc3 100644 --- a/sdk/dotnet/Billing/GetMpaAccountScope.cs +++ b/sdk/dotnet/Billing/GetMpaAccountScope.cs @@ -13,12 +13,66 @@ public static class GetMpaAccountScope { /// /// Use this data source to access an ID for your MPA Account billing scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Billing.GetMpaAccountScope.Invoke(new() + /// { + /// BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + /// CustomerName = "2281f543-7321-4cf9-1e23-edb4Oc31a31c", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getMpaAccountScopeResult => getMpaAccountScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetMpaAccountScopeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:billing/getMpaAccountScope:getMpaAccountScope", args ?? new GetMpaAccountScopeArgs(), options.WithDefaults()); /// /// Use this data source to access an ID for your MPA Account billing scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Billing.GetMpaAccountScope.Invoke(new() + /// { + /// BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + /// CustomerName = "2281f543-7321-4cf9-1e23-edb4Oc31a31c", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getMpaAccountScopeResult => getMpaAccountScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetMpaAccountScopeInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:billing/getMpaAccountScope:getMpaAccountScope", args ?? new GetMpaAccountScopeInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Blueprint/Assignment.cs b/sdk/dotnet/Blueprint/Assignment.cs index c2d6eedd25..e93302005c 100644 --- a/sdk/dotnet/Blueprint/Assignment.cs +++ b/sdk/dotnet/Blueprint/Assignment.cs @@ -16,6 +16,104 @@ namespace Pulumi.Azure.Blueprint /// /// > **NOTE:** Azure Blueprint Assignments can only be applied to Subscriptions. Assignments to Management Groups is not currently supported by the service or by this provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleSubscription = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleDefinition = Azure.Blueprint.GetDefinition.Invoke(new() + /// { + /// Name = "exampleBlueprint", + /// ScopeId = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }); + /// + /// var examplePublishedVersion = Azure.Blueprint.GetPublishedVersion.Invoke(new() + /// { + /// ScopeId = exampleDefinition.Apply(getDefinitionResult => getDefinitionResult.ScopeId), + /// BlueprintName = exampleDefinition.Apply(getDefinitionResult => getDefinitionResult.Name), + /// Version = "v1.0.0", + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// Tags = + /// { + /// { "Environment", "example" }, + /// }, + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var @operator = new Azure.Authorization.Assignment("operator", new() + /// { + /// Scope = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionName = "Blueprint Operator", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var owner = new Azure.Authorization.Assignment("owner", new() + /// { + /// Scope = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionName = "Owner", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var exampleAssignment = new Azure.Blueprint.Assignment("exampleAssignment", new() + /// { + /// TargetSubscriptionId = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// VersionId = examplePublishedVersion.Apply(getPublishedVersionResult => getPublishedVersionResult.Id), + /// Location = exampleResourceGroup.Location, + /// LockMode = "AllResourcesDoNotDelete", + /// LockExcludePrincipals = new[] + /// { + /// current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }, + /// Identity = new Azure.Blueprint.Inputs.AssignmentIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// ResourceGroups = @" { + /// ""ResourceGroup"": { + /// ""name"": ""exampleRG-bp"" + /// } + /// } + /// ", + /// ParameterValues = @" { + /// ""allowedlocationsforresourcegroups_listOfAllowedLocations"": { + /// ""value"": [""westus"", ""westus2"", ""eastus"", ""centralus"", ""centraluseuap"", ""southcentralus"", ""northcentralus"", ""westcentralus"", ""eastus2"", ""eastus2euap"", ""brazilsouth"", ""brazilus"", ""northeurope"", ""westeurope"", ""eastasia"", ""southeastasia"", ""japanwest"", ""japaneast"", ""koreacentral"", ""koreasouth"", ""indiasouth"", ""indiawest"", ""indiacentral"", ""australiaeast"", ""australiasoutheast"", ""canadacentral"", ""canadaeast"", ""uknorth"", ""uksouth2"", ""uksouth"", ""ukwest"", ""francecentral"", ""francesouth"", ""australiacentral"", ""australiacentral2"", ""uaecentral"", ""uaenorth"", ""southafricanorth"", ""southafricawest"", ""switzerlandnorth"", ""switzerlandwest"", ""germanynorth"", ""germanywestcentral"", ""norwayeast"", ""norwaywest""] + /// } + /// } + /// ", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// @operator, + /// owner, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Blueprint Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Blueprint/GetDefinition.cs b/sdk/dotnet/Blueprint/GetDefinition.cs index 6378b43279..8255aa00d9 100644 --- a/sdk/dotnet/Blueprint/GetDefinition.cs +++ b/sdk/dotnet/Blueprint/GetDefinition.cs @@ -15,6 +15,36 @@ public static class GetDefinition /// Use this data source to access information about an existing Azure Blueprint Definition /// /// > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var root = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }); + /// + /// var example = Azure.Blueprint.GetDefinition.Invoke(new() + /// { + /// Name = "exampleManagementGroupBP", + /// ScopeId = root.Apply(getGroupResult => getGroupResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDefinitionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:blueprint/getDefinition:getDefinition", args ?? new GetDefinitionArgs(), options.WithDefaults()); @@ -23,6 +53,36 @@ public static Task InvokeAsync(GetDefinitionArgs args, Invo /// Use this data source to access information about an existing Azure Blueprint Definition /// /// > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var root = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }); + /// + /// var example = Azure.Blueprint.GetDefinition.Invoke(new() + /// { + /// Name = "exampleManagementGroupBP", + /// ScopeId = root.Apply(getGroupResult => getGroupResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDefinitionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:blueprint/getDefinition:getDefinition", args ?? new GetDefinitionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Blueprint/GetPublishedVersion.cs b/sdk/dotnet/Blueprint/GetPublishedVersion.cs index 51a0dc9abb..f964f65890 100644 --- a/sdk/dotnet/Blueprint/GetPublishedVersion.cs +++ b/sdk/dotnet/Blueprint/GetPublishedVersion.cs @@ -15,6 +15,32 @@ public static class GetPublishedVersion /// Use this data source to access information about an existing Blueprint Published Version /// /// > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var test = Azure.Blueprint.GetPublishedVersion.Invoke(new() + /// { + /// ScopeId = current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// BlueprintName = "exampleBluePrint", + /// Version = "dev_v2.3", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPublishedVersionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:blueprint/getPublishedVersion:getPublishedVersion", args ?? new GetPublishedVersionArgs(), options.WithDefaults()); @@ -23,6 +49,32 @@ public static Task InvokeAsync(GetPublishedVersionArg /// Use this data source to access information about an existing Blueprint Published Version /// /// > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var test = Azure.Blueprint.GetPublishedVersion.Invoke(new() + /// { + /// ScopeId = current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// BlueprintName = "exampleBluePrint", + /// Version = "dev_v2.3", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPublishedVersionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:blueprint/getPublishedVersion:getPublishedVersion", args ?? new GetPublishedVersionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Bot/ChannelAlexa.cs b/sdk/dotnet/Bot/ChannelAlexa.cs index c3755d21cf..ad627eba54 100644 --- a/sdk/dotnet/Bot/ChannelAlexa.cs +++ b/sdk/dotnet/Bot/ChannelAlexa.cs @@ -14,6 +14,42 @@ namespace Pulumi.Azure.Bot /// /// > **Note** A bot can only have a single Alexa Channel associated with it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelAlexa = new Azure.Bot.ChannelAlexa("exampleChannelAlexa", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkillId = "amzn1.ask.skill.00000000-0000-0000-0000-000000000000", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Alexa Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelDirectLine.cs b/sdk/dotnet/Bot/ChannelDirectLine.cs index ca489f9c96..dea6f49dff 100644 --- a/sdk/dotnet/Bot/ChannelDirectLine.cs +++ b/sdk/dotnet/Bot/ChannelDirectLine.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Bot /// /// Manages a Directline integration for a Bot Channel /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelDirectLine = new Azure.Bot.ChannelDirectLine("exampleChannelDirectLine", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sites = new[] + /// { + /// new Azure.Bot.Inputs.ChannelDirectLineSiteArgs + /// { + /// Name = "default", + /// Enabled = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Directline Channel for a Bot can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelDirectLineSpeech.cs b/sdk/dotnet/Bot/ChannelDirectLineSpeech.cs index 6755b9e866..89a3d2423c 100644 --- a/sdk/dotnet/Bot/ChannelDirectLineSpeech.cs +++ b/sdk/dotnet/Bot/ChannelDirectLineSpeech.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.Bot /// /// Manages a Direct Line Speech integration for a Bot Channel /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Cognitive.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "SpeechServices", + /// SkuName = "S0", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelDirectLineSpeech = new Azure.Bot.ChannelDirectLineSpeech("exampleChannelDirectLineSpeech", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// CognitiveServiceLocation = exampleAccount.Location, + /// CognitiveServiceAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Direct Line Speech Channels can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelEmail.cs b/sdk/dotnet/Bot/ChannelEmail.cs index fdc28873ca..800855dac7 100644 --- a/sdk/dotnet/Bot/ChannelEmail.cs +++ b/sdk/dotnet/Bot/ChannelEmail.cs @@ -14,6 +14,43 @@ namespace Pulumi.Azure.Bot /// /// > **Note** A bot can only have a single Email Channel associated with it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelEmail = new Azure.Bot.ChannelEmail("exampleChannelEmail", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// EmailAddress = "example.com", + /// EmailPassword = "123456", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Email Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelFacebook.cs b/sdk/dotnet/Bot/ChannelFacebook.cs index 018c251117..573e0810b3 100644 --- a/sdk/dotnet/Bot/ChannelFacebook.cs +++ b/sdk/dotnet/Bot/ChannelFacebook.cs @@ -14,6 +14,51 @@ namespace Pulumi.Azure.Bot /// /// > **Note** A bot can only have a single Facebook Channel associated with it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelFacebook = new Azure.Bot.ChannelFacebook("exampleChannelFacebook", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FacebookApplicationId = "563490254873576", + /// FacebookApplicationSecret = "8976d2536445ad5b976dee8437b9beb0", + /// Pages = new[] + /// { + /// new Azure.Bot.Inputs.ChannelFacebookPageArgs + /// { + /// Id = "876248795081953", + /// AccessToken = "CGGCec3UAFPMBAKwK3Ft8SEpO8ZCuvpNBI5DClaJCDfqJj2BgEHCKxcY0FDarmUQap6XxpZC9GWCW4nZCzjcKosAZAP7SO44X8Q8gAntbDIXgYUBGp9xtS8wUkwgKPobUePcOOVFkvClxvYZByuiQxoTiK9fQ9jZCPEorbmZCsKDZAx4VLnrNwCTZAPUwXxO61gfq4ZD", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Facebook Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelLine.cs b/sdk/dotnet/Bot/ChannelLine.cs index 155ce66cad..499d6b04d9 100644 --- a/sdk/dotnet/Bot/ChannelLine.cs +++ b/sdk/dotnet/Bot/ChannelLine.cs @@ -14,6 +14,49 @@ namespace Pulumi.Azure.Bot /// /// > **Note** A bot can only have a single Line Channel associated with it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelLine = new Azure.Bot.ChannelLine("exampleChannelLine", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LineChannels = new[] + /// { + /// new Azure.Bot.Inputs.ChannelLineLineChannelArgs + /// { + /// AccessToken = "asdfdsdfTYUIOIoj1231hkjhk", + /// Secret = "aagfdgfd123567", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Line Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelSlack.cs b/sdk/dotnet/Bot/ChannelSlack.cs index b2c2c186e4..c74d443d69 100644 --- a/sdk/dotnet/Bot/ChannelSlack.cs +++ b/sdk/dotnet/Bot/ChannelSlack.cs @@ -14,6 +14,44 @@ namespace Pulumi.Azure.Bot /// /// > **Note** A bot can only have a single Slack Channel associated with it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelSlack = new Azure.Bot.ChannelSlack("exampleChannelSlack", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClientId = "exampleId", + /// ClientSecret = "exampleSecret", + /// VerificationToken = "exampleVerificationToken", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Slack Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelSms.cs b/sdk/dotnet/Bot/ChannelSms.cs index b2cf29138c..81a9efdb72 100644 --- a/sdk/dotnet/Bot/ChannelSms.cs +++ b/sdk/dotnet/Bot/ChannelSms.cs @@ -14,6 +14,44 @@ namespace Pulumi.Azure.Bot /// /// > **Note** A bot can only have a single SMS Channel associated with it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelSms = new Azure.Bot.ChannelSms("exampleChannelSms", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SmsChannelAccountSecurityId = "BG61f7cf5157f439b084e98256409c2815", + /// SmsChannelAuthToken = "jh8980432610052ed4e29565c5e232f", + /// PhoneNumber = "+12313803556", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The SMS Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelTeams.cs b/sdk/dotnet/Bot/ChannelTeams.cs index d0f582bbe3..36cd994dff 100644 --- a/sdk/dotnet/Bot/ChannelTeams.cs +++ b/sdk/dotnet/Bot/ChannelTeams.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.Bot /// /// > **Note** A bot can only have a single MS Teams Channel associated with it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelTeams = new Azure.Bot.ChannelTeams("exampleChannelTeams", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Microsoft Teams Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelWebChat.cs b/sdk/dotnet/Bot/ChannelWebChat.cs index 595700c003..4b503cfd06 100644 --- a/sdk/dotnet/Bot/ChannelWebChat.cs +++ b/sdk/dotnet/Bot/ChannelWebChat.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.Bot /// /// Manages a Web Chat integration for a Bot Channel /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleChannelWebChat = new Azure.Bot.ChannelWebChat("exampleChannelWebChat", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sites = new[] + /// { + /// new Azure.Bot.Inputs.ChannelWebChatSiteArgs + /// { + /// Name = "TestSite", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Web Chat Channels can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ChannelsRegistration.cs b/sdk/dotnet/Bot/ChannelsRegistration.cs index 2b09ddc06c..359e8ec92a 100644 --- a/sdk/dotnet/Bot/ChannelsRegistration.cs +++ b/sdk/dotnet/Bot/ChannelsRegistration.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Bot /// /// Manages a Bot Channels Registration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Bot Channels Registration can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/Connection.cs b/sdk/dotnet/Bot/Connection.cs index e794cc9a5b..81e78ffcbd 100644 --- a/sdk/dotnet/Bot/Connection.cs +++ b/sdk/dotnet/Bot/Connection.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Bot /// /// Manages a Bot Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("exampleChannelsRegistration", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// var exampleConnection = new Azure.Bot.Connection("exampleConnection", new() + /// { + /// BotName = exampleChannelsRegistration.Name, + /// Location = exampleChannelsRegistration.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceProviderName = "box", + /// ClientId = "exampleId", + /// ClientSecret = "exampleSecret", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Bot Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/Healthbot.cs b/sdk/dotnet/Bot/Healthbot.cs index a36ef48568..15039e5a9b 100644 --- a/sdk/dotnet/Bot/Healthbot.cs +++ b/sdk/dotnet/Bot/Healthbot.cs @@ -12,6 +12,31 @@ namespace Pulumi.Azure.Bot /// /// Manages a Healthbot Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleHealthbot = new Azure.Bot.Healthbot("exampleHealthbot", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "F0", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Healthbot Service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/ServiceAzureBot.cs b/sdk/dotnet/Bot/ServiceAzureBot.cs index e362b6d2ec..fbef36009f 100644 --- a/sdk/dotnet/Bot/ServiceAzureBot.cs +++ b/sdk/dotnet/Bot/ServiceAzureBot.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.Bot /// /// Manages an Azure Bot Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleApiKey = new Azure.AppInsights.ApiKey("exampleApiKey", new() + /// { + /// ApplicationInsightsId = exampleInsights.Id, + /// ReadPermissions = new[] + /// { + /// "aggregate", + /// "api", + /// "draft", + /// "extendqueries", + /// "search", + /// }, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleServiceAzureBot = new Azure.Bot.ServiceAzureBot("exampleServiceAzureBot", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "global", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// Sku = "F0", + /// Endpoint = "https://example.com", + /// DeveloperAppInsightsApiKey = exampleApiKey.ApiKey, + /// DeveloperAppInsightsApplicationId = exampleInsights.AppId, + /// Tags = + /// { + /// { "environment", "test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Bot Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Bot/WebApp.cs b/sdk/dotnet/Bot/WebApp.cs index 5aefca9363..50760d00df 100644 --- a/sdk/dotnet/Bot/WebApp.cs +++ b/sdk/dotnet/Bot/WebApp.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Bot /// /// Manages a Bot Web App. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWebApp = new Azure.Bot.WebApp("exampleWebApp", new() + /// { + /// Location = "global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "F0", + /// MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Bot Web App's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/Endpoint.cs b/sdk/dotnet/Cdn/Endpoint.cs index d4bdedfa1a..e8129e82eb 100644 --- a/sdk/dotnet/Cdn/Endpoint.cs +++ b/sdk/dotnet/Cdn/Endpoint.cs @@ -10,6 +10,46 @@ namespace Pulumi.Azure.Cdn { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleProfile = new Azure.Cdn.Profile("exampleProfile", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard_Verizon", + /// }); + /// + /// var exampleEndpoint = new Azure.Cdn.Endpoint("exampleEndpoint", new() + /// { + /// ProfileName = exampleProfile.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Origins = new[] + /// { + /// new Azure.Cdn.Inputs.EndpointOriginArgs + /// { + /// Name = "example", + /// HostName = "www.contoso.com", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CDN Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/EndpointCustomDomain.cs b/sdk/dotnet/Cdn/EndpointCustomDomain.cs index a40b07f612..c9abf09d6b 100644 --- a/sdk/dotnet/Cdn/EndpointCustomDomain.cs +++ b/sdk/dotnet/Cdn/EndpointCustomDomain.cs @@ -12,6 +12,79 @@ namespace Pulumi.Azure.Cdn /// /// Manages a Custom Domain for a CDN Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleProfile = new Azure.Cdn.Profile("exampleProfile", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard_Verizon", + /// }); + /// + /// var exampleEndpoint = new Azure.Cdn.Endpoint("exampleEndpoint", new() + /// { + /// ProfileName = exampleProfile.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Origins = new[] + /// { + /// new Azure.Cdn.Inputs.EndpointOriginArgs + /// { + /// Name = "example", + /// HostName = exampleAccount.PrimaryBlobHost, + /// }, + /// }, + /// }); + /// + /// var exampleZone = Azure.Dns.GetZone.Invoke(new() + /// { + /// Name = "example-domain.com", + /// ResourceGroupName = "domain-rg", + /// }); + /// + /// var exampleCNameRecord = new Azure.Dns.CNameRecord("exampleCNameRecord", new() + /// { + /// ZoneName = exampleZone.Apply(getZoneResult => getZoneResult.Name), + /// ResourceGroupName = exampleZone.Apply(getZoneResult => getZoneResult.ResourceGroupName), + /// Ttl = 3600, + /// TargetResourceId = exampleEndpoint.Id, + /// }); + /// + /// var exampleEndpointCustomDomain = new Azure.Cdn.EndpointCustomDomain("exampleEndpointCustomDomain", new() + /// { + /// CdnEndpointId = exampleEndpoint.Id, + /// HostName = Output.Tuple(exampleCNameRecord.Name, exampleZone).Apply(values => + /// { + /// var name = values.Item1; + /// var exampleZone = values.Item2; + /// return $"{name}.{exampleZone.Apply(getZoneResult => getZoneResult.Name)}"; + /// }), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CDN Endpoint Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorCustomDomain.cs b/sdk/dotnet/Cdn/FrontdoorCustomDomain.cs index 50c1b5c83d..b729103de3 100644 --- a/sdk/dotnet/Cdn/FrontdoorCustomDomain.cs +++ b/sdk/dotnet/Cdn/FrontdoorCustomDomain.cs @@ -10,6 +10,76 @@ namespace Pulumi.Azure.Cdn { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("exampleFrontdoorProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard_AzureFrontDoor", + /// }); + /// + /// var exampleFrontdoorCustomDomain = new Azure.Cdn.FrontdoorCustomDomain("exampleFrontdoorCustomDomain", new() + /// { + /// CdnFrontdoorProfileId = exampleFrontdoorProfile.Id, + /// DnsZoneId = exampleZone.Id, + /// HostName = "contoso.fabrikam.com", + /// Tls = new Azure.Cdn.Inputs.FrontdoorCustomDomainTlsArgs + /// { + /// CertificateType = "ManagedCertificate", + /// MinimumTlsVersion = "TLS12", + /// }, + /// }); + /// + /// }); + /// ``` + /// ## Example CNAME Record Usage + /// + /// !>**IMPORTANT:** You **must** include the `depends_on` meta-argument which references both the `azure.cdn.FrontdoorRoute` and the `azure.cdn.FrontdoorSecurityPolicy` that are associated with your Custom Domain. The reason for these `depends_on` meta-arguments is because all of the resources for the Custom Domain need to be associated within Front Door before the CNAME record can be written to the domains DNS, else the CNAME validation will fail and Front Door will not enable traffic to the Domain. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.CNameRecord("example", new() + /// { + /// ZoneName = azurerm_dns_zone.Example.Name, + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// Ttl = 3600, + /// Record = azurerm_cdn_frontdoor_endpoint.Example.Host_name, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// azurerm_cdn_frontdoor_route.Example, + /// azurerm_cdn_frontdoor_security_policy.Example, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Door Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorEndpoint.cs b/sdk/dotnet/Cdn/FrontdoorEndpoint.cs index fd0aebcfec..6d6f7f94e7 100644 --- a/sdk/dotnet/Cdn/FrontdoorEndpoint.cs +++ b/sdk/dotnet/Cdn/FrontdoorEndpoint.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.Cdn /// /// Manages a Front Door (standard/premium) Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("exampleFrontdoorProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard_AzureFrontDoor", + /// }); + /// + /// var exampleFrontdoorEndpoint = new Azure.Cdn.FrontdoorEndpoint("exampleFrontdoorEndpoint", new() + /// { + /// CdnFrontdoorProfileId = exampleFrontdoorProfile.Id, + /// Tags = + /// { + /// { "ENV", "example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Door Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorFirewallPolicy.cs b/sdk/dotnet/Cdn/FrontdoorFirewallPolicy.cs index f9c83934c5..e8fd517cab 100644 --- a/sdk/dotnet/Cdn/FrontdoorFirewallPolicy.cs +++ b/sdk/dotnet/Cdn/FrontdoorFirewallPolicy.cs @@ -12,6 +12,176 @@ namespace Pulumi.Azure.Cdn /// /// Manages a Front Door (standard/premium) Firewall Policy instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("exampleFrontdoorProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Premium_AzureFrontDoor", + /// }); + /// + /// var exampleFrontdoorFirewallPolicy = new Azure.Cdn.FrontdoorFirewallPolicy("exampleFrontdoorFirewallPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = exampleFrontdoorProfile.SkuName, + /// Enabled = true, + /// Mode = "Prevention", + /// RedirectUrl = "https://www.contoso.com", + /// CustomBlockResponseStatusCode = 403, + /// CustomBlockResponseBody = "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + /// CustomRules = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyCustomRuleArgs + /// { + /// Name = "Rule1", + /// Enabled = true, + /// Priority = 1, + /// RateLimitDurationInMinutes = 1, + /// RateLimitThreshold = 10, + /// Type = "MatchRule", + /// Action = "Block", + /// MatchConditions = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariable = "RemoteAddr", + /// Operator = "IPMatch", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "10.0.1.0/24", + /// "10.0.0.0/24", + /// }, + /// }, + /// }, + /// }, + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyCustomRuleArgs + /// { + /// Name = "Rule2", + /// Enabled = true, + /// Priority = 2, + /// RateLimitDurationInMinutes = 1, + /// RateLimitThreshold = 10, + /// Type = "MatchRule", + /// Action = "Block", + /// MatchConditions = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariable = "RemoteAddr", + /// Operator = "IPMatch", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }, + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariable = "RequestHeader", + /// Selector = "UserAgent", + /// Operator = "Contains", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "windows", + /// }, + /// Transforms = new[] + /// { + /// "Lowercase", + /// "Trim", + /// }, + /// }, + /// }, + /// }, + /// }, + /// ManagedRules = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleArgs + /// { + /// Type = "DefaultRuleSet", + /// Version = "1.0", + /// Exclusions = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleExclusionArgs + /// { + /// MatchVariable = "QueryStringArgNames", + /// Operator = "Equals", + /// Selector = "not_suspicious", + /// }, + /// }, + /// Overrides = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleOverrideArgs + /// { + /// RuleGroupName = "PHP", + /// Rules = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs + /// { + /// RuleId = "933100", + /// Enabled = false, + /// Action = "Block", + /// }, + /// }, + /// }, + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleOverrideArgs + /// { + /// RuleGroupName = "SQLI", + /// Exclusions = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleOverrideExclusionArgs + /// { + /// MatchVariable = "QueryStringArgNames", + /// Operator = "Equals", + /// Selector = "really_not_suspicious", + /// }, + /// }, + /// Rules = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs + /// { + /// RuleId = "942200", + /// Action = "Block", + /// Exclusions = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleOverrideRuleExclusionArgs + /// { + /// MatchVariable = "QueryStringArgNames", + /// Operator = "Equals", + /// Selector = "innocent", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// new Azure.Cdn.Inputs.FrontdoorFirewallPolicyManagedRuleArgs + /// { + /// Type = "Microsoft_BotManagerRuleSet", + /// Version = "1.0", + /// Action = "Log", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Door Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorOriginGroup.cs b/sdk/dotnet/Cdn/FrontdoorOriginGroup.cs index 11c6d2366c..651505e57d 100644 --- a/sdk/dotnet/Cdn/FrontdoorOriginGroup.cs +++ b/sdk/dotnet/Cdn/FrontdoorOriginGroup.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Cdn /// /// Manages a Front Door (standard/premium) Origin Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("exampleFrontdoorProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard_AzureFrontDoor", + /// }); + /// + /// var exampleFrontdoorOriginGroup = new Azure.Cdn.FrontdoorOriginGroup("exampleFrontdoorOriginGroup", new() + /// { + /// CdnFrontdoorProfileId = exampleFrontdoorProfile.Id, + /// SessionAffinityEnabled = true, + /// RestoreTrafficTimeToHealedOrNewEndpointInMinutes = 10, + /// HealthProbe = new Azure.Cdn.Inputs.FrontdoorOriginGroupHealthProbeArgs + /// { + /// IntervalInSeconds = 240, + /// Path = "/healthProbe", + /// Protocol = "Https", + /// RequestType = "HEAD", + /// }, + /// LoadBalancing = new Azure.Cdn.Inputs.FrontdoorOriginGroupLoadBalancingArgs + /// { + /// AdditionalLatencyInMilliseconds = 0, + /// SampleSize = 16, + /// SuccessfulSamplesRequired = 3, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Door Origin Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorProfile.cs b/sdk/dotnet/Cdn/FrontdoorProfile.cs index 9453289d9d..233019c44f 100644 --- a/sdk/dotnet/Cdn/FrontdoorProfile.cs +++ b/sdk/dotnet/Cdn/FrontdoorProfile.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Cdn /// /// Manages a Front Door (standard/premium) Profile which contains a collection of endpoints and origin groups. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("exampleFrontdoorProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard_AzureFrontDoor", + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Door Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorRouteDisableLinkToDefaultDomain.cs b/sdk/dotnet/Cdn/FrontdoorRouteDisableLinkToDefaultDomain.cs index 96ad9e63bd..9047c8add9 100644 --- a/sdk/dotnet/Cdn/FrontdoorRouteDisableLinkToDefaultDomain.cs +++ b/sdk/dotnet/Cdn/FrontdoorRouteDisableLinkToDefaultDomain.cs @@ -14,6 +14,29 @@ namespace Pulumi.Azure.Cdn /// /// !>**IMPORTANT:** This resource has been deprecated and should not be used for new deployments. The `azure.cdn.FrontdoorRouteDisableLinkToDefaultDomain` resource will be removed from the 4.0 AzureRM provider. Please use the `link_to_default_domain` field in the `azure.cdn.FrontdoorRoute` resource to control this value. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Cdn.FrontdoorRouteDisableLinkToDefaultDomain("example", new() + /// { + /// CdnFrontdoorRouteId = azurerm_cdn_frontdoor_route.Example.Id, + /// CdnFrontdoorCustomDomainIds = new[] + /// { + /// azurerm_cdn_frontdoor_custom_domain.Contoso.Id, + /// azurerm_cdn_frontdoor_custom_domain.Fabrikam.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// FrontDoor Route Disable Link To Default Domain can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorRuleSet.cs b/sdk/dotnet/Cdn/FrontdoorRuleSet.cs index fcc2583e8a..9a38a22ce3 100644 --- a/sdk/dotnet/Cdn/FrontdoorRuleSet.cs +++ b/sdk/dotnet/Cdn/FrontdoorRuleSet.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Cdn /// /// Manages a Front Door (standard/premium) Rule Set. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("exampleFrontdoorProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard_AzureFrontDoor", + /// }); + /// + /// var exampleFrontdoorRuleSet = new Azure.Cdn.FrontdoorRuleSet("exampleFrontdoorRuleSet", new() + /// { + /// CdnFrontdoorProfileId = exampleFrontdoorProfile.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Door Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/FrontdoorSecret.cs b/sdk/dotnet/Cdn/FrontdoorSecret.cs index f622eb7a7e..5064331641 100644 --- a/sdk/dotnet/Cdn/FrontdoorSecret.cs +++ b/sdk/dotnet/Cdn/FrontdoorSecret.cs @@ -12,6 +12,114 @@ namespace Pulumi.Azure.Cdn /// /// Manages a Front Door (standard/premium) Secret. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var frontdoor = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "Microsoft.Azure.Cdn", + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// SoftDeleteRetentionDays = 7, + /// NetworkAcls = new Azure.KeyVault.Inputs.KeyVaultNetworkAclsArgs + /// { + /// DefaultAction = "Deny", + /// Bypass = "AzureServices", + /// IpRules = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// }, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = frontdoor.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Get", + /// "Import", + /// "Delete", + /// "Purge", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs + /// { + /// Contents = ReadFileBase64("my-certificate.pfx"), + /// }, + /// }); + /// + /// var exampleFrontdoorProfile = new Azure.Cdn.FrontdoorProfile("exampleFrontdoorProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard_AzureFrontDoor", + /// }); + /// + /// var exampleFrontdoorSecret = new Azure.Cdn.FrontdoorSecret("exampleFrontdoorSecret", new() + /// { + /// CdnFrontdoorProfileId = exampleFrontdoorProfile.Id, + /// Secret = new Azure.Cdn.Inputs.FrontdoorSecretSecretArgs + /// { + /// CustomerCertificates = new[] + /// { + /// new Azure.Cdn.Inputs.FrontdoorSecretSecretCustomerCertificateArgs + /// { + /// KeyVaultCertificateId = exampleCertificate.Id, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Door Secrets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cdn/GetFrontdoorCustomDomain.cs b/sdk/dotnet/Cdn/GetFrontdoorCustomDomain.cs index aa46c0a6df..f0d8160978 100644 --- a/sdk/dotnet/Cdn/GetFrontdoorCustomDomain.cs +++ b/sdk/dotnet/Cdn/GetFrontdoorCustomDomain.cs @@ -13,12 +13,60 @@ public static class GetFrontdoorCustomDomain { /// /// Use this data source to access information about an existing Front Door (standard/premium) Custom Domain. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorCustomDomain.Invoke(new() + /// { + /// Name = azurerm_cdn_frontdoor_custom_domain.Example.Name, + /// ProfileName = azurerm_cdn_frontdoor_profile.Example.Name, + /// ResourceGroupName = azurerm_cdn_frontdoor_profile.Example.Resource_group_name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFrontdoorCustomDomainArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getFrontdoorCustomDomain:getFrontdoorCustomDomain", args ?? new GetFrontdoorCustomDomainArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Front Door (standard/premium) Custom Domain. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorCustomDomain.Invoke(new() + /// { + /// Name = azurerm_cdn_frontdoor_custom_domain.Example.Name, + /// ProfileName = azurerm_cdn_frontdoor_profile.Example.Name, + /// ResourceGroupName = azurerm_cdn_frontdoor_profile.Example.Resource_group_name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFrontdoorCustomDomainInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getFrontdoorCustomDomain:getFrontdoorCustomDomain", args ?? new GetFrontdoorCustomDomainInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/GetFrontdoorEndpoint.cs b/sdk/dotnet/Cdn/GetFrontdoorEndpoint.cs index cc496e3d4c..29f566e93d 100644 --- a/sdk/dotnet/Cdn/GetFrontdoorEndpoint.cs +++ b/sdk/dotnet/Cdn/GetFrontdoorEndpoint.cs @@ -13,12 +13,60 @@ public static class GetFrontdoorEndpoint { /// /// Use this data source to access information about an existing Front Door (standard/premium) Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorEndpoint.Invoke(new() + /// { + /// Name = "existing-endpoint", + /// ProfileName = "existing-cdn-profile", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFrontdoorEndpointArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getFrontdoorEndpoint:getFrontdoorEndpoint", args ?? new GetFrontdoorEndpointArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Front Door (standard/premium) Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorEndpoint.Invoke(new() + /// { + /// Name = "existing-endpoint", + /// ProfileName = "existing-cdn-profile", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFrontdoorEndpointInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getFrontdoorEndpoint:getFrontdoorEndpoint", args ?? new GetFrontdoorEndpointInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/GetFrontdoorFirewallPolicy.cs b/sdk/dotnet/Cdn/GetFrontdoorFirewallPolicy.cs index e38cd2621f..c68a006cca 100644 --- a/sdk/dotnet/Cdn/GetFrontdoorFirewallPolicy.cs +++ b/sdk/dotnet/Cdn/GetFrontdoorFirewallPolicy.cs @@ -13,12 +13,58 @@ public static class GetFrontdoorFirewallPolicy { /// /// Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorFirewallPolicy.Invoke(new() + /// { + /// Name = "examplecdnfdwafpolicy", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFrontdoorFirewallPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getFrontdoorFirewallPolicy:getFrontdoorFirewallPolicy", args ?? new GetFrontdoorFirewallPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorFirewallPolicy.Invoke(new() + /// { + /// Name = "examplecdnfdwafpolicy", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFrontdoorFirewallPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getFrontdoorFirewallPolicy:getFrontdoorFirewallPolicy", args ?? new GetFrontdoorFirewallPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/GetFrontdoorOriginGroup.cs b/sdk/dotnet/Cdn/GetFrontdoorOriginGroup.cs index b0b0895a2d..4e44928d48 100644 --- a/sdk/dotnet/Cdn/GetFrontdoorOriginGroup.cs +++ b/sdk/dotnet/Cdn/GetFrontdoorOriginGroup.cs @@ -13,12 +13,60 @@ public static class GetFrontdoorOriginGroup { /// /// Use this data source to access information about an existing Front Door (standard/premium) Origin Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorOriginGroup.Invoke(new() + /// { + /// Name = "example-origin-group", + /// ProfileName = "example-profile", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFrontdoorOriginGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getFrontdoorOriginGroup:getFrontdoorOriginGroup", args ?? new GetFrontdoorOriginGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Front Door (standard/premium) Origin Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorOriginGroup.Invoke(new() + /// { + /// Name = "example-origin-group", + /// ProfileName = "example-profile", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFrontdoorOriginGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getFrontdoorOriginGroup:getFrontdoorOriginGroup", args ?? new GetFrontdoorOriginGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/GetFrontdoorProfile.cs b/sdk/dotnet/Cdn/GetFrontdoorProfile.cs index 8e8c1a9eba..b424e0e4e9 100644 --- a/sdk/dotnet/Cdn/GetFrontdoorProfile.cs +++ b/sdk/dotnet/Cdn/GetFrontdoorProfile.cs @@ -13,12 +13,58 @@ public static class GetFrontdoorProfile { /// /// Use this data source to access information about an existing Front Door (standard/premium) Profile. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorProfile.Invoke(new() + /// { + /// Name = "existing-cdn-profile", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFrontdoorProfileArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getFrontdoorProfile:getFrontdoorProfile", args ?? new GetFrontdoorProfileArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Front Door (standard/premium) Profile. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorProfile.Invoke(new() + /// { + /// Name = "existing-cdn-profile", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFrontdoorProfileInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getFrontdoorProfile:getFrontdoorProfile", args ?? new GetFrontdoorProfileInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/GetFrontdoorRuleSet.cs b/sdk/dotnet/Cdn/GetFrontdoorRuleSet.cs index d5f73ba8b9..f4c3fac1eb 100644 --- a/sdk/dotnet/Cdn/GetFrontdoorRuleSet.cs +++ b/sdk/dotnet/Cdn/GetFrontdoorRuleSet.cs @@ -13,12 +13,60 @@ public static class GetFrontdoorRuleSet { /// /// Use this data source to access information about an existing Front Door (standard/premium) Rule Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorRuleSet.Invoke(new() + /// { + /// Name = "existing-rule-set", + /// ProfileName = "existing-profile", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFrontdoorRuleSetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getFrontdoorRuleSet:getFrontdoorRuleSet", args ?? new GetFrontdoorRuleSetArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Front Door (standard/premium) Rule Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorRuleSet.Invoke(new() + /// { + /// Name = "existing-rule-set", + /// ProfileName = "existing-profile", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFrontdoorRuleSetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getFrontdoorRuleSet:getFrontdoorRuleSet", args ?? new GetFrontdoorRuleSetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/GetFrontdoorSecret.cs b/sdk/dotnet/Cdn/GetFrontdoorSecret.cs index e3b1b83b5a..10d71e52f6 100644 --- a/sdk/dotnet/Cdn/GetFrontdoorSecret.cs +++ b/sdk/dotnet/Cdn/GetFrontdoorSecret.cs @@ -13,12 +13,60 @@ public static class GetFrontdoorSecret { /// /// Use this data source to access information about an existing Front Door (standard/premium) Secret. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorSecret.Invoke(new() + /// { + /// Name = "example-secret", + /// ProfileName = "example-profile", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFrontdoorSecretArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getFrontdoorSecret:getFrontdoorSecret", args ?? new GetFrontdoorSecretArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Front Door (standard/premium) Secret. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetFrontdoorSecret.Invoke(new() + /// { + /// Name = "example-secret", + /// ProfileName = "example-profile", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFrontdoorSecretInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getFrontdoorSecret:getFrontdoorSecret", args ?? new GetFrontdoorSecretInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/GetProfile.cs b/sdk/dotnet/Cdn/GetProfile.cs index 7f7b692b25..6ab2825479 100644 --- a/sdk/dotnet/Cdn/GetProfile.cs +++ b/sdk/dotnet/Cdn/GetProfile.cs @@ -13,12 +13,66 @@ public static class GetProfile { /// /// Use this data source to access information about an existing CDN Profile. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetProfile.Invoke(new() + /// { + /// Name = "myfirstcdnprofile", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["cdnProfileId"] = example.Apply(getProfileResult => getProfileResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetProfileArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cdn/getProfile:getProfile", args ?? new GetProfileArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing CDN Profile. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Cdn.GetProfile.Invoke(new() + /// { + /// Name = "myfirstcdnprofile", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["cdnProfileId"] = example.Apply(getProfileResult => getProfileResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetProfileInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cdn/getProfile:getProfile", args ?? new GetProfileInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Cdn/Profile.cs b/sdk/dotnet/Cdn/Profile.cs index 9037e14fc5..21422135f4 100644 --- a/sdk/dotnet/Cdn/Profile.cs +++ b/sdk/dotnet/Cdn/Profile.cs @@ -10,6 +10,36 @@ namespace Pulumi.Azure.Cdn { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleProfile = new Azure.Cdn.Profile("exampleProfile", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard_Verizon", + /// Tags = + /// { + /// { "environment", "Production" }, + /// { "cost_center", "MSFT" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CDN Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cognitive/Account.cs b/sdk/dotnet/Cognitive/Account.cs index 5e60b38e83..5a2c766f8e 100644 --- a/sdk/dotnet/Cognitive/Account.cs +++ b/sdk/dotnet/Cognitive/Account.cs @@ -14,6 +14,36 @@ namespace Pulumi.Azure.Cognitive /// /// > **Note:** Version v2.65.0 of the Azure Provider and later will attempt to Purge the Cognitive Account during deletion. This feature can be disabled using the `features` block within the `provider` block, see the provider documentation on the features block for more information. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Cognitive.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "Face", + /// SkuName = "S0", + /// Tags = + /// { + /// { "Acceptance", "Test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cognitive Service Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cognitive/AccountCustomerManagedKey.cs b/sdk/dotnet/Cognitive/AccountCustomerManagedKey.cs index 069c3df099..68595a326e 100644 --- a/sdk/dotnet/Cognitive/AccountCustomerManagedKey.cs +++ b/sdk/dotnet/Cognitive/AccountCustomerManagedKey.cs @@ -14,6 +14,159 @@ namespace Pulumi.Azure.Cognitive /// /// > **NOTE:** It's possible to define a Customer Managed Key both within the `azure.cognitive.Account` resource via the `customer_managed_key` block and by using the `azure.cognitive.AccountCustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Cognitive Account, since there'll be conflicts. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleAccount = new Azure.Cognitive.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "Face", + /// SkuName = "E0", + /// CustomSubdomainName = "example-account", + /// Identity = new Azure.Cognitive.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned, UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleAccount.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleAccount.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "List", + /// "Restore", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// "Purge", + /// "Encrypt", + /// "Decrypt", + /// "Sign", + /// "Verify", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "Delete", + /// "List", + /// "Restore", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// "Purge", + /// "Encrypt", + /// "Decrypt", + /// "Sign", + /// "Verify", + /// "GetRotationPolicy", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleUserAssignedIdentity.TenantId, + /// ObjectId = exampleUserAssignedIdentity.PrincipalId, + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "Delete", + /// "List", + /// "Restore", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// "Purge", + /// "Encrypt", + /// "Decrypt", + /// "Sign", + /// "Verify", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }); + /// + /// var exampleAccountCustomerManagedKey = new Azure.Cognitive.AccountCustomerManagedKey("exampleAccountCustomerManagedKey", new() + /// { + /// CognitiveAccountId = exampleAccount.Id, + /// KeyVaultKeyId = exampleKey.Id, + /// IdentityClientId = exampleUserAssignedIdentity.ClientId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Customer Managed Keys for a Cognitive Account can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cognitive/Deployment.cs b/sdk/dotnet/Cognitive/Deployment.cs index 8bb25d6202..b74cfce184 100644 --- a/sdk/dotnet/Cognitive/Deployment.cs +++ b/sdk/dotnet/Cognitive/Deployment.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Cognitive /// /// Manages a Cognitive Services Account Deployment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Cognitive.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "OpenAI", + /// SkuName = "S0", + /// }); + /// + /// var exampleDeployment = new Azure.Cognitive.Deployment("exampleDeployment", new() + /// { + /// CognitiveAccountId = exampleAccount.Id, + /// Model = new Azure.Cognitive.Inputs.DeploymentModelArgs + /// { + /// Format = "OpenAI", + /// Name = "text-curie-001", + /// Version = "1", + /// }, + /// Scale = new Azure.Cognitive.Inputs.DeploymentScaleArgs + /// { + /// Type = "Standard", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cognitive Services Account Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Cognitive/GetAccount.cs b/sdk/dotnet/Cognitive/GetAccount.cs index e4d6f966a1..7b8bc65fa1 100644 --- a/sdk/dotnet/Cognitive/GetAccount.cs +++ b/sdk/dotnet/Cognitive/GetAccount.cs @@ -13,12 +13,66 @@ public static class GetAccount { /// /// Use this data source to access information about an existing Cognitive Services Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.Cognitive.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "cognitive_account_rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["primaryAccessKey"] = test.Apply(getAccountResult => getAccountResult.PrimaryAccessKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cognitive/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Cognitive Services Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.Cognitive.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "cognitive_account_rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["primaryAccessKey"] = test.Apply(getAccountResult => getAccountResult.PrimaryAccessKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cognitive/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Communication/EmailService.cs b/sdk/dotnet/Communication/EmailService.cs index 840c65357d..aec213fbf4 100644 --- a/sdk/dotnet/Communication/EmailService.cs +++ b/sdk/dotnet/Communication/EmailService.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Communication /// /// Manages an Email Communication Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEmailService = new Azure.Communication.EmailService("exampleEmailService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// DataLocation = "United States", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Communication/GetService.cs b/sdk/dotnet/Communication/GetService.cs index f7667fc453..fa4020dfc6 100644 --- a/sdk/dotnet/Communication/GetService.cs +++ b/sdk/dotnet/Communication/GetService.cs @@ -13,12 +13,66 @@ public static class GetService { /// /// Use this data source to access information about an existing Communication Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Communication.GetService.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:communication/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Communication Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Communication.GetService.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:communication/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Communication/Service.cs b/sdk/dotnet/Communication/Service.cs index dbb0d33f7f..5f2718a0c4 100644 --- a/sdk/dotnet/Communication/Service.cs +++ b/sdk/dotnet/Communication/Service.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Communication /// /// Manages a Communication Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.Communication.Service("exampleService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// DataLocation = "United States", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/AvailabilitySet.cs b/sdk/dotnet/Compute/AvailabilitySet.cs index bd72d9c998..c81bd2b160 100644 --- a/sdk/dotnet/Compute/AvailabilitySet.cs +++ b/sdk/dotnet/Compute/AvailabilitySet.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Compute /// /// Manages an Availability Set for Virtual Machines. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAvailabilitySet = new Azure.Compute.AvailabilitySet("exampleAvailabilitySet", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Availability Sets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/BastionHost.cs b/sdk/dotnet/Compute/BastionHost.cs index 1b56e2e82a..d5812795ed 100644 --- a/sdk/dotnet/Compute/BastionHost.cs +++ b/sdk/dotnet/Compute/BastionHost.cs @@ -12,6 +12,66 @@ namespace Pulumi.Azure.Compute /// /// Manages a Bastion Host. /// + /// ## Example Usage + /// + /// This example deploys an Azure Bastion Host Instance to a target virtual network. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.1.224/27", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleBastionHost = new Azure.Compute.BastionHost("exampleBastionHost", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfiguration = new Azure.Compute.Inputs.BastionHostIpConfigurationArgs + /// { + /// Name = "configuration", + /// SubnetId = exampleSubnet.Id, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Bastion Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/CapacityReservation.cs b/sdk/dotnet/Compute/CapacityReservation.cs index 2c4ecf1559..f92c3f9e4c 100644 --- a/sdk/dotnet/Compute/CapacityReservation.cs +++ b/sdk/dotnet/Compute/CapacityReservation.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.Compute /// /// Manages a Capacity Reservation within a Capacity Reservation Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCapacityReservationGroup = new Azure.Compute.CapacityReservationGroup("exampleCapacityReservationGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleCapacityReservation = new Azure.Compute.CapacityReservation("exampleCapacityReservation", new() + /// { + /// CapacityReservationGroupId = exampleCapacityReservationGroup.Id, + /// Sku = new Azure.Compute.Inputs.CapacityReservationSkuArgs + /// { + /// Name = "Standard_D2s_v3", + /// Capacity = 1, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Capacity Reservations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/CapacityReservationGroup.cs b/sdk/dotnet/Compute/CapacityReservationGroup.cs index 54f9fda3b2..4bd778ac4d 100644 --- a/sdk/dotnet/Compute/CapacityReservationGroup.cs +++ b/sdk/dotnet/Compute/CapacityReservationGroup.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Compute /// /// Manages a Capacity Reservation Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCapacityReservationGroup = new Azure.Compute.CapacityReservationGroup("exampleCapacityReservationGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Capacity Reservation Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DataDiskAttachment.cs b/sdk/dotnet/Compute/DataDiskAttachment.cs index 1d78c9bb5c..318e7e831a 100644 --- a/sdk/dotnet/Compute/DataDiskAttachment.cs +++ b/sdk/dotnet/Compute/DataDiskAttachment.cs @@ -16,6 +16,115 @@ namespace Pulumi.Azure.Compute /// /// > **Please Note:** only Managed Disks are supported via this separate resource, Unmanaged Disks can be attached using the `storage_data_disk` block in the `azure.compute.VirtualMachine` resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var config = new Config(); + /// var prefix = config.Get("prefix") ?? "example"; + /// var vmName = $"{prefix}-vm"; + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var mainVirtualNetwork = new Azure.Network.VirtualNetwork("mainVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = mainVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var mainNetworkInterface = new Azure.Network.NetworkInterface("mainNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// SubnetId = @internal.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleVirtualMachine = new Azure.Compute.VirtualMachine("exampleVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkInterfaceIds = new[] + /// { + /// mainNetworkInterface.Id, + /// }, + /// VmSize = "Standard_F2", + /// StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs + /// { + /// Name = "myosdisk1", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Standard_LRS", + /// }, + /// OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs + /// { + /// ComputerName = vmName, + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = false, + /// }, + /// }); + /// + /// var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccountType = "Standard_LRS", + /// CreateOption = "Empty", + /// DiskSizeGb = 10, + /// }); + /// + /// var exampleDataDiskAttachment = new Azure.Compute.DataDiskAttachment("exampleDataDiskAttachment", new() + /// { + /// ManagedDiskId = exampleManagedDisk.Id, + /// VirtualMachineId = exampleVirtualMachine.Id, + /// Lun = 10, + /// Caching = "ReadWrite", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Machines Data Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DedicatedHost.cs b/sdk/dotnet/Compute/DedicatedHost.cs index e83ba9038b..64adf9df01 100644 --- a/sdk/dotnet/Compute/DedicatedHost.cs +++ b/sdk/dotnet/Compute/DedicatedHost.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.Compute /// /// Manage a Dedicated Host within a Dedicated Host Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDedicatedHostGroup = new Azure.Compute.DedicatedHostGroup("exampleDedicatedHostGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PlatformFaultDomainCount = 2, + /// }); + /// + /// var exampleDedicatedHost = new Azure.Compute.DedicatedHost("exampleDedicatedHost", new() + /// { + /// Location = exampleResourceGroup.Location, + /// DedicatedHostGroupId = exampleDedicatedHostGroup.Id, + /// SkuName = "DSv3-Type1", + /// PlatformFaultDomain = 1, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dedicated Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DedicatedHostGroup.cs b/sdk/dotnet/Compute/DedicatedHostGroup.cs index 69e4bea671..5ce92adaa9 100644 --- a/sdk/dotnet/Compute/DedicatedHostGroup.cs +++ b/sdk/dotnet/Compute/DedicatedHostGroup.cs @@ -12,6 +12,31 @@ namespace Pulumi.Azure.Compute /// /// Manage a Dedicated Host Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDedicatedHostGroup = new Azure.Compute.DedicatedHostGroup("exampleDedicatedHostGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PlatformFaultDomainCount = 1, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dedicated Host Group can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DiskAccess.cs b/sdk/dotnet/Compute/DiskAccess.cs index 53793ead03..e774d17c53 100644 --- a/sdk/dotnet/Compute/DiskAccess.cs +++ b/sdk/dotnet/Compute/DiskAccess.cs @@ -12,6 +12,25 @@ namespace Pulumi.Azure.Compute /// /// Manages a Disk Access. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Compute.DiskAccess("example", new() + /// { + /// Location = "West Europe", + /// ResourceGroupName = "example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Disk Access resource can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DiskEncryptionSet.cs b/sdk/dotnet/Compute/DiskEncryptionSet.cs index 8fd002ba91..d0be1fc8bd 100644 --- a/sdk/dotnet/Compute/DiskEncryptionSet.cs +++ b/sdk/dotnet/Compute/DiskEncryptionSet.cs @@ -14,6 +14,224 @@ namespace Pulumi.Azure.Compute /// /// > **NOTE:** At this time the Key Vault used to store the Active Key for this Disk Encryption Set must have both Soft Delete & Purge Protection enabled - which are not yet supported by this provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// EnabledForDiskEncryption = true, + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var example_user = new Azure.KeyVault.AccessPolicy("example-user", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "Get", + /// "Purge", + /// "Recover", + /// "Update", + /// "List", + /// "Decrypt", + /// "Sign", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// example_user, + /// }, + /// }); + /// + /// var exampleDiskEncryptionSet = new Azure.Compute.DiskEncryptionSet("exampleDiskEncryptionSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// KeyVaultKeyId = exampleKey.Id, + /// Identity = new Azure.Compute.Inputs.DiskEncryptionSetIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var example_diskAccessPolicy = new Azure.KeyVault.AccessPolicy("example-diskAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = exampleDiskEncryptionSet.Identity.Apply(identity => identity.TenantId), + /// ObjectId = exampleDiskEncryptionSet.Identity.Apply(identity => identity.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "Get", + /// "Purge", + /// "Recover", + /// "Update", + /// "List", + /// "Decrypt", + /// "Sign", + /// }, + /// }); + /// + /// var example_diskAssignment = new Azure.Authorization.Assignment("example-diskAssignment", new() + /// { + /// Scope = exampleKeyVault.Id, + /// RoleDefinitionName = "Key Vault Crypto Service Encryption User", + /// PrincipalId = exampleDiskEncryptionSet.Identity.Apply(identity => identity.PrincipalId), + /// }); + /// + /// }); + /// ``` + /// ### With Automatic Key Rotation Enabled + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// EnabledForDiskEncryption = true, + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var example_user = new Azure.KeyVault.AccessPolicy("example-user", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "Get", + /// "Purge", + /// "Recover", + /// "Update", + /// "List", + /// "Decrypt", + /// "Sign", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// example_user, + /// }, + /// }); + /// + /// var exampleDiskEncryptionSet = new Azure.Compute.DiskEncryptionSet("exampleDiskEncryptionSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// KeyVaultKeyId = exampleKey.VersionlessId, + /// AutoKeyRotationEnabled = true, + /// Identity = new Azure.Compute.Inputs.DiskEncryptionSetIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var example_diskAccessPolicy = new Azure.KeyVault.AccessPolicy("example-diskAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = exampleDiskEncryptionSet.Identity.Apply(identity => identity.TenantId), + /// ObjectId = exampleDiskEncryptionSet.Identity.Apply(identity => identity.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "Get", + /// "Purge", + /// "Recover", + /// "Update", + /// "List", + /// "Decrypt", + /// "Sign", + /// }, + /// }); + /// + /// var example_diskAssignment = new Azure.Authorization.Assignment("example-diskAssignment", new() + /// { + /// Scope = exampleKeyVault.Id, + /// RoleDefinitionName = "Key Vault Crypto Service Encryption User", + /// PrincipalId = exampleDiskEncryptionSet.Identity.Apply(identity => identity.PrincipalId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Disk Encryption Sets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DiskPool.cs b/sdk/dotnet/Compute/DiskPool.cs index b6bcf81757..7e55df7434 100644 --- a/sdk/dotnet/Compute/DiskPool.cs +++ b/sdk/dotnet/Compute/DiskPool.cs @@ -14,6 +14,71 @@ namespace Pulumi.Azure.Compute /// /// !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleVirtualNetwork.ResourceGroupName, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "diskspool", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/read", + /// }, + /// Name = "Microsoft.StoragePool/diskPools", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleDiskPool = new Azure.Compute.DiskPool("exampleDiskPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "Basic_B1", + /// SubnetId = exampleSubnet.Id, + /// Zones = new[] + /// { + /// "1", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Disk Pools can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DiskPoolIscsiTarget.cs b/sdk/dotnet/Compute/DiskPoolIscsiTarget.cs index 9b1c549b9f..64c070c699 100644 --- a/sdk/dotnet/Compute/DiskPoolIscsiTarget.cs +++ b/sdk/dotnet/Compute/DiskPoolIscsiTarget.cs @@ -16,6 +16,130 @@ namespace Pulumi.Azure.Compute /// /// !> **Note:** Each Disk Pool can have a maximum of 1 iSCSI Target. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "diskspool", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/read", + /// }, + /// Name = "Microsoft.StoragePool/diskPools", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleDiskPool = new Azure.Compute.DiskPool("exampleDiskPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubnetId = exampleSubnet.Id, + /// Zones = new[] + /// { + /// "1", + /// }, + /// SkuName = "Basic_B1", + /// }); + /// + /// var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CreateOption = "Empty", + /// StorageAccountType = "Premium_LRS", + /// DiskSizeGb = 4, + /// MaxShares = 2, + /// Zone = "1", + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "StoragePool Resource Provider", + /// }); + /// + /// var roles = new[] + /// { + /// "Disk Pool Operator", + /// "Virtual Machine Contributor", + /// }; + /// + /// var exampleAssignment = new List<Azure.Authorization.Assignment>(); + /// for (var rangeIndex = 0; rangeIndex < roles.Length; rangeIndex++) + /// { + /// var range = new { Value = rangeIndex }; + /// exampleAssignment.Add(new Azure.Authorization.Assignment($"exampleAssignment-{range.Value}", new() + /// { + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.Id), + /// RoleDefinitionName = roles[range.Value], + /// Scope = exampleManagedDisk.Id, + /// })); + /// } + /// var exampleDiskPoolManagedDiskAttachment = new Azure.Compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", new() + /// { + /// DiskPoolId = exampleDiskPool.Id, + /// ManagedDiskId = exampleManagedDisk.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// var exampleDiskPoolIscsiTarget = new Azure.Compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", new() + /// { + /// AclMode = "Dynamic", + /// DisksPoolId = exampleDiskPool.Id, + /// TargetIqn = "iqn.2021-11.com.microsoft:test", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleDiskPoolManagedDiskAttachment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// iSCSI Targets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DiskPoolIscsiTargetLun.cs b/sdk/dotnet/Compute/DiskPoolIscsiTargetLun.cs index 2125a18531..9e9a3ab565 100644 --- a/sdk/dotnet/Compute/DiskPoolIscsiTargetLun.cs +++ b/sdk/dotnet/Compute/DiskPoolIscsiTargetLun.cs @@ -14,6 +14,136 @@ namespace Pulumi.Azure.Compute /// /// !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "diskspool", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/read", + /// }, + /// Name = "Microsoft.StoragePool/diskPools", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleDiskPool = new Azure.Compute.DiskPool("exampleDiskPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubnetId = exampleSubnet.Id, + /// Zones = new[] + /// { + /// "1", + /// }, + /// SkuName = "Basic_B1", + /// }); + /// + /// var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CreateOption = "Empty", + /// StorageAccountType = "Premium_LRS", + /// DiskSizeGb = 4, + /// MaxShares = 2, + /// Zone = "1", + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "StoragePool Resource Provider", + /// }); + /// + /// var roles = new[] + /// { + /// "Disk Pool Operator", + /// "Virtual Machine Contributor", + /// }; + /// + /// var exampleAssignment = new List<Azure.Authorization.Assignment>(); + /// for (var rangeIndex = 0; rangeIndex < roles.Length; rangeIndex++) + /// { + /// var range = new { Value = rangeIndex }; + /// exampleAssignment.Add(new Azure.Authorization.Assignment($"exampleAssignment-{range.Value}", new() + /// { + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.Id), + /// RoleDefinitionName = roles[range.Value], + /// Scope = exampleManagedDisk.Id, + /// })); + /// } + /// var exampleDiskPoolManagedDiskAttachment = new Azure.Compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", new() + /// { + /// DiskPoolId = exampleDiskPool.Id, + /// ManagedDiskId = exampleManagedDisk.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// var exampleDiskPoolIscsiTarget = new Azure.Compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", new() + /// { + /// AclMode = "Dynamic", + /// DisksPoolId = exampleDiskPool.Id, + /// TargetIqn = "iqn.2021-11.com.microsoft:test", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleDiskPoolManagedDiskAttachment, + /// }, + /// }); + /// + /// var exampleDiskPoolIscsiTargetLun = new Azure.Compute.DiskPoolIscsiTargetLun("exampleDiskPoolIscsiTargetLun", new() + /// { + /// IscsiTargetId = exampleDiskPoolIscsiTarget.Id, + /// DiskPoolManagedDiskAttachmentId = exampleDiskPoolManagedDiskAttachment.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// iSCSI Target Luns can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/DiskPoolManagedDiskAttachment.cs b/sdk/dotnet/Compute/DiskPoolManagedDiskAttachment.cs index 0609a848ef..4207ae8195 100644 --- a/sdk/dotnet/Compute/DiskPoolManagedDiskAttachment.cs +++ b/sdk/dotnet/Compute/DiskPoolManagedDiskAttachment.cs @@ -22,6 +22,117 @@ namespace Pulumi.Azure.Compute /// /// > **Note:** You must provide the StoragePool resource provider RBAC permissions to the disks that will be added to the disk pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "diskspool", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/read", + /// }, + /// Name = "Microsoft.StoragePool/diskPools", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleDiskPool = new Azure.Compute.DiskPool("exampleDiskPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubnetId = exampleSubnet.Id, + /// Zones = new[] + /// { + /// "1", + /// }, + /// SkuName = "Basic_B1", + /// }); + /// + /// var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CreateOption = "Empty", + /// StorageAccountType = "Premium_LRS", + /// DiskSizeGb = 4, + /// MaxShares = 2, + /// Zone = "1", + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "StoragePool Resource Provider", + /// }); + /// + /// var roles = new[] + /// { + /// "Disk Pool Operator", + /// "Virtual Machine Contributor", + /// }; + /// + /// var exampleAssignment = new List<Azure.Authorization.Assignment>(); + /// for (var rangeIndex = 0; rangeIndex < roles.Length; rangeIndex++) + /// { + /// var range = new { Value = rangeIndex }; + /// exampleAssignment.Add(new Azure.Authorization.Assignment($"exampleAssignment-{range.Value}", new() + /// { + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.Id), + /// RoleDefinitionName = roles[range.Value], + /// Scope = exampleManagedDisk.Id, + /// })); + /// } + /// var exampleDiskPoolManagedDiskAttachment = new Azure.Compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", new() + /// { + /// DiskPoolId = exampleDiskPool.Id, + /// ManagedDiskId = exampleManagedDisk.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Disks Pool Managed Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/Extension.cs b/sdk/dotnet/Compute/Extension.cs index 94c2c488c7..64d3231f7b 100644 --- a/sdk/dotnet/Compute/Extension.cs +++ b/sdk/dotnet/Compute/Extension.cs @@ -17,6 +17,108 @@ namespace Pulumi.Azure.Compute /// /// > **NOTE:** Custom Script Extensions require that the Azure Virtual Machine Guest Agent is running on the Virtual Machine. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_F2", + /// AdminUsername = "adminuser", + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// AdminSshKeys = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineAdminSshKeyArgs + /// { + /// Username = "adminuser", + /// PublicKey = File.ReadAllText("~/.ssh/id_rsa.pub"), + /// }, + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// }); + /// + /// var exampleExtension = new Azure.Compute.Extension("exampleExtension", new() + /// { + /// VirtualMachineId = exampleLinuxVirtualMachine.Id, + /// Publisher = "Microsoft.Azure.Extensions", + /// Type = "CustomScript", + /// TypeHandlerVersion = "2.0", + /// Settings = @" { + /// ""commandToExecute"": ""hostname && uptime"" + /// } + /// ", + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Machine Extensions can be imported using the `resource id`, e.g. @@ -100,6 +202,16 @@ public partial class Extension : global::Pulumi.CustomResource /// The type of extension, available types for a publisher can be found using the Azure CLI. /// /// > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Output("type")] public Output Type { get; private set; } = null!; @@ -260,6 +372,16 @@ public InputMap Tags /// The type of extension, available types for a publisher can be found using the Azure CLI. /// /// > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Input("type", required: true)] public Input Type { get; set; } = null!; @@ -378,6 +500,16 @@ public InputMap Tags /// The type of extension, available types for a publisher can be found using the Azure CLI. /// /// > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Input("type")] public Input? Type { get; set; } diff --git a/sdk/dotnet/Compute/GalleryApplication.cs b/sdk/dotnet/Compute/GalleryApplication.cs index a613be9843..fc6f25875c 100644 --- a/sdk/dotnet/Compute/GalleryApplication.cs +++ b/sdk/dotnet/Compute/GalleryApplication.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.Compute /// /// Manages a Gallery Application. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSharedImageGallery = new Azure.Compute.SharedImageGallery("exampleSharedImageGallery", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleGalleryApplication = new Azure.Compute.GalleryApplication("exampleGalleryApplication", new() + /// { + /// GalleryId = exampleSharedImageGallery.Id, + /// Location = exampleResourceGroup.Location, + /// SupportedOsType = "Linux", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Gallery Applications can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/GalleryApplicationVersion.cs b/sdk/dotnet/Compute/GalleryApplicationVersion.cs index 655970f9fc..1416ed31e2 100644 --- a/sdk/dotnet/Compute/GalleryApplicationVersion.cs +++ b/sdk/dotnet/Compute/GalleryApplicationVersion.cs @@ -12,6 +12,82 @@ namespace Pulumi.Azure.Compute /// /// Manages a Gallery Application Version. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSharedImageGallery = new Azure.Compute.SharedImageGallery("exampleSharedImageGallery", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleGalleryApplication = new Azure.Compute.GalleryApplication("exampleGalleryApplication", new() + /// { + /// GalleryId = exampleSharedImageGallery.Id, + /// Location = exampleResourceGroup.Location, + /// SupportedOsType = "Linux", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "blob", + /// }); + /// + /// var exampleBlob = new Azure.Storage.Blob("exampleBlob", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// StorageContainerName = exampleContainer.Name, + /// Type = "Block", + /// SourceContent = "[scripts file content]", + /// }); + /// + /// var exampleGalleryApplicationVersion = new Azure.Compute.GalleryApplicationVersion("exampleGalleryApplicationVersion", new() + /// { + /// GalleryApplicationId = exampleGalleryApplication.Id, + /// Location = exampleGalleryApplication.Location, + /// ManageAction = new Azure.Compute.Inputs.GalleryApplicationVersionManageActionArgs + /// { + /// Install = "[install command]", + /// Remove = "[remove command]", + /// }, + /// Source = new Azure.Compute.Inputs.GalleryApplicationVersionSourceArgs + /// { + /// MediaLink = exampleBlob.Id, + /// }, + /// TargetRegions = new[] + /// { + /// new Azure.Compute.Inputs.GalleryApplicationVersionTargetRegionArgs + /// { + /// Name = exampleGalleryApplication.Location, + /// RegionalReplicaCount = 1, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Gallery Application Versions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/GetAvailabilitySet.cs b/sdk/dotnet/Compute/GetAvailabilitySet.cs index 01fd97ff69..85058b7cca 100644 --- a/sdk/dotnet/Compute/GetAvailabilitySet.cs +++ b/sdk/dotnet/Compute/GetAvailabilitySet.cs @@ -13,12 +13,66 @@ public static class GetAvailabilitySet { /// /// Use this data source to access information about an existing Availability Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetAvailabilitySet.Invoke(new() + /// { + /// Name = "tf-appsecuritygroup", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["availabilitySetId"] = example.Apply(getAvailabilitySetResult => getAvailabilitySetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAvailabilitySetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getAvailabilitySet:getAvailabilitySet", args ?? new GetAvailabilitySetArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Availability Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetAvailabilitySet.Invoke(new() + /// { + /// Name = "tf-appsecuritygroup", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["availabilitySetId"] = example.Apply(getAvailabilitySetResult => getAvailabilitySetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAvailabilitySetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getAvailabilitySet:getAvailabilitySet", args ?? new GetAvailabilitySetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetBastionHost.cs b/sdk/dotnet/Compute/GetBastionHost.cs index 38bd717c99..ab6d4b4a5a 100644 --- a/sdk/dotnet/Compute/GetBastionHost.cs +++ b/sdk/dotnet/Compute/GetBastionHost.cs @@ -13,12 +13,66 @@ public static class GetBastionHost { /// /// Use this data source to access information about an existing Bastion Host. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetBastionHost.Invoke(new() + /// { + /// Name = "existing-bastion", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getBastionHostResult => getBastionHostResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBastionHostArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getBastionHost:getBastionHost", args ?? new GetBastionHostArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Bastion Host. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetBastionHost.Invoke(new() + /// { + /// Name = "existing-bastion", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getBastionHostResult => getBastionHostResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBastionHostInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getBastionHost:getBastionHost", args ?? new GetBastionHostInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetConfidentialLedger.cs b/sdk/dotnet/Compute/GetConfidentialLedger.cs index 00495e0cb6..0db2f47217 100644 --- a/sdk/dotnet/Compute/GetConfidentialLedger.cs +++ b/sdk/dotnet/Compute/GetConfidentialLedger.cs @@ -13,12 +13,66 @@ public static class GetConfidentialLedger { /// /// Gets information about an existing Confidential Ledger. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Compute.GetConfidentialLedger.Invoke(new() + /// { + /// Name = "example-ledger", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ledgerEndpoint"] = current.Apply(getConfidentialLedgerResult => getConfidentialLedgerResult.LedgerEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetConfidentialLedgerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getConfidentialLedger:getConfidentialLedger", args ?? new GetConfidentialLedgerArgs(), options.WithDefaults()); /// /// Gets information about an existing Confidential Ledger. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Compute.GetConfidentialLedger.Invoke(new() + /// { + /// Name = "example-ledger", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ledgerEndpoint"] = current.Apply(getConfidentialLedgerResult => getConfidentialLedgerResult.LedgerEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetConfidentialLedgerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getConfidentialLedger:getConfidentialLedger", args ?? new GetConfidentialLedgerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetDedicatedHost.cs b/sdk/dotnet/Compute/GetDedicatedHost.cs index a221160f1f..59c2bf5faa 100644 --- a/sdk/dotnet/Compute/GetDedicatedHost.cs +++ b/sdk/dotnet/Compute/GetDedicatedHost.cs @@ -13,12 +13,68 @@ public static class GetDedicatedHost { /// /// Use this data source to access information about an existing Dedicated Host. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetDedicatedHost.Invoke(new() + /// { + /// Name = "example-host", + /// DedicatedHostGroupName = "example-host-group", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dedicatedHostId"] = example.Apply(getDedicatedHostResult => getDedicatedHostResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDedicatedHostArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getDedicatedHost:getDedicatedHost", args ?? new GetDedicatedHostArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Dedicated Host. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetDedicatedHost.Invoke(new() + /// { + /// Name = "example-host", + /// DedicatedHostGroupName = "example-host-group", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dedicatedHostId"] = example.Apply(getDedicatedHostResult => getDedicatedHostResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDedicatedHostInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getDedicatedHost:getDedicatedHost", args ?? new GetDedicatedHostInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetDedicatedHostGroup.cs b/sdk/dotnet/Compute/GetDedicatedHostGroup.cs index 7bc86eb086..1c801a3ffd 100644 --- a/sdk/dotnet/Compute/GetDedicatedHostGroup.cs +++ b/sdk/dotnet/Compute/GetDedicatedHostGroup.cs @@ -13,12 +13,66 @@ public static class GetDedicatedHostGroup { /// /// Use this data source to access information about an existing Dedicated Host Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetDedicatedHostGroup.Invoke(new() + /// { + /// Name = "example-dedicated-host-group", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDedicatedHostGroupResult => getDedicatedHostGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDedicatedHostGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getDedicatedHostGroup:getDedicatedHostGroup", args ?? new GetDedicatedHostGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Dedicated Host Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetDedicatedHostGroup.Invoke(new() + /// { + /// Name = "example-dedicated-host-group", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDedicatedHostGroupResult => getDedicatedHostGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDedicatedHostGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getDedicatedHostGroup:getDedicatedHostGroup", args ?? new GetDedicatedHostGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetDiskAccess.cs b/sdk/dotnet/Compute/GetDiskAccess.cs index 1d8fe74dda..504d39f94f 100644 --- a/sdk/dotnet/Compute/GetDiskAccess.cs +++ b/sdk/dotnet/Compute/GetDiskAccess.cs @@ -13,12 +13,66 @@ public static class GetDiskAccess { /// /// Use this data source to access information about an existing Disk Access. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetDiskAccess.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDiskAccessResult => getDiskAccessResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDiskAccessArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getDiskAccess:getDiskAccess", args ?? new GetDiskAccessArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Disk Access. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetDiskAccess.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDiskAccessResult => getDiskAccessResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDiskAccessInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getDiskAccess:getDiskAccess", args ?? new GetDiskAccessInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetDiskEncryptionSet.cs b/sdk/dotnet/Compute/GetDiskEncryptionSet.cs index 9604d235bd..ec554c2714 100644 --- a/sdk/dotnet/Compute/GetDiskEncryptionSet.cs +++ b/sdk/dotnet/Compute/GetDiskEncryptionSet.cs @@ -13,12 +13,66 @@ public static class GetDiskEncryptionSet { /// /// Use this data source to access information about an existing Disk Encryption Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Compute.GetDiskEncryptionSet.Invoke(new() + /// { + /// Name = "example-des", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = existing.Apply(getDiskEncryptionSetResult => getDiskEncryptionSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDiskEncryptionSetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getDiskEncryptionSet:getDiskEncryptionSet", args ?? new GetDiskEncryptionSetArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Disk Encryption Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Compute.GetDiskEncryptionSet.Invoke(new() + /// { + /// Name = "example-des", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = existing.Apply(getDiskEncryptionSetResult => getDiskEncryptionSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDiskEncryptionSetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getDiskEncryptionSet:getDiskEncryptionSet", args ?? new GetDiskEncryptionSetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetImage.cs b/sdk/dotnet/Compute/GetImage.cs index 3c52e88e1a..11e6a0691f 100644 --- a/sdk/dotnet/Compute/GetImage.cs +++ b/sdk/dotnet/Compute/GetImage.cs @@ -13,12 +13,66 @@ public static class GetImage { /// /// Use this data source to access information about an existing Image. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var search = Azure.Compute.GetImage.Invoke(new() + /// { + /// Name = "search-api", + /// ResourceGroupName = "packerimages", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["imageId"] = search.Apply(getImageResult => getImageResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetImageArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getImage:getImage", args ?? new GetImageArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Image. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var search = Azure.Compute.GetImage.Invoke(new() + /// { + /// Name = "search-api", + /// ResourceGroupName = "packerimages", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["imageId"] = search.Apply(getImageResult => getImageResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetImageInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getImage:getImage", args ?? new GetImageInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetImages.cs b/sdk/dotnet/Compute/GetImages.cs index f93d3136b0..93f214c406 100644 --- a/sdk/dotnet/Compute/GetImages.cs +++ b/sdk/dotnet/Compute/GetImages.cs @@ -13,12 +13,56 @@ public static class GetImages { /// /// Use this data source to access information about existing Images within a Resource Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetImages.Invoke(new() + /// { + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetImagesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getImages:getImages", args ?? new GetImagesArgs(), options.WithDefaults()); /// /// Use this data source to access information about existing Images within a Resource Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetImages.Invoke(new() + /// { + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetImagesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getImages:getImages", args ?? new GetImagesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetManagedDisk.cs b/sdk/dotnet/Compute/GetManagedDisk.cs index 51b4aaa2b1..ebdff97e02 100644 --- a/sdk/dotnet/Compute/GetManagedDisk.cs +++ b/sdk/dotnet/Compute/GetManagedDisk.cs @@ -13,12 +13,66 @@ public static class GetManagedDisk { /// /// Use this data source to access information about an existing Managed Disk. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Compute.GetManagedDisk.Invoke(new() + /// { + /// Name = "example-datadisk", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = existing.Apply(getManagedDiskResult => getManagedDiskResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetManagedDiskArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getManagedDisk:getManagedDisk", args ?? new GetManagedDiskArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Managed Disk. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Compute.GetManagedDisk.Invoke(new() + /// { + /// Name = "example-datadisk", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = existing.Apply(getManagedDiskResult => getManagedDiskResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetManagedDiskInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getManagedDisk:getManagedDisk", args ?? new GetManagedDiskInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetOrchestratedVirtualMachineScaleSet.cs b/sdk/dotnet/Compute/GetOrchestratedVirtualMachineScaleSet.cs index d931e18b91..27f1e90cc6 100644 --- a/sdk/dotnet/Compute/GetOrchestratedVirtualMachineScaleSet.cs +++ b/sdk/dotnet/Compute/GetOrchestratedVirtualMachineScaleSet.cs @@ -13,12 +13,66 @@ public static class GetOrchestratedVirtualMachineScaleSet { /// /// Use this data source to access information about an existing Orchestrated Virtual Machine Scale Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetOrchestratedVirtualMachineScaleSet.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getOrchestratedVirtualMachineScaleSetResult => getOrchestratedVirtualMachineScaleSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetOrchestratedVirtualMachineScaleSetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getOrchestratedVirtualMachineScaleSet:getOrchestratedVirtualMachineScaleSet", args ?? new GetOrchestratedVirtualMachineScaleSetArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Orchestrated Virtual Machine Scale Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetOrchestratedVirtualMachineScaleSet.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getOrchestratedVirtualMachineScaleSetResult => getOrchestratedVirtualMachineScaleSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetOrchestratedVirtualMachineScaleSetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getOrchestratedVirtualMachineScaleSet:getOrchestratedVirtualMachineScaleSet", args ?? new GetOrchestratedVirtualMachineScaleSetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetPlatformImage.cs b/sdk/dotnet/Compute/GetPlatformImage.cs index 034ab03ff4..ae83e9ec5a 100644 --- a/sdk/dotnet/Compute/GetPlatformImage.cs +++ b/sdk/dotnet/Compute/GetPlatformImage.cs @@ -13,12 +13,70 @@ public static class GetPlatformImage { /// /// Use this data source to access information about a Platform Image. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetPlatformImage.Invoke(new() + /// { + /// Location = "West Europe", + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPlatformImageResult => getPlatformImageResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPlatformImageArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getPlatformImage:getPlatformImage", args ?? new GetPlatformImageArgs(), options.WithDefaults()); /// /// Use this data source to access information about a Platform Image. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetPlatformImage.Invoke(new() + /// { + /// Location = "West Europe", + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPlatformImageResult => getPlatformImageResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPlatformImageInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getPlatformImage:getPlatformImage", args ?? new GetPlatformImageInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetSharedImage.cs b/sdk/dotnet/Compute/GetSharedImage.cs index bfc0b5ac70..61147edaa6 100644 --- a/sdk/dotnet/Compute/GetSharedImage.cs +++ b/sdk/dotnet/Compute/GetSharedImage.cs @@ -13,12 +13,60 @@ public static class GetSharedImage { /// /// Use this data source to access information about an existing Shared Image within a Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImage.Invoke(new() + /// { + /// GalleryName = "my-image-gallery", + /// Name = "my-image", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSharedImageArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getSharedImage:getSharedImage", args ?? new GetSharedImageArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Shared Image within a Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImage.Invoke(new() + /// { + /// GalleryName = "my-image-gallery", + /// Name = "my-image", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSharedImageInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getSharedImage:getSharedImage", args ?? new GetSharedImageInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetSharedImageGallery.cs b/sdk/dotnet/Compute/GetSharedImageGallery.cs index c06562af63..665e9ebc62 100644 --- a/sdk/dotnet/Compute/GetSharedImageGallery.cs +++ b/sdk/dotnet/Compute/GetSharedImageGallery.cs @@ -13,12 +13,58 @@ public static class GetSharedImageGallery { /// /// Use this data source to access information about an existing Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImageGallery.Invoke(new() + /// { + /// Name = "my-image-gallery", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSharedImageGalleryArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getSharedImageGallery:getSharedImageGallery", args ?? new GetSharedImageGalleryArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImageGallery.Invoke(new() + /// { + /// Name = "my-image-gallery", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSharedImageGalleryInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getSharedImageGallery:getSharedImageGallery", args ?? new GetSharedImageGalleryInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetSharedImageVersion.cs b/sdk/dotnet/Compute/GetSharedImageVersion.cs index be7a01448f..61916c12f2 100644 --- a/sdk/dotnet/Compute/GetSharedImageVersion.cs +++ b/sdk/dotnet/Compute/GetSharedImageVersion.cs @@ -13,12 +13,62 @@ public static class GetSharedImageVersion { /// /// Use this data source to access information about an existing Version of a Shared Image within a Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImageVersion.Invoke(new() + /// { + /// GalleryName = "my-image-gallery", + /// ImageName = "my-image", + /// Name = "1.0.0", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSharedImageVersionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getSharedImageVersion:getSharedImageVersion", args ?? new GetSharedImageVersionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Version of a Shared Image within a Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImageVersion.Invoke(new() + /// { + /// GalleryName = "my-image-gallery", + /// ImageName = "my-image", + /// Name = "1.0.0", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSharedImageVersionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getSharedImageVersion:getSharedImageVersion", args ?? new GetSharedImageVersionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetSharedImageVersions.cs b/sdk/dotnet/Compute/GetSharedImageVersions.cs index 126e7c8273..8d1038b0bc 100644 --- a/sdk/dotnet/Compute/GetSharedImageVersions.cs +++ b/sdk/dotnet/Compute/GetSharedImageVersions.cs @@ -13,12 +13,60 @@ public static class GetSharedImageVersions { /// /// Use this data source to access information about existing Versions of a Shared Image within a Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImageVersions.Invoke(new() + /// { + /// GalleryName = "my-image-gallery", + /// ImageName = "my-image", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSharedImageVersionsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getSharedImageVersions:getSharedImageVersions", args ?? new GetSharedImageVersionsArgs(), options.WithDefaults()); /// /// Use this data source to access information about existing Versions of a Shared Image within a Shared Image Gallery. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSharedImageVersions.Invoke(new() + /// { + /// GalleryName = "my-image-gallery", + /// ImageName = "my-image", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSharedImageVersionsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getSharedImageVersions:getSharedImageVersions", args ?? new GetSharedImageVersionsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetSnapshot.cs b/sdk/dotnet/Compute/GetSnapshot.cs index 1306fa6194..77d4784630 100644 --- a/sdk/dotnet/Compute/GetSnapshot.cs +++ b/sdk/dotnet/Compute/GetSnapshot.cs @@ -13,12 +13,58 @@ public static class GetSnapshot { /// /// Use this data source to access information about an existing Snapshot. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSnapshot.Invoke(new() + /// { + /// Name = "my-snapshot", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSnapshotArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getSnapshot:getSnapshot", args ?? new GetSnapshotArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Snapshot. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSnapshot.Invoke(new() + /// { + /// Name = "my-snapshot", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSnapshotInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getSnapshot:getSnapshot", args ?? new GetSnapshotInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetSshPublicKey.cs b/sdk/dotnet/Compute/GetSshPublicKey.cs index a43e80a9ef..f5236b7b54 100644 --- a/sdk/dotnet/Compute/GetSshPublicKey.cs +++ b/sdk/dotnet/Compute/GetSshPublicKey.cs @@ -13,12 +13,66 @@ public static class GetSshPublicKey { /// /// Use this data source to access information about an existing SSH Public Key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSshPublicKey.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSshPublicKeyResult => getSshPublicKeyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSshPublicKeyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getSshPublicKey:getSshPublicKey", args ?? new GetSshPublicKeyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing SSH Public Key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetSshPublicKey.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSshPublicKeyResult => getSshPublicKeyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSshPublicKeyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getSshPublicKey:getSshPublicKey", args ?? new GetSshPublicKeyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetVirtualMachine.cs b/sdk/dotnet/Compute/GetVirtualMachine.cs index bf0ecc0788..46b8d0a81c 100644 --- a/sdk/dotnet/Compute/GetVirtualMachine.cs +++ b/sdk/dotnet/Compute/GetVirtualMachine.cs @@ -13,12 +13,66 @@ public static class GetVirtualMachine { /// /// Use this data source to access information about an existing Virtual Machine. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetVirtualMachine.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualMachineId"] = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVirtualMachineArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getVirtualMachine:getVirtualMachine", args ?? new GetVirtualMachineArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Virtual Machine. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetVirtualMachine.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualMachineId"] = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVirtualMachineInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getVirtualMachine:getVirtualMachine", args ?? new GetVirtualMachineInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/GetVirtualMachineScaleSet.cs b/sdk/dotnet/Compute/GetVirtualMachineScaleSet.cs index 2560ee21e7..26371e2453 100644 --- a/sdk/dotnet/Compute/GetVirtualMachineScaleSet.cs +++ b/sdk/dotnet/Compute/GetVirtualMachineScaleSet.cs @@ -13,12 +13,66 @@ public static class GetVirtualMachineScaleSet { /// /// Use this data source to access information about an existing Virtual Machine Scale Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetVirtualMachineScaleSet.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getVirtualMachineScaleSetResult => getVirtualMachineScaleSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVirtualMachineScaleSetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:compute/getVirtualMachineScaleSet:getVirtualMachineScaleSet", args ?? new GetVirtualMachineScaleSetArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Virtual Machine Scale Set. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Compute.GetVirtualMachineScaleSet.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getVirtualMachineScaleSetResult => getVirtualMachineScaleSetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVirtualMachineScaleSetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:compute/getVirtualMachineScaleSet:getVirtualMachineScaleSet", args ?? new GetVirtualMachineScaleSetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Compute/Inputs/ScaleSetIdentityArgs.cs b/sdk/dotnet/Compute/Inputs/ScaleSetIdentityArgs.cs index 35e6522dab..b884aef8f9 100644 --- a/sdk/dotnet/Compute/Inputs/ScaleSetIdentityArgs.cs +++ b/sdk/dotnet/Compute/Inputs/ScaleSetIdentityArgs.cs @@ -17,6 +17,49 @@ public sealed class ScaleSetIdentityArgs : global::Pulumi.ResourceArgs /// /// Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Compute.ScaleSet("example", new() + /// { + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// Location = azurerm_resource_group.Example.Location, + /// Sku = new Azure.Compute.Inputs.ScaleSetSkuArgs + /// { + /// Name = @var.Vm_sku, + /// Tier = "Standard", + /// Capacity = @var.Instance_count, + /// }, + /// Identity = new Azure.Compute.Inputs.ScaleSetIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Extensions = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetExtensionArgs + /// { + /// Name = "MSILinuxExtension", + /// Publisher = "Microsoft.ManagedIdentity", + /// Type = "ManagedIdentityExtensionForLinux", + /// TypeHandlerVersion = "1.0", + /// Settings = "{\"port\": 50342}", + /// }, + /// }, + /// }); + /// + /// // ... + /// return new Dictionary<string, object?> + /// { + /// ["principalId"] = example.Identity.Apply(identity => identity.PrincipalId), + /// }; + /// }); + /// ``` /// public InputList IdentityIds { diff --git a/sdk/dotnet/Compute/Inputs/ScaleSetIdentityGetArgs.cs b/sdk/dotnet/Compute/Inputs/ScaleSetIdentityGetArgs.cs index f2f441b242..e99079917f 100644 --- a/sdk/dotnet/Compute/Inputs/ScaleSetIdentityGetArgs.cs +++ b/sdk/dotnet/Compute/Inputs/ScaleSetIdentityGetArgs.cs @@ -17,6 +17,49 @@ public sealed class ScaleSetIdentityGetArgs : global::Pulumi.ResourceArgs /// /// Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Compute.ScaleSet("example", new() + /// { + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// Location = azurerm_resource_group.Example.Location, + /// Sku = new Azure.Compute.Inputs.ScaleSetSkuArgs + /// { + /// Name = @var.Vm_sku, + /// Tier = "Standard", + /// Capacity = @var.Instance_count, + /// }, + /// Identity = new Azure.Compute.Inputs.ScaleSetIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Extensions = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetExtensionArgs + /// { + /// Name = "MSILinuxExtension", + /// Publisher = "Microsoft.ManagedIdentity", + /// Type = "ManagedIdentityExtensionForLinux", + /// TypeHandlerVersion = "1.0", + /// Settings = "{\"port\": 50342}", + /// }, + /// }, + /// }); + /// + /// // ... + /// return new Dictionary<string, object?> + /// { + /// ["principalId"] = example.Identity.Apply(identity => identity.PrincipalId), + /// }; + /// }); + /// ``` /// public InputList IdentityIds { diff --git a/sdk/dotnet/Compute/LinuxVirtualMachine.cs b/sdk/dotnet/Compute/LinuxVirtualMachine.cs index 8f874cd1ee..ab57857fce 100644 --- a/sdk/dotnet/Compute/LinuxVirtualMachine.cs +++ b/sdk/dotnet/Compute/LinuxVirtualMachine.cs @@ -24,6 +24,94 @@ namespace Pulumi.Azure.Compute /// /// > In this release there's a known issue where the `public_ip_address` and `public_ip_addresses` fields may not be fully populated for Dynamic Public IP's. /// + /// ## Example Usage + /// + /// This example provisions a basic Linux Virtual Machine on an internal network. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_F2", + /// AdminUsername = "adminuser", + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// AdminSshKeys = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineAdminSshKeyArgs + /// { + /// Username = "adminuser", + /// PublicKey = File.ReadAllText("~/.ssh/id_rsa.pub"), + /// }, + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/LinuxVirtualMachineScaleSet.cs b/sdk/dotnet/Compute/LinuxVirtualMachineScaleSet.cs index 304819cc2c..e0967ccf01 100644 --- a/sdk/dotnet/Compute/LinuxVirtualMachineScaleSet.cs +++ b/sdk/dotnet/Compute/LinuxVirtualMachineScaleSet.cs @@ -16,6 +16,94 @@ namespace Pulumi.Azure.Compute /// /// > **NOTE:** This provider will automatically update & reimage the nodes in the Scale Set (if Required) during an Update - this behaviour can be configured using the `features` setting within the Provider block. /// + /// ## Example Usage + /// + /// This example provisions a basic Linux Virtual Machine Scale Set on an internal network. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var firstPublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com"; + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard_F2", + /// Instances = 1, + /// AdminUsername = "adminuser", + /// AdminSshKeys = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs + /// { + /// Username = "adminuser", + /// PublicKey = firstPublicKey, + /// }, + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs + /// { + /// StorageAccountType = "Standard_LRS", + /// Caching = "ReadWrite", + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "example", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// Primary = true, + /// SubnetId = @internal.Id, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Linux Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/ManagedDisk.cs b/sdk/dotnet/Compute/ManagedDisk.cs index 6238e2b6e1..08f74f65a1 100644 --- a/sdk/dotnet/Compute/ManagedDisk.cs +++ b/sdk/dotnet/Compute/ManagedDisk.cs @@ -13,6 +13,80 @@ namespace Pulumi.Azure.Compute /// Manages a managed disk. /// /// ## Example Usage + /// ### With Create Empty + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccountType = "Standard_LRS", + /// CreateOption = "Empty", + /// DiskSizeGb = 1, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### With Create Copy + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var source = new Azure.Compute.ManagedDisk("source", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// StorageAccountType = "Standard_LRS", + /// CreateOption = "Empty", + /// DiskSizeGb = 1, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var copy = new Azure.Compute.ManagedDisk("copy", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// StorageAccountType = "Standard_LRS", + /// CreateOption = "Copy", + /// SourceResourceId = source.Id, + /// DiskSizeGb = 1, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Compute/ManagedDiskSasToken.cs b/sdk/dotnet/Compute/ManagedDiskSasToken.cs index 0c02246bb0..0c7fe40cb2 100644 --- a/sdk/dotnet/Compute/ManagedDiskSasToken.cs +++ b/sdk/dotnet/Compute/ManagedDiskSasToken.cs @@ -18,6 +18,40 @@ namespace Pulumi.Azure.Compute /// /// With the help of this resource, data from the disk can be copied from managed disk to a storage blob or to some other system without the need of azcopy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testResourceGroup = new Azure.Core.ResourceGroup("testResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var testManagedDisk = new Azure.Compute.ManagedDisk("testManagedDisk", new() + /// { + /// Location = testResourceGroup.Location, + /// ResourceGroupName = testResourceGroup.Name, + /// StorageAccountType = "Standard_LRS", + /// CreateOption = "Empty", + /// DiskSizeGb = 1, + /// }); + /// + /// var testManagedDiskSasToken = new Azure.Compute.ManagedDiskSasToken("testManagedDiskSasToken", new() + /// { + /// ManagedDiskId = testManagedDisk.Id, + /// DurationInSeconds = 300, + /// AccessLevel = "Read", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Disk SAS Token can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/OrchestratedVirtualMachineScaleSet.cs b/sdk/dotnet/Compute/OrchestratedVirtualMachineScaleSet.cs index e6ba1ac062..44488f84f2 100644 --- a/sdk/dotnet/Compute/OrchestratedVirtualMachineScaleSet.cs +++ b/sdk/dotnet/Compute/OrchestratedVirtualMachineScaleSet.cs @@ -18,6 +18,35 @@ namespace Pulumi.Azure.Compute /// /// > **NOTE:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleOrchestratedVirtualMachineScaleSet = new Azure.Compute.OrchestratedVirtualMachineScaleSet("exampleOrchestratedVirtualMachineScaleSet", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PlatformFaultDomainCount = 1, + /// Zones = new[] + /// { + /// "1", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An Orchestrated Virtual Machine Scale Set can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/Outputs/ScaleSetIdentity.cs b/sdk/dotnet/Compute/Outputs/ScaleSetIdentity.cs index f4e7c4130b..e3615312e3 100644 --- a/sdk/dotnet/Compute/Outputs/ScaleSetIdentity.cs +++ b/sdk/dotnet/Compute/Outputs/ScaleSetIdentity.cs @@ -15,6 +15,49 @@ public sealed class ScaleSetIdentity { /// /// Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Compute.ScaleSet("example", new() + /// { + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// Location = azurerm_resource_group.Example.Location, + /// Sku = new Azure.Compute.Inputs.ScaleSetSkuArgs + /// { + /// Name = @var.Vm_sku, + /// Tier = "Standard", + /// Capacity = @var.Instance_count, + /// }, + /// Identity = new Azure.Compute.Inputs.ScaleSetIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Extensions = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetExtensionArgs + /// { + /// Name = "MSILinuxExtension", + /// Publisher = "Microsoft.ManagedIdentity", + /// Type = "ManagedIdentityExtensionForLinux", + /// TypeHandlerVersion = "1.0", + /// Settings = "{\"port\": 50342}", + /// }, + /// }, + /// }); + /// + /// // ... + /// return new Dictionary<string, object?> + /// { + /// ["principalId"] = example.Identity.Apply(identity => identity.PrincipalId), + /// }; + /// }); + /// ``` /// public readonly ImmutableArray IdentityIds; public readonly string? PrincipalId; diff --git a/sdk/dotnet/Compute/PacketCapture.cs b/sdk/dotnet/Compute/PacketCapture.cs index a9068aa276..6e6facbca2 100644 --- a/sdk/dotnet/Compute/PacketCapture.cs +++ b/sdk/dotnet/Compute/PacketCapture.cs @@ -12,6 +12,135 @@ namespace Pulumi.Azure.Compute /// /// Configures Network Packet Capturing against a Virtual Machine using a Network Watcher. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkWatcher = new Azure.Network.NetworkWatcher("exampleNetworkWatcher", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleVirtualMachine = new Azure.Compute.VirtualMachine("exampleVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// VmSize = "Standard_F2", + /// StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs + /// { + /// Name = "osdisk", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Standard_LRS", + /// }, + /// OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs + /// { + /// ComputerName = "pctest-vm", + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = false, + /// }, + /// }); + /// + /// var exampleExtension = new Azure.Compute.Extension("exampleExtension", new() + /// { + /// VirtualMachineId = exampleVirtualMachine.Id, + /// Publisher = "Microsoft.Azure.NetworkWatcher", + /// Type = "NetworkWatcherAgentLinux", + /// TypeHandlerVersion = "1.4", + /// AutoUpgradeMinorVersion = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePacketCapture = new Azure.Compute.PacketCapture("examplePacketCapture", new() + /// { + /// NetworkWatcherId = exampleNetworkWatcher.Id, + /// VirtualMachineId = exampleVirtualMachine.Id, + /// StorageLocation = new Azure.Compute.Inputs.PacketCaptureStorageLocationArgs + /// { + /// StorageAccountId = exampleAccount.Id, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleExtension, + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `azure.compute.Extension` resource. + /// /// ## Import /// /// Virtual Machine Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/ScaleSet.cs b/sdk/dotnet/Compute/ScaleSet.cs index f502f3216a..ede0fb6b08 100644 --- a/sdk/dotnet/Compute/ScaleSet.cs +++ b/sdk/dotnet/Compute/ScaleSet.cs @@ -13,6 +13,335 @@ namespace Pulumi.Azure.Compute /// Manages a virtual machine scale set. /// /// ## Example Usage + /// ### With Managed Disks (Recommended) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// DomainNameLabel = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var bpepool = new Azure.Lb.BackendAddressPool("bpepool", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// }); + /// + /// var lbnatpool = new Azure.Lb.NatPool("lbnatpool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Protocol = "Tcp", + /// FrontendPortStart = 50000, + /// FrontendPortEnd = 50119, + /// BackendPort = 22, + /// FrontendIpConfigurationName = "PublicIPAddress", + /// }); + /// + /// var exampleProbe = new Azure.Lb.Probe("exampleProbe", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Protocol = "Http", + /// RequestPath = "/health", + /// Port = 8080, + /// }); + /// + /// var exampleScaleSet = new Azure.Compute.ScaleSet("exampleScaleSet", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutomaticOsUpgrade = true, + /// UpgradePolicyMode = "Rolling", + /// RollingUpgradePolicy = new Azure.Compute.Inputs.ScaleSetRollingUpgradePolicyArgs + /// { + /// MaxBatchInstancePercent = 20, + /// MaxUnhealthyInstancePercent = 20, + /// MaxUnhealthyUpgradedInstancePercent = 5, + /// PauseTimeBetweenBatches = "PT0S", + /// }, + /// HealthProbeId = exampleProbe.Id, + /// Sku = new Azure.Compute.Inputs.ScaleSetSkuArgs + /// { + /// Name = "Standard_F2", + /// Tier = "Standard", + /// Capacity = 2, + /// }, + /// StorageProfileImageReference = new Azure.Compute.Inputs.ScaleSetStorageProfileImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// StorageProfileOsDisk = new Azure.Compute.Inputs.ScaleSetStorageProfileOsDiskArgs + /// { + /// Name = "", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Standard_LRS", + /// }, + /// StorageProfileDataDisks = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetStorageProfileDataDiskArgs + /// { + /// Lun = 0, + /// Caching = "ReadWrite", + /// CreateOption = "Empty", + /// DiskSizeGb = 10, + /// }, + /// }, + /// OsProfile = new Azure.Compute.Inputs.ScaleSetOsProfileArgs + /// { + /// ComputerNamePrefix = "testvm", + /// AdminUsername = "myadmin", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.ScaleSetOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = true, + /// SshKeys = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetOsProfileLinuxConfigSshKeyArgs + /// { + /// Path = "/home/myadmin/.ssh/authorized_keys", + /// KeyData = File.ReadAllText("~/.ssh/demo_key.pub"), + /// }, + /// }, + /// }, + /// NetworkProfiles = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetNetworkProfileArgs + /// { + /// Name = "mynetworkprofile", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetNetworkProfileIpConfigurationArgs + /// { + /// Name = "TestIPConfiguration", + /// Primary = true, + /// SubnetId = exampleSubnet.Id, + /// LoadBalancerBackendAddressPoolIds = new[] + /// { + /// bpepool.Id, + /// }, + /// LoadBalancerInboundNatRulesIds = new[] + /// { + /// lbnatpool.Id, + /// }, + /// }, + /// }, + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### With Unmanaged Disks + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleScaleSet = new Azure.Compute.ScaleSet("exampleScaleSet", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// UpgradePolicyMode = "Manual", + /// Sku = new Azure.Compute.Inputs.ScaleSetSkuArgs + /// { + /// Name = "Standard_F2", + /// Tier = "Standard", + /// Capacity = 2, + /// }, + /// OsProfile = new Azure.Compute.Inputs.ScaleSetOsProfileArgs + /// { + /// ComputerNamePrefix = "testvm", + /// AdminUsername = "myadmin", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.ScaleSetOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = true, + /// SshKeys = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetOsProfileLinuxConfigSshKeyArgs + /// { + /// Path = "/home/myadmin/.ssh/authorized_keys", + /// KeyData = File.ReadAllText("~/.ssh/demo_key.pub"), + /// }, + /// }, + /// }, + /// NetworkProfiles = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetNetworkProfileArgs + /// { + /// Name = "TestNetworkProfile", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.ScaleSetNetworkProfileIpConfigurationArgs + /// { + /// Name = "TestIPConfiguration", + /// Primary = true, + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// }, + /// }, + /// StorageProfileOsDisk = new Azure.Compute.Inputs.ScaleSetStorageProfileOsDiskArgs + /// { + /// Name = "osDiskProfile", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// VhdContainers = new[] + /// { + /// Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values => + /// { + /// var primaryBlobEndpoint = values.Item1; + /// var name = values.Item2; + /// return $"{primaryBlobEndpoint}{name}"; + /// }), + /// }, + /// }, + /// StorageProfileImageReference = new Azure.Compute.Inputs.ScaleSetStorageProfileImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// }); + /// + /// }); + /// ``` + /// ## Example of storage_profile_image_reference with id + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleImage = new Azure.Compute.Image("exampleImage"); + /// + /// // ... + /// var exampleScaleSet = new Azure.Compute.ScaleSet("exampleScaleSet", new() + /// { + /// StorageProfileImageReference = new Azure.Compute.Inputs.ScaleSetStorageProfileImageReferenceArgs + /// { + /// Id = exampleImage.Id, + /// }, + /// }); + /// + /// // ... + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Compute/ScaleSetPacketCapture.cs b/sdk/dotnet/Compute/ScaleSetPacketCapture.cs index 0ec503e38f..230e3e0f5f 100644 --- a/sdk/dotnet/Compute/ScaleSetPacketCapture.cs +++ b/sdk/dotnet/Compute/ScaleSetPacketCapture.cs @@ -12,6 +12,131 @@ namespace Pulumi.Azure.Compute /// /// Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkWatcher = new Azure.Network.NetworkWatcher("exampleNetworkWatcher", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard_F2", + /// Instances = 4, + /// AdminUsername = "adminuser", + /// AdminPassword = "P@ssword1234!", + /// ComputerNamePrefix = "my-linux-computer-name-prefix", + /// UpgradeMode = "Automatic", + /// DisablePasswordAuthentication = false, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs + /// { + /// StorageAccountType = "Standard_LRS", + /// Caching = "ReadWrite", + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "example", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// Primary = true, + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleVirtualMachineScaleSetExtension = new Azure.Compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", new() + /// { + /// VirtualMachineScaleSetId = exampleLinuxVirtualMachineScaleSet.Id, + /// Publisher = "Microsoft.Azure.NetworkWatcher", + /// Type = "NetworkWatcherAgentLinux", + /// TypeHandlerVersion = "1.4", + /// AutoUpgradeMinorVersion = true, + /// AutomaticUpgradeEnabled = true, + /// }); + /// + /// var exampleScaleSetPacketCapture = new Azure.Compute.ScaleSetPacketCapture("exampleScaleSetPacketCapture", new() + /// { + /// NetworkWatcherId = exampleNetworkWatcher.Id, + /// VirtualMachineScaleSetId = exampleLinuxVirtualMachineScaleSet.Id, + /// StorageLocation = new Azure.Compute.Inputs.ScaleSetPacketCaptureStorageLocationArgs + /// { + /// FilePath = "/var/captures/packet.cap", + /// }, + /// MachineScope = new Azure.Compute.Inputs.ScaleSetPacketCaptureMachineScopeArgs + /// { + /// IncludeInstanceIds = new[] + /// { + /// "0", + /// }, + /// ExcludeInstanceIds = new[] + /// { + /// "1", + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleVirtualMachineScaleSetExtension, + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// > **NOTE:** This Resource requires that [the Network Watcher Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine Scale Set before capturing can be enabled which can be installed via the `azure.compute.VirtualMachineScaleSetExtension` resource. + /// /// ## Import /// /// Virtual Machine Scale Set Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/SharedImage.cs b/sdk/dotnet/Compute/SharedImage.cs index bf35b16bd3..8716802a37 100644 --- a/sdk/dotnet/Compute/SharedImage.cs +++ b/sdk/dotnet/Compute/SharedImage.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Compute /// /// Manages a Shared Image within a Shared Image Gallery. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSharedImageGallery = new Azure.Compute.SharedImageGallery("exampleSharedImageGallery", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Description = "Shared images and things.", + /// Tags = + /// { + /// { "Hello", "There" }, + /// { "World", "Example" }, + /// }, + /// }); + /// + /// var exampleSharedImage = new Azure.Compute.SharedImage("exampleSharedImage", new() + /// { + /// GalleryName = exampleSharedImageGallery.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OsType = "Linux", + /// Identifier = new Azure.Compute.Inputs.SharedImageIdentifierArgs + /// { + /// Publisher = "PublisherName", + /// Offer = "OfferName", + /// Sku = "ExampleSku", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Shared Images can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/SharedImageGallery.cs b/sdk/dotnet/Compute/SharedImageGallery.cs index 08b431afca..db0421751b 100644 --- a/sdk/dotnet/Compute/SharedImageGallery.cs +++ b/sdk/dotnet/Compute/SharedImageGallery.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.Compute /// /// Manages a Shared Image Gallery. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSharedImageGallery = new Azure.Compute.SharedImageGallery("exampleSharedImageGallery", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Description = "Shared images and things.", + /// Tags = + /// { + /// { "Hello", "There" }, + /// { "World", "Example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Shared Image Galleries can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/SharedImageVersion.cs b/sdk/dotnet/Compute/SharedImageVersion.cs index 355f3ec4be..e0ff1b7139 100644 --- a/sdk/dotnet/Compute/SharedImageVersion.cs +++ b/sdk/dotnet/Compute/SharedImageVersion.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Compute /// /// Manages a Version of a Shared Image within a Shared Image Gallery. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existingImage = Azure.Compute.GetImage.Invoke(new() + /// { + /// Name = "search-api", + /// ResourceGroupName = "packerimages", + /// }); + /// + /// var existingSharedImage = Azure.Compute.GetSharedImage.Invoke(new() + /// { + /// Name = "existing-image", + /// GalleryName = "existing_gallery", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// var example = new Azure.Compute.SharedImageVersion("example", new() + /// { + /// GalleryName = existingSharedImage.Apply(getSharedImageResult => getSharedImageResult.GalleryName), + /// ImageName = existingSharedImage.Apply(getSharedImageResult => getSharedImageResult.Name), + /// ResourceGroupName = existingSharedImage.Apply(getSharedImageResult => getSharedImageResult.ResourceGroupName), + /// Location = existingSharedImage.Apply(getSharedImageResult => getSharedImageResult.Location), + /// ManagedImageId = existingImage.Apply(getImageResult => getImageResult.Id), + /// TargetRegions = new[] + /// { + /// new Azure.Compute.Inputs.SharedImageVersionTargetRegionArgs + /// { + /// Name = existingSharedImage.Apply(getSharedImageResult => getSharedImageResult.Location), + /// RegionalReplicaCount = 5, + /// StorageAccountType = "Standard_LRS", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Shared Image Versions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/Snapshot.cs b/sdk/dotnet/Compute/Snapshot.cs index d9f2359a54..34a7367238 100644 --- a/sdk/dotnet/Compute/Snapshot.cs +++ b/sdk/dotnet/Compute/Snapshot.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Compute /// /// Manages a Disk Snapshot. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccountType = "Standard_LRS", + /// CreateOption = "Empty", + /// DiskSizeGb = 10, + /// }); + /// + /// var exampleSnapshot = new Azure.Compute.Snapshot("exampleSnapshot", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// CreateOption = "Copy", + /// SourceUri = exampleManagedDisk.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Snapshots can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/SshPublicKey.cs b/sdk/dotnet/Compute/SshPublicKey.cs index 745e977a59..dfa18d4072 100644 --- a/sdk/dotnet/Compute/SshPublicKey.cs +++ b/sdk/dotnet/Compute/SshPublicKey.cs @@ -12,6 +12,27 @@ namespace Pulumi.Azure.Compute /// /// Manages a SSH Public Key. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Compute.SshPublicKey("example", new() + /// { + /// ResourceGroupName = "example", + /// Location = "West Europe", + /// PublicKey = File.ReadAllText("~/.ssh/id_rsa.pub"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SSH Public Keys can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/VirtualMachine.cs b/sdk/dotnet/Compute/VirtualMachine.cs index 2b96cd94fa..eb302bea25 100644 --- a/sdk/dotnet/Compute/VirtualMachine.cs +++ b/sdk/dotnet/Compute/VirtualMachine.cs @@ -19,6 +19,101 @@ namespace Pulumi.Azure.Compute /// > **Note:** Data Disks can be attached either directly on the `azure.compute.VirtualMachine` resource, or using the `azure.compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur. /// /// ## Example Usage + /// ### From An Azure Platform Image) + /// + /// This example provisions a Virtual Machine with Managed Disks. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var config = new Config(); + /// var prefix = config.Get("prefix") ?? "tfvmex"; + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var mainVirtualNetwork = new Azure.Network.VirtualNetwork("mainVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = example.Name, + /// VirtualNetworkName = mainVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var mainNetworkInterface = new Azure.Network.NetworkInterface("mainNetworkInterface", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = @internal.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var mainVirtualMachine = new Azure.Compute.VirtualMachine("mainVirtualMachine", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// NetworkInterfaceIds = new[] + /// { + /// mainNetworkInterface.Id, + /// }, + /// VmSize = "Standard_DS1_v2", + /// StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs + /// { + /// Name = "myosdisk1", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Standard_LRS", + /// }, + /// OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs + /// { + /// ComputerName = "hostname", + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = false, + /// }, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Compute/VirtualMachineScaleSetExtension.cs b/sdk/dotnet/Compute/VirtualMachineScaleSetExtension.cs index 49c8e6942a..813ed1e006 100644 --- a/sdk/dotnet/Compute/VirtualMachineScaleSetExtension.cs +++ b/sdk/dotnet/Compute/VirtualMachineScaleSetExtension.cs @@ -14,6 +14,72 @@ namespace Pulumi.Azure.Compute /// /// > **NOTE:** This resource is not intended to be used with the `azure.compute.ScaleSet` resource - instead it's intended for this to be used with the `azure.compute.LinuxVirtualMachineScaleSet` and `azure.compute.WindowsVirtualMachineScaleSet` resources. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard_F2", + /// AdminUsername = "adminuser", + /// Instances = 1, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "example", + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// }, + /// }, + /// }, + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs + /// { + /// StorageAccountType = "Standard_LRS", + /// Caching = "ReadWrite", + /// }, + /// }); + /// + /// var exampleVirtualMachineScaleSetExtension = new Azure.Compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", new() + /// { + /// VirtualMachineScaleSetId = exampleLinuxVirtualMachineScaleSet.Id, + /// Publisher = "Microsoft.Azure.Extensions", + /// Type = "CustomScript", + /// TypeHandlerVersion = "2.0", + /// Settings = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["commandToExecute"] = "echo $HOSTNAME", + /// }), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Machine Scale Set Extensions can be imported using the `resource id`, e.g. @@ -103,6 +169,16 @@ public partial class VirtualMachineScaleSetExtension : global::Pulumi.CustomReso /// Specifies the version of the extension to use, available versions can be found using the Azure CLI. /// /// > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Output("typeHandlerVersion")] public Output TypeHandlerVersion { get; private set; } = null!; @@ -259,6 +335,16 @@ public InputList ProvisionAfterExtensions /// Specifies the version of the extension to use, available versions can be found using the Azure CLI. /// /// > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Input("typeHandlerVersion", required: true)] public Input TypeHandlerVersion { get; set; } = null!; @@ -373,6 +459,16 @@ public InputList ProvisionAfterExtensions /// Specifies the version of the extension to use, available versions can be found using the Azure CLI. /// /// > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Input("typeHandlerVersion")] public Input? TypeHandlerVersion { get; set; } diff --git a/sdk/dotnet/Compute/WindowsVirtualMachine.cs b/sdk/dotnet/Compute/WindowsVirtualMachine.cs index 58f2d80443..f4d4c36284 100644 --- a/sdk/dotnet/Compute/WindowsVirtualMachine.cs +++ b/sdk/dotnet/Compute/WindowsVirtualMachine.cs @@ -24,6 +24,86 @@ namespace Pulumi.Azure.Compute /// /// > In this release there's a known issue where the `public_ip_address` and `public_ip_addresses` fields may not be fully populated for Dynamic Public IP's. /// + /// ## Example Usage + /// + /// This example provisions a basic Windows Virtual Machine on an internal network. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleWindowsVirtualMachine = new Azure.Compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_F2", + /// AdminUsername = "adminuser", + /// AdminPassword = "P@$$w0rd1234!", + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// OsDisk = new Azure.Compute.Inputs.WindowsVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.WindowsVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "MicrosoftWindowsServer", + /// Offer = "WindowsServer", + /// Sku = "2016-Datacenter", + /// Version = "latest", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Compute/WindowsVirtualMachineScaleSet.cs b/sdk/dotnet/Compute/WindowsVirtualMachineScaleSet.cs index 02b0cf1132..46aed9f30a 100644 --- a/sdk/dotnet/Compute/WindowsVirtualMachineScaleSet.cs +++ b/sdk/dotnet/Compute/WindowsVirtualMachineScaleSet.cs @@ -20,6 +20,85 @@ namespace Pulumi.Azure.Compute /// /// > **NOTE:** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `azure.compute.ScaleSet` resource instead /// + /// ## Example Usage + /// + /// This example provisions a basic Windows Virtual Machine Scale Set on an internal network. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleWindowsVirtualMachineScaleSet = new Azure.Compute.WindowsVirtualMachineScaleSet("exampleWindowsVirtualMachineScaleSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard_F2", + /// Instances = 1, + /// AdminPassword = "P@55w0rd1234!", + /// AdminUsername = "adminuser", + /// SourceImageReference = new Azure.Compute.Inputs.WindowsVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "MicrosoftWindowsServer", + /// Offer = "WindowsServer", + /// Sku = "2016-Datacenter-Server-Core", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.WindowsVirtualMachineScaleSetOsDiskArgs + /// { + /// StorageAccountType = "Standard_LRS", + /// Caching = "ReadWrite", + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.WindowsVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "example", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.WindowsVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// Primary = true, + /// SubnetId = @internal.Id, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Windows Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ConfidentialLedger/Ledger.cs b/sdk/dotnet/ConfidentialLedger/Ledger.cs index 074da6094c..71a02863c8 100644 --- a/sdk/dotnet/ConfidentialLedger/Ledger.cs +++ b/sdk/dotnet/ConfidentialLedger/Ledger.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.ConfidentialLedger /// /// Manages a Confidential Ledger. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var ledger = new Azure.ConfidentialLedger.Ledger("ledger", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// LedgerType = "Private", + /// AzureadBasedServicePrincipals = new[] + /// { + /// new Azure.ConfidentialLedger.Inputs.LedgerAzureadBasedServicePrincipalArgs + /// { + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// LedgerRoleName = "Administrator", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Confidential Ledgers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Connections/ApiConnection.cs b/sdk/dotnet/Connections/ApiConnection.cs index 76df7784a3..010380636b 100644 --- a/sdk/dotnet/Connections/ApiConnection.cs +++ b/sdk/dotnet/Connections/ApiConnection.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.Connections /// /// Manages an API Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleManagedApi = Azure.Connections.GetManagedApi.Invoke(new() + /// { + /// Name = "servicebus", + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Basic", + /// }); + /// + /// var exampleApiConnection = new Azure.Connections.ApiConnection("exampleApiConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ManagedApiId = exampleManagedApi.Apply(getManagedApiResult => getManagedApiResult.Id), + /// DisplayName = "Example 1", + /// ParameterValues = + /// { + /// { "connectionString", exampleNamespace.DefaultPrimaryConnectionString }, + /// }, + /// Tags = + /// { + /// { "Hello", "World" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// API Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Connections/GetManagedApi.cs b/sdk/dotnet/Connections/GetManagedApi.cs index 2bb6e3610d..f1904b358b 100644 --- a/sdk/dotnet/Connections/GetManagedApi.cs +++ b/sdk/dotnet/Connections/GetManagedApi.cs @@ -13,12 +13,66 @@ public static class GetManagedApi { /// /// Uses this data source to access information about an existing Managed API. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Connections.GetManagedApi.Invoke(new() + /// { + /// Name = "servicebus", + /// Location = "West Europe", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getManagedApiResult => getManagedApiResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetManagedApiArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:connections/getManagedApi:getManagedApi", args ?? new GetManagedApiArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing Managed API. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Connections.GetManagedApi.Invoke(new() + /// { + /// Name = "servicebus", + /// Location = "West Europe", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getManagedApiResult => getManagedApiResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetManagedApiInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:connections/getManagedApi:getManagedApi", args ?? new GetManagedApiInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Consumption/BudgetManagementGroup.cs b/sdk/dotnet/Consumption/BudgetManagementGroup.cs index 4ff512c4af..bc9076ddfa 100644 --- a/sdk/dotnet/Consumption/BudgetManagementGroup.cs +++ b/sdk/dotnet/Consumption/BudgetManagementGroup.cs @@ -12,6 +12,93 @@ namespace Pulumi.Azure.Consumption /// /// Manages a Consumption Budget for a Management Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = new Azure.Management.Group("exampleGroup", new() + /// { + /// DisplayName = "example", + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "eastus", + /// }); + /// + /// var exampleBudgetManagementGroup = new Azure.Consumption.BudgetManagementGroup("exampleBudgetManagementGroup", new() + /// { + /// ManagementGroupId = exampleGroup.Id, + /// Amount = 1000, + /// TimeGrain = "Monthly", + /// TimePeriod = new Azure.Consumption.Inputs.BudgetManagementGroupTimePeriodArgs + /// { + /// StartDate = "2022-06-01T00:00:00Z", + /// EndDate = "2022-07-01T00:00:00Z", + /// }, + /// Filter = new Azure.Consumption.Inputs.BudgetManagementGroupFilterArgs + /// { + /// Dimensions = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetManagementGroupFilterDimensionArgs + /// { + /// Name = "ResourceGroupName", + /// Values = new[] + /// { + /// exampleResourceGroup.Name, + /// }, + /// }, + /// }, + /// Tags = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetManagementGroupFilterTagArgs + /// { + /// Name = "foo", + /// Values = new[] + /// { + /// "bar", + /// "baz", + /// }, + /// }, + /// }, + /// }, + /// Notifications = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetManagementGroupNotificationArgs + /// { + /// Enabled = true, + /// Threshold = 90, + /// Operator = "EqualTo", + /// ContactEmails = new[] + /// { + /// "foo@example.com", + /// "bar@example.com", + /// }, + /// }, + /// new Azure.Consumption.Inputs.BudgetManagementGroupNotificationArgs + /// { + /// Enabled = false, + /// Threshold = 100, + /// Operator = "GreaterThan", + /// ThresholdType = "Forecasted", + /// ContactEmails = new[] + /// { + /// "foo@example.com", + /// "bar@example.com", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Management Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Consumption/BudgetResourceGroup.cs b/sdk/dotnet/Consumption/BudgetResourceGroup.cs index a07215ad07..c6dc237cf3 100644 --- a/sdk/dotnet/Consumption/BudgetResourceGroup.cs +++ b/sdk/dotnet/Consumption/BudgetResourceGroup.cs @@ -12,6 +12,102 @@ namespace Pulumi.Azure.Consumption /// /// Manages a Resource Group Consumption Budget. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "eastus", + /// }); + /// + /// var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "example", + /// }); + /// + /// var exampleBudgetResourceGroup = new Azure.Consumption.BudgetResourceGroup("exampleBudgetResourceGroup", new() + /// { + /// ResourceGroupId = exampleResourceGroup.Id, + /// Amount = 1000, + /// TimeGrain = "Monthly", + /// TimePeriod = new Azure.Consumption.Inputs.BudgetResourceGroupTimePeriodArgs + /// { + /// StartDate = "2022-06-01T00:00:00Z", + /// EndDate = "2022-07-01T00:00:00Z", + /// }, + /// Filter = new Azure.Consumption.Inputs.BudgetResourceGroupFilterArgs + /// { + /// Dimensions = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetResourceGroupFilterDimensionArgs + /// { + /// Name = "ResourceId", + /// Values = new[] + /// { + /// exampleActionGroup.Id, + /// }, + /// }, + /// }, + /// Tags = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetResourceGroupFilterTagArgs + /// { + /// Name = "foo", + /// Values = new[] + /// { + /// "bar", + /// "baz", + /// }, + /// }, + /// }, + /// }, + /// Notifications = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetResourceGroupNotificationArgs + /// { + /// Enabled = true, + /// Threshold = 90, + /// Operator = "EqualTo", + /// ThresholdType = "Forecasted", + /// ContactEmails = new[] + /// { + /// "foo@example.com", + /// "bar@example.com", + /// }, + /// ContactGroups = new[] + /// { + /// exampleActionGroup.Id, + /// }, + /// ContactRoles = new[] + /// { + /// "Owner", + /// }, + /// }, + /// new Azure.Consumption.Inputs.BudgetResourceGroupNotificationArgs + /// { + /// Enabled = false, + /// Threshold = 100, + /// Operator = "GreaterThan", + /// ContactEmails = new[] + /// { + /// "foo@example.com", + /// "bar@example.com", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Consumption/BudgetSubscription.cs b/sdk/dotnet/Consumption/BudgetSubscription.cs index efdfe23e5a..83496e7a31 100644 --- a/sdk/dotnet/Consumption/BudgetSubscription.cs +++ b/sdk/dotnet/Consumption/BudgetSubscription.cs @@ -12,6 +12,104 @@ namespace Pulumi.Azure.Consumption /// /// Manages a Subscription Consumption Budget. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "eastus", + /// }); + /// + /// var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "example", + /// }); + /// + /// var exampleBudgetSubscription = new Azure.Consumption.BudgetSubscription("exampleBudgetSubscription", new() + /// { + /// SubscriptionId = current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Amount = 1000, + /// TimeGrain = "Monthly", + /// TimePeriod = new Azure.Consumption.Inputs.BudgetSubscriptionTimePeriodArgs + /// { + /// StartDate = "2022-06-01T00:00:00Z", + /// EndDate = "2022-07-01T00:00:00Z", + /// }, + /// Filter = new Azure.Consumption.Inputs.BudgetSubscriptionFilterArgs + /// { + /// Dimensions = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetSubscriptionFilterDimensionArgs + /// { + /// Name = "ResourceGroupName", + /// Values = new[] + /// { + /// exampleResourceGroup.Name, + /// }, + /// }, + /// }, + /// Tags = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetSubscriptionFilterTagArgs + /// { + /// Name = "foo", + /// Values = new[] + /// { + /// "bar", + /// "baz", + /// }, + /// }, + /// }, + /// }, + /// Notifications = new[] + /// { + /// new Azure.Consumption.Inputs.BudgetSubscriptionNotificationArgs + /// { + /// Enabled = true, + /// Threshold = 90, + /// Operator = "EqualTo", + /// ContactEmails = new[] + /// { + /// "foo@example.com", + /// "bar@example.com", + /// }, + /// ContactGroups = new[] + /// { + /// exampleActionGroup.Id, + /// }, + /// ContactRoles = new[] + /// { + /// "Owner", + /// }, + /// }, + /// new Azure.Consumption.Inputs.BudgetSubscriptionNotificationArgs + /// { + /// Enabled = false, + /// Threshold = 100, + /// Operator = "GreaterThan", + /// ThresholdType = "Forecasted", + /// ContactEmails = new[] + /// { + /// "foo@example.com", + /// "bar@example.com", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subscription Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Consumption/GetBudgetResourceGroup.cs b/sdk/dotnet/Consumption/GetBudgetResourceGroup.cs index b3c6022b23..9efcd4c2db 100644 --- a/sdk/dotnet/Consumption/GetBudgetResourceGroup.cs +++ b/sdk/dotnet/Consumption/GetBudgetResourceGroup.cs @@ -13,12 +13,66 @@ public static class GetBudgetResourceGroup { /// /// Use this data source to access information about an existing Consumption Budget for a specific resource group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Consumption.GetBudgetResourceGroup.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupId = azurerm_resource_group.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getBudgetResourceGroupResult => getBudgetResourceGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBudgetResourceGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:consumption/getBudgetResourceGroup:getBudgetResourceGroup", args ?? new GetBudgetResourceGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Consumption Budget for a specific resource group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Consumption.GetBudgetResourceGroup.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupId = azurerm_resource_group.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getBudgetResourceGroupResult => getBudgetResourceGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBudgetResourceGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:consumption/getBudgetResourceGroup:getBudgetResourceGroup", args ?? new GetBudgetResourceGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Consumption/GetBudgetSubscription.cs b/sdk/dotnet/Consumption/GetBudgetSubscription.cs index cc6acabf83..78807a050e 100644 --- a/sdk/dotnet/Consumption/GetBudgetSubscription.cs +++ b/sdk/dotnet/Consumption/GetBudgetSubscription.cs @@ -13,12 +13,66 @@ public static class GetBudgetSubscription { /// /// Use this data source to access information about an existing Consumption Budget for a specific subscription. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Consumption.GetBudgetSubscription.Invoke(new() + /// { + /// Name = "existing", + /// SubscriptionId = "/subscriptions/00000000-0000-0000-0000-000000000000/", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_consumption_budget.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBudgetSubscriptionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:consumption/getBudgetSubscription:getBudgetSubscription", args ?? new GetBudgetSubscriptionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Consumption Budget for a specific subscription. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Consumption.GetBudgetSubscription.Invoke(new() + /// { + /// Name = "existing", + /// SubscriptionId = "/subscriptions/00000000-0000-0000-0000-000000000000/", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_consumption_budget.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBudgetSubscriptionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:consumption/getBudgetSubscription:getBudgetSubscription", args ?? new GetBudgetSubscriptionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerApp/App.cs b/sdk/dotnet/ContainerApp/App.cs index fa75bac0a2..e0d69c7db4 100644 --- a/sdk/dotnet/ContainerApp/App.cs +++ b/sdk/dotnet/ContainerApp/App.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.ContainerApp /// /// Manages a Container App. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleEnvironment = new Azure.ContainerApp.Environment("exampleEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleApp = new Azure.ContainerApp.App("exampleApp", new() + /// { + /// ContainerAppEnvironmentId = exampleEnvironment.Id, + /// ResourceGroupName = exampleResourceGroup.Name, + /// RevisionMode = "Single", + /// Template = new Azure.ContainerApp.Inputs.AppTemplateArgs + /// { + /// Containers = new[] + /// { + /// new Azure.ContainerApp.Inputs.AppTemplateContainerArgs + /// { + /// Name = "examplecontainerapp", + /// Image = "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest", + /// Cpu = 0.25, + /// Memory = "0.5Gi", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Container App can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerApp/Environment.cs b/sdk/dotnet/ContainerApp/Environment.cs index b0ce21146d..a681fcca34 100644 --- a/sdk/dotnet/ContainerApp/Environment.cs +++ b/sdk/dotnet/ContainerApp/Environment.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.ContainerApp /// /// Manages a Container App Environment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleEnvironment = new Azure.ContainerApp.Environment("exampleEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerApp/EnvironmentDaprComponent.cs b/sdk/dotnet/ContainerApp/EnvironmentDaprComponent.cs index 193bd0acdb..745d5cdbc9 100644 --- a/sdk/dotnet/ContainerApp/EnvironmentDaprComponent.cs +++ b/sdk/dotnet/ContainerApp/EnvironmentDaprComponent.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.ContainerApp /// /// Manages a Dapr Component for a Container App Environment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleEnvironment = new Azure.ContainerApp.Environment("exampleEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleEnvironmentDaprComponent = new Azure.ContainerApp.EnvironmentDaprComponent("exampleEnvironmentDaprComponent", new() + /// { + /// ContainerAppEnvironmentId = exampleEnvironment.Id, + /// ComponentType = "state.azure.blobstorage", + /// Version = "v1", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Dapr Component for a Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerApp/EnvironmentStorage.cs b/sdk/dotnet/ContainerApp/EnvironmentStorage.cs index addd77f3f5..b1b3e53bed 100644 --- a/sdk/dotnet/ContainerApp/EnvironmentStorage.cs +++ b/sdk/dotnet/ContainerApp/EnvironmentStorage.cs @@ -12,6 +12,62 @@ namespace Pulumi.Azure.ContainerApp /// /// Manages a Container App Environment Storage. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleEnvironment = new Azure.ContainerApp.Environment("exampleEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleShare = new Azure.Storage.Share("exampleShare", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// Quota = 5, + /// }); + /// + /// var exampleEnvironmentStorage = new Azure.ContainerApp.EnvironmentStorage("exampleEnvironmentStorage", new() + /// { + /// ContainerAppEnvironmentId = exampleEnvironment.Id, + /// AccountName = exampleAccount.Name, + /// ShareName = exampleShare.Name, + /// AccessKey = exampleAccount.PrimaryAccessKey, + /// AccessMode = "ReadOnly", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Container App Environment Storage can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerApp/GetApp.cs b/sdk/dotnet/ContainerApp/GetApp.cs index e1e5b37bf4..71caaf1781 100644 --- a/sdk/dotnet/ContainerApp/GetApp.cs +++ b/sdk/dotnet/ContainerApp/GetApp.cs @@ -13,12 +13,58 @@ public static class GetApp { /// /// Use this data source to access information about an existing Container App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerApp.GetApp.Invoke(new() + /// { + /// Name = "example-app", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAppArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerapp/getApp:getApp", args ?? new GetAppArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Container App. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerApp.GetApp.Invoke(new() + /// { + /// Name = "example-app", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAppInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerapp/getApp:getApp", args ?? new GetAppInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerApp/GetEnvironment.cs b/sdk/dotnet/ContainerApp/GetEnvironment.cs index 87d13d804a..f319021fd1 100644 --- a/sdk/dotnet/ContainerApp/GetEnvironment.cs +++ b/sdk/dotnet/ContainerApp/GetEnvironment.cs @@ -13,12 +13,58 @@ public static class GetEnvironment { /// /// Use this data source to access information about an existing Container App Environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerApp.GetEnvironment.Invoke(new() + /// { + /// Name = "example-environment", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEnvironmentArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerapp/getEnvironment:getEnvironment", args ?? new GetEnvironmentArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Container App Environment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerApp.GetEnvironment.Invoke(new() + /// { + /// Name = "example-environment", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEnvironmentInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerapp/getEnvironment:getEnvironment", args ?? new GetEnvironmentInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerApp/GetEnvironmentCertificate.cs b/sdk/dotnet/ContainerApp/GetEnvironmentCertificate.cs index 392ace277c..0115480ec7 100644 --- a/sdk/dotnet/ContainerApp/GetEnvironmentCertificate.cs +++ b/sdk/dotnet/ContainerApp/GetEnvironmentCertificate.cs @@ -13,12 +13,70 @@ public static class GetEnvironmentCertificate { /// /// Use this data source to access information about an existing Container App Environment Certificate. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleEnvironment = Azure.ContainerApp.GetEnvironment.Invoke(new() + /// { + /// Name = "example-environment", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleEnvironmentCertificate = Azure.ContainerApp.GetEnvironmentCertificate.Invoke(new() + /// { + /// Name = "mycertificate", + /// ContainerAppEnvironmentId = exampleEnvironment.Apply(getEnvironmentResult => getEnvironmentResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEnvironmentCertificateArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerapp/getEnvironmentCertificate:getEnvironmentCertificate", args ?? new GetEnvironmentCertificateArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Container App Environment Certificate. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleEnvironment = Azure.ContainerApp.GetEnvironment.Invoke(new() + /// { + /// Name = "example-environment", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleEnvironmentCertificate = Azure.ContainerApp.GetEnvironmentCertificate.Invoke(new() + /// { + /// Name = "mycertificate", + /// ContainerAppEnvironmentId = exampleEnvironment.Apply(getEnvironmentResult => getEnvironmentResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEnvironmentCertificateInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerapp/getEnvironmentCertificate:getEnvironmentCertificate", args ?? new GetEnvironmentCertificateInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/ClusterTrustedAccessRoleBinding.cs b/sdk/dotnet/ContainerService/ClusterTrustedAccessRoleBinding.cs index 629c3c4fc2..1b427c62ce 100644 --- a/sdk/dotnet/ContainerService/ClusterTrustedAccessRoleBinding.cs +++ b/sdk/dotnet/ContainerService/ClusterTrustedAccessRoleBinding.cs @@ -16,6 +16,95 @@ namespace Pulumi.Azure.ContainerService /// > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name TrustedAccessPreview` and then `az provider register -n Microsoft.ContainerService` /// . /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "example-value", + /// }); + /// + /// var test = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = data.Azurerm_client_config.Example.Tenant_id, + /// SkuName = "example-value", + /// SoftDeleteRetentionDays = "example-value", + /// }); + /// + /// var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("exampleAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = data.Azurerm_client_config.Example.Tenant_id, + /// ObjectId = data.Azurerm_client_config.Example.Object_id, + /// KeyPermissions = "example-value", + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "acctestaksexample", + /// DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs + /// { + /// Name = "example-value", + /// NodeCount = "example-value", + /// VmSize = "example-value", + /// }, + /// Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs + /// { + /// Type = "example-value", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "example-value", + /// AccountReplicationType = "example-value", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// ApplicationInsightsId = exampleInsights.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "example-value", + /// }, + /// }); + /// + /// var exampleClusterTrustedAccessRoleBinding = new Azure.ContainerService.ClusterTrustedAccessRoleBinding("exampleClusterTrustedAccessRoleBinding", new() + /// { + /// KubernetesClusterId = exampleKubernetesCluster.Id, + /// Roles = "example-value", + /// SourceResourceId = exampleWorkspace.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing Kubernetes Cluster Trusted Access Role Binding can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/ConnectedRegistry.cs b/sdk/dotnet/ContainerService/ConnectedRegistry.cs index 366d827b40..eadb30cc0f 100644 --- a/sdk/dotnet/ContainerService/ConnectedRegistry.cs +++ b/sdk/dotnet/ContainerService/ConnectedRegistry.cs @@ -12,6 +12,63 @@ namespace Pulumi.Azure.ContainerService /// /// Manages a Container Connected Registry. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Premium", + /// DataEndpointEnabled = true, + /// }); + /// + /// var exampleRegistryScopeMap = new Azure.ContainerService.RegistryScopeMap("exampleRegistryScopeMap", new() + /// { + /// ContainerRegistryName = exampleRegistry.Name, + /// ResourceGroupName = exampleRegistry.ResourceGroupName, + /// Actions = new[] + /// { + /// "repositories/hello-world/content/delete", + /// "repositories/hello-world/content/read", + /// "repositories/hello-world/content/write", + /// "repositories/hello-world/metadata/read", + /// "repositories/hello-world/metadata/write", + /// "gateway/examplecr/config/read", + /// "gateway/examplecr/config/write", + /// "gateway/examplecr/message/read", + /// "gateway/examplecr/message/write", + /// }, + /// }); + /// + /// var exampleRegistryToken = new Azure.ContainerService.RegistryToken("exampleRegistryToken", new() + /// { + /// ContainerRegistryName = exampleRegistry.Name, + /// ResourceGroupName = exampleRegistry.ResourceGroupName, + /// ScopeMapId = exampleRegistryScopeMap.Id, + /// }); + /// + /// var exampleConnectedRegistry = new Azure.ContainerService.ConnectedRegistry("exampleConnectedRegistry", new() + /// { + /// ContainerRegistryId = exampleRegistry.Id, + /// SyncTokenId = exampleRegistryToken.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Connected Registries can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/FluxConfiguration.cs b/sdk/dotnet/ContainerService/FluxConfiguration.cs index 4e0a5c78d0..8cfcb46155 100644 --- a/sdk/dotnet/ContainerService/FluxConfiguration.cs +++ b/sdk/dotnet/ContainerService/FluxConfiguration.cs @@ -12,6 +12,72 @@ namespace Pulumi.Azure.ContainerService /// /// Manages a Kubernetes Flux Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = "West Europe", + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "example-aks", + /// DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs + /// { + /// Name = "default", + /// NodeCount = 1, + /// VmSize = "Standard_DS2_v2", + /// }, + /// Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleKubernetesClusterExtension = new Azure.ContainerService.KubernetesClusterExtension("exampleKubernetesClusterExtension", new() + /// { + /// ClusterId = azurerm_kubernetes_cluster.Test.Id, + /// ExtensionType = "microsoft.flux", + /// }); + /// + /// var exampleFluxConfiguration = new Azure.ContainerService.FluxConfiguration("exampleFluxConfiguration", new() + /// { + /// ClusterId = azurerm_kubernetes_cluster.Test.Id, + /// Namespace = "flux", + /// GitRepository = new Azure.ContainerService.Inputs.FluxConfigurationGitRepositoryArgs + /// { + /// Url = "https://github.com/Azure/arc-k8s-demo", + /// ReferenceType = "branch", + /// ReferenceValue = "main", + /// }, + /// Kustomizations = new[] + /// { + /// new Azure.ContainerService.Inputs.FluxConfigurationKustomizationArgs + /// { + /// Name = "kustomization-1", + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleKubernetesClusterExtension, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/dotnet/ContainerService/GetClusterNodePool.cs b/sdk/dotnet/ContainerService/GetClusterNodePool.cs index 4764f4fb12..98551bdef4 100644 --- a/sdk/dotnet/ContainerService/GetClusterNodePool.cs +++ b/sdk/dotnet/ContainerService/GetClusterNodePool.cs @@ -13,12 +13,68 @@ public static class GetClusterNodePool { /// /// Use this data source to access information about an existing Kubernetes Cluster Node Pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetClusterNodePool.Invoke(new() + /// { + /// Name = "existing", + /// KubernetesClusterName = "existing-cluster", + /// ResourceGroupName = "existing-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getClusterNodePoolResult => getClusterNodePoolResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetClusterNodePoolArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getClusterNodePool:getClusterNodePool", args ?? new GetClusterNodePoolArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Kubernetes Cluster Node Pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetClusterNodePool.Invoke(new() + /// { + /// Name = "existing", + /// KubernetesClusterName = "existing-cluster", + /// ResourceGroupName = "existing-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getClusterNodePoolResult => getClusterNodePoolResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetClusterNodePoolInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getClusterNodePool:getClusterNodePool", args ?? new GetClusterNodePoolInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/GetGroup.cs b/sdk/dotnet/ContainerService/GetGroup.cs index fdfa36aa66..16124a9dd8 100644 --- a/sdk/dotnet/ContainerService/GetGroup.cs +++ b/sdk/dotnet/ContainerService/GetGroup.cs @@ -13,12 +13,70 @@ public static class GetGroup { /// /// Use this data source to access information about an existing Container Group instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetGroup.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getGroupResult => getGroupResult.Id), + /// ["ipAddress"] = example.Apply(getGroupResult => getGroupResult.IpAddress), + /// ["fqdn"] = example.Apply(getGroupResult => getGroupResult.Fqdn), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getGroup:getGroup", args ?? new GetGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Container Group instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetGroup.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getGroupResult => getGroupResult.Id), + /// ["ipAddress"] = example.Apply(getGroupResult => getGroupResult.IpAddress), + /// ["fqdn"] = example.Apply(getGroupResult => getGroupResult.Fqdn), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getGroup:getGroup", args ?? new GetGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/GetKubernetesCluster.cs b/sdk/dotnet/ContainerService/GetKubernetesCluster.cs index 60785bd9ef..7d89ef563c 100644 --- a/sdk/dotnet/ContainerService/GetKubernetesCluster.cs +++ b/sdk/dotnet/ContainerService/GetKubernetesCluster.cs @@ -13,12 +13,58 @@ public static class GetKubernetesCluster { /// /// Use this data source to access information about an existing Managed Kubernetes Cluster (AKS). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetKubernetesCluster.Invoke(new() + /// { + /// Name = "myakscluster", + /// ResourceGroupName = "my-example-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetKubernetesClusterArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getKubernetesCluster:getKubernetesCluster", args ?? new GetKubernetesClusterArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Managed Kubernetes Cluster (AKS). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetKubernetesCluster.Invoke(new() + /// { + /// Name = "myakscluster", + /// ResourceGroupName = "my-example-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetKubernetesClusterInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getKubernetesCluster:getKubernetesCluster", args ?? new GetKubernetesClusterInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/GetKubernetesNodePoolSnapshot.cs b/sdk/dotnet/ContainerService/GetKubernetesNodePoolSnapshot.cs index 85b2962a34..ce739d37ab 100644 --- a/sdk/dotnet/ContainerService/GetKubernetesNodePoolSnapshot.cs +++ b/sdk/dotnet/ContainerService/GetKubernetesNodePoolSnapshot.cs @@ -13,12 +13,58 @@ public static class GetKubernetesNodePoolSnapshot { /// /// Use this data source to access information about an existing Kubernetes Node Pool Snapshot. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetKubernetesNodePoolSnapshot.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetKubernetesNodePoolSnapshotArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getKubernetesNodePoolSnapshot:getKubernetesNodePoolSnapshot", args ?? new GetKubernetesNodePoolSnapshotArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Kubernetes Node Pool Snapshot. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetKubernetesNodePoolSnapshot.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetKubernetesNodePoolSnapshotInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getKubernetesNodePoolSnapshot:getKubernetesNodePoolSnapshot", args ?? new GetKubernetesNodePoolSnapshotInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/GetKubernetesServiceVersions.cs b/sdk/dotnet/ContainerService/GetKubernetesServiceVersions.cs index 4ad39e475b..5109e58e14 100644 --- a/sdk/dotnet/ContainerService/GetKubernetesServiceVersions.cs +++ b/sdk/dotnet/ContainerService/GetKubernetesServiceVersions.cs @@ -13,12 +13,66 @@ public static class GetKubernetesServiceVersions { /// /// Use this data source to retrieve the version of Kubernetes supported by Azure Kubernetes Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.ContainerService.GetKubernetesServiceVersions.Invoke(new() + /// { + /// Location = "West Europe", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["versions"] = current.Apply(getKubernetesServiceVersionsResult => getKubernetesServiceVersionsResult.Versions), + /// ["latestVersion"] = current.Apply(getKubernetesServiceVersionsResult => getKubernetesServiceVersionsResult.LatestVersion), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetKubernetesServiceVersionsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getKubernetesServiceVersions:getKubernetesServiceVersions", args ?? new GetKubernetesServiceVersionsArgs(), options.WithDefaults()); /// /// Use this data source to retrieve the version of Kubernetes supported by Azure Kubernetes Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.ContainerService.GetKubernetesServiceVersions.Invoke(new() + /// { + /// Location = "West Europe", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["versions"] = current.Apply(getKubernetesServiceVersionsResult => getKubernetesServiceVersionsResult.Versions), + /// ["latestVersion"] = current.Apply(getKubernetesServiceVersionsResult => getKubernetesServiceVersionsResult.LatestVersion), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetKubernetesServiceVersionsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getKubernetesServiceVersions:getKubernetesServiceVersions", args ?? new GetKubernetesServiceVersionsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/GetRegistry.cs b/sdk/dotnet/ContainerService/GetRegistry.cs index 1cc1c1bf67..b0a8a6263e 100644 --- a/sdk/dotnet/ContainerService/GetRegistry.cs +++ b/sdk/dotnet/ContainerService/GetRegistry.cs @@ -13,12 +13,66 @@ public static class GetRegistry { /// /// Use this data source to access information about an existing Container Registry. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetRegistry.Invoke(new() + /// { + /// Name = "testacr", + /// ResourceGroupName = "test", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["loginServer"] = example.Apply(getRegistryResult => getRegistryResult.LoginServer), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRegistryArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getRegistry:getRegistry", args ?? new GetRegistryArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Container Registry. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetRegistry.Invoke(new() + /// { + /// Name = "testacr", + /// ResourceGroupName = "test", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["loginServer"] = example.Apply(getRegistryResult => getRegistryResult.LoginServer), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRegistryInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getRegistry:getRegistry", args ?? new GetRegistryInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/GetRegistryScopeMap.cs b/sdk/dotnet/ContainerService/GetRegistryScopeMap.cs index 5f1d6b9e19..a345054592 100644 --- a/sdk/dotnet/ContainerService/GetRegistryScopeMap.cs +++ b/sdk/dotnet/ContainerService/GetRegistryScopeMap.cs @@ -13,12 +13,68 @@ public static class GetRegistryScopeMap { /// /// Use this data source to access information about an existing Container Registry scope map. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetRegistryScopeMap.Invoke(new() + /// { + /// Name = "example-scope-map", + /// ResourceGroupName = "example-resource-group", + /// ContainerRegistryName = "example-registry", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["actions"] = example.Apply(getRegistryScopeMapResult => getRegistryScopeMapResult.Actions), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRegistryScopeMapArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getRegistryScopeMap:getRegistryScopeMap", args ?? new GetRegistryScopeMapArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Container Registry scope map. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetRegistryScopeMap.Invoke(new() + /// { + /// Name = "example-scope-map", + /// ResourceGroupName = "example-resource-group", + /// ContainerRegistryName = "example-registry", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["actions"] = example.Apply(getRegistryScopeMapResult => getRegistryScopeMapResult.Actions), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRegistryScopeMapInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getRegistryScopeMap:getRegistryScopeMap", args ?? new GetRegistryScopeMapInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/GetRegistryToken.cs b/sdk/dotnet/ContainerService/GetRegistryToken.cs index 066a551f8f..5079ad4c18 100644 --- a/sdk/dotnet/ContainerService/GetRegistryToken.cs +++ b/sdk/dotnet/ContainerService/GetRegistryToken.cs @@ -13,12 +13,68 @@ public static class GetRegistryToken { /// /// Use this data source to access information about an existing Container Registry token. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetRegistryToken.Invoke(new() + /// { + /// Name = "exampletoken", + /// ResourceGroupName = "example-resource-group", + /// ContainerRegistryName = "example-registry", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["scopeMapId"] = example.Apply(getRegistryTokenResult => getRegistryTokenResult.ScopeMapId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRegistryTokenArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:containerservice/getRegistryToken:getRegistryToken", args ?? new GetRegistryTokenArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Container Registry token. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ContainerService.GetRegistryToken.Invoke(new() + /// { + /// Name = "exampletoken", + /// ResourceGroupName = "example-resource-group", + /// ContainerRegistryName = "example-registry", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["scopeMapId"] = example.Apply(getRegistryTokenResult => getRegistryTokenResult.ScopeMapId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRegistryTokenInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:containerservice/getRegistryToken:getRegistryToken", args ?? new GetRegistryTokenInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ContainerService/Group.cs b/sdk/dotnet/ContainerService/Group.cs index 7ced3247c9..e5cb8c2542 100644 --- a/sdk/dotnet/ContainerService/Group.cs +++ b/sdk/dotnet/ContainerService/Group.cs @@ -14,6 +14,64 @@ namespace Pulumi.Azure.ContainerService /// /// > **Note** `network_profile_id` is [deprecated](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet) by Azure. For users who want to continue to manage existing `azure.containerservice.Group` that rely on `network_profile_id`, please stay on provider versions prior to v3.16.0. Otherwise, use `subnet_ids` instead. /// + /// ## Example Usage + /// + /// This example provisions a Basic Container. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleGroup = new Azure.ContainerService.Group("exampleGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpAddressType = "Public", + /// DnsNameLabel = "aci-label", + /// OsType = "Linux", + /// Containers = new[] + /// { + /// new Azure.ContainerService.Inputs.GroupContainerArgs + /// { + /// Name = "hello-world", + /// Image = "mcr.microsoft.com/azuredocs/aci-helloworld:latest", + /// Cpu = 0.5, + /// Memory = 1.5, + /// Ports = new[] + /// { + /// new Azure.ContainerService.Inputs.GroupContainerPortArgs + /// { + /// Port = 443, + /// Protocol = "TCP", + /// }, + /// }, + /// }, + /// new Azure.ContainerService.Inputs.GroupContainerArgs + /// { + /// Name = "sidecar", + /// Image = "mcr.microsoft.com/azuredocs/aci-tutorial-sidecar", + /// Cpu = 0.5, + /// Memory = 1.5, + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "testing" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Group's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxArgs.cs b/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxArgs.cs index 859ebd9bed..b5b8644691 100644 --- a/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxArgs.cs +++ b/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxArgs.cs @@ -30,6 +30,36 @@ public InputList /// > **Note:** At this time ACI Connectors are not supported in Azure China. /// /// > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var @virtual = new Azure.Network.Subnet("virtual", new() + /// { + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "aciDelegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/action", + /// }, + /// Name = "Microsoft.ContainerInstance/containerGroups", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// [Input("subnetName", required: true)] public Input SubnetName { get; set; } = null!; diff --git a/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxGetArgs.cs b/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxGetArgs.cs index 183b7a9b6c..ad07afe13c 100644 --- a/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxGetArgs.cs +++ b/sdk/dotnet/ContainerService/Inputs/KubernetesClusterAciConnectorLinuxGetArgs.cs @@ -30,6 +30,36 @@ public InputList [Input("subnetName", required: true)] public Input SubnetName { get; set; } = null!; diff --git a/sdk/dotnet/ContainerService/KubernetesCluster.cs b/sdk/dotnet/ContainerService/KubernetesCluster.cs index 94379d7dd1..335df3bd23 100644 --- a/sdk/dotnet/ContainerService/KubernetesCluster.cs +++ b/sdk/dotnet/ContainerService/KubernetesCluster.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.ContainerService /// /// Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service) /// + /// ## Example Usage + /// + /// This example provisions a basic Managed Kubernetes Cluster. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "exampleaks1", + /// DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs + /// { + /// Name = "default", + /// NodeCount = 1, + /// VmSize = "Standard_D2_v2", + /// }, + /// Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["clientCertificate"] = exampleKubernetesCluster.KubeConfigs.Apply(kubeConfigs => kubeConfigs[0].ClientCertificate), + /// ["kubeConfig"] = exampleKubernetesCluster.KubeConfigRaw, + /// }; + /// }); + /// ``` + /// /// ## Import /// /// Managed Kubernetes Clusters can be imported using the `resource id`, e.g. @@ -351,6 +397,55 @@ public partial class KubernetesCluster : global::Pulumi.CustomResource /// Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. /// /// > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleZone.Id, + /// RoleDefinitionName = "Private DNS Zone Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "aksexamplednsprefix1", + /// PrivateClusterEnabled = true, + /// PrivateDnsZoneId = exampleZone.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` /// [Output("privateClusterPublicFqdnEnabled")] public Output PrivateClusterPublicFqdnEnabled { get; private set; } = null!; @@ -796,6 +891,55 @@ public InputList CustomCaTrustCertificatesBase64s /// Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. /// /// > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleZone.Id, + /// RoleDefinitionName = "Private DNS Zone Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "aksexamplednsprefix1", + /// PrivateClusterEnabled = true, + /// PrivateDnsZoneId = exampleZone.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` /// [Input("privateClusterPublicFqdnEnabled")] public Input? PrivateClusterPublicFqdnEnabled { get; set; } @@ -1290,6 +1434,55 @@ public InputList KubeConfigs /// Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. /// /// > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleZone.Id, + /// RoleDefinitionName = "Private DNS Zone Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "aksexamplednsprefix1", + /// PrivateClusterEnabled = true, + /// PrivateDnsZoneId = exampleZone.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` /// [Input("privateClusterPublicFqdnEnabled")] public Input? PrivateClusterPublicFqdnEnabled { get; set; } diff --git a/sdk/dotnet/ContainerService/KubernetesClusterExtension.cs b/sdk/dotnet/ContainerService/KubernetesClusterExtension.cs index 936c5a1f5b..ec0af2fe02 100644 --- a/sdk/dotnet/ContainerService/KubernetesClusterExtension.cs +++ b/sdk/dotnet/ContainerService/KubernetesClusterExtension.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.ContainerService /// /// Manages a Kubernetes Cluster Extension. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = "West Europe", + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "example-aks", + /// DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs + /// { + /// Name = "default", + /// NodeCount = 1, + /// VmSize = "Standard_DS2_v2", + /// }, + /// Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleKubernetesClusterExtension = new Azure.ContainerService.KubernetesClusterExtension("exampleKubernetesClusterExtension", new() + /// { + /// ClusterId = exampleKubernetesCluster.Id, + /// ExtensionType = "microsoft.flux", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/dotnet/ContainerService/KubernetesClusterNodePool.cs b/sdk/dotnet/ContainerService/KubernetesClusterNodePool.cs index 24d9ffa32b..9d9a2feaac 100644 --- a/sdk/dotnet/ContainerService/KubernetesClusterNodePool.cs +++ b/sdk/dotnet/ContainerService/KubernetesClusterNodePool.cs @@ -14,6 +14,55 @@ namespace Pulumi.Azure.ContainerService /// /// > **NOTE:** Multiple Node Pools are only supported when the Kubernetes Cluster is using Virtual Machine Scale Sets. /// + /// ## Example Usage + /// + /// This example provisions a basic Kubernetes Node Pool. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "exampleaks1", + /// DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs + /// { + /// Name = "default", + /// NodeCount = 1, + /// VmSize = "Standard_D2_v2", + /// }, + /// ServicePrincipal = new Azure.ContainerService.Inputs.KubernetesClusterServicePrincipalArgs + /// { + /// ClientId = "00000000-0000-0000-0000-000000000000", + /// ClientSecret = "00000000000000000000000000000000", + /// }, + /// }); + /// + /// var exampleKubernetesClusterNodePool = new Azure.ContainerService.KubernetesClusterNodePool("exampleKubernetesClusterNodePool", new() + /// { + /// KubernetesClusterId = exampleKubernetesCluster.Id, + /// VmSize = "Standard_DS2_v2", + /// NodeCount = 1, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kubernetes Cluster Node Pools can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/KubernetesFleetManager.cs b/sdk/dotnet/ContainerService/KubernetesFleetManager.cs index 6ebe368be5..dee6408806 100644 --- a/sdk/dotnet/ContainerService/KubernetesFleetManager.cs +++ b/sdk/dotnet/ContainerService/KubernetesFleetManager.cs @@ -17,6 +17,29 @@ namespace Pulumi.Azure.ContainerService /// > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name FleetResourcePreview` and then `az provider register -n Microsoft.ContainerService` /// . /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKubernetesFleetManager = new Azure.ContainerService.KubernetesFleetManager("exampleKubernetesFleetManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` /// ## Blocks Reference /// /// ### `hub_profile` Block diff --git a/sdk/dotnet/ContainerService/Outputs/KubernetesClusterAciConnectorLinux.cs b/sdk/dotnet/ContainerService/Outputs/KubernetesClusterAciConnectorLinux.cs index bd8cd6dfd6..ce98f51e5d 100644 --- a/sdk/dotnet/ContainerService/Outputs/KubernetesClusterAciConnectorLinux.cs +++ b/sdk/dotnet/ContainerService/Outputs/KubernetesClusterAciConnectorLinux.cs @@ -23,6 +23,36 @@ public sealed class KubernetesClusterAciConnectorLinux /// > **Note:** At this time ACI Connectors are not supported in Azure China. /// /// > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var @virtual = new Azure.Network.Subnet("virtual", new() + /// { + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "aciDelegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/action", + /// }, + /// Name = "Microsoft.ContainerInstance/containerGroups", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// public readonly string SubnetName; diff --git a/sdk/dotnet/ContainerService/Registry.cs b/sdk/dotnet/ContainerService/Registry.cs index 747a64f166..6da08c9c90 100644 --- a/sdk/dotnet/ContainerService/Registry.cs +++ b/sdk/dotnet/ContainerService/Registry.cs @@ -12,6 +12,150 @@ namespace Pulumi.Azure.ContainerService /// /// Manages an Azure Container Registry. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var acr = new Azure.ContainerService.Registry("acr", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// Sku = "Premium", + /// AdminEnabled = false, + /// Georeplications = new[] + /// { + /// new Azure.ContainerService.Inputs.RegistryGeoreplicationArgs + /// { + /// Location = "East US", + /// ZoneRedundancyEnabled = true, + /// Tags = null, + /// }, + /// new Azure.ContainerService.Inputs.RegistryGeoreplicationArgs + /// { + /// Location = "North Europe", + /// ZoneRedundancyEnabled = true, + /// Tags = null, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Encryption) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleKey = Azure.KeyVault.GetKey.Invoke(new() + /// { + /// Name = "super-secret", + /// KeyVaultId = data.Azurerm_key_vault.Existing.Id, + /// }); + /// + /// var acr = new Azure.ContainerService.Registry("acr", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Premium", + /// Identity = new Azure.ContainerService.Inputs.RegistryIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Encryption = new Azure.ContainerService.Inputs.RegistryEncryptionArgs + /// { + /// Enabled = true, + /// KeyVaultKeyId = exampleKey.Apply(getKeyResult => getKeyResult.Id), + /// IdentityClientId = exampleUserAssignedIdentity.ClientId, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Attaching A Container Registry To A Kubernetes Cluster) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Premium", + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefix = "exampleaks1", + /// DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs + /// { + /// Name = "default", + /// NodeCount = 1, + /// VmSize = "Standard_D2_v2", + /// }, + /// Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// PrincipalId = exampleKubernetesCluster.KubeletIdentity.Apply(kubeletIdentity => kubeletIdentity.ObjectId), + /// RoleDefinitionName = "AcrPull", + /// Scope = exampleRegistry.Id, + /// SkipServicePrincipalAadCheck = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/RegistryAgentPool.cs b/sdk/dotnet/ContainerService/RegistryAgentPool.cs index 2c74ec1ef0..bc54df95c2 100644 --- a/sdk/dotnet/ContainerService/RegistryAgentPool.cs +++ b/sdk/dotnet/ContainerService/RegistryAgentPool.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.ContainerService /// /// Manages an Azure Container Registry Agent Pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europ", + /// }); + /// + /// var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Premium", + /// }); + /// + /// var exampleRegistryAgentPool = new Azure.ContainerService.RegistryAgentPool("exampleRegistryAgentPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ContainerRegistryName = exampleRegistry.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Container Registry Agent Pool can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/RegistryScopeMap.cs b/sdk/dotnet/ContainerService/RegistryScopeMap.cs index 490c0e9e6c..50a5d69637 100644 --- a/sdk/dotnet/ContainerService/RegistryScopeMap.cs +++ b/sdk/dotnet/ContainerService/RegistryScopeMap.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.ContainerService /// /// Manages an Azure Container Registry scope map. Scope Maps are a preview feature only available in Premium SKU Container registries. /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Premium", + /// AdminEnabled = false, + /// Georeplications = new[] + /// { + /// new Azure.ContainerService.Inputs.RegistryGeoreplicationArgs + /// { + /// Location = "East US", + /// }, + /// new Azure.ContainerService.Inputs.RegistryGeoreplicationArgs + /// { + /// Location = "West Europe", + /// }, + /// }, + /// }); + /// + /// var exampleRegistryScopeMap = new Azure.ContainerService.RegistryScopeMap("exampleRegistryScopeMap", new() + /// { + /// ContainerRegistryName = exampleRegistry.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Actions = new[] + /// { + /// "repositories/repo1/content/read", + /// "repositories/repo1/content/write", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/RegistryTask.cs b/sdk/dotnet/ContainerService/RegistryTask.cs index 031fed496e..da9eb57552 100644 --- a/sdk/dotnet/ContainerService/RegistryTask.cs +++ b/sdk/dotnet/ContainerService/RegistryTask.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.ContainerService /// /// Manages a Container Registry Task. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Basic", + /// }); + /// + /// var exampleRegistryTask = new Azure.ContainerService.RegistryTask("exampleRegistryTask", new() + /// { + /// ContainerRegistryId = exampleRegistry.Id, + /// Platform = new Azure.ContainerService.Inputs.RegistryTaskPlatformArgs + /// { + /// Os = "Linux", + /// }, + /// DockerStep = new Azure.ContainerService.Inputs.RegistryTaskDockerStepArgs + /// { + /// DockerfilePath = "Dockerfile", + /// ContextPath = "https://github.com/<username>/<repository>#<branch>:<folder>", + /// ContextAccessToken = "<github personal access token>", + /// ImageNames = new[] + /// { + /// "helloworld:{{.Run.ID}}", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Registry Tasks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/RegistryTaskScheduleRunNow.cs b/sdk/dotnet/ContainerService/RegistryTaskScheduleRunNow.cs index 9d0b6ace32..b162bfc031 100644 --- a/sdk/dotnet/ContainerService/RegistryTaskScheduleRunNow.cs +++ b/sdk/dotnet/ContainerService/RegistryTaskScheduleRunNow.cs @@ -11,6 +11,55 @@ namespace Pulumi.Azure.ContainerService { /// /// Runs a Container Registry Task Schedule. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Basic", + /// }); + /// + /// var exampleRegistryTask = new Azure.ContainerService.RegistryTask("exampleRegistryTask", new() + /// { + /// ContainerRegistryId = exampleRegistry.Id, + /// Platform = new Azure.ContainerService.Inputs.RegistryTaskPlatformArgs + /// { + /// Os = "Linux", + /// }, + /// DockerStep = new Azure.ContainerService.Inputs.RegistryTaskDockerStepArgs + /// { + /// DockerfilePath = "Dockerfile", + /// ContextPath = "https://github.com/<user name>/acr-build-helloworld-node#main", + /// ContextAccessToken = "<github personal access token>", + /// ImageNames = new[] + /// { + /// "helloworld:{{.Run.ID}}", + /// }, + /// }, + /// }); + /// + /// var exampleRegistryTaskScheduleRunNow = new Azure.ContainerService.RegistryTaskScheduleRunNow("exampleRegistryTaskScheduleRunNow", new() + /// { + /// ContainerRegistryTaskId = exampleRegistryTask.Id, + /// }); + /// + /// }); + /// ``` /// [AzureResourceType("azure:containerservice/registryTaskScheduleRunNow:RegistryTaskScheduleRunNow")] public partial class RegistryTaskScheduleRunNow : global::Pulumi.CustomResource diff --git a/sdk/dotnet/ContainerService/RegistryToken.cs b/sdk/dotnet/ContainerService/RegistryToken.cs index 56ff6bc36a..b19bd3c766 100644 --- a/sdk/dotnet/ContainerService/RegistryToken.cs +++ b/sdk/dotnet/ContainerService/RegistryToken.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.ContainerService /// /// Manages an Azure Container Registry token. Tokens are a preview feature only available in Premium SKU Container registries. /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRegistry = new Azure.ContainerService.Registry("exampleRegistry", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Premium", + /// AdminEnabled = false, + /// Georeplications = new[] + /// { + /// new Azure.ContainerService.Inputs.RegistryGeoreplicationArgs + /// { + /// Location = "East US", + /// }, + /// new Azure.ContainerService.Inputs.RegistryGeoreplicationArgs + /// { + /// Location = "West Europe", + /// }, + /// }, + /// }); + /// + /// var exampleRegistryScopeMap = new Azure.ContainerService.RegistryScopeMap("exampleRegistryScopeMap", new() + /// { + /// ContainerRegistryName = exampleRegistry.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Actions = new[] + /// { + /// "repositories/repo1/content/read", + /// "repositories/repo1/content/write", + /// }, + /// }); + /// + /// var exampleRegistryToken = new Azure.ContainerService.RegistryToken("exampleRegistryToken", new() + /// { + /// ContainerRegistryName = exampleRegistry.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ScopeMapId = exampleRegistryScopeMap.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/RegistryWebhook.cs b/sdk/dotnet/ContainerService/RegistryWebhook.cs index aea6bd65c4..7f087054eb 100644 --- a/sdk/dotnet/ContainerService/RegistryWebhook.cs +++ b/sdk/dotnet/ContainerService/RegistryWebhook.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.ContainerService /// /// Manages an Azure Container Registry Webhook. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var acr = new Azure.ContainerService.Registry("acr", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// Sku = "Standard", + /// AdminEnabled = false, + /// }); + /// + /// var webhook = new Azure.ContainerService.RegistryWebhook("webhook", new() + /// { + /// ResourceGroupName = example.Name, + /// RegistryName = acr.Name, + /// Location = example.Location, + /// ServiceUri = "https://mywebhookreceiver.example/mytag", + /// Status = "enabled", + /// Scope = "mytag:*", + /// Actions = new[] + /// { + /// "push", + /// }, + /// CustomHeaders = + /// { + /// { "Content-Type", "application/json" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ContainerService/RegistryWebook.cs b/sdk/dotnet/ContainerService/RegistryWebook.cs index d5f4a84c03..b59172979a 100644 --- a/sdk/dotnet/ContainerService/RegistryWebook.cs +++ b/sdk/dotnet/ContainerService/RegistryWebook.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.ContainerService /// /// Manages an Azure Container Registry Webhook. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var acr = new Azure.ContainerService.Registry("acr", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// Sku = "Standard", + /// AdminEnabled = false, + /// }); + /// + /// var webhook = new Azure.ContainerService.RegistryWebhook("webhook", new() + /// { + /// ResourceGroupName = example.Name, + /// RegistryName = acr.Name, + /// Location = example.Location, + /// ServiceUri = "https://mywebhookreceiver.example/mytag", + /// Status = "enabled", + /// Scope = "mytag:*", + /// Actions = new[] + /// { + /// "push", + /// }, + /// CustomHeaders = + /// { + /// { "Content-Type", "application/json" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/CustomProvider.cs b/sdk/dotnet/Core/CustomProvider.cs index 076b4092fa..771d346bac 100644 --- a/sdk/dotnet/Core/CustomProvider.cs +++ b/sdk/dotnet/Core/CustomProvider.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Core /// /// Manages an Azure Custom Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCustomProvider = new Azure.Core.CustomProvider("exampleCustomProvider", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ResourceTypes = new[] + /// { + /// new Azure.Core.Inputs.CustomProviderResourceTypeArgs + /// { + /// Name = "dEf1", + /// Endpoint = "https://testendpoint.com/", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Custom Provider can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/GetClientConfig.cs b/sdk/dotnet/Core/GetClientConfig.cs index af2c61f782..e8aa17e7ef 100644 --- a/sdk/dotnet/Core/GetClientConfig.cs +++ b/sdk/dotnet/Core/GetClientConfig.cs @@ -13,12 +13,58 @@ public static class GetClientConfig { /// /// Use this data source to access the configuration of the AzureRM provider. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accountId"] = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:core/getClientConfig:getClientConfig", InvokeArgs.Empty, options.WithDefaults()); /// /// Use this data source to access the configuration of the AzureRM provider. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accountId"] = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:core/getClientConfig:getClientConfig", InvokeArgs.Empty, options.WithDefaults()); diff --git a/sdk/dotnet/Core/GetExtendedLocations.cs b/sdk/dotnet/Core/GetExtendedLocations.cs index bbf316a0d3..22595e9116 100644 --- a/sdk/dotnet/Core/GetExtendedLocations.cs +++ b/sdk/dotnet/Core/GetExtendedLocations.cs @@ -13,12 +13,56 @@ public static class GetExtendedLocations { /// /// This data source return the available Extended Locations for a specific Azure Region. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Core.GetExtendedLocations.Invoke(new() + /// { + /// Location = "West Europe", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetExtendedLocationsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:core/getExtendedLocations:getExtendedLocations", args ?? new GetExtendedLocationsArgs(), options.WithDefaults()); /// /// This data source return the available Extended Locations for a specific Azure Region. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Core.GetExtendedLocations.Invoke(new() + /// { + /// Location = "West Europe", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetExtendedLocationsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:core/getExtendedLocations:getExtendedLocations", args ?? new GetExtendedLocationsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Core/GetResourceGroup.cs b/sdk/dotnet/Core/GetResourceGroup.cs index cae9cc3bfe..78df00ef25 100644 --- a/sdk/dotnet/Core/GetResourceGroup.cs +++ b/sdk/dotnet/Core/GetResourceGroup.cs @@ -13,12 +13,64 @@ public static class GetResourceGroup { /// /// Use this data source to access information about an existing Resource Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Core.GetResourceGroup.Invoke(new() + /// { + /// Name = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getResourceGroupResult => getResourceGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetResourceGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:core/getResourceGroup:getResourceGroup", args ?? new GetResourceGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Resource Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Core.GetResourceGroup.Invoke(new() + /// { + /// Name = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getResourceGroupResult => getResourceGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetResourceGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:core/getResourceGroup:getResourceGroup", args ?? new GetResourceGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Core/GetSubscription.cs b/sdk/dotnet/Core/GetSubscription.cs index 797d927bf9..62a8dd0637 100644 --- a/sdk/dotnet/Core/GetSubscription.cs +++ b/sdk/dotnet/Core/GetSubscription.cs @@ -13,12 +13,58 @@ public static class GetSubscription { /// /// Use this data source to access information about an existing Subscription. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// return new Dictionary<string, object?> + /// { + /// ["currentSubscriptionDisplayName"] = current.Apply(getSubscriptionResult => getSubscriptionResult.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSubscriptionArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:core/getSubscription:getSubscription", args ?? new GetSubscriptionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Subscription. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// return new Dictionary<string, object?> + /// { + /// ["currentSubscriptionDisplayName"] = current.Apply(getSubscriptionResult => getSubscriptionResult.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSubscriptionInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:core/getSubscription:getSubscription", args ?? new GetSubscriptionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Core/GetSubscriptions.cs b/sdk/dotnet/Core/GetSubscriptions.cs index 562158c610..3e2ffce709 100644 --- a/sdk/dotnet/Core/GetSubscriptions.cs +++ b/sdk/dotnet/Core/GetSubscriptions.cs @@ -13,12 +13,60 @@ public static class GetSubscriptions { /// /// Use this data source to access information about all the Subscriptions currently available. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var available = Azure.Core.GetSubscriptions.Invoke(); + /// + /// return new Dictionary<string, object?> + /// { + /// ["availableSubscriptions"] = available.Apply(getSubscriptionsResult => getSubscriptionsResult.Subscriptions), + /// ["firstAvailableSubscriptionDisplayName"] = available.Apply(getSubscriptionsResult => getSubscriptionsResult.Subscriptions[0]?.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSubscriptionsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:core/getSubscriptions:getSubscriptions", args ?? new GetSubscriptionsArgs(), options.WithDefaults()); /// /// Use this data source to access information about all the Subscriptions currently available. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var available = Azure.Core.GetSubscriptions.Invoke(); + /// + /// return new Dictionary<string, object?> + /// { + /// ["availableSubscriptions"] = available.Apply(getSubscriptionsResult => getSubscriptionsResult.Subscriptions), + /// ["firstAvailableSubscriptionDisplayName"] = available.Apply(getSubscriptionsResult => getSubscriptionsResult.Subscriptions[0]?.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSubscriptionsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:core/getSubscriptions:getSubscriptions", args ?? new GetSubscriptionsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Core/GetTemplateSpecVersion.cs b/sdk/dotnet/Core/GetTemplateSpecVersion.cs index 873ac5e4a7..eb301149a6 100644 --- a/sdk/dotnet/Core/GetTemplateSpecVersion.cs +++ b/sdk/dotnet/Core/GetTemplateSpecVersion.cs @@ -13,12 +13,68 @@ public static class GetTemplateSpecVersion { /// /// Use this data source to access information about an existing Template Spec Version. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Core.GetTemplateSpecVersion.Invoke(new() + /// { + /// Name = "exampleTemplateSpec", + /// ResourceGroupName = "MyResourceGroup", + /// Version = "v1.0.4", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getTemplateSpecVersionResult => getTemplateSpecVersionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTemplateSpecVersionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:core/getTemplateSpecVersion:getTemplateSpecVersion", args ?? new GetTemplateSpecVersionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Template Spec Version. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Core.GetTemplateSpecVersion.Invoke(new() + /// { + /// Name = "exampleTemplateSpec", + /// ResourceGroupName = "MyResourceGroup", + /// Version = "v1.0.4", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getTemplateSpecVersionResult => getTemplateSpecVersionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTemplateSpecVersionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:core/getTemplateSpecVersion:getTemplateSpecVersion", args ?? new GetTemplateSpecVersionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Core/GetUserAssignedIdentity.cs b/sdk/dotnet/Core/GetUserAssignedIdentity.cs index a12935bb21..4ac6beaca7 100644 --- a/sdk/dotnet/Core/GetUserAssignedIdentity.cs +++ b/sdk/dotnet/Core/GetUserAssignedIdentity.cs @@ -17,6 +17,32 @@ public static class GetUserAssignedIdentity /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Authorization.GetUserAssignedIdentity.Invoke(new() + /// { + /// Name = "name_of_user_assigned_identity", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["uaiClientId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.ClientId), + /// ["uaiPrincipalId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.PrincipalId), + /// ["uaiTenantId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.TenantId), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Task InvokeAsync(GetUserAssignedIdentityArgs args, InvokeOptions? options = null) @@ -27,6 +53,32 @@ public static Task InvokeAsync(GetUserAssignedIde /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Authorization.GetUserAssignedIdentity.Invoke(new() + /// { + /// Name = "name_of_user_assigned_identity", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["uaiClientId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.ClientId), + /// ["uaiPrincipalId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.PrincipalId), + /// ["uaiTenantId"] = example.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.TenantId), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Output Invoke(GetUserAssignedIdentityInvokeArgs args, InvokeOptions? options = null) diff --git a/sdk/dotnet/Core/PortalTenantConfiguration.cs b/sdk/dotnet/Core/PortalTenantConfiguration.cs index c1acb9654e..1074546dc2 100644 --- a/sdk/dotnet/Core/PortalTenantConfiguration.cs +++ b/sdk/dotnet/Core/PortalTenantConfiguration.cs @@ -20,6 +20,24 @@ namespace Pulumi.Azure.Core /// /// > **Note:** While assigning the role to the existing/new Service Principal at the Tenant Scope, the user assigning role must already have the `Owner` role assigned at the Tenant Scope. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.PortalTenantConfiguration("example", new() + /// { + /// PrivateMarkdownStorageEnforced = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Portal Tenant Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceDeploymentScriptAzureCli.cs b/sdk/dotnet/Core/ResourceDeploymentScriptAzureCli.cs index d267f65dd9..b5d8efe4bf 100644 --- a/sdk/dotnet/Core/ResourceDeploymentScriptAzureCli.cs +++ b/sdk/dotnet/Core/ResourceDeploymentScriptAzureCli.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.Core /// /// Manages a Resource Deployment Script of Azure Cli. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleResourceDeploymentScriptAzureCli = new Azure.Core.ResourceDeploymentScriptAzureCli("exampleResourceDeploymentScriptAzureCli", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// Version = "2.40.0", + /// RetentionInterval = "P1D", + /// CommandLine = "'foo' 'bar'", + /// CleanupPreference = "OnSuccess", + /// ForceUpdateTag = "1", + /// Timeout = "PT30M", + /// ScriptContent = @" echo ""{\""name\"":{\""displayName\"":\""$1 $2\""}}"" > $AZ_SCRIPTS_OUTPUT_PATH + /// ", + /// Identity = new Azure.Core.Inputs.ResourceDeploymentScriptAzureCliIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceDeploymentScriptPowerShell.cs b/sdk/dotnet/Core/ResourceDeploymentScriptPowerShell.cs index 1a43f8a9cd..6fd188d375 100644 --- a/sdk/dotnet/Core/ResourceDeploymentScriptPowerShell.cs +++ b/sdk/dotnet/Core/ResourceDeploymentScriptPowerShell.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.Core /// /// Manages a Resource Deployment Script of Azure PowerShell. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleResourceDeploymentScriptPowerShell = new Azure.Core.ResourceDeploymentScriptPowerShell("exampleResourceDeploymentScriptPowerShell", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// Version = "8.3", + /// RetentionInterval = "P1D", + /// CommandLine = "-name \"John Dole\"", + /// CleanupPreference = "OnSuccess", + /// ForceUpdateTag = "1", + /// Timeout = "PT30M", + /// ScriptContent = @" param([string] $name) + /// $output = 'Hello {0}.' -f $name + /// Write-Output $output + /// $DeploymentScriptOutputs = @{} + /// $DeploymentScriptOutputs['text'] = $output + /// ", + /// Identity = new Azure.Core.Inputs.ResourceDeploymentScriptPowerShellIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceGroup.cs b/sdk/dotnet/Core/ResourceGroup.cs index 183940b9ab..b17cd1bcda 100644 --- a/sdk/dotnet/Core/ResourceGroup.cs +++ b/sdk/dotnet/Core/ResourceGroup.cs @@ -10,6 +10,24 @@ namespace Pulumi.Azure.Core { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceGroupCostManagementExport.cs b/sdk/dotnet/Core/ResourceGroupCostManagementExport.cs index f85b847888..49897f1f40 100644 --- a/sdk/dotnet/Core/ResourceGroupCostManagementExport.cs +++ b/sdk/dotnet/Core/ResourceGroupCostManagementExport.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.Core /// /// Manages a Cost Management Export for a Resource Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleResourceGroupCostManagementExport = new Azure.Core.ResourceGroupCostManagementExport("exampleResourceGroupCostManagementExport", new() + /// { + /// ResourceGroupId = exampleResourceGroup.Id, + /// RecurrenceType = "Monthly", + /// RecurrencePeriodStartDate = "2020-08-18T00:00:00Z", + /// RecurrencePeriodEndDate = "2020-09-18T00:00:00Z", + /// ExportDataStorageLocation = new Azure.Core.Inputs.ResourceGroupCostManagementExportExportDataStorageLocationArgs + /// { + /// ContainerId = exampleContainer.ResourceManagerId, + /// RootFolderPath = "/root/updated", + /// }, + /// ExportDataOptions = new Azure.Core.Inputs.ResourceGroupCostManagementExportExportDataOptionsArgs + /// { + /// Type = "Usage", + /// TimeFrame = "WeekToDate", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cost Management Export for a Resource Group can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceGroupCostManagementView.cs b/sdk/dotnet/Core/ResourceGroupCostManagementView.cs index 9a7adfaf1e..11b2eaaa86 100644 --- a/sdk/dotnet/Core/ResourceGroupCostManagementView.cs +++ b/sdk/dotnet/Core/ResourceGroupCostManagementView.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Core /// /// Manages an Azure Cost Management View for a Resource Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleResourceGroupCostManagementView = new Azure.Core.ResourceGroupCostManagementView("exampleResourceGroupCostManagementView", new() + /// { + /// DisplayName = "Cost View per Month", + /// ChartType = "StackedColumn", + /// Accumulated = false, + /// ResourceGroupId = exampleResourceGroup.Id, + /// ReportType = "Usage", + /// Timeframe = "MonthToDate", + /// Dataset = new Azure.Core.Inputs.ResourceGroupCostManagementViewDatasetArgs + /// { + /// Granularity = "Monthly", + /// Aggregations = new[] + /// { + /// new Azure.Core.Inputs.ResourceGroupCostManagementViewDatasetAggregationArgs + /// { + /// Name = "totalCost", + /// ColumnName = "Cost", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cost Management View for a Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceGroupPolicyAssignment.cs b/sdk/dotnet/Core/ResourceGroupPolicyAssignment.cs index 9527513137..c93e5fc03e 100644 --- a/sdk/dotnet/Core/ResourceGroupPolicyAssignment.cs +++ b/sdk/dotnet/Core/ResourceGroupPolicyAssignment.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.Core /// /// Manages a Resource Group Policy Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDefinition = new Azure.Policy.Definition("exampleDefinition", new() + /// { + /// PolicyType = "Custom", + /// Mode = "All", + /// DisplayName = "my-policy-definition", + /// PolicyRule = @" { + /// ""if"": { + /// ""not"": { + /// ""field"": ""location"", + /// ""equals"": ""westeurope"" + /// } + /// }, + /// ""then"": { + /// ""effect"": ""Deny"" + /// } + /// } + /// ", + /// }); + /// + /// var exampleResourceGroupPolicyAssignment = new Azure.Core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", new() + /// { + /// ResourceGroupId = exampleResourceGroup.Id, + /// PolicyDefinitionId = exampleDefinition.Id, + /// Parameters = @" { + /// ""tagName"": { + /// ""value"": ""Business Unit"" + /// }, + /// ""tagValue"": { + /// ""value"": ""BU"" + /// } + /// } + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceGroupPolicyExemption.cs b/sdk/dotnet/Core/ResourceGroupPolicyExemption.cs index 7729ce79c1..eb106e8bc4 100644 --- a/sdk/dotnet/Core/ResourceGroupPolicyExemption.cs +++ b/sdk/dotnet/Core/ResourceGroupPolicyExemption.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.Core /// /// Manages a Resource Group Policy Exemption. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "westus", + /// }); + /// + /// var examplePolicyDefintion = Azure.Policy.GetPolicyDefintion.Invoke(new() + /// { + /// DisplayName = "Allowed locations", + /// }); + /// + /// var exampleResourceGroupPolicyAssignment = new Azure.Core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", new() + /// { + /// ResourceGroupId = exampleResourceGroup.Id, + /// PolicyDefinitionId = examplePolicyDefintion.Apply(getPolicyDefintionResult => getPolicyDefintionResult.Id), + /// Parameters = exampleResourceGroup.Location.Apply(location => JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["listOfAllowedLocations"] = new Dictionary<string, object?> + /// { + /// ["value"] = new[] + /// { + /// location, + /// }, + /// }, + /// })), + /// }); + /// + /// var exampleResourceGroupPolicyExemption = new Azure.Core.ResourceGroupPolicyExemption("exampleResourceGroupPolicyExemption", new() + /// { + /// ResourceGroupId = exampleResourceGroup.Id, + /// PolicyAssignmentId = exampleResourceGroupPolicyAssignment.Id, + /// ExemptionCategory = "Mitigated", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourcePolicyAssignment.cs b/sdk/dotnet/Core/ResourcePolicyAssignment.cs index 8e91aefd93..20c93bf34c 100644 --- a/sdk/dotnet/Core/ResourcePolicyAssignment.cs +++ b/sdk/dotnet/Core/ResourcePolicyAssignment.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Core /// /// Manages a Policy Assignment to a Resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleVirtualNetwork = Azure.Network.GetVirtualNetwork.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// var exampleDefinition = new Azure.Policy.Definition("exampleDefinition", new() + /// { + /// PolicyType = "Custom", + /// Mode = "All", + /// DisplayName = "my-policy-definition", + /// PolicyRule = @" { + /// ""if"": { + /// ""not"": { + /// ""field"": ""location"", + /// ""equals"": ""westeurope"" + /// } + /// }, + /// ""then"": { + /// ""effect"": ""Deny"" + /// } + /// } + /// ", + /// }); + /// + /// var exampleResourcePolicyAssignment = new Azure.Core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", new() + /// { + /// ResourceId = exampleVirtualNetwork.Apply(getVirtualNetworkResult => getVirtualNetworkResult.Id), + /// PolicyDefinitionId = exampleDefinition.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourcePolicyExemption.cs b/sdk/dotnet/Core/ResourcePolicyExemption.cs index e6f8ef0012..96047b653c 100644 --- a/sdk/dotnet/Core/ResourcePolicyExemption.cs +++ b/sdk/dotnet/Core/ResourcePolicyExemption.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.Core /// /// Manages a Resource Policy Exemption. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "westus", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var examplePolicySetDefinition = Azure.Policy.GetPolicySetDefinition.Invoke(new() + /// { + /// DisplayName = "Audit machines with insecure password security settings", + /// }); + /// + /// var exampleResourcePolicyAssignment = new Azure.Core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", new() + /// { + /// ResourceId = exampleVirtualNetwork.Id, + /// PolicyDefinitionId = examplePolicySetDefinition.Apply(getPolicySetDefinitionResult => getPolicySetDefinitionResult.Id), + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.Core.Inputs.ResourcePolicyAssignmentIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleResourcePolicyExemption = new Azure.Core.ResourcePolicyExemption("exampleResourcePolicyExemption", new() + /// { + /// ResourceId = exampleResourcePolicyAssignment.ResourceId, + /// PolicyAssignmentId = exampleResourcePolicyAssignment.Id, + /// ExemptionCategory = "Mitigated", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/ResourceProviderRegistration.cs b/sdk/dotnet/Core/ResourceProviderRegistration.cs index bb91d19f1f..96d6826b1a 100644 --- a/sdk/dotnet/Core/ResourceProviderRegistration.cs +++ b/sdk/dotnet/Core/ResourceProviderRegistration.cs @@ -18,6 +18,45 @@ namespace Pulumi.Azure.Core /// /// > **Note:** Adding or Removing a Preview Feature will re-register the Resource Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceProviderRegistration("example"); + /// + /// }); + /// ``` + /// ### Registering A Preview Feature) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceProviderRegistration("example", new() + /// { + /// Features = new[] + /// { + /// new Azure.Core.Inputs.ResourceProviderRegistrationFeatureArgs + /// { + /// Name = "AKS-DataPlaneAutoApprove", + /// Registered = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Provider Registrations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/Subscription.cs b/sdk/dotnet/Core/Subscription.cs index 41c6e5d0e5..cad4feee91 100644 --- a/sdk/dotnet/Core/Subscription.cs +++ b/sdk/dotnet/Core/Subscription.cs @@ -11,6 +11,98 @@ namespace Pulumi.Azure.Core { /// /// ## Example Usage + /// ### Creating A New Alias And Subscription For An Enrollment Account + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleEnrollmentAccountScope = Azure.Billing.GetEnrollmentAccountScope.Invoke(new() + /// { + /// BillingAccountName = "1234567890", + /// EnrollmentAccountName = "0123456", + /// }); + /// + /// var exampleSubscription = new Azure.Core.Subscription("exampleSubscription", new() + /// { + /// SubscriptionName = "My Example EA Subscription", + /// BillingScopeId = exampleEnrollmentAccountScope.Apply(getEnrollmentAccountScopeResult => getEnrollmentAccountScopeResult.Id), + /// }); + /// + /// }); + /// ``` + /// ### Creating A New Alias And Subscription For A Microsoft Customer Account + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleMcaAccountScope = Azure.Billing.GetMcaAccountScope.Invoke(new() + /// { + /// BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + /// BillingProfileName = "PE2Q-NOIT-BG7-TGB", + /// InvoiceSectionName = "MTT4-OBS7-PJA-TGB", + /// }); + /// + /// var exampleSubscription = new Azure.Core.Subscription("exampleSubscription", new() + /// { + /// SubscriptionName = "My Example MCA Subscription", + /// BillingScopeId = exampleMcaAccountScope.Apply(getMcaAccountScopeResult => getMcaAccountScopeResult.Id), + /// }); + /// + /// }); + /// ``` + /// ### Creating A New Alias And Subscription For A Microsoft Partner Account + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleMpaAccountScope = Azure.Billing.GetMpaAccountScope.Invoke(new() + /// { + /// BillingAccountName = "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + /// CustomerName = "2281f543-7321-4cf9-1e23-edb4Oc31a31c", + /// }); + /// + /// var exampleSubscription = new Azure.Core.Subscription("exampleSubscription", new() + /// { + /// SubscriptionName = "My Example MPA Subscription", + /// BillingScopeId = exampleMpaAccountScope.Apply(getMpaAccountScopeResult => getMpaAccountScopeResult.Id), + /// }); + /// + /// }); + /// ``` + /// ### Adding An Alias To An Existing Subscription + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.Subscription("example", new() + /// { + /// Alias = "examplesub", + /// SubscriptionId = "12345678-12234-5678-9012-123456789012", + /// SubscriptionName = "My Example Subscription", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Core/SubscriptionCostManagementExport.cs b/sdk/dotnet/Core/SubscriptionCostManagementExport.cs index 5197f7e481..72e15b8bd1 100644 --- a/sdk/dotnet/Core/SubscriptionCostManagementExport.cs +++ b/sdk/dotnet/Core/SubscriptionCostManagementExport.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.Core /// /// Manages a Cost Management Export for a Subscription. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleSubscription = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleSubscriptionCostManagementExport = new Azure.Core.SubscriptionCostManagementExport("exampleSubscriptionCostManagementExport", new() + /// { + /// SubscriptionId = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RecurrenceType = "Monthly", + /// RecurrencePeriodStartDate = "2020-08-18T00:00:00Z", + /// RecurrencePeriodEndDate = "2020-09-18T00:00:00Z", + /// ExportDataStorageLocation = new Azure.Core.Inputs.SubscriptionCostManagementExportExportDataStorageLocationArgs + /// { + /// ContainerId = exampleContainer.ResourceManagerId, + /// RootFolderPath = "/root/updated", + /// }, + /// ExportDataOptions = new Azure.Core.Inputs.SubscriptionCostManagementExportExportDataOptionsArgs + /// { + /// Type = "Usage", + /// TimeFrame = "WeekToDate", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subscription Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/SubscriptionCostManagementView.cs b/sdk/dotnet/Core/SubscriptionCostManagementView.cs index c5670e6396..8ac20f6ff5 100644 --- a/sdk/dotnet/Core/SubscriptionCostManagementView.cs +++ b/sdk/dotnet/Core/SubscriptionCostManagementView.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Core /// /// Manages an Azure Cost Management View for a Subscription. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.SubscriptionCostManagementView("example", new() + /// { + /// Accumulated = false, + /// ChartType = "StackedColumn", + /// Dataset = new Azure.Core.Inputs.SubscriptionCostManagementViewDatasetArgs + /// { + /// Aggregations = new[] + /// { + /// new Azure.Core.Inputs.SubscriptionCostManagementViewDatasetAggregationArgs + /// { + /// ColumnName = "Cost", + /// Name = "totalCost", + /// }, + /// }, + /// Granularity = "Monthly", + /// }, + /// DisplayName = "Cost View per Month", + /// ReportType = "Usage", + /// SubscriptionId = "/subscription/00000000-0000-0000-0000-000000000000", + /// Timeframe = "MonthToDate", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cost Management View for a Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/SubscriptionPolicyAssignment.cs b/sdk/dotnet/Core/SubscriptionPolicyAssignment.cs index c74eeac592..fc5fb573eb 100644 --- a/sdk/dotnet/Core/SubscriptionPolicyAssignment.cs +++ b/sdk/dotnet/Core/SubscriptionPolicyAssignment.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Core /// /// Manages a Subscription Policy Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleDefinition = new Azure.Policy.Definition("exampleDefinition", new() + /// { + /// PolicyType = "Custom", + /// Mode = "All", + /// DisplayName = "Allowed resource types", + /// PolicyRule = @" { + /// ""if"": { + /// ""not"": { + /// ""field"": ""location"", + /// ""equals"": ""westeurope"" + /// } + /// }, + /// ""then"": { + /// ""effect"": ""Deny"" + /// } + /// } + /// ", + /// }); + /// + /// var exampleSubscriptionPolicyAssignment = new Azure.Core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", new() + /// { + /// PolicyDefinitionId = exampleDefinition.Id, + /// SubscriptionId = current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subscription Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/SubscriptionPolicyExemption.cs b/sdk/dotnet/Core/SubscriptionPolicyExemption.cs index 271ae99ea0..0341a59ca3 100644 --- a/sdk/dotnet/Core/SubscriptionPolicyExemption.cs +++ b/sdk/dotnet/Core/SubscriptionPolicyExemption.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Core /// /// Manages a Subscription Policy Exemption. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleSubscription = Azure.Core.GetSubscription.Invoke(); + /// + /// var examplePolicySetDefinition = Azure.Policy.GetPolicySetDefinition.Invoke(new() + /// { + /// DisplayName = "Audit machines with insecure password security settings", + /// }); + /// + /// var exampleSubscriptionPolicyAssignment = new Azure.Core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", new() + /// { + /// SubscriptionId = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// PolicyDefinitionId = examplePolicySetDefinition.Apply(getPolicySetDefinitionResult => getPolicySetDefinitionResult.Id), + /// Location = "westus", + /// Identity = new Azure.Core.Inputs.SubscriptionPolicyAssignmentIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSubscriptionPolicyExemption = new Azure.Core.SubscriptionPolicyExemption("exampleSubscriptionPolicyExemption", new() + /// { + /// SubscriptionId = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// PolicyAssignmentId = exampleSubscriptionPolicyAssignment.Id, + /// ExemptionCategory = "Mitigated", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/SubscriptionTemplateDeployment.cs b/sdk/dotnet/Core/SubscriptionTemplateDeployment.cs index f24685d0c5..67736aaa15 100644 --- a/sdk/dotnet/Core/SubscriptionTemplateDeployment.cs +++ b/sdk/dotnet/Core/SubscriptionTemplateDeployment.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Core /// /// Manages a Subscription Template Deployment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.SubscriptionTemplateDeployment("example", new() + /// { + /// Location = "West Europe", + /// TemplateContent = @" { + /// ""$schema"": ""https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"", + /// ""contentVersion"": ""1.0.0.0"", + /// ""parameters"": {}, + /// ""variables"": {}, + /// ""resources"": [ + /// { + /// ""type"": ""Microsoft.Resources/resourceGroups"", + /// ""apiVersion"": ""2018-05-01"", + /// ""location"": ""West Europe"", + /// ""name"": ""some-resource-group"", + /// ""properties"": {} + /// } + /// ] + /// } + /// + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subscription Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Core/TemplateDeployment.cs b/sdk/dotnet/Core/TemplateDeployment.cs index 56f03bf774..aab39510eb 100644 --- a/sdk/dotnet/Core/TemplateDeployment.cs +++ b/sdk/dotnet/Core/TemplateDeployment.cs @@ -16,6 +16,95 @@ namespace Pulumi.Azure.Core /// This means that when deleting the `azure.core.TemplateDeployment` resource, this provider will only remove the reference to the deployment, whilst leaving any resources created by that ARM Template Deployment. /// One workaround for this is to use a unique Resource Group for each ARM Template Deployment, which means deleting the Resource Group would contain any resources created within it - however this isn't ideal. [More information](https://docs.microsoft.com/en-us/rest/api/resources/deployments#Deployments_Delete). /// + /// ## Example Usage + /// + /// > **Note:** This example uses Storage Accounts and Public IP's which are natively supported by this provider - we'd highly recommend using the Native Resources where possible instead rather than an ARM Template, for the reasons outlined above. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTemplateDeployment = new Azure.Core.TemplateDeployment("exampleTemplateDeployment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// TemplateBody = @"{ + /// ""$schema"": ""https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#"", + /// ""contentVersion"": ""1.0.0.0"", + /// ""parameters"": { + /// ""storageAccountType"": { + /// ""type"": ""string"", + /// ""defaultValue"": ""Standard_LRS"", + /// ""allowedValues"": [ + /// ""Standard_LRS"", + /// ""Standard_GRS"", + /// ""Standard_ZRS"" + /// ], + /// ""metadata"": { + /// ""description"": ""Storage Account type"" + /// } + /// } + /// }, + /// ""variables"": { + /// ""location"": ""[resourceGroup().location]"", + /// ""storageAccountName"": ""[concat(uniquestring(resourceGroup().id), 'storage')]"", + /// ""publicIPAddressName"": ""[concat('myPublicIp', uniquestring(resourceGroup().id))]"", + /// ""publicIPAddressType"": ""Dynamic"", + /// ""apiVersion"": ""2015-06-15"", + /// ""dnsLabelPrefix"": ""example-acctest"" + /// }, + /// ""resources"": [ + /// { + /// ""type"": ""Microsoft.Storage/storageAccounts"", + /// ""name"": ""[variables('storageAccountName')]"", + /// ""apiVersion"": ""[variables('apiVersion')]"", + /// ""location"": ""[variables('location')]"", + /// ""properties"": { + /// ""accountType"": ""[parameters('storageAccountType')]"" + /// } + /// }, + /// { + /// ""type"": ""Microsoft.Network/publicIPAddresses"", + /// ""apiVersion"": ""[variables('apiVersion')]"", + /// ""name"": ""[variables('publicIPAddressName')]"", + /// ""location"": ""[variables('location')]"", + /// ""properties"": { + /// ""publicIPAllocationMethod"": ""[variables('publicIPAddressType')]"", + /// ""dnsSettings"": { + /// ""domainNameLabel"": ""[variables('dnsLabelPrefix')]"" + /// } + /// } + /// } + /// ], + /// ""outputs"": { + /// ""storageAccountName"": { + /// ""type"": ""string"", + /// ""value"": ""[variables('storageAccountName')]"" + /// } + /// } + /// } + /// ", + /// Parameters = + /// { + /// { "storageAccountType", "Standard_GRS" }, + /// }, + /// DeploymentMode = "Incremental", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["storageAccountName"] = exampleTemplateDeployment.Outputs.Apply(outputs => outputs.StorageAccountName), + /// }; + /// }); + /// ``` /// ## Note /// /// This provider does not know about the individual resources created by Azure using a deployment template and therefore cannot delete these resources during a destroy. Destroying a template deployment removes the associated deployment operations, but will not delete the Azure resources created by the deployment. In order to delete these resources, the containing resource group must also be destroyed. [More information](https://docs.microsoft.com/rest/api/resources/deployments#Deployments_Delete). diff --git a/sdk/dotnet/Core/TenantTemplateDeployment.cs b/sdk/dotnet/Core/TenantTemplateDeployment.cs index 6c28134b43..d33d5c3fda 100644 --- a/sdk/dotnet/Core/TenantTemplateDeployment.cs +++ b/sdk/dotnet/Core/TenantTemplateDeployment.cs @@ -10,6 +10,32 @@ namespace Pulumi.Azure.Core { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleTemplateSpecVersion = Azure.Core.GetTemplateSpecVersion.Invoke(new() + /// { + /// Name = "myTemplateForTenant", + /// ResourceGroupName = "myResourceGroup", + /// Version = "v0.1", + /// }); + /// + /// var exampleTenantTemplateDeployment = new Azure.Core.TenantTemplateDeployment("exampleTenantTemplateDeployment", new() + /// { + /// Location = "West Europe", + /// TemplateSpecVersionId = exampleTemplateSpecVersion.Apply(getTemplateSpecVersionResult => getTemplateSpecVersionResult.Id), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Tenant Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/Account.cs b/sdk/dotnet/CosmosDB/Account.cs index 3abfad93aa..f4edd210ae 100644 --- a/sdk/dotnet/CosmosDB/Account.cs +++ b/sdk/dotnet/CosmosDB/Account.cs @@ -12,6 +12,78 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a CosmosDB (formally DocumentDB) Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var rg = new Azure.Core.ResourceGroup("rg", new() + /// { + /// Location = "westus", + /// }); + /// + /// var ri = new Random.RandomInteger("ri", new() + /// { + /// Min = 10000, + /// Max = 99999, + /// }); + /// + /// var db = new Azure.CosmosDB.Account("db", new() + /// { + /// Location = azurerm_resource_group.Example.Location, + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// OfferType = "Standard", + /// Kind = "MongoDB", + /// EnableAutomaticFailover = true, + /// Capabilities = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableAggregationPipeline", + /// }, + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "mongoEnableDocLevelTTL", + /// }, + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "MongoDBv3.4", + /// }, + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableMongo", + /// }, + /// }, + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "BoundedStaleness", + /// MaxIntervalInSeconds = 300, + /// MaxStalenessPrefix = 100000, + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = "eastus", + /// FailoverPriority = 1, + /// }, + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = "westus", + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CosmosDB Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/CassandraCluster.cs b/sdk/dotnet/CosmosDB/CassandraCluster.cs index 67bd15ad02..9d63317324 100644 --- a/sdk/dotnet/CosmosDB/CassandraCluster.cs +++ b/sdk/dotnet/CosmosDB/CassandraCluster.cs @@ -14,6 +14,81 @@ namespace Pulumi.Azure.CosmosDB /// /// > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "Azure Cosmos DB", + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleVirtualNetwork.Id, + /// RoleDefinitionName = "Network Contributor", + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// }); + /// + /// var exampleCassandraCluster = new Azure.CosmosDB.CassandraCluster("exampleCassandraCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DelegatedManagementSubnetId = exampleSubnet.Id, + /// DefaultAdminPassword = "Password1234", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cassandra Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/CassandraDatacenter.cs b/sdk/dotnet/CosmosDB/CassandraDatacenter.cs index 685f72534c..fb0e24e170 100644 --- a/sdk/dotnet/CosmosDB/CassandraDatacenter.cs +++ b/sdk/dotnet/CosmosDB/CassandraDatacenter.cs @@ -14,6 +14,92 @@ namespace Pulumi.Azure.CosmosDB /// /// > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "Azure Cosmos DB", + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleVirtualNetwork.Id, + /// RoleDefinitionName = "Network Contributor", + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// }); + /// + /// var exampleCassandraCluster = new Azure.CosmosDB.CassandraCluster("exampleCassandraCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DelegatedManagementSubnetId = exampleSubnet.Id, + /// DefaultAdminPassword = "Password1234", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// var exampleCassandraDatacenter = new Azure.CosmosDB.CassandraDatacenter("exampleCassandraDatacenter", new() + /// { + /// Location = exampleCassandraCluster.Location, + /// CassandraClusterId = exampleCassandraCluster.Id, + /// DelegatedManagementSubnetId = exampleSubnet.Id, + /// NodeCount = 3, + /// DiskCount = 4, + /// SkuName = "Standard_DS14_v2", + /// AvailabilityZonesEnabled = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cassandra Datacenters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/CassandraKeyspace.cs b/sdk/dotnet/CosmosDB/CassandraKeyspace.cs index c137ba8a2c..a33c19af10 100644 --- a/sdk/dotnet/CosmosDB/CassandraKeyspace.cs +++ b/sdk/dotnet/CosmosDB/CassandraKeyspace.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Cassandra KeySpace within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OfferType = "Standard", + /// Capabilities = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableCassandra", + /// }, + /// }, + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleCassandraKeyspace = new Azure.CosmosDB.CassandraKeyspace("exampleCassandraKeyspace", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// Throughput = 400, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos Cassandra KeySpace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/CassandraTable.cs b/sdk/dotnet/CosmosDB/CassandraTable.cs index 115e2394c5..a3fefbf66d 100644 --- a/sdk/dotnet/CosmosDB/CassandraTable.cs +++ b/sdk/dotnet/CosmosDB/CassandraTable.cs @@ -12,6 +12,85 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Cassandra Table within a Cosmos DB Cassandra Keyspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OfferType = "Standard", + /// Capabilities = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableCassandra", + /// }, + /// }, + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleCassandraKeyspace = new Azure.CosmosDB.CassandraKeyspace("exampleCassandraKeyspace", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// Throughput = 400, + /// }); + /// + /// var exampleCassandraTable = new Azure.CosmosDB.CassandraTable("exampleCassandraTable", new() + /// { + /// CassandraKeyspaceId = exampleCassandraKeyspace.Id, + /// Schema = new Azure.CosmosDB.Inputs.CassandraTableSchemaArgs + /// { + /// Columns = new[] + /// { + /// new Azure.CosmosDB.Inputs.CassandraTableSchemaColumnArgs + /// { + /// Name = "test1", + /// Type = "ascii", + /// }, + /// new Azure.CosmosDB.Inputs.CassandraTableSchemaColumnArgs + /// { + /// Name = "test2", + /// Type = "int", + /// }, + /// }, + /// PartitionKeys = new[] + /// { + /// new Azure.CosmosDB.Inputs.CassandraTableSchemaPartitionKeyArgs + /// { + /// Name = "test1", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos Cassandra Table can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/GetAccount.cs b/sdk/dotnet/CosmosDB/GetAccount.cs index eeb9113d6e..b3cecb7858 100644 --- a/sdk/dotnet/CosmosDB/GetAccount.cs +++ b/sdk/dotnet/CosmosDB/GetAccount.cs @@ -13,12 +13,66 @@ public static class GetAccount { /// /// Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["cosmosdbAccountEndpoint"] = example.Apply(getAccountResult => getAccountResult.Endpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cosmosdb/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["cosmosdbAccountEndpoint"] = example.Apply(getAccountResult => getAccountResult.Endpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cosmosdb/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/CosmosDB/GetMongoDatabase.cs b/sdk/dotnet/CosmosDB/GetMongoDatabase.cs index e9bec837a0..eeb85fe824 100644 --- a/sdk/dotnet/CosmosDB/GetMongoDatabase.cs +++ b/sdk/dotnet/CosmosDB/GetMongoDatabase.cs @@ -13,12 +13,68 @@ public static class GetMongoDatabase { /// /// Use this data source to access information about an existing Cosmos DB Mongo Database. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetMongoDatabase.Invoke(new() + /// { + /// Name = "test-cosmosdb-mongo-db", + /// ResourceGroupName = "test-cosmosdb-account-rg", + /// AccountName = "test-cosmosdb-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getMongoDatabaseResult => getMongoDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetMongoDatabaseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cosmosdb/getMongoDatabase:getMongoDatabase", args ?? new GetMongoDatabaseArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Cosmos DB Mongo Database. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetMongoDatabase.Invoke(new() + /// { + /// Name = "test-cosmosdb-mongo-db", + /// ResourceGroupName = "test-cosmosdb-account-rg", + /// AccountName = "test-cosmosdb-account", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getMongoDatabaseResult => getMongoDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetMongoDatabaseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cosmosdb/getMongoDatabase:getMongoDatabase", args ?? new GetMongoDatabaseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/CosmosDB/GetRestorableDatabaseAccounts.cs b/sdk/dotnet/CosmosDB/GetRestorableDatabaseAccounts.cs index 5be46c47c4..51a12f2d50 100644 --- a/sdk/dotnet/CosmosDB/GetRestorableDatabaseAccounts.cs +++ b/sdk/dotnet/CosmosDB/GetRestorableDatabaseAccounts.cs @@ -13,12 +13,66 @@ public static class GetRestorableDatabaseAccounts { /// /// Use this data source to access information about Cosmos DB Restorable Database Accounts. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetRestorableDatabaseAccounts.Invoke(new() + /// { + /// Name = "example-ca", + /// Location = "West Europe", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getRestorableDatabaseAccountsResult => getRestorableDatabaseAccountsResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRestorableDatabaseAccountsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cosmosdb/getRestorableDatabaseAccounts:getRestorableDatabaseAccounts", args ?? new GetRestorableDatabaseAccountsArgs(), options.WithDefaults()); /// /// Use this data source to access information about Cosmos DB Restorable Database Accounts. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetRestorableDatabaseAccounts.Invoke(new() + /// { + /// Name = "example-ca", + /// Location = "West Europe", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getRestorableDatabaseAccountsResult => getRestorableDatabaseAccountsResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRestorableDatabaseAccountsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cosmosdb/getRestorableDatabaseAccounts:getRestorableDatabaseAccounts", args ?? new GetRestorableDatabaseAccountsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/CosmosDB/GetSqlDatabase.cs b/sdk/dotnet/CosmosDB/GetSqlDatabase.cs index d71e157809..014d0d1cd9 100644 --- a/sdk/dotnet/CosmosDB/GetSqlDatabase.cs +++ b/sdk/dotnet/CosmosDB/GetSqlDatabase.cs @@ -13,12 +13,60 @@ public static class GetSqlDatabase { /// /// Use this data source to access information about an existing CosmosDB SQL Database. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetSqlDatabase.Invoke(new() + /// { + /// AccountName = "tfex-cosmosdb-sql-database-account-name", + /// Name = "tfex-cosmosdb-sql-database", + /// ResourceGroupName = "tfex-cosmosdb-sql-database-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSqlDatabaseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cosmosdb/getSqlDatabase:getSqlDatabase", args ?? new GetSqlDatabaseArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing CosmosDB SQL Database. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetSqlDatabase.Invoke(new() + /// { + /// AccountName = "tfex-cosmosdb-sql-database-account-name", + /// Name = "tfex-cosmosdb-sql-database", + /// ResourceGroupName = "tfex-cosmosdb-sql-database-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSqlDatabaseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cosmosdb/getSqlDatabase:getSqlDatabase", args ?? new GetSqlDatabaseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/CosmosDB/GetSqlRoleDefinition.cs b/sdk/dotnet/CosmosDB/GetSqlRoleDefinition.cs index 973856727c..2f0eee565c 100644 --- a/sdk/dotnet/CosmosDB/GetSqlRoleDefinition.cs +++ b/sdk/dotnet/CosmosDB/GetSqlRoleDefinition.cs @@ -13,12 +13,60 @@ public static class GetSqlRoleDefinition { /// /// Use this data source to access information about an existing Cosmos DB SQL Role Definition. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetSqlRoleDefinition.Invoke(new() + /// { + /// AccountName = "tfex-cosmosdb-sql-role-definition-account-name", + /// ResourceGroupName = "tfex-cosmosdb-sql-role-definition-rg", + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSqlRoleDefinitionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:cosmosdb/getSqlRoleDefinition:getSqlRoleDefinition", args ?? new GetSqlRoleDefinitionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Cosmos DB SQL Role Definition. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.CosmosDB.GetSqlRoleDefinition.Invoke(new() + /// { + /// AccountName = "tfex-cosmosdb-sql-role-definition-account-name", + /// ResourceGroupName = "tfex-cosmosdb-sql-role-definition-rg", + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSqlRoleDefinitionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:cosmosdb/getSqlRoleDefinition:getSqlRoleDefinition", args ?? new GetSqlRoleDefinitionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/CosmosDB/GremlinDatabase.cs b/sdk/dotnet/CosmosDB/GremlinDatabase.cs index d87856ec6e..3f6a259788 100644 --- a/sdk/dotnet/CosmosDB/GremlinDatabase.cs +++ b/sdk/dotnet/CosmosDB/GremlinDatabase.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Gremlin Database within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleGremlinDatabase = new Azure.CosmosDB.GremlinDatabase("exampleGremlinDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// Throughput = 400, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CosmosDB Gremlin Databases can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/GremlinGraph.cs b/sdk/dotnet/CosmosDB/GremlinGraph.cs index 917e14df4d..bc44b54339 100644 --- a/sdk/dotnet/CosmosDB/GremlinGraph.cs +++ b/sdk/dotnet/CosmosDB/GremlinGraph.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Gremlin Graph within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleGremlinDatabase = new Azure.CosmosDB.GremlinDatabase("exampleGremlinDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// }); + /// + /// var exampleGremlinGraph = new Azure.CosmosDB.GremlinGraph("exampleGremlinGraph", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// DatabaseName = exampleGremlinDatabase.Name, + /// PartitionKeyPath = "/Example", + /// Throughput = 400, + /// IndexPolicy = new Azure.CosmosDB.Inputs.GremlinGraphIndexPolicyArgs + /// { + /// Automatic = true, + /// IndexingMode = "consistent", + /// IncludedPaths = new[] + /// { + /// "/*", + /// }, + /// ExcludedPaths = new[] + /// { + /// "/\"_etag\"/?", + /// }, + /// }, + /// ConflictResolutionPolicy = new Azure.CosmosDB.Inputs.GremlinGraphConflictResolutionPolicyArgs + /// { + /// Mode = "LastWriterWins", + /// ConflictResolutionPath = "/_ts", + /// }, + /// UniqueKeys = new[] + /// { + /// new Azure.CosmosDB.Inputs.GremlinGraphUniqueKeyArgs + /// { + /// Paths = new[] + /// { + /// "/definition/id1", + /// "/definition/id2", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// > **NOTE:** The CosmosDB Account needs to have the `EnableGremlin` capability enabled to use this resource - which can be done by adding this to the `capabilities` list within the `azure.cosmosdb.Account` resource. + /// /// ## Import /// /// Cosmos Gremlin Graphs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/MongoCollection.cs b/sdk/dotnet/CosmosDB/MongoCollection.cs index 159723532f..a1732b263f 100644 --- a/sdk/dotnet/CosmosDB/MongoCollection.cs +++ b/sdk/dotnet/CosmosDB/MongoCollection.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Mongo Collection within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleMongoDatabase = new Azure.CosmosDB.MongoDatabase("exampleMongoDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// }); + /// + /// var exampleMongoCollection = new Azure.CosmosDB.MongoCollection("exampleMongoCollection", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// DatabaseName = exampleMongoDatabase.Name, + /// DefaultTtlSeconds = 777, + /// ShardKey = "uniqueKey", + /// Throughput = 400, + /// Indices = new[] + /// { + /// new Azure.CosmosDB.Inputs.MongoCollectionIndexArgs + /// { + /// Keys = new[] + /// { + /// "_id", + /// }, + /// Unique = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CosmosDB Mongo Collection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/MongoDatabase.cs b/sdk/dotnet/CosmosDB/MongoDatabase.cs index 5d41b11bc7..54565f35db 100644 --- a/sdk/dotnet/CosmosDB/MongoDatabase.cs +++ b/sdk/dotnet/CosmosDB/MongoDatabase.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Mongo Database within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleMongoDatabase = new Azure.CosmosDB.MongoDatabase("exampleMongoDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// Throughput = 400, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos Mongo Database can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/MongoRoleDefinition.cs b/sdk/dotnet/CosmosDB/MongoRoleDefinition.cs index 47f86844aa..36003b4bf2 100644 --- a/sdk/dotnet/CosmosDB/MongoRoleDefinition.cs +++ b/sdk/dotnet/CosmosDB/MongoRoleDefinition.cs @@ -12,6 +12,67 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Cosmos DB Mongo Role Definition. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "MongoDB", + /// Capabilities = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableMongo", + /// }, + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableMongoRoleBasedAccessControl", + /// }, + /// }, + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleMongoDatabase = new Azure.CosmosDB.MongoDatabase("exampleMongoDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// }); + /// + /// var exampleMongoRoleDefinition = new Azure.CosmosDB.MongoRoleDefinition("exampleMongoRoleDefinition", new() + /// { + /// CosmosMongoDatabaseId = exampleMongoDatabase.Id, + /// RoleName = "example-roledefinition", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos DB Mongo Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/MongoUserDefinition.cs b/sdk/dotnet/CosmosDB/MongoUserDefinition.cs index dcc0053f6a..fde14fed74 100644 --- a/sdk/dotnet/CosmosDB/MongoUserDefinition.cs +++ b/sdk/dotnet/CosmosDB/MongoUserDefinition.cs @@ -12,6 +12,68 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Cosmos DB Mongo User Definition. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "MongoDB", + /// Capabilities = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableMongo", + /// }, + /// new Azure.CosmosDB.Inputs.AccountCapabilityArgs + /// { + /// Name = "EnableMongoRoleBasedAccessControl", + /// }, + /// }, + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleMongoDatabase = new Azure.CosmosDB.MongoDatabase("exampleMongoDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// }); + /// + /// var exampleMongoUserDefinition = new Azure.CosmosDB.MongoUserDefinition("exampleMongoUserDefinition", new() + /// { + /// CosmosMongoDatabaseId = exampleMongoDatabase.Id, + /// Username = "myUserName", + /// Password = "myPassword", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos DB Mongo User Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/NotebookWorkspace.cs b/sdk/dotnet/CosmosDB/NotebookWorkspace.cs index d9dbef6a98..c4bc558840 100644 --- a/sdk/dotnet/CosmosDB/NotebookWorkspace.cs +++ b/sdk/dotnet/CosmosDB/NotebookWorkspace.cs @@ -18,6 +18,50 @@ namespace Pulumi.Azure.CosmosDB /// /// > **NOTE:** However, CosmosDb Notebook feature no longer uses the permanent notebook workspace being referred to the public surface in the RP (have since moved to temporary notebooks workspaces which are short-lived <1 hour). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "BoundedStaleness", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleNotebookWorkspace = new Azure.CosmosDB.NotebookWorkspace("exampleNotebookWorkspace", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// =SQL Notebook Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/PostgresqlCluster.cs b/sdk/dotnet/CosmosDB/PostgresqlCluster.cs index e868362d05..fa36a928e2 100644 --- a/sdk/dotnet/CosmosDB/PostgresqlCluster.cs +++ b/sdk/dotnet/CosmosDB/PostgresqlCluster.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages an Azure Cosmos DB for PostgreSQL Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePostgresqlCluster = new Azure.CosmosDB.PostgresqlCluster("examplePostgresqlCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// CoordinatorStorageQuotaInMb = 131072, + /// CoordinatorVcoreCount = 2, + /// NodeCount = 0, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/PostgresqlCoordinatorConfiguration.cs b/sdk/dotnet/CosmosDB/PostgresqlCoordinatorConfiguration.cs index 026726ff98..fc7f55075f 100644 --- a/sdk/dotnet/CosmosDB/PostgresqlCoordinatorConfiguration.cs +++ b/sdk/dotnet/CosmosDB/PostgresqlCoordinatorConfiguration.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.CosmosDB /// /// Sets a Coordinator Configuration value on Azure Cosmos DB for PostgreSQL Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = new Azure.Core.ResourceGroup("test", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePostgresqlCluster = new Azure.CosmosDB.PostgresqlCluster("examplePostgresqlCluster", new() + /// { + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// Location = azurerm_resource_group.Example.Location, + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// CoordinatorStorageQuotaInMb = 131072, + /// CoordinatorVcoreCount = 2, + /// NodeCount = 2, + /// NodeStorageQuotaInMb = 131072, + /// NodeVcores = 2, + /// }); + /// + /// var examplePostgresqlCoordinatorConfiguration = new Azure.CosmosDB.PostgresqlCoordinatorConfiguration("examplePostgresqlCoordinatorConfiguration", new() + /// { + /// ClusterId = examplePostgresqlCluster.Id, + /// Value = "on", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Coordinator Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/PostgresqlFirewallRule.cs b/sdk/dotnet/CosmosDB/PostgresqlFirewallRule.cs index a5df4b810c..e9dd6c0a67 100644 --- a/sdk/dotnet/CosmosDB/PostgresqlFirewallRule.cs +++ b/sdk/dotnet/CosmosDB/PostgresqlFirewallRule.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages an Azure Cosmos DB for PostgreSQL Firewall Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePostgresqlCluster = new Azure.CosmosDB.PostgresqlCluster("examplePostgresqlCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// CoordinatorStorageQuotaInMb = 131072, + /// CoordinatorVcoreCount = 2, + /// NodeCount = 0, + /// }); + /// + /// var examplePostgresqlFirewallRule = new Azure.CosmosDB.PostgresqlFirewallRule("examplePostgresqlFirewallRule", new() + /// { + /// ClusterId = examplePostgresqlCluster.Id, + /// StartIpAddress = "10.0.17.62", + /// EndIpAddress = "10.0.17.64", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Cosmos DB for PostgreSQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/PostgresqlNodeConfiguration.cs b/sdk/dotnet/CosmosDB/PostgresqlNodeConfiguration.cs index 06ba03de3b..e1bcbb433f 100644 --- a/sdk/dotnet/CosmosDB/PostgresqlNodeConfiguration.cs +++ b/sdk/dotnet/CosmosDB/PostgresqlNodeConfiguration.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.CosmosDB /// /// Sets a Node Configuration value on Azure Cosmos DB for PostgreSQL Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePostgresqlCluster = new Azure.CosmosDB.PostgresqlCluster("examplePostgresqlCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// CoordinatorStorageQuotaInMb = 131072, + /// CoordinatorVcoreCount = 2, + /// NodeCount = 2, + /// NodeStorageQuotaInMb = 131072, + /// NodeVcores = 2, + /// }); + /// + /// var examplePostgresqlNodeConfiguration = new Azure.CosmosDB.PostgresqlNodeConfiguration("examplePostgresqlNodeConfiguration", new() + /// { + /// ClusterId = examplePostgresqlCluster.Id, + /// Value = "on", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Node Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/PostgresqlRole.cs b/sdk/dotnet/CosmosDB/PostgresqlRole.cs index 5771215e8e..11c849f7a7 100644 --- a/sdk/dotnet/CosmosDB/PostgresqlRole.cs +++ b/sdk/dotnet/CosmosDB/PostgresqlRole.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages an Azure Cosmos DB for PostgreSQL Role. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePostgresqlCluster = new Azure.CosmosDB.PostgresqlCluster("examplePostgresqlCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// CoordinatorStorageQuotaInMb = 131072, + /// CoordinatorVcoreCount = 2, + /// NodeCount = 0, + /// }); + /// + /// var examplePostgresqlRole = new Azure.CosmosDB.PostgresqlRole("examplePostgresqlRole", new() + /// { + /// ClusterId = examplePostgresqlCluster.Id, + /// Password = "H@Sh1CoR3!", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Cosmos DB for PostgreSQL Roles can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlContainer.cs b/sdk/dotnet/CosmosDB/SqlContainer.cs index 568201016e..a6e42fb3cb 100644 --- a/sdk/dotnet/CosmosDB/SqlContainer.cs +++ b/sdk/dotnet/CosmosDB/SqlContainer.cs @@ -12,6 +12,74 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a SQL Container within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/definition/id", + /// PartitionKeyVersion = 1, + /// Throughput = 400, + /// IndexingPolicy = new Azure.CosmosDB.Inputs.SqlContainerIndexingPolicyArgs + /// { + /// IndexingMode = "consistent", + /// IncludedPaths = new[] + /// { + /// new Azure.CosmosDB.Inputs.SqlContainerIndexingPolicyIncludedPathArgs + /// { + /// Path = "/*", + /// }, + /// new Azure.CosmosDB.Inputs.SqlContainerIndexingPolicyIncludedPathArgs + /// { + /// Path = "/included/?", + /// }, + /// }, + /// ExcludedPaths = new[] + /// { + /// new Azure.CosmosDB.Inputs.SqlContainerIndexingPolicyExcludedPathArgs + /// { + /// Path = "/excluded/?", + /// }, + /// }, + /// }, + /// UniqueKeys = new[] + /// { + /// new Azure.CosmosDB.Inputs.SqlContainerUniqueKeyArgs + /// { + /// Paths = new[] + /// { + /// "/definition/idlong", + /// "/definition/idshort", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos SQL Containers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlDatabase.cs b/sdk/dotnet/CosmosDB/SqlDatabase.cs index 8af6987d39..2724c9836b 100644 --- a/sdk/dotnet/CosmosDB/SqlDatabase.cs +++ b/sdk/dotnet/CosmosDB/SqlDatabase.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a SQL Database within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// Throughput = 400, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlDedicatedGateway.cs b/sdk/dotnet/CosmosDB/SqlDedicatedGateway.cs index ef8a3d12ef..483c387565 100644 --- a/sdk/dotnet/CosmosDB/SqlDedicatedGateway.cs +++ b/sdk/dotnet/CosmosDB/SqlDedicatedGateway.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a SQL Dedicated Gateway within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "BoundedStaleness", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlDedicatedGateway = new Azure.CosmosDB.SqlDedicatedGateway("exampleSqlDedicatedGateway", new() + /// { + /// CosmosdbAccountId = exampleAccount.Id, + /// InstanceCount = 1, + /// InstanceSize = "Cosmos.D4s", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CosmosDB SQL Dedicated Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlFunction.cs b/sdk/dotnet/CosmosDB/SqlFunction.cs index 95372a1117..13cd00734d 100644 --- a/sdk/dotnet/CosmosDB/SqlFunction.cs +++ b/sdk/dotnet/CosmosDB/SqlFunction.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages an SQL User Defined Function. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// Throughput = 400, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/id", + /// }); + /// + /// var exampleSqlFunction = new Azure.CosmosDB.SqlFunction("exampleSqlFunction", new() + /// { + /// ContainerId = exampleSqlContainer.Id, + /// Body = "function trigger(){}", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL User Defined Functions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlRoleAssignment.cs b/sdk/dotnet/CosmosDB/SqlRoleAssignment.cs index c3574160f9..7fb7e96432 100644 --- a/sdk/dotnet/CosmosDB/SqlRoleAssignment.cs +++ b/sdk/dotnet/CosmosDB/SqlRoleAssignment.cs @@ -12,6 +12,76 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Cosmos DB SQL Role Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlRoleDefinition = new Azure.CosmosDB.SqlRoleDefinition("exampleSqlRoleDefinition", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// Type = "CustomRole", + /// AssignableScopes = new[] + /// { + /// exampleAccount.Id, + /// }, + /// Permissions = new[] + /// { + /// new Azure.CosmosDB.Inputs.SqlRoleDefinitionPermissionArgs + /// { + /// DataActions = new[] + /// { + /// "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleSqlRoleAssignment = new Azure.CosmosDB.SqlRoleAssignment("exampleSqlRoleAssignment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// RoleDefinitionId = exampleSqlRoleDefinition.Id, + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// Scope = exampleAccount.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos DB SQL Role Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlRoleDefinition.cs b/sdk/dotnet/CosmosDB/SqlRoleDefinition.cs index 1204efd6b3..0f89d363fa 100644 --- a/sdk/dotnet/CosmosDB/SqlRoleDefinition.cs +++ b/sdk/dotnet/CosmosDB/SqlRoleDefinition.cs @@ -12,6 +12,67 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Cosmos DB SQL Role Definition. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlRoleDefinition = new Azure.CosmosDB.SqlRoleDefinition("exampleSqlRoleDefinition", new() + /// { + /// RoleDefinitionId = "84cf3a8b-4122-4448-bce2-fa423cfe0a15", + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// AssignableScopes = new[] + /// { + /// exampleAccount.Id.Apply(id => $"{id}/dbs/sales"), + /// }, + /// Permissions = new[] + /// { + /// new Azure.CosmosDB.Inputs.SqlRoleDefinitionPermissionArgs + /// { + /// DataActions = new[] + /// { + /// "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cosmos DB SQL Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlStoredProcedure.cs b/sdk/dotnet/CosmosDB/SqlStoredProcedure.cs index f90c48f274..cb53f6d8d1 100644 --- a/sdk/dotnet/CosmosDB/SqlStoredProcedure.cs +++ b/sdk/dotnet/CosmosDB/SqlStoredProcedure.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a SQL Stored Procedure within a Cosmos DB Account SQL Database. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// Throughput = 400, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/id", + /// }); + /// + /// var exampleSqlStoredProcedure = new Azure.CosmosDB.SqlStoredProcedure("exampleSqlStoredProcedure", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// DatabaseName = exampleSqlDatabase.Name, + /// ContainerName = exampleSqlContainer.Name, + /// Body = @" function () { var context = getContext(); var response = context.getResponse(); response.setBody('Hello, World'); } + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CosmosDB SQL Stored Procedures can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/SqlTrigger.cs b/sdk/dotnet/CosmosDB/SqlTrigger.cs index 1853db838c..75335cf134 100644 --- a/sdk/dotnet/CosmosDB/SqlTrigger.cs +++ b/sdk/dotnet/CosmosDB/SqlTrigger.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages an SQL Trigger. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// Throughput = 400, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/id", + /// }); + /// + /// var exampleSqlTrigger = new Azure.CosmosDB.SqlTrigger("exampleSqlTrigger", new() + /// { + /// ContainerId = exampleSqlContainer.Id, + /// Body = "function trigger(){}", + /// Operation = "Delete", + /// Type = "Post", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CosmosDB/Table.cs b/sdk/dotnet/CosmosDB/Table.cs index 8134431ccc..e75a251365 100644 --- a/sdk/dotnet/CosmosDB/Table.cs +++ b/sdk/dotnet/CosmosDB/Table.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.CosmosDB /// /// Manages a Table within a Cosmos DB Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleTable = new Azure.CosmosDB.Table("exampleTable", new() + /// { + /// ResourceGroupName = exampleAccount.Apply(getAccountResult => getAccountResult.ResourceGroupName), + /// AccountName = exampleAccount.Apply(getAccountResult => getAccountResult.Name), + /// Throughput = 400, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CosmosDB Tables can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CostManagement/AnomalyAlert.cs b/sdk/dotnet/CostManagement/AnomalyAlert.cs index 7709bc7c0c..1f1a1d6459 100644 --- a/sdk/dotnet/CostManagement/AnomalyAlert.cs +++ b/sdk/dotnet/CostManagement/AnomalyAlert.cs @@ -12,6 +12,29 @@ namespace Pulumi.Azure.CostManagement /// /// Manages a Cost Anomaly Alert. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.CostManagement.AnomalyAlert("example", new() + /// { + /// DisplayName = "Alert DisplayName", + /// EmailAddresses = new[] + /// { + /// "example@test.net", + /// }, + /// EmailSubject = "My Test Anomaly Alert", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Cost Anomaly Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/CostManagement/ScheduledAction.cs b/sdk/dotnet/CostManagement/ScheduledAction.cs index baeb743d9b..2aaded1518 100644 --- a/sdk/dotnet/CostManagement/ScheduledAction.cs +++ b/sdk/dotnet/CostManagement/ScheduledAction.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.CostManagement /// /// Manages an Azure Cost Management Scheduled Action. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.CostManagement.ScheduledAction("example", new() + /// { + /// DisplayName = "Report Last 6 Months", + /// EmailAddressSender = "platformteam@test.com", + /// EmailAddresses = new[] + /// { + /// "example@example.com", + /// }, + /// EmailSubject = "Cost Management Report", + /// EndDate = "2023-02-02T00:00:00Z", + /// Frequency = "Daily", + /// Message = "Hi all, take a look at last 6 months spending!", + /// StartDate = "2023-01-02T00:00:00Z", + /// ViewId = "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Cost Management Scheduled Actions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dashboard/Azurerm_portal_dashboard.cs b/sdk/dotnet/Dashboard/Azurerm_portal_dashboard.cs index 83d8fd1740..991b174050 100644 --- a/sdk/dotnet/Dashboard/Azurerm_portal_dashboard.cs +++ b/sdk/dotnet/Dashboard/Azurerm_portal_dashboard.cs @@ -14,12 +14,66 @@ public static class Azurerm_portal_dashboard { /// /// Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Portal.GetDashboard.Invoke(new() + /// { + /// Name = "existing-dashboard", + /// ResourceGroupName = "dashboard-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_dashboard.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(Azurerm_portal_dashboardArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dashboard/azurerm_portal_dashboard:azurerm_portal_dashboard", args ?? new Azurerm_portal_dashboardArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Portal.GetDashboard.Invoke(new() + /// { + /// Name = "existing-dashboard", + /// ResourceGroupName = "dashboard-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_dashboard.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(Azurerm_portal_dashboardInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dashboard/azurerm_portal_dashboard:azurerm_portal_dashboard", args ?? new Azurerm_portal_dashboardInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Dashboard/Dashboard.cs b/sdk/dotnet/Dashboard/Dashboard.cs index 139004f8e0..dc9e14c93c 100644 --- a/sdk/dotnet/Dashboard/Dashboard.cs +++ b/sdk/dotnet/Dashboard/Dashboard.cs @@ -14,6 +14,151 @@ namespace Pulumi.Azure.Dashboard /// /// !> **Note:** The `azure.portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.portal.PortalDashboard` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var config = new Config(); + /// var mdContent = config.Get("mdContent") ?? "# Hello all :)"; + /// var videoLink = config.Get("videoLink") ?? "https://www.youtube.com/watch?v=......"; + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var my_board = new Azure.Portal.Dashboard("my-board", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// Tags = + /// { + /// { "source", "managed" }, + /// }, + /// DashboardProperties = @$"{{ + /// ""lenses"": {{ + /// ""0"": {{ + /// ""order"": 0, + /// ""parts"": {{ + /// ""0"": {{ + /// ""position"": {{ + /// ""x"": 0, + /// ""y"": 0, + /// ""rowSpan"": 2, + /// ""colSpan"": 3 + /// }}, + /// ""metadata"": {{ + /// ""inputs"": [], + /// ""type"": ""Extension/HubsExtension/PartType/MarkdownPart"", + /// ""settings"": {{ + /// ""content"": {{ + /// ""settings"": {{ + /// ""content"": ""{mdContent}"", + /// ""subtitle"": """", + /// ""title"": """" + /// }} + /// }} + /// }} + /// }} + /// }}, + /// ""1"": {{ + /// ""position"": {{ + /// ""x"": 5, + /// ""y"": 0, + /// ""rowSpan"": 4, + /// ""colSpan"": 6 + /// }}, + /// ""metadata"": {{ + /// ""inputs"": [], + /// ""type"": ""Extension/HubsExtension/PartType/VideoPart"", + /// ""settings"": {{ + /// ""content"": {{ + /// ""settings"": {{ + /// ""title"": ""Important Information"", + /// ""subtitle"": """", + /// ""src"": ""{videoLink}"", + /// ""autoplay"": true + /// }} + /// }} + /// }} + /// }} + /// }}, + /// ""2"": {{ + /// ""position"": {{ + /// ""x"": 0, + /// ""y"": 4, + /// ""rowSpan"": 4, + /// ""colSpan"": 6 + /// }}, + /// ""metadata"": {{ + /// ""inputs"": [ + /// {{ + /// ""name"": ""ComponentId"", + /// ""value"": ""/subscriptions/{current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId)}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp"" + /// }} + /// ], + /// ""type"": ""Extension/AppInsightsExtension/PartType/AppMapGalPt"", + /// ""settings"": {{}}, + /// ""asset"": {{ + /// ""idInputName"": ""ComponentId"", + /// ""type"": ""ApplicationInsights"" + /// }} + /// }} + /// }} + /// }} + /// }} + /// }}, + /// ""metadata"": {{ + /// ""model"": {{ + /// ""timeRange"": {{ + /// ""value"": {{ + /// ""relative"": {{ + /// ""duration"": 24, + /// ""timeUnit"": 1 + /// }} + /// }}, + /// ""type"": ""MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"" + /// }}, + /// ""filterLocale"": {{ + /// ""value"": ""en-us"" + /// }}, + /// ""filters"": {{ + /// ""value"": {{ + /// ""MsPortalFx_TimeRange"": {{ + /// ""model"": {{ + /// ""format"": ""utc"", + /// ""granularity"": ""auto"", + /// ""relative"": ""24h"" + /// }}, + /// ""displayCache"": {{ + /// ""name"": ""UTC Time"", + /// ""value"": ""Past 24 hours"" + /// }}, + /// ""filteredPartIds"": [ + /// ""StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7"" + /// ] + /// }} + /// }} + /// }} + /// }} + /// }} + /// }} + /// ", + /// }); + /// + /// }); + /// ``` + /// + /// It is recommended to follow the steps outlined + /// [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + /// /// ## Import /// /// Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dashboard/Grafana.cs b/sdk/dotnet/Dashboard/Grafana.cs index b509771b0b..7f94034487 100644 --- a/sdk/dotnet/Dashboard/Grafana.cs +++ b/sdk/dotnet/Dashboard/Grafana.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Dashboard /// /// Manages a Dashboard Grafana. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleGrafana = new Azure.Dashboard.Grafana("exampleGrafana", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// ApiKeyEnabled = true, + /// DeterministicOutboundIpEnabled = true, + /// PublicNetworkAccessEnabled = false, + /// Identity = new Azure.Dashboard.Inputs.GrafanaIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dashboard Grafana can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataBricks/AccessConnector.cs b/sdk/dotnet/DataBricks/AccessConnector.cs index f73d12f6e2..b4d1a4113c 100644 --- a/sdk/dotnet/DataBricks/AccessConnector.cs +++ b/sdk/dotnet/DataBricks/AccessConnector.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.DataBricks /// /// Manages a Databricks Access Connector /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccessConnector = new Azure.DataBricks.AccessConnector("exampleAccessConnector", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.DataBricks.Inputs.AccessConnectorIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Databricks Access Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataBricks/GetWorkspace.cs b/sdk/dotnet/DataBricks/GetWorkspace.cs index 599a96f078..a5aa3d865b 100644 --- a/sdk/dotnet/DataBricks/GetWorkspace.cs +++ b/sdk/dotnet/DataBricks/GetWorkspace.cs @@ -13,12 +13,66 @@ public static class GetWorkspace { /// /// Use this data source to access information about an existing Databricks workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataBricks.GetWorkspace.Invoke(new() + /// { + /// Name = "example-workspace", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["databricksWorkspaceId"] = example.Apply(getWorkspaceResult => getWorkspaceResult.WorkspaceId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWorkspaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:databricks/getWorkspace:getWorkspace", args ?? new GetWorkspaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Databricks workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataBricks.GetWorkspace.Invoke(new() + /// { + /// Name = "example-workspace", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["databricksWorkspaceId"] = example.Apply(getWorkspaceResult => getWorkspaceResult.WorkspaceId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWorkspaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:databricks/getWorkspace:getWorkspace", args ?? new GetWorkspaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataBricks/GetWorkspacePrivateEndpointConnection.cs b/sdk/dotnet/DataBricks/GetWorkspacePrivateEndpointConnection.cs index dd90727458..9099ab4f1a 100644 --- a/sdk/dotnet/DataBricks/GetWorkspacePrivateEndpointConnection.cs +++ b/sdk/dotnet/DataBricks/GetWorkspacePrivateEndpointConnection.cs @@ -13,12 +13,66 @@ public static class GetWorkspacePrivateEndpointConnection { /// /// Use this data source to access information on an existing Databricks Workspace private endpoint connection state. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataBricks.GetWorkspacePrivateEndpointConnection.Invoke(new() + /// { + /// WorkspaceId = azurerm_databricks_workspace.Example.Id, + /// PrivateEndpointId = azurerm_private_endpoint.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["databricksWorkspacePrivateEndpointConnectionStatus"] = example.Apply(getWorkspacePrivateEndpointConnectionResult => getWorkspacePrivateEndpointConnectionResult.Connections[0]?.Status), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWorkspacePrivateEndpointConnectionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:databricks/getWorkspacePrivateEndpointConnection:getWorkspacePrivateEndpointConnection", args ?? new GetWorkspacePrivateEndpointConnectionArgs(), options.WithDefaults()); /// /// Use this data source to access information on an existing Databricks Workspace private endpoint connection state. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataBricks.GetWorkspacePrivateEndpointConnection.Invoke(new() + /// { + /// WorkspaceId = azurerm_databricks_workspace.Example.Id, + /// PrivateEndpointId = azurerm_private_endpoint.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["databricksWorkspacePrivateEndpointConnectionStatus"] = example.Apply(getWorkspacePrivateEndpointConnectionResult => getWorkspacePrivateEndpointConnectionResult.Connections[0]?.Status), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWorkspacePrivateEndpointConnectionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:databricks/getWorkspacePrivateEndpointConnection:getWorkspacePrivateEndpointConnection", args ?? new GetWorkspacePrivateEndpointConnectionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataBricks/VirtualNetworkPeering.cs b/sdk/dotnet/DataBricks/VirtualNetworkPeering.cs index 095c900010..af0fc8098c 100644 --- a/sdk/dotnet/DataBricks/VirtualNetworkPeering.cs +++ b/sdk/dotnet/DataBricks/VirtualNetworkPeering.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.DataBricks /// /// Manages a Databricks Virtual Network Peering /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var remoteVirtualNetwork = new Azure.Network.VirtualNetwork("remoteVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleWorkspace = new Azure.DataBricks.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "standard", + /// }); + /// + /// var exampleVirtualNetworkPeering = new Azure.DataBricks.VirtualNetworkPeering("exampleVirtualNetworkPeering", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceId = exampleWorkspace.Id, + /// RemoteAddressSpacePrefixes = remoteVirtualNetwork.AddressSpaces, + /// RemoteVirtualNetworkId = remoteVirtualNetwork.Id, + /// AllowVirtualNetworkAccess = true, + /// }); + /// + /// var remoteVirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("remoteVirtualNetworkPeering", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = remoteVirtualNetwork.Name, + /// RemoteVirtualNetworkId = exampleVirtualNetworkPeering.VirtualNetworkId, + /// AllowVirtualNetworkAccess = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Databrick Virtual Network Peerings can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/CustomDataset.cs b/sdk/dotnet/DataFactory/CustomDataset.cs index 7097bba824..f7f6ef78c1 100644 --- a/sdk/dotnet/DataFactory/CustomDataset.cs +++ b/sdk/dotnet/DataFactory/CustomDataset.cs @@ -12,6 +12,121 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Dataset inside an Azure Data Factory. This is a generic resource that supports all different Dataset Types. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataFactory.Inputs.FactoryIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleLinkedCustomService = new Azure.DataFactory.LinkedCustomService("exampleLinkedCustomService", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Type = "AzureBlobStorage", + /// TypePropertiesJson = exampleAccount.PrimaryConnectionString.Apply(primaryConnectionString => @$"{{ + /// ""connectionString"":""{primaryConnectionString}"" + /// }} + /// "), + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleCustomDataset = new Azure.DataFactory.CustomDataset("exampleCustomDataset", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Type = "Json", + /// LinkedService = new Azure.DataFactory.Inputs.CustomDatasetLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// Parameters = + /// { + /// { "key1", "value1" }, + /// }, + /// }, + /// TypePropertiesJson = exampleContainer.Name.Apply(name => @$"{{ + /// ""location"": {{ + /// ""container"":""{name}"", + /// ""fileName"":""foo.txt"", + /// ""folderPath"": ""foo/bar/"", + /// ""type"":""AzureBlobStorageLocation"" + /// }}, + /// ""encodingName"":""UTF-8"" + /// }} + /// "), + /// Description = "test description", + /// Annotations = new[] + /// { + /// "test1", + /// "test2", + /// "test3", + /// }, + /// Folder = "testFolder", + /// Parameters = + /// { + /// { "foo", "test1" }, + /// { "Bar", "Test2" }, + /// }, + /// AdditionalProperties = + /// { + /// { "foo", "test1" }, + /// { "bar", "test2" }, + /// }, + /// SchemaJson = @"{ + /// ""type"": ""object"", + /// ""properties"": { + /// ""name"": { + /// ""type"": ""object"", + /// ""properties"": { + /// ""firstName"": { + /// ""type"": ""string"" + /// }, + /// ""lastName"": { + /// ""type"": ""string"" + /// } + /// } + /// }, + /// ""age"": { + /// ""type"": ""integer"" + /// } + /// } + /// } + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DataFlow.cs b/sdk/dotnet/DataFactory/DataFlow.cs index db70e9e23e..b688474625 100644 --- a/sdk/dotnet/DataFactory/DataFlow.cs +++ b/sdk/dotnet/DataFactory/DataFlow.cs @@ -12,6 +12,207 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Data Flow inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedCustomService = new Azure.DataFactory.LinkedCustomService("exampleLinkedCustomService", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Type = "AzureBlobStorage", + /// TypePropertiesJson = exampleAccount.PrimaryConnectionString.Apply(primaryConnectionString => @$"{{ + /// ""connectionString"": ""{primaryConnectionString}"" + /// }} + /// "), + /// }); + /// + /// var example1DatasetJson = new Azure.DataFactory.DatasetJson("example1DatasetJson", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedCustomService.Name, + /// AzureBlobStorageLocation = new Azure.DataFactory.Inputs.DatasetJsonAzureBlobStorageLocationArgs + /// { + /// Container = "container", + /// Path = "foo/bar/", + /// Filename = "foo.txt", + /// }, + /// Encoding = "UTF-8", + /// }); + /// + /// var example2DatasetJson = new Azure.DataFactory.DatasetJson("example2DatasetJson", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedCustomService.Name, + /// AzureBlobStorageLocation = new Azure.DataFactory.Inputs.DatasetJsonAzureBlobStorageLocationArgs + /// { + /// Container = "container", + /// Path = "foo/bar/", + /// Filename = "bar.txt", + /// }, + /// Encoding = "UTF-8", + /// }); + /// + /// var example1FlowletDataFlow = new Azure.DataFactory.FlowletDataFlow("example1FlowletDataFlow", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Sources = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSourceArgs + /// { + /// Name = "source1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSourceLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Sinks = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSinkArgs + /// { + /// Name = "sink1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSinkLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Script = @"source( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// limit: 100, + /// ignoreNoFilesFound: false, + /// documentForm: 'documentPerLine') ~> source1 + /// source1 sink( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// skipDuplicateMapInputs: true, + /// skipDuplicateMapOutputs: true) ~> sink1 + /// ", + /// }); + /// + /// var example2FlowletDataFlow = new Azure.DataFactory.FlowletDataFlow("example2FlowletDataFlow", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Sources = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSourceArgs + /// { + /// Name = "source1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSourceLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Sinks = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSinkArgs + /// { + /// Name = "sink1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSinkLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Script = @"source( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// limit: 100, + /// ignoreNoFilesFound: false, + /// documentForm: 'documentPerLine') ~> source1 + /// source1 sink( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// skipDuplicateMapInputs: true, + /// skipDuplicateMapOutputs: true) ~> sink1 + /// ", + /// }); + /// + /// var exampleDataFlow = new Azure.DataFactory.DataFlow("exampleDataFlow", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Sources = new[] + /// { + /// new Azure.DataFactory.Inputs.DataFlowSourceArgs + /// { + /// Name = "source1", + /// Flowlet = new Azure.DataFactory.Inputs.DataFlowSourceFlowletArgs + /// { + /// Name = example1FlowletDataFlow.Name, + /// Parameters = + /// { + /// { "Key1", "value1" }, + /// }, + /// }, + /// Dataset = new Azure.DataFactory.Inputs.DataFlowSourceDatasetArgs + /// { + /// Name = example1DatasetJson.Name, + /// }, + /// }, + /// }, + /// Sinks = new[] + /// { + /// new Azure.DataFactory.Inputs.DataFlowSinkArgs + /// { + /// Name = "sink1", + /// Flowlet = new Azure.DataFactory.Inputs.DataFlowSinkFlowletArgs + /// { + /// Name = example2FlowletDataFlow.Name, + /// Parameters = + /// { + /// { "Key1", "value1" }, + /// }, + /// }, + /// Dataset = new Azure.DataFactory.Inputs.DataFlowSinkDatasetArgs + /// { + /// Name = example2DatasetJson.Name, + /// }, + /// }, + /// }, + /// Script = @"source( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// limit: 100, + /// ignoreNoFilesFound: false, + /// documentForm: 'documentPerLine') ~> source1 + /// source1 sink( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// skipDuplicateMapInputs: true, + /// skipDuplicateMapOutputs: true) ~> sink1 + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetAzureBlob.cs b/sdk/dotnet/DataFactory/DatasetAzureBlob.cs index 1b364c462a..df0adcbce7 100644 --- a/sdk/dotnet/DataFactory/DatasetAzureBlob.cs +++ b/sdk/dotnet/DataFactory/DatasetAzureBlob.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure Blob Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceAzureBlobStorage = new Azure.DataFactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = exampleAccount.Apply(getAccountResult => getAccountResult.PrimaryConnectionString), + /// }); + /// + /// var exampleDatasetAzureBlob = new Azure.DataFactory.DatasetAzureBlob("exampleDatasetAzureBlob", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceAzureBlobStorage.Name, + /// Path = "foo", + /// Filename = "bar.png", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetAzureSqlTable.cs b/sdk/dotnet/DataFactory/DatasetAzureSqlTable.cs index 2d7add4311..e3a8c72dfa 100644 --- a/sdk/dotnet/DataFactory/DatasetAzureSqlTable.cs +++ b/sdk/dotnet/DataFactory/DatasetAzureSqlTable.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure SQL Table Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceAzureSqlDatabase = new Azure.DataFactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Integrated Security=False;Data Source=test;Initial Catalog=test;Initial Catalog=test;User ID=test;Password=test", + /// }); + /// + /// var exampleDatasetAzureSqlTable = new Azure.DataFactory.DatasetAzureSqlTable("exampleDatasetAzureSqlTable", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceId = exampleLinkedServiceAzureSqlDatabase.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Azure SQL Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetBinary.cs b/sdk/dotnet/DataFactory/DatasetBinary.cs index 930ca4a184..f90d320df6 100644 --- a/sdk/dotnet/DataFactory/DatasetBinary.cs +++ b/sdk/dotnet/DataFactory/DatasetBinary.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Data Factory Binary Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceSftp = new Azure.DataFactory.LinkedServiceSftp("exampleLinkedServiceSftp", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AuthenticationType = "Basic", + /// Host = "http://www.bing.com", + /// Port = 22, + /// Username = "foo", + /// Password = "bar", + /// }); + /// + /// var exampleDatasetBinary = new Azure.DataFactory.DatasetBinary("exampleDatasetBinary", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceSftp.Name, + /// SftpServerLocation = new Azure.DataFactory.Inputs.DatasetBinarySftpServerLocationArgs + /// { + /// Path = "/test/", + /// Filename = "**", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Binary Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetCosmosDBApi.cs b/sdk/dotnet/DataFactory/DatasetCosmosDBApi.cs index 2f0041b7b7..9e5fd2a728 100644 --- a/sdk/dotnet/DataFactory/DatasetCosmosDBApi.cs +++ b/sdk/dotnet/DataFactory/DatasetCosmosDBApi.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure Cosmos DB SQL API Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceCosmosDb = new Azure.DataFactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AccountEndpoint = exampleAccount.Apply(getAccountResult => getAccountResult.Endpoint), + /// Database = "foo", + /// }); + /// + /// var exampleDatasetCosmosDBApi = new Azure.DataFactory.DatasetCosmosDBApi("exampleDatasetCosmosDBApi", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceCosmosDb.Name, + /// CollectionName = "bar", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetDelimitedText.cs b/sdk/dotnet/DataFactory/DatasetDelimitedText.cs index e5fce3f63b..fb64a917d3 100644 --- a/sdk/dotnet/DataFactory/DatasetDelimitedText.cs +++ b/sdk/dotnet/DataFactory/DatasetDelimitedText.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure Delimited Text Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceWeb = new Azure.DataFactory.LinkedServiceWeb("exampleLinkedServiceWeb", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AuthenticationType = "Anonymous", + /// Url = "https://www.bing.com", + /// }); + /// + /// var exampleDatasetDelimitedText = new Azure.DataFactory.DatasetDelimitedText("exampleDatasetDelimitedText", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceWeb.Name, + /// HttpServerLocation = new Azure.DataFactory.Inputs.DatasetDelimitedTextHttpServerLocationArgs + /// { + /// RelativeUrl = "http://www.bing.com", + /// Path = "foo/bar/", + /// Filename = "fizz.txt", + /// }, + /// ColumnDelimiter = ",", + /// RowDelimiter = "NEW", + /// Encoding = "UTF-8", + /// QuoteCharacter = "x", + /// EscapeCharacter = "f", + /// FirstRowAsHeader = true, + /// NullValue = "NULL", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetHttp.cs b/sdk/dotnet/DataFactory/DatasetHttp.cs index 3e9849cd78..696c67c861 100644 --- a/sdk/dotnet/DataFactory/DatasetHttp.cs +++ b/sdk/dotnet/DataFactory/DatasetHttp.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure HTTP Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceWeb = new Azure.DataFactory.LinkedServiceWeb("exampleLinkedServiceWeb", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AuthenticationType = "Anonymous", + /// Url = "https://www.bing.com", + /// }); + /// + /// var exampleDatasetHttp = new Azure.DataFactory.DatasetHttp("exampleDatasetHttp", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceWeb.Name, + /// RelativeUrl = "http://www.bing.com", + /// RequestBody = "foo=bar", + /// RequestMethod = "POST", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetJson.cs b/sdk/dotnet/DataFactory/DatasetJson.cs index 0d06f6eb87..40047dc930 100644 --- a/sdk/dotnet/DataFactory/DatasetJson.cs +++ b/sdk/dotnet/DataFactory/DatasetJson.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure JSON Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceWeb = new Azure.DataFactory.LinkedServiceWeb("exampleLinkedServiceWeb", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AuthenticationType = "Anonymous", + /// Url = "https://www.bing.com", + /// }); + /// + /// var exampleDatasetJson = new Azure.DataFactory.DatasetJson("exampleDatasetJson", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceWeb.Name, + /// HttpServerLocation = new Azure.DataFactory.Inputs.DatasetJsonHttpServerLocationArgs + /// { + /// RelativeUrl = "/fizz/buzz/", + /// Path = "foo/bar/", + /// Filename = "foo.txt", + /// }, + /// Encoding = "UTF-8", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetMysql.cs b/sdk/dotnet/DataFactory/DatasetMysql.cs index 1330514d94..3af0bccc95 100644 --- a/sdk/dotnet/DataFactory/DatasetMysql.cs +++ b/sdk/dotnet/DataFactory/DatasetMysql.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a MySQL Dataset inside a Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceMysql = new Azure.DataFactory.LinkedServiceMysql("exampleLinkedServiceMysql", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test", + /// }); + /// + /// var exampleDatasetMysql = new Azure.DataFactory.DatasetMysql("exampleDatasetMysql", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceMysql.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory MySQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetParquet.cs b/sdk/dotnet/DataFactory/DatasetParquet.cs index 5064480c86..b2fbb465a7 100644 --- a/sdk/dotnet/DataFactory/DatasetParquet.cs +++ b/sdk/dotnet/DataFactory/DatasetParquet.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure Parquet Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceWeb = new Azure.DataFactory.LinkedServiceWeb("exampleLinkedServiceWeb", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AuthenticationType = "Anonymous", + /// Url = "https://www.bing.com", + /// }); + /// + /// var exampleDatasetParquet = new Azure.DataFactory.DatasetParquet("exampleDatasetParquet", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceWeb.Name, + /// HttpServerLocation = new Azure.DataFactory.Inputs.DatasetParquetHttpServerLocationArgs + /// { + /// RelativeUrl = "http://www.bing.com", + /// Path = "foo/bar/", + /// Filename = "fizz.txt", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetPostgresql.cs b/sdk/dotnet/DataFactory/DatasetPostgresql.cs index b62f0d4408..abbdc71f27 100644 --- a/sdk/dotnet/DataFactory/DatasetPostgresql.cs +++ b/sdk/dotnet/DataFactory/DatasetPostgresql.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a PostgreSQL Dataset inside a Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServicePostgresql = new Azure.DataFactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example", + /// }); + /// + /// var exampleDatasetPostgresql = new Azure.DataFactory.DatasetPostgresql("exampleDatasetPostgresql", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServicePostgresql.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory PostgreSQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/DatasetSnowflake.cs b/sdk/dotnet/DataFactory/DatasetSnowflake.cs index fd39a1ec78..74d39d059f 100644 --- a/sdk/dotnet/DataFactory/DatasetSnowflake.cs +++ b/sdk/dotnet/DataFactory/DatasetSnowflake.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Snowflake Dataset inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceSnowflake = new Azure.DataFactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + /// }); + /// + /// var exampleDatasetSnowflake = new Azure.DataFactory.DatasetSnowflake("exampleDatasetSnowflake", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceSnowflake.Name, + /// SchemaName = "foo_schema", + /// TableName = "foo_table", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Snowflake Datasets can be imported using the `resource id`, diff --git a/sdk/dotnet/DataFactory/DatasetSqlServerTable.cs b/sdk/dotnet/DataFactory/DatasetSqlServerTable.cs index 7f6022d812..6baebe96b6 100644 --- a/sdk/dotnet/DataFactory/DatasetSqlServerTable.cs +++ b/sdk/dotnet/DataFactory/DatasetSqlServerTable.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a SQL Server Table Dataset inside a Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceSqlServer = new Azure.DataFactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test", + /// }); + /// + /// var exampleDatasetSqlServerTable = new Azure.DataFactory.DatasetSqlServerTable("exampleDatasetSqlServerTable", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedServiceSqlServer.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory SQL Server Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/Factory.cs b/sdk/dotnet/DataFactory/Factory.cs index 51f3b60169..872b630119 100644 --- a/sdk/dotnet/DataFactory/Factory.cs +++ b/sdk/dotnet/DataFactory/Factory.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.DataFactory /// /// Manages an Azure Data Factory (Version 2). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/FlowletDataFlow.cs b/sdk/dotnet/DataFactory/FlowletDataFlow.cs index 56f4132a33..c771e316f2 100644 --- a/sdk/dotnet/DataFactory/FlowletDataFlow.cs +++ b/sdk/dotnet/DataFactory/FlowletDataFlow.cs @@ -12,6 +12,199 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Flowlet Data Flow inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedCustomService = new Azure.DataFactory.LinkedCustomService("exampleLinkedCustomService", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Type = "AzureBlobStorage", + /// TypePropertiesJson = exampleAccount.PrimaryConnectionString.Apply(primaryConnectionString => @$"{{ + /// ""connectionString"": ""{primaryConnectionString}"" + /// }} + /// "), + /// }); + /// + /// var example1DatasetJson = new Azure.DataFactory.DatasetJson("example1DatasetJson", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedCustomService.Name, + /// AzureBlobStorageLocation = new Azure.DataFactory.Inputs.DatasetJsonAzureBlobStorageLocationArgs + /// { + /// Container = "container", + /// Path = "foo/bar/", + /// Filename = "foo.txt", + /// }, + /// Encoding = "UTF-8", + /// }); + /// + /// var example2DatasetJson = new Azure.DataFactory.DatasetJson("example2DatasetJson", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// LinkedServiceName = exampleLinkedCustomService.Name, + /// AzureBlobStorageLocation = new Azure.DataFactory.Inputs.DatasetJsonAzureBlobStorageLocationArgs + /// { + /// Container = "container", + /// Path = "foo/bar/", + /// Filename = "bar.txt", + /// }, + /// Encoding = "UTF-8", + /// }); + /// + /// var example1FlowletDataFlow = new Azure.DataFactory.FlowletDataFlow("example1FlowletDataFlow", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Sources = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSourceArgs + /// { + /// Name = "source1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSourceLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Sinks = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSinkArgs + /// { + /// Name = "sink1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSinkLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Script = @"source( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// limit: 100, + /// ignoreNoFilesFound: false, + /// documentForm: 'documentPerLine') ~> source1 + /// source1 sink( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// skipDuplicateMapInputs: true, + /// skipDuplicateMapOutputs: true) ~> sink1 + /// ", + /// }); + /// + /// var example2FlowletDataFlow = new Azure.DataFactory.FlowletDataFlow("example2FlowletDataFlow", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Sources = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSourceArgs + /// { + /// Name = "source1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSourceLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Sinks = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSinkArgs + /// { + /// Name = "sink1", + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSinkLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Script = @"source( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// limit: 100, + /// ignoreNoFilesFound: false, + /// documentForm: 'documentPerLine') ~> source1 + /// source1 sink( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// skipDuplicateMapInputs: true, + /// skipDuplicateMapOutputs: true) ~> sink1 + /// ", + /// }); + /// + /// var exampleFlowletDataFlow = new Azure.DataFactory.FlowletDataFlow("exampleFlowletDataFlow", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Sources = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSourceArgs + /// { + /// Name = "source1", + /// Flowlet = new Azure.DataFactory.Inputs.FlowletDataFlowSourceFlowletArgs + /// { + /// Name = example1FlowletDataFlow.Name, + /// }, + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSourceLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Sinks = new[] + /// { + /// new Azure.DataFactory.Inputs.FlowletDataFlowSinkArgs + /// { + /// Name = "sink1", + /// Flowlet = new Azure.DataFactory.Inputs.FlowletDataFlowSinkFlowletArgs + /// { + /// Name = example2FlowletDataFlow.Name, + /// }, + /// LinkedService = new Azure.DataFactory.Inputs.FlowletDataFlowSinkLinkedServiceArgs + /// { + /// Name = exampleLinkedCustomService.Name, + /// }, + /// }, + /// }, + /// Script = @"source( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// limit: 100, + /// ignoreNoFilesFound: false, + /// documentForm: 'documentPerLine') ~> source1 + /// source1 sink( + /// allowSchemaDrift: true, + /// validateSchema: false, + /// skipDuplicateMapInputs: true, + /// skipDuplicateMapOutputs: true) ~> sink1 + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Flowlet Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/GetFactory.cs b/sdk/dotnet/DataFactory/GetFactory.cs index 912b6d7570..15e57d525e 100644 --- a/sdk/dotnet/DataFactory/GetFactory.cs +++ b/sdk/dotnet/DataFactory/GetFactory.cs @@ -13,12 +13,66 @@ public static class GetFactory { /// /// Use this data source to access information about an existing Azure Data Factory (Version 2). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataFactory.GetFactory.Invoke(new() + /// { + /// Name = "existing-adf", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFactoryResult => getFactoryResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFactoryArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:datafactory/getFactory:getFactory", args ?? new GetFactoryArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure Data Factory (Version 2). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataFactory.GetFactory.Invoke(new() + /// { + /// Name = "existing-adf", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFactoryResult => getFactoryResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFactoryInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:datafactory/getFactory:getFactory", args ?? new GetFactoryInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataFactory/IntegrationRuntimeManaged.cs b/sdk/dotnet/DataFactory/IntegrationRuntimeManaged.cs index 816d5191af..d41f6145a8 100644 --- a/sdk/dotnet/DataFactory/IntegrationRuntimeManaged.cs +++ b/sdk/dotnet/DataFactory/IntegrationRuntimeManaged.cs @@ -14,6 +14,37 @@ namespace Pulumi.Azure.DataFactory /// /// > **NOTE:** The `azure.datafactory.IntegrationRuntimeManaged` resource has been superseded by the `azure.datafactory.IntegrationRuntimeSsis` resource. We recommend using the `azure.datafactory.IntegrationRuntimeSsis` resource for new deployments. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleIntegrationRuntimeManaged = new Azure.DataFactory.IntegrationRuntimeManaged("exampleIntegrationRuntimeManaged", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Location = exampleResourceGroup.Location, + /// NodeSize = "Standard_D8_v3", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Integration Managed Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/IntegrationRuntimeRule.cs b/sdk/dotnet/DataFactory/IntegrationRuntimeRule.cs index cd0bea99ad..720a628105 100644 --- a/sdk/dotnet/DataFactory/IntegrationRuntimeRule.cs +++ b/sdk/dotnet/DataFactory/IntegrationRuntimeRule.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Data Factory Azure Integration Runtime. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleIntegrationRuntimeRule = new Azure.DataFactory.IntegrationRuntimeRule("exampleIntegrationRuntimeRule", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/IntegrationRuntimeSelfHosted.cs b/sdk/dotnet/DataFactory/IntegrationRuntimeSelfHosted.cs index 3fdff0ae5e..04684857ca 100644 --- a/sdk/dotnet/DataFactory/IntegrationRuntimeSelfHosted.cs +++ b/sdk/dotnet/DataFactory/IntegrationRuntimeSelfHosted.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Data Factory Self-hosted Integration Runtime. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleIntegrationRuntimeSelfHosted = new Azure.DataFactory.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factories can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/IntegrationRuntimeSsis.cs b/sdk/dotnet/DataFactory/IntegrationRuntimeSsis.cs index ecd5263ce8..f96428248e 100644 --- a/sdk/dotnet/DataFactory/IntegrationRuntimeSsis.cs +++ b/sdk/dotnet/DataFactory/IntegrationRuntimeSsis.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Data Factory Azure-SSIS Integration Runtime. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleIntegrationRuntimeSsis = new Azure.DataFactory.IntegrationRuntimeSsis("exampleIntegrationRuntimeSsis", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Location = exampleResourceGroup.Location, + /// NodeSize = "Standard_D8_v3", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Azure-SSIS Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedCustomService.cs b/sdk/dotnet/DataFactory/LinkedCustomService.cs index b3e5abcb4e..665ae3f845 100644 --- a/sdk/dotnet/DataFactory/LinkedCustomService.cs +++ b/sdk/dotnet/DataFactory/LinkedCustomService.cs @@ -12,6 +12,65 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between a resource and Azure Data Factory. This is a generic resource that supports all different Linked Service Types. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataFactory.Inputs.FactoryIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleLinkedCustomService = new Azure.DataFactory.LinkedCustomService("exampleLinkedCustomService", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Type = "AzureBlobStorage", + /// Description = "test description", + /// TypePropertiesJson = exampleAccount.PrimaryConnectionString.Apply(primaryConnectionString => @$"{{ + /// ""connectionString"":""{primaryConnectionString}"" + /// }} + /// "), + /// Parameters = + /// { + /// { "foo", "bar" }, + /// { "Env", "Test" }, + /// }, + /// Annotations = new[] + /// { + /// "test1", + /// "test2", + /// "test3", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceAzureBlobStorage.cs b/sdk/dotnet/DataFactory/LinkedServiceAzureBlobStorage.cs index ce4e6b13c4..42e03c5da6 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceAzureBlobStorage.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceAzureBlobStorage.cs @@ -12,6 +12,105 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between an Azure Blob Storage Account and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceAzureBlobStorage = new Azure.DataFactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = exampleAccount.Apply(getAccountResult => getAccountResult.PrimaryConnectionString), + /// }); + /// + /// }); + /// ``` + /// ### With SAS URI And SAS Token + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var testFactory = new Azure.DataFactory.Factory("testFactory", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// }); + /// + /// var testKeyVault = new Azure.KeyVault.KeyVault("testKeyVault", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// }); + /// + /// var testLinkedServiceKeyVault = new Azure.DataFactory.LinkedServiceKeyVault("testLinkedServiceKeyVault", new() + /// { + /// DataFactoryId = testFactory.Id, + /// KeyVaultId = testKeyVault.Id, + /// }); + /// + /// var testLinkedServiceAzureBlobStorage = new Azure.DataFactory.LinkedServiceAzureBlobStorage("testLinkedServiceAzureBlobStorage", new() + /// { + /// DataFactoryId = testFactory.Id, + /// SasUri = "https://example.blob.core.windows.net", + /// KeyVaultSasToken = new Azure.DataFactory.Inputs.LinkedServiceAzureBlobStorageKeyVaultSasTokenArgs + /// { + /// LinkedServiceName = testLinkedServiceKeyVault.Name, + /// SecretName = "secret", + /// }, + /// }); + /// + /// var testDatafactory_linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage = new Azure.DataFactory.LinkedServiceAzureBlobStorage("testDatafactory/linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage", new() + /// { + /// DataFactoryId = testFactory.Id, + /// ServiceEndpoint = "https://example.blob.core.windows.net", + /// ServicePrincipalId = "00000000-0000-0000-0000-000000000000", + /// TenantId = "00000000-0000-0000-0000-000000000000", + /// ServicePrincipalLinkedKeyVaultKey = new Azure.DataFactory.Inputs.LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKeyArgs + /// { + /// LinkedServiceName = testLinkedServiceKeyVault.Name, + /// SecretName = "secret", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceAzureDatabricks.cs b/sdk/dotnet/DataFactory/LinkedServiceAzureDatabricks.cs index 0be50da4a6..68798115b2 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceAzureDatabricks.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceAzureDatabricks.cs @@ -13,6 +13,120 @@ namespace Pulumi.Azure.DataFactory /// Manages a Linked Service (connection) between Azure Databricks and Azure Data Factory. /// /// ## Example Usage + /// ### With Managed Identity & New Cluster + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// //Create a Linked Service using managed identity and new cluster config + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataFactory.Inputs.FactoryIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// //Create a databricks instance + /// var exampleWorkspace = new Azure.DataBricks.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "standard", + /// }); + /// + /// var msiLinked = new Azure.DataFactory.LinkedServiceAzureDatabricks("msiLinked", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Description = "ADB Linked Service via MSI", + /// AdbDomain = exampleWorkspace.WorkspaceUrl.Apply(workspaceUrl => $"https://{workspaceUrl}"), + /// MsiWorkSpaceResourceId = exampleWorkspace.Id, + /// NewClusterConfig = new Azure.DataFactory.Inputs.LinkedServiceAzureDatabricksNewClusterConfigArgs + /// { + /// NodeType = "Standard_NC12", + /// ClusterVersion = "5.5.x-gpu-scala2.11", + /// MinNumberOfWorkers = 1, + /// MaxNumberOfWorkers = 5, + /// DriverNodeType = "Standard_NC12", + /// LogDestination = "dbfs:/logs", + /// CustomTags = + /// { + /// { "custom_tag1", "sct_value_1" }, + /// { "custom_tag2", "sct_value_2" }, + /// }, + /// SparkConfig = + /// { + /// { "config1", "value1" }, + /// { "config2", "value2" }, + /// }, + /// SparkEnvironmentVariables = + /// { + /// { "envVar1", "value1" }, + /// { "envVar2", "value2" }, + /// }, + /// InitScripts = new[] + /// { + /// "init.sh", + /// "init2.sh", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### With Access Token & Existing Cluster + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// //Link to an existing cluster via access token + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// //Create a databricks instance + /// var exampleWorkspace = new Azure.DataBricks.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "standard", + /// }); + /// + /// var atLinked = new Azure.DataFactory.LinkedServiceAzureDatabricks("atLinked", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Description = "ADB Linked Service via Access Token", + /// ExistingClusterId = "0308-201146-sly615", + /// AccessToken = "SomeDatabricksAccessToken", + /// AdbDomain = exampleWorkspace.WorkspaceUrl.Apply(workspaceUrl => $"https://{workspaceUrl}"), + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/DataFactory/LinkedServiceAzureFileStorage.cs b/sdk/dotnet/DataFactory/LinkedServiceAzureFileStorage.cs index c57c26d31a..917c0854ed 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceAzureFileStorage.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceAzureFileStorage.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceAzureFileStorage = new Azure.DataFactory.LinkedServiceAzureFileStorage("exampleLinkedServiceAzureFileStorage", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = exampleAccount.Apply(getAccountResult => getAccountResult.PrimaryConnectionString), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceAzureFunction.cs b/sdk/dotnet/DataFactory/LinkedServiceAzureFunction.cs index b5e3215cd8..14b612d5de 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceAzureFunction.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceAzureFunction.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between an Azure Function and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFunctionApp = Azure.AppService.GetFunctionApp.Invoke(new() + /// { + /// Name = "test-azure-functions", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceAzureFunction = new Azure.DataFactory.LinkedServiceAzureFunction("exampleLinkedServiceAzureFunction", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Url = $"https://{exampleFunctionApp.Apply(getFunctionAppResult => getFunctionAppResult.DefaultHostname)}", + /// Key = "foo", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceAzureSqlDatabase.cs b/sdk/dotnet/DataFactory/LinkedServiceAzureSqlDatabase.cs index 04e46d7ead..246b586d46 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceAzureSqlDatabase.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceAzureSqlDatabase.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between Azure SQL Database and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceAzureSqlDatabase = new Azure.DataFactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "data source=serverhostname;initial catalog=master;user id=testUser;Password=test;integrated security=False;encrypt=True;connection timeout=30", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Azure SQL Database Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceAzureTableStorage.cs b/sdk/dotnet/DataFactory/LinkedServiceAzureTableStorage.cs index f960ceffaa..1b1e20e7dd 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceAzureTableStorage.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceAzureTableStorage.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between an Azure Table Storage and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceAzureTableStorage = new Azure.DataFactory.LinkedServiceAzureTableStorage("exampleLinkedServiceAzureTableStorage", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = exampleAccount.Apply(getAccountResult => getAccountResult.PrimaryConnectionString), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceCosmosDb.cs b/sdk/dotnet/DataFactory/LinkedServiceCosmosDb.cs index 835f0f0a86..5e5d226379 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceCosmosDb.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceCosmosDb.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between a CosmosDB and Azure Data Factory using SQL API. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = Azure.CosmosDB.GetAccount.Invoke(new() + /// { + /// Name = "tfex-cosmosdb-account", + /// ResourceGroupName = "tfex-cosmosdb-account-rg", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceCosmosDb = new Azure.DataFactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AccountEndpoint = exampleAccount.Apply(getAccountResult => getAccountResult.Endpoint), + /// AccountKey = exampleAccount.Apply(getAccountResult => getAccountResult.PrimaryKey), + /// Database = "foo", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceCosmosDbMongoApi.cs b/sdk/dotnet/DataFactory/LinkedServiceCosmosDbMongoApi.cs index eeeb5a96fc..1b440d763e 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceCosmosDbMongoApi.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceCosmosDbMongoApi.cs @@ -14,6 +14,37 @@ namespace Pulumi.Azure.DataFactory /// /// > **Note:** All arguments including the client secret will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceCosmosDbMongoApi = new Azure.DataFactory.LinkedServiceCosmosDbMongoApi("exampleLinkedServiceCosmosDbMongoApi", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "mongodb://testinstance:testkey@testinstance.documents.azure.com:10255/?ssl=true", + /// Database = "foo", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceDataLakeStorageGen2.cs b/sdk/dotnet/DataFactory/LinkedServiceDataLakeStorageGen2.cs index 22c1accd1e..078282f856 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceDataLakeStorageGen2.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceDataLakeStorageGen2.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between Data Lake Storage Gen2 and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleLinkedServiceDataLakeStorageGen2 = new Azure.DataFactory.LinkedServiceDataLakeStorageGen2("exampleLinkedServiceDataLakeStorageGen2", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ServicePrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// ServicePrincipalKey = "exampleKey", + /// Tenant = "11111111-1111-1111-1111-111111111111", + /// Url = "https://datalakestoragegen2", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Data Lake Storage Gen2 Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceKeyVault.cs b/sdk/dotnet/DataFactory/LinkedServiceKeyVault.cs index 291c117bbc..25671c95b2 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceKeyVault.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceKeyVault.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between Key Vault and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceKeyVault = new Azure.DataFactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Key Vault Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceKusto.cs b/sdk/dotnet/DataFactory/LinkedServiceKusto.cs index 6db52a1234..e7322d57c5 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceKusto.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceKusto.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between a Kusto Cluster and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataFactory.Inputs.FactoryIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// }); + /// + /// var exampleLinkedServiceKusto = new Azure.DataFactory.LinkedServiceKusto("exampleLinkedServiceKusto", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// KustoEndpoint = exampleCluster.Uri, + /// KustoDatabaseName = exampleDatabase.Name, + /// UseManagedIdentity = true, + /// }); + /// + /// var exampleDatabasePrincipalAssignment = new Azure.Kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClusterName = exampleCluster.Name, + /// DatabaseName = exampleDatabase.Name, + /// TenantId = exampleFactory.Identity.Apply(identity => identity?.TenantId), + /// PrincipalId = exampleFactory.Identity.Apply(identity => identity?.PrincipalId), + /// PrincipalType = "App", + /// Role = "Viewer", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceMysql.cs b/sdk/dotnet/DataFactory/LinkedServiceMysql.cs index b4a0a2c299..b0af726db5 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceMysql.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceMysql.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between MySQL and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceMysql = new Azure.DataFactory.LinkedServiceMysql("exampleLinkedServiceMysql", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory MySQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceOdata.cs b/sdk/dotnet/DataFactory/LinkedServiceOdata.cs index 669d926e71..c7c795b659 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceOdata.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceOdata.cs @@ -14,6 +14,47 @@ namespace Pulumi.Azure.DataFactory /// /// > **Note:** All arguments including the connection_string will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var anonymous = new Azure.DataFactory.LinkedServiceOdata("anonymous", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Url = "https://services.odata.org/v4/TripPinServiceRW/People", + /// }); + /// + /// var basicAuth = new Azure.DataFactory.LinkedServiceOdata("basicAuth", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// Url = "https://services.odata.org/v4/TripPinServiceRW/People", + /// BasicAuthentication = new Azure.DataFactory.Inputs.LinkedServiceOdataBasicAuthenticationArgs + /// { + /// Username = "emma", + /// Password = "Ch4ngeM3!", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory OData Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceOdbc.cs b/sdk/dotnet/DataFactory/LinkedServiceOdbc.cs index 2a209998d5..80481a8356 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceOdbc.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceOdbc.cs @@ -14,6 +14,47 @@ namespace Pulumi.Azure.DataFactory /// /// > **Note:** All arguments including the connection_string will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var anonymous = new Azure.DataFactory.LinkedServiceOdbc("anonymous", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;", + /// }); + /// + /// var basicAuth = new Azure.DataFactory.LinkedServiceOdbc("basicAuth", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;", + /// BasicAuthentication = new Azure.DataFactory.Inputs.LinkedServiceOdbcBasicAuthenticationArgs + /// { + /// Username = "onrylmz", + /// Password = "Ch4ngeM3!", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory ODBC Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServicePostgresql.cs b/sdk/dotnet/DataFactory/LinkedServicePostgresql.cs index 31f7690395..c471472efd 100644 --- a/sdk/dotnet/DataFactory/LinkedServicePostgresql.cs +++ b/sdk/dotnet/DataFactory/LinkedServicePostgresql.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between PostgreSQL and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServicePostgresql = new Azure.DataFactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory PostgreSQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceSftp.cs b/sdk/dotnet/DataFactory/LinkedServiceSftp.cs index fb4495ffee..3b0eccaf90 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceSftp.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceSftp.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceSftp = new Azure.DataFactory.LinkedServiceSftp("exampleLinkedServiceSftp", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AuthenticationType = "Basic", + /// Host = "http://www.bing.com", + /// Port = 22, + /// Username = "foo", + /// Password = "bar", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceSnowflake.cs b/sdk/dotnet/DataFactory/LinkedServiceSnowflake.cs index ae0866bf62..7eac21d8b0 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceSnowflake.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceSnowflake.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between Snowflake and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceSnowflake = new Azure.DataFactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + /// }); + /// + /// }); + /// ``` + /// ### With Password In Key Vault + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceKeyVault = new Azure.DataFactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// }); + /// + /// var exampleLinkedServiceSnowflake = new Azure.DataFactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + /// KeyVaultPassword = new Azure.DataFactory.Inputs.LinkedServiceSnowflakeKeyVaultPasswordArgs + /// { + /// LinkedServiceName = exampleLinkedServiceKeyVault.Name, + /// SecretName = "secret", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Snowflake Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceSqlServer.cs b/sdk/dotnet/DataFactory/LinkedServiceSqlServer.cs index 8d8caa0fbd..0ece2b9733 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceSqlServer.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceSqlServer.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between a SQL Server and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceSqlServer = new Azure.DataFactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test", + /// }); + /// + /// }); + /// ``` + /// ### With Password In Key Vault + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceKeyVault = new Azure.DataFactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// }); + /// + /// var exampleLinkedServiceSqlServer = new Azure.DataFactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + /// KeyVaultPassword = new Azure.DataFactory.Inputs.LinkedServiceSqlServerKeyVaultPasswordArgs + /// { + /// LinkedServiceName = exampleLinkedServiceKeyVault.Name, + /// SecretName = "secret", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory SQL Server Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceSynapse.cs b/sdk/dotnet/DataFactory/LinkedServiceSynapse.cs index 72f21f2414..4c97b929c7 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceSynapse.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceSynapse.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between Synapse and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceSynapse = new Azure.DataFactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test", + /// }); + /// + /// }); + /// ``` + /// ### With Password In Key Vault + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceKeyVault = new Azure.DataFactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// }); + /// + /// var exampleLinkedServiceSynapse = new Azure.DataFactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// ConnectionString = "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + /// KeyVaultPassword = new Azure.DataFactory.Inputs.LinkedServiceSynapseKeyVaultPasswordArgs + /// { + /// LinkedServiceName = exampleLinkedServiceKeyVault.Name, + /// SecretName = "secret", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Synapse Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/LinkedServiceWeb.cs b/sdk/dotnet/DataFactory/LinkedServiceWeb.cs index 60d0cbeb58..df82b334cc 100644 --- a/sdk/dotnet/DataFactory/LinkedServiceWeb.cs +++ b/sdk/dotnet/DataFactory/LinkedServiceWeb.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Linked Service (connection) between a Web Server and Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleLinkedServiceWeb = new Azure.DataFactory.LinkedServiceWeb("exampleLinkedServiceWeb", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// AuthenticationType = "Anonymous", + /// Url = "http://www.bing.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/ManagedPrivateEndpoint.cs b/sdk/dotnet/DataFactory/ManagedPrivateEndpoint.cs index 3775b81f42..f4dd392540 100644 --- a/sdk/dotnet/DataFactory/ManagedPrivateEndpoint.cs +++ b/sdk/dotnet/DataFactory/ManagedPrivateEndpoint.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Data Factory Managed Private Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ManagedVirtualNetworkEnabled = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleManagedPrivateEndpoint = new Azure.DataFactory.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// TargetResourceId = exampleAccount.Id, + /// SubresourceName = "blob", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/Pipeline.cs b/sdk/dotnet/DataFactory/Pipeline.cs index 65c6c35a1e..a4290f43f4 100644 --- a/sdk/dotnet/DataFactory/Pipeline.cs +++ b/sdk/dotnet/DataFactory/Pipeline.cs @@ -12,6 +12,69 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Pipeline inside a Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePipeline = new Azure.DataFactory.Pipeline("examplePipeline", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// }); + /// + /// }); + /// ``` + /// ### With Activities + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = new Azure.DataFactory.Pipeline("test", new() + /// { + /// DataFactoryId = azurerm_data_factory.Test.Id, + /// Variables = + /// { + /// { "bob", "item1" }, + /// }, + /// ActivitiesJson = @"[ + /// { + /// ""name"": ""Append variable1"", + /// ""type"": ""AppendVariable"", + /// ""dependsOn"": [], + /// ""userProperties"": [], + /// ""typeProperties"": { + /// ""variableName"": ""bob"", + /// ""value"": ""something"" + /// } + /// } + /// ] + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Pipeline's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/TriggerBlobEvent.cs b/sdk/dotnet/DataFactory/TriggerBlobEvent.cs index 4f2e95e11c..9fa60ea3e4 100644 --- a/sdk/dotnet/DataFactory/TriggerBlobEvent.cs +++ b/sdk/dotnet/DataFactory/TriggerBlobEvent.cs @@ -12,6 +12,80 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Blob Event Trigger inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePipeline = new Azure.DataFactory.Pipeline("examplePipeline", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleTriggerBlobEvent = new Azure.DataFactory.TriggerBlobEvent("exampleTriggerBlobEvent", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// StorageAccountId = exampleAccount.Id, + /// Events = new[] + /// { + /// "Microsoft.Storage.BlobCreated", + /// "Microsoft.Storage.BlobDeleted", + /// }, + /// BlobPathEndsWith = ".txt", + /// IgnoreEmptyBlobs = true, + /// Activated = true, + /// Annotations = new[] + /// { + /// "test1", + /// "test2", + /// "test3", + /// }, + /// Description = "example description", + /// Pipelines = new[] + /// { + /// new Azure.DataFactory.Inputs.TriggerBlobEventPipelineArgs + /// { + /// Name = examplePipeline.Name, + /// Parameters = + /// { + /// { "Env", "Prod" }, + /// }, + /// }, + /// }, + /// AdditionalProperties = + /// { + /// { "foo", "foo1" }, + /// { "bar", "bar2" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Blob Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/TriggerCustomEvent.cs b/sdk/dotnet/DataFactory/TriggerCustomEvent.cs index 5dac8fac6b..d0ea7cbc45 100644 --- a/sdk/dotnet/DataFactory/TriggerCustomEvent.cs +++ b/sdk/dotnet/DataFactory/TriggerCustomEvent.cs @@ -12,6 +12,77 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Custom Event Trigger inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePipeline = new Azure.DataFactory.Pipeline("examplePipeline", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// }); + /// + /// var exampleTopic = new Azure.EventGrid.Topic("exampleTopic", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleTriggerCustomEvent = new Azure.DataFactory.TriggerCustomEvent("exampleTriggerCustomEvent", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// EventgridTopicId = exampleTopic.Id, + /// Events = new[] + /// { + /// "event1", + /// "event2", + /// }, + /// SubjectBeginsWith = "abc", + /// SubjectEndsWith = "xyz", + /// Annotations = new[] + /// { + /// "example1", + /// "example2", + /// "example3", + /// }, + /// Description = "example description", + /// Pipelines = new[] + /// { + /// new Azure.DataFactory.Inputs.TriggerCustomEventPipelineArgs + /// { + /// Name = examplePipeline.Name, + /// Parameters = + /// { + /// { "Env", "Prod" }, + /// }, + /// }, + /// }, + /// AdditionalProperties = + /// { + /// { "foo", "foo1" }, + /// { "bar", "bar2" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Custom Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/TriggerSchedule.cs b/sdk/dotnet/DataFactory/TriggerSchedule.cs index ae9e1afaec..af8a2dfbac 100644 --- a/sdk/dotnet/DataFactory/TriggerSchedule.cs +++ b/sdk/dotnet/DataFactory/TriggerSchedule.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Trigger Schedule inside a Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePipeline = new Azure.DataFactory.Pipeline("examplePipeline", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// }); + /// + /// var exampleTriggerSchedule = new Azure.DataFactory.TriggerSchedule("exampleTriggerSchedule", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// PipelineName = examplePipeline.Name, + /// Interval = 5, + /// Frequency = "Day", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Schedule Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataFactory/TriggerTumblingWindow.cs b/sdk/dotnet/DataFactory/TriggerTumblingWindow.cs index 7fbbb4cbb2..7cf8319473 100644 --- a/sdk/dotnet/DataFactory/TriggerTumblingWindow.cs +++ b/sdk/dotnet/DataFactory/TriggerTumblingWindow.cs @@ -12,6 +12,78 @@ namespace Pulumi.Azure.DataFactory /// /// Manages a Tumbling Window Trigger inside an Azure Data Factory. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFactory = new Azure.DataFactory.Factory("exampleFactory", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePipeline = new Azure.DataFactory.Pipeline("examplePipeline", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// }); + /// + /// var exampleTriggerTumblingWindow = new Azure.DataFactory.TriggerTumblingWindow("exampleTriggerTumblingWindow", new() + /// { + /// DataFactoryId = exampleFactory.Id, + /// StartTime = "2022-09-21T00:00:00Z", + /// EndTime = "2022-09-21T08:00:00Z", + /// Frequency = "Minute", + /// Interval = 15, + /// Delay = "16:00:00", + /// Annotations = new[] + /// { + /// "example1", + /// "example2", + /// "example3", + /// }, + /// Description = "example description", + /// Retry = new Azure.DataFactory.Inputs.TriggerTumblingWindowRetryArgs + /// { + /// Count = 1, + /// Interval = 30, + /// }, + /// Pipeline = new Azure.DataFactory.Inputs.TriggerTumblingWindowPipelineArgs + /// { + /// Name = examplePipeline.Name, + /// Parameters = + /// { + /// { "Env", "Prod" }, + /// }, + /// }, + /// TriggerDependencies = new[] + /// { + /// new Azure.DataFactory.Inputs.TriggerTumblingWindowTriggerDependencyArgs + /// { + /// Size = "24:00:00", + /// Offset = "-24:00:00", + /// }, + /// }, + /// AdditionalProperties = + /// { + /// { "foo", "value1" }, + /// { "bar", "value2" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Factory Tumbling Window Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/BackupInstanceBlogStorage.cs b/sdk/dotnet/DataProtection/BackupInstanceBlogStorage.cs index 3e134a2509..ef0935c12a 100644 --- a/sdk/dotnet/DataProtection/BackupInstanceBlogStorage.cs +++ b/sdk/dotnet/DataProtection/BackupInstanceBlogStorage.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.DataProtection /// /// Manages a Backup Instance Blob Storage. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleBackupVault = new Azure.DataProtection.BackupVault("exampleBackupVault", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatastoreType = "VaultStore", + /// Redundancy = "LocallyRedundant", + /// Identity = new Azure.DataProtection.Inputs.BackupVaultIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Storage Account Backup Contributor", + /// PrincipalId = exampleBackupVault.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var exampleBackupPolicyBlobStorage = new Azure.DataProtection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", new() + /// { + /// VaultId = exampleBackupVault.Id, + /// RetentionDuration = "P30D", + /// }); + /// + /// var exampleBackupInstanceBlogStorage = new Azure.DataProtection.BackupInstanceBlogStorage("exampleBackupInstanceBlogStorage", new() + /// { + /// VaultId = exampleBackupVault.Id, + /// Location = exampleResourceGroup.Location, + /// StorageAccountId = exampleAccount.Id, + /// BackupPolicyId = exampleBackupPolicyBlobStorage.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Instance Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/BackupInstanceDisk.cs b/sdk/dotnet/DataProtection/BackupInstanceDisk.cs index d060ba8df1..cab2819184 100644 --- a/sdk/dotnet/DataProtection/BackupInstanceDisk.cs +++ b/sdk/dotnet/DataProtection/BackupInstanceDisk.cs @@ -12,6 +12,78 @@ namespace Pulumi.Azure.DataProtection /// /// Manages a Backup Instance to back up Disk. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleManagedDisk = new Azure.Compute.ManagedDisk("exampleManagedDisk", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccountType = "Standard_LRS", + /// CreateOption = "Empty", + /// DiskSizeGb = 1, + /// }); + /// + /// var exampleBackupVault = new Azure.DataProtection.BackupVault("exampleBackupVault", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatastoreType = "VaultStore", + /// Redundancy = "LocallyRedundant", + /// Identity = new Azure.DataProtection.Inputs.BackupVaultIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var example1 = new Azure.Authorization.Assignment("example1", new() + /// { + /// Scope = exampleResourceGroup.Id, + /// RoleDefinitionName = "Disk Snapshot Contributor", + /// PrincipalId = exampleBackupVault.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var example2 = new Azure.Authorization.Assignment("example2", new() + /// { + /// Scope = exampleManagedDisk.Id, + /// RoleDefinitionName = "Disk Backup Reader", + /// PrincipalId = exampleBackupVault.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var exampleBackupPolicyDisk = new Azure.DataProtection.BackupPolicyDisk("exampleBackupPolicyDisk", new() + /// { + /// VaultId = exampleBackupVault.Id, + /// BackupRepeatingTimeIntervals = new[] + /// { + /// "R/2021-05-19T06:33:16+00:00/PT4H", + /// }, + /// DefaultRetentionDuration = "P7D", + /// }); + /// + /// var exampleBackupInstanceDisk = new Azure.DataProtection.BackupInstanceDisk("exampleBackupInstanceDisk", new() + /// { + /// Location = exampleBackupVault.Location, + /// VaultId = exampleBackupVault.Id, + /// DiskId = exampleManagedDisk.Id, + /// SnapshotResourceGroupName = exampleResourceGroup.Name, + /// BackupPolicyId = exampleBackupPolicyDisk.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Instance Disks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/BackupInstancePostgresql.cs b/sdk/dotnet/DataProtection/BackupInstancePostgresql.cs index 1315ad767a..c390753a38 100644 --- a/sdk/dotnet/DataProtection/BackupInstancePostgresql.cs +++ b/sdk/dotnet/DataProtection/BackupInstancePostgresql.cs @@ -14,6 +14,156 @@ namespace Pulumi.Azure.DataProtection /// /// > **Note:** Before using this resource, there are some prerequisite permissions for configure backup and restore. See more details from <https://docs.microsoft.com/azure/backup/backup-azure-database-postgresql#prerequisite-permissions-for-configure-backup-and-restore>. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = false, + /// AutoGrowEnabled = true, + /// AdministratorLogin = "psqladmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// Version = "9.5", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleFirewallRule = new Azure.PostgreSql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "0.0.0.0", + /// }); + /// + /// var exampleDatabase = new Azure.PostgreSql.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Charset = "UTF8", + /// Collation = "English_United States.1252", + /// }); + /// + /// var exampleBackupVault = new Azure.DataProtection.BackupVault("exampleBackupVault", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatastoreType = "VaultStore", + /// Redundancy = "LocallyRedundant", + /// Identity = new Azure.DataProtection.Inputs.BackupVaultIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// "Get", + /// "Delete", + /// "Purge", + /// "Recover", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleBackupVault.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleBackupVault.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// "Get", + /// "Delete", + /// "Purge", + /// "Recover", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleSecret = new Azure.KeyVault.Secret("exampleSecret", new() + /// { + /// Value = Output.Tuple(exampleServer.Name, exampleDatabase.Name, exampleServer.Name).Apply(values => + /// { + /// var exampleServerName = values.Item1; + /// var exampleDatabaseName = values.Item2; + /// var exampleServerName1 = values.Item3; + /// return $"Server={exampleServerName}.postgres.database.azure.com;Database={exampleDatabaseName};Port=5432;User Id=psqladmin@{exampleServerName1};Password=H@Sh1CoR3!;Ssl Mode=Require;"; + /// }), + /// KeyVaultId = exampleKeyVault.Id, + /// }); + /// + /// var exampleBackupPolicyPostgresql = new Azure.DataProtection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VaultName = exampleBackupVault.Name, + /// BackupRepeatingTimeIntervals = new[] + /// { + /// "R/2021-05-23T02:30:00+00:00/P1W", + /// }, + /// DefaultRetentionDuration = "P4M", + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleServer.Id, + /// RoleDefinitionName = "Reader", + /// PrincipalId = exampleBackupVault.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var exampleBackupInstancePostgresql = new Azure.DataProtection.BackupInstancePostgresql("exampleBackupInstancePostgresql", new() + /// { + /// Location = exampleResourceGroup.Location, + /// VaultId = exampleBackupVault.Id, + /// DatabaseId = exampleDatabase.Id, + /// BackupPolicyId = exampleBackupPolicyPostgresql.Id, + /// DatabaseCredentialKeyVaultSecretId = exampleSecret.VersionlessId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Instance PostgreSQL can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/BackupPolicyBlobStorage.cs b/sdk/dotnet/DataProtection/BackupPolicyBlobStorage.cs index 317d520895..3386f50cba 100644 --- a/sdk/dotnet/DataProtection/BackupPolicyBlobStorage.cs +++ b/sdk/dotnet/DataProtection/BackupPolicyBlobStorage.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.DataProtection /// /// Manages a Backup Policy Blob Storage. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleBackupVault = new Azure.DataProtection.BackupVault("exampleBackupVault", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatastoreType = "VaultStore", + /// Redundancy = "LocallyRedundant", + /// }); + /// + /// var exampleBackupPolicyBlobStorage = new Azure.DataProtection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", new() + /// { + /// VaultId = exampleBackupVault.Id, + /// RetentionDuration = "P30D", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Policy Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/BackupPolicyDisk.cs b/sdk/dotnet/DataProtection/BackupPolicyDisk.cs index e3e1fed466..d43d75d38d 100644 --- a/sdk/dotnet/DataProtection/BackupPolicyDisk.cs +++ b/sdk/dotnet/DataProtection/BackupPolicyDisk.cs @@ -12,6 +12,65 @@ namespace Pulumi.Azure.DataProtection /// /// Manages a Backup Policy Disk. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleBackupVault = new Azure.DataProtection.BackupVault("exampleBackupVault", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatastoreType = "VaultStore", + /// Redundancy = "LocallyRedundant", + /// }); + /// + /// var exampleBackupPolicyDisk = new Azure.DataProtection.BackupPolicyDisk("exampleBackupPolicyDisk", new() + /// { + /// VaultId = exampleBackupVault.Id, + /// BackupRepeatingTimeIntervals = new[] + /// { + /// "R/2021-05-19T06:33:16+00:00/PT4H", + /// }, + /// DefaultRetentionDuration = "P7D", + /// RetentionRules = new[] + /// { + /// new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleArgs + /// { + /// Name = "Daily", + /// Duration = "P7D", + /// Priority = 25, + /// Criteria = new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleCriteriaArgs + /// { + /// AbsoluteCriteria = "FirstOfDay", + /// }, + /// }, + /// new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleArgs + /// { + /// Name = "Weekly", + /// Duration = "P7D", + /// Priority = 20, + /// Criteria = new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleCriteriaArgs + /// { + /// AbsoluteCriteria = "FirstOfWeek", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Policy Disks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/BackupPolicyPostgresql.cs b/sdk/dotnet/DataProtection/BackupPolicyPostgresql.cs index 8782c688cb..d3e3c25404 100644 --- a/sdk/dotnet/DataProtection/BackupPolicyPostgresql.cs +++ b/sdk/dotnet/DataProtection/BackupPolicyPostgresql.cs @@ -12,6 +12,95 @@ namespace Pulumi.Azure.DataProtection /// /// Manages a Backup Policy to back up PostgreSQL. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleBackupVault = new Azure.DataProtection.BackupVault("exampleBackupVault", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatastoreType = "VaultStore", + /// Redundancy = "LocallyRedundant", + /// }); + /// + /// var exampleBackupPolicyPostgresql = new Azure.DataProtection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VaultName = exampleBackupVault.Name, + /// BackupRepeatingTimeIntervals = new[] + /// { + /// "R/2021-05-23T02:30:00+00:00/P1W", + /// }, + /// DefaultRetentionDuration = "P4M", + /// RetentionRules = new[] + /// { + /// new Azure.DataProtection.Inputs.BackupPolicyPostgresqlRetentionRuleArgs + /// { + /// Name = "weekly", + /// Duration = "P6M", + /// Priority = 20, + /// Criteria = new Azure.DataProtection.Inputs.BackupPolicyPostgresqlRetentionRuleCriteriaArgs + /// { + /// AbsoluteCriteria = "FirstOfWeek", + /// }, + /// }, + /// new Azure.DataProtection.Inputs.BackupPolicyPostgresqlRetentionRuleArgs + /// { + /// Name = "thursday", + /// Duration = "P1W", + /// Priority = 25, + /// Criteria = new Azure.DataProtection.Inputs.BackupPolicyPostgresqlRetentionRuleCriteriaArgs + /// { + /// DaysOfWeeks = new[] + /// { + /// "Thursday", + /// }, + /// ScheduledBackupTimes = new[] + /// { + /// "2021-05-23T02:30:00Z", + /// }, + /// }, + /// }, + /// new Azure.DataProtection.Inputs.BackupPolicyPostgresqlRetentionRuleArgs + /// { + /// Name = "monthly", + /// Duration = "P1D", + /// Priority = 15, + /// Criteria = new Azure.DataProtection.Inputs.BackupPolicyPostgresqlRetentionRuleCriteriaArgs + /// { + /// WeeksOfMonths = new[] + /// { + /// "First", + /// "Last", + /// }, + /// DaysOfWeeks = new[] + /// { + /// "Tuesday", + /// }, + /// ScheduledBackupTimes = new[] + /// { + /// "2021-05-23T02:30:00Z", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Policy PostgreSQL's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/BackupVault.cs b/sdk/dotnet/DataProtection/BackupVault.cs index 56fe6c2341..a7748a55ce 100644 --- a/sdk/dotnet/DataProtection/BackupVault.cs +++ b/sdk/dotnet/DataProtection/BackupVault.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.DataProtection /// /// Manages a Backup Vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleBackupVault = new Azure.DataProtection.BackupVault("exampleBackupVault", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatastoreType = "VaultStore", + /// Redundancy = "LocallyRedundant", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backup Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataProtection/GetBackupVault.cs b/sdk/dotnet/DataProtection/GetBackupVault.cs index 048041c1fc..76f7c37558 100644 --- a/sdk/dotnet/DataProtection/GetBackupVault.cs +++ b/sdk/dotnet/DataProtection/GetBackupVault.cs @@ -13,12 +13,68 @@ public static class GetBackupVault { /// /// Use this data source to access information about an existing Backup Vault. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataProtection.GetBackupVault.Invoke(new() + /// { + /// Name = "existing-backup-vault", + /// ResourceGroupName = "existing-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermDataProtectionBackupVaultId"] = data.Azurerm_vpn_gateway.Example.Id, + /// ["azurermDataProtectionBackupVaultPrincipalId"] = example.Apply(getBackupVaultResult => getBackupVaultResult.Identities[0]?.PrincipalId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBackupVaultArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dataprotection/getBackupVault:getBackupVault", args ?? new GetBackupVaultArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Backup Vault. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataProtection.GetBackupVault.Invoke(new() + /// { + /// Name = "existing-backup-vault", + /// ResourceGroupName = "existing-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermDataProtectionBackupVaultId"] = data.Azurerm_vpn_gateway.Example.Id, + /// ["azurermDataProtectionBackupVaultPrincipalId"] = example.Apply(getBackupVaultResult => getBackupVaultResult.Identities[0]?.PrincipalId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBackupVaultInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dataprotection/getBackupVault:getBackupVault", args ?? new GetBackupVaultInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataProtection/ResourceGuard.cs b/sdk/dotnet/DataProtection/ResourceGuard.cs index 6c06428ef8..2645122cd8 100644 --- a/sdk/dotnet/DataProtection/ResourceGuard.cs +++ b/sdk/dotnet/DataProtection/ResourceGuard.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.DataProtection /// /// Manages a Resource Guard. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleResourceGuard = new Azure.DataProtection.ResourceGuard("exampleResourceGuard", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataShare/Account.cs b/sdk/dotnet/DataShare/Account.cs index d77336193d..0583288bf6 100644 --- a/sdk/dotnet/DataShare/Account.cs +++ b/sdk/dotnet/DataShare/Account.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.DataShare /// /// Manages a Data Share Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.DataShare.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataShare.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Share Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataShare/DatasetBlobStorage.cs b/sdk/dotnet/DataShare/DatasetBlobStorage.cs index 5ad0fa22c2..bdaa09520f 100644 --- a/sdk/dotnet/DataShare/DatasetBlobStorage.cs +++ b/sdk/dotnet/DataShare/DatasetBlobStorage.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.DataShare /// /// Manages a Data Share Blob Storage Dataset. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.DataShare.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataShare.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleShare = new Azure.DataShare.Share("exampleShare", new() + /// { + /// AccountId = exampleAccount.Id, + /// Kind = "CopyBased", + /// }); + /// + /// var exampleStorage_accountAccount = new Azure.Storage.Account("exampleStorage/accountAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "RAGRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleStorage / accountAccount.Name, + /// ContainerAccessType = "container", + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = exampleAccount.Name, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleStorage / accountAccount.Id, + /// RoleDefinitionName = "Storage Blob Data Reader", + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// }); + /// + /// var exampleDatasetBlobStorage = new Azure.DataShare.DatasetBlobStorage("exampleDatasetBlobStorage", new() + /// { + /// DataShareId = exampleShare.Id, + /// ContainerName = exampleContainer.Name, + /// StorageAccount = new Azure.DataShare.Inputs.DatasetBlobStorageStorageAccountArgs + /// { + /// Name = exampleStorage / accountAccount.Name, + /// ResourceGroupName = exampleStorage / accountAccount.ResourceGroupName, + /// SubscriptionId = "00000000-0000-0000-0000-000000000000", + /// }, + /// FilePath = "myfile.txt", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Share Blob Storage Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataShare/DatasetDataLakeGen2.cs b/sdk/dotnet/DataShare/DatasetDataLakeGen2.cs index dd2c626c44..e40c500a3a 100644 --- a/sdk/dotnet/DataShare/DatasetDataLakeGen2.cs +++ b/sdk/dotnet/DataShare/DatasetDataLakeGen2.cs @@ -12,6 +12,81 @@ namespace Pulumi.Azure.DataShare /// /// Manages a Data Share Data Lake Gen2 Dataset. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.DataShare.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataShare.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleShare = new Azure.DataShare.Share("exampleShare", new() + /// { + /// AccountId = exampleAccount.Id, + /// Kind = "CopyBased", + /// }); + /// + /// var exampleStorage_accountAccount = new Azure.Storage.Account("exampleStorage/accountAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleStorage / accountAccount.Id, + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = exampleAccount.Name, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleStorage / accountAccount.Id, + /// RoleDefinitionName = "Storage Blob Data Reader", + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// }); + /// + /// var exampleDatasetDataLakeGen2 = new Azure.DataShare.DatasetDataLakeGen2("exampleDatasetDataLakeGen2", new() + /// { + /// ShareId = exampleShare.Id, + /// StorageAccountId = exampleStorage / accountAccount.Id, + /// FileSystemName = exampleDataLakeGen2Filesystem.Name, + /// FilePath = "myfile.txt", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Share Data Lake Gen2 Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataShare/DatasetKustoCluster.cs b/sdk/dotnet/DataShare/DatasetKustoCluster.cs index 0d5053ed4f..bbce15ad78 100644 --- a/sdk/dotnet/DataShare/DatasetKustoCluster.cs +++ b/sdk/dotnet/DataShare/DatasetKustoCluster.cs @@ -12,6 +12,70 @@ namespace Pulumi.Azure.DataShare /// /// Manages a Data Share Kusto Cluster Dataset. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.DataShare.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataShare.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleShare = new Azure.DataShare.Share("exampleShare", new() + /// { + /// AccountId = exampleAccount.Id, + /// Kind = "InPlace", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleCluster.Id, + /// RoleDefinitionName = "Contributor", + /// PrincipalId = exampleAccount.Identity.Apply(identity => identity.PrincipalId), + /// }); + /// + /// var exampleDatasetKustoCluster = new Azure.DataShare.DatasetKustoCluster("exampleDatasetKustoCluster", new() + /// { + /// ShareId = exampleShare.Id, + /// KustoClusterId = exampleCluster.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Share Kusto Cluster Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataShare/DatasetKustoDatabase.cs b/sdk/dotnet/DataShare/DatasetKustoDatabase.cs index 74253728c3..bcce6f8669 100644 --- a/sdk/dotnet/DataShare/DatasetKustoDatabase.cs +++ b/sdk/dotnet/DataShare/DatasetKustoDatabase.cs @@ -12,6 +12,77 @@ namespace Pulumi.Azure.DataShare /// /// Manages a Data Share Kusto Database Dataset. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.DataShare.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataShare.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleShare = new Azure.DataShare.Share("exampleShare", new() + /// { + /// AccountId = exampleAccount.Id, + /// Kind = "InPlace", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleCluster.Id, + /// RoleDefinitionName = "Contributor", + /// PrincipalId = exampleAccount.Identity.Apply(identity => identity.PrincipalId), + /// }); + /// + /// var exampleDatasetKustoDatabase = new Azure.DataShare.DatasetKustoDatabase("exampleDatasetKustoDatabase", new() + /// { + /// ShareId = exampleShare.Id, + /// KustoDatabaseId = exampleDatabase.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Share Kusto Database Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataShare/GetAccount.cs b/sdk/dotnet/DataShare/GetAccount.cs index ed327bb658..d727796999 100644 --- a/sdk/dotnet/DataShare/GetAccount.cs +++ b/sdk/dotnet/DataShare/GetAccount.cs @@ -13,12 +13,66 @@ public static class GetAccount { /// /// Use this data source to access information about an existing Data Share Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:datashare/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Share Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:datashare/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataShare/GetDatasetBlobStorage.cs b/sdk/dotnet/DataShare/GetDatasetBlobStorage.cs index 8769b1172f..7e3c81a9f9 100644 --- a/sdk/dotnet/DataShare/GetDatasetBlobStorage.cs +++ b/sdk/dotnet/DataShare/GetDatasetBlobStorage.cs @@ -13,12 +13,66 @@ public static class GetDatasetBlobStorage { /// /// Use this data source to access information about an existing Data Share Blob Storage Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetBlobStorage.Invoke(new() + /// { + /// Name = "example-dsbsds", + /// DataShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetBlobStorageResult => getDatasetBlobStorageResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDatasetBlobStorageArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:datashare/getDatasetBlobStorage:getDatasetBlobStorage", args ?? new GetDatasetBlobStorageArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Share Blob Storage Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetBlobStorage.Invoke(new() + /// { + /// Name = "example-dsbsds", + /// DataShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetBlobStorageResult => getDatasetBlobStorageResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDatasetBlobStorageInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:datashare/getDatasetBlobStorage:getDatasetBlobStorage", args ?? new GetDatasetBlobStorageInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataShare/GetDatasetDataLakeGen2.cs b/sdk/dotnet/DataShare/GetDatasetDataLakeGen2.cs index 8f592bded7..ec8280fdd6 100644 --- a/sdk/dotnet/DataShare/GetDatasetDataLakeGen2.cs +++ b/sdk/dotnet/DataShare/GetDatasetDataLakeGen2.cs @@ -13,12 +13,66 @@ public static class GetDatasetDataLakeGen2 { /// /// Use this data source to access information about an existing Data Share Data Lake Gen2 Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetDataLakeGen2.Invoke(new() + /// { + /// Name = "example-dsdlg2ds", + /// ShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetDataLakeGen2Result => getDatasetDataLakeGen2Result.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDatasetDataLakeGen2Args args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:datashare/getDatasetDataLakeGen2:getDatasetDataLakeGen2", args ?? new GetDatasetDataLakeGen2Args(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Share Data Lake Gen2 Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetDataLakeGen2.Invoke(new() + /// { + /// Name = "example-dsdlg2ds", + /// ShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetDataLakeGen2Result => getDatasetDataLakeGen2Result.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDatasetDataLakeGen2InvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:datashare/getDatasetDataLakeGen2:getDatasetDataLakeGen2", args ?? new GetDatasetDataLakeGen2InvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataShare/GetDatasetKustoCluster.cs b/sdk/dotnet/DataShare/GetDatasetKustoCluster.cs index 1ad2821d70..01ae2fd9f8 100644 --- a/sdk/dotnet/DataShare/GetDatasetKustoCluster.cs +++ b/sdk/dotnet/DataShare/GetDatasetKustoCluster.cs @@ -13,12 +13,66 @@ public static class GetDatasetKustoCluster { /// /// Use this data source to access information about an existing Data Share Kusto Cluster Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetKustoCluster.Invoke(new() + /// { + /// Name = "example-dskc", + /// ShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetKustoClusterResult => getDatasetKustoClusterResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDatasetKustoClusterArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:datashare/getDatasetKustoCluster:getDatasetKustoCluster", args ?? new GetDatasetKustoClusterArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Share Kusto Cluster Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetKustoCluster.Invoke(new() + /// { + /// Name = "example-dskc", + /// ShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetKustoClusterResult => getDatasetKustoClusterResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDatasetKustoClusterInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:datashare/getDatasetKustoCluster:getDatasetKustoCluster", args ?? new GetDatasetKustoClusterInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataShare/GetDatasetKustoDatabase.cs b/sdk/dotnet/DataShare/GetDatasetKustoDatabase.cs index 726959bf46..a4503f385d 100644 --- a/sdk/dotnet/DataShare/GetDatasetKustoDatabase.cs +++ b/sdk/dotnet/DataShare/GetDatasetKustoDatabase.cs @@ -13,12 +13,66 @@ public static class GetDatasetKustoDatabase { /// /// Use this data source to access information about an existing Data Share Kusto Database Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetKustoDatabase.Invoke(new() + /// { + /// Name = "example-dskdds", + /// ShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetKustoDatabaseResult => getDatasetKustoDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDatasetKustoDatabaseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:datashare/getDatasetKustoDatabase:getDatasetKustoDatabase", args ?? new GetDatasetKustoDatabaseArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Share Kusto Database Dataset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataShare.GetDatasetKustoDatabase.Invoke(new() + /// { + /// Name = "example-dskdds", + /// ShareId = "example-share-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDatasetKustoDatabaseResult => getDatasetKustoDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDatasetKustoDatabaseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:datashare/getDatasetKustoDatabase:getDatasetKustoDatabase", args ?? new GetDatasetKustoDatabaseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataShare/GetShare.cs b/sdk/dotnet/DataShare/GetShare.cs index 7b2b8342fa..e2855fbc70 100644 --- a/sdk/dotnet/DataShare/GetShare.cs +++ b/sdk/dotnet/DataShare/GetShare.cs @@ -13,12 +13,78 @@ public static class GetShare { /// /// Use this data source to access information about an existing Data Share. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.DataShare.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// var exampleShare = Azure.DataShare.GetShare.Invoke(new() + /// { + /// Name = "existing", + /// AccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleShare.Apply(getShareResult => getShareResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetShareArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:datashare/getShare:getShare", args ?? new GetShareArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Share. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.DataShare.GetAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// var exampleShare = Azure.DataShare.GetShare.Invoke(new() + /// { + /// Name = "existing", + /// AccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleShare.Apply(getShareResult => getShareResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetShareInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:datashare/getShare:getShare", args ?? new GetShareInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataShare/Share.cs b/sdk/dotnet/DataShare/Share.cs index 34e78f75b8..97f5e850e3 100644 --- a/sdk/dotnet/DataShare/Share.cs +++ b/sdk/dotnet/DataShare/Share.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.DataShare /// /// Manages a Data Share. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.DataShare.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Identity = new Azure.DataShare.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// var exampleShare = new Azure.DataShare.Share("exampleShare", new() + /// { + /// AccountId = exampleAccount.Id, + /// Kind = "CopyBased", + /// Description = "example desc", + /// Terms = "example terms", + /// SnapshotSchedule = new Azure.DataShare.Inputs.ShareSnapshotScheduleArgs + /// { + /// Name = "example-ss", + /// Recurrence = "Day", + /// StartTime = "2020-04-17T04:47:52.9614956Z", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Shares can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DatabaseMigration/GetProject.cs b/sdk/dotnet/DatabaseMigration/GetProject.cs index 2b4618466a..07de8c54a9 100644 --- a/sdk/dotnet/DatabaseMigration/GetProject.cs +++ b/sdk/dotnet/DatabaseMigration/GetProject.cs @@ -13,12 +13,68 @@ public static class GetProject { /// /// Use this data source to access information about an existing Database Migration Project. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DatabaseMigration.GetProject.Invoke(new() + /// { + /// Name = "example-dbms-project", + /// ResourceGroupName = "example-rg", + /// ServiceName = "example-dbms", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["name"] = example.Apply(getProjectResult => getProjectResult.Name), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetProjectArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:databasemigration/getProject:getProject", args ?? new GetProjectArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Database Migration Project. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DatabaseMigration.GetProject.Invoke(new() + /// { + /// Name = "example-dbms-project", + /// ResourceGroupName = "example-rg", + /// ServiceName = "example-dbms", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["name"] = example.Apply(getProjectResult => getProjectResult.Name), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetProjectInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:databasemigration/getProject:getProject", args ?? new GetProjectInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DatabaseMigration/GetService.cs b/sdk/dotnet/DatabaseMigration/GetService.cs index 9317b096af..5e86eda504 100644 --- a/sdk/dotnet/DatabaseMigration/GetService.cs +++ b/sdk/dotnet/DatabaseMigration/GetService.cs @@ -13,12 +13,66 @@ public static class GetService { /// /// Use this data source to access information about an existing Database Migration Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DatabaseMigration.GetService.Invoke(new() + /// { + /// Name = "example-dms", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermDmsId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:databasemigration/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Database Migration Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DatabaseMigration.GetService.Invoke(new() + /// { + /// Name = "example-dms", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermDmsId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:databasemigration/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DatabaseMigration/Project.cs b/sdk/dotnet/DatabaseMigration/Project.cs index bdae31f652..13843ed725 100644 --- a/sdk/dotnet/DatabaseMigration/Project.cs +++ b/sdk/dotnet/DatabaseMigration/Project.cs @@ -14,6 +14,61 @@ namespace Pulumi.Azure.DatabaseMigration /// /// > **NOTE:** Destroying a Database Migration Project will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleService = new Azure.DatabaseMigration.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SubnetId = exampleSubnet.Id, + /// SkuName = "Standard_1vCores", + /// }); + /// + /// var exampleProject = new Azure.DatabaseMigration.Project("exampleProject", new() + /// { + /// ServiceName = exampleService.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SourcePlatform = "SQL", + /// TargetPlatform = "SQLDB", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Database Migration Projects can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DatabaseMigration/Service.cs b/sdk/dotnet/DatabaseMigration/Service.cs index 7a127500a1..e9c5e11611 100644 --- a/sdk/dotnet/DatabaseMigration/Service.cs +++ b/sdk/dotnet/DatabaseMigration/Service.cs @@ -14,6 +14,52 @@ namespace Pulumi.Azure.DatabaseMigration /// /// > **NOTE:** Destroying a Database Migration Service will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provide. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleService = new Azure.DatabaseMigration.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SubnetId = exampleSubnet.Id, + /// SkuName = "Standard_1vCores", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Database Migration Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataboxEdge/Device.cs b/sdk/dotnet/DataboxEdge/Device.cs index dc0492ecc5..46cd2d9380 100644 --- a/sdk/dotnet/DataboxEdge/Device.cs +++ b/sdk/dotnet/DataboxEdge/Device.cs @@ -12,6 +12,31 @@ namespace Pulumi.Azure.DataboxEdge /// /// Manages a Databox Edge Device. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDevice = new Azure.DataboxEdge.Device("exampleDevice", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "EdgeP_Base-Standard", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Databox Edge Devices can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DataboxEdge/GetDevice.cs b/sdk/dotnet/DataboxEdge/GetDevice.cs index 816d257216..7331941c07 100644 --- a/sdk/dotnet/DataboxEdge/GetDevice.cs +++ b/sdk/dotnet/DataboxEdge/GetDevice.cs @@ -13,12 +13,58 @@ public static class GetDevice { /// /// Get information about a Databox Edge Device. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataboxEdge.GetDevice.Invoke(new() + /// { + /// Name = "example-device", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDeviceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:databoxedge/getDevice:getDevice", args ?? new GetDeviceArgs(), options.WithDefaults()); /// /// Get information about a Databox Edge Device. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DataboxEdge.GetDevice.Invoke(new() + /// { + /// Name = "example-device", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDeviceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:databoxedge/getDevice:getDevice", args ?? new GetDeviceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DataboxEdge/Order.cs b/sdk/dotnet/DataboxEdge/Order.cs index 282a4461d0..da3e884881 100644 --- a/sdk/dotnet/DataboxEdge/Order.cs +++ b/sdk/dotnet/DataboxEdge/Order.cs @@ -14,6 +14,58 @@ namespace Pulumi.Azure.DataboxEdge /// /// !> Creation of Databox Edge Order is not supported by the Azure API - as such the `azure.databoxedge.Order` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDevice = new Azure.DataboxEdge.Device("exampleDevice", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "EdgeP_Base-Standard", + /// }); + /// + /// var exampleOrder = new Azure.DataboxEdge.Order("exampleOrder", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// DeviceName = exampleDevice.Name, + /// Contact = new Azure.DataboxEdge.Inputs.OrderContactArgs + /// { + /// Name = "TerraForm Test", + /// Emails = new[] + /// { + /// "creator4983@FlynnsArcade.com", + /// }, + /// CompanyName = "Flynn's Arcade", + /// PhoneNumber = "(800) 555-1234", + /// }, + /// ShipmentAddress = new Azure.DataboxEdge.Inputs.OrderShipmentAddressArgs + /// { + /// Addresses = new[] + /// { + /// "One Microsoft Way", + /// }, + /// City = "Redmond", + /// PostalCode = "98052", + /// State = "WA", + /// Country = "United States", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Databox Edge Orders can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Datadog/Monitor.cs b/sdk/dotnet/Datadog/Monitor.cs index 2288300338..4c8a6f8a36 100644 --- a/sdk/dotnet/Datadog/Monitor.cs +++ b/sdk/dotnet/Datadog/Monitor.cs @@ -13,10 +13,75 @@ namespace Pulumi.Azure.Datadog /// Manages a datadog Monitor. /// /// ## Example Usage + /// ### Monitor creation with linking to Datadog organization + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US 2", + /// }); + /// + /// var exampleMonitor = new Azure.Datadog.Monitor("exampleMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatadogOrganization = new Azure.Datadog.Inputs.MonitorDatadogOrganizationArgs + /// { + /// ApiKey = "XXXX", + /// ApplicationKey = "XXXX", + /// }, + /// User = new Azure.Datadog.Inputs.MonitorUserArgs + /// { + /// Name = "Example", + /// Email = "abc@xyz.com", + /// }, + /// SkuName = "Linked", + /// Identity = new Azure.Datadog.Inputs.MonitorIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` /// ## Role Assignment /// /// To enable metrics flow, perform role assignment on the identity created above. `Monitoring reader(43d0d8ad-25c7-4714-9337-8ba259a9fe05)` role is required . /// + /// ### Role assignment on the monitor created + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var monitoringReader = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// Name = "Monitoring Reader", + /// }); + /// + /// var example = new Azure.Authorization.Assignment("example", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionId = monitoringReader.Apply(getRoleDefinitionResult => getRoleDefinitionResult.RoleDefinitionId), + /// PrincipalId = azurerm_datadog_monitor.Example.Identity[0].Principal_id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Datadog Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Datadog/MonitorSsoConfiguration.cs b/sdk/dotnet/Datadog/MonitorSsoConfiguration.cs index 7f2f0a978b..7de41c46a0 100644 --- a/sdk/dotnet/Datadog/MonitorSsoConfiguration.cs +++ b/sdk/dotnet/Datadog/MonitorSsoConfiguration.cs @@ -13,6 +13,50 @@ namespace Pulumi.Azure.Datadog /// Manages SingleSignOn on the datadog Monitor. /// /// ## Example Usage + /// ### Enabling SSO on monitor + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US 2", + /// }); + /// + /// var exampleMonitor = new Azure.Datadog.Monitor("exampleMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatadogOrganization = new Azure.Datadog.Inputs.MonitorDatadogOrganizationArgs + /// { + /// ApiKey = "XXXX", + /// ApplicationKey = "XXXX", + /// }, + /// User = new Azure.Datadog.Inputs.MonitorUserArgs + /// { + /// Name = "Example", + /// Email = "abc@xyz.com", + /// }, + /// SkuName = "Linked", + /// Identity = new Azure.Datadog.Inputs.MonitorIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleMonitorSsoConfiguration = new Azure.Datadog.MonitorSsoConfiguration("exampleMonitorSsoConfiguration", new() + /// { + /// DatadogMonitorId = exampleMonitor.Id, + /// SingleSignOnEnabled = "Enable", + /// EnterpriseApplicationId = "XXXX", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Datadog/MonitorTagRule.cs b/sdk/dotnet/Datadog/MonitorTagRule.cs index f558aac873..dc1bfd88ff 100644 --- a/sdk/dotnet/Datadog/MonitorTagRule.cs +++ b/sdk/dotnet/Datadog/MonitorTagRule.cs @@ -13,6 +13,70 @@ namespace Pulumi.Azure.Datadog /// Manages TagRules on the datadog Monitor. /// /// ## Example Usage + /// ### Adding TagRules on monitor + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US 2", + /// }); + /// + /// var exampleMonitor = new Azure.Datadog.Monitor("exampleMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DatadogOrganization = new Azure.Datadog.Inputs.MonitorDatadogOrganizationArgs + /// { + /// ApiKey = "XXXX", + /// ApplicationKey = "XXXX", + /// }, + /// User = new Azure.Datadog.Inputs.MonitorUserArgs + /// { + /// Name = "Example", + /// Email = "abc@xyz.com", + /// }, + /// SkuName = "Linked", + /// Identity = new Azure.Datadog.Inputs.MonitorIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleMonitorTagRule = new Azure.Datadog.MonitorTagRule("exampleMonitorTagRule", new() + /// { + /// DatadogMonitorId = exampleMonitor.Id, + /// Logs = new[] + /// { + /// new Azure.Datadog.Inputs.MonitorTagRuleLogArgs + /// { + /// SubscriptionLogEnabled = true, + /// }, + /// }, + /// Metrics = new[] + /// { + /// new Azure.Datadog.Inputs.MonitorTagRuleMetricArgs + /// { + /// Filters = new[] + /// { + /// new Azure.Datadog.Inputs.MonitorTagRuleMetricFilterArgs + /// { + /// Name = "Test", + /// Value = "Logs", + /// Action = "Include", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/DesktopVirtualization/Application.cs b/sdk/dotnet/DesktopVirtualization/Application.cs index d8dee37277..d5fb41d7c7 100644 --- a/sdk/dotnet/DesktopVirtualization/Application.cs +++ b/sdk/dotnet/DesktopVirtualization/Application.cs @@ -12,6 +12,64 @@ namespace Pulumi.Azure.DesktopVirtualization /// /// Manages a Virtual Desktop Application. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var pooledbreadthfirst = new Azure.DesktopVirtualization.HostPool("pooledbreadthfirst", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "Pooled", + /// LoadBalancerType = "BreadthFirst", + /// }); + /// + /// var personalautomatic = new Azure.DesktopVirtualization.HostPool("personalautomatic", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "Personal", + /// PersonalDesktopAssignmentType = "Automatic", + /// LoadBalancerType = "BreadthFirst", + /// }); + /// + /// var remoteapp = new Azure.DesktopVirtualization.ApplicationGroup("remoteapp", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "RemoteApp", + /// HostPoolId = pooledbreadthfirst.Id, + /// FriendlyName = "TestAppGroup", + /// Description = "Acceptance Test: An application group", + /// }); + /// + /// var chrome = new Azure.DesktopVirtualization.Application("chrome", new() + /// { + /// ApplicationGroupId = remoteapp.Id, + /// FriendlyName = "Google Chrome", + /// Description = "Chromium based web browser", + /// Path = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + /// CommandLineArgumentPolicy = "DoNotAllow", + /// CommandLineArguments = "--incognito", + /// ShowInPortal = false, + /// IconPath = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + /// IconIndex = 0, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Desktop Application can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DesktopVirtualization/ApplicationGroup.cs b/sdk/dotnet/DesktopVirtualization/ApplicationGroup.cs index 1a7c7845d7..9165a0c15b 100644 --- a/sdk/dotnet/DesktopVirtualization/ApplicationGroup.cs +++ b/sdk/dotnet/DesktopVirtualization/ApplicationGroup.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.DesktopVirtualization /// /// Manages a Virtual Desktop Application Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var pooledbreadthfirst = new Azure.DesktopVirtualization.HostPool("pooledbreadthfirst", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "Pooled", + /// LoadBalancerType = "BreadthFirst", + /// }); + /// + /// var personalautomatic = new Azure.DesktopVirtualization.HostPool("personalautomatic", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "Personal", + /// PersonalDesktopAssignmentType = "Automatic", + /// LoadBalancerType = "BreadthFirst", + /// }); + /// + /// var remoteapp = new Azure.DesktopVirtualization.ApplicationGroup("remoteapp", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "RemoteApp", + /// HostPoolId = pooledbreadthfirst.Id, + /// FriendlyName = "TestAppGroup", + /// Description = "Acceptance Test: An application group", + /// }); + /// + /// var desktopapp = new Azure.DesktopVirtualization.ApplicationGroup("desktopapp", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "Desktop", + /// HostPoolId = personalautomatic.Id, + /// FriendlyName = "TestAppGroup", + /// Description = "Acceptance Test: An application group", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DesktopVirtualization/GetHostPool.cs b/sdk/dotnet/DesktopVirtualization/GetHostPool.cs index add1fd3d2a..b75fccce16 100644 --- a/sdk/dotnet/DesktopVirtualization/GetHostPool.cs +++ b/sdk/dotnet/DesktopVirtualization/GetHostPool.cs @@ -13,12 +13,58 @@ public static class GetHostPool { /// /// Use this data source to access information about an existing Virtual Desktop Host Pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DesktopVirtualization.GetHostPool.Invoke(new() + /// { + /// Name = "example-pool", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetHostPoolArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:desktopvirtualization/getHostPool:getHostPool", args ?? new GetHostPoolArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Virtual Desktop Host Pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DesktopVirtualization.GetHostPool.Invoke(new() + /// { + /// Name = "example-pool", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetHostPoolInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:desktopvirtualization/getHostPool:getHostPool", args ?? new GetHostPoolInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DesktopVirtualization/GetHostPoolRegistrationInfo.cs b/sdk/dotnet/DesktopVirtualization/GetHostPoolRegistrationInfo.cs index b0a4aa9e20..90ba1efeed 100644 --- a/sdk/dotnet/DesktopVirtualization/GetHostPoolRegistrationInfo.cs +++ b/sdk/dotnet/DesktopVirtualization/GetHostPoolRegistrationInfo.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.DesktopVirtualization /// /// Manages the Registration Info for a Virtual Desktop Host Pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "westeurope", + /// }); + /// + /// var exampleHostPool = new Azure.DesktopVirtualization.HostPool("exampleHostPool", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Type = "Pooled", + /// ValidateEnvironment = true, + /// LoadBalancerType = "BreadthFirst", + /// }); + /// + /// var examplegetHostPoolRegistrationInfo = new Azure.DesktopVirtualization.GetHostPoolRegistrationInfo("examplegetHostPoolRegistrationInfo", new() + /// { + /// HostpoolId = exampleHostPool.Id, + /// ExpirationDate = "2022-01-01T23:40:52Z", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// AVD Registration Infos can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DesktopVirtualization/HostPool.cs b/sdk/dotnet/DesktopVirtualization/HostPool.cs index bbd890ff11..fe024f33cb 100644 --- a/sdk/dotnet/DesktopVirtualization/HostPool.cs +++ b/sdk/dotnet/DesktopVirtualization/HostPool.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.DesktopVirtualization /// /// Manages a Virtual Desktop Host Pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleHostPool = new Azure.DesktopVirtualization.HostPool("exampleHostPool", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FriendlyName = "pooleddepthfirst", + /// ValidateEnvironment = true, + /// StartVmOnConnect = true, + /// CustomRdpProperties = "audiocapturemode:i:1;audiomode:i:0;", + /// Description = "Acceptance Test: A pooled host pool - pooleddepthfirst", + /// Type = "Pooled", + /// MaximumSessionsAllowed = 50, + /// LoadBalancerType = "DepthFirst", + /// ScheduledAgentUpdates = new Azure.DesktopVirtualization.Inputs.HostPoolScheduledAgentUpdatesArgs + /// { + /// Enabled = true, + /// Schedules = new[] + /// { + /// new Azure.DesktopVirtualization.Inputs.HostPoolScheduledAgentUpdatesScheduleArgs + /// { + /// DayOfWeek = "Saturday", + /// HourOfDay = 2, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Desktop Host Pools can be imported using the `resource id`, e.g. text diff --git a/sdk/dotnet/DesktopVirtualization/ScalingPlan.cs b/sdk/dotnet/DesktopVirtualization/ScalingPlan.cs index df047e9111..7767d1bcc3 100644 --- a/sdk/dotnet/DesktopVirtualization/ScalingPlan.cs +++ b/sdk/dotnet/DesktopVirtualization/ScalingPlan.cs @@ -18,6 +18,133 @@ namespace Pulumi.Azure.DesktopVirtualization /// /// > **Note** Scaling Plans require specific permissions to be granted to the Windows Virtual Desktop application before a 'host_pool' can be configured. [Required Permissions for Scaling Plans](https://docs.microsoft.com/azure/virtual-desktop/autoscale-scaling-plan#create-a-custom-rbac-role). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleRandomUuid = new Random.RandomUuid("exampleRandomUuid"); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRoleDefinition = new Azure.Authorization.RoleDefinition("exampleRoleDefinition", new() + /// { + /// Scope = exampleResourceGroup.Id, + /// Description = "AVD AutoScale Role", + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Insights/eventtypes/values/read", + /// "Microsoft.Compute/virtualMachines/deallocate/action", + /// "Microsoft.Compute/virtualMachines/restart/action", + /// "Microsoft.Compute/virtualMachines/powerOff/action", + /// "Microsoft.Compute/virtualMachines/start/action", + /// "Microsoft.Compute/virtualMachines/read", + /// "Microsoft.DesktopVirtualization/hostpools/read", + /// "Microsoft.DesktopVirtualization/hostpools/write", + /// "Microsoft.DesktopVirtualization/hostpools/sessionhosts/read", + /// "Microsoft.DesktopVirtualization/hostpools/sessionhosts/write", + /// "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete", + /// "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + /// "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action", + /// "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// exampleResourceGroup.Id, + /// }, + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "Windows Virtual Desktop", + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Name = exampleRandomUuid.Result, + /// Scope = exampleResourceGroup.Id, + /// RoleDefinitionId = exampleRoleDefinition.RoleDefinitionResourceId, + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.Id), + /// SkipServicePrincipalAadCheck = true, + /// }); + /// + /// var exampleHostPool = new Azure.DesktopVirtualization.HostPool("exampleHostPool", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Type = "Pooled", + /// ValidateEnvironment = true, + /// LoadBalancerType = "BreadthFirst", + /// }); + /// + /// var exampleScalingPlan = new Azure.DesktopVirtualization.ScalingPlan("exampleScalingPlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FriendlyName = "Scaling Plan Example", + /// Description = "Example Scaling Plan", + /// TimeZone = "GMT Standard Time", + /// Schedules = new[] + /// { + /// new Azure.DesktopVirtualization.Inputs.ScalingPlanScheduleArgs + /// { + /// Name = "Weekdays", + /// DaysOfWeeks = new[] + /// { + /// "Monday", + /// "Tuesday", + /// "Wednesday", + /// "Thursday", + /// "Friday", + /// }, + /// RampUpStartTime = "05:00", + /// RampUpLoadBalancingAlgorithm = "BreadthFirst", + /// RampUpMinimumHostsPercent = 20, + /// RampUpCapacityThresholdPercent = 10, + /// PeakStartTime = "09:00", + /// PeakLoadBalancingAlgorithm = "BreadthFirst", + /// RampDownStartTime = "19:00", + /// RampDownLoadBalancingAlgorithm = "DepthFirst", + /// RampDownMinimumHostsPercent = 10, + /// RampDownForceLogoffUsers = false, + /// RampDownWaitTimeMinutes = 45, + /// RampDownNotificationMessage = "Please log off in the next 45 minutes...", + /// RampDownCapacityThresholdPercent = 5, + /// RampDownStopHostsWhen = "ZeroSessions", + /// OffPeakStartTime = "22:00", + /// OffPeakLoadBalancingAlgorithm = "DepthFirst", + /// }, + /// }, + /// HostPools = new[] + /// { + /// new Azure.DesktopVirtualization.Inputs.ScalingPlanHostPoolArgs + /// { + /// HostpoolId = exampleHostPool.Id, + /// ScalingPlanEnabled = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Desktop Scaling Plans can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DesktopVirtualization/Workspace.cs b/sdk/dotnet/DesktopVirtualization/Workspace.cs index fa5934810e..69ab06ec8f 100644 --- a/sdk/dotnet/DesktopVirtualization/Workspace.cs +++ b/sdk/dotnet/DesktopVirtualization/Workspace.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.DesktopVirtualization /// /// Manages a Virtual Desktop Workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var workspace = new Azure.DesktopVirtualization.Workspace("workspace", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// FriendlyName = "FriendlyName", + /// Description = "A description of my workspace", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Desktop Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DesktopVirtualization/WorkspaceApplicationGroupAssociation.cs b/sdk/dotnet/DesktopVirtualization/WorkspaceApplicationGroupAssociation.cs index 3995cc5800..bb8d141bc1 100644 --- a/sdk/dotnet/DesktopVirtualization/WorkspaceApplicationGroupAssociation.cs +++ b/sdk/dotnet/DesktopVirtualization/WorkspaceApplicationGroupAssociation.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.DesktopVirtualization /// /// Manages a Virtual Desktop Workspace Application Group Association. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var pooledbreadthfirst = new Azure.DesktopVirtualization.HostPool("pooledbreadthfirst", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "Pooled", + /// LoadBalancerType = "BreadthFirst", + /// }); + /// + /// var remoteapp = new Azure.DesktopVirtualization.ApplicationGroup("remoteapp", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Type = "RemoteApp", + /// HostPoolId = pooledbreadthfirst.Id, + /// }); + /// + /// var workspace = new Azure.DesktopVirtualization.Workspace("workspace", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// }); + /// + /// var workspaceremoteapp = new Azure.DesktopVirtualization.WorkspaceApplicationGroupAssociation("workspaceremoteapp", new() + /// { + /// WorkspaceId = workspace.Id, + /// ApplicationGroupId = remoteapp.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between Virtual Desktop Workspaces and Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DevCenter/DevCenter.cs b/sdk/dotnet/DevCenter/DevCenter.cs index c69bb9fc75..97e226b191 100644 --- a/sdk/dotnet/DevCenter/DevCenter.cs +++ b/sdk/dotnet/DevCenter/DevCenter.cs @@ -14,6 +14,35 @@ namespace Pulumi.Azure.DevCenter /// /// Manages a Dev Center. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleDevCenter = new Azure.DevCenter.DevCenter("exampleDevCenter", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` /// ## Blocks Reference /// /// ### `identity` Block diff --git a/sdk/dotnet/DevCenter/Project.cs b/sdk/dotnet/DevCenter/Project.cs index 895db8d4e2..beabe44e4d 100644 --- a/sdk/dotnet/DevCenter/Project.cs +++ b/sdk/dotnet/DevCenter/Project.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.DevCenter /// /// Manages a Dev Center Project. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDevCenter = new Azure.DevCenter.DevCenter("exampleDevCenter", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.DevCenter.Inputs.DevCenterIdentityArgs + /// { + /// Type = "example-value", + /// }, + /// }); + /// + /// var exampleProject = new Azure.DevCenter.Project("exampleProject", new() + /// { + /// DevCenterId = exampleDevCenter.Id, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing Dev Center Project can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/dotnet/DevTest/GetLab.cs b/sdk/dotnet/DevTest/GetLab.cs index e64e6d2d4b..2123ca4f68 100644 --- a/sdk/dotnet/DevTest/GetLab.cs +++ b/sdk/dotnet/DevTest/GetLab.cs @@ -13,12 +13,66 @@ public static class GetLab { /// /// Use this data source to access information about an existing Dev Test Lab. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DevTest.GetLab.Invoke(new() + /// { + /// Name = "example-lab", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["uniqueIdentifier"] = example.Apply(getLabResult => getLabResult.UniqueIdentifier), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetLabArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:devtest/getLab:getLab", args ?? new GetLabArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Dev Test Lab. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DevTest.GetLab.Invoke(new() + /// { + /// Name = "example-lab", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["uniqueIdentifier"] = example.Apply(getLabResult => getLabResult.UniqueIdentifier), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetLabInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:devtest/getLab:getLab", args ?? new GetLabInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DevTest/GetVirtualNetwork.cs b/sdk/dotnet/DevTest/GetVirtualNetwork.cs index 04838cb9dc..34bcca1659 100644 --- a/sdk/dotnet/DevTest/GetVirtualNetwork.cs +++ b/sdk/dotnet/DevTest/GetVirtualNetwork.cs @@ -13,12 +13,68 @@ public static class GetVirtualNetwork { /// /// Use this data source to access information about an existing Dev Test Lab Virtual Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DevTest.GetVirtualNetwork.Invoke(new() + /// { + /// Name = "example-network", + /// LabName = "examplelab", + /// ResourceGroupName = "example-resource", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["labSubnetName"] = example.Apply(getVirtualNetworkResult => getVirtualNetworkResult.AllowedSubnets[0]?.LabSubnetName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVirtualNetworkArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:devtest/getVirtualNetwork:getVirtualNetwork", args ?? new GetVirtualNetworkArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Dev Test Lab Virtual Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DevTest.GetVirtualNetwork.Invoke(new() + /// { + /// Name = "example-network", + /// LabName = "examplelab", + /// ResourceGroupName = "example-resource", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["labSubnetName"] = example.Apply(getVirtualNetworkResult => getVirtualNetworkResult.AllowedSubnets[0]?.LabSubnetName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVirtualNetworkInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:devtest/getVirtualNetwork:getVirtualNetwork", args ?? new GetVirtualNetworkInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DevTest/GlobalVMShutdownSchedule.cs b/sdk/dotnet/DevTest/GlobalVMShutdownSchedule.cs index c9e1d95f9a..f2fb316422 100644 --- a/sdk/dotnet/DevTest/GlobalVMShutdownSchedule.cs +++ b/sdk/dotnet/DevTest/GlobalVMShutdownSchedule.cs @@ -14,6 +14,101 @@ namespace Pulumi.Azure.DevTest /// this resource applies only to standard VMs, not DevTest Lab VMs. To manage automated shutdown schedules for DevTest Lab VMs, reference the /// `azure.devtest.Schedule` resource /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// Size = "Standard_B2s", + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Name = "myosdisk-example", + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// DisablePasswordAuthentication = false, + /// }); + /// + /// var exampleGlobalVMShutdownSchedule = new Azure.DevTest.GlobalVMShutdownSchedule("exampleGlobalVMShutdownSchedule", new() + /// { + /// VirtualMachineId = exampleLinuxVirtualMachine.Id, + /// Location = exampleResourceGroup.Location, + /// Enabled = true, + /// DailyRecurrenceTime = "1100", + /// Timezone = "Pacific Standard Time", + /// NotificationSettings = new Azure.DevTest.Inputs.GlobalVMShutdownScheduleNotificationSettingsArgs + /// { + /// Enabled = true, + /// TimeInMinutes = 60, + /// WebhookUrl = "https://sample-webhook-url.example.com", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing Dev Test Global Shutdown Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DevTest/Lab.cs b/sdk/dotnet/DevTest/Lab.cs index 94d89bc8cf..9e216b2fdb 100644 --- a/sdk/dotnet/DevTest/Lab.cs +++ b/sdk/dotnet/DevTest/Lab.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.DevTest /// /// Manages a Dev Test Lab. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.DevTest.Lab("exampleLab", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "Sydney", "Australia" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dev Test Labs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DevTest/LinuxVirtualMachine.cs b/sdk/dotnet/DevTest/LinuxVirtualMachine.cs index 2fa2b9bb25..667b1e86d3 100644 --- a/sdk/dotnet/DevTest/LinuxVirtualMachine.cs +++ b/sdk/dotnet/DevTest/LinuxVirtualMachine.cs @@ -12,6 +12,67 @@ namespace Pulumi.Azure.DevTest /// /// Manages a Linux Virtual Machine within a Dev Test Lab. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.DevTest.Lab("exampleLab", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "Sydney", "Australia" }, + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.DevTest.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// LabName = exampleLab.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Subnet = new Azure.DevTest.Inputs.VirtualNetworkSubnetArgs + /// { + /// UsePublicIpAddress = "Allow", + /// UseInVirtualMachineCreation = "Allow", + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.DevTest.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// LabName = exampleLab.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_DS2", + /// Username = "exampleuser99", + /// SshKey = File.ReadAllText("~/.ssh/id_rsa.pub"), + /// LabVirtualNetworkId = exampleVirtualNetwork.Id, + /// LabSubnetName = exampleVirtualNetwork.Subnet.Apply(subnet => subnet.Name), + /// StorageType = "Premium", + /// Notes = "Some notes about this Virtual Machine.", + /// GalleryImageReference = new Azure.DevTest.Inputs.LinuxVirtualMachineGalleryImageReferenceArgs + /// { + /// Offer = "UbuntuServer", + /// Publisher = "Canonical", + /// Sku = "18.04-LTS", + /// Version = "latest", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dev Test Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DevTest/Policy.cs b/sdk/dotnet/DevTest/Policy.cs index eb2c02f1a4..cc7fb00c8a 100644 --- a/sdk/dotnet/DevTest/Policy.cs +++ b/sdk/dotnet/DevTest/Policy.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.DevTest /// /// Manages a Policy within a Dev Test Policy Set. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.DevTest.Lab("exampleLab", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "Sydney", "Australia" }, + /// }, + /// }); + /// + /// var examplePolicy = new Azure.DevTest.Policy("examplePolicy", new() + /// { + /// PolicySetName = "default", + /// LabName = exampleLab.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FactData = "", + /// Threshold = "999", + /// EvaluatorType = "MaxValuePolicy", + /// Tags = + /// { + /// { "Acceptance", "Test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dev Test Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DevTest/Schedule.cs b/sdk/dotnet/DevTest/Schedule.cs index 69c50b7ee1..c9cc06aa34 100644 --- a/sdk/dotnet/DevTest/Schedule.cs +++ b/sdk/dotnet/DevTest/Schedule.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.DevTest /// /// Manages automated startup and shutdown schedules for Azure Dev Test Lab. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.DevTest.Lab("exampleLab", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSchedule = new Azure.DevTest.Schedule("exampleSchedule", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LabName = exampleLab.Name, + /// WeeklyRecurrence = new Azure.DevTest.Inputs.ScheduleWeeklyRecurrenceArgs + /// { + /// Time = "1100", + /// WeekDays = new[] + /// { + /// "Monday", + /// "Tuesday", + /// }, + /// }, + /// TimeZoneId = "Pacific Standard Time", + /// TaskType = "LabVmsStartupTask", + /// NotificationSettings = null, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// DevTest Schedule's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DevTest/VirtualNetwork.cs b/sdk/dotnet/DevTest/VirtualNetwork.cs index e5edc6d394..f01893a4d3 100644 --- a/sdk/dotnet/DevTest/VirtualNetwork.cs +++ b/sdk/dotnet/DevTest/VirtualNetwork.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.DevTest /// /// Manages a Virtual Network within a DevTest Lab. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.DevTest.Lab("exampleLab", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "Sydney", "Australia" }, + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.DevTest.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// LabName = exampleLab.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Subnet = new Azure.DevTest.Inputs.VirtualNetworkSubnetArgs + /// { + /// UsePublicIpAddress = "Allow", + /// UseInVirtualMachineCreation = "Allow", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// DevTest Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DevTest/WindowsVirtualMachine.cs b/sdk/dotnet/DevTest/WindowsVirtualMachine.cs index 39ee66ac2d..3612dfeca1 100644 --- a/sdk/dotnet/DevTest/WindowsVirtualMachine.cs +++ b/sdk/dotnet/DevTest/WindowsVirtualMachine.cs @@ -12,6 +12,66 @@ namespace Pulumi.Azure.DevTest /// /// Manages a Windows Virtual Machine within a Dev Test Lab. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.DevTest.Lab("exampleLab", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "Sydney", "Australia" }, + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.DevTest.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// LabName = exampleLab.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Subnet = new Azure.DevTest.Inputs.VirtualNetworkSubnetArgs + /// { + /// UsePublicIpAddress = "Allow", + /// UseInVirtualMachineCreation = "Allow", + /// }, + /// }); + /// + /// var exampleWindowsVirtualMachine = new Azure.DevTest.WindowsVirtualMachine("exampleWindowsVirtualMachine", new() + /// { + /// LabName = exampleLab.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_DS2", + /// Username = "exampleuser99", + /// Password = "Pa$w0rd1234!", + /// LabVirtualNetworkId = exampleVirtualNetwork.Id, + /// LabSubnetName = exampleVirtualNetwork.Subnet.Apply(subnet => subnet.Name), + /// StorageType = "Premium", + /// Notes = "Some notes about this Virtual Machine.", + /// GalleryImageReference = new Azure.DevTest.Inputs.WindowsVirtualMachineGalleryImageReferenceArgs + /// { + /// Offer = "WindowsServer", + /// Publisher = "MicrosoftWindowsServer", + /// Sku = "2019-Datacenter", + /// Version = "latest", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// DevTest Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DigitalTwins/EndpointEventGrid.cs b/sdk/dotnet/DigitalTwins/EndpointEventGrid.cs index aed9a817eb..920d39123d 100644 --- a/sdk/dotnet/DigitalTwins/EndpointEventGrid.cs +++ b/sdk/dotnet/DigitalTwins/EndpointEventGrid.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.DigitalTwins /// /// Manages a Digital Twins Event Grid Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInstance = new Azure.DigitalTwins.Instance("exampleInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleTopic = new Azure.EventGrid.Topic("exampleTopic", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleEndpointEventGrid = new Azure.DigitalTwins.EndpointEventGrid("exampleEndpointEventGrid", new() + /// { + /// DigitalTwinsId = exampleInstance.Id, + /// EventgridTopicEndpoint = exampleTopic.Endpoint, + /// EventgridTopicPrimaryAccessKey = exampleTopic.PrimaryAccessKey, + /// EventgridTopicSecondaryAccessKey = exampleTopic.SecondaryAccessKey, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Digital Twins Eventgrid Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DigitalTwins/EndpointEventHub.cs b/sdk/dotnet/DigitalTwins/EndpointEventHub.cs index 90ae56299c..12c53d6cb0 100644 --- a/sdk/dotnet/DigitalTwins/EndpointEventHub.cs +++ b/sdk/dotnet/DigitalTwins/EndpointEventHub.cs @@ -12,6 +12,62 @@ namespace Pulumi.Azure.DigitalTwins /// /// Manages a Digital Twins Event Hub Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInstance = new Azure.DigitalTwins.Instance("exampleInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Listen = false, + /// Send = true, + /// Manage = false, + /// }); + /// + /// var exampleEndpointEventHub = new Azure.DigitalTwins.EndpointEventHub("exampleEndpointEventHub", new() + /// { + /// DigitalTwinsId = exampleInstance.Id, + /// EventhubPrimaryConnectionString = exampleAuthorizationRule.PrimaryConnectionString, + /// EventhubSecondaryConnectionString = exampleAuthorizationRule.SecondaryConnectionString, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Digital Twins Eventhub Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DigitalTwins/EndpointServicebus.cs b/sdk/dotnet/DigitalTwins/EndpointServicebus.cs index d00e007696..910e256e3a 100644 --- a/sdk/dotnet/DigitalTwins/EndpointServicebus.cs +++ b/sdk/dotnet/DigitalTwins/EndpointServicebus.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.DigitalTwins /// /// Manages a Digital Twins Service Bus Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInstance = new Azure.DigitalTwins.Instance("exampleInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// }); + /// + /// var exampleTopicAuthorizationRule = new Azure.ServiceBus.TopicAuthorizationRule("exampleTopicAuthorizationRule", new() + /// { + /// TopicId = exampleTopic.Id, + /// Listen = false, + /// Send = true, + /// Manage = false, + /// }); + /// + /// var exampleEndpointServicebus = new Azure.DigitalTwins.EndpointServicebus("exampleEndpointServicebus", new() + /// { + /// DigitalTwinsId = exampleInstance.Id, + /// ServicebusPrimaryConnectionString = exampleTopicAuthorizationRule.PrimaryConnectionString, + /// ServicebusSecondaryConnectionString = exampleTopicAuthorizationRule.SecondaryConnectionString, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Digital Twins Service Bus Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DigitalTwins/GetInstance.cs b/sdk/dotnet/DigitalTwins/GetInstance.cs index 9898629f77..d4b05926e2 100644 --- a/sdk/dotnet/DigitalTwins/GetInstance.cs +++ b/sdk/dotnet/DigitalTwins/GetInstance.cs @@ -13,12 +13,66 @@ public static class GetInstance { /// /// Use this data source to access information about an existing Digital Twins instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DigitalTwins.GetInstance.Invoke(new() + /// { + /// Name = "existing-digital-twins", + /// ResourceGroupName = "existing-resgroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getInstanceResult => getInstanceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetInstanceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:digitaltwins/getInstance:getInstance", args ?? new GetInstanceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Digital Twins instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DigitalTwins.GetInstance.Invoke(new() + /// { + /// Name = "existing-digital-twins", + /// ResourceGroupName = "existing-resgroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getInstanceResult => getInstanceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetInstanceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:digitaltwins/getInstance:getInstance", args ?? new GetInstanceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DigitalTwins/Instance.cs b/sdk/dotnet/DigitalTwins/Instance.cs index 4f64eabe1a..9df8e3e79e 100644 --- a/sdk/dotnet/DigitalTwins/Instance.cs +++ b/sdk/dotnet/DigitalTwins/Instance.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.DigitalTwins /// /// Manages a Digital Twins instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInstance = new Azure.DigitalTwins.Instance("exampleInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Digital Twins instances can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DigitalTwins/TimeSeriesDatabaseConnection.cs b/sdk/dotnet/DigitalTwins/TimeSeriesDatabaseConnection.cs index 2f63e63f78..7ffae03b3a 100644 --- a/sdk/dotnet/DigitalTwins/TimeSeriesDatabaseConnection.cs +++ b/sdk/dotnet/DigitalTwins/TimeSeriesDatabaseConnection.cs @@ -12,6 +12,120 @@ namespace Pulumi.Azure.DigitalTwins /// /// Manages a Digital Twins Time Series Database Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInstance = new Azure.DigitalTwins.Instance("exampleInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.DigitalTwins.Inputs.InstanceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 7, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// }); + /// + /// var databaseContributor = new Azure.Authorization.Assignment("databaseContributor", new() + /// { + /// Scope = exampleDatabase.Id, + /// PrincipalId = exampleInstance.Identity.Apply(identity => identity?.PrincipalId), + /// RoleDefinitionName = "Contributor", + /// }); + /// + /// var eventhubDataOwner = new Azure.Authorization.Assignment("eventhubDataOwner", new() + /// { + /// Scope = exampleEventHub.Id, + /// PrincipalId = exampleInstance.Identity.Apply(identity => identity?.PrincipalId), + /// RoleDefinitionName = "Azure Event Hubs Data Owner", + /// }); + /// + /// var exampleDatabasePrincipalAssignment = new Azure.Kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClusterName = exampleCluster.Name, + /// DatabaseName = exampleDatabase.Name, + /// TenantId = exampleInstance.Identity.Apply(identity => identity?.TenantId), + /// PrincipalId = exampleInstance.Identity.Apply(identity => identity?.PrincipalId), + /// PrincipalType = "App", + /// Role = "Admin", + /// }); + /// + /// var exampleTimeSeriesDatabaseConnection = new Azure.DigitalTwins.TimeSeriesDatabaseConnection("exampleTimeSeriesDatabaseConnection", new() + /// { + /// DigitalTwinsId = exampleInstance.Id, + /// EventhubName = exampleEventHub.Name, + /// EventhubNamespaceId = exampleEventHubNamespace.Id, + /// EventhubNamespaceEndpointUri = exampleEventHubNamespace.Name.Apply(name => $"sb://{name}.servicebus.windows.net"), + /// EventhubConsumerGroupName = exampleConsumerGroup.Name, + /// KustoClusterId = exampleCluster.Id, + /// KustoClusterUri = exampleCluster.Uri, + /// KustoDatabaseName = exampleDatabase.Name, + /// KustoTableName = "exampleTable", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// databaseContributor, + /// eventhubDataOwner, + /// exampleDatabasePrincipalAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Digital Twins Time Series Database Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/ARecord.cs b/sdk/dotnet/Dns/ARecord.cs index 129e650d12..1f90821a12 100644 --- a/sdk/dotnet/Dns/ARecord.cs +++ b/sdk/dotnet/Dns/ARecord.cs @@ -10,6 +10,78 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleARecord = new Azure.Dns.ARecord("exampleARecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// "10.0.180.17", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Alias Record) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// IpVersion = "IPv4", + /// }); + /// + /// var exampleARecord = new Azure.Dns.ARecord("exampleARecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// TargetResourceId = examplePublicIp.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/AaaaRecord.cs b/sdk/dotnet/Dns/AaaaRecord.cs index 4208c0b4df..86cc29e2bb 100644 --- a/sdk/dotnet/Dns/AaaaRecord.cs +++ b/sdk/dotnet/Dns/AaaaRecord.cs @@ -10,6 +10,78 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAaaaRecord = new Azure.Dns.AaaaRecord("exampleAaaaRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// "2001:db8::1:0:0:1", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Alias Record) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// IpVersion = "IPv6", + /// }); + /// + /// var exampleAaaaRecord = new Azure.Dns.AaaaRecord("exampleAaaaRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// TargetResourceId = examplePublicIp.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// AAAA records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/CNameRecord.cs b/sdk/dotnet/Dns/CNameRecord.cs index 076df9e3b0..1b732981ee 100644 --- a/sdk/dotnet/Dns/CNameRecord.cs +++ b/sdk/dotnet/Dns/CNameRecord.cs @@ -10,6 +10,75 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleCNameRecord = new Azure.Dns.CNameRecord("exampleCNameRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Record = "contoso.com", + /// }); + /// + /// }); + /// ``` + /// ### Alias Record) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var target = new Azure.Dns.CNameRecord("target", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Record = "contoso.com", + /// }); + /// + /// var exampleCNameRecord = new Azure.Dns.CNameRecord("exampleCNameRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// TargetResourceId = target.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CNAME records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/CaaRecord.cs b/sdk/dotnet/Dns/CaaRecord.cs index 62d62ae035..5c1f32433f 100644 --- a/sdk/dotnet/Dns/CaaRecord.cs +++ b/sdk/dotnet/Dns/CaaRecord.cs @@ -10,6 +10,67 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleCaaRecord = new Azure.Dns.CaaRecord("exampleCaaRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.Dns.Inputs.CaaRecordRecordArgs + /// { + /// Flags = 0, + /// Tag = "issue", + /// Value = "example.com", + /// }, + /// new Azure.Dns.Inputs.CaaRecordRecordArgs + /// { + /// Flags = 0, + /// Tag = "issue", + /// Value = "example.net", + /// }, + /// new Azure.Dns.Inputs.CaaRecordRecordArgs + /// { + /// Flags = 0, + /// Tag = "issuewild", + /// Value = ";", + /// }, + /// new Azure.Dns.Inputs.CaaRecordRecordArgs + /// { + /// Flags = 0, + /// Tag = "iodef", + /// Value = "mailto:user@nonexisting.tld", + /// }, + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// CAA records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/GetAAAARecord.cs b/sdk/dotnet/Dns/GetAAAARecord.cs index 251893fae7..e75aadaa15 100644 --- a/sdk/dotnet/Dns/GetAAAARecord.cs +++ b/sdk/dotnet/Dns/GetAAAARecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetAAAARecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.AaaaRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsAaaaRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetAAAARecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getAAAARecord:getAAAARecord", args ?? new GetAAAARecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.AaaaRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsAaaaRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetAAAARecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getAAAARecord:getAAAARecord", args ?? new GetAAAARecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetARecord.cs b/sdk/dotnet/Dns/GetARecord.cs index 149d60274a..7d6dcaa99b 100644 --- a/sdk/dotnet/Dns/GetARecord.cs +++ b/sdk/dotnet/Dns/GetARecord.cs @@ -11,9 +11,67 @@ namespace Pulumi.Azure.Dns { public static class GetARecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Dns.GetARecord.Invoke(new() + /// { + /// Name = "test", + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsARecordId"] = example.Apply(getARecordResult => getARecordResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetARecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getARecord:getARecord", args ?? new GetARecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Dns.GetARecord.Invoke(new() + /// { + /// Name = "test", + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsARecordId"] = example.Apply(getARecordResult => getARecordResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetARecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getARecord:getARecord", args ?? new GetARecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetCAARecord.cs b/sdk/dotnet/Dns/GetCAARecord.cs index 427d4a6955..432b5402a9 100644 --- a/sdk/dotnet/Dns/GetCAARecord.cs +++ b/sdk/dotnet/Dns/GetCAARecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetCAARecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.CaaRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsCaaRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetCAARecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getCAARecord:getCAARecord", args ?? new GetCAARecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.CaaRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsCaaRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetCAARecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getCAARecord:getCAARecord", args ?? new GetCAARecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetCnameRecord.cs b/sdk/dotnet/Dns/GetCnameRecord.cs index ae1432162f..af8857040a 100644 --- a/sdk/dotnet/Dns/GetCnameRecord.cs +++ b/sdk/dotnet/Dns/GetCnameRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetCnameRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.CNameRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsCnameRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetCnameRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getCnameRecord:getCnameRecord", args ?? new GetCnameRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.CNameRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsCnameRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetCnameRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getCnameRecord:getCnameRecord", args ?? new GetCnameRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetMxRecord.cs b/sdk/dotnet/Dns/GetMxRecord.cs index 8039a39a40..1691733b9f 100644 --- a/sdk/dotnet/Dns/GetMxRecord.cs +++ b/sdk/dotnet/Dns/GetMxRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetMxRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.MxRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsMxRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetMxRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getMxRecord:getMxRecord", args ?? new GetMxRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.MxRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsMxRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetMxRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getMxRecord:getMxRecord", args ?? new GetMxRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetNsRecord.cs b/sdk/dotnet/Dns/GetNsRecord.cs index d184d4a037..3ff74fd185 100644 --- a/sdk/dotnet/Dns/GetNsRecord.cs +++ b/sdk/dotnet/Dns/GetNsRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetNsRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.NsRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsNsRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetNsRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getNsRecord:getNsRecord", args ?? new GetNsRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.NsRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsNsRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetNsRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getNsRecord:getNsRecord", args ?? new GetNsRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetPtrRecord.cs b/sdk/dotnet/Dns/GetPtrRecord.cs index 80135162c0..0b30211088 100644 --- a/sdk/dotnet/Dns/GetPtrRecord.cs +++ b/sdk/dotnet/Dns/GetPtrRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetPtrRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.PtrRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsPtrRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetPtrRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getPtrRecord:getPtrRecord", args ?? new GetPtrRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.PtrRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsPtrRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetPtrRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getPtrRecord:getPtrRecord", args ?? new GetPtrRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetSrvRecord.cs b/sdk/dotnet/Dns/GetSrvRecord.cs index 340cc9bd69..9cde4c830e 100644 --- a/sdk/dotnet/Dns/GetSrvRecord.cs +++ b/sdk/dotnet/Dns/GetSrvRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetSrvRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.SrvRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsSrvRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetSrvRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getSrvRecord:getSrvRecord", args ?? new GetSrvRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.SrvRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsSrvRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetSrvRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getSrvRecord:getSrvRecord", args ?? new GetSrvRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetTxtRecord.cs b/sdk/dotnet/Dns/GetTxtRecord.cs index cbb2cc23ce..ebf6117ec4 100644 --- a/sdk/dotnet/Dns/GetTxtRecord.cs +++ b/sdk/dotnet/Dns/GetTxtRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.Dns { public static class GetTxtRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.TxtRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsTxtRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetTxtRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getTxtRecord:getTxtRecord", args ?? new GetTxtRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Dns.TxtRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsTxtRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetTxtRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getTxtRecord:getTxtRecord", args ?? new GetTxtRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Dns/GetZone.cs b/sdk/dotnet/Dns/GetZone.cs index d73933c1c3..9a7dce5b04 100644 --- a/sdk/dotnet/Dns/GetZone.cs +++ b/sdk/dotnet/Dns/GetZone.cs @@ -13,12 +13,66 @@ public static class GetZone { /// /// Use this data source to access information about an existing DNS Zone. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Dns.GetZone.Invoke(new() + /// { + /// Name = "search-eventhubns", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsZoneId"] = example.Apply(getZoneResult => getZoneResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetZoneArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:dns/getZone:getZone", args ?? new GetZoneArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing DNS Zone. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Dns.GetZone.Invoke(new() + /// { + /// Name = "search-eventhubns", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["dnsZoneId"] = example.Apply(getZoneResult => getZoneResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetZoneInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:dns/getZone:getZone", args ?? new GetZoneInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Dns/MxRecord.cs b/sdk/dotnet/Dns/MxRecord.cs index 72cb11a595..51708cf91c 100644 --- a/sdk/dotnet/Dns/MxRecord.cs +++ b/sdk/dotnet/Dns/MxRecord.cs @@ -10,6 +10,53 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleMxRecord = new Azure.Dns.MxRecord("exampleMxRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.Dns.Inputs.MxRecordRecordArgs + /// { + /// Preference = "10", + /// Exchange = "mail1.contoso.com", + /// }, + /// new Azure.Dns.Inputs.MxRecordRecordArgs + /// { + /// Preference = "20", + /// Exchange = "mail2.contoso.com", + /// }, + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MX records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/NsRecord.cs b/sdk/dotnet/Dns/NsRecord.cs index 9f8dc14aa3..28c7ae65d6 100644 --- a/sdk/dotnet/Dns/NsRecord.cs +++ b/sdk/dotnet/Dns/NsRecord.cs @@ -10,6 +10,45 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNsRecord = new Azure.Dns.NsRecord("exampleNsRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// "ns1.contoso.com.", + /// "ns2.contoso.com.", + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// NS records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/PtrRecord.cs b/sdk/dotnet/Dns/PtrRecord.cs index e2bd3eb025..0792b748e9 100644 --- a/sdk/dotnet/Dns/PtrRecord.cs +++ b/sdk/dotnet/Dns/PtrRecord.cs @@ -10,6 +10,40 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePtrRecord = new Azure.Dns.PtrRecord("examplePtrRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// "yourdomain.com", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PTR records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/SrvRecord.cs b/sdk/dotnet/Dns/SrvRecord.cs index 0e4cce8374..96807d5480 100644 --- a/sdk/dotnet/Dns/SrvRecord.cs +++ b/sdk/dotnet/Dns/SrvRecord.cs @@ -10,6 +10,50 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSrvRecord = new Azure.Dns.SrvRecord("exampleSrvRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.Dns.Inputs.SrvRecordRecordArgs + /// { + /// Priority = 1, + /// Weight = 5, + /// Port = 8080, + /// Target = "target1.contoso.com", + /// }, + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SRV records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/TxtRecord.cs b/sdk/dotnet/Dns/TxtRecord.cs index 40deeffc52..78efe60910 100644 --- a/sdk/dotnet/Dns/TxtRecord.cs +++ b/sdk/dotnet/Dns/TxtRecord.cs @@ -10,6 +10,51 @@ namespace Pulumi.Azure.Dns { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.Dns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleTxtRecord = new Azure.Dns.TxtRecord("exampleTxtRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.Dns.Inputs.TxtRecordRecordArgs + /// { + /// Value = "google-site-authenticator", + /// }, + /// new Azure.Dns.Inputs.TxtRecordRecordArgs + /// { + /// Value = "more site information here", + /// }, + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// TXT records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Dns/Zone.cs b/sdk/dotnet/Dns/Zone.cs index 36154d54cc..efc59cb018 100644 --- a/sdk/dotnet/Dns/Zone.cs +++ b/sdk/dotnet/Dns/Zone.cs @@ -12,6 +12,29 @@ namespace Pulumi.Azure.Dns /// /// Enables you to manage DNS zones within Azure DNS. These zones are hosted on Azure's name servers to which you can delegate the zone from the parent domain. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var example_public = new Azure.Dns.Zone("example-public", new() + /// { + /// ResourceGroupName = example.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/DomainServices/GetService.cs b/sdk/dotnet/DomainServices/GetService.cs index b527ec73dc..157b6c0741 100644 --- a/sdk/dotnet/DomainServices/GetService.cs +++ b/sdk/dotnet/DomainServices/GetService.cs @@ -15,6 +15,29 @@ public static class GetService /// Gets information about an Active Directory Domain Service. /// /// > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DomainServices.GetService.Invoke(new() + /// { + /// Name = "example-aadds", + /// ResourceGroupName = "example-aadds-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:domainservices/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); @@ -23,6 +46,29 @@ public static Task InvokeAsync(GetServiceArgs args, InvokeOpti /// Gets information about an Active Directory Domain Service. /// /// > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.DomainServices.GetService.Invoke(new() + /// { + /// Name = "example-aadds", + /// ResourceGroupName = "example-aadds-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:domainservices/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/DomainServices/ReplicaSet.cs b/sdk/dotnet/DomainServices/ReplicaSet.cs index e09f9ed033..4ce12f1cf7 100644 --- a/sdk/dotnet/DomainServices/ReplicaSet.cs +++ b/sdk/dotnet/DomainServices/ReplicaSet.cs @@ -12,6 +12,310 @@ namespace Pulumi.Azure.DomainServices /// /// Manages a Replica Set for an Active Directory Domain Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primaryResourceGroup = new Azure.Core.ResourceGroup("primaryResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var primaryVirtualNetwork = new Azure.Network.VirtualNetwork("primaryVirtualNetwork", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.1.0/16", + /// }, + /// }); + /// + /// var primarySubnet = new Azure.Network.Subnet("primarySubnet", new() + /// { + /// ResourceGroupName = primaryResourceGroup.Name, + /// VirtualNetworkName = primaryVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var primaryNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("primaryNetworkSecurityGroup", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// SecurityRules = new[] + /// { + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowSyncWithAzureAD", + /// Priority = 101, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "443", + /// SourceAddressPrefix = "AzureActiveDirectoryDomainServices", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowRD", + /// Priority = 201, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "3389", + /// SourceAddressPrefix = "CorpNetSaw", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowPSRemoting", + /// Priority = 301, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "5986", + /// SourceAddressPrefix = "AzureActiveDirectoryDomainServices", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowLDAPS", + /// Priority = 401, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "636", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// }, + /// }, + /// }); + /// + /// var primarySubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("primarySubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = primarySubnet.Id, + /// NetworkSecurityGroupId = primaryNetworkSecurityGroup.Id, + /// }); + /// + /// var dcAdmins = new AzureAD.Group("dcAdmins", new() + /// { + /// DisplayName = "aad-dc-administrators", + /// SecurityEnabled = true, + /// }); + /// + /// var adminUser = new AzureAD.User("adminUser", new() + /// { + /// UserPrincipalName = "dc-admin@hashicorp-example.net", + /// DisplayName = "DC Administrator", + /// Password = "Pa55w0Rd!!1", + /// }); + /// + /// var adminGroupMember = new AzureAD.GroupMember("adminGroupMember", new() + /// { + /// GroupObjectId = dcAdmins.ObjectId, + /// MemberObjectId = adminUser.ObjectId, + /// }); + /// + /// var exampleServicePrincipal = new AzureAD.ServicePrincipal("exampleServicePrincipal", new() + /// { + /// ApplicationId = "2565bd9d-da50-47d4-8b85-4c97f669dc36", + /// }); + /// + /// // published app for domain services + /// var aadds = new Azure.Core.ResourceGroup("aadds", new() + /// { + /// Location = "westeurope", + /// }); + /// + /// var exampleService = new Azure.DomainServices.Service("exampleService", new() + /// { + /// Location = aadds.Location, + /// ResourceGroupName = aadds.Name, + /// DomainName = "widgetslogin.net", + /// Sku = "Enterprise", + /// FilteredSyncEnabled = false, + /// InitialReplicaSet = new Azure.DomainServices.Inputs.ServiceInitialReplicaSetArgs + /// { + /// Location = primaryVirtualNetwork.Location, + /// SubnetId = primarySubnet.Id, + /// }, + /// Notifications = new Azure.DomainServices.Inputs.ServiceNotificationsArgs + /// { + /// AdditionalRecipients = new[] + /// { + /// "notifyA@example.net", + /// "notifyB@example.org", + /// }, + /// NotifyDcAdmins = true, + /// NotifyGlobalAdmins = true, + /// }, + /// Security = new Azure.DomainServices.Inputs.ServiceSecurityArgs + /// { + /// SyncKerberosPasswords = true, + /// SyncNtlmPasswords = true, + /// SyncOnPremPasswords = true, + /// }, + /// Tags = + /// { + /// { "Environment", "prod" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleServicePrincipal, + /// primarySubnetNetworkSecurityGroupAssociation, + /// }, + /// }); + /// + /// var replicaResourceGroup = new Azure.Core.ResourceGroup("replicaResourceGroup", new() + /// { + /// Location = "North Europe", + /// }); + /// + /// var replicaVirtualNetwork = new Azure.Network.VirtualNetwork("replicaVirtualNetwork", new() + /// { + /// Location = replicaResourceGroup.Location, + /// ResourceGroupName = replicaResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.20.0.0/16", + /// }, + /// }); + /// + /// var aaddsReplicaSubnet = new Azure.Network.Subnet("aaddsReplicaSubnet", new() + /// { + /// ResourceGroupName = replicaResourceGroup.Name, + /// VirtualNetworkName = replicaVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.20.0.0/24", + /// }, + /// }); + /// + /// var aaddsReplicaNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("aaddsReplicaNetworkSecurityGroup", new() + /// { + /// Location = replicaResourceGroup.Location, + /// ResourceGroupName = replicaResourceGroup.Name, + /// SecurityRules = new[] + /// { + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowSyncWithAzureAD", + /// Priority = 101, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "443", + /// SourceAddressPrefix = "AzureActiveDirectoryDomainServices", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowRD", + /// Priority = 201, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "3389", + /// SourceAddressPrefix = "CorpNetSaw", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowPSRemoting", + /// Priority = 301, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "5986", + /// SourceAddressPrefix = "AzureActiveDirectoryDomainServices", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowLDAPS", + /// Priority = 401, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "636", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// }, + /// }, + /// }); + /// + /// var replicaSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("replicaSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = aaddsReplicaSubnet.Id, + /// NetworkSecurityGroupId = aaddsReplicaNetworkSecurityGroup.Id, + /// }); + /// + /// var primaryReplica = new Azure.Network.VirtualNetworkPeering("primaryReplica", new() + /// { + /// ResourceGroupName = primaryVirtualNetwork.ResourceGroupName, + /// VirtualNetworkName = primaryVirtualNetwork.Name, + /// RemoteVirtualNetworkId = replicaVirtualNetwork.Id, + /// AllowForwardedTraffic = true, + /// AllowGatewayTransit = false, + /// AllowVirtualNetworkAccess = true, + /// UseRemoteGateways = false, + /// }); + /// + /// var replicaPrimary = new Azure.Network.VirtualNetworkPeering("replicaPrimary", new() + /// { + /// ResourceGroupName = replicaVirtualNetwork.ResourceGroupName, + /// VirtualNetworkName = replicaVirtualNetwork.Name, + /// RemoteVirtualNetworkId = primaryVirtualNetwork.Id, + /// AllowForwardedTraffic = true, + /// AllowGatewayTransit = false, + /// AllowVirtualNetworkAccess = true, + /// UseRemoteGateways = false, + /// }); + /// + /// var replicaVirtualNetworkDnsServers = new Azure.Network.VirtualNetworkDnsServers("replicaVirtualNetworkDnsServers", new() + /// { + /// VirtualNetworkId = replicaVirtualNetwork.Id, + /// DnsServers = exampleService.InitialReplicaSet.Apply(initialReplicaSet => initialReplicaSet.DomainControllerIpAddresses), + /// }); + /// + /// var replicaReplicaSet = new Azure.DomainServices.ReplicaSet("replicaReplicaSet", new() + /// { + /// DomainServiceId = exampleService.Id, + /// Location = replicaResourceGroup.Location, + /// SubnetId = aaddsReplicaSubnet.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// replicaSubnetNetworkSecurityGroupAssociation, + /// primaryReplica, + /// replicaPrimary, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Domain Service Replica Sets can be imported using the resource ID of the parent Domain Service and the Replica Set ID, e.g. diff --git a/sdk/dotnet/DomainServices/Service.cs b/sdk/dotnet/DomainServices/Service.cs index d8bd13386b..f5918548d9 100644 --- a/sdk/dotnet/DomainServices/Service.cs +++ b/sdk/dotnet/DomainServices/Service.cs @@ -10,6 +10,178 @@ namespace Pulumi.Azure.DomainServices { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var deployResourceGroup = new Azure.Core.ResourceGroup("deployResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var deployVirtualNetwork = new Azure.Network.VirtualNetwork("deployVirtualNetwork", new() + /// { + /// Location = deployResourceGroup.Location, + /// ResourceGroupName = deployResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.1.0/16", + /// }, + /// }); + /// + /// var deploySubnet = new Azure.Network.Subnet("deploySubnet", new() + /// { + /// ResourceGroupName = deployResourceGroup.Name, + /// VirtualNetworkName = deployVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var deployNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("deployNetworkSecurityGroup", new() + /// { + /// Location = deployResourceGroup.Location, + /// ResourceGroupName = deployResourceGroup.Name, + /// SecurityRules = new[] + /// { + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowSyncWithAzureAD", + /// Priority = 101, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "443", + /// SourceAddressPrefix = "AzureActiveDirectoryDomainServices", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowRD", + /// Priority = 201, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "3389", + /// SourceAddressPrefix = "CorpNetSaw", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowPSRemoting", + /// Priority = 301, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "5986", + /// SourceAddressPrefix = "AzureActiveDirectoryDomainServices", + /// DestinationAddressPrefix = "*", + /// }, + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "AllowLDAPS", + /// Priority = 401, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "636", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// }, + /// }, + /// }); + /// + /// var deploySubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("deploySubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = deploySubnet.Id, + /// NetworkSecurityGroupId = deployNetworkSecurityGroup.Id, + /// }); + /// + /// var dcAdmins = new AzureAD.Group("dcAdmins", new() + /// { + /// DisplayName = "AAD DC Administrators", + /// SecurityEnabled = true, + /// }); + /// + /// var adminUser = new AzureAD.User("adminUser", new() + /// { + /// UserPrincipalName = "dc-admin@hashicorp-example.com", + /// DisplayName = "DC Administrator", + /// Password = "Pa55w0Rd!!1", + /// }); + /// + /// var adminGroupMember = new AzureAD.GroupMember("adminGroupMember", new() + /// { + /// GroupObjectId = dcAdmins.ObjectId, + /// MemberObjectId = adminUser.ObjectId, + /// }); + /// + /// var exampleServicePrincipal = new AzureAD.ServicePrincipal("exampleServicePrincipal", new() + /// { + /// ApplicationId = "2565bd9d-da50-47d4-8b85-4c97f669dc36", + /// }); + /// + /// // published app for domain services + /// var aadds = new Azure.Core.ResourceGroup("aadds", new() + /// { + /// Location = "westeurope", + /// }); + /// + /// var exampleService = new Azure.DomainServices.Service("exampleService", new() + /// { + /// Location = aadds.Location, + /// ResourceGroupName = aadds.Name, + /// DomainName = "widgetslogin.net", + /// Sku = "Enterprise", + /// FilteredSyncEnabled = false, + /// InitialReplicaSet = new Azure.DomainServices.Inputs.ServiceInitialReplicaSetArgs + /// { + /// SubnetId = deploySubnet.Id, + /// }, + /// Notifications = new Azure.DomainServices.Inputs.ServiceNotificationsArgs + /// { + /// AdditionalRecipients = new[] + /// { + /// "notifyA@example.net", + /// "notifyB@example.org", + /// }, + /// NotifyDcAdmins = true, + /// NotifyGlobalAdmins = true, + /// }, + /// Security = new Azure.DomainServices.Inputs.ServiceSecurityArgs + /// { + /// SyncKerberosPasswords = true, + /// SyncNtlmPasswords = true, + /// SyncOnPremPasswords = true, + /// }, + /// Tags = + /// { + /// { "Environment", "prod" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleServicePrincipal, + /// deploySubnetNetworkSecurityGroupAssociation, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Domain Services can be imported using the resource ID, together with the Replica Set ID that you wish to designate as the initial replica set, e.g. diff --git a/sdk/dotnet/DomainServices/ServiceTrust.cs b/sdk/dotnet/DomainServices/ServiceTrust.cs index 22c183fbed..08320ed4fe 100644 --- a/sdk/dotnet/DomainServices/ServiceTrust.cs +++ b/sdk/dotnet/DomainServices/ServiceTrust.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.DomainServices /// /// Manages a Active Directory Domain Service Trust. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleService = Azure.DomainServices.GetService.Invoke(new() + /// { + /// Name = "example-ds", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleServiceTrust = new Azure.DomainServices.ServiceTrust("exampleServiceTrust", new() + /// { + /// DomainServiceId = exampleService.Apply(getServiceResult => getServiceResult.Id), + /// TrustedDomainFqdn = "example.com", + /// TrustedDomainDnsIps = new[] + /// { + /// "10.1.0.3", + /// "10.1.0.4", + /// }, + /// Password = "Password123", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Active Directory Domain Service Trusts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ElasticCloud/Elasticsearch.cs b/sdk/dotnet/ElasticCloud/Elasticsearch.cs index 62444ba2b5..991c906499 100644 --- a/sdk/dotnet/ElasticCloud/Elasticsearch.cs +++ b/sdk/dotnet/ElasticCloud/Elasticsearch.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.ElasticCloud /// /// Manages an Elasticsearch in Elastic Cloud. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testResourceGroup = new Azure.Core.ResourceGroup("testResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var testElasticsearch = new Azure.ElasticCloud.Elasticsearch("testElasticsearch", new() + /// { + /// ResourceGroupName = testResourceGroup.Name, + /// Location = testResourceGroup.Location, + /// SkuName = "ess-monthly-consumption_Monthly", + /// ElasticCloudEmailAddress = "user@example.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Elasticsearch's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ElasticCloud/GetElasticsearch.cs b/sdk/dotnet/ElasticCloud/GetElasticsearch.cs index a03d0bd566..d561656260 100644 --- a/sdk/dotnet/ElasticCloud/GetElasticsearch.cs +++ b/sdk/dotnet/ElasticCloud/GetElasticsearch.cs @@ -13,12 +13,68 @@ public static class GetElasticsearch { /// /// Use this data source to access information about an existing Elasticsearch resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ElasticCloud.GetElasticsearch.Invoke(new() + /// { + /// Name = "my-elastic-search", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["elasticsearchEndpoint"] = example.Apply(getElasticsearchResult => getElasticsearchResult.ElasticsearchServiceUrl), + /// ["kibanaEndpoint"] = example.Apply(getElasticsearchResult => getElasticsearchResult.KibanaServiceUrl), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetElasticsearchArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:elasticcloud/getElasticsearch:getElasticsearch", args ?? new GetElasticsearchArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Elasticsearch resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ElasticCloud.GetElasticsearch.Invoke(new() + /// { + /// Name = "my-elastic-search", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["elasticsearchEndpoint"] = example.Apply(getElasticsearchResult => getElasticsearchResult.ElasticsearchServiceUrl), + /// ["kibanaEndpoint"] = example.Apply(getElasticsearchResult => getElasticsearchResult.KibanaServiceUrl), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetElasticsearchInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:elasticcloud/getElasticsearch:getElasticsearch", args ?? new GetElasticsearchInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventGrid/Domain.cs b/sdk/dotnet/EventGrid/Domain.cs index e973aff638..10745992be 100644 --- a/sdk/dotnet/EventGrid/Domain.cs +++ b/sdk/dotnet/EventGrid/Domain.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.EventGrid /// /// Manages an EventGrid Domain /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDomain = new Azure.EventGrid.Domain("exampleDomain", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventGrid/DomainTopic.cs b/sdk/dotnet/EventGrid/DomainTopic.cs index 1a1025d673..a51ac7137e 100644 --- a/sdk/dotnet/EventGrid/DomainTopic.cs +++ b/sdk/dotnet/EventGrid/DomainTopic.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.EventGrid /// /// Manages an EventGrid Domain Topic /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDomain = new Azure.EventGrid.Domain("exampleDomain", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleDomainTopic = new Azure.EventGrid.DomainTopic("exampleDomainTopic", new() + /// { + /// DomainName = exampleDomain.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid Domain Topics can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventGrid/EventSubscription.cs b/sdk/dotnet/EventGrid/EventSubscription.cs index 19a03cf776..a1e9ed6fb5 100644 --- a/sdk/dotnet/EventGrid/EventSubscription.cs +++ b/sdk/dotnet/EventGrid/EventSubscription.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.EventGrid /// /// Manages an EventGrid Event Subscription /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleQueue = new Azure.Storage.Queue("exampleQueue", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleEventSubscription = new Azure.EventGrid.EventSubscription("exampleEventSubscription", new() + /// { + /// Scope = exampleResourceGroup.Id, + /// StorageQueueEndpoint = new Azure.EventGrid.Inputs.EventSubscriptionStorageQueueEndpointArgs + /// { + /// StorageAccountId = exampleAccount.Id, + /// QueueName = exampleQueue.Name, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventGrid/GetDomain.cs b/sdk/dotnet/EventGrid/GetDomain.cs index 0a0da92ba7..2f4f8d261e 100644 --- a/sdk/dotnet/EventGrid/GetDomain.cs +++ b/sdk/dotnet/EventGrid/GetDomain.cs @@ -13,12 +13,66 @@ public static class GetDomain { /// /// Use this data source to access information about an existing EventGrid Domain + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetDomain.Invoke(new() + /// { + /// Name = "my-eventgrid-domain", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventgridDomainMappingTopic"] = example.Apply(getDomainResult => getDomainResult.InputMappingFields[0]?.Topic), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDomainArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventgrid/getDomain:getDomain", args ?? new GetDomainArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventGrid Domain + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetDomain.Invoke(new() + /// { + /// Name = "my-eventgrid-domain", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventgridDomainMappingTopic"] = example.Apply(getDomainResult => getDomainResult.InputMappingFields[0]?.Topic), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDomainInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventgrid/getDomain:getDomain", args ?? new GetDomainInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventGrid/GetDomainTopic.cs b/sdk/dotnet/EventGrid/GetDomainTopic.cs index e8f8eecc40..3cd4d2105e 100644 --- a/sdk/dotnet/EventGrid/GetDomainTopic.cs +++ b/sdk/dotnet/EventGrid/GetDomainTopic.cs @@ -13,12 +13,58 @@ public static class GetDomainTopic { /// /// Use this data source to access information about an existing EventGrid Domain Topic + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetDomainTopic.Invoke(new() + /// { + /// Name = "my-eventgrid-domain-topic", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDomainTopicArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventgrid/getDomainTopic:getDomainTopic", args ?? new GetDomainTopicArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventGrid Domain Topic + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetDomainTopic.Invoke(new() + /// { + /// Name = "my-eventgrid-domain-topic", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDomainTopicInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventgrid/getDomainTopic:getDomainTopic", args ?? new GetDomainTopicInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventGrid/GetSystemTopic.cs b/sdk/dotnet/EventGrid/GetSystemTopic.cs index 5318d633ef..9f8a82594c 100644 --- a/sdk/dotnet/EventGrid/GetSystemTopic.cs +++ b/sdk/dotnet/EventGrid/GetSystemTopic.cs @@ -13,12 +13,58 @@ public static class GetSystemTopic { /// /// Use this data source to access information about an existing EventGrid System Topic + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetSystemTopic.Invoke(new() + /// { + /// Name = "eventgrid-system-topic", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSystemTopicArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventgrid/getSystemTopic:getSystemTopic", args ?? new GetSystemTopicArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventGrid System Topic + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetSystemTopic.Invoke(new() + /// { + /// Name = "eventgrid-system-topic", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSystemTopicInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventgrid/getSystemTopic:getSystemTopic", args ?? new GetSystemTopicInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventGrid/GetTopic.cs b/sdk/dotnet/EventGrid/GetTopic.cs index 80ffd73802..4d5acc350a 100644 --- a/sdk/dotnet/EventGrid/GetTopic.cs +++ b/sdk/dotnet/EventGrid/GetTopic.cs @@ -13,12 +13,58 @@ public static class GetTopic { /// /// Use this data source to access information about an existing EventGrid Topic + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetTopic.Invoke(new() + /// { + /// Name = "my-eventgrid-topic", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTopicArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventgrid/getTopic:getTopic", args ?? new GetTopicArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventGrid Topic + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventGrid.GetTopic.Invoke(new() + /// { + /// Name = "my-eventgrid-topic", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTopicInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventgrid/getTopic:getTopic", args ?? new GetTopicInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventGrid/SystemTopic.cs b/sdk/dotnet/EventGrid/SystemTopic.cs index 55e397e6cf..d67fe0b484 100644 --- a/sdk/dotnet/EventGrid/SystemTopic.cs +++ b/sdk/dotnet/EventGrid/SystemTopic.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.EventGrid /// /// Manages an Event Grid System Topic. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleSystemTopic = new Azure.EventGrid.SystemTopic("exampleSystemTopic", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SourceArmResourceId = exampleAccount.Id, + /// TopicType = "Microsoft.Storage.StorageAccounts", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Event Grid System Topic can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventGrid/SystemTopicEventSubscription.cs b/sdk/dotnet/EventGrid/SystemTopicEventSubscription.cs index 2097f6e4e4..a0d190d998 100644 --- a/sdk/dotnet/EventGrid/SystemTopicEventSubscription.cs +++ b/sdk/dotnet/EventGrid/SystemTopicEventSubscription.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.EventGrid /// /// Manages an EventGrid System Topic Event Subscription. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleQueue = new Azure.Storage.Queue("exampleQueue", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleSystemTopic = new Azure.EventGrid.SystemTopic("exampleSystemTopic", new() + /// { + /// Location = "Global", + /// ResourceGroupName = exampleResourceGroup.Name, + /// SourceArmResourceId = exampleResourceGroup.Id, + /// TopicType = "Microsoft.Resources.ResourceGroups", + /// }); + /// + /// var exampleSystemTopicEventSubscription = new Azure.EventGrid.SystemTopicEventSubscription("exampleSystemTopicEventSubscription", new() + /// { + /// SystemTopic = exampleSystemTopic.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageQueueEndpoint = new Azure.EventGrid.Inputs.SystemTopicEventSubscriptionStorageQueueEndpointArgs + /// { + /// StorageAccountId = exampleAccount.Id, + /// QueueName = exampleQueue.Name, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid System Topic Event Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventGrid/Topic.cs b/sdk/dotnet/EventGrid/Topic.cs index bda08c5c25..dd6cbddb4c 100644 --- a/sdk/dotnet/EventGrid/Topic.cs +++ b/sdk/dotnet/EventGrid/Topic.cs @@ -14,6 +14,34 @@ namespace Pulumi.Azure.EventGrid /// /// > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTopic = new Azure.EventGrid.Topic("exampleTopic", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/AuthorizationRule.cs b/sdk/dotnet/EventHub/AuthorizationRule.cs index 98a8085d78..052ba9f143 100644 --- a/sdk/dotnet/EventHub/AuthorizationRule.cs +++ b/sdk/dotnet/EventHub/AuthorizationRule.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.EventHub /// /// Manages a Event Hubs authorization Rule within an Event Hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Basic", + /// Capacity = 2, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 2, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Listen = true, + /// Send = false, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/Cluster.cs b/sdk/dotnet/EventHub/Cluster.cs index 5587581288..fdd66ca84b 100644 --- a/sdk/dotnet/EventHub/Cluster.cs +++ b/sdk/dotnet/EventHub/Cluster.cs @@ -12,6 +12,31 @@ namespace Pulumi.Azure.EventHub /// /// Manages an EventHub Cluster /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var test = new Azure.EventHub.Cluster("test", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// SkuName = "Dedicated_1", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHub Cluster's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/ConsumerGroup.cs b/sdk/dotnet/EventHub/ConsumerGroup.cs index 940694f0da..0d3b33da58 100644 --- a/sdk/dotnet/EventHub/ConsumerGroup.cs +++ b/sdk/dotnet/EventHub/ConsumerGroup.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.EventHub /// /// Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Basic", + /// Capacity = 2, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 2, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// UserMetadata = "some-meta-data", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/Domain.cs b/sdk/dotnet/EventHub/Domain.cs index 1e7e091a34..0a11e4e1e8 100644 --- a/sdk/dotnet/EventHub/Domain.cs +++ b/sdk/dotnet/EventHub/Domain.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.EventHub /// /// Manages an EventGrid Domain /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDomain = new Azure.EventGrid.Domain("exampleDomain", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventGridTopic.cs b/sdk/dotnet/EventHub/EventGridTopic.cs index c39c701fcb..43fe3da35e 100644 --- a/sdk/dotnet/EventHub/EventGridTopic.cs +++ b/sdk/dotnet/EventHub/EventGridTopic.cs @@ -14,6 +14,34 @@ namespace Pulumi.Azure.EventHub /// /// > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTopic = new Azure.EventGrid.Topic("exampleTopic", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventHub.cs b/sdk/dotnet/EventHub/EventHub.cs index 7ddb48a160..9ddf4f3786 100644 --- a/sdk/dotnet/EventHub/EventHub.cs +++ b/sdk/dotnet/EventHub/EventHub.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.EventHub /// /// Manages a Event Hubs as a nested resource within a Event Hubs namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 1, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventHubAuthorizationRule.cs b/sdk/dotnet/EventHub/EventHubAuthorizationRule.cs index 807d810b05..3e68ec22b0 100644 --- a/sdk/dotnet/EventHub/EventHubAuthorizationRule.cs +++ b/sdk/dotnet/EventHub/EventHubAuthorizationRule.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.EventHub /// /// Manages a Event Hubs authorization Rule within an Event Hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Basic", + /// Capacity = 2, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 2, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Listen = true, + /// Send = false, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventHubConsumerGroup.cs b/sdk/dotnet/EventHub/EventHubConsumerGroup.cs index 2774cdd91f..e25f22fe10 100644 --- a/sdk/dotnet/EventHub/EventHubConsumerGroup.cs +++ b/sdk/dotnet/EventHub/EventHubConsumerGroup.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.EventHub /// /// Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Basic", + /// Capacity = 2, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 2, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// UserMetadata = "some-meta-data", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventHubNamespace.cs b/sdk/dotnet/EventHub/EventHubNamespace.cs index 35afe4758a..bf4d68fb10 100644 --- a/sdk/dotnet/EventHub/EventHubNamespace.cs +++ b/sdk/dotnet/EventHub/EventHubNamespace.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.EventHub /// /// Manages an EventHub Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 2, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventHubNamespaceAuthorizationRule.cs b/sdk/dotnet/EventHub/EventHubNamespaceAuthorizationRule.cs index e173bb9f6c..4bdd78df63 100644 --- a/sdk/dotnet/EventHub/EventHubNamespaceAuthorizationRule.cs +++ b/sdk/dotnet/EventHub/EventHubNamespaceAuthorizationRule.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.EventHub /// /// Manages an Authorization Rule for an Event Hub Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Basic", + /// Capacity = 2, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleEventHubNamespaceAuthorizationRule = new Azure.EventHub.EventHubNamespaceAuthorizationRule("exampleEventHubNamespaceAuthorizationRule", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Listen = true, + /// Send = false, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHub Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventSubscription.cs b/sdk/dotnet/EventHub/EventSubscription.cs index 2b6ae28c7f..446d903210 100644 --- a/sdk/dotnet/EventHub/EventSubscription.cs +++ b/sdk/dotnet/EventHub/EventSubscription.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.EventHub /// /// Manages an EventGrid Event Subscription /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleQueue = new Azure.Storage.Queue("exampleQueue", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleEventSubscription = new Azure.EventGrid.EventSubscription("exampleEventSubscription", new() + /// { + /// Scope = exampleResourceGroup.Id, + /// StorageQueueEndpoint = new Azure.EventGrid.Inputs.EventSubscriptionStorageQueueEndpointArgs + /// { + /// StorageAccountId = exampleAccount.Id, + /// QueueName = exampleQueue.Name, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/EventhubNamespaceDisasterRecoveryConfig.cs b/sdk/dotnet/EventHub/EventhubNamespaceDisasterRecoveryConfig.cs index 4bd4a99f82..b7a89ea16b 100644 --- a/sdk/dotnet/EventHub/EventhubNamespaceDisasterRecoveryConfig.cs +++ b/sdk/dotnet/EventHub/EventhubNamespaceDisasterRecoveryConfig.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.EventHub /// /// Manages an Disaster Recovery Config for an Event Hub Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var primary = new Azure.EventHub.EventHubNamespace("primary", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var secondary = new Azure.EventHub.EventHubNamespace("secondary", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleEventhubNamespaceDisasterRecoveryConfig = new Azure.EventHub.EventhubNamespaceDisasterRecoveryConfig("exampleEventhubNamespaceDisasterRecoveryConfig", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// NamespaceName = primary.Name, + /// PartnerNamespaceId = secondary.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/GetAuthorizationRule.cs b/sdk/dotnet/EventHub/GetAuthorizationRule.cs index 16e32795bb..ef9566e6fc 100644 --- a/sdk/dotnet/EventHub/GetAuthorizationRule.cs +++ b/sdk/dotnet/EventHub/GetAuthorizationRule.cs @@ -13,12 +13,62 @@ public static class GetAuthorizationRule { /// /// Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.EventHub.GetAuthorizationRule.Invoke(new() + /// { + /// Name = "test", + /// NamespaceName = azurerm_eventhub_namespace.Test.Name, + /// EventhubName = azurerm_eventhub.Test.Name, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAuthorizationRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getAuthorizationRule:getAuthorizationRule", args ?? new GetAuthorizationRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.EventHub.GetAuthorizationRule.Invoke(new() + /// { + /// Name = "test", + /// NamespaceName = azurerm_eventhub_namespace.Test.Name, + /// EventhubName = azurerm_eventhub.Test.Name, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAuthorizationRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getAuthorizationRule:getAuthorizationRule", args ?? new GetAuthorizationRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/GetCluster.cs b/sdk/dotnet/EventHub/GetCluster.cs index f94f5f51a1..58b48c5970 100644 --- a/sdk/dotnet/EventHub/GetCluster.cs +++ b/sdk/dotnet/EventHub/GetCluster.cs @@ -13,12 +13,66 @@ public static class GetCluster { /// /// Use this data source to access information about an existing EventHub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetCluster.Invoke(new() + /// { + /// Name = "search-eventhub", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubId"] = example.Apply(getClusterResult => getClusterResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetClusterArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getCluster:getCluster", args ?? new GetClusterArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventHub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetCluster.Invoke(new() + /// { + /// Name = "search-eventhub", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubId"] = example.Apply(getClusterResult => getClusterResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetClusterInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getCluster:getCluster", args ?? new GetClusterInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/GetConsumeGroup.cs b/sdk/dotnet/EventHub/GetConsumeGroup.cs index 48f8f871da..aba8dfe074 100644 --- a/sdk/dotnet/EventHub/GetConsumeGroup.cs +++ b/sdk/dotnet/EventHub/GetConsumeGroup.cs @@ -13,12 +13,62 @@ public static class GetConsumeGroup { /// /// Use this data source to access information about an existing Event Hubs Consumer Group within an Event Hub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.EventHub.GetConsumeGroup.Invoke(new() + /// { + /// Name = azurerm_eventhub_consumer_group.Test.Name, + /// NamespaceName = azurerm_eventhub_namespace.Test.Name, + /// EventhubName = azurerm_eventhub.Test.Name, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetConsumeGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getConsumeGroup:getConsumeGroup", args ?? new GetConsumeGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Event Hubs Consumer Group within an Event Hub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.EventHub.GetConsumeGroup.Invoke(new() + /// { + /// Name = azurerm_eventhub_consumer_group.Test.Name, + /// NamespaceName = azurerm_eventhub_namespace.Test.Name, + /// EventhubName = azurerm_eventhub.Test.Name, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetConsumeGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getConsumeGroup:getConsumeGroup", args ?? new GetConsumeGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/GetEventHub.cs b/sdk/dotnet/EventHub/GetEventHub.cs index d75ab5df02..4f4c34f4c9 100644 --- a/sdk/dotnet/EventHub/GetEventHub.cs +++ b/sdk/dotnet/EventHub/GetEventHub.cs @@ -13,12 +13,68 @@ public static class GetEventHub { /// /// Use this data source to access information about an existing EventHub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetEventHub.Invoke(new() + /// { + /// Name = "search-eventhub", + /// ResourceGroupName = "search-service", + /// NamespaceName = "search-eventhubns", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubId"] = example.Apply(getEventHubResult => getEventHubResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEventHubArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getEventHub:getEventHub", args ?? new GetEventHubArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventHub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetEventHub.Invoke(new() + /// { + /// Name = "search-eventhub", + /// ResourceGroupName = "search-service", + /// NamespaceName = "search-eventhubns", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubId"] = example.Apply(getEventHubResult => getEventHubResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEventHubInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getEventHub:getEventHub", args ?? new GetEventHubInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/GetEventhubNamespace.cs b/sdk/dotnet/EventHub/GetEventhubNamespace.cs index ab92055c36..64b0a8c059 100644 --- a/sdk/dotnet/EventHub/GetEventhubNamespace.cs +++ b/sdk/dotnet/EventHub/GetEventhubNamespace.cs @@ -14,12 +14,66 @@ public static class GetEventhubNamespace { /// /// Use this data source to access information about an existing EventHub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetNamespace.Invoke(new() + /// { + /// Name = "search-eventhubns", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubNamespaceId"] = example.Apply(getNamespaceResult => getNamespaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEventhubNamespaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getEventhubNamespace:getEventhubNamespace", args ?? new GetEventhubNamespaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventHub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetNamespace.Invoke(new() + /// { + /// Name = "search-eventhubns", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubNamespaceId"] = example.Apply(getNamespaceResult => getNamespaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEventhubNamespaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getEventhubNamespace:getEventhubNamespace", args ?? new GetEventhubNamespaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/GetNamespace.cs b/sdk/dotnet/EventHub/GetNamespace.cs index 134d71a420..2c25f20da3 100644 --- a/sdk/dotnet/EventHub/GetNamespace.cs +++ b/sdk/dotnet/EventHub/GetNamespace.cs @@ -13,12 +13,66 @@ public static class GetNamespace { /// /// Use this data source to access information about an existing EventHub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetNamespace.Invoke(new() + /// { + /// Name = "search-eventhubns", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubNamespaceId"] = example.Apply(getNamespaceResult => getNamespaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNamespaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getNamespace:getNamespace", args ?? new GetNamespaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing EventHub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetNamespace.Invoke(new() + /// { + /// Name = "search-eventhubns", + /// ResourceGroupName = "search-service", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubNamespaceId"] = example.Apply(getNamespaceResult => getNamespaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNamespaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getNamespace:getNamespace", args ?? new GetNamespaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/GetNamespaceAuthorizationRule.cs b/sdk/dotnet/EventHub/GetNamespaceAuthorizationRule.cs index 213772b671..1c5b296909 100644 --- a/sdk/dotnet/EventHub/GetNamespaceAuthorizationRule.cs +++ b/sdk/dotnet/EventHub/GetNamespaceAuthorizationRule.cs @@ -13,12 +13,68 @@ public static class GetNamespaceAuthorizationRule { /// /// Use this data source to access information about an Authorization Rule for an Event Hub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetNamespaceAuthorizationRule.Invoke(new() + /// { + /// Name = "navi", + /// ResourceGroupName = "example-resources", + /// NamespaceName = "example-ns", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubAuthorizationRuleId"] = data.Azurem_eventhub_namespace_authorization_rule.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNamespaceAuthorizationRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getNamespaceAuthorizationRule:getNamespaceAuthorizationRule", args ?? new GetNamespaceAuthorizationRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an Authorization Rule for an Event Hub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.EventHub.GetNamespaceAuthorizationRule.Invoke(new() + /// { + /// Name = "navi", + /// ResourceGroupName = "example-resources", + /// NamespaceName = "example-ns", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["eventhubAuthorizationRuleId"] = data.Azurem_eventhub_namespace_authorization_rule.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNamespaceAuthorizationRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getNamespaceAuthorizationRule:getNamespaceAuthorizationRule", args ?? new GetNamespaceAuthorizationRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/GetServiceBusNamespace.cs b/sdk/dotnet/EventHub/GetServiceBusNamespace.cs index 8702379ac6..b9ed640be1 100644 --- a/sdk/dotnet/EventHub/GetServiceBusNamespace.cs +++ b/sdk/dotnet/EventHub/GetServiceBusNamespace.cs @@ -14,12 +14,66 @@ public static class GetServiceBusNamespace { /// /// Use this data source to access information about an existing ServiceBus Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetNamespace.Invoke(new() + /// { + /// Name = "examplenamespace", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["location"] = example.Apply(getNamespaceResult => getNamespaceResult.Location), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceBusNamespaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:eventhub/getServiceBusNamespace:getServiceBusNamespace", args ?? new GetServiceBusNamespaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing ServiceBus Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetNamespace.Invoke(new() + /// { + /// Name = "examplenamespace", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["location"] = example.Apply(getNamespaceResult => getNamespaceResult.Location), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceBusNamespaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:eventhub/getServiceBusNamespace:getServiceBusNamespace", args ?? new GetServiceBusNamespaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/EventHub/Namespace.cs b/sdk/dotnet/EventHub/Namespace.cs index b12663a18a..6bdb16a2ae 100644 --- a/sdk/dotnet/EventHub/Namespace.cs +++ b/sdk/dotnet/EventHub/Namespace.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.EventHub /// /// Manages a ServiceBus Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/NamespaceAuthorizationRule.cs b/sdk/dotnet/EventHub/NamespaceAuthorizationRule.cs index c9e7f36fb0..738d6315a2 100644 --- a/sdk/dotnet/EventHub/NamespaceAuthorizationRule.cs +++ b/sdk/dotnet/EventHub/NamespaceAuthorizationRule.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.EventHub /// /// Manages a ServiceBus Namespace authorization Rule within a ServiceBus. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleNamespaceAuthorizationRule = new Azure.ServiceBus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// Listen = true, + /// Send = true, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/NamespaceCustomerManagedKey.cs b/sdk/dotnet/EventHub/NamespaceCustomerManagedKey.cs index 3e514bcbb2..9d3063a757 100644 --- a/sdk/dotnet/EventHub/NamespaceCustomerManagedKey.cs +++ b/sdk/dotnet/EventHub/NamespaceCustomerManagedKey.cs @@ -14,6 +14,116 @@ namespace Pulumi.Azure.EventHub /// /// !> **Note:** In 2.x versions of the Azure Provider during deletion this resource will **delete and recreate the parent EventHub Namespace which may involve data loss** as it's not possible to remove the Customer Managed Key from the EventHub Namespace once it's been added. Version 3.0 of the Azure Provider will change this so that the Delete operation is a noop, requiring the parent EventHub Namespace is deleted/recreated to remove the Customer Managed Key. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.EventHub.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "Dedicated_1", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// DedicatedClusterId = exampleCluster.Id, + /// Identity = new Azure.EventHub.Inputs.EventHubNamespaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("exampleAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = exampleEventHubNamespace.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleEventHubNamespace.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "UnwrapKey", + /// "WrapKey", + /// }, + /// }); + /// + /// var example2 = new Azure.KeyVault.AccessPolicy("example2", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "Get", + /// "List", + /// "Purge", + /// "Recover", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAccessPolicy, + /// example2, + /// }, + /// }); + /// + /// var exampleNamespaceCustomerManagedKey = new Azure.EventHub.NamespaceCustomerManagedKey("exampleNamespaceCustomerManagedKey", new() + /// { + /// EventhubNamespaceId = exampleEventHubNamespace.Id, + /// KeyVaultKeyIds = new[] + /// { + /// exampleKey.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Customer Managed Keys for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/NamespaceSchemaGroup.cs b/sdk/dotnet/EventHub/NamespaceSchemaGroup.cs index 8617bb7387..bf6dd7b0d0 100644 --- a/sdk/dotnet/EventHub/NamespaceSchemaGroup.cs +++ b/sdk/dotnet/EventHub/NamespaceSchemaGroup.cs @@ -10,6 +10,38 @@ namespace Pulumi.Azure.EventHub { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "East US", + /// }); + /// + /// var testEventHubNamespace = new Azure.EventHub.EventHubNamespace("testEventHubNamespace", new() + /// { + /// Location = azurerm_resource_group.Test.Location, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// Sku = "Standard", + /// }); + /// + /// var testNamespaceSchemaGroup = new Azure.EventHub.NamespaceSchemaGroup("testNamespaceSchemaGroup", new() + /// { + /// NamespaceId = testEventHubNamespace.Id, + /// SchemaCompatibility = "Forward", + /// SchemaType = "Avro", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Schema Group for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/Queue.cs b/sdk/dotnet/EventHub/Queue.cs index 175d0c6f1b..47c58fd17a 100644 --- a/sdk/dotnet/EventHub/Queue.cs +++ b/sdk/dotnet/EventHub/Queue.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.EventHub /// /// Manages a ServiceBus Queue. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleQueue = new Azure.ServiceBus.Queue("exampleQueue", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/QueueAuthorizationRule.cs b/sdk/dotnet/EventHub/QueueAuthorizationRule.cs index 139db8748f..73b17493cc 100644 --- a/sdk/dotnet/EventHub/QueueAuthorizationRule.cs +++ b/sdk/dotnet/EventHub/QueueAuthorizationRule.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.EventHub /// /// Manages an Authorization Rule for a ServiceBus Queue. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleQueue = new Azure.ServiceBus.Queue("exampleQueue", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleQueueAuthorizationRule = new Azure.ServiceBus.QueueAuthorizationRule("exampleQueueAuthorizationRule", new() + /// { + /// QueueId = exampleQueue.Id, + /// Listen = true, + /// Send = true, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/Subscription.cs b/sdk/dotnet/EventHub/Subscription.cs index 07c0e11b35..57874b0ec6 100644 --- a/sdk/dotnet/EventHub/Subscription.cs +++ b/sdk/dotnet/EventHub/Subscription.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.EventHub /// /// Manages a ServiceBus Subscription. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleSubscription = new Azure.ServiceBus.Subscription("exampleSubscription", new() + /// { + /// TopicId = exampleTopic.Id, + /// MaxDeliveryCount = 1, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/SubscriptionRule.cs b/sdk/dotnet/EventHub/SubscriptionRule.cs index 686730f0a2..f5d5510ae9 100644 --- a/sdk/dotnet/EventHub/SubscriptionRule.cs +++ b/sdk/dotnet/EventHub/SubscriptionRule.cs @@ -13,6 +13,108 @@ namespace Pulumi.Azure.EventHub /// Manages a ServiceBus Subscription Rule. /// /// ## Example Usage + /// ### SQL Filter) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleSubscription = new Azure.ServiceBus.Subscription("exampleSubscription", new() + /// { + /// TopicId = exampleTopic.Id, + /// MaxDeliveryCount = 1, + /// }); + /// + /// var exampleSubscriptionRule = new Azure.ServiceBus.SubscriptionRule("exampleSubscriptionRule", new() + /// { + /// SubscriptionId = exampleSubscription.Id, + /// FilterType = "SqlFilter", + /// SqlFilter = "colour = 'red'", + /// }); + /// + /// }); + /// ``` + /// ### Correlation Filter) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleSubscription = new Azure.ServiceBus.Subscription("exampleSubscription", new() + /// { + /// TopicId = exampleTopic.Id, + /// MaxDeliveryCount = 1, + /// }); + /// + /// var exampleSubscriptionRule = new Azure.ServiceBus.SubscriptionRule("exampleSubscriptionRule", new() + /// { + /// SubscriptionId = exampleSubscription.Id, + /// FilterType = "CorrelationFilter", + /// CorrelationFilter = new Azure.ServiceBus.Inputs.SubscriptionRuleCorrelationFilterArgs + /// { + /// CorrelationId = "high", + /// Label = "red", + /// Properties = + /// { + /// { "customProperty", "value" }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/EventHub/Topic.cs b/sdk/dotnet/EventHub/Topic.cs index 43a48d2bb0..6cf11113e1 100644 --- a/sdk/dotnet/EventHub/Topic.cs +++ b/sdk/dotnet/EventHub/Topic.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.EventHub /// /// **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/EventHub/TopicAuthorizationRule.cs b/sdk/dotnet/EventHub/TopicAuthorizationRule.cs index 46e4ff7f60..0ce9047e33 100644 --- a/sdk/dotnet/EventHub/TopicAuthorizationRule.cs +++ b/sdk/dotnet/EventHub/TopicAuthorizationRule.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.EventHub /// /// Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// }); + /// + /// var exampleTopicAuthorizationRule = new Azure.ServiceBus.TopicAuthorizationRule("exampleTopicAuthorizationRule", new() + /// { + /// TopicId = exampleTopic.Id, + /// Listen = true, + /// Send = false, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/FluidRelay/Server.cs b/sdk/dotnet/FluidRelay/Server.cs index 2098aee412..7cf2e7f134 100644 --- a/sdk/dotnet/FluidRelay/Server.cs +++ b/sdk/dotnet/FluidRelay/Server.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.FluidRelay /// /// Manages a Fluid Relay Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.FluidRelay.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Fluid Relay Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/FrontDoor/FirewallPolicy.cs b/sdk/dotnet/FrontDoor/FirewallPolicy.cs index 6c78b3b76d..0f16732f04 100644 --- a/sdk/dotnet/FrontDoor/FirewallPolicy.cs +++ b/sdk/dotnet/FrontDoor/FirewallPolicy.cs @@ -10,6 +10,168 @@ namespace Pulumi.Azure.FrontDoor { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFirewallPolicy = new Azure.FrontDoor.FirewallPolicy("exampleFirewallPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Enabled = true, + /// Mode = "Prevention", + /// RedirectUrl = "https://www.contoso.com", + /// CustomBlockResponseStatusCode = 403, + /// CustomBlockResponseBody = "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + /// CustomRules = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyCustomRuleArgs + /// { + /// Name = "Rule1", + /// Enabled = true, + /// Priority = 1, + /// RateLimitDurationInMinutes = 1, + /// RateLimitThreshold = 10, + /// Type = "MatchRule", + /// Action = "Block", + /// MatchConditions = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariable = "RemoteAddr", + /// Operator = "IPMatch", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "192.168.1.0/24", + /// "10.0.0.0/24", + /// }, + /// }, + /// }, + /// }, + /// new Azure.FrontDoor.Inputs.FirewallPolicyCustomRuleArgs + /// { + /// Name = "Rule2", + /// Enabled = true, + /// Priority = 2, + /// RateLimitDurationInMinutes = 1, + /// RateLimitThreshold = 10, + /// Type = "MatchRule", + /// Action = "Block", + /// MatchConditions = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariable = "RemoteAddr", + /// Operator = "IPMatch", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }, + /// new Azure.FrontDoor.Inputs.FirewallPolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariable = "RequestHeader", + /// Selector = "UserAgent", + /// Operator = "Contains", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "windows", + /// }, + /// Transforms = new[] + /// { + /// "Lowercase", + /// "Trim", + /// }, + /// }, + /// }, + /// }, + /// }, + /// ManagedRules = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleArgs + /// { + /// Type = "DefaultRuleSet", + /// Version = "1.0", + /// Exclusions = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleExclusionArgs + /// { + /// MatchVariable = "QueryStringArgNames", + /// Operator = "Equals", + /// Selector = "not_suspicious", + /// }, + /// }, + /// Overrides = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleOverrideArgs + /// { + /// RuleGroupName = "PHP", + /// Rules = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleOverrideRuleArgs + /// { + /// RuleId = "933100", + /// Enabled = false, + /// Action = "Block", + /// }, + /// }, + /// }, + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleOverrideArgs + /// { + /// RuleGroupName = "SQLI", + /// Exclusions = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleOverrideExclusionArgs + /// { + /// MatchVariable = "QueryStringArgNames", + /// Operator = "Equals", + /// Selector = "really_not_suspicious", + /// }, + /// }, + /// Rules = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleOverrideRuleArgs + /// { + /// RuleId = "942200", + /// Action = "Block", + /// Exclusions = new[] + /// { + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleOverrideRuleExclusionArgs + /// { + /// MatchVariable = "QueryStringArgNames", + /// Operator = "Equals", + /// Selector = "innocent", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// new Azure.FrontDoor.Inputs.FirewallPolicyManagedRuleArgs + /// { + /// Type = "Microsoft_BotManagerRuleSet", + /// Version = "1.0", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// FrontDoor Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/FrontDoor/Frontdoor.cs b/sdk/dotnet/FrontDoor/Frontdoor.cs index bd5e80675c..ff01efcb89 100644 --- a/sdk/dotnet/FrontDoor/Frontdoor.cs +++ b/sdk/dotnet/FrontDoor/Frontdoor.cs @@ -22,6 +22,95 @@ namespace Pulumi.Azure.FrontDoor /// * Use Front Door to improve application performance with SSL offload and routing requests to the fastest available application backend. /// * Use Front Door for application layer security and DDoS protection for your application. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFrontdoor = new Azure.FrontDoor.Frontdoor("exampleFrontdoor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RoutingRules = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorRoutingRuleArgs + /// { + /// Name = "exampleRoutingRule1", + /// AcceptedProtocols = new[] + /// { + /// "Http", + /// "Https", + /// }, + /// PatternsToMatches = new[] + /// { + /// "/*", + /// }, + /// FrontendEndpoints = new[] + /// { + /// "exampleFrontendEndpoint1", + /// }, + /// ForwardingConfiguration = new Azure.FrontDoor.Inputs.FrontdoorRoutingRuleForwardingConfigurationArgs + /// { + /// ForwardingProtocol = "MatchRequest", + /// BackendPoolName = "exampleBackendBing", + /// }, + /// }, + /// }, + /// BackendPoolLoadBalancings = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolLoadBalancingArgs + /// { + /// Name = "exampleLoadBalancingSettings1", + /// }, + /// }, + /// BackendPoolHealthProbes = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolHealthProbeArgs + /// { + /// Name = "exampleHealthProbeSetting1", + /// }, + /// }, + /// BackendPools = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolArgs + /// { + /// Name = "exampleBackendBing", + /// Backends = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolBackendArgs + /// { + /// HostHeader = "www.bing.com", + /// Address = "www.bing.com", + /// HttpPort = 80, + /// HttpsPort = 443, + /// }, + /// }, + /// LoadBalancingName = "exampleLoadBalancingSettings1", + /// HealthProbeName = "exampleHealthProbeSetting1", + /// }, + /// }, + /// FrontendEndpoints = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorFrontendEndpointArgs + /// { + /// Name = "exampleFrontendEndpoint1", + /// HostName = "example-FrontDoor.azurefd.net", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Front Doors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/FrontDoor/RulesEngine.cs b/sdk/dotnet/FrontDoor/RulesEngine.cs index bb196f007b..6a639ffaac 100644 --- a/sdk/dotnet/FrontDoor/RulesEngine.cs +++ b/sdk/dotnet/FrontDoor/RulesEngine.cs @@ -14,6 +14,152 @@ namespace Pulumi.Azure.FrontDoor /// /// Manages an Azure Front Door (classic) Rules Engine configuration and rules. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFrontdoor = new Azure.FrontDoor.Frontdoor("exampleFrontdoor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// BackendPools = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolArgs + /// { + /// Name = "exampleBackendBing", + /// LoadBalancingName = "exampleLoadBalancingSettings1", + /// HealthProbeName = "exampleHealthProbeSetting1", + /// Backends = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolBackendArgs + /// { + /// HostHeader = "www.bing.com", + /// Address = "www.bing.com", + /// HttpPort = 80, + /// HttpsPort = 443, + /// }, + /// }, + /// }, + /// }, + /// BackendPoolHealthProbes = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolHealthProbeArgs + /// { + /// Name = "exampleHealthProbeSetting1", + /// }, + /// }, + /// BackendPoolLoadBalancings = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorBackendPoolLoadBalancingArgs + /// { + /// Name = "exampleLoadBalancingSettings1", + /// }, + /// }, + /// FrontendEndpoints = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorFrontendEndpointArgs + /// { + /// Name = "exampleFrontendEndpoint1", + /// HostName = "example-FrontDoor.azurefd.net", + /// }, + /// }, + /// RoutingRules = new[] + /// { + /// new Azure.FrontDoor.Inputs.FrontdoorRoutingRuleArgs + /// { + /// Name = "exampleRoutingRule1", + /// AcceptedProtocols = new[] + /// { + /// "Http", + /// "Https", + /// }, + /// PatternsToMatches = new[] + /// { + /// "/*", + /// }, + /// FrontendEndpoints = new[] + /// { + /// "exampleFrontendEndpoint1", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleRulesEngine = new Azure.FrontDoor.RulesEngine("exampleRulesEngine", new() + /// { + /// FrontdoorName = exampleFrontdoor.Name, + /// ResourceGroupName = exampleFrontdoor.ResourceGroupName, + /// Rules = new[] + /// { + /// new Azure.FrontDoor.Inputs.RulesEngineRuleArgs + /// { + /// Name = "debuggingoutput", + /// Priority = 1, + /// Action = new Azure.FrontDoor.Inputs.RulesEngineRuleActionArgs + /// { + /// ResponseHeaders = new[] + /// { + /// new Azure.FrontDoor.Inputs.RulesEngineRuleActionResponseHeaderArgs + /// { + /// HeaderActionType = "Append", + /// HeaderName = "X-TEST-HEADER", + /// Value = "Append Header Rule", + /// }, + /// }, + /// }, + /// }, + /// new Azure.FrontDoor.Inputs.RulesEngineRuleArgs + /// { + /// Name = "overwriteorigin", + /// Priority = 2, + /// MatchConditions = new[] + /// { + /// new Azure.FrontDoor.Inputs.RulesEngineRuleMatchConditionArgs + /// { + /// Variable = "RequestMethod", + /// Operator = "Equal", + /// Values = new[] + /// { + /// "GET", + /// "POST", + /// }, + /// }, + /// }, + /// Action = new Azure.FrontDoor.Inputs.RulesEngineRuleActionArgs + /// { + /// ResponseHeaders = new[] + /// { + /// new Azure.FrontDoor.Inputs.RulesEngineRuleActionResponseHeaderArgs + /// { + /// HeaderActionType = "Overwrite", + /// HeaderName = "Access-Control-Allow-Origin", + /// Value = "*", + /// }, + /// new Azure.FrontDoor.Inputs.RulesEngineRuleActionResponseHeaderArgs + /// { + /// HeaderActionType = "Overwrite", + /// HeaderName = "Access-Control-Allow-Credentials", + /// Value = "true", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Front Door Rules Engine's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Graph/Account.cs b/sdk/dotnet/Graph/Account.cs index 68062034e6..ba1b092d91 100644 --- a/sdk/dotnet/Graph/Account.cs +++ b/sdk/dotnet/Graph/Account.cs @@ -14,6 +14,40 @@ namespace Pulumi.Azure.Graph /// /// !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.graph.ServicesAccount` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleApplication = new AzureAD.Application("exampleApplication", new() + /// { + /// DisplayName = "example-app", + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Graph.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationId = exampleApplication.ApplicationId, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/dotnet/Graph/ServicesAccount.cs b/sdk/dotnet/Graph/ServicesAccount.cs index ecce886ea1..976de4b396 100644 --- a/sdk/dotnet/Graph/ServicesAccount.cs +++ b/sdk/dotnet/Graph/ServicesAccount.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.Graph /// /// Manages a Microsoft Graph Services Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleApplication = new AzureAD.Application("exampleApplication", new() + /// { + /// DisplayName = "example-app", + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicesAccount = new Azure.Graph.ServicesAccount("exampleServicesAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationId = exampleApplication.ApplicationId, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/dotnet/HDInsight/GetCluster.cs b/sdk/dotnet/HDInsight/GetCluster.cs index cc356981b0..e6fed9846c 100644 --- a/sdk/dotnet/HDInsight/GetCluster.cs +++ b/sdk/dotnet/HDInsight/GetCluster.cs @@ -13,12 +13,66 @@ public static class GetCluster { /// /// Use this data source to access information about an existing HDInsight Cluster. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.HDInsight.GetCluster.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["httpsEndpoint"] = example.Apply(getClusterResult => getClusterResult.HttpsEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetClusterArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:hdinsight/getCluster:getCluster", args ?? new GetClusterArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing HDInsight Cluster. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.HDInsight.GetCluster.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["httpsEndpoint"] = example.Apply(getClusterResult => getClusterResult.HttpsEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetClusterInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:hdinsight/getCluster:getCluster", args ?? new GetClusterInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/HDInsight/HBaseCluster.cs b/sdk/dotnet/HDInsight/HBaseCluster.cs index f745f0247d..0e4af3bd03 100644 --- a/sdk/dotnet/HDInsight/HBaseCluster.cs +++ b/sdk/dotnet/HDInsight/HBaseCluster.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.HDInsight /// /// Manages a HDInsight HBase Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleHBaseCluster = new Azure.HDInsight.HBaseCluster("exampleHBaseCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterVersion = "3.6", + /// Tier = "Standard", + /// ComponentVersion = new Azure.HDInsight.Inputs.HBaseClusterComponentVersionArgs + /// { + /// Hbase = "1.1", + /// }, + /// Gateway = new Azure.HDInsight.Inputs.HBaseClusterGatewayArgs + /// { + /// Username = "acctestusrgw", + /// Password = "Password123!", + /// }, + /// StorageAccounts = new[] + /// { + /// new Azure.HDInsight.Inputs.HBaseClusterStorageAccountArgs + /// { + /// StorageContainerId = exampleContainer.Id, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// IsDefault = true, + /// }, + /// }, + /// Roles = new Azure.HDInsight.Inputs.HBaseClusterRolesArgs + /// { + /// HeadNode = new Azure.HDInsight.Inputs.HBaseClusterRolesHeadNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// WorkerNode = new Azure.HDInsight.Inputs.HBaseClusterRolesWorkerNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// TargetInstanceCount = 3, + /// }, + /// ZookeeperNode = new Azure.HDInsight.Inputs.HBaseClusterRolesZookeeperNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// HDInsight HBase Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/HDInsight/HadoopCluster.cs b/sdk/dotnet/HDInsight/HadoopCluster.cs index 3f3e86b8e5..20ce1f7700 100644 --- a/sdk/dotnet/HDInsight/HadoopCluster.cs +++ b/sdk/dotnet/HDInsight/HadoopCluster.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.HDInsight /// /// Manages a HDInsight Hadoop Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleHadoopCluster = new Azure.HDInsight.HadoopCluster("exampleHadoopCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterVersion = "3.6", + /// Tier = "Standard", + /// ComponentVersion = new Azure.HDInsight.Inputs.HadoopClusterComponentVersionArgs + /// { + /// Hadoop = "2.7", + /// }, + /// Gateway = new Azure.HDInsight.Inputs.HadoopClusterGatewayArgs + /// { + /// Username = "acctestusrgw", + /// Password = "PAssword123!", + /// }, + /// StorageAccounts = new[] + /// { + /// new Azure.HDInsight.Inputs.HadoopClusterStorageAccountArgs + /// { + /// StorageContainerId = exampleContainer.Id, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// IsDefault = true, + /// }, + /// }, + /// Roles = new Azure.HDInsight.Inputs.HadoopClusterRolesArgs + /// { + /// HeadNode = new Azure.HDInsight.Inputs.HadoopClusterRolesHeadNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// WorkerNode = new Azure.HDInsight.Inputs.HadoopClusterRolesWorkerNodeArgs + /// { + /// VmSize = "Standard_D4_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// TargetInstanceCount = 3, + /// }, + /// ZookeeperNode = new Azure.HDInsight.Inputs.HadoopClusterRolesZookeeperNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// HDInsight Hadoop Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/HDInsight/InteractiveQueryCluster.cs b/sdk/dotnet/HDInsight/InteractiveQueryCluster.cs index 34040d93ff..af1d44db2d 100644 --- a/sdk/dotnet/HDInsight/InteractiveQueryCluster.cs +++ b/sdk/dotnet/HDInsight/InteractiveQueryCluster.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.HDInsight /// /// Manages a HDInsight Interactive Query Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleInteractiveQueryCluster = new Azure.HDInsight.InteractiveQueryCluster("exampleInteractiveQueryCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterVersion = "3.6", + /// Tier = "Standard", + /// ComponentVersion = new Azure.HDInsight.Inputs.InteractiveQueryClusterComponentVersionArgs + /// { + /// InteractiveHive = "2.1", + /// }, + /// Gateway = new Azure.HDInsight.Inputs.InteractiveQueryClusterGatewayArgs + /// { + /// Username = "acctestusrgw", + /// Password = "Password!", + /// }, + /// StorageAccounts = new[] + /// { + /// new Azure.HDInsight.Inputs.InteractiveQueryClusterStorageAccountArgs + /// { + /// StorageContainerId = exampleContainer.Id, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// IsDefault = true, + /// }, + /// }, + /// Roles = new Azure.HDInsight.Inputs.InteractiveQueryClusterRolesArgs + /// { + /// HeadNode = new Azure.HDInsight.Inputs.InteractiveQueryClusterRolesHeadNodeArgs + /// { + /// VmSize = "Standard_D13_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// WorkerNode = new Azure.HDInsight.Inputs.InteractiveQueryClusterRolesWorkerNodeArgs + /// { + /// VmSize = "Standard_D14_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// TargetInstanceCount = 3, + /// }, + /// ZookeeperNode = new Azure.HDInsight.Inputs.InteractiveQueryClusterRolesZookeeperNodeArgs + /// { + /// VmSize = "Standard_A4_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// HDInsight Interactive Query Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/HDInsight/KafkaCluster.cs b/sdk/dotnet/HDInsight/KafkaCluster.cs index 6d8704f04a..f0ab4751c8 100644 --- a/sdk/dotnet/HDInsight/KafkaCluster.cs +++ b/sdk/dotnet/HDInsight/KafkaCluster.cs @@ -12,6 +12,87 @@ namespace Pulumi.Azure.HDInsight /// /// Manages a HDInsight Kafka Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleKafkaCluster = new Azure.HDInsight.KafkaCluster("exampleKafkaCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterVersion = "4.0", + /// Tier = "Standard", + /// ComponentVersion = new Azure.HDInsight.Inputs.KafkaClusterComponentVersionArgs + /// { + /// Kafka = "2.1", + /// }, + /// Gateway = new Azure.HDInsight.Inputs.KafkaClusterGatewayArgs + /// { + /// Username = "acctestusrgw", + /// Password = "Password123!", + /// }, + /// StorageAccounts = new[] + /// { + /// new Azure.HDInsight.Inputs.KafkaClusterStorageAccountArgs + /// { + /// StorageContainerId = exampleContainer.Id, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// IsDefault = true, + /// }, + /// }, + /// Roles = new Azure.HDInsight.Inputs.KafkaClusterRolesArgs + /// { + /// HeadNode = new Azure.HDInsight.Inputs.KafkaClusterRolesHeadNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// WorkerNode = new Azure.HDInsight.Inputs.KafkaClusterRolesWorkerNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// NumberOfDisksPerNode = 3, + /// TargetInstanceCount = 3, + /// }, + /// ZookeeperNode = new Azure.HDInsight.Inputs.KafkaClusterRolesZookeeperNodeArgs + /// { + /// VmSize = "Standard_D3_V2", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// HDInsight Kafka Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/HDInsight/SparkCluster.cs b/sdk/dotnet/HDInsight/SparkCluster.cs index 1d6b7cfc17..cef83e15ab 100644 --- a/sdk/dotnet/HDInsight/SparkCluster.cs +++ b/sdk/dotnet/HDInsight/SparkCluster.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.HDInsight /// /// Manages a HDInsight Spark Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleSparkCluster = new Azure.HDInsight.SparkCluster("exampleSparkCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterVersion = "3.6", + /// Tier = "Standard", + /// ComponentVersion = new Azure.HDInsight.Inputs.SparkClusterComponentVersionArgs + /// { + /// Spark = "2.3", + /// }, + /// Gateway = new Azure.HDInsight.Inputs.SparkClusterGatewayArgs + /// { + /// Username = "acctestusrgw", + /// Password = "Password123!", + /// }, + /// StorageAccounts = new[] + /// { + /// new Azure.HDInsight.Inputs.SparkClusterStorageAccountArgs + /// { + /// StorageContainerId = exampleContainer.Id, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// IsDefault = true, + /// }, + /// }, + /// Roles = new Azure.HDInsight.Inputs.SparkClusterRolesArgs + /// { + /// HeadNode = new Azure.HDInsight.Inputs.SparkClusterRolesHeadNodeArgs + /// { + /// VmSize = "Standard_A3", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// WorkerNode = new Azure.HDInsight.Inputs.SparkClusterRolesWorkerNodeArgs + /// { + /// VmSize = "Standard_A3", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// TargetInstanceCount = 3, + /// }, + /// ZookeeperNode = new Azure.HDInsight.Inputs.SparkClusterRolesZookeeperNodeArgs + /// { + /// VmSize = "Medium", + /// Username = "acctestusrvm", + /// Password = "AccTestvdSC4daf986!", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// HDInsight Spark Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Healthcare/DicomService.cs b/sdk/dotnet/Healthcare/DicomService.cs index df5319dc48..f9ecba3246 100644 --- a/sdk/dotnet/Healthcare/DicomService.cs +++ b/sdk/dotnet/Healthcare/DicomService.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.Healthcare /// /// Manages a Healthcare DICOM Service /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testWorkspace = new Azure.Healthcare.Workspace("testWorkspace", new() + /// { + /// ResourceGroupName = "tfex-resource_group", + /// Location = "east us", + /// }); + /// + /// var testDicomService = new Azure.Healthcare.DicomService("testDicomService", new() + /// { + /// WorkspaceId = testWorkspace.Id, + /// Location = "east us", + /// Identity = new Azure.Healthcare.Inputs.DicomServiceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "environment", "None" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Healthcare DICOM Service can be imported using the resource`id`, e.g. diff --git a/sdk/dotnet/Healthcare/FhirService.cs b/sdk/dotnet/Healthcare/FhirService.cs index bd0a9ae5bd..0a21e45534 100644 --- a/sdk/dotnet/Healthcare/FhirService.cs +++ b/sdk/dotnet/Healthcare/FhirService.cs @@ -12,6 +12,78 @@ namespace Pulumi.Azure.Healthcare /// /// Manages a Healthcare FHIR (Fast Healthcare Interoperability Resources) Service /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleWorkspace = new Azure.Healthcare.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFhirService = new Azure.Healthcare.FhirService("exampleFhirService", new() + /// { + /// Location = "east us", + /// ResourceGroupName = "tfex-resource_group", + /// WorkspaceId = exampleWorkspace.Id, + /// Kind = "fhir-R4", + /// Authentication = new Azure.Healthcare.Inputs.FhirServiceAuthenticationArgs + /// { + /// Authority = "https://login.microsoftonline.com/tenantId", + /// Audience = "https://tfexfhir.fhir.azurehealthcareapis.com", + /// }, + /// AccessPolicyObjectIds = new[] + /// { + /// current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }, + /// Identity = new Azure.Healthcare.Inputs.FhirServiceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// ContainerRegistryLoginServerUrls = new[] + /// { + /// "tfex-container_registry_login_server", + /// }, + /// Cors = new Azure.Healthcare.Inputs.FhirServiceCorsArgs + /// { + /// AllowedOrigins = new[] + /// { + /// "https://tfex.com:123", + /// "https://tfex1.com:3389", + /// }, + /// AllowedHeaders = new[] + /// { + /// "*", + /// }, + /// AllowedMethods = new[] + /// { + /// "GET", + /// "DELETE", + /// "PUT", + /// }, + /// MaxAgeInSeconds = 3600, + /// CredentialsAllowed = true, + /// }, + /// ConfigurationExportStorageAccountName = "storage_account_name", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Healthcare FHIR Service can be imported using the resource`id`, e.g. diff --git a/sdk/dotnet/Healthcare/GetDicomService.cs b/sdk/dotnet/Healthcare/GetDicomService.cs index cd2bf3466b..0aa8714454 100644 --- a/sdk/dotnet/Healthcare/GetDicomService.cs +++ b/sdk/dotnet/Healthcare/GetDicomService.cs @@ -13,12 +13,66 @@ public static class GetDicomService { /// /// Use this data source to access information about an existing Healthcare DICOM Service + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetDicomService.Invoke(new() + /// { + /// Name = "example-healthcare_dicom_service", + /// WorkspaceId = data.Azurerm_healthcare_workspace.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermHealthcareDicomService"] = example.Apply(getDicomServiceResult => getDicomServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDicomServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:healthcare/getDicomService:getDicomService", args ?? new GetDicomServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Healthcare DICOM Service + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetDicomService.Invoke(new() + /// { + /// Name = "example-healthcare_dicom_service", + /// WorkspaceId = data.Azurerm_healthcare_workspace.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermHealthcareDicomService"] = example.Apply(getDicomServiceResult => getDicomServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDicomServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:healthcare/getDicomService:getDicomService", args ?? new GetDicomServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Healthcare/GetMedtechService.cs b/sdk/dotnet/Healthcare/GetMedtechService.cs index 174489aa22..54361a98a5 100644 --- a/sdk/dotnet/Healthcare/GetMedtechService.cs +++ b/sdk/dotnet/Healthcare/GetMedtechService.cs @@ -13,12 +13,66 @@ public static class GetMedtechService { /// /// Use this data source to access information about an existing Healthcare Med Tech Service + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetMedtechService.Invoke(new() + /// { + /// Name = "tfexmedtech", + /// WorkspaceId = "tfexwks", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermHealthcareMedtechServiceId"] = example.Apply(getMedtechServiceResult => getMedtechServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetMedtechServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:healthcare/getMedtechService:getMedtechService", args ?? new GetMedtechServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Healthcare Med Tech Service + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetMedtechService.Invoke(new() + /// { + /// Name = "tfexmedtech", + /// WorkspaceId = "tfexwks", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermHealthcareMedtechServiceId"] = example.Apply(getMedtechServiceResult => getMedtechServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetMedtechServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:healthcare/getMedtechService:getMedtechService", args ?? new GetMedtechServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Healthcare/GetService.cs b/sdk/dotnet/Healthcare/GetService.cs index ff055ec0a9..699c4b9246 100644 --- a/sdk/dotnet/Healthcare/GetService.cs +++ b/sdk/dotnet/Healthcare/GetService.cs @@ -13,12 +13,68 @@ public static class GetService { /// /// Use this data source to access information about an existing Healthcare Service + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetService.Invoke(new() + /// { + /// Name = "example-healthcare_service", + /// ResourceGroupName = "example-resources", + /// Location = "westus2", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["healthcareServiceId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:healthcare/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Healthcare Service + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetService.Invoke(new() + /// { + /// Name = "example-healthcare_service", + /// ResourceGroupName = "example-resources", + /// Location = "westus2", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["healthcareServiceId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:healthcare/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Healthcare/GetWorkspace.cs b/sdk/dotnet/Healthcare/GetWorkspace.cs index e5884d54e4..0be8a2aaa0 100644 --- a/sdk/dotnet/Healthcare/GetWorkspace.cs +++ b/sdk/dotnet/Healthcare/GetWorkspace.cs @@ -13,12 +13,66 @@ public static class GetWorkspace { /// /// Use this data source to access information about an existing Healthcare Workspace + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetWorkspace.Invoke(new() + /// { + /// Name = "example-healthcare_service", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["healthcareWorkspaceId"] = example.Apply(getWorkspaceResult => getWorkspaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWorkspaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:healthcare/getWorkspace:getWorkspace", args ?? new GetWorkspaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Healthcare Workspace + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Healthcare.GetWorkspace.Invoke(new() + /// { + /// Name = "example-healthcare_service", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["healthcareWorkspaceId"] = example.Apply(getWorkspaceResult => getWorkspaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWorkspaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:healthcare/getWorkspace:getWorkspace", args ?? new GetWorkspaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Healthcare/MedtechService.cs b/sdk/dotnet/Healthcare/MedtechService.cs index 1e23cae2b7..8afe3afe11 100644 --- a/sdk/dotnet/Healthcare/MedtechService.cs +++ b/sdk/dotnet/Healthcare/MedtechService.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.Healthcare /// /// Manages a Healthcare Med Tech Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleWorkspace = new Azure.Healthcare.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleMedtechService = new Azure.Healthcare.MedtechService("exampleMedtechService", new() + /// { + /// WorkspaceId = exampleWorkspace.Id, + /// Location = "east us", + /// Identity = new Azure.Healthcare.Inputs.MedtechServiceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// EventhubNamespaceName = "example-eventhub-namespace", + /// EventhubName = "example-eventhub", + /// EventhubConsumerGroupName = "$Default", + /// DeviceMappingJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["templateType"] = "CollectionContent", + /// ["template"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["templateType"] = "JsonPathContent", + /// ["template"] = new Dictionary<string, object?> + /// { + /// ["typeName"] = "heartrate", + /// ["typeMatchExpression"] = "$..[?(@heartrate)]", + /// ["deviceIdExpression"] = "$.deviceid", + /// ["timestampExpression"] = "$.measurementdatetime", + /// ["values"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["required"] = "true", + /// ["valueExpression"] = "$.heartrate", + /// ["valueName"] = "hr", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Healthcare Med Tech Service can be imported using the resource`id`, e.g. diff --git a/sdk/dotnet/Healthcare/MedtechServiceFhirDestination.cs b/sdk/dotnet/Healthcare/MedtechServiceFhirDestination.cs index f7c6d39ea3..b54650d8f2 100644 --- a/sdk/dotnet/Healthcare/MedtechServiceFhirDestination.cs +++ b/sdk/dotnet/Healthcare/MedtechServiceFhirDestination.cs @@ -12,6 +12,122 @@ namespace Pulumi.Azure.Healthcare /// /// Manages a Healthcare Med Tech Service Fhir Destination. /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleWorkspace = new Azure.Healthcare.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 1, + /// MessageRetention = 1, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFhirService = new Azure.Healthcare.FhirService("exampleFhirService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceId = exampleWorkspace.Id, + /// Kind = "fhir-R4", + /// Authentication = new Azure.Healthcare.Inputs.FhirServiceAuthenticationArgs + /// { + /// Authority = "https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + /// Audience = "https://examplefhir.fhir.azurehealthcareapis.com", + /// }, + /// }); + /// + /// var exampleMedtechService = new Azure.Healthcare.MedtechService("exampleMedtechService", new() + /// { + /// WorkspaceId = exampleWorkspace.Id, + /// Location = exampleResourceGroup.Location, + /// EventhubNamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// EventhubConsumerGroupName = exampleConsumerGroup.Name, + /// DeviceMappingJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["templateType"] = "CollectionContent", + /// ["template"] = new[] + /// { + /// }, + /// }), + /// }); + /// + /// var exampleMedtechServiceFhirDestination = new Azure.Healthcare.MedtechServiceFhirDestination("exampleMedtechServiceFhirDestination", new() + /// { + /// Location = "east us", + /// MedtechServiceId = exampleMedtechService.Id, + /// DestinationFhirServiceId = exampleFhirService.Id, + /// DestinationIdentityResolutionType = "Create", + /// DestinationFhirMappingJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["templateType"] = "CollectionFhirTemplate", + /// ["template"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["templateType"] = "CodeValueFhir", + /// ["template"] = new Dictionary<string, object?> + /// { + /// ["codes"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["code"] = "8867-4", + /// ["system"] = "http://loinc.org", + /// ["display"] = "Heart rate", + /// }, + /// }, + /// ["periodInterval"] = 60, + /// ["typeName"] = "heartrate", + /// ["value"] = new Dictionary<string, object?> + /// { + /// ["defaultPeriod"] = 5000, + /// ["unit"] = "count/min", + /// ["valueName"] = "hr", + /// ["valueType"] = "SampledData", + /// }, + /// }, + /// }, + /// }, + /// }), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Healthcare Med Tech Service Fhir Destination can be imported using the resource`id`, e.g. diff --git a/sdk/dotnet/Healthcare/Service.cs b/sdk/dotnet/Healthcare/Service.cs index 4b618ad9d1..3b541c77e5 100644 --- a/sdk/dotnet/Healthcare/Service.cs +++ b/sdk/dotnet/Healthcare/Service.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.Healthcare /// /// Manages a Healthcare Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var example = new Azure.Healthcare.Service("example", new() + /// { + /// ResourceGroupName = "sample-resource-group", + /// Location = "westus2", + /// Kind = "fhir-R4", + /// CosmosdbThroughput = 2000, + /// AccessPolicyObjectIds = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// Tags = + /// { + /// { "environment", "testenv" }, + /// { "purpose", "AcceptanceTests" }, + /// }, + /// AuthenticationConfiguration = new Azure.Healthcare.Inputs.ServiceAuthenticationConfigurationArgs + /// { + /// Authority = "https://login.microsoftonline.com/$%7Bdata.azurerm_client_config.current.tenant_id%7D", + /// Audience = "https://azurehealthcareapis.com/", + /// SmartProxyEnabled = true, + /// }, + /// CorsConfiguration = new Azure.Healthcare.Inputs.ServiceCorsConfigurationArgs + /// { + /// AllowedOrigins = new[] + /// { + /// "http://www.example.com", + /// "http://www.example2.com", + /// }, + /// AllowedHeaders = new[] + /// { + /// "x-tempo-*", + /// "x-tempo2-*", + /// }, + /// AllowedMethods = new[] + /// { + /// "GET", + /// "PUT", + /// }, + /// MaxAgeInSeconds = 500, + /// AllowCredentials = true, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Healthcare Service can be imported using the resource`id`, e.g. diff --git a/sdk/dotnet/Healthcare/Workspace.cs b/sdk/dotnet/Healthcare/Workspace.cs index 13b4173448..c51db44052 100644 --- a/sdk/dotnet/Healthcare/Workspace.cs +++ b/sdk/dotnet/Healthcare/Workspace.cs @@ -12,6 +12,25 @@ namespace Pulumi.Azure.Healthcare /// /// Manages a Healthcare workspace /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = new Azure.Healthcare.Workspace("test", new() + /// { + /// Location = "east us", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Healthcare Workspaces can be imported using the resource`id`, e.g. diff --git a/sdk/dotnet/Hpc/Cache.cs b/sdk/dotnet/Hpc/Cache.cs index 0c33c6518e..fbfa2c8b6b 100644 --- a/sdk/dotnet/Hpc/Cache.cs +++ b/sdk/dotnet/Hpc/Cache.cs @@ -14,6 +14,53 @@ namespace Pulumi.Azure.Hpc /// /// > **Note:** By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleCache = new Azure.Hpc.Cache("exampleCache", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CacheSizeInGb = 3072, + /// SubnetId = exampleSubnet.Id, + /// SkuName = "Standard_2G", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// HPC Caches can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Hpc/CacheAccessPolicy.cs b/sdk/dotnet/Hpc/CacheAccessPolicy.cs index f16ad731dc..fb73f518c7 100644 --- a/sdk/dotnet/Hpc/CacheAccessPolicy.cs +++ b/sdk/dotnet/Hpc/CacheAccessPolicy.cs @@ -12,6 +12,66 @@ namespace Pulumi.Azure.Hpc /// /// Manages a HPC Cache Access Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleCache = new Azure.Hpc.Cache("exampleCache", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CacheSizeInGb = 3072, + /// SubnetId = exampleSubnet.Id, + /// SkuName = "Standard_2G", + /// }); + /// + /// var exampleCacheAccessPolicy = new Azure.Hpc.CacheAccessPolicy("exampleCacheAccessPolicy", new() + /// { + /// HpcCacheId = exampleCache.Id, + /// AccessRules = new[] + /// { + /// new Azure.Hpc.Inputs.CacheAccessPolicyAccessRuleArgs + /// { + /// Scope = "default", + /// Access = "rw", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// HPC Cache Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Hpc/CacheBlobTarget.cs b/sdk/dotnet/Hpc/CacheBlobTarget.cs index 39b8578390..fc0345845f 100644 --- a/sdk/dotnet/Hpc/CacheBlobTarget.cs +++ b/sdk/dotnet/Hpc/CacheBlobTarget.cs @@ -14,6 +14,94 @@ namespace Pulumi.Azure.Hpc /// /// > **NOTE:**: By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleCache = new Azure.Hpc.Cache("exampleCache", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CacheSizeInGb = 3072, + /// SubnetId = exampleSubnet.Id, + /// SkuName = "Standard_2G", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "HPC Cache Resource Provider", + /// }); + /// + /// var exampleStorageAccountContrib = new Azure.Authorization.Assignment("exampleStorageAccountContrib", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Storage Account Contributor", + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// }); + /// + /// var exampleStorageBlobDataContrib = new Azure.Authorization.Assignment("exampleStorageBlobDataContrib", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Storage Blob Data Contributor", + /// PrincipalId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// }); + /// + /// var exampleCacheBlobTarget = new Azure.Hpc.CacheBlobTarget("exampleCacheBlobTarget", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// CacheName = exampleCache.Name, + /// StorageContainerId = exampleContainer.ResourceManagerId, + /// NamespacePath = "/blob_storage", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Blob Targets within an HPC Cache can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Hsm/Module.cs b/sdk/dotnet/Hsm/Module.cs index 1cac80194e..ae4730d2cb 100644 --- a/sdk/dotnet/Hsm/Module.cs +++ b/sdk/dotnet/Hsm/Module.cs @@ -16,6 +16,139 @@ namespace Pulumi.Azure.Hsm /// /// > **Note:** If the quota is not enough in some region, please submit the quota request to service team. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.2.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.2.0.0/24", + /// }, + /// }); + /// + /// var example2 = new Azure.Network.Subnet("example2", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.2.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "first", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.HardwareSecurityModules/dedicatedHSMs", + /// Actions = new[] + /// { + /// "Microsoft.Network/networkinterfaces/*", + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var example3 = new Azure.Network.Subnet("example3", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.2.255.0/26", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// }); + /// + /// var exampleVirtualNetworkGateway = new Azure.Network.VirtualNetworkGateway("exampleVirtualNetworkGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Type = "ExpressRoute", + /// VpnType = "PolicyBased", + /// Sku = "Standard", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkGatewayIpConfigurationArgs + /// { + /// PublicIpAddressId = examplePublicIp.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// SubnetId = example3.Id, + /// }, + /// }, + /// }); + /// + /// var exampleModule = new Azure.Hsm.Module("exampleModule", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "payShield10K_LMK1_CPS60", + /// ManagementNetworkProfile = new Azure.Hsm.Inputs.ModuleManagementNetworkProfileArgs + /// { + /// NetworkInterfacePrivateIpAddresses = new[] + /// { + /// "10.2.1.7", + /// }, + /// SubnetId = example2.Id, + /// }, + /// NetworkProfile = new Azure.Hsm.Inputs.ModuleNetworkProfileArgs + /// { + /// NetworkInterfacePrivateIpAddresses = new[] + /// { + /// "10.2.1.8", + /// }, + /// SubnetId = example2.Id, + /// }, + /// StampId = "stamp2", + /// Tags = + /// { + /// { "env", "Test" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleVirtualNetworkGateway, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dedicated Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Hybrid/GetComputeMachine.cs b/sdk/dotnet/Hybrid/GetComputeMachine.cs index c14466a0e8..3426928607 100644 --- a/sdk/dotnet/Hybrid/GetComputeMachine.cs +++ b/sdk/dotnet/Hybrid/GetComputeMachine.cs @@ -17,6 +17,33 @@ public static class GetComputeMachine /// ## Disclaimers /// /// > **Note:** The Data Source `azure.hybrid.getComputeMachine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `azure.arcmachine.get` Data Source. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Hybrid.GetComputeMachine.Invoke(new() + /// { + /// Name = "existing-hcmachine", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getComputeMachineResult => getComputeMachineResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetComputeMachineArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:hybrid/getComputeMachine:getComputeMachine", args ?? new GetComputeMachineArgs(), options.WithDefaults()); @@ -27,6 +54,33 @@ public static Task InvokeAsync(GetComputeMachineArgs ar /// ## Disclaimers /// /// > **Note:** The Data Source `azure.hybrid.getComputeMachine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `azure.arcmachine.get` Data Source. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Hybrid.GetComputeMachine.Invoke(new() + /// { + /// Name = "existing-hcmachine", + /// ResourceGroupName = "existing-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getComputeMachineResult => getComputeMachineResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetComputeMachineInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:hybrid/getComputeMachine:getComputeMachine", args ?? new GetComputeMachineInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Iot/Certificate.cs b/sdk/dotnet/Iot/Certificate.cs index cc1fbaedb0..b5f705214e 100644 --- a/sdk/dotnet/Iot/Certificate.cs +++ b/sdk/dotnet/Iot/Certificate.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Iot /// /// Manages an IotHub Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "B1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.Iot.Certificate("exampleCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubName = exampleIoTHub.Name, + /// IsVerified = true, + /// CertificateContent = ReadFileBase64("example.cer"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/ConsumerGroup.cs b/sdk/dotnet/Iot/ConsumerGroup.cs index 95b2bea1bb..3a5727a799 100644 --- a/sdk/dotnet/Iot/ConsumerGroup.cs +++ b/sdk/dotnet/Iot/ConsumerGroup.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Iot /// /// Manages a Consumer Group within an IotHub /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// Tags = + /// { + /// { "purpose", "testing" }, + /// }, + /// }); + /// + /// var exampleConsumerGroup = new Azure.Iot.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// IothubName = exampleIoTHub.Name, + /// EventhubEndpointName = "events", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/DpsSharedAccessPolicy.cs b/sdk/dotnet/Iot/DpsSharedAccessPolicy.cs index 469fb3f9a4..ec3096ffc9 100644 --- a/sdk/dotnet/Iot/DpsSharedAccessPolicy.cs +++ b/sdk/dotnet/Iot/DpsSharedAccessPolicy.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Iot /// /// Manages an IotHub Device Provisioning Service Shared Access Policy /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIotHubDps = new Azure.Iot.IotHubDps("exampleIotHubDps", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IotHubDpsSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleDpsSharedAccessPolicy = new Azure.Iot.DpsSharedAccessPolicy("exampleDpsSharedAccessPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubDpsName = exampleIotHubDps.Name, + /// EnrollmentWrite = true, + /// EnrollmentRead = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub Device Provisioning Service Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/EndpointCosmosdbAccount.cs b/sdk/dotnet/Iot/EndpointCosmosdbAccount.cs index 446714ff45..2867458a34 100644 --- a/sdk/dotnet/Iot/EndpointCosmosdbAccount.cs +++ b/sdk/dotnet/Iot/EndpointCosmosdbAccount.cs @@ -14,6 +14,84 @@ namespace Pulumi.Azure.Iot /// /// > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "B1", + /// Capacity = 1, + /// }, + /// Tags = + /// { + /// { "purpose", "example" }, + /// }, + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Strong", + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/definition/id", + /// }); + /// + /// var exampleEndpointCosmosdbAccount = new Azure.Iot.EndpointCosmosdbAccount("exampleEndpointCosmosdbAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubId = exampleIoTHub.Id, + /// ContainerName = exampleSqlContainer.Name, + /// DatabaseName = exampleSqlDatabase.Name, + /// EndpointUri = exampleAccount.Endpoint, + /// PrimaryKey = exampleAccount.PrimaryKey, + /// SecondaryKey = exampleAccount.SecondaryKey, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub Cosmos DB Account Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/EndpointEventhub.cs b/sdk/dotnet/Iot/EndpointEventhub.cs index 41fd1e2319..a4fc1c1596 100644 --- a/sdk/dotnet/Iot/EndpointEventhub.cs +++ b/sdk/dotnet/Iot/EndpointEventhub.cs @@ -14,6 +14,71 @@ namespace Pulumi.Azure.Iot /// /// > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Basic", + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Listen = false, + /// Send = true, + /// Manage = false, + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "B1", + /// Capacity = 1, + /// }, + /// Tags = + /// { + /// { "purpose", "example" }, + /// }, + /// }); + /// + /// var exampleEndpointEventhub = new Azure.Iot.EndpointEventhub("exampleEndpointEventhub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubId = exampleIoTHub.Id, + /// ConnectionString = exampleAuthorizationRule.PrimaryConnectionString, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub EventHub Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/EndpointServicebusQueue.cs b/sdk/dotnet/Iot/EndpointServicebusQueue.cs index 013b3ba67b..a2dec8834f 100644 --- a/sdk/dotnet/Iot/EndpointServicebusQueue.cs +++ b/sdk/dotnet/Iot/EndpointServicebusQueue.cs @@ -14,6 +14,67 @@ namespace Pulumi.Azure.Iot /// /// > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleQueue = new Azure.ServiceBus.Queue("exampleQueue", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleQueueAuthorizationRule = new Azure.ServiceBus.QueueAuthorizationRule("exampleQueueAuthorizationRule", new() + /// { + /// QueueId = exampleQueue.Id, + /// Listen = false, + /// Send = true, + /// Manage = false, + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "B1", + /// Capacity = 1, + /// }, + /// Tags = + /// { + /// { "purpose", "example" }, + /// }, + /// }); + /// + /// var exampleEndpointServicebusQueue = new Azure.Iot.EndpointServicebusQueue("exampleEndpointServicebusQueue", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubId = exampleIoTHub.Id, + /// ConnectionString = exampleQueueAuthorizationRule.PrimaryConnectionString, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub ServiceBus Queue Endpoint can be imported using the `resource id`, e.g. g diff --git a/sdk/dotnet/Iot/EndpointServicebusTopic.cs b/sdk/dotnet/Iot/EndpointServicebusTopic.cs index 475b0fef07..eb94e928a4 100644 --- a/sdk/dotnet/Iot/EndpointServicebusTopic.cs +++ b/sdk/dotnet/Iot/EndpointServicebusTopic.cs @@ -14,6 +14,66 @@ namespace Pulumi.Azure.Iot /// /// > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// }); + /// + /// var exampleTopicAuthorizationRule = new Azure.ServiceBus.TopicAuthorizationRule("exampleTopicAuthorizationRule", new() + /// { + /// TopicId = exampleTopic.Id, + /// Listen = false, + /// Send = true, + /// Manage = false, + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "B1", + /// Capacity = 1, + /// }, + /// Tags = + /// { + /// { "purpose", "example" }, + /// }, + /// }); + /// + /// var exampleEndpointServicebusTopic = new Azure.Iot.EndpointServicebusTopic("exampleEndpointServicebusTopic", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubId = exampleIoTHub.Id, + /// ConnectionString = exampleTopicAuthorizationRule.PrimaryConnectionString, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub ServiceBus Topic Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/EndpointStorageContainer.cs b/sdk/dotnet/Iot/EndpointStorageContainer.cs index a1900572ca..eac5d9632c 100644 --- a/sdk/dotnet/Iot/EndpointStorageContainer.cs +++ b/sdk/dotnet/Iot/EndpointStorageContainer.cs @@ -14,6 +14,61 @@ namespace Pulumi.Azure.Iot /// /// > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleEndpointStorageContainer = new Azure.Iot.EndpointStorageContainer("exampleEndpointStorageContainer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubId = exampleIoTHub.Id, + /// ContainerName = "acctestcont", + /// ConnectionString = exampleAccount.PrimaryBlobConnectionString, + /// FileNameFormat = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + /// BatchFrequencyInSeconds = 60, + /// MaxChunkSizeInBytes = 10485760, + /// Encoding = "JSON", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub Storage Container Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/FileUpload.cs b/sdk/dotnet/Iot/FileUpload.cs index ee653cc073..d2e543d7a8 100644 --- a/sdk/dotnet/Iot/FileUpload.cs +++ b/sdk/dotnet/Iot/FileUpload.cs @@ -14,6 +14,56 @@ namespace Pulumi.Azure.Iot /// /// > **NOTE:** File upload can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleFileUpload = new Azure.Iot.FileUpload("exampleFileUpload", new() + /// { + /// IothubId = exampleIoTHub.Id, + /// ConnectionString = exampleAccount.PrimaryBlobConnectionString, + /// ContainerName = exampleContainer.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoT Hub File Uploads can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/GetDps.cs b/sdk/dotnet/Iot/GetDps.cs index 9c374221ec..356da4b0e4 100644 --- a/sdk/dotnet/Iot/GetDps.cs +++ b/sdk/dotnet/Iot/GetDps.cs @@ -13,12 +13,58 @@ public static class GetDps { /// /// Use this data source to access information about an existing IotHub Device Provisioning Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetDps.Invoke(new() + /// { + /// Name = "iot_hub_dps_test", + /// ResourceGroupName = "iothub_dps_rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDpsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:iot/getDps:getDps", args ?? new GetDpsArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing IotHub Device Provisioning Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetDps.Invoke(new() + /// { + /// Name = "iot_hub_dps_test", + /// ResourceGroupName = "iothub_dps_rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDpsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:iot/getDps:getDps", args ?? new GetDpsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Iot/GetDpsSharedAccessPolicy.cs b/sdk/dotnet/Iot/GetDpsSharedAccessPolicy.cs index 5ca48fd472..7ba08b5458 100644 --- a/sdk/dotnet/Iot/GetDpsSharedAccessPolicy.cs +++ b/sdk/dotnet/Iot/GetDpsSharedAccessPolicy.cs @@ -13,12 +13,60 @@ public static class GetDpsSharedAccessPolicy { /// /// Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetDpsSharedAccessPolicy.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// IothubDpsName = azurerm_iothub_dps.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDpsSharedAccessPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:iot/getDpsSharedAccessPolicy:getDpsSharedAccessPolicy", args ?? new GetDpsSharedAccessPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetDpsSharedAccessPolicy.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// IothubDpsName = azurerm_iothub_dps.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDpsSharedAccessPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:iot/getDpsSharedAccessPolicy:getDpsSharedAccessPolicy", args ?? new GetDpsSharedAccessPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Iot/GetIotHub.cs b/sdk/dotnet/Iot/GetIotHub.cs index d227ab651f..a548b664cc 100644 --- a/sdk/dotnet/Iot/GetIotHub.cs +++ b/sdk/dotnet/Iot/GetIotHub.cs @@ -13,12 +13,66 @@ public static class GetIotHub { /// /// Use this data source to access information about an existing IoTHub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetIotHub.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getIotHubResult => getIotHubResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetIotHubArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:iot/getIotHub:getIotHub", args ?? new GetIotHubArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing IoTHub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetIotHub.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getIotHubResult => getIotHubResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetIotHubInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:iot/getIotHub:getIotHub", args ?? new GetIotHubInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Iot/GetSharedAccessPolicy.cs b/sdk/dotnet/Iot/GetSharedAccessPolicy.cs index 1b1ea86859..a7ed10f27e 100644 --- a/sdk/dotnet/Iot/GetSharedAccessPolicy.cs +++ b/sdk/dotnet/Iot/GetSharedAccessPolicy.cs @@ -13,12 +13,60 @@ public static class GetSharedAccessPolicy { /// /// Use this data source to access information about an existing IotHub Shared Access Policy + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetSharedAccessPolicy.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// IothubName = azurerm_iothub.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSharedAccessPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:iot/getSharedAccessPolicy:getSharedAccessPolicy", args ?? new GetSharedAccessPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing IotHub Shared Access Policy + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Iot.GetSharedAccessPolicy.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// IothubName = azurerm_iothub.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSharedAccessPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:iot/getSharedAccessPolicy:getSharedAccessPolicy", args ?? new GetSharedAccessPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Iot/IoTHub.cs b/sdk/dotnet/Iot/IoTHub.cs index b8d991224f..00934df539 100644 --- a/sdk/dotnet/Iot/IoTHub.cs +++ b/sdk/dotnet/Iot/IoTHub.cs @@ -22,6 +22,149 @@ namespace Pulumi.Azure.Iot /// /// > **NOTE:** File upload can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Basic", + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// NamespaceName = exampleEventHubNamespace.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// Send = true, + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LocalAuthenticationEnabled = false, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// Endpoints = new[] + /// { + /// new Azure.Iot.Inputs.IoTHubEndpointArgs + /// { + /// Type = "AzureIotHub.StorageContainer", + /// ConnectionString = exampleAccount.PrimaryBlobConnectionString, + /// Name = "export", + /// BatchFrequencyInSeconds = 60, + /// MaxChunkSizeInBytes = 10485760, + /// ContainerName = exampleContainer.Name, + /// Encoding = "Avro", + /// FileNameFormat = "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + /// }, + /// new Azure.Iot.Inputs.IoTHubEndpointArgs + /// { + /// Type = "AzureIotHub.EventHub", + /// ConnectionString = exampleAuthorizationRule.PrimaryConnectionString, + /// Name = "export2", + /// }, + /// }, + /// Routes = new[] + /// { + /// new Azure.Iot.Inputs.IoTHubRouteArgs + /// { + /// Name = "export", + /// Source = "DeviceMessages", + /// Condition = "true", + /// EndpointNames = new[] + /// { + /// "export", + /// }, + /// Enabled = true, + /// }, + /// new Azure.Iot.Inputs.IoTHubRouteArgs + /// { + /// Name = "export2", + /// Source = "DeviceMessages", + /// Condition = "true", + /// EndpointNames = new[] + /// { + /// "export2", + /// }, + /// Enabled = true, + /// }, + /// }, + /// Enrichments = new[] + /// { + /// new Azure.Iot.Inputs.IoTHubEnrichmentArgs + /// { + /// Key = "tenant", + /// Value = "$twin.tags.Tenant", + /// EndpointNames = new[] + /// { + /// "export", + /// "export2", + /// }, + /// }, + /// }, + /// CloudToDevice = new Azure.Iot.Inputs.IoTHubCloudToDeviceArgs + /// { + /// MaxDeliveryCount = 30, + /// DefaultTtl = "PT1H", + /// Feedbacks = new[] + /// { + /// new Azure.Iot.Inputs.IoTHubCloudToDeviceFeedbackArgs + /// { + /// TimeToLive = "PT1H10M", + /// MaxDeliveryCount = 15, + /// LockDuration = "PT30S", + /// }, + /// }, + /// }, + /// Tags = + /// { + /// { "purpose", "testing" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHubs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/IotHubCertificate.cs b/sdk/dotnet/Iot/IotHubCertificate.cs index b2f804a450..6f81d6f8a8 100644 --- a/sdk/dotnet/Iot/IotHubCertificate.cs +++ b/sdk/dotnet/Iot/IotHubCertificate.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.Iot /// /// Manages an IotHub Device Provisioning Service Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIotHubDps = new Azure.Iot.IotHubDps("exampleIotHubDps", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IotHubDpsSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleIotHubCertificate = new Azure.Iot.IotHubCertificate("exampleIotHubCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IotDpsName = exampleIotHubDps.Name, + /// CertificateContent = ReadFileBase64("example.cer"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub Device Provisioning Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/IotHubDeviceUpdateAccount.cs b/sdk/dotnet/Iot/IotHubDeviceUpdateAccount.cs index b4cc059cd6..20d9afc90b 100644 --- a/sdk/dotnet/Iot/IotHubDeviceUpdateAccount.cs +++ b/sdk/dotnet/Iot/IotHubDeviceUpdateAccount.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Iot /// /// Manages an IoT Hub Device Update Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleIotHubDeviceUpdateAccount = new Azure.Iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.Iot.Inputs.IotHubDeviceUpdateAccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoT Hub Device Update Account can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/IotHubDeviceUpdateInstance.cs b/sdk/dotnet/Iot/IotHubDeviceUpdateInstance.cs index 2f79d3171c..8e67e90ec9 100644 --- a/sdk/dotnet/Iot/IotHubDeviceUpdateInstance.cs +++ b/sdk/dotnet/Iot/IotHubDeviceUpdateInstance.cs @@ -12,6 +12,65 @@ namespace Pulumi.Azure.Iot /// /// Manages an IoT Hub Device Update Instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleIotHubDeviceUpdateAccount = new Azure.Iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleIotHubDeviceUpdateInstance = new Azure.Iot.IotHubDeviceUpdateInstance("exampleIotHubDeviceUpdateInstance", new() + /// { + /// DeviceUpdateAccountId = exampleIotHubDeviceUpdateAccount.Id, + /// IothubId = exampleIoTHub.Id, + /// DiagnosticEnabled = true, + /// DiagnosticStorageAccount = new Azure.Iot.Inputs.IotHubDeviceUpdateInstanceDiagnosticStorageAccountArgs + /// { + /// ConnectionString = exampleAccount.PrimaryConnectionString, + /// Id = exampleAccount.Id, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoT Hub Device Update Instance can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/IotHubDps.cs b/sdk/dotnet/Iot/IotHubDps.cs index ddba985391..0e0d04daf9 100644 --- a/sdk/dotnet/Iot/IotHubDps.cs +++ b/sdk/dotnet/Iot/IotHubDps.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.Iot /// /// Manages an IotHub Device Provisioning Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIotHubDps = new Azure.Iot.IotHubDps("exampleIotHubDps", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllocationPolicy = "Hashed", + /// Sku = new Azure.Iot.Inputs.IotHubDpsSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoT Device Provisioning Service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/SecurityDeviceGroup.cs b/sdk/dotnet/Iot/SecurityDeviceGroup.cs index 3cb1251ebc..2f194201ad 100644 --- a/sdk/dotnet/Iot/SecurityDeviceGroup.cs +++ b/sdk/dotnet/Iot/SecurityDeviceGroup.cs @@ -12,6 +12,74 @@ namespace Pulumi.Azure.Iot /// /// Manages a Iot Security Device Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleSecuritySolution = new Azure.Iot.SecuritySolution("exampleSecuritySolution", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DisplayName = "Iot Security Solution", + /// IothubIds = new[] + /// { + /// exampleIoTHub.Id, + /// }, + /// }); + /// + /// var exampleSecurityDeviceGroup = new Azure.Iot.SecurityDeviceGroup("exampleSecurityDeviceGroup", new() + /// { + /// IothubId = exampleIoTHub.Id, + /// AllowRule = new Azure.Iot.Inputs.SecurityDeviceGroupAllowRuleArgs + /// { + /// ConnectionToIpsNotAlloweds = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// }, + /// RangeRules = new[] + /// { + /// new Azure.Iot.Inputs.SecurityDeviceGroupRangeRuleArgs + /// { + /// Type = "ActiveConnectionsNotInAllowedRange", + /// Min = 0, + /// Max = 30, + /// Duration = "PT5M", + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleSecuritySolution, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Iot Security Device Group can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/SecuritySolution.cs b/sdk/dotnet/Iot/SecuritySolution.cs index d778d10a7a..886f3d42ab 100644 --- a/sdk/dotnet/Iot/SecuritySolution.cs +++ b/sdk/dotnet/Iot/SecuritySolution.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Iot /// /// Manages an iot security solution. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleSecuritySolution = new Azure.Iot.SecuritySolution("exampleSecuritySolution", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DisplayName = "Iot Security Solution", + /// IothubIds = new[] + /// { + /// exampleIoTHub.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Iot Security Solution can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/SharedAccessPolicy.cs b/sdk/dotnet/Iot/SharedAccessPolicy.cs index fe8e589ea4..8acdcd1fbc 100644 --- a/sdk/dotnet/Iot/SharedAccessPolicy.cs +++ b/sdk/dotnet/Iot/SharedAccessPolicy.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Iot /// /// Manages an IotHub Shared Access Policy /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleSharedAccessPolicy = new Azure.Iot.SharedAccessPolicy("exampleSharedAccessPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubName = exampleIoTHub.Name, + /// RegistryRead = true, + /// RegistryWrite = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoTHub Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/TimeSeriesInsightsAccessPolicy.cs b/sdk/dotnet/Iot/TimeSeriesInsightsAccessPolicy.cs index c224984479..d2cafa882e 100644 --- a/sdk/dotnet/Iot/TimeSeriesInsightsAccessPolicy.cs +++ b/sdk/dotnet/Iot/TimeSeriesInsightsAccessPolicy.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Iot /// /// Manages an Azure IoT Time Series Insights Access Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTimeSeriesInsightsStandardEnvironment = new Azure.Iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "S1_1", + /// DataRetentionTime = "P30D", + /// }); + /// + /// var exampleTimeSeriesInsightsAccessPolicy = new Azure.Iot.TimeSeriesInsightsAccessPolicy("exampleTimeSeriesInsightsAccessPolicy", new() + /// { + /// TimeSeriesInsightsEnvironmentId = exampleTimeSeriesInsightsStandardEnvironment.Name, + /// PrincipalObjectId = "aGUID", + /// Roles = new[] + /// { + /// "Reader", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure IoT Time Series Insights Access Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceEventhub.cs b/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceEventhub.cs index 9a2cfbea83..314dd0d67c 100644 --- a/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceEventhub.cs +++ b/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceEventhub.cs @@ -12,6 +12,92 @@ namespace Pulumi.Azure.Iot /// /// Manages an Azure IoT Time Series Insights EventHub Event Source. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 7, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Listen = true, + /// Send = false, + /// Manage = false, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleTimeSeriesInsightsGen2Environment = new Azure.Iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "L1", + /// IdProperties = new[] + /// { + /// "id", + /// }, + /// Storage = new Azure.Iot.Inputs.TimeSeriesInsightsGen2EnvironmentStorageArgs + /// { + /// Name = exampleAccount.Name, + /// Key = exampleAccount.PrimaryAccessKey, + /// }, + /// }); + /// + /// var exampleTimeSeriesInsightsEventSourceEventhub = new Azure.Iot.TimeSeriesInsightsEventSourceEventhub("exampleTimeSeriesInsightsEventSourceEventhub", new() + /// { + /// Location = exampleResourceGroup.Location, + /// EnvironmentId = exampleTimeSeriesInsightsGen2Environment.Id, + /// EventhubName = exampleEventHub.Name, + /// NamespaceName = exampleEventHubNamespace.Name, + /// SharedAccessKey = exampleAuthorizationRule.PrimaryKey, + /// SharedAccessKeyName = exampleAuthorizationRule.Name, + /// ConsumerGroupName = exampleConsumerGroup.Name, + /// EventSourceResourceId = exampleEventHub.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure IoT Time Series Insights EventHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceIothub.cs b/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceIothub.cs index 85b95aabfc..d201524e25 100644 --- a/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceIothub.cs +++ b/sdk/dotnet/Iot/TimeSeriesInsightsEventSourceIothub.cs @@ -12,6 +12,77 @@ namespace Pulumi.Azure.Iot /// /// Manages an Azure IoT Time Series Insights IoTHub Event Source. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "B1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleConsumerGroup = new Azure.Iot.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// IothubName = exampleIoTHub.Name, + /// EventhubEndpointName = "events", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var storage = new Azure.Storage.Account("storage", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleTimeSeriesInsightsGen2Environment = new Azure.Iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "L1", + /// IdProperties = new[] + /// { + /// "id", + /// }, + /// Storage = new Azure.Iot.Inputs.TimeSeriesInsightsGen2EnvironmentStorageArgs + /// { + /// Name = storage.Name, + /// Key = storage.PrimaryAccessKey, + /// }, + /// }); + /// + /// var exampleTimeSeriesInsightsEventSourceIothub = new Azure.Iot.TimeSeriesInsightsEventSourceIothub("exampleTimeSeriesInsightsEventSourceIothub", new() + /// { + /// Location = exampleResourceGroup.Location, + /// EnvironmentId = exampleTimeSeriesInsightsGen2Environment.Id, + /// IothubName = exampleIoTHub.Name, + /// SharedAccessKey = exampleIoTHub.SharedAccessPolicies.Apply(sharedAccessPolicies => sharedAccessPolicies[0].PrimaryKey), + /// SharedAccessKeyName = exampleIoTHub.SharedAccessPolicies.Apply(sharedAccessPolicies => sharedAccessPolicies[0].KeyName), + /// ConsumerGroupName = exampleConsumerGroup.Name, + /// EventSourceResourceId = exampleIoTHub.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure IoT Time Series Insights IoTHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/TimeSeriesInsightsGen2Environment.cs b/sdk/dotnet/Iot/TimeSeriesInsightsGen2Environment.cs index 7fe246d3b6..d7183e343c 100644 --- a/sdk/dotnet/Iot/TimeSeriesInsightsGen2Environment.cs +++ b/sdk/dotnet/Iot/TimeSeriesInsightsGen2Environment.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Iot /// /// Manages an Azure IoT Time Series Insights Gen2 Environment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var storage = new Azure.Storage.Account("storage", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleTimeSeriesInsightsGen2Environment = new Azure.Iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "L1", + /// WarmStoreDataRetentionTime = "P30D", + /// IdProperties = new[] + /// { + /// "id", + /// }, + /// Storage = new Azure.Iot.Inputs.TimeSeriesInsightsGen2EnvironmentStorageArgs + /// { + /// Name = storage.Name, + /// Key = storage.PrimaryAccessKey, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure IoT Time Series Insights Gen2 Environment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/TimeSeriesInsightsReferenceDataSet.cs b/sdk/dotnet/Iot/TimeSeriesInsightsReferenceDataSet.cs index ac065b01f4..9ebac45a79 100644 --- a/sdk/dotnet/Iot/TimeSeriesInsightsReferenceDataSet.cs +++ b/sdk/dotnet/Iot/TimeSeriesInsightsReferenceDataSet.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Iot /// /// Manages an Azure IoT Time Series Insights Reference Data Set. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTimeSeriesInsightsStandardEnvironment = new Azure.Iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "S1_1", + /// DataRetentionTime = "P30D", + /// }); + /// + /// var exampleTimeSeriesInsightsReferenceDataSet = new Azure.Iot.TimeSeriesInsightsReferenceDataSet("exampleTimeSeriesInsightsReferenceDataSet", new() + /// { + /// TimeSeriesInsightsEnvironmentId = exampleTimeSeriesInsightsStandardEnvironment.Id, + /// Location = exampleResourceGroup.Location, + /// KeyProperties = new[] + /// { + /// new Azure.Iot.Inputs.TimeSeriesInsightsReferenceDataSetKeyPropertyArgs + /// { + /// Name = "keyProperty1", + /// Type = "String", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure IoT Time Series Insights Reference Data Set can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Iot/TimeSeriesInsightsStandardEnvironment.cs b/sdk/dotnet/Iot/TimeSeriesInsightsStandardEnvironment.cs index ec013d64b2..2546f8b9d2 100644 --- a/sdk/dotnet/Iot/TimeSeriesInsightsStandardEnvironment.cs +++ b/sdk/dotnet/Iot/TimeSeriesInsightsStandardEnvironment.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.Iot /// /// Manages an Azure IoT Time Series Insights Standard Environment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTimeSeriesInsightsStandardEnvironment = new Azure.Iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "S1_1", + /// DataRetentionTime = "P30D", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure IoT Time Series Insights Standard Environment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/IotCentral/Application.cs b/sdk/dotnet/IotCentral/Application.cs index 60b8c6654d..a9afad40ff 100644 --- a/sdk/dotnet/IotCentral/Application.cs +++ b/sdk/dotnet/IotCentral/Application.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.IotCentral /// /// Manages an IoT Central Application /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleApplication = new Azure.IotCentral.Application("exampleApplication", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubDomain = "example-iotcentral-app-subdomain", + /// DisplayName = "example-iotcentral-app-display-name", + /// Sku = "ST1", + /// Template = "iotc-default@1.0.0", + /// Tags = + /// { + /// { "Foo", "Bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The IoT Central Application can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/IotCentral/ApplicationNetworkRuleSet.cs b/sdk/dotnet/IotCentral/ApplicationNetworkRuleSet.cs index 9230b376ec..d801b656c5 100644 --- a/sdk/dotnet/IotCentral/ApplicationNetworkRuleSet.cs +++ b/sdk/dotnet/IotCentral/ApplicationNetworkRuleSet.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.IotCentral /// /// Manages an IoT Central Application Network Rule Set. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleApplication = new Azure.IotCentral.Application("exampleApplication", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubDomain = "example-iotcentral-app-subdomain", + /// DisplayName = "example-iotcentral-app-display-name", + /// Sku = "ST1", + /// Tags = + /// { + /// { "Foo", "Bar" }, + /// }, + /// }); + /// + /// var exampleApplicationNetworkRuleSet = new Azure.IotCentral.ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet", new() + /// { + /// IotcentralApplicationId = exampleApplication.Id, + /// IpRules = new[] + /// { + /// new Azure.IotCentral.Inputs.ApplicationNetworkRuleSetIpRuleArgs + /// { + /// Name = "rule1", + /// IpMask = "10.0.1.0/24", + /// }, + /// new Azure.IotCentral.Inputs.ApplicationNetworkRuleSetIpRuleArgs + /// { + /// Name = "rule2", + /// IpMask = "10.1.1.0/24", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IoT Central Application Network Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/KeyVault/AccessPolicy.cs b/sdk/dotnet/KeyVault/AccessPolicy.cs index e597275ffb..fc8d95d819 100644 --- a/sdk/dotnet/KeyVault/AccessPolicy.cs +++ b/sdk/dotnet/KeyVault/AccessPolicy.cs @@ -16,6 +16,69 @@ namespace Pulumi.Azure.KeyVault /// /// > **NOTE:** Azure permits a maximum of 1024 Access Policies per Key Vault - [more information can be found in this document](https://docs.microsoft.com/azure/key-vault/key-vault-secure-your-key-vault#data-plane-access-control). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// }); + /// + /// var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("exampleAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "example-app", + /// }); + /// + /// var example_principal = new Azure.KeyVault.AccessPolicy("example-principal", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "List", + /// "Encrypt", + /// "Decrypt", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Key Vault Access Policies can be imported using the Resource ID of the Key Vault, plus some additional metadata. If both an `object_id` and `application_id` are specified, then the Access Policy can be imported using the following code diff --git a/sdk/dotnet/KeyVault/Certifiate.cs b/sdk/dotnet/KeyVault/Certifiate.cs index 145189b603..b84804f1f0 100644 --- a/sdk/dotnet/KeyVault/Certifiate.cs +++ b/sdk/dotnet/KeyVault/Certifiate.cs @@ -18,6 +18,249 @@ namespace Pulumi.Azure.KeyVault /// ======= /// > > > > > > > 8d78c87098 (Update-documentation) /// ## Example Usage + /// ### Importing A PFX) + /// + /// > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "DeleteIssuers", + /// "Get", + /// "GetIssuers", + /// "Import", + /// "List", + /// "ListIssuers", + /// "ManageContacts", + /// "ManageIssuers", + /// "SetIssuers", + /// "Update", + /// }, + /// KeyPermissions = new[] + /// { + /// "Backup", + /// "Create", + /// "Decrypt", + /// "Delete", + /// "Encrypt", + /// "Get", + /// "Import", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Sign", + /// "UnwrapKey", + /// "Update", + /// "Verify", + /// "WrapKey", + /// }, + /// SecretPermissions = new[] + /// { + /// "Backup", + /// "Delete", + /// "Get", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Set", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs + /// { + /// Contents = ReadFileBase64("certificate-to-import.pfx"), + /// Password = "", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Generating a new certificate + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "DeleteIssuers", + /// "Get", + /// "GetIssuers", + /// "Import", + /// "List", + /// "ListIssuers", + /// "ManageContacts", + /// "ManageIssuers", + /// "Purge", + /// "SetIssuers", + /// "Update", + /// }, + /// KeyPermissions = new[] + /// { + /// "Backup", + /// "Create", + /// "Decrypt", + /// "Delete", + /// "Encrypt", + /// "Get", + /// "Import", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Sign", + /// "UnwrapKey", + /// "Update", + /// "Verify", + /// "WrapKey", + /// }, + /// SecretPermissions = new[] + /// { + /// "Backup", + /// "Delete", + /// "Get", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Set", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// CertificatePolicy = new Azure.KeyVault.Inputs.CertificateCertificatePolicyArgs + /// { + /// IssuerParameters = new Azure.KeyVault.Inputs.CertificateCertificatePolicyIssuerParametersArgs + /// { + /// Name = "Self", + /// }, + /// KeyProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyKeyPropertiesArgs + /// { + /// Exportable = true, + /// KeySize = 2048, + /// KeyType = "RSA", + /// ReuseKey = true, + /// }, + /// LifetimeActions = new[] + /// { + /// new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionArgs + /// { + /// Action = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionActionArgs + /// { + /// ActionType = "AutoRenew", + /// }, + /// Trigger = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionTriggerArgs + /// { + /// DaysBeforeExpiry = 30, + /// }, + /// }, + /// }, + /// SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs + /// { + /// ContentType = "application/x-pkcs12", + /// }, + /// X509CertificateProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesArgs + /// { + /// ExtendedKeyUsages = new[] + /// { + /// "1.3.6.1.5.5.7.3.1", + /// }, + /// KeyUsages = new[] + /// { + /// "cRLSign", + /// "dataEncipherment", + /// "digitalSignature", + /// "keyAgreement", + /// "keyCertSign", + /// "keyEncipherment", + /// }, + /// SubjectAlternativeNames = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs + /// { + /// DnsNames = new[] + /// { + /// "internal.contoso.com", + /// "domain.hello.world", + /// }, + /// }, + /// Subject = "CN=hello-world", + /// ValidityInMonths = 12, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/KeyVault/Certificate.cs b/sdk/dotnet/KeyVault/Certificate.cs index 799df5dfc8..17523fc962 100644 --- a/sdk/dotnet/KeyVault/Certificate.cs +++ b/sdk/dotnet/KeyVault/Certificate.cs @@ -18,6 +18,249 @@ namespace Pulumi.Azure.KeyVault /// ======= /// > > > > > > > 8d78c87098 (Update-documentation) /// ## Example Usage + /// ### Importing A PFX) + /// + /// > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "DeleteIssuers", + /// "Get", + /// "GetIssuers", + /// "Import", + /// "List", + /// "ListIssuers", + /// "ManageContacts", + /// "ManageIssuers", + /// "SetIssuers", + /// "Update", + /// }, + /// KeyPermissions = new[] + /// { + /// "Backup", + /// "Create", + /// "Decrypt", + /// "Delete", + /// "Encrypt", + /// "Get", + /// "Import", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Sign", + /// "UnwrapKey", + /// "Update", + /// "Verify", + /// "WrapKey", + /// }, + /// SecretPermissions = new[] + /// { + /// "Backup", + /// "Delete", + /// "Get", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Set", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs + /// { + /// Contents = ReadFileBase64("certificate-to-import.pfx"), + /// Password = "", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Generating a new certificate + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "DeleteIssuers", + /// "Get", + /// "GetIssuers", + /// "Import", + /// "List", + /// "ListIssuers", + /// "ManageContacts", + /// "ManageIssuers", + /// "Purge", + /// "SetIssuers", + /// "Update", + /// }, + /// KeyPermissions = new[] + /// { + /// "Backup", + /// "Create", + /// "Decrypt", + /// "Delete", + /// "Encrypt", + /// "Get", + /// "Import", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Sign", + /// "UnwrapKey", + /// "Update", + /// "Verify", + /// "WrapKey", + /// }, + /// SecretPermissions = new[] + /// { + /// "Backup", + /// "Delete", + /// "Get", + /// "List", + /// "Purge", + /// "Recover", + /// "Restore", + /// "Set", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// CertificatePolicy = new Azure.KeyVault.Inputs.CertificateCertificatePolicyArgs + /// { + /// IssuerParameters = new Azure.KeyVault.Inputs.CertificateCertificatePolicyIssuerParametersArgs + /// { + /// Name = "Self", + /// }, + /// KeyProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyKeyPropertiesArgs + /// { + /// Exportable = true, + /// KeySize = 2048, + /// KeyType = "RSA", + /// ReuseKey = true, + /// }, + /// LifetimeActions = new[] + /// { + /// new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionArgs + /// { + /// Action = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionActionArgs + /// { + /// ActionType = "AutoRenew", + /// }, + /// Trigger = new Azure.KeyVault.Inputs.CertificateCertificatePolicyLifetimeActionTriggerArgs + /// { + /// DaysBeforeExpiry = 30, + /// }, + /// }, + /// }, + /// SecretProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicySecretPropertiesArgs + /// { + /// ContentType = "application/x-pkcs12", + /// }, + /// X509CertificateProperties = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesArgs + /// { + /// ExtendedKeyUsages = new[] + /// { + /// "1.3.6.1.5.5.7.3.1", + /// }, + /// KeyUsages = new[] + /// { + /// "cRLSign", + /// "dataEncipherment", + /// "digitalSignature", + /// "keyAgreement", + /// "keyCertSign", + /// "keyEncipherment", + /// }, + /// SubjectAlternativeNames = new Azure.KeyVault.Inputs.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs + /// { + /// DnsNames = new[] + /// { + /// "internal.contoso.com", + /// "domain.hello.world", + /// }, + /// }, + /// Subject = "CN=hello-world", + /// ValidityInMonths = 12, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/KeyVault/CertificateContacts.cs b/sdk/dotnet/KeyVault/CertificateContacts.cs index 65a94366c0..8320d11d05 100644 --- a/sdk/dotnet/KeyVault/CertificateContacts.cs +++ b/sdk/dotnet/KeyVault/CertificateContacts.cs @@ -16,6 +16,77 @@ namespace Pulumi.Azure.KeyVault /// /// > **Note:** It's possible to define Key Vault Certificate Contacts both within the `azure.keyvault.KeyVault` resource via the `contact` block and by using the `azure.keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// }); + /// + /// var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("exampleAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "ManageContacts", + /// }, + /// KeyPermissions = new[] + /// { + /// "Create", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// }, + /// }); + /// + /// var exampleCertificateContacts = new Azure.KeyVault.CertificateContacts("exampleCertificateContacts", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// Contacts = new[] + /// { + /// new Azure.KeyVault.Inputs.CertificateContactsContactArgs + /// { + /// Email = "example@example.com", + /// Name = "example", + /// Phone = "01234567890", + /// }, + /// new Azure.KeyVault.Inputs.CertificateContactsContactArgs + /// { + /// Email = "example2@example.com", + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAccessPolicy, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Key Vault Certificate Contacts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/KeyVault/CertificateIssuer.cs b/sdk/dotnet/KeyVault/CertificateIssuer.cs index 38988b33f7..47b7e93f8c 100644 --- a/sdk/dotnet/KeyVault/CertificateIssuer.cs +++ b/sdk/dotnet/KeyVault/CertificateIssuer.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.KeyVault /// /// Manages a Key Vault Certificate Issuer. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "standard", + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }); + /// + /// var exampleCertificateIssuer = new Azure.KeyVault.CertificateIssuer("exampleCertificateIssuer", new() + /// { + /// OrgId = "ExampleOrgName", + /// KeyVaultId = exampleKeyVault.Id, + /// ProviderName = "DigiCert", + /// AccountId = "0000", + /// Password = "example-password", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Key Vault Certificate Issuers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/KeyVault/GetAccessPolicy.cs b/sdk/dotnet/KeyVault/GetAccessPolicy.cs index 2558ad283b..2fba060676 100644 --- a/sdk/dotnet/KeyVault/GetAccessPolicy.cs +++ b/sdk/dotnet/KeyVault/GetAccessPolicy.cs @@ -13,12 +13,64 @@ public static class GetAccessPolicy { /// /// Use this data source to access information about the permissions from the Management Key Vault Templates. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var contributor = Azure.KeyVault.GetAccessPolicy.Invoke(new() + /// { + /// Name = "Key Management", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accessPolicyKeyPermissions"] = contributor.Apply(getAccessPolicyResult => getAccessPolicyResult.KeyPermissions), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccessPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getAccessPolicy:getAccessPolicy", args ?? new GetAccessPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about the permissions from the Management Key Vault Templates. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var contributor = Azure.KeyVault.GetAccessPolicy.Invoke(new() + /// { + /// Name = "Key Management", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accessPolicyKeyPermissions"] = contributor.Apply(getAccessPolicyResult => getAccessPolicyResult.KeyPermissions), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccessPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getAccessPolicy:getAccessPolicy", args ?? new GetAccessPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/GetCertificate.cs b/sdk/dotnet/KeyVault/GetCertificate.cs index 9137c22f9f..eb455f8b96 100644 --- a/sdk/dotnet/KeyVault/GetCertificate.cs +++ b/sdk/dotnet/KeyVault/GetCertificate.cs @@ -13,12 +13,78 @@ public static class GetCertificate { /// /// Use this data source to access information about an existing Key Vault Certificate. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "examplekv", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleCertificate = Azure.KeyVault.GetCertificate.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["certificateThumbprint"] = exampleCertificate.Apply(getCertificateResult => getCertificateResult.Thumbprint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCertificateArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getCertificate:getCertificate", args ?? new GetCertificateArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Key Vault Certificate. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "examplekv", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleCertificate = Azure.KeyVault.GetCertificate.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["certificateThumbprint"] = exampleCertificate.Apply(getCertificateResult => getCertificateResult.Thumbprint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCertificateInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getCertificate:getCertificate", args ?? new GetCertificateInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/GetCertificateData.cs b/sdk/dotnet/KeyVault/GetCertificateData.cs index c4822f1ac3..eafbe56489 100644 --- a/sdk/dotnet/KeyVault/GetCertificateData.cs +++ b/sdk/dotnet/KeyVault/GetCertificateData.cs @@ -15,6 +15,39 @@ public static class GetCertificateData /// Use this data source to access data stored in an existing Key Vault Certificate. /// /// > **Note:** This data source uses the `GetSecret` function of the Azure API, to get the key of the certificate. Therefore you need secret/get permission + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "examplekv", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleCertificateData = Azure.KeyVault.GetCertificateData.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["examplePem"] = exampleCertificateData.Apply(getCertificateDataResult => getCertificateDataResult.Pem), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCertificateDataArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getCertificateData:getCertificateData", args ?? new GetCertificateDataArgs(), options.WithDefaults()); @@ -23,6 +56,39 @@ public static Task InvokeAsync(GetCertificateDataArgs /// Use this data source to access data stored in an existing Key Vault Certificate. /// /// > **Note:** This data source uses the `GetSecret` function of the Azure API, to get the key of the certificate. Therefore you need secret/get permission + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "examplekv", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleCertificateData = Azure.KeyVault.GetCertificateData.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["examplePem"] = exampleCertificateData.Apply(getCertificateDataResult => getCertificateDataResult.Pem), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCertificateDataInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getCertificateData:getCertificateData", args ?? new GetCertificateDataInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/GetCertificateIssuer.cs b/sdk/dotnet/KeyVault/GetCertificateIssuer.cs index 002e130b6c..7ca87e1580 100644 --- a/sdk/dotnet/KeyVault/GetCertificateIssuer.cs +++ b/sdk/dotnet/KeyVault/GetCertificateIssuer.cs @@ -13,12 +13,78 @@ public static class GetCertificateIssuer { /// /// Use this data source to access information about an existing Key Vault Certificate Issuer. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "mykeyvault", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleCertificateIssuer = Azure.KeyVault.GetCertificateIssuer.Invoke(new() + /// { + /// Name = "existing", + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleCertificateIssuer.Apply(getCertificateIssuerResult => getCertificateIssuerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCertificateIssuerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getCertificateIssuer:getCertificateIssuer", args ?? new GetCertificateIssuerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Key Vault Certificate Issuer. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "mykeyvault", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleCertificateIssuer = Azure.KeyVault.GetCertificateIssuer.Invoke(new() + /// { + /// Name = "existing", + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleCertificateIssuer.Apply(getCertificateIssuerResult => getCertificateIssuerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCertificateIssuerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getCertificateIssuer:getCertificateIssuer", args ?? new GetCertificateIssuerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/GetKey.cs b/sdk/dotnet/KeyVault/GetKey.cs index cd221f9b8f..c25503aec6 100644 --- a/sdk/dotnet/KeyVault/GetKey.cs +++ b/sdk/dotnet/KeyVault/GetKey.cs @@ -13,12 +13,66 @@ public static class GetKey { /// /// Use this data source to access information about an existing Key Vault Key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetKey.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = data.Azurerm_key_vault.Existing.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["keyType"] = example.Apply(getKeyResult => getKeyResult.KeyType), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetKeyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getKey:getKey", args ?? new GetKeyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Key Vault Key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetKey.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = data.Azurerm_key_vault.Existing.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["keyType"] = example.Apply(getKeyResult => getKeyResult.KeyType), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetKeyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getKey:getKey", args ?? new GetKeyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/GetKeyVault.cs b/sdk/dotnet/KeyVault/GetKeyVault.cs index c843fcbd44..bde199ad7a 100644 --- a/sdk/dotnet/KeyVault/GetKeyVault.cs +++ b/sdk/dotnet/KeyVault/GetKeyVault.cs @@ -13,12 +13,66 @@ public static class GetKeyVault { /// /// Use this data source to access information about an existing Key Vault. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "mykeyvault", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["vaultUri"] = example.Apply(getKeyVaultResult => getKeyVaultResult.VaultUri), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetKeyVaultArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getKeyVault:getKeyVault", args ?? new GetKeyVaultArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Key Vault. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "mykeyvault", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["vaultUri"] = example.Apply(getKeyVaultResult => getKeyVaultResult.VaultUri), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetKeyVaultInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getKeyVault:getKeyVault", args ?? new GetKeyVaultInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/GetManagedHardwareSecurityModule.cs b/sdk/dotnet/KeyVault/GetManagedHardwareSecurityModule.cs index 6166a0ddf3..56f0dfef6b 100644 --- a/sdk/dotnet/KeyVault/GetManagedHardwareSecurityModule.cs +++ b/sdk/dotnet/KeyVault/GetManagedHardwareSecurityModule.cs @@ -13,12 +13,66 @@ public static class GetManagedHardwareSecurityModule { /// /// Use this data source to access information about an existing Key Vault Managed Hardware Security Module. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetManagedHardwareSecurityModule.Invoke(new() + /// { + /// Name = "mykeyvaultHsm", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["hsmUri"] = example.Apply(getManagedHardwareSecurityModuleResult => getManagedHardwareSecurityModuleResult.HsmUri), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetManagedHardwareSecurityModuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getManagedHardwareSecurityModule:getManagedHardwareSecurityModule", args ?? new GetManagedHardwareSecurityModuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Key Vault Managed Hardware Security Module. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetManagedHardwareSecurityModule.Invoke(new() + /// { + /// Name = "mykeyvaultHsm", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["hsmUri"] = example.Apply(getManagedHardwareSecurityModuleResult => getManagedHardwareSecurityModuleResult.HsmUri), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetManagedHardwareSecurityModuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getManagedHardwareSecurityModule:getManagedHardwareSecurityModule", args ?? new GetManagedHardwareSecurityModuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/GetSecret.cs b/sdk/dotnet/KeyVault/GetSecret.cs index 39baf30fe6..d4b0565e70 100644 --- a/sdk/dotnet/KeyVault/GetSecret.cs +++ b/sdk/dotnet/KeyVault/GetSecret.cs @@ -13,12 +13,66 @@ public static class GetSecret { /// /// Use this data source to access information about an existing Key Vault Secret. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetSecret.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = data.Azurerm_key_vault.Existing.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["secretValue"] = example.Apply(getSecretResult => getSecretResult.Value), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSecretArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:keyvault/getSecret:getSecret", args ?? new GetSecretArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Key Vault Secret. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.KeyVault.GetSecret.Invoke(new() + /// { + /// Name = "secret-sauce", + /// KeyVaultId = data.Azurerm_key_vault.Existing.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["secretValue"] = example.Apply(getSecretResult => getSecretResult.Value), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSecretInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:keyvault/getSecret:getSecret", args ?? new GetSecretInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateArgs.cs b/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateArgs.cs index 91cb930943..d58cbc4437 100644 --- a/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateArgs.cs +++ b/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateArgs.cs @@ -37,6 +37,15 @@ public Input? Contents /// > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. /// /// To convert a private key to pkcs8 format with openssl use: + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// /// The PEM content should look something like: /// diff --git a/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateGetArgs.cs b/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateGetArgs.cs index 129547764d..d971998dd0 100644 --- a/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateGetArgs.cs +++ b/sdk/dotnet/KeyVault/Inputs/CertifiateCertificateGetArgs.cs @@ -37,6 +37,15 @@ public Input? Contents /// > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. /// /// To convert a private key to pkcs8 format with openssl use: + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// /// The PEM content should look something like: /// diff --git a/sdk/dotnet/KeyVault/Inputs/CertificateCertificateArgs.cs b/sdk/dotnet/KeyVault/Inputs/CertificateCertificateArgs.cs index 011af879c7..2542e2c8f8 100644 --- a/sdk/dotnet/KeyVault/Inputs/CertificateCertificateArgs.cs +++ b/sdk/dotnet/KeyVault/Inputs/CertificateCertificateArgs.cs @@ -37,6 +37,15 @@ public Input? Contents /// > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. /// /// To convert a private key to pkcs8 format with openssl use: + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// /// The PEM content should look something like: /// diff --git a/sdk/dotnet/KeyVault/Inputs/CertificateCertificateGetArgs.cs b/sdk/dotnet/KeyVault/Inputs/CertificateCertificateGetArgs.cs index 7c30adf603..7b48592425 100644 --- a/sdk/dotnet/KeyVault/Inputs/CertificateCertificateGetArgs.cs +++ b/sdk/dotnet/KeyVault/Inputs/CertificateCertificateGetArgs.cs @@ -37,6 +37,15 @@ public Input? Contents /// > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. /// /// To convert a private key to pkcs8 format with openssl use: + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// /// The PEM content should look something like: /// diff --git a/sdk/dotnet/KeyVault/Key.cs b/sdk/dotnet/KeyVault/Key.cs index 1cf7a8bf86..395323aa85 100644 --- a/sdk/dotnet/KeyVault/Key.cs +++ b/sdk/dotnet/KeyVault/Key.cs @@ -17,6 +17,82 @@ namespace Pulumi.Azure.KeyVault /// > **Note:** To use this resource, your client should have RBAC roles with permissions like `Key Vault Crypto Officer` or `Key Vault Administrator` or an assigned Key Vault Access Policy with permissions `Create`,`Delete`,`Get`,`Purge`,`Recover`,`Update` and `GetRotationPolicy` for keys without Rotation Policy. Include `SetRotationPolicy` for keys with Rotation Policy. /// /// > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Key resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_keys_on_destroy` for more information. + /// ### Additional Examples + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "Get", + /// "Purge", + /// "Recover", + /// "Update", + /// "GetRotationPolicy", + /// "SetRotationPolicy", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// }, + /// }, + /// }, + /// }); + /// + /// var generated = new Azure.KeyVault.Key("generated", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// RotationPolicy = new Azure.KeyVault.Inputs.KeyRotationPolicyArgs + /// { + /// Automatic = new Azure.KeyVault.Inputs.KeyRotationPolicyAutomaticArgs + /// { + /// TimeBeforeExpiry = "P30D", + /// }, + /// ExpireAfter = "P90D", + /// NotifyBeforeExpiry = "P29D", + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/KeyVault/KeyVault.cs b/sdk/dotnet/KeyVault/KeyVault.cs index 7a5f306ffd..0a28984d61 100644 --- a/sdk/dotnet/KeyVault/KeyVault.cs +++ b/sdk/dotnet/KeyVault/KeyVault.cs @@ -18,6 +18,57 @@ namespace Pulumi.Azure.KeyVault /// /// > **Note:** It's possible to define Key Vault Certificate Contacts both within the `azure.keyvault.KeyVault` resource via the `contact` block and by using the `azure.keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// EnabledForDiskEncryption = true, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SoftDeleteRetentionDays = 7, + /// PurgeProtectionEnabled = false, + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// StoragePermissions = new[] + /// { + /// "Get", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Key Vault's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/KeyVault/ManagedHardwareSecurityModule.cs b/sdk/dotnet/KeyVault/ManagedHardwareSecurityModule.cs index 71c3847b00..69fc3f7443 100644 --- a/sdk/dotnet/KeyVault/ManagedHardwareSecurityModule.cs +++ b/sdk/dotnet/KeyVault/ManagedHardwareSecurityModule.cs @@ -14,6 +14,44 @@ namespace Pulumi.Azure.KeyVault /// /// > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Managed Hardware Security Module resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_hardware_security_modules_on_destroy` for more information. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleManagedHardwareSecurityModule = new Azure.KeyVault.ManagedHardwareSecurityModule("exampleManagedHardwareSecurityModule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "Standard_B1", + /// PurgeProtectionEnabled = false, + /// SoftDeleteRetentionDays = 90, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// AdminObjectIds = new[] + /// { + /// current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }, + /// Tags = + /// { + /// { "Env", "Test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Key Vault Managed Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/KeyVault/ManagedStorageAccount.cs b/sdk/dotnet/KeyVault/ManagedStorageAccount.cs index 0c216a3f1a..8798841e9b 100644 --- a/sdk/dotnet/KeyVault/ManagedStorageAccount.cs +++ b/sdk/dotnet/KeyVault/ManagedStorageAccount.cs @@ -12,6 +12,162 @@ namespace Pulumi.Azure.KeyVault /// /// Manages a Key Vault Managed Storage Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// "Delete", + /// }, + /// StoragePermissions = new[] + /// { + /// "Get", + /// "List", + /// "Set", + /// "SetSAS", + /// "GetSAS", + /// "DeleteSAS", + /// "Update", + /// "RegenerateKey", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleManagedStorageAccount = new Azure.KeyVault.ManagedStorageAccount("exampleManagedStorageAccount", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountKey = "key1", + /// RegenerateKeyAutomatically = false, + /// RegenerationPeriod = "P1D", + /// }); + /// + /// }); + /// ``` + /// ### Automatically Regenerate Storage Account Access Key) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var test = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// ApplicationId = "cfa8b339-82a2-471a-a3c9-0fc0be7a4093", + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// "Delete", + /// }, + /// StoragePermissions = new[] + /// { + /// "Get", + /// "List", + /// "Set", + /// "SetSAS", + /// "GetSAS", + /// "DeleteSAS", + /// "Update", + /// "RegenerateKey", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Storage Account Key Operator Service Role", + /// PrincipalId = test.Apply(getServicePrincipalResult => getServicePrincipalResult.Id), + /// }); + /// + /// var exampleManagedStorageAccount = new Azure.KeyVault.ManagedStorageAccount("exampleManagedStorageAccount", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountKey = "key1", + /// RegenerateKeyAutomatically = true, + /// RegenerationPeriod = "P1D", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Key Vault Managed Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/KeyVault/ManagedStorageAccountSasTokenDefinition.cs b/sdk/dotnet/KeyVault/ManagedStorageAccountSasTokenDefinition.cs index e10ad16ebd..adceec198f 100644 --- a/sdk/dotnet/KeyVault/ManagedStorageAccountSasTokenDefinition.cs +++ b/sdk/dotnet/KeyVault/ManagedStorageAccountSasTokenDefinition.cs @@ -12,6 +12,117 @@ namespace Pulumi.Azure.KeyVault /// /// Manages a Key Vault Managed Storage Account SAS Definition. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleAccountSAS = Azure.Storage.GetAccountSAS.Invoke(new() + /// { + /// ConnectionString = exampleAccount.PrimaryConnectionString, + /// HttpsOnly = true, + /// ResourceTypes = new Azure.Storage.Inputs.GetAccountSASResourceTypesInputArgs + /// { + /// Service = true, + /// Container = false, + /// Object = false, + /// }, + /// Services = new Azure.Storage.Inputs.GetAccountSASServicesInputArgs + /// { + /// Blob = true, + /// Queue = false, + /// Table = false, + /// File = false, + /// }, + /// Start = "2021-04-30T00:00:00Z", + /// Expiry = "2023-04-30T00:00:00Z", + /// Permissions = new Azure.Storage.Inputs.GetAccountSASPermissionsInputArgs + /// { + /// Read = true, + /// Write = true, + /// Delete = false, + /// List = false, + /// Add = true, + /// Create = true, + /// Update = false, + /// Process = false, + /// Tag = false, + /// Filter = false, + /// }, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// "Delete", + /// }, + /// StoragePermissions = new[] + /// { + /// "Get", + /// "List", + /// "Set", + /// "SetSAS", + /// "GetSAS", + /// "DeleteSAS", + /// "Update", + /// "RegenerateKey", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleManagedStorageAccount = new Azure.KeyVault.ManagedStorageAccount("exampleManagedStorageAccount", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountKey = "key1", + /// RegenerateKeyAutomatically = false, + /// RegenerationPeriod = "P1D", + /// }); + /// + /// var exampleManagedStorageAccountSasTokenDefinition = new Azure.KeyVault.ManagedStorageAccountSasTokenDefinition("exampleManagedStorageAccountSasTokenDefinition", new() + /// { + /// ValidityPeriod = "P1D", + /// ManagedStorageAccountId = exampleManagedStorageAccount.Id, + /// SasTemplateUri = exampleAccountSAS.Apply(getAccountSASResult => getAccountSASResult.Sas), + /// SasType = "account", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Key Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/KeyVault/Outputs/CertifiateCertificate.cs b/sdk/dotnet/KeyVault/Outputs/CertifiateCertificate.cs index bfb572d01f..628b33539a 100644 --- a/sdk/dotnet/KeyVault/Outputs/CertifiateCertificate.cs +++ b/sdk/dotnet/KeyVault/Outputs/CertifiateCertificate.cs @@ -23,6 +23,15 @@ public sealed class CertifiateCertificate /// > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. /// /// To convert a private key to pkcs8 format with openssl use: + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// /// The PEM content should look something like: /// diff --git a/sdk/dotnet/KeyVault/Outputs/CertificateCertificate.cs b/sdk/dotnet/KeyVault/Outputs/CertificateCertificate.cs index 414f98098e..fe7a203118 100644 --- a/sdk/dotnet/KeyVault/Outputs/CertificateCertificate.cs +++ b/sdk/dotnet/KeyVault/Outputs/CertificateCertificate.cs @@ -23,6 +23,15 @@ public sealed class CertificateCertificate /// > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. /// /// To convert a private key to pkcs8 format with openssl use: + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// /// The PEM content should look something like: /// diff --git a/sdk/dotnet/KeyVault/Secret.cs b/sdk/dotnet/KeyVault/Secret.cs index 14aabd5746..cb1554d127 100644 --- a/sdk/dotnet/KeyVault/Secret.cs +++ b/sdk/dotnet/KeyVault/Secret.cs @@ -20,6 +20,61 @@ namespace Pulumi.Azure.KeyVault /// /// ======= /// > > > > > > > 8d78c87098 (Update-documentation) + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// "Get", + /// "Delete", + /// "Purge", + /// "Recover", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleSecret = new Azure.KeyVault.Secret("exampleSecret", new() + /// { + /// Value = "szechuan", + /// KeyVaultId = exampleKeyVault.Id, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Kusto/AttachedDatabaseConfiguration.cs b/sdk/dotnet/Kusto/AttachedDatabaseConfiguration.cs index a92b62efe9..d27b833b00 100644 --- a/sdk/dotnet/Kusto/AttachedDatabaseConfiguration.cs +++ b/sdk/dotnet/Kusto/AttachedDatabaseConfiguration.cs @@ -12,6 +12,96 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto (also known as Azure Data Explorer) Attached Database Configuration /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var followerCluster = new Azure.Kusto.Cluster("followerCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// }); + /// + /// var followedCluster = new Azure.Kusto.Cluster("followedCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// }); + /// + /// var followedDatabase = new Azure.Kusto.Database("followedDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = followerCluster.Name, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = followerCluster.Name, + /// }); + /// + /// var exampleAttachedDatabaseConfiguration = new Azure.Kusto.AttachedDatabaseConfiguration("exampleAttachedDatabaseConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = followerCluster.Name, + /// ClusterResourceId = followedCluster.Id, + /// DatabaseName = exampleDatabase.Name, + /// Sharing = new Azure.Kusto.Inputs.AttachedDatabaseConfigurationSharingArgs + /// { + /// ExternalTablesToExcludes = new[] + /// { + /// "ExternalTable2", + /// }, + /// ExternalTablesToIncludes = new[] + /// { + /// "ExternalTable1", + /// }, + /// MaterializedViewsToExcludes = new[] + /// { + /// "MaterializedViewTable2", + /// }, + /// MaterializedViewsToIncludes = new[] + /// { + /// "MaterializedViewTable1", + /// }, + /// TablesToExcludes = new[] + /// { + /// "Table2", + /// }, + /// TablesToIncludes = new[] + /// { + /// "Table1", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto Attached Database Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/Cluster.cs b/sdk/dotnet/Kusto/Cluster.cs index 84cb6fe58c..082392eb46 100644 --- a/sdk/dotnet/Kusto/Cluster.cs +++ b/sdk/dotnet/Kusto/Cluster.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto (also known as Azure Data Explorer) Cluster /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/ClusterCustomerManagedKey.cs b/sdk/dotnet/Kusto/ClusterCustomerManagedKey.cs index ce9b4d68fd..351420c7a3 100644 --- a/sdk/dotnet/Kusto/ClusterCustomerManagedKey.cs +++ b/sdk/dotnet/Kusto/ClusterCustomerManagedKey.cs @@ -12,6 +12,110 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Customer Managed Key for a Kusto Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// Identity = new Azure.Kusto.Inputs.ClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var cluster = new Azure.KeyVault.AccessPolicy("cluster", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleCluster.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "UnwrapKey", + /// "WrapKey", + /// }, + /// }); + /// + /// var client = new Azure.KeyVault.AccessPolicy("client", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "List", + /// "Create", + /// "Delete", + /// "Recover", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// client, + /// cluster, + /// }, + /// }); + /// + /// var exampleClusterCustomerManagedKey = new Azure.Kusto.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", new() + /// { + /// ClusterId = exampleCluster.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// KeyName = exampleKey.Name, + /// KeyVersion = exampleKey.Version, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Customer Managed Keys for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/ClusterManagedPrivateEndpoint.cs b/sdk/dotnet/Kusto/ClusterManagedPrivateEndpoint.cs index b15c1a8fe2..2f61b74f60 100644 --- a/sdk/dotnet/Kusto/ClusterManagedPrivateEndpoint.cs +++ b/sdk/dotnet/Kusto/ClusterManagedPrivateEndpoint.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Managed Private Endpoint for a Kusto Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleClusterManagedPrivateEndpoint = new Azure.Kusto.ClusterManagedPrivateEndpoint("exampleClusterManagedPrivateEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClusterName = exampleCluster.Name, + /// PrivateLinkResourceId = exampleAccount.Id, + /// PrivateLinkResourceRegion = exampleAccount.Location, + /// GroupId = "blob", + /// RequestMessage = "Please Approve", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Managed Private Endpoint for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/ClusterPrincipalAssignment.cs b/sdk/dotnet/Kusto/ClusterPrincipalAssignment.cs index 46056f5088..b1683b18b3 100644 --- a/sdk/dotnet/Kusto/ClusterPrincipalAssignment.cs +++ b/sdk/dotnet/Kusto/ClusterPrincipalAssignment.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto Cluster Principal Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// }); + /// + /// var exampleClusterPrincipalAssignment = new Azure.Kusto.ClusterPrincipalAssignment("exampleClusterPrincipalAssignment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClusterName = exampleCluster.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// PrincipalType = "App", + /// Role = "AllDatabasesAdmin", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Explorer Cluster Principal Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/CosmosdbDataConnection.cs b/sdk/dotnet/Kusto/CosmosdbDataConnection.cs index 3883038aee..08d9b006bf 100644 --- a/sdk/dotnet/Kusto/CosmosdbDataConnection.cs +++ b/sdk/dotnet/Kusto/CosmosdbDataConnection.cs @@ -12,6 +12,139 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto / Cosmos Database Data Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var builtin = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// RoleDefinitionId = "fbdf93bf-df7d-467e-a4d2-9458aa1360c8", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// Identity = new Azure.Kusto.Inputs.ClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = exampleResourceGroup.Id, + /// RoleDefinitionName = builtin.Apply(getRoleDefinitionResult => getRoleDefinitionResult.Name), + /// PrincipalId = exampleCluster.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "Session", + /// MaxIntervalInSeconds = 5, + /// MaxStalenessPrefix = 100, + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "/part", + /// Throughput = 400, + /// }); + /// + /// var exampleSqlRoleDefinition = Azure.CosmosDB.GetSqlRoleDefinition.Invoke(new() + /// { + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000001", + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// }); + /// + /// var exampleSqlRoleAssignment = new Azure.CosmosDB.SqlRoleAssignment("exampleSqlRoleAssignment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// RoleDefinitionId = exampleSqlRoleDefinition.Apply(getSqlRoleDefinitionResult => getSqlRoleDefinitionResult.Id), + /// PrincipalId = exampleCluster.Identity.Apply(identity => identity?.PrincipalId), + /// Scope = exampleAccount.Id, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// }); + /// + /// var exampleScript = new Azure.Kusto.Script("exampleScript", new() + /// { + /// DatabaseId = exampleDatabase.Id, + /// ScriptContent = @".create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime) + /// .create table TestTable ingestion json mapping ""TestMapping"" + /// '[' + /// ' {""column"":""Id"",""path"":""$.id""},' + /// ' {""column"":""Name"",""path"":""$.name""},' + /// ' {""column"":""_ts"",""path"":""$._ts""},' + /// ' {""column"":""_timestamp"",""path"":""$._ts"", ""transform"":""DateTimeFromUnixSeconds""}' + /// ']' + /// .alter table TestTable policy ingestionbatching ""{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}"" + /// ", + /// }); + /// + /// var exampleCosmosdbDataConnection = new Azure.Kusto.CosmosdbDataConnection("exampleCosmosdbDataConnection", new() + /// { + /// Location = exampleResourceGroup.Location, + /// CosmosdbContainerId = exampleSqlContainer.Id, + /// KustoDatabaseId = exampleDatabase.Id, + /// ManagedIdentityId = exampleCluster.Id, + /// TableName = "TestTable", + /// MappingRuleName = "TestMapping", + /// RetrievalStartDate = "2023-06-26T12:00:00.6554616Z", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto / Cosmos Database Data Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/Database.cs b/sdk/dotnet/Kusto/Database.cs index 456681a885..aea5a9f001 100644 --- a/sdk/dotnet/Kusto/Database.cs +++ b/sdk/dotnet/Kusto/Database.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto (also known as Azure Data Explorer) Database /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var cluster = new Azure.Kusto.Cluster("cluster", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// }); + /// + /// var database = new Azure.Kusto.Database("database", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// ClusterName = cluster.Name, + /// HotCachePeriod = "P7D", + /// SoftDeletePeriod = "P31D", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/DatabasePrincipalAssignment.cs b/sdk/dotnet/Kusto/DatabasePrincipalAssignment.cs index 2bc3e3609d..dc516d7109 100644 --- a/sdk/dotnet/Kusto/DatabasePrincipalAssignment.cs +++ b/sdk/dotnet/Kusto/DatabasePrincipalAssignment.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto (also known as Azure Data Explorer) Database Principal Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// HotCachePeriod = "P7D", + /// SoftDeletePeriod = "P31D", + /// }); + /// + /// var exampleDatabasePrincipalAssignment = new Azure.Kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClusterName = exampleCluster.Name, + /// DatabaseName = exampleDatabase.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId), + /// PrincipalType = "App", + /// Role = "Viewer", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto Database Principal Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/EventGridDataConnection.cs b/sdk/dotnet/Kusto/EventGridDataConnection.cs index d54b28bc58..9c60569d7d 100644 --- a/sdk/dotnet/Kusto/EventGridDataConnection.cs +++ b/sdk/dotnet/Kusto/EventGridDataConnection.cs @@ -12,6 +12,111 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto (also known as Azure Data Explorer) Event Grid Data Connection /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// HotCachePeriod = "P7D", + /// SoftDeletePeriod = "P31D", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 1, + /// MessageRetention = 1, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleEventSubscription = new Azure.EventGrid.EventSubscription("exampleEventSubscription", new() + /// { + /// Scope = exampleAccount.Id, + /// EventhubEndpointId = exampleEventHub.Id, + /// EventDeliverySchema = "EventGridSchema", + /// IncludedEventTypes = new[] + /// { + /// "Microsoft.Storage.BlobCreated", + /// "Microsoft.Storage.BlobRenamed", + /// }, + /// RetryPolicy = new Azure.EventGrid.Inputs.EventSubscriptionRetryPolicyArgs + /// { + /// EventTimeToLive = 144, + /// MaxDeliveryAttempts = 10, + /// }, + /// }); + /// + /// var exampleEventGridDataConnection = new Azure.Kusto.EventGridDataConnection("exampleEventGridDataConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// DatabaseName = exampleDatabase.Name, + /// StorageAccountId = exampleAccount.Id, + /// EventhubId = exampleEventHub.Id, + /// EventhubConsumerGroupName = exampleConsumerGroup.Name, + /// TableName = "my-table", + /// MappingRuleName = "my-table-mapping", + /// DataFormat = "JSON", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleEventSubscription, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto Event Grid Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/EventhubDataConnection.cs b/sdk/dotnet/Kusto/EventhubDataConnection.cs index 39ed3e26f2..fdcc4a1b26 100644 --- a/sdk/dotnet/Kusto/EventhubDataConnection.cs +++ b/sdk/dotnet/Kusto/EventhubDataConnection.cs @@ -12,6 +12,80 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto (also known as Azure Data Explorer) EventHub Data Connection /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var cluster = new Azure.Kusto.Cluster("cluster", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// }); + /// + /// var database = new Azure.Kusto.Database("database", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// ClusterName = cluster.Name, + /// HotCachePeriod = "P7D", + /// SoftDeletePeriod = "P31D", + /// }); + /// + /// var eventhubNs = new Azure.EventHub.EventHubNamespace("eventhubNs", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = "Standard", + /// }); + /// + /// var eventhub = new Azure.EventHub.EventHub("eventhub", new() + /// { + /// NamespaceName = eventhubNs.Name, + /// ResourceGroupName = example.Name, + /// PartitionCount = 1, + /// MessageRetention = 1, + /// }); + /// + /// var consumerGroup = new Azure.EventHub.ConsumerGroup("consumerGroup", new() + /// { + /// NamespaceName = eventhubNs.Name, + /// EventhubName = eventhub.Name, + /// ResourceGroupName = example.Name, + /// }); + /// + /// var eventhubConnection = new Azure.Kusto.EventhubDataConnection("eventhubConnection", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// ClusterName = cluster.Name, + /// DatabaseName = database.Name, + /// EventhubId = eventhub.Id, + /// ConsumerGroup = consumerGroup.Name, + /// TableName = "my-table", + /// MappingRuleName = "my-table-mapping", + /// DataFormat = "JSON", + /// }); + /// + /// //(Optional) + /// }); + /// ``` + /// /// ## Import /// /// Kusto EventHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/GetCluster.cs b/sdk/dotnet/Kusto/GetCluster.cs index 57402ca7de..e4edb2b7a5 100644 --- a/sdk/dotnet/Kusto/GetCluster.cs +++ b/sdk/dotnet/Kusto/GetCluster.cs @@ -13,12 +13,58 @@ public static class GetCluster { /// /// Use this data source to access information about an existing Kusto (also known as Azure Data Explorer) Cluster + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Kusto.GetCluster.Invoke(new() + /// { + /// Name = "kustocluster", + /// ResourceGroupName = "test_resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetClusterArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:kusto/getCluster:getCluster", args ?? new GetClusterArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Kusto (also known as Azure Data Explorer) Cluster + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Kusto.GetCluster.Invoke(new() + /// { + /// Name = "kustocluster", + /// ResourceGroupName = "test_resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetClusterInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:kusto/getCluster:getCluster", args ?? new GetClusterInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Kusto/GetDatabase.cs b/sdk/dotnet/Kusto/GetDatabase.cs index e9f878656f..266565eef0 100644 --- a/sdk/dotnet/Kusto/GetDatabase.cs +++ b/sdk/dotnet/Kusto/GetDatabase.cs @@ -13,12 +13,60 @@ public static class GetDatabase { /// /// Use this data source to access information about an existing Kusto Database + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Kusto.GetDatabase.Invoke(new() + /// { + /// ClusterName = "test_cluster", + /// Name = "my-kusto-database", + /// ResourceGroupName = "test_resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDatabaseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:kusto/getDatabase:getDatabase", args ?? new GetDatabaseArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Kusto Database + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Kusto.GetDatabase.Invoke(new() + /// { + /// ClusterName = "test_cluster", + /// Name = "my-kusto-database", + /// ResourceGroupName = "test_resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDatabaseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:kusto/getDatabase:getDatabase", args ?? new GetDatabaseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Kusto/IotHubDataConnection.cs b/sdk/dotnet/Kusto/IotHubDataConnection.cs index b38f9bdb55..9094145591 100644 --- a/sdk/dotnet/Kusto/IotHubDataConnection.cs +++ b/sdk/dotnet/Kusto/IotHubDataConnection.cs @@ -12,6 +12,89 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto (also known as Azure Data Explorer) IotHub Data Connection /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Standard_D13_v2", + /// Capacity = 2, + /// }, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// HotCachePeriod = "P7D", + /// SoftDeletePeriod = "P31D", + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "B1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleSharedAccessPolicy = new Azure.Iot.SharedAccessPolicy("exampleSharedAccessPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubName = exampleIoTHub.Name, + /// RegistryRead = true, + /// }); + /// + /// var exampleConsumerGroup = new Azure.Iot.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IothubName = exampleIoTHub.Name, + /// EventhubEndpointName = "events", + /// }); + /// + /// var exampleIotHubDataConnection = new Azure.Kusto.IotHubDataConnection("exampleIotHubDataConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// DatabaseName = exampleDatabase.Name, + /// IothubId = exampleIoTHub.Id, + /// ConsumerGroup = exampleConsumerGroup.Name, + /// SharedAccessPolicyName = exampleSharedAccessPolicy.Name, + /// EventSystemProperties = new[] + /// { + /// "message-id", + /// "sequence-number", + /// "to", + /// }, + /// TableName = "my-table", + /// MappingRuleName = "my-table-mapping", + /// DataFormat = "JSON", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto IotHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Kusto/Script.cs b/sdk/dotnet/Kusto/Script.cs index dca05b8f6d..1659c64d8f 100644 --- a/sdk/dotnet/Kusto/Script.cs +++ b/sdk/dotnet/Kusto/Script.cs @@ -12,6 +12,91 @@ namespace Pulumi.Azure.Kusto /// /// Manages a Kusto Script. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.Kusto.Cluster("exampleCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.Kusto.Inputs.ClusterSkuArgs + /// { + /// Name = "Dev(No SLA)_Standard_D11_v2", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleDatabase = new Azure.Kusto.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClusterName = exampleCluster.Name, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleBlob = new Azure.Storage.Blob("exampleBlob", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// StorageContainerName = exampleContainer.Name, + /// Type = "Block", + /// SourceContent = ".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)", + /// }); + /// + /// var exampleAccountBlobContainerSAS = Azure.Storage.GetAccountBlobContainerSAS.Invoke(new() + /// { + /// ConnectionString = exampleAccount.PrimaryConnectionString, + /// ContainerName = exampleContainer.Name, + /// HttpsOnly = true, + /// Start = "2017-03-21", + /// Expiry = "2022-03-21", + /// Permissions = new Azure.Storage.Inputs.GetAccountBlobContainerSASPermissionsInputArgs + /// { + /// Read = true, + /// Add = false, + /// Create = false, + /// Write = true, + /// Delete = false, + /// List = true, + /// }, + /// }); + /// + /// var exampleScript = new Azure.Kusto.Script("exampleScript", new() + /// { + /// DatabaseId = exampleDatabase.Id, + /// Url = exampleBlob.Id, + /// SasToken = exampleAccountBlobContainerSAS.Apply(getAccountBlobContainerSASResult => getAccountBlobContainerSASResult.Sas), + /// ContinueOnErrorsEnabled = true, + /// ForceAnUpdateWhenValueChanged = "first", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Kusto Scripts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lab/Lab.cs b/sdk/dotnet/Lab/Lab.cs index dbf053fe91..3fe27ce1b3 100644 --- a/sdk/dotnet/Lab/Lab.cs +++ b/sdk/dotnet/Lab/Lab.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.Lab /// /// Manages a Lab Service Lab. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.Lab.Lab("exampleLab", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Title = "Test Title", + /// Security = new Azure.Lab.Inputs.LabSecurityArgs + /// { + /// OpenAccessEnabled = false, + /// }, + /// VirtualMachine = new Azure.Lab.Inputs.LabVirtualMachineArgs + /// { + /// AdminUser = new Azure.Lab.Inputs.LabVirtualMachineAdminUserArgs + /// { + /// Username = "testadmin", + /// Password = "Password1234!", + /// }, + /// ImageReference = new Azure.Lab.Inputs.LabVirtualMachineImageReferenceArgs + /// { + /// Offer = "0001-com-ubuntu-server-focal", + /// Publisher = "canonical", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// Sku = new Azure.Lab.Inputs.LabVirtualMachineSkuArgs + /// { + /// Name = "Classic_Fsv2_2_4GB_128_S_SSD", + /// Capacity = 0, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Lab Service Labs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lab/Schedule.cs b/sdk/dotnet/Lab/Schedule.cs index ffacc57816..e6a650d346 100644 --- a/sdk/dotnet/Lab/Schedule.cs +++ b/sdk/dotnet/Lab/Schedule.cs @@ -12,6 +12,62 @@ namespace Pulumi.Azure.Lab /// /// Manages a Lab Service Schedule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.Lab.Lab("exampleLab", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Title = "Test Title", + /// Security = new Azure.Lab.Inputs.LabSecurityArgs + /// { + /// OpenAccessEnabled = false, + /// }, + /// VirtualMachine = new Azure.Lab.Inputs.LabVirtualMachineArgs + /// { + /// AdminUser = new Azure.Lab.Inputs.LabVirtualMachineAdminUserArgs + /// { + /// Username = "testadmin", + /// Password = "Password1234!", + /// }, + /// ImageReference = new Azure.Lab.Inputs.LabVirtualMachineImageReferenceArgs + /// { + /// Offer = "0001-com-ubuntu-server-focal", + /// Publisher = "canonical", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// Sku = new Azure.Lab.Inputs.LabVirtualMachineSkuArgs + /// { + /// Name = "Classic_Fsv2_2_4GB_128_S_SSD", + /// Capacity = 1, + /// }, + /// }, + /// }); + /// + /// var exampleSchedule = new Azure.Lab.Schedule("exampleSchedule", new() + /// { + /// LabId = exampleLab.Id, + /// StopTime = "2022-11-28T00:00:00Z", + /// TimeZone = "America/Los_Angeles", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Lab Service Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lab/ServicePlan.cs b/sdk/dotnet/Lab/ServicePlan.cs index b6549557bd..0dcc020a08 100644 --- a/sdk/dotnet/Lab/ServicePlan.cs +++ b/sdk/dotnet/Lab/ServicePlan.cs @@ -14,6 +14,34 @@ namespace Pulumi.Azure.Lab /// /// > **Note:** Before using this resource, it's required to submit the request of registering the provider with Azure CLI `az provider register --namespace Microsoft.LabServices`. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicePlan = new Azure.Lab.ServicePlan("exampleServicePlan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllowedRegions = new[] + /// { + /// exampleResourceGroup.Location, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Lab Service Plans can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lab/User.cs b/sdk/dotnet/Lab/User.cs index d7cb7931d9..b3ecca0892 100644 --- a/sdk/dotnet/Lab/User.cs +++ b/sdk/dotnet/Lab/User.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.Lab /// /// Manages a Lab Service User. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLab = new Azure.Lab.Lab("exampleLab", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Title = "Test Title", + /// Security = new Azure.Lab.Inputs.LabSecurityArgs + /// { + /// OpenAccessEnabled = false, + /// }, + /// VirtualMachine = new Azure.Lab.Inputs.LabVirtualMachineArgs + /// { + /// AdminUser = new Azure.Lab.Inputs.LabVirtualMachineAdminUserArgs + /// { + /// Username = "testadmin", + /// Password = "Password1234!", + /// }, + /// ImageReference = new Azure.Lab.Inputs.LabVirtualMachineImageReferenceArgs + /// { + /// Offer = "0001-com-ubuntu-server-focal", + /// Publisher = "canonical", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// Sku = new Azure.Lab.Inputs.LabVirtualMachineSkuArgs + /// { + /// Name = "Classic_Fsv2_2_4GB_128_S_SSD", + /// Capacity = 1, + /// }, + /// }, + /// }); + /// + /// var exampleUser = new Azure.Lab.User("exampleUser", new() + /// { + /// LabId = exampleLab.Id, + /// Email = "terraform-acctest@hashicorp.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Lab Service Users can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lb/BackendAddressPool.cs b/sdk/dotnet/Lb/BackendAddressPool.cs index c19b2d154c..80d246fefd 100644 --- a/sdk/dotnet/Lb/BackendAddressPool.cs +++ b/sdk/dotnet/Lb/BackendAddressPool.cs @@ -14,6 +14,50 @@ namespace Pulumi.Azure.Lb /// /// > **NOTE:** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleBackendAddressPool = new Azure.Lb.BackendAddressPool("exampleBackendAddressPool", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lb/BackendAddressPoolAddress.cs b/sdk/dotnet/Lb/BackendAddressPoolAddress.cs index 5dcf8b5581..2c6c770e1b 100644 --- a/sdk/dotnet/Lb/BackendAddressPoolAddress.cs +++ b/sdk/dotnet/Lb/BackendAddressPoolAddress.cs @@ -14,6 +14,62 @@ namespace Pulumi.Azure.Lb /// /// > **Note:** Backend Addresses can only be added to a `Standard` SKU Load Balancer. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleVirtualNetwork = Azure.Network.GetVirtualNetwork.Invoke(new() + /// { + /// Name = "example-network", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleLB = Azure.Lb.GetLB.Invoke(new() + /// { + /// Name = "example-lb", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleBackendAddressPool = Azure.Lb.GetBackendAddressPool.Invoke(new() + /// { + /// Name = "first", + /// LoadbalancerId = exampleLB.Apply(getLBResult => getLBResult.Id), + /// }); + /// + /// var exampleBackendAddressPoolAddress = new Azure.Lb.BackendAddressPoolAddress("exampleBackendAddressPoolAddress", new() + /// { + /// BackendAddressPoolId = exampleBackendAddressPool.Apply(getBackendAddressPoolResult => getBackendAddressPoolResult.Id), + /// VirtualNetworkId = exampleVirtualNetwork.Apply(getVirtualNetworkResult => getVirtualNetworkResult.Id), + /// IpAddress = "10.0.0.1", + /// }); + /// + /// var backend_pool_cr = Azure.Lb.GetBackendAddressPool.Invoke(new() + /// { + /// Name = "globalLBBackendPool", + /// LoadbalancerId = exampleLB.Apply(getLBResult => getLBResult.Id), + /// }); + /// + /// var example_1 = new Azure.Lb.BackendAddressPoolAddress("example-1", new() + /// { + /// BackendAddressPoolId = backend_pool_cr.Apply(backend_pool_cr => backend_pool_cr.Apply(getBackendAddressPoolResult => getBackendAddressPoolResult.Id)), + /// BackendAddressIpConfigurationId = azurerm_lb.Backend_lb_R1.Frontend_ip_configuration[0].Id, + /// }); + /// + /// var example_2 = new Azure.Lb.BackendAddressPoolAddress("example-2", new() + /// { + /// BackendAddressPoolId = backend_pool_cr.Apply(backend_pool_cr => backend_pool_cr.Apply(getBackendAddressPoolResult => getBackendAddressPoolResult.Id)), + /// BackendAddressIpConfigurationId = azurerm_lb.Backend_lb_R2.Frontend_ip_configuration[0].Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Backend Address Pool Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lb/GetBackendAddressPool.cs b/sdk/dotnet/Lb/GetBackendAddressPool.cs index 427f5acc90..abd503180d 100644 --- a/sdk/dotnet/Lb/GetBackendAddressPool.cs +++ b/sdk/dotnet/Lb/GetBackendAddressPool.cs @@ -13,12 +13,80 @@ public static class GetBackendAddressPool { /// /// Use this data source to access information about an existing Load Balancer's Backend Address Pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleLB = Azure.Lb.GetLB.Invoke(new() + /// { + /// Name = "example-lb", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleBackendAddressPool = Azure.Lb.GetBackendAddressPool.Invoke(new() + /// { + /// Name = "first", + /// LoadbalancerId = exampleLB.Apply(getLBResult => getLBResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["backendAddressPoolId"] = exampleBackendAddressPool.Apply(getBackendAddressPoolResult => getBackendAddressPoolResult.Id), + /// ["backendIpConfigurationIds"] = data.Azurerm_lb_backend_address_pool.Beap.Backend_ip_configurations.Select(__item => __item.Id).ToList(), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBackendAddressPoolArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:lb/getBackendAddressPool:getBackendAddressPool", args ?? new GetBackendAddressPoolArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Load Balancer's Backend Address Pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleLB = Azure.Lb.GetLB.Invoke(new() + /// { + /// Name = "example-lb", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleBackendAddressPool = Azure.Lb.GetBackendAddressPool.Invoke(new() + /// { + /// Name = "first", + /// LoadbalancerId = exampleLB.Apply(getLBResult => getLBResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["backendAddressPoolId"] = exampleBackendAddressPool.Apply(getBackendAddressPoolResult => getBackendAddressPoolResult.Id), + /// ["backendIpConfigurationIds"] = data.Azurerm_lb_backend_address_pool.Beap.Backend_ip_configurations.Select(__item => __item.Id).ToList(), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBackendAddressPoolInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:lb/getBackendAddressPool:getBackendAddressPool", args ?? new GetBackendAddressPoolInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Lb/GetLB.cs b/sdk/dotnet/Lb/GetLB.cs index 6e10f569b7..b56412c840 100644 --- a/sdk/dotnet/Lb/GetLB.cs +++ b/sdk/dotnet/Lb/GetLB.cs @@ -13,12 +13,66 @@ public static class GetLB { /// /// Use this data source to access information about an existing Load Balancer + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Lb.GetLB.Invoke(new() + /// { + /// Name = "example-lb", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["loadbalancerId"] = example.Apply(getLBResult => getLBResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetLBArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:lb/getLB:getLB", args ?? new GetLBArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Load Balancer + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Lb.GetLB.Invoke(new() + /// { + /// Name = "example-lb", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["loadbalancerId"] = example.Apply(getLBResult => getLBResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetLBInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:lb/getLB:getLB", args ?? new GetLBInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Lb/GetLBOutboundRule.cs b/sdk/dotnet/Lb/GetLBOutboundRule.cs index 94f0406662..29fbeb5b27 100644 --- a/sdk/dotnet/Lb/GetLBOutboundRule.cs +++ b/sdk/dotnet/Lb/GetLBOutboundRule.cs @@ -13,12 +13,66 @@ public static class GetLBOutboundRule { /// /// Use this data source to access information about an existing Load Balancer Outbound Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Lb.GetLBOutboundRule.Invoke(new() + /// { + /// Name = "existing_lb_outbound_rule", + /// LoadbalancerId = "existing_load_balancer_id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLBOutboundRuleResult => getLBOutboundRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetLBOutboundRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:lb/getLBOutboundRule:getLBOutboundRule", args ?? new GetLBOutboundRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Load Balancer Outbound Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Lb.GetLBOutboundRule.Invoke(new() + /// { + /// Name = "existing_lb_outbound_rule", + /// LoadbalancerId = "existing_load_balancer_id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLBOutboundRuleResult => getLBOutboundRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetLBOutboundRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:lb/getLBOutboundRule:getLBOutboundRule", args ?? new GetLBOutboundRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Lb/LoadBalancer.cs b/sdk/dotnet/Lb/LoadBalancer.cs index d3064c700b..64586fba0f 100644 --- a/sdk/dotnet/Lb/LoadBalancer.cs +++ b/sdk/dotnet/Lb/LoadBalancer.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.Lb /// /// Manages a Load Balancer Resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Load Balancers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lb/NatPool.cs b/sdk/dotnet/Lb/NatPool.cs index 7532942cb9..590ae38183 100644 --- a/sdk/dotnet/Lb/NatPool.cs +++ b/sdk/dotnet/Lb/NatPool.cs @@ -16,6 +16,56 @@ namespace Pulumi.Azure.Lb /// /// > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleNatPool = new Azure.Lb.NatPool("exampleNatPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Protocol = "Tcp", + /// FrontendPortStart = 80, + /// FrontendPortEnd = 81, + /// BackendPort = 8080, + /// FrontendIpConfigurationName = "PublicIPAddress", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Load Balancer NAT Pools can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lb/OutboundRule.cs b/sdk/dotnet/Lb/OutboundRule.cs index 8bcc229ce4..0ade9ab6d9 100644 --- a/sdk/dotnet/Lb/OutboundRule.cs +++ b/sdk/dotnet/Lb/OutboundRule.cs @@ -14,6 +14,64 @@ namespace Pulumi.Azure.Lb /// /// > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration and a Backend Address Pool Attached. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleBackendAddressPool = new Azure.Lb.BackendAddressPool("exampleBackendAddressPool", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// }); + /// + /// var exampleOutboundRule = new Azure.Lb.OutboundRule("exampleOutboundRule", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Protocol = "Tcp", + /// BackendAddressPoolId = exampleBackendAddressPool.Id, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.OutboundRuleFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Load Balancer Outbound Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lb/Probe.cs b/sdk/dotnet/Lb/Probe.cs index db2c106ccf..5886d2a1f7 100644 --- a/sdk/dotnet/Lb/Probe.cs +++ b/sdk/dotnet/Lb/Probe.cs @@ -14,6 +14,51 @@ namespace Pulumi.Azure.Lb /// /// > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleProbe = new Azure.Lb.Probe("exampleProbe", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Port = 22, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Load Balancer Probes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lb/Rule.cs b/sdk/dotnet/Lb/Rule.cs index 4d8edea5e3..1badce414b 100644 --- a/sdk/dotnet/Lb/Rule.cs +++ b/sdk/dotnet/Lb/Rule.cs @@ -14,6 +14,54 @@ namespace Pulumi.Azure.Lb /// /// > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = "West US", + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = "West US", + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "PublicIPAddress", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleRule = new Azure.Lb.Rule("exampleRule", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Protocol = "Tcp", + /// FrontendPort = 3389, + /// BackendPort = 3389, + /// FrontendIpConfigurationName = "PublicIPAddress", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Load Balancer Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lighthouse/Assignment.cs b/sdk/dotnet/Lighthouse/Assignment.cs index 8792ad623a..f49d0fa704 100644 --- a/sdk/dotnet/Lighthouse/Assignment.cs +++ b/sdk/dotnet/Lighthouse/Assignment.cs @@ -12,6 +12,27 @@ namespace Pulumi.Azure.Lighthouse /// /// Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Assignment to a subscription, or to a resource group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var example = new Azure.Lighthouse.Assignment("example", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// LighthouseDefinitionId = "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Lighthouse Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Lighthouse/Definition.cs b/sdk/dotnet/Lighthouse/Definition.cs index 51b91d9044..8d0cac2673 100644 --- a/sdk/dotnet/Lighthouse/Definition.cs +++ b/sdk/dotnet/Lighthouse/Definition.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.Lighthouse /// /// Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Definition. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var contributor = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// RoleDefinitionId = "b24988ac-6180-42a0-ab88-20f7382dd24c", + /// }); + /// + /// var example = new Azure.Lighthouse.Definition("example", new() + /// { + /// Description = "This is a lighthouse definition created IaC", + /// ManagingTenantId = "00000000-0000-0000-0000-000000000000", + /// Scope = "/subscriptions/00000000-0000-0000-0000-000000000000", + /// Authorizations = new[] + /// { + /// new Azure.Lighthouse.Inputs.DefinitionAuthorizationArgs + /// { + /// PrincipalId = "00000000-0000-0000-0000-000000000000", + /// RoleDefinitionId = contributor.Apply(getRoleDefinitionResult => getRoleDefinitionResult.RoleDefinitionId), + /// PrincipalDisplayName = "Tier 1 Support", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Lighthouse Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LoadTest/LoadTest.cs b/sdk/dotnet/LoadTest/LoadTest.cs index 7c41666f72..c2500e98b4 100644 --- a/sdk/dotnet/LoadTest/LoadTest.cs +++ b/sdk/dotnet/LoadTest/LoadTest.cs @@ -14,6 +14,35 @@ namespace Pulumi.Azure.LoadTest /// /// Manages a Load Test Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLoadTest = new Azure.LoadTest.LoadTest("exampleLoadTest", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` /// ## Blocks Reference /// /// ### `identity` Block diff --git a/sdk/dotnet/LogAnalytics/Cluster.cs b/sdk/dotnet/LogAnalytics/Cluster.cs index 00bd832241..16b3d2e3ef 100644 --- a/sdk/dotnet/LogAnalytics/Cluster.cs +++ b/sdk/dotnet/LogAnalytics/Cluster.cs @@ -14,6 +14,34 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.LogAnalytics.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.LogAnalytics.Inputs.ClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/ClusterCustomerManagedKey.cs b/sdk/dotnet/LogAnalytics/ClusterCustomerManagedKey.cs index c4e536a013..1930796672 100644 --- a/sdk/dotnet/LogAnalytics/ClusterCustomerManagedKey.cs +++ b/sdk/dotnet/LogAnalytics/ClusterCustomerManagedKey.cs @@ -12,6 +12,99 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Cluster Customer Managed Key. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleCluster = new Azure.LogAnalytics.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.LogAnalytics.Inputs.ClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// "GetRotationPolicy", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleCluster.Identity.Apply(identity => identity.TenantId), + /// ObjectId = exampleCluster.Identity.Apply(identity => identity.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Unwrapkey", + /// "Wrapkey", + /// }, + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }); + /// + /// var exampleClusterCustomerManagedKey = new Azure.LogAnalytics.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", new() + /// { + /// LogAnalyticsClusterId = exampleCluster.Id, + /// KeyVaultKeyId = exampleKey.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Cluster Customer Managed Keys can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/DataExportRule.cs b/sdk/dotnet/LogAnalytics/DataExportRule.cs index c3f3e91255..965df135df 100644 --- a/sdk/dotnet/LogAnalytics/DataExportRule.cs +++ b/sdk/dotnet/LogAnalytics/DataExportRule.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Data Export Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDataExportRule = new Azure.LogAnalytics.DataExportRule("exampleDataExportRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// DestinationResourceId = exampleAccount.Id, + /// TableNames = new[] + /// { + /// "Heartbeat", + /// }, + /// Enabled = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Data Export Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/DataSourceWindowsEvent.cs b/sdk/dotnet/LogAnalytics/DataSourceWindowsEvent.cs index bca050d45a..7d56cae151 100644 --- a/sdk/dotnet/LogAnalytics/DataSourceWindowsEvent.cs +++ b/sdk/dotnet/LogAnalytics/DataSourceWindowsEvent.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Windows Event DataSource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleDataSourceWindowsEvent = new Azure.LogAnalytics.DataSourceWindowsEvent("exampleDataSourceWindowsEvent", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// EventLogName = "Application", + /// EventTypes = new[] + /// { + /// "Error", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Windows Event DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/DataSourceWindowsPerformanceCounter.cs b/sdk/dotnet/LogAnalytics/DataSourceWindowsPerformanceCounter.cs index 4322c71d9e..e539c9cc60 100644 --- a/sdk/dotnet/LogAnalytics/DataSourceWindowsPerformanceCounter.cs +++ b/sdk/dotnet/LogAnalytics/DataSourceWindowsPerformanceCounter.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics (formally Operational Insights) Windows Performance Counter DataSource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleDataSourceWindowsPerformanceCounter = new Azure.LogAnalytics.DataSourceWindowsPerformanceCounter("exampleDataSourceWindowsPerformanceCounter", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// ObjectName = "CPU", + /// InstanceName = "*", + /// CounterName = "CPU", + /// IntervalSeconds = 10, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Windows Performance Counter DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/LinkedService.cs b/sdk/dotnet/LogAnalytics/LinkedService.cs index d8cb9c21db..fab83cb55f 100644 --- a/sdk/dotnet/LogAnalytics/LinkedService.cs +++ b/sdk/dotnet/LogAnalytics/LinkedService.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Linked Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Automation.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// Tags = + /// { + /// { "environment", "development" }, + /// }, + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleLinkedService = new Azure.LogAnalytics.LinkedService("exampleLinkedService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// ReadAccessId = exampleAccount.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/LinkedStorageAccount.cs b/sdk/dotnet/LogAnalytics/LinkedStorageAccount.cs index 609aff2712..3b3ec66978 100644 --- a/sdk/dotnet/LogAnalytics/LinkedStorageAccount.cs +++ b/sdk/dotnet/LogAnalytics/LinkedStorageAccount.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Linked Storage Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLinkedStorageAccount = new Azure.LogAnalytics.LinkedStorageAccount("exampleLinkedStorageAccount", new() + /// { + /// DataSourceType = "CustomLogs", + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// StorageAccountIds = new[] + /// { + /// exampleAccount.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Linked Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/QueryPack.cs b/sdk/dotnet/LogAnalytics/QueryPack.cs index 13925be33d..399ac0bc94 100644 --- a/sdk/dotnet/LogAnalytics/QueryPack.cs +++ b/sdk/dotnet/LogAnalytics/QueryPack.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Query Pack. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleQueryPack = new Azure.LogAnalytics.QueryPack("exampleQueryPack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Query Packs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/SavedSearch.cs b/sdk/dotnet/LogAnalytics/SavedSearch.cs index 055f746609..d60bfdcfcc 100644 --- a/sdk/dotnet/LogAnalytics/SavedSearch.cs +++ b/sdk/dotnet/LogAnalytics/SavedSearch.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics (formally Operational Insights) Saved Search. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleSavedSearch = new Azure.LogAnalytics.SavedSearch("exampleSavedSearch", new() + /// { + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// Category = "exampleCategory", + /// DisplayName = "exampleDisplayName", + /// Query = "exampleQuery", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Saved Searches can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogAnalytics/StorageInsights.cs b/sdk/dotnet/LogAnalytics/StorageInsights.cs index 9991e70d15..0780190055 100644 --- a/sdk/dotnet/LogAnalytics/StorageInsights.cs +++ b/sdk/dotnet/LogAnalytics/StorageInsights.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.LogAnalytics /// /// Manages a Log Analytics Storage Insights resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleStorageInsights = new Azure.LogAnalytics.StorageInsights("exampleStorageInsights", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// StorageAccountId = exampleAccount.Id, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Storage Insight Configs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/ActionCustom.cs b/sdk/dotnet/LogicApps/ActionCustom.cs index 553a259c5a..198d5ce2c7 100644 --- a/sdk/dotnet/LogicApps/ActionCustom.cs +++ b/sdk/dotnet/LogicApps/ActionCustom.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Custom Action within a Logic App Workflow /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkflow = new Azure.LogicApps.Workflow("exampleWorkflow", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleActionCustom = new Azure.LogicApps.ActionCustom("exampleActionCustom", new() + /// { + /// LogicAppId = exampleWorkflow.Id, + /// Body = @"{ + /// ""description"": ""A variable to configure the auto expiration age in days. Configured in negative number. Default is -30 (30 days old)."", + /// ""inputs"": { + /// ""variables"": [ + /// { + /// ""name"": ""ExpirationAgeInDays"", + /// ""type"": ""Integer"", + /// ""value"": -30 + /// } + /// ] + /// }, + /// ""runAfter"": {}, + /// ""type"": ""InitializeVariable"" + /// } + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Custom Actions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/ActionHttp.cs b/sdk/dotnet/LogicApps/ActionHttp.cs index 0544721070..62a51c1511 100644 --- a/sdk/dotnet/LogicApps/ActionHttp.cs +++ b/sdk/dotnet/LogicApps/ActionHttp.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.LogicApps /// /// Manages an HTTP Action within a Logic App Workflow /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkflow = new Azure.LogicApps.Workflow("exampleWorkflow", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleActionHttp = new Azure.LogicApps.ActionHttp("exampleActionHttp", new() + /// { + /// LogicAppId = exampleWorkflow.Id, + /// Method = "GET", + /// Uri = "http://example.com/some-webhook", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App HTTP Actions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/GetIntegrationAccount.cs b/sdk/dotnet/LogicApps/GetIntegrationAccount.cs index b7ea1c86aa..6e17c1f468 100644 --- a/sdk/dotnet/LogicApps/GetIntegrationAccount.cs +++ b/sdk/dotnet/LogicApps/GetIntegrationAccount.cs @@ -13,12 +13,66 @@ public static class GetIntegrationAccount { /// /// Use this data source to access information about an existing Logic App Integration Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.LogicApps.GetIntegrationAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getIntegrationAccountResult => getIntegrationAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetIntegrationAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:logicapps/getIntegrationAccount:getIntegrationAccount", args ?? new GetIntegrationAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Logic App Integration Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.LogicApps.GetIntegrationAccount.Invoke(new() + /// { + /// Name = "example-account", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getIntegrationAccountResult => getIntegrationAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetIntegrationAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:logicapps/getIntegrationAccount:getIntegrationAccount", args ?? new GetIntegrationAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/LogicApps/GetStandard.cs b/sdk/dotnet/LogicApps/GetStandard.cs index fa3d8d4ff4..9de329fe68 100644 --- a/sdk/dotnet/LogicApps/GetStandard.cs +++ b/sdk/dotnet/LogicApps/GetStandard.cs @@ -13,12 +13,66 @@ public static class GetStandard { /// /// Use this data source to access information about an existing Logic App Standard instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.LogicApps.GetStandard.Invoke(new() + /// { + /// Name = "logicappstd", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getStandardResult => getStandardResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetStandardArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:logicapps/getStandard:getStandard", args ?? new GetStandardArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Logic App Standard instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.LogicApps.GetStandard.Invoke(new() + /// { + /// Name = "logicappstd", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getStandardResult => getStandardResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetStandardInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:logicapps/getStandard:getStandard", args ?? new GetStandardInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/LogicApps/GetWorkflow.cs b/sdk/dotnet/LogicApps/GetWorkflow.cs index b0d77c1ab9..a94247e91a 100644 --- a/sdk/dotnet/LogicApps/GetWorkflow.cs +++ b/sdk/dotnet/LogicApps/GetWorkflow.cs @@ -13,12 +13,66 @@ public static class GetWorkflow { /// /// Use this data source to access information about an existing Logic App Workflow. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.LogicApps.GetWorkflow.Invoke(new() + /// { + /// Name = "workflow1", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accessEndpoint"] = example.Apply(getWorkflowResult => getWorkflowResult.AccessEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWorkflowArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:logicapps/getWorkflow:getWorkflow", args ?? new GetWorkflowArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Logic App Workflow. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.LogicApps.GetWorkflow.Invoke(new() + /// { + /// Name = "workflow1", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accessEndpoint"] = example.Apply(getWorkflowResult => getWorkflowResult.AccessEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWorkflowInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:logicapps/getWorkflow:getWorkflow", args ?? new GetWorkflowInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/LogicApps/IntegrationAccount.cs b/sdk/dotnet/LogicApps/IntegrationAccount.cs index d00ee3c71d..0f5317fa94 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccount.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccount.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "Standard", + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountAgreement.cs b/sdk/dotnet/LogicApps/IntegrationAccountAgreement.cs index 37d3aeedce..47665058a4 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountAgreement.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountAgreement.cs @@ -12,6 +12,80 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Agreement. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var testIntegrationAccount = new Azure.LogicApps.IntegrationAccount("testIntegrationAccount", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// SkuName = "Standard", + /// }); + /// + /// var host = new Azure.LogicApps.IntegrationAccountPartner("host", new() + /// { + /// ResourceGroupName = example.Name, + /// IntegrationAccountName = testIntegrationAccount.Name, + /// BusinessIdentities = new[] + /// { + /// new Azure.LogicApps.Inputs.IntegrationAccountPartnerBusinessIdentityArgs + /// { + /// Qualifier = "AS2Identity", + /// Value = "FabrikamNY", + /// }, + /// }, + /// }); + /// + /// var guest = new Azure.LogicApps.IntegrationAccountPartner("guest", new() + /// { + /// ResourceGroupName = example.Name, + /// IntegrationAccountName = testIntegrationAccount.Name, + /// BusinessIdentities = new[] + /// { + /// new Azure.LogicApps.Inputs.IntegrationAccountPartnerBusinessIdentityArgs + /// { + /// Qualifier = "AS2Identity", + /// Value = "FabrikamDC", + /// }, + /// }, + /// }); + /// + /// var testIntegrationAccountAgreement = new Azure.LogicApps.IntegrationAccountAgreement("testIntegrationAccountAgreement", new() + /// { + /// ResourceGroupName = example.Name, + /// IntegrationAccountName = testIntegrationAccount.Name, + /// AgreementType = "AS2", + /// HostPartnerName = host.Name, + /// GuestPartnerName = guest.Name, + /// Content = File.ReadAllText("testdata/integration_account_agreement_content_as2.json"), + /// HostIdentity = new Azure.LogicApps.Inputs.IntegrationAccountAgreementHostIdentityArgs + /// { + /// Qualifier = "AS2Identity", + /// Value = "FabrikamNY", + /// }, + /// GuestIdentity = new Azure.LogicApps.Inputs.IntegrationAccountAgreementGuestIdentityArgs + /// { + /// Qualifier = "AS2Identity", + /// Value = "FabrikamDC", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Agreements can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountAssembly.cs b/sdk/dotnet/LogicApps/IntegrationAccountAssembly.cs index 0fb28753ee..a27fa292a6 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountAssembly.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountAssembly.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Assembly. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleIntegrationAccountAssembly = new Azure.LogicApps.IntegrationAccountAssembly("exampleIntegrationAccountAssembly", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IntegrationAccountName = exampleIntegrationAccount.Name, + /// AssemblyName = "TestAssembly", + /// Content = ReadFileBase64("testdata/log4net.dll"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Assemblies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountBatchConfiguration.cs b/sdk/dotnet/LogicApps/IntegrationAccountBatchConfiguration.cs index 59dd317f56..9cd358c0a6 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountBatchConfiguration.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountBatchConfiguration.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Batch Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleIntegrationAccountBatchConfiguration = new Azure.LogicApps.IntegrationAccountBatchConfiguration("exampleIntegrationAccountBatchConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IntegrationAccountName = exampleIntegrationAccount.Name, + /// BatchGroupName = "TestBatchGroup", + /// ReleaseCriteria = new Azure.LogicApps.Inputs.IntegrationAccountBatchConfigurationReleaseCriteriaArgs + /// { + /// MessageCount = 80, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Batch Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountCertificate.cs b/sdk/dotnet/LogicApps/IntegrationAccountCertificate.cs index 8347d6d77a..4823943758 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountCertificate.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountCertificate.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleIntegrationAccountCertificate = new Azure.LogicApps.IntegrationAccountCertificate("exampleIntegrationAccountCertificate", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IntegrationAccountName = exampleIntegrationAccount.Name, + /// PublicCertificate = "MIIDbzCCAlegAwIBAgIJAIzjRD36sIbbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAl0ZXJyYWZvcm0xFTATBgNVBAMMDHRlcnJhZm9ybS5pbzAgFw0xNzA0MjEyMDA1MjdaGA8yMTE3MDMyODIwMDUyN1owTTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAoMCXRlcnJhZm9ybTEVMBMGA1UEAwwMdGVycmFmb3JtLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3L9L5szT4+FLykTFNyyPjy/k3BQTYAfRQzP2dhnsuUKm3cdPC0NyZ+wEXIUGhoDO2YG6EYChOl8fsDqDOjloSUGKqYw++nlpHIuUgJx8IxxG2XkALCjFU7EmF+w7kn76d0ezpEIYxnLP+KG2DVornoEt1aLhv1MLmpgEZZPhDbMSLhSYWeTVRMayXLwqtfgnDumQSB+8d/1JuJqrSI4pD12JozVThzb6hsjfb6RMX4epPmrGn0PbTPEEA6awmsxBCXB0s13nNQt/O0hLM2agwvAyozilQV+s616Ckgk6DJoUkqZhDy7vPYMIRSr98fBws6zkrV6tTLjmD8xAvobePQIDAQABo1AwTjAdBgNVHQ4EFgQUXIqO421zMMmbcRRX9wctZFCQuPIwHwYDVR0jBBgwFoAUXIqO421zMMmbcRRX9wctZFCQuPIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAr82NeT3BYJOKLlUL6Om5LjUF66ewcJjG9ltdvyQwVneMcq7t5UAPxgChzqNRVk4da8PzkXpjBJyWezHupdJNX3XqeUk2kSxqQ6/gmhqvfI3y7djrwoO6jvMEY26WqtkTNORWDP3THJJVimC3zV+KMU5UBVrEzhOVhHSU709lBP75o0BBn3xGsPqSq9k8IotIFfyAc6a+XP3+ZMpvh7wqAUml7vWa5wlcXExCx39h1balfDSLGNC4swWPCp9AMnQR0p+vMay9hNP1Eh+9QYUai14d5KS3cFV+KxE1cJR5HD/iLltnnOEbpMsB0eVOZWkFvE7Y5lW0oVSAfin5TwTJMQ==", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountMap.cs b/sdk/dotnet/LogicApps/IntegrationAccountMap.cs index 270a0e9c44..d8cfc6df53 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountMap.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountMap.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Map. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleIntegrationAccountMap = new Azure.LogicApps.IntegrationAccountMap("exampleIntegrationAccountMap", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IntegrationAccountName = exampleIntegrationAccount.Name, + /// MapType = "Xslt", + /// Content = File.ReadAllText("testdata/integration_account_map_content.xsd"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Maps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountPartner.cs b/sdk/dotnet/LogicApps/IntegrationAccountPartner.cs index 4ca569c970..f5e7049a93 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountPartner.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountPartner.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Partner. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleIntegrationAccountPartner = new Azure.LogicApps.IntegrationAccountPartner("exampleIntegrationAccountPartner", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IntegrationAccountName = exampleIntegrationAccount.Name, + /// BusinessIdentities = new[] + /// { + /// new Azure.LogicApps.Inputs.IntegrationAccountPartnerBusinessIdentityArgs + /// { + /// Qualifier = "ZZ", + /// Value = "AA", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Partners can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountSchema.cs b/sdk/dotnet/LogicApps/IntegrationAccountSchema.cs index c2c87e4db3..53c5411ea8 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountSchema.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountSchema.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Schema. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleIntegrationAccountSchema = new Azure.LogicApps.IntegrationAccountSchema("exampleIntegrationAccountSchema", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IntegrationAccountName = exampleIntegrationAccount.Name, + /// Content = File.ReadAllText("testdata/integration_account_schema_content.xsd"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Schemas can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/IntegrationAccountSession.cs b/sdk/dotnet/LogicApps/IntegrationAccountSession.cs index fc463c4e98..56a82be112 100644 --- a/sdk/dotnet/LogicApps/IntegrationAccountSession.cs +++ b/sdk/dotnet/LogicApps/IntegrationAccountSession.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Integration Account Session. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIntegrationAccount = new Azure.LogicApps.IntegrationAccount("exampleIntegrationAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Basic", + /// }); + /// + /// var exampleIntegrationAccountSession = new Azure.LogicApps.IntegrationAccountSession("exampleIntegrationAccountSession", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// IntegrationAccountName = exampleIntegrationAccount.Name, + /// Content = @" { + /// ""controlNumber"": ""1234"" + /// } + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Integration Account Sessions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/InterationServiceEnvironment.cs b/sdk/dotnet/LogicApps/InterationServiceEnvironment.cs index 0e834a79bf..20aa563d1e 100644 --- a/sdk/dotnet/LogicApps/InterationServiceEnvironment.cs +++ b/sdk/dotnet/LogicApps/InterationServiceEnvironment.cs @@ -14,6 +14,104 @@ namespace Pulumi.Azure.LogicApps /// /// !> **NOTE:** The `azure.logicapps.InterationServiceEnvironment` resource is deprecated and will be removed in v4.0 of the Azure Provider. The underlying Azure Service is being retired on 2024-08-31 and new instances cannot be provisioned by default after 2022-11-01. More information on the retirement and how to migrate to Logic Apps Standard [can be found here](https://aka.ms/isedeprecation). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/22", + /// }, + /// }); + /// + /// var isesubnet1 = new Azure.Network.Subnet("isesubnet1", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/27", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "integrationServiceEnvironments", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Logic/integrationServiceEnvironments", + /// }, + /// }, + /// }, + /// }); + /// + /// var isesubnet2 = new Azure.Network.Subnet("isesubnet2", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.32/27", + /// }, + /// }); + /// + /// var isesubnet3 = new Azure.Network.Subnet("isesubnet3", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.64/27", + /// }, + /// }); + /// + /// var isesubnet4 = new Azure.Network.Subnet("isesubnet4", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.96/27", + /// }, + /// }); + /// + /// var exampleInterationServiceEnvironment = new Azure.LogicApps.InterationServiceEnvironment("exampleInterationServiceEnvironment", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Developer_0", + /// AccessEndpointType = "Internal", + /// VirtualNetworkSubnetIds = new[] + /// { + /// isesubnet1.Id, + /// isesubnet2.Id, + /// isesubnet3.Id, + /// isesubnet4.Id, + /// }, + /// Tags = + /// { + /// { "environment", "development" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Integration Service Environments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/Standard.cs b/sdk/dotnet/LogicApps/Standard.cs index 18627a695f..701fdc7046 100644 --- a/sdk/dotnet/LogicApps/Standard.cs +++ b/sdk/dotnet/LogicApps/Standard.cs @@ -13,6 +13,116 @@ namespace Pulumi.Azure.LogicApps /// Manages a Logic App (Standard / Single Tenant) /// /// ## Example Usage + /// ### With App Service Plan) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "elastic", + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "WorkflowStandard", + /// Size = "WS1", + /// }, + /// }); + /// + /// var exampleStandard = new Azure.LogicApps.Standard("exampleStandard", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// AppSettings = + /// { + /// { "FUNCTIONS_WORKER_RUNTIME", "node" }, + /// { "WEBSITE_NODE_DEFAULT_VERSION", "~18" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### For Container Mode) + /// + /// > **Note:** You must set `azure.appservice.Plan` `kind` to `Linux` and `reserved` to `true` when used with `linux_fx_version` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "Linux", + /// Reserved = true, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "WorkflowStandard", + /// Size = "WS1", + /// }, + /// }); + /// + /// var exampleStandard = new Azure.LogicApps.Standard("exampleStandard", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// SiteConfig = new Azure.LogicApps.Inputs.StandardSiteConfigArgs + /// { + /// LinuxFxVersion = "DOCKER|mcr.microsoft.com/azure-functions/dotnet:3.0-appservice", + /// }, + /// AppSettings = + /// { + /// { "DOCKER_REGISTRY_SERVER_URL", "https://<server-name>.azurecr.io" }, + /// { "DOCKER_REGISTRY_SERVER_USERNAME", "username" }, + /// { "DOCKER_REGISTRY_SERVER_PASSWORD", "password" }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/LogicApps/TriggerCustom.cs b/sdk/dotnet/LogicApps/TriggerCustom.cs index ceab430f9d..a5bae2d15e 100644 --- a/sdk/dotnet/LogicApps/TriggerCustom.cs +++ b/sdk/dotnet/LogicApps/TriggerCustom.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Custom Trigger within a Logic App Workflow /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkflow = new Azure.LogicApps.Workflow("exampleWorkflow", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleTriggerCustom = new Azure.LogicApps.TriggerCustom("exampleTriggerCustom", new() + /// { + /// LogicAppId = exampleWorkflow.Id, + /// Body = @"{ + /// ""recurrence"": { + /// ""frequency"": ""Day"", + /// ""interval"": 1 + /// }, + /// ""type"": ""Recurrence"" + /// } + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Custom Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/TriggerHttpRequest.cs b/sdk/dotnet/LogicApps/TriggerHttpRequest.cs index cd751b4c4b..2e6843b504 100644 --- a/sdk/dotnet/LogicApps/TriggerHttpRequest.cs +++ b/sdk/dotnet/LogicApps/TriggerHttpRequest.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a HTTP Request Trigger within a Logic App Workflow /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkflow = new Azure.LogicApps.Workflow("exampleWorkflow", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleTriggerHttpRequest = new Azure.LogicApps.TriggerHttpRequest("exampleTriggerHttpRequest", new() + /// { + /// LogicAppId = exampleWorkflow.Id, + /// Schema = @"{ + /// ""type"": ""object"", + /// ""properties"": { + /// ""hello"": { + /// ""type"": ""string"" + /// } + /// } + /// } + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App HTTP Request Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/TriggerRecurrence.cs b/sdk/dotnet/LogicApps/TriggerRecurrence.cs index 7970c6b197..6811565c13 100644 --- a/sdk/dotnet/LogicApps/TriggerRecurrence.cs +++ b/sdk/dotnet/LogicApps/TriggerRecurrence.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Recurrence Trigger within a Logic App Workflow /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkflow = new Azure.LogicApps.Workflow("exampleWorkflow", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleTriggerRecurrence = new Azure.LogicApps.TriggerRecurrence("exampleTriggerRecurrence", new() + /// { + /// LogicAppId = exampleWorkflow.Id, + /// Frequency = "Day", + /// Interval = 1, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Recurrence Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/LogicApps/Workflow.cs b/sdk/dotnet/LogicApps/Workflow.cs index 82129702bc..f2dfff71c3 100644 --- a/sdk/dotnet/LogicApps/Workflow.cs +++ b/sdk/dotnet/LogicApps/Workflow.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.LogicApps /// /// Manages a Logic App Workflow. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkflow = new Azure.LogicApps.Workflow("exampleWorkflow", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logic App Workflows can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/Database.cs b/sdk/dotnet/MSSql/Database.cs index 20efc2f93d..f88fdecc00 100644 --- a/sdk/dotnet/MSSql/Database.cs +++ b/sdk/dotnet/MSSql/Database.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.MSSql /// /// Manages a MS SQL Database. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var test = new Azure.MSSql.Database("test", new() + /// { + /// ServerId = exampleServer.Id, + /// Collation = "SQL_Latin1_General_CP1_CI_AS", + /// LicenseType = "LicenseIncluded", + /// MaxSizeGb = 4, + /// ReadScale = true, + /// SkuName = "S0", + /// ZoneRedundant = true, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/DatabaseExtendedAuditingPolicy.cs b/sdk/dotnet/MSSql/DatabaseExtendedAuditingPolicy.cs index 3b75e32870..d07eb330af 100644 --- a/sdk/dotnet/MSSql/DatabaseExtendedAuditingPolicy.cs +++ b/sdk/dotnet/MSSql/DatabaseExtendedAuditingPolicy.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.MSSql /// /// Manages a MS SQL Database Extended Auditing Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "AdminPassword123!", + /// }); + /// + /// var exampleDatabase = new Azure.MSSql.Database("exampleDatabase", new() + /// { + /// ServerId = exampleServer.Id, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDatabaseExtendedAuditingPolicy = new Azure.MSSql.DatabaseExtendedAuditingPolicy("exampleDatabaseExtendedAuditingPolicy", new() + /// { + /// DatabaseId = exampleDatabase.Id, + /// StorageEndpoint = exampleAccount.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// StorageAccountAccessKeyIsSecondary = false, + /// RetentionInDays = 6, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MS SQL Database Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/DatabaseVulnerabilityAssessmentRuleBaseline.cs b/sdk/dotnet/MSSql/DatabaseVulnerabilityAssessmentRuleBaseline.cs index 39a3147b65..c7cfd31093 100644 --- a/sdk/dotnet/MSSql/DatabaseVulnerabilityAssessmentRuleBaseline.cs +++ b/sdk/dotnet/MSSql/DatabaseVulnerabilityAssessmentRuleBaseline.cs @@ -14,6 +14,103 @@ namespace Pulumi.Azure.MSSql /// /// > **NOTE** Database Vulnerability Assessment is currently only available for MS SQL databases. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleServerSecurityAlertPolicy = new Azure.MSSql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleSqlServer.Name, + /// State = "Enabled", + /// }); + /// + /// var exampleDatabase = new Azure.Sql.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleSqlServer.Name, + /// Location = exampleResourceGroup.Location, + /// Edition = "Standard", + /// }); + /// + /// var exampleServerVulnerabilityAssessment = new Azure.MSSql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", new() + /// { + /// ServerSecurityAlertPolicyId = exampleServerSecurityAlertPolicy.Id, + /// StorageContainerPath = Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values => + /// { + /// var primaryBlobEndpoint = values.Item1; + /// var name = values.Item2; + /// return $"{primaryBlobEndpoint}{name}/"; + /// }), + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// var exampleDatabaseVulnerabilityAssessmentRuleBaseline = new Azure.MSSql.DatabaseVulnerabilityAssessmentRuleBaseline("exampleDatabaseVulnerabilityAssessmentRuleBaseline", new() + /// { + /// ServerVulnerabilityAssessmentId = exampleServerVulnerabilityAssessment.Id, + /// DatabaseName = exampleDatabase.Name, + /// RuleId = "VA2065", + /// BaselineName = "master", + /// BaselineResults = new[] + /// { + /// new Azure.MSSql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs + /// { + /// Results = new[] + /// { + /// "allowedip1", + /// "123.123.123.123", + /// "123.123.123.123", + /// }, + /// }, + /// new Azure.MSSql.Inputs.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs + /// { + /// Results = new[] + /// { + /// "allowedip2", + /// "255.255.255.255", + /// "255.255.255.255", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Database Vulnerability Assessment Rule Baseline can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ElasticPool.cs b/sdk/dotnet/MSSql/ElasticPool.cs index 9c3b73cf1d..e444171e46 100644 --- a/sdk/dotnet/MSSql/ElasticPool.cs +++ b/sdk/dotnet/MSSql/ElasticPool.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.MSSql /// /// Allows you to manage an Azure SQL Elastic Pool via the `v3.0` API which allows for `vCore` and `DTU` based configurations. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleElasticPool = new Azure.MSSql.ElasticPool("exampleElasticPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServerName = exampleServer.Name, + /// LicenseType = "LicenseIncluded", + /// MaxSizeGb = 756, + /// Sku = new Azure.MSSql.Inputs.ElasticPoolSkuArgs + /// { + /// Name = "BasicPool", + /// Tier = "Basic", + /// Family = "Gen4", + /// Capacity = 4, + /// }, + /// PerDatabaseSettings = new Azure.MSSql.Inputs.ElasticPoolPerDatabaseSettingsArgs + /// { + /// MinCapacity = 0.25, + /// MaxCapacity = 4, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Elastic Pool can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/FailoverGroup.cs b/sdk/dotnet/MSSql/FailoverGroup.cs index 3066ef7cbf..5c9fe8a518 100644 --- a/sdk/dotnet/MSSql/FailoverGroup.cs +++ b/sdk/dotnet/MSSql/FailoverGroup.cs @@ -12,6 +12,76 @@ namespace Pulumi.Azure.MSSql /// /// Manages a Microsoft Azure SQL Failover Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var primary = new Azure.MSSql.Server("primary", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "thisIsKat11", + /// }); + /// + /// var secondary = new Azure.MSSql.Server("secondary", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "thisIsKat12", + /// }); + /// + /// var exampleDatabase = new Azure.MSSql.Database("exampleDatabase", new() + /// { + /// ServerId = primary.Id, + /// SkuName = "S1", + /// Collation = "SQL_Latin1_General_CP1_CI_AS", + /// MaxSizeGb = 200, + /// }); + /// + /// var exampleFailoverGroup = new Azure.MSSql.FailoverGroup("exampleFailoverGroup", new() + /// { + /// ServerId = primary.Id, + /// Databases = new[] + /// { + /// exampleDatabase.Id, + /// }, + /// PartnerServers = new[] + /// { + /// new Azure.MSSql.Inputs.FailoverGroupPartnerServerArgs + /// { + /// Id = secondary.Id, + /// }, + /// }, + /// ReadWriteEndpointFailoverPolicy = new Azure.MSSql.Inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgs + /// { + /// Mode = "Automatic", + /// GraceMinutes = 80, + /// }, + /// Tags = + /// { + /// { "environment", "prod" }, + /// { "database", "example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/FirewallRule.cs b/sdk/dotnet/MSSql/FirewallRule.cs index d95693b576..9610ec63cf 100644 --- a/sdk/dotnet/MSSql/FirewallRule.cs +++ b/sdk/dotnet/MSSql/FirewallRule.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.MSSql /// /// Allows you to manage an Azure SQL Firewall Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleFirewallRule = new Azure.MSSql.FirewallRule("exampleFirewallRule", new() + /// { + /// ServerId = exampleServer.Id, + /// StartIpAddress = "10.0.17.62", + /// EndIpAddress = "10.0.17.62", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/GetDatabase.cs b/sdk/dotnet/MSSql/GetDatabase.cs index fe113051f8..39d26cb080 100644 --- a/sdk/dotnet/MSSql/GetDatabase.cs +++ b/sdk/dotnet/MSSql/GetDatabase.cs @@ -13,12 +13,94 @@ public static class GetDatabase { /// /// Use this data source to access information about an existing SQL database. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleDatabase = Azure.MSSql.GetDatabase.Invoke(new() + /// { + /// Name = "example-mssql-db", + /// ServerId = exampleServer.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["databaseId"] = exampleDatabase.Apply(getDatabaseResult => getDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDatabaseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mssql/getDatabase:getDatabase", args ?? new GetDatabaseArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing SQL database. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleDatabase = Azure.MSSql.GetDatabase.Invoke(new() + /// { + /// Name = "example-mssql-db", + /// ServerId = exampleServer.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["databaseId"] = exampleDatabase.Apply(getDatabaseResult => getDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDatabaseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mssql/getDatabase:getDatabase", args ?? new GetDatabaseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MSSql/GetElasticPool.cs b/sdk/dotnet/MSSql/GetElasticPool.cs index 38404b52bb..df28b9abcd 100644 --- a/sdk/dotnet/MSSql/GetElasticPool.cs +++ b/sdk/dotnet/MSSql/GetElasticPool.cs @@ -13,12 +13,68 @@ public static class GetElasticPool { /// /// Use this data source to access information about an existing SQL elastic pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MSSql.GetElasticPool.Invoke(new() + /// { + /// Name = "mssqlelasticpoolname", + /// ResourceGroupName = "example-resources", + /// ServerName = "example-sql-server", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["elasticpoolId"] = example.Apply(getElasticPoolResult => getElasticPoolResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetElasticPoolArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mssql/getElasticPool:getElasticPool", args ?? new GetElasticPoolArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing SQL elastic pool. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MSSql.GetElasticPool.Invoke(new() + /// { + /// Name = "mssqlelasticpoolname", + /// ResourceGroupName = "example-resources", + /// ServerName = "example-sql-server", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["elasticpoolId"] = example.Apply(getElasticPoolResult => getElasticPoolResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetElasticPoolInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mssql/getElasticPool:getElasticPool", args ?? new GetElasticPoolInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MSSql/GetManagedInstance.cs b/sdk/dotnet/MSSql/GetManagedInstance.cs index 2fe8929ae4..c10a61c5bd 100644 --- a/sdk/dotnet/MSSql/GetManagedInstance.cs +++ b/sdk/dotnet/MSSql/GetManagedInstance.cs @@ -13,12 +13,58 @@ public static class GetManagedInstance { /// /// Use this data source to access information about an existing Microsoft SQL Azure Managed Instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MSSql.GetManagedInstance.Invoke(new() + /// { + /// Name = "managedsqlinstance", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetManagedInstanceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mssql/getManagedInstance:getManagedInstance", args ?? new GetManagedInstanceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Microsoft SQL Azure Managed Instance. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MSSql.GetManagedInstance.Invoke(new() + /// { + /// Name = "managedsqlinstance", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetManagedInstanceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mssql/getManagedInstance:getManagedInstance", args ?? new GetManagedInstanceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MSSql/GetServer.cs b/sdk/dotnet/MSSql/GetServer.cs index b76d26a057..d99a966980 100644 --- a/sdk/dotnet/MSSql/GetServer.cs +++ b/sdk/dotnet/MSSql/GetServer.cs @@ -13,12 +13,66 @@ public static class GetServer { /// /// Use this data source to access information about an existing Microsoft SQL Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MSSql.GetServer.Invoke(new() + /// { + /// Name = "existingMsSqlServer", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mssql/getServer:getServer", args ?? new GetServerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Microsoft SQL Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MSSql.GetServer.Invoke(new() + /// { + /// Name = "existingMsSqlServer", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mssql/getServer:getServer", args ?? new GetServerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MSSql/JobAgent.cs b/sdk/dotnet/MSSql/JobAgent.cs index ea3d1aa775..b607f85853 100644 --- a/sdk/dotnet/MSSql/JobAgent.cs +++ b/sdk/dotnet/MSSql/JobAgent.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.MSSql /// /// Manages an Elastic Job Agent. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "northeurope", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleDatabase = new Azure.MSSql.Database("exampleDatabase", new() + /// { + /// ServerId = exampleServer.Id, + /// Collation = "SQL_Latin1_General_CP1_CI_AS", + /// SkuName = "S1", + /// }); + /// + /// var exampleJobAgent = new Azure.MSSql.JobAgent("exampleJobAgent", new() + /// { + /// Location = exampleResourceGroup.Location, + /// DatabaseId = exampleDatabase.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Elastic Job Agents can be imported using the `id`, e.g. diff --git a/sdk/dotnet/MSSql/JobCredential.cs b/sdk/dotnet/MSSql/JobCredential.cs index 14a665a15c..af1d5db170 100644 --- a/sdk/dotnet/MSSql/JobCredential.cs +++ b/sdk/dotnet/MSSql/JobCredential.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.MSSql /// /// Manages an Elastic Job Credential. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "northeurope", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleDatabase = new Azure.MSSql.Database("exampleDatabase", new() + /// { + /// ServerId = exampleServer.Id, + /// Collation = "SQL_Latin1_General_CP1_CI_AS", + /// SkuName = "S1", + /// }); + /// + /// var exampleJobAgent = new Azure.MSSql.JobAgent("exampleJobAgent", new() + /// { + /// Location = exampleResourceGroup.Location, + /// DatabaseId = exampleDatabase.Id, + /// }); + /// + /// var exampleJobCredential = new Azure.MSSql.JobCredential("exampleJobCredential", new() + /// { + /// JobAgentId = exampleJobAgent.Id, + /// Username = "my-username", + /// Password = "MyP4ssw0rd!!!", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Elastic Job Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ManagedDatabase.cs b/sdk/dotnet/MSSql/ManagedDatabase.cs index 835521b8a5..3d522fdf5d 100644 --- a/sdk/dotnet/MSSql/ManagedDatabase.cs +++ b/sdk/dotnet/MSSql/ManagedDatabase.cs @@ -12,6 +12,62 @@ namespace Pulumi.Azure.MSSql /// /// Manages an Azure SQL Azure Managed Database for a SQL Managed Instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LicenseType = "BasePrice", + /// SkuName = "GP_Gen5", + /// StorageSizeInGb = 32, + /// SubnetId = exampleSubnet.Id, + /// Vcores = 4, + /// AdministratorLogin = "msadministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// }); + /// + /// var exampleManagedDatabase = new Azure.MSSql.ManagedDatabase("exampleManagedDatabase", new() + /// { + /// ManagedInstanceId = exampleManagedInstance.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ManagedInstance.cs b/sdk/dotnet/MSSql/ManagedInstance.cs index 9510273602..58a1ee4d8a 100644 --- a/sdk/dotnet/MSSql/ManagedInstance.cs +++ b/sdk/dotnet/MSSql/ManagedInstance.cs @@ -14,6 +14,236 @@ namespace Pulumi.Azure.MSSql /// /// > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var allowManagementInbound = new Azure.Network.NetworkSecurityRule("allowManagementInbound", new() + /// { + /// Priority = 106, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRanges = new[] + /// { + /// "9000", + /// "9003", + /// "1438", + /// "1440", + /// "1452", + /// }, + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowMisubnetInbound = new Azure.Network.NetworkSecurityRule("allowMisubnetInbound", new() + /// { + /// Priority = 200, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "10.0.0.0/24", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowHealthProbeInbound = new Azure.Network.NetworkSecurityRule("allowHealthProbeInbound", new() + /// { + /// Priority = 300, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "AzureLoadBalancer", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowTdsInbound = new Azure.Network.NetworkSecurityRule("allowTdsInbound", new() + /// { + /// Priority = 1000, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "1433", + /// SourceAddressPrefix = "VirtualNetwork", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var denyAllInbound = new Azure.Network.NetworkSecurityRule("denyAllInbound", new() + /// { + /// Priority = 4096, + /// Direction = "Inbound", + /// Access = "Deny", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowManagementOutbound = new Azure.Network.NetworkSecurityRule("allowManagementOutbound", new() + /// { + /// Priority = 102, + /// Direction = "Outbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRanges = new[] + /// { + /// "80", + /// "443", + /// "12000", + /// }, + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowMisubnetOutbound = new Azure.Network.NetworkSecurityRule("allowMisubnetOutbound", new() + /// { + /// Priority = 200, + /// Direction = "Outbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "10.0.0.0/24", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var denyAllOutbound = new Azure.Network.NetworkSecurityRule("denyAllOutbound", new() + /// { + /// Priority = 4096, + /// Direction = "Outbound", + /// Access = "Deny", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "managedinstancedelegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Sql/managedInstances", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + /// "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// var exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DisableBgpRoutePropagation = false, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleSubnet, + /// }, + /// }); + /// + /// var exampleSubnetRouteTableAssociation = new Azure.Network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// RouteTableId = exampleRouteTable.Id, + /// }); + /// + /// var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LicenseType = "BasePrice", + /// SkuName = "GP_Gen5", + /// StorageSizeInGb = 32, + /// SubnetId = exampleSubnet.Id, + /// Vcores = 4, + /// AdministratorLogin = "mradministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleSubnetNetworkSecurityGroupAssociation, + /// exampleSubnetRouteTableAssociation, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Microsoft SQL Managed Instances can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ManagedInstanceActiveDirectoryAdministrator.cs b/sdk/dotnet/MSSql/ManagedInstanceActiveDirectoryAdministrator.cs index ffd608a7dd..bfc7904572 100644 --- a/sdk/dotnet/MSSql/ManagedInstanceActiveDirectoryAdministrator.cs +++ b/sdk/dotnet/MSSql/ManagedInstanceActiveDirectoryAdministrator.cs @@ -12,6 +12,91 @@ namespace Pulumi.Azure.MSSql /// /// Allows you to set a user, group or service principal as the AAD Administrator for an Azure SQL Managed Instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LicenseType = "BasePrice", + /// SkuName = "GP_Gen5", + /// StorageSizeInGb = 32, + /// SubnetId = exampleSubnet.Id, + /// Vcores = 4, + /// AdministratorLogin = "msadministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// Identity = new Azure.MSSql.Inputs.ManagedInstanceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var reader = new AzureAD.DirectoryRole("reader", new() + /// { + /// DisplayName = "Directory Readers", + /// }); + /// + /// var exampleDirectoryRoleMember = new AzureAD.DirectoryRoleMember("exampleDirectoryRoleMember", new() + /// { + /// RoleObjectId = reader.ObjectId, + /// MemberObjectId = exampleManagedInstance.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var admin = new AzureAD.User("admin", new() + /// { + /// UserPrincipalName = "ms.admin@hashicorp.com", + /// DisplayName = "Ms Admin", + /// MailNickname = "ms.admin", + /// Password = "SecretP@sswd99!", + /// }); + /// + /// var exampleManagedInstanceActiveDirectoryAdministrator = new Azure.MSSql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", new() + /// { + /// ManagedInstanceId = exampleManagedInstance.Id, + /// LoginUsername = "msadmin", + /// ObjectId = admin.ObjectId, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An Azure SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ManagedInstanceSecurityAlertPolicy.cs b/sdk/dotnet/MSSql/ManagedInstanceSecurityAlertPolicy.cs index 5d394a7bcb..2546377bc2 100644 --- a/sdk/dotnet/MSSql/ManagedInstanceSecurityAlertPolicy.cs +++ b/sdk/dotnet/MSSql/ManagedInstanceSecurityAlertPolicy.cs @@ -12,6 +12,251 @@ namespace Pulumi.Azure.MSSql /// /// Manages a Security Alert Policy for an MS SQL Managed Instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var allowManagementInbound = new Azure.Network.NetworkSecurityRule("allowManagementInbound", new() + /// { + /// Priority = 106, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRanges = new[] + /// { + /// "9000", + /// "9003", + /// "1438", + /// "1440", + /// "1452", + /// }, + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowMisubnetInbound = new Azure.Network.NetworkSecurityRule("allowMisubnetInbound", new() + /// { + /// Priority = 200, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "10.0.0.0/24", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowHealthProbeInbound = new Azure.Network.NetworkSecurityRule("allowHealthProbeInbound", new() + /// { + /// Priority = 300, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "AzureLoadBalancer", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowTdsInbound = new Azure.Network.NetworkSecurityRule("allowTdsInbound", new() + /// { + /// Priority = 1000, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "1433", + /// SourceAddressPrefix = "VirtualNetwork", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var denyAllInbound = new Azure.Network.NetworkSecurityRule("denyAllInbound", new() + /// { + /// Priority = 4096, + /// Direction = "Inbound", + /// Access = "Deny", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowManagementOutbound = new Azure.Network.NetworkSecurityRule("allowManagementOutbound", new() + /// { + /// Priority = 102, + /// Direction = "Outbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRanges = new[] + /// { + /// "80", + /// "443", + /// "12000", + /// }, + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowMisubnetOutbound = new Azure.Network.NetworkSecurityRule("allowMisubnetOutbound", new() + /// { + /// Priority = 200, + /// Direction = "Outbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "10.0.0.0/24", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var denyAllOutbound = new Azure.Network.NetworkSecurityRule("denyAllOutbound", new() + /// { + /// Priority = 4096, + /// Direction = "Outbound", + /// Access = "Deny", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "managedinstancedelegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Sql/managedInstances", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + /// "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// var exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DisableBgpRoutePropagation = false, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleSubnet, + /// }, + /// }); + /// + /// var exampleSubnetRouteTableAssociation = new Azure.Network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// RouteTableId = exampleRouteTable.Id, + /// }); + /// + /// var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LicenseType = "BasePrice", + /// SkuName = "GP_Gen5", + /// StorageSizeInGb = 32, + /// SubnetId = exampleSubnet.Id, + /// Vcores = 4, + /// AdministratorLogin = "mradministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleSubnetNetworkSecurityGroupAssociation, + /// exampleSubnetRouteTableAssociation, + /// }, + /// }); + /// + /// var exampleManagedInstanceSecurityAlertPolicy = new Azure.MSSql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ManagedInstanceName = exampleManagedInstance.Name, + /// Enabled = true, + /// StorageEndpoint = azurerm_storage_account.Example.Primary_blob_endpoint, + /// StorageAccountAccessKey = azurerm_storage_account.Example.Primary_access_key, + /// DisabledAlerts = new[] + /// { + /// "Sql_Injection", + /// "Data_Exfiltration", + /// }, + /// RetentionDays = 20, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MS SQL Managed Instance Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ManagedInstanceTransparentDataEncryption.cs b/sdk/dotnet/MSSql/ManagedInstanceTransparentDataEncryption.cs index 999d7f53ea..71281a5500 100644 --- a/sdk/dotnet/MSSql/ManagedInstanceTransparentDataEncryption.cs +++ b/sdk/dotnet/MSSql/ManagedInstanceTransparentDataEncryption.cs @@ -17,6 +17,221 @@ namespace Pulumi.Azure.MSSql /// > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. /// /// ## Example Usage + /// ### With Service Managed Key + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "EastUs", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = azurerm_resource_group.Test.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "managedinstancedelegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Sql/managedInstances", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + /// "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LicenseType = "BasePrice", + /// SkuName = "GP_Gen5", + /// StorageSizeInGb = 32, + /// SubnetId = exampleSubnet.Id, + /// Vcores = 4, + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "NCC-1701-D", + /// Identity = new Azure.MSSql.Inputs.ManagedInstanceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleManagedInstanceTransparentDataEncryption = new Azure.MSSql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", new() + /// { + /// ManagedInstanceId = exampleManagedInstance.Id, + /// }); + /// + /// }); + /// ``` + /// ### With Customer Managed Key + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "EastUs", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = azurerm_resource_group.Test.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "managedinstancedelegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Sql/managedInstances", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + /// "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LicenseType = "BasePrice", + /// SkuName = "GP_Gen5", + /// StorageSizeInGb = 32, + /// SubnetId = exampleSubnet.Id, + /// Vcores = 4, + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "NCC-1701-D", + /// Identity = new Azure.MSSql.Inputs.ManagedInstanceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// // Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// EnabledForDiskEncryption = true, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SoftDeleteRetentionDays = 7, + /// PurgeProtectionEnabled = false, + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "List", + /// "Create", + /// "Delete", + /// "Update", + /// "Recover", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleManagedInstance.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleManagedInstance.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "WrapKey", + /// "UnwrapKey", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "unwrapKey", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleKeyVault, + /// }, + /// }); + /// + /// var exampleManagedInstanceTransparentDataEncryption = new Azure.MSSql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", new() + /// { + /// ManagedInstanceId = exampleManagedInstance.Id, + /// KeyVaultKeyId = exampleKey.Id, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/MSSql/ManagedInstanceVulnerabilityAssessment.cs b/sdk/dotnet/MSSql/ManagedInstanceVulnerabilityAssessment.cs index 8f427ad216..3e78ee6e0f 100644 --- a/sdk/dotnet/MSSql/ManagedInstanceVulnerabilityAssessment.cs +++ b/sdk/dotnet/MSSql/ManagedInstanceVulnerabilityAssessment.cs @@ -12,6 +12,109 @@ namespace Pulumi.Azure.MSSql /// /// Manages the Vulnerability Assessment for an MS Managed Instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleManagedInstance = new Azure.MSSql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// LicenseType = "BasePrice", + /// SkuName = "GP_Gen5", + /// StorageSizeInGb = 32, + /// SubnetId = exampleSubnet.Id, + /// Vcores = 4, + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "NCC-1701-D", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleManagedInstanceSecurityAlertPolicy = new Azure.MSSql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", new() + /// { + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// ManagedInstanceName = azurerm_mssql_managed_instance.Test.Name, + /// Enabled = true, + /// StorageEndpoint = azurerm_storage_account.Test.Primary_blob_endpoint, + /// StorageAccountAccessKey = azurerm_storage_account.Test.Primary_access_key, + /// RetentionDays = 30, + /// }); + /// + /// var exampleManagedInstanceVulnerabilityAssessment = new Azure.MSSql.ManagedInstanceVulnerabilityAssessment("exampleManagedInstanceVulnerabilityAssessment", new() + /// { + /// ManagedInstanceId = exampleManagedInstance.Id, + /// StorageContainerPath = Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values => + /// { + /// var primaryBlobEndpoint = values.Item1; + /// var name = values.Item2; + /// return $"{primaryBlobEndpoint}{name}/"; + /// }), + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// RecurringScans = new Azure.MSSql.Inputs.ManagedInstanceVulnerabilityAssessmentRecurringScansArgs + /// { + /// Enabled = true, + /// EmailSubscriptionAdmins = true, + /// Emails = new[] + /// { + /// "email@example1.com", + /// "email@example2.com", + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleManagedInstanceSecurityAlertPolicy, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/OutboundFirewallRule.cs b/sdk/dotnet/MSSql/OutboundFirewallRule.cs index f19ce6bd19..dc31556ee2 100644 --- a/sdk/dotnet/MSSql/OutboundFirewallRule.cs +++ b/sdk/dotnet/MSSql/OutboundFirewallRule.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.MSSql /// /// Allows you to manage an Azure SQL Outbound Firewall Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// OutboundNetworkRestrictionEnabled = true, + /// }); + /// + /// var exampleOutboundFirewallRule = new Azure.MSSql.OutboundFirewallRule("exampleOutboundFirewallRule", new() + /// { + /// ServerId = exampleServer.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Outbound Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/Server.cs b/sdk/dotnet/MSSql/Server.cs index 348194ef93..9e8d7e630f 100644 --- a/sdk/dotnet/MSSql/Server.cs +++ b/sdk/dotnet/MSSql/Server.cs @@ -12,6 +12,153 @@ namespace Pulumi.Azure.MSSql /// /// Manages a Microsoft SQL Azure Database Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "thisIsKat11", + /// MinimumTlsVersion = "1.2", + /// AzureadAdministrator = new Azure.MSSql.Inputs.ServerAzureadAdministratorArgs + /// { + /// LoginUsername = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Tags = + /// { + /// { "environment", "production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Transparent Data Encryption(TDE) With A Customer Managed Key(CMK) During Create + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// // Create a key vault with access policies which allow for the current user to get, list, create, delete, update, recover, purge and getRotationPolicy for the key vault key and also add a key vault access policy for the Microsoft Sql Server instance User Managed Identity to get, wrap, and unwrap key(s) + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// EnabledForDiskEncryption = true, + /// TenantId = exampleUserAssignedIdentity.TenantId, + /// SoftDeleteRetentionDays = 7, + /// PurgeProtectionEnabled = true, + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "List", + /// "Create", + /// "Delete", + /// "Update", + /// "Recover", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleUserAssignedIdentity.TenantId, + /// ObjectId = exampleUserAssignedIdentity.PrincipalId, + /// KeyPermissions = new[] + /// { + /// "Get", + /// "WrapKey", + /// "UnwrapKey", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "unwrapKey", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleKeyVault, + /// }, + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "Example-Administrator", + /// AdministratorLoginPassword = "Example_Password!", + /// MinimumTlsVersion = "1.2", + /// AzureadAdministrator = new Azure.MSSql.Inputs.ServerAzureadAdministratorArgs + /// { + /// LoginUsername = exampleUserAssignedIdentity.Name, + /// ObjectId = exampleUserAssignedIdentity.PrincipalId, + /// }, + /// Identity = new Azure.MSSql.Inputs.ServerIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// PrimaryUserAssignedIdentityId = exampleUserAssignedIdentity.Id, + /// TransparentDataEncryptionKeyVaultKeyId = exampleKey.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ServerDnsAlias.cs b/sdk/dotnet/MSSql/ServerDnsAlias.cs index 6255d22468..aa7ce889d8 100644 --- a/sdk/dotnet/MSSql/ServerDnsAlias.cs +++ b/sdk/dotnet/MSSql/ServerDnsAlias.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.MSSql /// /// Manages a MS SQL Server DNS Alias. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "AdminPassword123!", + /// }); + /// + /// var exampleServerDnsAlias = new Azure.MSSql.ServerDnsAlias("exampleServerDnsAlias", new() + /// { + /// MssqlServerId = exampleServer.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MSSQL Server DNS Aliass can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ServerExtendedAuditingPolicy.cs b/sdk/dotnet/MSSql/ServerExtendedAuditingPolicy.cs index e49886e837..8d0bbd1a6e 100644 --- a/sdk/dotnet/MSSql/ServerExtendedAuditingPolicy.cs +++ b/sdk/dotnet/MSSql/ServerExtendedAuditingPolicy.cs @@ -12,6 +12,179 @@ namespace Pulumi.Azure.MSSql /// /// Manages a MS SQL Server Extended Auditing Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "AdminPassword123!", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServerExtendedAuditingPolicy = new Azure.MSSql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", new() + /// { + /// ServerId = exampleServer.Id, + /// StorageEndpoint = exampleAccount.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// StorageAccountAccessKeyIsSecondary = false, + /// RetentionInDays = 6, + /// }); + /// + /// }); + /// ``` + /// ### With Storage Account Behind VNet And Firewall + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// "Microsoft.Storage", + /// }, + /// EnforcePrivateLinkEndpointNetworkPolicies = true, + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "AdminPassword123!", + /// MinimumTlsVersion = "1.2", + /// Identity = new Azure.MSSql.Inputs.ServerIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionName = "Storage Blob Data Contributor", + /// PrincipalId = exampleServer.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var sqlvnetrule = new Azure.Sql.VirtualNetworkRule("sqlvnetrule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// var exampleFirewallRule = new Azure.Sql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "0.0.0.0", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// AllowNestedItemsToBePublic = false, + /// NetworkRules = new Azure.Storage.Inputs.AccountNetworkRulesArgs + /// { + /// DefaultAction = "Deny", + /// IpRules = new[] + /// { + /// "127.0.0.1", + /// }, + /// VirtualNetworkSubnetIds = new[] + /// { + /// exampleSubnet.Id, + /// }, + /// Bypasses = new[] + /// { + /// "AzureServices", + /// }, + /// }, + /// Identity = new Azure.Storage.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleServerExtendedAuditingPolicy = new Azure.MSSql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", new() + /// { + /// StorageEndpoint = exampleAccount.PrimaryBlobEndpoint, + /// ServerId = exampleServer.Id, + /// RetentionInDays = 6, + /// LogMonitoringEnabled = false, + /// StorageAccountSubscriptionId = azurerm_subscription.Primary.Subscription_id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// exampleAccount, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MS SQL Server Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ServerMicrosoftSupportAuditingPolicy.cs b/sdk/dotnet/MSSql/ServerMicrosoftSupportAuditingPolicy.cs index 8da88c5c39..702ad2091d 100644 --- a/sdk/dotnet/MSSql/ServerMicrosoftSupportAuditingPolicy.cs +++ b/sdk/dotnet/MSSql/ServerMicrosoftSupportAuditingPolicy.cs @@ -12,6 +12,175 @@ namespace Pulumi.Azure.MSSql /// /// Manages a MS SQL Server Microsoft Support Auditing Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "AdminPassword123!", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleServerMicrosoftSupportAuditingPolicy = new Azure.MSSql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", new() + /// { + /// ServerId = exampleServer.Id, + /// BlobStorageEndpoint = exampleAccount.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` + /// ### With Storage Account Behind VNet And Firewall + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// "Microsoft.Storage", + /// }, + /// EnforcePrivateLinkEndpointNetworkPolicies = true, + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "AdminPassword123!", + /// MinimumTlsVersion = "1.2", + /// Identity = new Azure.MSSql.Inputs.ServerIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionName = "Storage Blob Data Contributor", + /// PrincipalId = exampleServer.Identity.Apply(identity => identity?.PrincipalId), + /// }); + /// + /// var sqlvnetrule = new Azure.Sql.VirtualNetworkRule("sqlvnetrule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// var exampleFirewallRule = new Azure.Sql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "0.0.0.0", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// AllowNestedItemsToBePublic = false, + /// NetworkRules = new Azure.Storage.Inputs.AccountNetworkRulesArgs + /// { + /// DefaultAction = "Deny", + /// IpRules = new[] + /// { + /// "127.0.0.1", + /// }, + /// VirtualNetworkSubnetIds = new[] + /// { + /// exampleSubnet.Id, + /// }, + /// Bypasses = new[] + /// { + /// "AzureServices", + /// }, + /// }, + /// Identity = new Azure.Storage.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleServerMicrosoftSupportAuditingPolicy = new Azure.MSSql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", new() + /// { + /// BlobStorageEndpoint = exampleAccount.PrimaryBlobEndpoint, + /// ServerId = exampleServer.Id, + /// LogMonitoringEnabled = false, + /// StorageAccountSubscriptionId = azurerm_subscription.Primary.Subscription_id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAssignment, + /// exampleAccount, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MS SQL Server Microsoft Support Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ServerSecurityAlertPolicy.cs b/sdk/dotnet/MSSql/ServerSecurityAlertPolicy.cs index 23ac0ba8c0..746fc5920e 100644 --- a/sdk/dotnet/MSSql/ServerSecurityAlertPolicy.cs +++ b/sdk/dotnet/MSSql/ServerSecurityAlertPolicy.cs @@ -14,6 +14,56 @@ namespace Pulumi.Azure.MSSql /// /// > **NOTE** Security Alert Policy is currently only available for MS SQL databases. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServerSecurityAlertPolicy = new Azure.MSSql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleSqlServer.Name, + /// State = "Enabled", + /// StorageEndpoint = exampleAccount.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// DisabledAlerts = new[] + /// { + /// "Sql_Injection", + /// "Data_Exfiltration", + /// }, + /// RetentionDays = 20, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MS SQL Server Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/ServerTransparentDataEncryption.cs b/sdk/dotnet/MSSql/ServerTransparentDataEncryption.cs index a08572bba5..bb972c689e 100644 --- a/sdk/dotnet/MSSql/ServerTransparentDataEncryption.cs +++ b/sdk/dotnet/MSSql/ServerTransparentDataEncryption.cs @@ -19,6 +19,155 @@ namespace Pulumi.Azure.MSSql /// > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. /// /// ## Example Usage + /// ### With Service Managed Key + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "EastUs", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "thisIsKat11", + /// MinimumTlsVersion = "1.2", + /// AzureadAdministrator = new Azure.MSSql.Inputs.ServerAzureadAdministratorArgs + /// { + /// LoginUsername = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Tags = + /// { + /// { "environment", "production" }, + /// }, + /// }); + /// + /// var exampleServerTransparentDataEncryption = new Azure.MSSql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", new() + /// { + /// ServerId = exampleServer.Id, + /// }); + /// + /// }); + /// ``` + /// ### With Customer Managed Key + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "EastUs", + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "missadministrator", + /// AdministratorLoginPassword = "thisIsKat11", + /// MinimumTlsVersion = "1.2", + /// AzureadAdministrator = new Azure.MSSql.Inputs.ServerAzureadAdministratorArgs + /// { + /// LoginUsername = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Tags = + /// { + /// { "environment", "production" }, + /// }, + /// Identity = new Azure.MSSql.Inputs.ServerIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// // Create a key vault with policies for the deployer to create a key & SQL Server to wrap/unwrap/get key + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// EnabledForDiskEncryption = true, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SoftDeleteRetentionDays = 7, + /// PurgeProtectionEnabled = false, + /// SkuName = "standard", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "List", + /// "Create", + /// "Delete", + /// "Update", + /// "Recover", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = exampleServer.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleServer.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "WrapKey", + /// "UnwrapKey", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "unwrapKey", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleKeyVault, + /// }, + /// }); + /// + /// var exampleServerTransparentDataEncryption = new Azure.MSSql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", new() + /// { + /// ServerId = exampleServer.Id, + /// KeyVaultKeyId = exampleKey.Id, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/MSSql/ServerVulnerabilityAssessment.cs b/sdk/dotnet/MSSql/ServerVulnerabilityAssessment.cs index 31bcb3c69e..103f188f5f 100644 --- a/sdk/dotnet/MSSql/ServerVulnerabilityAssessment.cs +++ b/sdk/dotnet/MSSql/ServerVulnerabilityAssessment.cs @@ -14,6 +14,76 @@ namespace Pulumi.Azure.MSSql /// /// > **NOTE** Vulnerability Assessment is currently only available for MS SQL databases. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleServerSecurityAlertPolicy = new Azure.MSSql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleSqlServer.Name, + /// State = "Enabled", + /// }); + /// + /// var exampleServerVulnerabilityAssessment = new Azure.MSSql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", new() + /// { + /// ServerSecurityAlertPolicyId = exampleServerSecurityAlertPolicy.Id, + /// StorageContainerPath = Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values => + /// { + /// var primaryBlobEndpoint = values.Item1; + /// var name = values.Item2; + /// return $"{primaryBlobEndpoint}{name}/"; + /// }), + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// RecurringScans = new Azure.MSSql.Inputs.ServerVulnerabilityAssessmentRecurringScansArgs + /// { + /// Enabled = true, + /// EmailSubscriptionAdmins = true, + /// Emails = new[] + /// { + /// "email@example1.com", + /// "email@example2.com", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MS SQL Server Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/VirtualMachine.cs b/sdk/dotnet/MSSql/VirtualMachine.cs index c8125c4b79..76f8549efc 100644 --- a/sdk/dotnet/MSSql/VirtualMachine.cs +++ b/sdk/dotnet/MSSql/VirtualMachine.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.MSSql /// /// Manages a Microsoft SQL Virtual Machine /// + /// ## Example Usage + /// + /// This example provisions a brief Managed Microsoft SQL Virtual Machine. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleVirtualMachine = Azure.Compute.GetVirtualMachine.Invoke(new() + /// { + /// Name = "example-vm", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleMssql_virtualMachineVirtualMachine = new Azure.MSSql.VirtualMachine("exampleMssql/virtualMachineVirtualMachine", new() + /// { + /// VirtualMachineId = exampleVirtualMachine.Apply(getVirtualMachineResult => getVirtualMachineResult.Id), + /// SqlLicenseType = "PAYG", + /// RServicesEnabled = true, + /// SqlConnectivityPort = 1433, + /// SqlConnectivityType = "PRIVATE", + /// SqlConnectivityUpdatePassword = "Password1234!", + /// SqlConnectivityUpdateUsername = "sqllogin", + /// AutoPatching = new Azure.MSSql.Inputs.VirtualMachineAutoPatchingArgs + /// { + /// DayOfWeek = "Sunday", + /// MaintenanceWindowDurationInMinutes = 60, + /// MaintenanceWindowStartingHour = 2, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Microsoft SQL Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/VirtualMachineGroup.cs b/sdk/dotnet/MSSql/VirtualMachineGroup.cs index 30277a5c65..abcab59286 100644 --- a/sdk/dotnet/MSSql/VirtualMachineGroup.cs +++ b/sdk/dotnet/MSSql/VirtualMachineGroup.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.MSSql /// /// Manages a Microsoft SQL Virtual Machine Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualMachineGroup = new Azure.MSSql.VirtualMachineGroup("exampleVirtualMachineGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SqlImageOffer = "SQL2017-WS2016", + /// SqlImageSku = "Developer", + /// WsfcDomainProfile = new Azure.MSSql.Inputs.VirtualMachineGroupWsfcDomainProfileArgs + /// { + /// Fqdn = "testdomain.com", + /// ClusterSubnetType = "SingleSubnet", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Microsoft SQL Virtual Machine Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MSSql/VirtualNetworkRule.cs b/sdk/dotnet/MSSql/VirtualNetworkRule.cs index ce3005934e..19a435dee4 100644 --- a/sdk/dotnet/MSSql/VirtualNetworkRule.cs +++ b/sdk/dotnet/MSSql/VirtualNetworkRule.cs @@ -12,6 +12,63 @@ namespace Pulumi.Azure.MSSql /// /// Allows you to manage rules for allowing traffic between an Azure SQL server and a subnet of a virtual network. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// }, + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleVirtualNetworkRule = new Azure.MSSql.VirtualNetworkRule("exampleVirtualNetworkRule", new() + /// { + /// ServerId = exampleServer.Id, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MachineLearning/ComputeCluster.cs b/sdk/dotnet/MachineLearning/ComputeCluster.cs index e14cd84ee0..7b5736acb4 100644 --- a/sdk/dotnet/MachineLearning/ComputeCluster.cs +++ b/sdk/dotnet/MachineLearning/ComputeCluster.cs @@ -13,6 +13,106 @@ namespace Pulumi.Azure.MachineLearning /// Manages a Machine Learning Compute Cluster. /// **NOTE:** At this point in time the resource cannot be updated (not supported by the backend Azure Go SDK). Therefore it can only be created and deleted, not updated. At the moment, there is also no possibility to specify ssh User Account Credentials to ssh into the compute cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// Tags = + /// { + /// { "stage", "example" }, + /// }, + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.1.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.1.0.0/24", + /// }, + /// }); + /// + /// var test = new Azure.MachineLearning.ComputeCluster("test", new() + /// { + /// Location = exampleResourceGroup.Location, + /// VmPriority = "LowPriority", + /// VmSize = "Standard_DS2_v2", + /// MachineLearningWorkspaceId = exampleWorkspace.Id, + /// SubnetResourceId = exampleSubnet.Id, + /// ScaleSettings = new Azure.MachineLearning.Inputs.ComputeClusterScaleSettingsArgs + /// { + /// MinNodeCount = 0, + /// MaxNodeCount = 1, + /// ScaleDownNodesAfterIdleDuration = "PT30S", + /// }, + /// Identity = new Azure.MachineLearning.Inputs.ComputeClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Machine Learning Compute Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MachineLearning/ComputeInstance.cs b/sdk/dotnet/MachineLearning/ComputeInstance.cs index fcd05610db..2aaeb752c4 100644 --- a/sdk/dotnet/MachineLearning/ComputeInstance.cs +++ b/sdk/dotnet/MachineLearning/ComputeInstance.cs @@ -12,6 +12,107 @@ namespace Pulumi.Azure.MachineLearning /// /// Manages a Machine Learning Compute Instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// Tags = + /// { + /// { "stage", "example" }, + /// }, + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.1.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.1.0.0/24", + /// }, + /// }); + /// + /// var config = new Config(); + /// var sshKey = config.Get("sshKey") ?? "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld"; + /// var exampleComputeInstance = new Azure.MachineLearning.ComputeInstance("exampleComputeInstance", new() + /// { + /// Location = exampleResourceGroup.Location, + /// MachineLearningWorkspaceId = exampleWorkspace.Id, + /// VirtualMachineSize = "STANDARD_DS2_V2", + /// AuthorizationType = "personal", + /// Ssh = new Azure.MachineLearning.Inputs.ComputeInstanceSshArgs + /// { + /// PublicKey = sshKey, + /// }, + /// SubnetResourceId = exampleSubnet.Id, + /// Description = "foo", + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Machine Learning Compute Instances can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MachineLearning/DatastoreBlobstorage.cs b/sdk/dotnet/MachineLearning/DatastoreBlobstorage.cs index c6a5a3729f..06ce8547ba 100644 --- a/sdk/dotnet/MachineLearning/DatastoreBlobstorage.cs +++ b/sdk/dotnet/MachineLearning/DatastoreBlobstorage.cs @@ -13,6 +13,74 @@ namespace Pulumi.Azure.MachineLearning /// Manages a Machine Learning Blob Storage DataStore. /// /// ## Example Usage + /// ### With Azure Blob + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleDatastoreBlobstorage = new Azure.MachineLearning.DatastoreBlobstorage("exampleDatastoreBlobstorage", new() + /// { + /// WorkspaceId = exampleWorkspace.Id, + /// StorageContainerId = exampleContainer.ResourceManagerId, + /// AccountKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/MachineLearning/DatastoreDatalakeGen2.cs b/sdk/dotnet/MachineLearning/DatastoreDatalakeGen2.cs index e0432f5ccb..d3bd34e632 100644 --- a/sdk/dotnet/MachineLearning/DatastoreDatalakeGen2.cs +++ b/sdk/dotnet/MachineLearning/DatastoreDatalakeGen2.cs @@ -12,6 +12,74 @@ namespace Pulumi.Azure.MachineLearning /// /// Manages a Machine Learning Data Lake Gen2 DataStore. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleDatastoreDatalakeGen2 = new Azure.MachineLearning.DatastoreDatalakeGen2("exampleDatastoreDatalakeGen2", new() + /// { + /// WorkspaceId = exampleWorkspace.Id, + /// StorageContainerId = exampleContainer.ResourceManagerId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Machine Learning DataStores can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MachineLearning/GetWorkspace.cs b/sdk/dotnet/MachineLearning/GetWorkspace.cs index faf5528b5f..eeebd506c7 100644 --- a/sdk/dotnet/MachineLearning/GetWorkspace.cs +++ b/sdk/dotnet/MachineLearning/GetWorkspace.cs @@ -13,12 +13,66 @@ public static class GetWorkspace { /// /// Use this data source to access information about an existing Machine Learning Workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.MachineLearning.GetWorkspace.Invoke(new() + /// { + /// Name = "example-workspace", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = azurerm_machine_learning_workspace.Existing.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWorkspaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:machinelearning/getWorkspace:getWorkspace", args ?? new GetWorkspaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Machine Learning Workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.MachineLearning.GetWorkspace.Invoke(new() + /// { + /// Name = "example-workspace", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = azurerm_machine_learning_workspace.Existing.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWorkspaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:machinelearning/getWorkspace:getWorkspace", args ?? new GetWorkspaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MachineLearning/InferenceCluster.cs b/sdk/dotnet/MachineLearning/InferenceCluster.cs index 9c17fc3bad..96b3a88e4a 100644 --- a/sdk/dotnet/MachineLearning/InferenceCluster.cs +++ b/sdk/dotnet/MachineLearning/InferenceCluster.cs @@ -14,6 +14,118 @@ namespace Pulumi.Azure.MachineLearning /// /// > **NOTE:** The Machine Learning Inference Cluster resource is used to attach an existing AKS cluster to the Machine Learning Workspace, it doesn't create the AKS cluster itself. Therefore it can only be created and deleted, not updated. Any change to the configuration will recreate the resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// Tags = + /// { + /// { "stage", "example" }, + /// }, + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.1.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.1.0.0/24", + /// }, + /// }); + /// + /// var exampleKubernetesCluster = new Azure.ContainerService.KubernetesCluster("exampleKubernetesCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DnsPrefixPrivateCluster = "prefix", + /// DefaultNodePool = new Azure.ContainerService.Inputs.KubernetesClusterDefaultNodePoolArgs + /// { + /// Name = "default", + /// NodeCount = 3, + /// VmSize = "Standard_D3_v2", + /// VnetSubnetId = exampleSubnet.Id, + /// }, + /// Identity = new Azure.ContainerService.Inputs.KubernetesClusterIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleInferenceCluster = new Azure.MachineLearning.InferenceCluster("exampleInferenceCluster", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ClusterPurpose = "FastProd", + /// KubernetesClusterId = exampleKubernetesCluster.Id, + /// Description = "This is an example cluster used with Terraform", + /// MachineLearningWorkspaceId = exampleWorkspace.Id, + /// Tags = + /// { + /// { "stage", "example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Machine Learning Inference Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MachineLearning/SynapseSpark.cs b/sdk/dotnet/MachineLearning/SynapseSpark.cs index bd85263c00..5c74ffdff1 100644 --- a/sdk/dotnet/MachineLearning/SynapseSpark.cs +++ b/sdk/dotnet/MachineLearning/SynapseSpark.cs @@ -12,6 +12,104 @@ namespace Pulumi.Azure.MachineLearning /// /// Manages the linked service to link an Azure Machine learning workspace to an Azure Synapse workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// Tags = + /// { + /// { "stage", "example" }, + /// }, + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleSynapse_workspaceWorkspace = new Azure.Synapse.Workspace("exampleSynapse/workspaceWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSparkPool = new Azure.Synapse.SparkPool("exampleSparkPool", new() + /// { + /// SynapseWorkspaceId = exampleSynapse / workspaceWorkspace.Id, + /// NodeSizeFamily = "MemoryOptimized", + /// NodeSize = "Small", + /// NodeCount = 3, + /// }); + /// + /// var exampleSynapseSpark = new Azure.MachineLearning.SynapseSpark("exampleSynapseSpark", new() + /// { + /// MachineLearningWorkspaceId = exampleWorkspace.Id, + /// Location = exampleResourceGroup.Location, + /// SynapseSparkPoolId = exampleSparkPool.Id, + /// Identity = new Azure.MachineLearning.Inputs.SynapseSparkIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Machine Learning Synapse Sparks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MachineLearning/Workspace.cs b/sdk/dotnet/MachineLearning/Workspace.cs index e3b9bfd35b..4be7875cee 100644 --- a/sdk/dotnet/MachineLearning/Workspace.cs +++ b/sdk/dotnet/MachineLearning/Workspace.cs @@ -10,6 +10,367 @@ namespace Pulumi.Azure.MachineLearning { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### With Data Encryption + /// + /// > **NOTE:** The Key Vault must enable purge protection. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleAccessPolicy = new Azure.KeyVault.AccessPolicy("exampleAccessPolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// "Delete", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleKeyVault, + /// exampleAccessPolicy, + /// }, + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Encryption = new Azure.MachineLearning.Inputs.WorkspaceEncryptionArgs + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyId = exampleKey.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### With User Assigned Identity And Data Encryption + /// + /// > **NOTE:** The Key Vault must enable purge protection. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var example_identity = new Azure.KeyVault.AccessPolicy("example-identity", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleUserAssignedIdentity.PrincipalId, + /// KeyPermissions = new[] + /// { + /// "WrapKey", + /// "UnwrapKey", + /// "Get", + /// "Recover", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// "List", + /// "Set", + /// "Delete", + /// "Recover", + /// "Backup", + /// "Restore", + /// }, + /// }); + /// + /// var example_sp = new Azure.KeyVault.AccessPolicy("example-sp", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "Recover", + /// "Delete", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var test = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// DisplayName = "Azure Cosmos DB", + /// }); + /// + /// var example_cosmosdb = new Azure.KeyVault.AccessPolicy("example-cosmosdb", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = test.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = + /// { + /// test, + /// current, + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleKeyVault, + /// example_sp, + /// }, + /// }); + /// + /// var example_role1 = new Azure.Authorization.Assignment("example-role1", new() + /// { + /// Scope = exampleKeyVault.Id, + /// RoleDefinitionName = "Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var example_role2 = new Azure.Authorization.Assignment("example-role2", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Storage Blob Data Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var example_role3 = new Azure.Authorization.Assignment("example-role3", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var example_role4 = new Azure.Authorization.Assignment("example-role4", new() + /// { + /// Scope = exampleInsights.Id, + /// RoleDefinitionName = "Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var exampleWorkspace = new Azure.MachineLearning.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationInsightsId = exampleInsights.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// HighBusinessImpact = true, + /// PrimaryUserAssignedIdentity = exampleUserAssignedIdentity.Id, + /// Identity = new Azure.MachineLearning.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Encryption = new Azure.MachineLearning.Inputs.WorkspaceEncryptionArgs + /// { + /// UserAssignedIdentityId = exampleUserAssignedIdentity.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// KeyId = exampleKey.Id, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// example_role1, + /// example_role2, + /// example_role3, + /// example_role4, + /// example_cosmosdb, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Machine Learning Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Maintenance/AssignmentDedicatedHost.cs b/sdk/dotnet/Maintenance/AssignmentDedicatedHost.cs index f115a5e8e7..3a28e56434 100644 --- a/sdk/dotnet/Maintenance/AssignmentDedicatedHost.cs +++ b/sdk/dotnet/Maintenance/AssignmentDedicatedHost.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.Maintenance /// /// Manages a maintenance assignment to Dedicated Host. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDedicatedHostGroup = new Azure.Compute.DedicatedHostGroup("exampleDedicatedHostGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PlatformFaultDomainCount = 2, + /// }); + /// + /// var exampleDedicatedHost = new Azure.Compute.DedicatedHost("exampleDedicatedHost", new() + /// { + /// Location = exampleResourceGroup.Location, + /// DedicatedHostGroupId = exampleDedicatedHostGroup.Id, + /// SkuName = "DSv3-Type1", + /// PlatformFaultDomain = 1, + /// }); + /// + /// var exampleConfiguration = new Azure.Maintenance.Configuration("exampleConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Scope = "Host", + /// }); + /// + /// var exampleAssignmentDedicatedHost = new Azure.Maintenance.AssignmentDedicatedHost("exampleAssignmentDedicatedHost", new() + /// { + /// Location = exampleResourceGroup.Location, + /// MaintenanceConfigurationId = exampleConfiguration.Id, + /// DedicatedHostId = exampleDedicatedHost.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Maintenance/AssignmentVirtualMachine.cs b/sdk/dotnet/Maintenance/AssignmentVirtualMachine.cs index f3991f0986..d0cc59e2d8 100644 --- a/sdk/dotnet/Maintenance/AssignmentVirtualMachine.cs +++ b/sdk/dotnet/Maintenance/AssignmentVirtualMachine.cs @@ -12,6 +12,106 @@ namespace Pulumi.Azure.Maintenance /// /// Manages a maintenance assignment to virtual machine. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_F2", + /// AdminUsername = "adminuser", + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// AdminSshKeys = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineAdminSshKeyArgs + /// { + /// Username = "adminuser", + /// PublicKey = File.ReadAllText("~/.ssh/id_rsa.pub"), + /// }, + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// }); + /// + /// var exampleConfiguration = new Azure.Maintenance.Configuration("exampleConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Scope = "All", + /// }); + /// + /// var exampleAssignmentVirtualMachine = new Azure.Maintenance.AssignmentVirtualMachine("exampleAssignmentVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// MaintenanceConfigurationId = exampleConfiguration.Id, + /// VirtualMachineId = exampleLinuxVirtualMachine.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Maintenance/AssignmentVirtualMachineScaleSet.cs b/sdk/dotnet/Maintenance/AssignmentVirtualMachineScaleSet.cs index 76314c2700..55501b97bd 100644 --- a/sdk/dotnet/Maintenance/AssignmentVirtualMachineScaleSet.cs +++ b/sdk/dotnet/Maintenance/AssignmentVirtualMachineScaleSet.cs @@ -12,6 +12,205 @@ namespace Pulumi.Azure.Maintenance /// /// Manages a maintenance assignment to a virtual machine scale set. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "internal", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleBackendAddressPool = new Azure.Lb.BackendAddressPool("exampleBackendAddressPool", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// }); + /// + /// var exampleProbe = new Azure.Lb.Probe("exampleProbe", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Port = 22, + /// Protocol = "Tcp", + /// }); + /// + /// var exampleRule = new Azure.Lb.Rule("exampleRule", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// ProbeId = exampleProbe.Id, + /// FrontendIpConfigurationName = "internal", + /// Protocol = "Tcp", + /// FrontendPort = 22, + /// BackendPort = 22, + /// }); + /// + /// var exampleConfiguration = new Azure.Maintenance.Configuration("exampleConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Scope = "OSImage", + /// Visibility = "Custom", + /// Window = new Azure.Maintenance.Inputs.ConfigurationWindowArgs + /// { + /// StartDateTime = "2021-12-31 00:00", + /// ExpirationDateTime = "9999-12-31 00:00", + /// Duration = "06:00", + /// TimeZone = "Pacific Standard Time", + /// RecurEvery = "1Days", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_F2", + /// AdminUsername = "adminuser", + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard_F2", + /// Instances = 1, + /// AdminUsername = "adminuser", + /// AdminPassword = "P@ssword1234!", + /// UpgradeMode = "Automatic", + /// HealthProbeId = exampleProbe.Id, + /// DisablePasswordAuthentication = false, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs + /// { + /// StorageAccountType = "Standard_LRS", + /// Caching = "ReadWrite", + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "example", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// Primary = true, + /// SubnetId = exampleSubnet.Id, + /// LoadBalancerBackendAddressPoolIds = new[] + /// { + /// exampleBackendAddressPool.Id, + /// }, + /// }, + /// }, + /// }, + /// }, + /// AutomaticOsUpgradePolicy = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyArgs + /// { + /// DisableAutomaticRollback = true, + /// EnableAutomaticOsUpgrade = true, + /// }, + /// RollingUpgradePolicy = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs + /// { + /// MaxBatchInstancePercent = 20, + /// MaxUnhealthyInstancePercent = 20, + /// MaxUnhealthyUpgradedInstancePercent = 20, + /// PauseTimeBetweenBatches = "PT0S", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// "azurerm_lb_rule.example", + /// }, + /// }); + /// + /// var exampleAssignmentVirtualMachineScaleSet = new Azure.Maintenance.AssignmentVirtualMachineScaleSet("exampleAssignmentVirtualMachineScaleSet", new() + /// { + /// Location = exampleResourceGroup.Location, + /// MaintenanceConfigurationId = exampleConfiguration.Id, + /// VirtualMachineScaleSetId = exampleLinuxVirtualMachine.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Maintenance/Configuration.cs b/sdk/dotnet/Maintenance/Configuration.cs index cd48d5e61b..e925b1fe84 100644 --- a/sdk/dotnet/Maintenance/Configuration.cs +++ b/sdk/dotnet/Maintenance/Configuration.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Maintenance /// /// Manages a maintenance configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleConfiguration = new Azure.Maintenance.Configuration("exampleConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Scope = "SQLDB", + /// Tags = + /// { + /// { "Env", "prod" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Maintenance Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Maintenance/GetConfiguration.cs b/sdk/dotnet/Maintenance/GetConfiguration.cs index b801da6fcc..bf75fad7d2 100644 --- a/sdk/dotnet/Maintenance/GetConfiguration.cs +++ b/sdk/dotnet/Maintenance/GetConfiguration.cs @@ -13,12 +13,66 @@ public static class GetConfiguration { /// /// Use this data source to access information about an existing Maintenance Configuration. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Maintenance.GetConfiguration.Invoke(new() + /// { + /// Name = "example-mc", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = azurerm_maintenance_configuration.Existing.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetConfigurationArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:maintenance/getConfiguration:getConfiguration", args ?? new GetConfigurationArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Maintenance Configuration. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Maintenance.GetConfiguration.Invoke(new() + /// { + /// Name = "example-mc", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = azurerm_maintenance_configuration.Existing.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetConfigurationInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:maintenance/getConfiguration:getConfiguration", args ?? new GetConfigurationInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Maintenance/GetPublicConfigurations.cs b/sdk/dotnet/Maintenance/GetPublicConfigurations.cs index 841b6199ba..112f4dadd3 100644 --- a/sdk/dotnet/Maintenance/GetPublicConfigurations.cs +++ b/sdk/dotnet/Maintenance/GetPublicConfigurations.cs @@ -13,12 +13,68 @@ public static class GetPublicConfigurations { /// /// Use this data source to access information about existing Public Maintenance Configurations. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Maintenance.GetPublicConfigurations.Invoke(new() + /// { + /// Location = "West Europe", + /// Scope = "SQLManagedInstance", + /// RecurEvery = "Monday-Thursday", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["name"] = existing.Apply(getPublicConfigurationsResult => getPublicConfigurationsResult.Configs[0]?.Name), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPublicConfigurationsArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:maintenance/getPublicConfigurations:getPublicConfigurations", args ?? new GetPublicConfigurationsArgs(), options.WithDefaults()); /// /// Use this data source to access information about existing Public Maintenance Configurations. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var existing = Azure.Maintenance.GetPublicConfigurations.Invoke(new() + /// { + /// Location = "West Europe", + /// Scope = "SQLManagedInstance", + /// RecurEvery = "Monday-Thursday", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["name"] = existing.Apply(getPublicConfigurationsResult => getPublicConfigurationsResult.Configs[0]?.Name), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPublicConfigurationsInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:maintenance/getPublicConfigurations:getPublicConfigurations", args ?? new GetPublicConfigurationsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ManagedApplication/Application.cs b/sdk/dotnet/ManagedApplication/Application.cs index 69af5312b0..e7e472c8e2 100644 --- a/sdk/dotnet/ManagedApplication/Application.cs +++ b/sdk/dotnet/ManagedApplication/Application.cs @@ -12,6 +12,79 @@ namespace Pulumi.Azure.ManagedApplication /// /// Manages a Managed Application. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var builtin = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// Name = "Contributor", + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDefinition = new Azure.ManagedApplication.Definition("exampleDefinition", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LockLevel = "ReadOnly", + /// PackageFileUri = "https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + /// DisplayName = "TestManagedAppDefinition", + /// Description = "Test Managed App Definition", + /// Authorizations = new[] + /// { + /// new Azure.ManagedApplication.Inputs.DefinitionAuthorizationArgs + /// { + /// ServicePrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// RoleDefinitionId = Output.Tuple(builtin.Apply(getRoleDefinitionResult => getRoleDefinitionResult.Id).Split("/"), builtin.Apply(getRoleDefinitionResult => getRoleDefinitionResult.Id).Split("/").Length).Apply(values => + /// { + /// var split = values.Item1; + /// var length = values.Item2; + /// return split[length - 1]; + /// }), + /// }, + /// }, + /// }); + /// + /// var exampleApplication = new Azure.ManagedApplication.Application("exampleApplication", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "ServiceCatalog", + /// ManagedResourceGroupName = "infrastructureGroup", + /// ApplicationDefinitionId = exampleDefinition.Id, + /// ParameterValues = exampleResourceGroup.Location.Apply(location => JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["location"] = new Dictionary<string, object?> + /// { + /// ["value"] = location, + /// }, + /// ["storageAccountNamePrefix"] = new Dictionary<string, object?> + /// { + /// ["value"] = "storeNamePrefix", + /// }, + /// ["storageAccountType"] = new Dictionary<string, object?> + /// { + /// ["value"] = "Standard_LRS", + /// }, + /// })), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Managed Application can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ManagedApplication/Definition.cs b/sdk/dotnet/ManagedApplication/Definition.cs index f062ea9174..277d538cff 100644 --- a/sdk/dotnet/ManagedApplication/Definition.cs +++ b/sdk/dotnet/ManagedApplication/Definition.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.ManagedApplication /// /// Manages a Managed Application Definition. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDefinition = new Azure.ManagedApplication.Definition("exampleDefinition", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// LockLevel = "ReadOnly", + /// PackageFileUri = "https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + /// DisplayName = "TestManagedApplicationDefinition", + /// Description = "Test Managed Application Definition", + /// Authorizations = new[] + /// { + /// new Azure.ManagedApplication.Inputs.DefinitionAuthorizationArgs + /// { + /// ServicePrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// RoleDefinitionId = "a094b430-dad3-424d-ae58-13f72fd72591", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Managed Application Definition can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ManagedApplication/GetDefinition.cs b/sdk/dotnet/ManagedApplication/GetDefinition.cs index bc54aabd59..fe6810be66 100644 --- a/sdk/dotnet/ManagedApplication/GetDefinition.cs +++ b/sdk/dotnet/ManagedApplication/GetDefinition.cs @@ -13,12 +13,66 @@ public static class GetDefinition { /// /// Uses this data source to access information about an existing Managed Application Definition. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ManagedApplication.GetDefinition.Invoke(new() + /// { + /// Name = "examplemanagedappdef", + /// ResourceGroupName = "exampleresources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDefinitionResult => getDefinitionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDefinitionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:managedapplication/getDefinition:getDefinition", args ?? new GetDefinitionArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing Managed Application Definition. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ManagedApplication.GetDefinition.Invoke(new() + /// { + /// Name = "examplemanagedappdef", + /// ResourceGroupName = "exampleresources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getDefinitionResult => getDefinitionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDefinitionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:managedapplication/getDefinition:getDefinition", args ?? new GetDefinitionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Management/GetGroup.cs b/sdk/dotnet/Management/GetGroup.cs index 9428d4cc8a..63e4442d48 100644 --- a/sdk/dotnet/Management/GetGroup.cs +++ b/sdk/dotnet/Management/GetGroup.cs @@ -13,12 +13,64 @@ public static class GetGroup { /// /// Use this data source to access information about an existing Management Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["displayName"] = example.Apply(getGroupResult => getGroupResult.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetGroupArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:management/getGroup:getGroup", args ?? new GetGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Management Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["displayName"] = example.Apply(getGroupResult => getGroupResult.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetGroupInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:management/getGroup:getGroup", args ?? new GetGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Management/Group.cs b/sdk/dotnet/Management/Group.cs index 18c3f218c4..cb2faafc42 100644 --- a/sdk/dotnet/Management/Group.cs +++ b/sdk/dotnet/Management/Group.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.Management /// /// !> **Note:** Configuring `subscription_ids` is not supported when using the `azure.management.GroupSubscriptionAssociation` resource, results will be unpredictable. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleParent = new Azure.Management.Group("exampleParent", new() + /// { + /// DisplayName = "ParentGroup", + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId), + /// }, + /// }); + /// + /// var exampleChild = new Azure.Management.Group("exampleChild", new() + /// { + /// DisplayName = "ChildGroup", + /// ParentManagementGroupId = exampleParent.Id, + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId), + /// }, + /// }); + /// + /// // other subscription IDs can go here + /// }); + /// ``` + /// /// ## Import /// /// Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/dotnet/Management/GroupPolicyAssignment.cs b/sdk/dotnet/Management/GroupPolicyAssignment.cs index 40a21db243..2aadcb62e4 100644 --- a/sdk/dotnet/Management/GroupPolicyAssignment.cs +++ b/sdk/dotnet/Management/GroupPolicyAssignment.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Management /// /// Manages a Policy Assignment to a Management Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = new Azure.Management.Group("exampleGroup", new() + /// { + /// DisplayName = "Some Management Group", + /// }); + /// + /// var exampleDefinition = new Azure.Policy.Definition("exampleDefinition", new() + /// { + /// PolicyType = "Custom", + /// Mode = "All", + /// DisplayName = "my-policy-definition", + /// ManagementGroupId = exampleGroup.Id, + /// PolicyRule = @" { + /// ""if"": { + /// ""not"": { + /// ""field"": ""location"", + /// ""equals"": ""westeurope"" + /// } + /// }, + /// ""then"": { + /// ""effect"": ""Deny"" + /// } + /// } + /// ", + /// }); + /// + /// var exampleGroupPolicyAssignment = new Azure.Management.GroupPolicyAssignment("exampleGroupPolicyAssignment", new() + /// { + /// PolicyDefinitionId = exampleDefinition.Id, + /// ManagementGroupId = exampleGroup.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Management Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Management/GroupPolicyExemption.cs b/sdk/dotnet/Management/GroupPolicyExemption.cs index 5a420f5f03..43cbe50e9e 100644 --- a/sdk/dotnet/Management/GroupPolicyExemption.cs +++ b/sdk/dotnet/Management/GroupPolicyExemption.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Management /// /// Manages a Management Group Policy Exemption. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = new Azure.Management.Group("exampleGroup", new() + /// { + /// DisplayName = "Example MgmtGroup", + /// }); + /// + /// var examplePolicySetDefinition = Azure.Policy.GetPolicySetDefinition.Invoke(new() + /// { + /// DisplayName = "Audit machines with insecure password security settings", + /// }); + /// + /// var exampleGroupPolicyAssignment = new Azure.Management.GroupPolicyAssignment("exampleGroupPolicyAssignment", new() + /// { + /// ManagementGroupId = exampleGroup.Id, + /// PolicyDefinitionId = examplePolicySetDefinition.Apply(getPolicySetDefinitionResult => getPolicySetDefinitionResult.Id), + /// Location = "westus", + /// Identity = new Azure.Management.Inputs.GroupPolicyAssignmentIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleGroupPolicyExemption = new Azure.Management.GroupPolicyExemption("exampleGroupPolicyExemption", new() + /// { + /// ManagementGroupId = exampleGroup.Id, + /// PolicyAssignmentId = exampleGroupPolicyAssignment.Id, + /// ExemptionCategory = "Mitigated", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Management/GroupSubscriptionAssociation.cs b/sdk/dotnet/Management/GroupSubscriptionAssociation.cs index d695ccd8d1..559245961b 100644 --- a/sdk/dotnet/Management/GroupSubscriptionAssociation.cs +++ b/sdk/dotnet/Management/GroupSubscriptionAssociation.cs @@ -14,6 +14,35 @@ namespace Pulumi.Azure.Management /// /// !> **Note:** When using this resource, configuring `subscription_ids` on the `azure.management.Group` resource is not supported. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "exampleManagementGroup", + /// }); + /// + /// var exampleSubscription = Azure.Core.GetSubscription.Invoke(new() + /// { + /// SubscriptionId = "12345678-1234-1234-1234-123456789012", + /// }); + /// + /// var exampleGroupSubscriptionAssociation = new Azure.Management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", new() + /// { + /// ManagementGroupId = exampleGroup.Apply(getGroupResult => getGroupResult.Id), + /// SubscriptionId = exampleSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Managements can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Management/GroupTemplateDeployment.cs b/sdk/dotnet/Management/GroupTemplateDeployment.cs index a054a63b78..ac9e587713 100644 --- a/sdk/dotnet/Management/GroupTemplateDeployment.cs +++ b/sdk/dotnet/Management/GroupTemplateDeployment.cs @@ -16,6 +16,126 @@ namespace Pulumi.Azure.Management /// /// > **Note:** Deployments to a Management Group are always Incrementally applied. Existing resources that are not part of the template will not be removed. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// var exampleGroupTemplateDeployment = new Azure.Management.GroupTemplateDeployment("exampleGroupTemplateDeployment", new() + /// { + /// Location = "West Europe", + /// ManagementGroupId = exampleGroup.Apply(getGroupResult => getGroupResult.Id), + /// TemplateContent = @"{ + /// ""$schema"": ""https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#"", + /// ""contentVersion"": ""1.0.0.0"", + /// ""parameters"": { + /// ""policyAssignmentName"": { + /// ""type"": ""string"", + /// ""defaultValue"": ""[guid(parameters('policyDefinitionID'), resourceGroup().name)]"", + /// ""metadata"": { + /// ""description"": ""Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides."" + /// } + /// }, + /// ""policyDefinitionID"": { + /// ""type"": ""string"", + /// ""metadata"": { + /// ""description"": ""Specifies the ID of the policy definition or policy set definition being assigned."" + /// } + /// } + /// }, + /// ""resources"": [ + /// { + /// ""type"": ""Microsoft.Authorization/policyAssignments"", + /// ""name"": ""[parameters('policyAssignmentName')]"", + /// ""apiVersion"": ""2019-09-01"", + /// ""properties"": { + /// ""scope"": ""[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]"", + /// ""policyDefinitionId"": ""[parameters('policyDefinitionID')]"" + /// } + /// } + /// ] + /// } + /// ", + /// ParametersContent = @"{ + /// ""$schema"": ""https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#"", + /// ""contentVersion"": ""1.0.0.0"", + /// ""parameters"": { + /// ""policyDefinitionID"": { + /// ""value"": ""/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a"" + /// } + /// } + /// } + /// ", + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// var exampleGroupTemplateDeployment = new Azure.Management.GroupTemplateDeployment("exampleGroupTemplateDeployment", new() + /// { + /// Location = "West Europe", + /// ManagementGroupId = exampleGroup.Apply(getGroupResult => getGroupResult.Id), + /// TemplateContent = File.ReadAllText("templates/example-deploy-template.json"), + /// ParametersContent = File.ReadAllText("templates/example-deploy-params.json"), + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// var exampleTemplateSpecVersion = Azure.Core.GetTemplateSpecVersion.Invoke(new() + /// { + /// Name = "exampleTemplateForManagementGroup", + /// ResourceGroupName = "exampleResourceGroup", + /// Version = "v1.0.9", + /// }); + /// + /// var exampleGroupTemplateDeployment = new Azure.Management.GroupTemplateDeployment("exampleGroupTemplateDeployment", new() + /// { + /// Location = "West Europe", + /// ManagementGroupId = exampleGroup.Apply(getGroupResult => getGroupResult.Id), + /// TemplateSpecVersionId = exampleTemplateSpecVersion.Apply(getTemplateSpecVersionResult => getTemplateSpecVersionResult.Id), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Management Group Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Management/Lock.cs b/sdk/dotnet/Management/Lock.cs index aba377c2ca..2b6ce1adf3 100644 --- a/sdk/dotnet/Management/Lock.cs +++ b/sdk/dotnet/Management/Lock.cs @@ -13,6 +13,83 @@ namespace Pulumi.Azure.Management /// Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. /// /// ## Example Usage + /// ### Subscription Level Lock) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var subscription_level = new Azure.Management.Lock("subscription-level", new() + /// { + /// Scope = current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// LockLevel = "CanNotDelete", + /// Notes = "Items can't be deleted in this subscription!", + /// }); + /// + /// }); + /// ``` + /// ### Resource Group Level Lock) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var resource_group_level = new Azure.Management.Lock("resource-group-level", new() + /// { + /// Scope = example.Id, + /// LockLevel = "ReadOnly", + /// Notes = "This Resource Group is Read-Only", + /// }); + /// + /// }); + /// ``` + /// ### Resource Level Lock) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// IdleTimeoutInMinutes = 30, + /// }); + /// + /// var public_ip = new Azure.Management.Lock("public-ip", new() + /// { + /// Scope = examplePublicIp.Id, + /// LockLevel = "CanNotDelete", + /// Notes = "Locked because it's needed by a third-party", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Management/PrivateLink.cs b/sdk/dotnet/Management/PrivateLink.cs index 5cb82f0803..1073217b6f 100644 --- a/sdk/dotnet/Management/PrivateLink.cs +++ b/sdk/dotnet/Management/PrivateLink.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Management /// /// Manages a Resource Management Private Link to restrict access for managing resources in the tenant. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePrivateLink = new Azure.Management.PrivateLink("examplePrivateLink", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing Resource Management Private Link can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/dotnet/ManagementGroups/GetManagementGroup.cs b/sdk/dotnet/ManagementGroups/GetManagementGroup.cs index 545a5514f6..dc8a583ee9 100644 --- a/sdk/dotnet/ManagementGroups/GetManagementGroup.cs +++ b/sdk/dotnet/ManagementGroups/GetManagementGroup.cs @@ -14,12 +14,64 @@ public static class GetManagementGroup { /// /// Use this data source to access information about an existing Management Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["displayName"] = example.Apply(getGroupResult => getGroupResult.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetManagementGroupArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:managementgroups/getManagementGroup:getManagementGroup", args ?? new GetManagementGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Management Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["displayName"] = example.Apply(getGroupResult => getGroupResult.DisplayName), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetManagementGroupInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:managementgroups/getManagementGroup:getManagementGroup", args ?? new GetManagementGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ManagementGroups/ManagementGroup.cs b/sdk/dotnet/ManagementGroups/ManagementGroup.cs index b8d4d17218..c24049f8ea 100644 --- a/sdk/dotnet/ManagementGroups/ManagementGroup.cs +++ b/sdk/dotnet/ManagementGroups/ManagementGroup.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.ManagementGroups /// /// !> **Note:** Configuring `subscription_ids` is not supported when using the `azure.management.GroupSubscriptionAssociation` resource, results will be unpredictable. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleParent = new Azure.Management.Group("exampleParent", new() + /// { + /// DisplayName = "ParentGroup", + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId), + /// }, + /// }); + /// + /// var exampleChild = new Azure.Management.Group("exampleChild", new() + /// { + /// DisplayName = "ChildGroup", + /// ParentManagementGroupId = exampleParent.Id, + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId), + /// }, + /// }); + /// + /// // other subscription IDs can go here + /// }); + /// ``` + /// /// ## Import /// /// Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/dotnet/ManagementResource/ManangementLock.cs b/sdk/dotnet/ManagementResource/ManangementLock.cs index fe6c907201..a6f8a8e74e 100644 --- a/sdk/dotnet/ManagementResource/ManangementLock.cs +++ b/sdk/dotnet/ManagementResource/ManangementLock.cs @@ -13,6 +13,83 @@ namespace Pulumi.Azure.ManagementResource /// Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. /// /// ## Example Usage + /// ### Subscription Level Lock) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var subscription_level = new Azure.Management.Lock("subscription-level", new() + /// { + /// Scope = current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// LockLevel = "CanNotDelete", + /// Notes = "Items can't be deleted in this subscription!", + /// }); + /// + /// }); + /// ``` + /// ### Resource Group Level Lock) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var resource_group_level = new Azure.Management.Lock("resource-group-level", new() + /// { + /// Scope = example.Id, + /// LockLevel = "ReadOnly", + /// Notes = "This Resource Group is Read-Only", + /// }); + /// + /// }); + /// ``` + /// ### Resource Level Lock) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// IdleTimeoutInMinutes = 30, + /// }); + /// + /// var public_ip = new Azure.Management.Lock("public-ip", new() + /// { + /// Scope = examplePublicIp.Id, + /// LockLevel = "CanNotDelete", + /// Notes = "Locked because it's needed by a third-party", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Maps/Account.cs b/sdk/dotnet/Maps/Account.cs index 58fc938758..f463ccdd10 100644 --- a/sdk/dotnet/Maps/Account.cs +++ b/sdk/dotnet/Maps/Account.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Maps /// /// Manages an Azure Maps Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Maps.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "S1", + /// LocalAuthenticationEnabled = true, + /// Tags = + /// { + /// { "environment", "Test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Maps Account can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Maps/Creator.cs b/sdk/dotnet/Maps/Creator.cs index 0c4244b779..d27a35862c 100644 --- a/sdk/dotnet/Maps/Creator.cs +++ b/sdk/dotnet/Maps/Creator.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.Maps /// /// Manages an Azure Maps Creator. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Maps.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "G2", + /// Tags = + /// { + /// { "environment", "Test" }, + /// }, + /// }); + /// + /// var exampleCreator = new Azure.Maps.Creator("exampleCreator", new() + /// { + /// MapsAccountId = exampleAccount.Id, + /// Location = exampleResourceGroup.Location, + /// StorageUnits = 1, + /// Tags = + /// { + /// { "environment", "Test" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An Azure Maps Creators can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Maps/GetAccount.cs b/sdk/dotnet/Maps/GetAccount.cs index efa305cf07..432c938202 100644 --- a/sdk/dotnet/Maps/GetAccount.cs +++ b/sdk/dotnet/Maps/GetAccount.cs @@ -13,12 +13,66 @@ public static class GetAccount { /// /// Use this data source to access information about an existing Azure Maps Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Maps.GetAccount.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "maps", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["mapsAccountId"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:maps/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure Maps Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Maps.GetAccount.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "maps", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["mapsAccountId"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:maps/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MariaDB/Configuration.cs b/sdk/dotnet/MariaDB/Configuration.cs index a98c908d7d..ca3e4164e2 100644 --- a/sdk/dotnet/MariaDB/Configuration.cs +++ b/sdk/dotnet/MariaDB/Configuration.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.MariaDB /// /// Sets a MariaDB Configuration value on a MariaDB Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MariaDB.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "B_Gen5_2", + /// SslEnforcementEnabled = true, + /// AdministratorLogin = "mariadbadmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// Version = "10.2", + /// }); + /// + /// var exampleConfiguration = new Azure.MariaDB.Configuration("exampleConfiguration", new() + /// { + /// Name = "interactive_timeout", + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Value = "600", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MariaDB Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MariaDB/Database.cs b/sdk/dotnet/MariaDB/Database.cs index 315270fc97..4bc7e5240a 100644 --- a/sdk/dotnet/MariaDB/Database.cs +++ b/sdk/dotnet/MariaDB/Database.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.MariaDB /// /// Manages a MariaDB Database within a MariaDB Server /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MariaDB.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "B_Gen5_2", + /// StorageMb = 51200, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = false, + /// AdministratorLogin = "acctestun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// Version = "10.2", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleDatabase = new Azure.MariaDB.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Charset = "utf8mb4", + /// Collation = "utf8mb4_unicode_520_ci", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MariaDB Database's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MariaDB/FirewallRule.cs b/sdk/dotnet/MariaDB/FirewallRule.cs index 65fe16d0df..5b0af4e0c0 100644 --- a/sdk/dotnet/MariaDB/FirewallRule.cs +++ b/sdk/dotnet/MariaDB/FirewallRule.cs @@ -13,6 +13,46 @@ namespace Pulumi.Azure.MariaDB /// Manages a Firewall Rule for a MariaDB Server /// /// ## Example Usage + /// ### Single IP Address) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.MariaDB.FirewallRule("example", new() + /// { + /// EndIpAddress = "40.112.8.12", + /// ResourceGroupName = "test-rg", + /// ServerName = "test-server", + /// StartIpAddress = "40.112.8.12", + /// }); + /// + /// }); + /// ``` + /// ### IP Range) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.MariaDB.FirewallRule("example", new() + /// { + /// EndIpAddress = "40.112.255.255", + /// ResourceGroupName = "test-rg", + /// ServerName = "test-server", + /// StartIpAddress = "40.112.0.0", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/MariaDB/GetMariaDbServer.cs b/sdk/dotnet/MariaDB/GetMariaDbServer.cs index da32c591e1..47384408d2 100644 --- a/sdk/dotnet/MariaDB/GetMariaDbServer.cs +++ b/sdk/dotnet/MariaDB/GetMariaDbServer.cs @@ -13,12 +13,66 @@ public static class GetMariaDbServer { /// /// Use this data source to access information about an existing MariaDB Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var dbServer = Azure.MariaDB.GetMariaDbServer.Invoke(new() + /// { + /// Name = "mariadb-server", + /// ResourceGroupName = azurerm_mariadb_server.Example.Resource_group_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["mariadbServerId"] = data.Azurerm_mariadb_server.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetMariaDbServerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mariadb/getMariaDbServer:getMariaDbServer", args ?? new GetMariaDbServerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing MariaDB Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var dbServer = Azure.MariaDB.GetMariaDbServer.Invoke(new() + /// { + /// Name = "mariadb-server", + /// ResourceGroupName = azurerm_mariadb_server.Example.Resource_group_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["mariadbServerId"] = data.Azurerm_mariadb_server.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetMariaDbServerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mariadb/getMariaDbServer:getMariaDbServer", args ?? new GetMariaDbServerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MariaDB/Server.cs b/sdk/dotnet/MariaDB/Server.cs index 7c593b9932..71d3463f57 100644 --- a/sdk/dotnet/MariaDB/Server.cs +++ b/sdk/dotnet/MariaDB/Server.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.MariaDB /// /// Manages a MariaDB Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MariaDB.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mariadbadmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// Version = "10.2", + /// AutoGrowEnabled = true, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = false, + /// PublicNetworkAccessEnabled = false, + /// SslEnforcementEnabled = true, + /// SslMinimalTlsVersionEnforced = "TLS1_2", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MariaDB Server's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MariaDB/VirtualNetworkRule.cs b/sdk/dotnet/MariaDB/VirtualNetworkRule.cs index 8d33c57dd9..17cd544d58 100644 --- a/sdk/dotnet/MariaDB/VirtualNetworkRule.cs +++ b/sdk/dotnet/MariaDB/VirtualNetworkRule.cs @@ -14,6 +14,66 @@ namespace Pulumi.Azure.MariaDB /// /// > **NOTE:** MariaDB Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mariadb/concepts-data-access-security-vnet) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// }, + /// }); + /// + /// var exampleServer = new Azure.MariaDB.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mariadbadminun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// Version = "10.2", + /// SslEnforcementEnabled = true, + /// SkuName = "GP_Gen5_2", + /// }); + /// + /// var exampleVirtualNetworkRule = new Azure.MariaDB.VirtualNetworkRule("exampleVirtualNetworkRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// SubnetId = @internal.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MariaDB Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Marketplace/Agreement.cs b/sdk/dotnet/Marketplace/Agreement.cs index 225d2ddd1c..aa30cea67d 100644 --- a/sdk/dotnet/Marketplace/Agreement.cs +++ b/sdk/dotnet/Marketplace/Agreement.cs @@ -12,6 +12,26 @@ namespace Pulumi.Azure.Marketplace /// /// Allows accepting the Legal Terms for a Marketplace Image. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var barracuda = new Azure.Marketplace.Agreement("barracuda", new() + /// { + /// Offer = "waf", + /// Plan = "hourly", + /// Publisher = "barracudanetworks", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Marketplace Agreement can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Marketplace/GetAgreement.cs b/sdk/dotnet/Marketplace/GetAgreement.cs index 476af69e19..718bc85140 100644 --- a/sdk/dotnet/Marketplace/GetAgreement.cs +++ b/sdk/dotnet/Marketplace/GetAgreement.cs @@ -13,12 +13,68 @@ public static class GetAgreement { /// /// Uses this data source to access information about an existing Marketplace Agreement. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var barracuda = Azure.Marketplace.GetAgreement.Invoke(new() + /// { + /// Publisher = "barracudanetworks", + /// Offer = "waf", + /// Plan = "hourly", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermMarketplaceAgreementId"] = data.Azurerm_marketplace_agreement.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAgreementArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:marketplace/getAgreement:getAgreement", args ?? new GetAgreementArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing Marketplace Agreement. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var barracuda = Azure.Marketplace.GetAgreement.Invoke(new() + /// { + /// Publisher = "barracudanetworks", + /// Offer = "waf", + /// Plan = "hourly", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermMarketplaceAgreementId"] = data.Azurerm_marketplace_agreement.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAgreementInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:marketplace/getAgreement:getAgreement", args ?? new GetAgreementInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Media/AccountFilter.cs b/sdk/dotnet/Media/AccountFilter.cs index fb3c7d0a36..a4464614a4 100644 --- a/sdk/dotnet/Media/AccountFilter.cs +++ b/sdk/dotnet/Media/AccountFilter.cs @@ -12,6 +12,107 @@ namespace Pulumi.Azure.Media /// /// Manages a Media Services Account Filter. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleAccountFilter = new Azure.Media.AccountFilter("exampleAccountFilter", new() + /// { + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// MediaServicesAccountName = azurerm_media_services_account.Test.Name, + /// FirstQualityBitrate = 128000, + /// PresentationTimeRange = new Azure.Media.Inputs.AccountFilterPresentationTimeRangeArgs + /// { + /// StartInUnits = 0, + /// EndInUnits = 15, + /// PresentationWindowInUnits = 90, + /// LiveBackoffInUnits = 0, + /// UnitTimescaleInMilliseconds = 1000, + /// ForceEnd = false, + /// }, + /// TrackSelections = new[] + /// { + /// new Azure.Media.Inputs.AccountFilterTrackSelectionArgs + /// { + /// Conditions = new[] + /// { + /// new Azure.Media.Inputs.AccountFilterTrackSelectionConditionArgs + /// { + /// Property = "Type", + /// Operation = "Equal", + /// Value = "Audio", + /// }, + /// new Azure.Media.Inputs.AccountFilterTrackSelectionConditionArgs + /// { + /// Property = "Language", + /// Operation = "NotEqual", + /// Value = "en", + /// }, + /// new Azure.Media.Inputs.AccountFilterTrackSelectionConditionArgs + /// { + /// Property = "FourCC", + /// Operation = "NotEqual", + /// Value = "EC-3", + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.AccountFilterTrackSelectionArgs + /// { + /// Conditions = new[] + /// { + /// new Azure.Media.Inputs.AccountFilterTrackSelectionConditionArgs + /// { + /// Property = "Type", + /// Operation = "Equal", + /// Value = "Video", + /// }, + /// new Azure.Media.Inputs.AccountFilterTrackSelectionConditionArgs + /// { + /// Property = "Bitrate", + /// Operation = "Equal", + /// Value = "3000000-5000000", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Account Filters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/Asset.cs b/sdk/dotnet/Media/Asset.cs index a474759183..58c02d4abd 100644 --- a/sdk/dotnet/Media/Asset.cs +++ b/sdk/dotnet/Media/Asset.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.Media /// /// Manages a Media Asset. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleAsset = new Azure.Media.Asset("exampleAsset", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "Asset description", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Media Assets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/AssetFilter.cs b/sdk/dotnet/Media/AssetFilter.cs index edfa786378..3a571c1cfc 100644 --- a/sdk/dotnet/Media/AssetFilter.cs +++ b/sdk/dotnet/Media/AssetFilter.cs @@ -12,6 +12,113 @@ namespace Pulumi.Azure.Media /// /// Manages an Azure Media Asset Filter. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleAsset = new Azure.Media.Asset("exampleAsset", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "Asset description", + /// }); + /// + /// var exampleAssetFilter = new Azure.Media.AssetFilter("exampleAssetFilter", new() + /// { + /// AssetId = exampleAsset.Id, + /// FirstQualityBitrate = 128000, + /// PresentationTimeRange = new Azure.Media.Inputs.AssetFilterPresentationTimeRangeArgs + /// { + /// StartInUnits = 0, + /// EndInUnits = 15, + /// PresentationWindowInUnits = 90, + /// LiveBackoffInUnits = 0, + /// UnitTimescaleInMiliseconds = 1000, + /// ForceEnd = false, + /// }, + /// TrackSelections = new[] + /// { + /// new Azure.Media.Inputs.AssetFilterTrackSelectionArgs + /// { + /// Conditions = new[] + /// { + /// new Azure.Media.Inputs.AssetFilterTrackSelectionConditionArgs + /// { + /// Property = "Type", + /// Operation = "Equal", + /// Value = "Audio", + /// }, + /// new Azure.Media.Inputs.AssetFilterTrackSelectionConditionArgs + /// { + /// Property = "Language", + /// Operation = "NotEqual", + /// Value = "en", + /// }, + /// new Azure.Media.Inputs.AssetFilterTrackSelectionConditionArgs + /// { + /// Property = "FourCC", + /// Operation = "NotEqual", + /// Value = "EC-3", + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.AssetFilterTrackSelectionArgs + /// { + /// Conditions = new[] + /// { + /// new Azure.Media.Inputs.AssetFilterTrackSelectionConditionArgs + /// { + /// Property = "Type", + /// Operation = "Equal", + /// Value = "Video", + /// }, + /// new Azure.Media.Inputs.AssetFilterTrackSelectionConditionArgs + /// { + /// Property = "Bitrate", + /// Operation = "Equal", + /// Value = "3000000-5000000", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Asset Filters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/ContentKeyPolicy.cs b/sdk/dotnet/Media/ContentKeyPolicy.cs index c21ccd7991..c2bd11ddb5 100644 --- a/sdk/dotnet/Media/ContentKeyPolicy.cs +++ b/sdk/dotnet/Media/ContentKeyPolicy.cs @@ -12,6 +12,155 @@ namespace Pulumi.Azure.Media /// /// Manages a Content Key Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleContentKeyPolicy = new Azure.Media.ContentKeyPolicy("exampleContentKeyPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// PolicyOptions = new[] + /// { + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionArgs + /// { + /// Name = "fairPlay", + /// FairplayConfiguration = new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs + /// { + /// Ask = "bb566284cc124a21c435a92cd3c108c4", + /// Pfx = "MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + /// PfxPassword = "password", + /// RentalDurationSeconds = 2249, + /// RentalAndLeaseKeyType = "PersistentUnlimited", + /// }, + /// OpenRestrictionEnabled = true, + /// }, + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionArgs + /// { + /// Name = "playReady", + /// PlayreadyConfigurationLicenses = new[] + /// { + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicenseArgs + /// { + /// AllowTestDevices = true, + /// BeginDate = "2017-10-16T18:22:53Z", + /// SecurityLevel = "SL150", + /// PlayRight = new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightArgs + /// { + /// ScmsRestriction = 2, + /// DigitalVideoOnlyContentRestriction = false, + /// ImageConstraintForAnalogComponentVideoRestriction = false, + /// ImageConstraintForAnalogComputerMonitorRestriction = false, + /// AllowPassingVideoContentToUnknownOutput = "NotAllowed", + /// UncompressedDigitalVideoOpl = 100, + /// UncompressedDigitalAudioOpl = 100, + /// AnalogVideoOpl = 150, + /// CompressedDigitalAudioOpl = 250, + /// CompressedDigitalVideoOpl = 400, + /// ExplicitAnalogTelevisionOutputRestriction = new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightExplicitAnalogTelevisionOutputRestrictionArgs + /// { + /// BestEffortEnforced = true, + /// ControlBits = 3, + /// }, + /// }, + /// LicenseType = "Persistent", + /// ContentType = "UltraVioletDownload", + /// ContentKeyLocationFromHeaderEnabled = true, + /// }, + /// }, + /// OpenRestrictionEnabled = true, + /// }, + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionArgs + /// { + /// Name = "clearKey", + /// ClearKeyConfigurationEnabled = true, + /// TokenRestriction = new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionTokenRestrictionArgs + /// { + /// Issuer = "urn:issuer", + /// Audience = "urn:audience", + /// TokenType = "Swt", + /// PrimarySymmetricTokenKey = "AAAAAAAAAAAAAAAAAAAAAA==", + /// AlternateKeys = new[] + /// { + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs + /// { + /// RsaTokenKeyExponent = "AQAB", + /// RsaTokenKeyModulus = "AQAD", + /// }, + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs + /// { + /// SymmetricTokenKey = "BBAAAAAAAAAAAAAAAAAAAA==", + /// }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionArgs + /// { + /// Name = "widevine", + /// WidevineConfigurationTemplate = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["allowed_track_types"] = "SD_HD", + /// ["content_key_specs"] = new[] + /// { + /// new Dictionary<string, object?> + /// { + /// ["track_type"] = "SD", + /// ["security_level"] = 1, + /// ["required_output_protection"] = new Dictionary<string, object?> + /// { + /// ["hdcp"] = "HDCP_V2", + /// }, + /// }, + /// }, + /// ["policy_overrides"] = new Dictionary<string, object?> + /// { + /// ["can_play"] = true, + /// ["can_persist"] = true, + /// ["can_renew"] = false, + /// }, + /// }), + /// OpenRestrictionEnabled = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Content Key Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/Job.cs b/sdk/dotnet/Media/Job.cs index 9fbc9da962..34d5addc20 100644 --- a/sdk/dotnet/Media/Job.cs +++ b/sdk/dotnet/Media/Job.cs @@ -12,6 +12,99 @@ namespace Pulumi.Azure.Media /// /// Manages a Media Job. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleTransform = new Azure.Media.Transform("exampleTransform", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "My transform description", + /// Outputs = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputArgs + /// { + /// RelativePriority = "Normal", + /// OnErrorAction = "ContinueJob", + /// BuiltinPreset = new Azure.Media.Inputs.TransformOutputBuiltinPresetArgs + /// { + /// PresetName = "AACGoodQualityAudio", + /// }, + /// }, + /// }, + /// }); + /// + /// var input = new Azure.Media.Asset("input", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "Input Asset description", + /// }); + /// + /// var output = new Azure.Media.Asset("output", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "Output Asset description", + /// }); + /// + /// var exampleJob = new Azure.Media.Job("exampleJob", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// TransformName = exampleTransform.Name, + /// Description = "My Job description", + /// Priority = "Normal", + /// InputAsset = new Azure.Media.Inputs.JobInputAssetArgs + /// { + /// Name = input.Name, + /// }, + /// OutputAssets = new[] + /// { + /// new Azure.Media.Inputs.JobOutputAssetArgs + /// { + /// Name = output.Name, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Media Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/LiveEvent.cs b/sdk/dotnet/Media/LiveEvent.cs index 98d6fc2e29..ac0beb4690 100644 --- a/sdk/dotnet/Media/LiveEvent.cs +++ b/sdk/dotnet/Media/LiveEvent.cs @@ -12,6 +12,96 @@ namespace Pulumi.Azure.Media /// /// Manages a Live Event. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleLiveEvent = new Azure.Media.LiveEvent("exampleLiveEvent", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "My Event Description", + /// Input = new Azure.Media.Inputs.LiveEventInputArgs + /// { + /// StreamingProtocol = "RTMP", + /// IpAccessControlAllows = new[] + /// { + /// new Azure.Media.Inputs.LiveEventInputIpAccessControlAllowArgs + /// { + /// Name = "AllowAll", + /// Address = "0.0.0.0", + /// SubnetPrefixLength = 0, + /// }, + /// }, + /// }, + /// Encoding = new Azure.Media.Inputs.LiveEventEncodingArgs + /// { + /// Type = "Standard", + /// PresetName = "Default720p", + /// StretchMode = "AutoFit", + /// KeyFrameInterval = "PT2S", + /// }, + /// Preview = new Azure.Media.Inputs.LiveEventPreviewArgs + /// { + /// IpAccessControlAllows = new[] + /// { + /// new Azure.Media.Inputs.LiveEventPreviewIpAccessControlAllowArgs + /// { + /// Name = "AllowAll", + /// Address = "0.0.0.0", + /// SubnetPrefixLength = 0, + /// }, + /// }, + /// }, + /// StreamOptions = new[] + /// { + /// "LowLatency", + /// }, + /// UseStaticHostname = true, + /// HostnamePrefix = "special-event", + /// TranscriptionLanguages = new[] + /// { + /// "en-US", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Live Events can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/LiveEventOutput.cs b/sdk/dotnet/Media/LiveEventOutput.cs index 8cc3254671..2ff57d36a7 100644 --- a/sdk/dotnet/Media/LiveEventOutput.cs +++ b/sdk/dotnet/Media/LiveEventOutput.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.Media /// /// Manages a Azure Media Live Event Output. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleAsset = new Azure.Media.Asset("exampleAsset", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// }); + /// + /// var exampleLiveEvent = new Azure.Media.LiveEvent("exampleLiveEvent", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "My Event Description", + /// Input = new Azure.Media.Inputs.LiveEventInputArgs + /// { + /// StreamingProtocol = "RTMP", + /// KeyFrameIntervalDuration = "PT6S", + /// IpAccessControlAllows = new[] + /// { + /// new Azure.Media.Inputs.LiveEventInputIpAccessControlAllowArgs + /// { + /// Name = "AllowAll", + /// Address = "0.0.0.0", + /// SubnetPrefixLength = 0, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleLiveEventOutput = new Azure.Media.LiveEventOutput("exampleLiveEventOutput", new() + /// { + /// LiveEventId = exampleLiveEvent.Id, + /// ArchiveWindowDuration = "PT5M", + /// AssetName = exampleAsset.Name, + /// Description = "Test live output 1", + /// ManifestName = "testmanifest", + /// OutputSnapTimeInSeconds = 0, + /// HlsFragmentsPerTsSegment = 5, + /// RewindWindowDuration = "PT5M", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Live Outputs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/ServiceAccount.cs b/sdk/dotnet/Media/ServiceAccount.cs index efdd190290..3da07360d3 100644 --- a/sdk/dotnet/Media/ServiceAccount.cs +++ b/sdk/dotnet/Media/ServiceAccount.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Media /// /// Manages a Media Services Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/StreamingEndpoint.cs b/sdk/dotnet/Media/StreamingEndpoint.cs index 22e11790f9..51ab7ac33d 100644 --- a/sdk/dotnet/Media/StreamingEndpoint.cs +++ b/sdk/dotnet/Media/StreamingEndpoint.cs @@ -12,6 +12,132 @@ namespace Pulumi.Azure.Media /// /// Manages a Streaming Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleStreamingEndpoint = new Azure.Media.StreamingEndpoint("exampleStreamingEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// ScaleUnits = 2, + /// }); + /// + /// }); + /// ``` + /// ### With Access Control + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleStreamingEndpoint = new Azure.Media.StreamingEndpoint("exampleStreamingEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// ScaleUnits = 2, + /// AccessControl = new Azure.Media.Inputs.StreamingEndpointAccessControlArgs + /// { + /// IpAllows = new[] + /// { + /// new Azure.Media.Inputs.StreamingEndpointAccessControlIpAllowArgs + /// { + /// Name = "AllowedIP", + /// Address = "192.168.1.1", + /// }, + /// new Azure.Media.Inputs.StreamingEndpointAccessControlIpAllowArgs + /// { + /// Name = "AnotherIp", + /// Address = "192.168.1.2", + /// }, + /// }, + /// AkamaiSignatureHeaderAuthenticationKeys = new[] + /// { + /// new Azure.Media.Inputs.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs + /// { + /// Identifier = "id1", + /// Expiration = "2030-12-31T16:00:00Z", + /// Base64Key = "dGVzdGlkMQ==", + /// }, + /// new Azure.Media.Inputs.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs + /// { + /// Identifier = "id2", + /// Expiration = "2032-01-28T16:00:00Z", + /// Base64Key = "dGVzdGlkMQ==", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Streaming Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/StreamingLocator.cs b/sdk/dotnet/Media/StreamingLocator.cs index e409c8c7f7..8c7f4b9b2c 100644 --- a/sdk/dotnet/Media/StreamingLocator.cs +++ b/sdk/dotnet/Media/StreamingLocator.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.Media /// /// Manages a Media Streaming Locator. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleAccountFilter = new Azure.Media.AccountFilter("exampleAccountFilter", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// }); + /// + /// var exampleAsset = new Azure.Media.Asset("exampleAsset", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "Asset description", + /// }); + /// + /// var exampleStreamingLocator = new Azure.Media.StreamingLocator("exampleStreamingLocator", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// AssetName = exampleAsset.Name, + /// StreamingPolicyName = "Predefined_ClearStreamingOnly", + /// FilterNames = new[] + /// { + /// exampleAccountFilter.Name, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Streaming Locators can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/StreamingPolicy.cs b/sdk/dotnet/Media/StreamingPolicy.cs index 70163bcfbd..90b7b6cfcd 100644 --- a/sdk/dotnet/Media/StreamingPolicy.cs +++ b/sdk/dotnet/Media/StreamingPolicy.cs @@ -12,6 +12,125 @@ namespace Pulumi.Azure.Media /// /// Manages a Streaming Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleContentKeyPolicy = new Azure.Media.ContentKeyPolicy("exampleContentKeyPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// PolicyOptions = new[] + /// { + /// new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionArgs + /// { + /// Name = "fairPlay", + /// FairplayConfiguration = new Azure.Media.Inputs.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs + /// { + /// Ask = "bb566284cc124a21c435a92cd3c108c4", + /// Pfx = "MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + /// PfxPassword = "password", + /// RentalDurationSeconds = 2249, + /// RentalAndLeaseKeyType = "PersistentUnlimited", + /// }, + /// OpenRestrictionEnabled = true, + /// }, + /// }, + /// }); + /// + /// var exampleStreamingPolicy = new Azure.Media.StreamingPolicy("exampleStreamingPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// CommonEncryptionCenc = new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCencArgs + /// { + /// ClearTracks = new[] + /// { + /// new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCencClearTrackArgs + /// { + /// Conditions = new[] + /// { + /// new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCencClearTrackConditionArgs + /// { + /// Property = "FourCC", + /// Operation = "Equal", + /// Value = "hev2", + /// }, + /// }, + /// }, + /// }, + /// EnabledProtocols = new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCencEnabledProtocolsArgs + /// { + /// Download = false, + /// Dash = true, + /// Hls = false, + /// SmoothStreaming = false, + /// }, + /// DefaultContentKey = new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCencDefaultContentKeyArgs + /// { + /// Label = "aesDefaultKey", + /// PolicyName = exampleContentKeyPolicy.Name, + /// }, + /// DrmPlayready = new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCencDrmPlayreadyArgs + /// { + /// CustomLicenseAcquisitionUrlTemplate = "https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}", + /// CustomAttributes = "PlayReady CustomAttributes", + /// }, + /// DrmWidevineCustomLicenseAcquisitionUrlTemplate = "https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId}", + /// }, + /// CommonEncryptionCbcs = new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCbcsArgs + /// { + /// EnabledProtocols = new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCbcsEnabledProtocolsArgs + /// { + /// Download = false, + /// Dash = true, + /// Hls = false, + /// SmoothStreaming = false, + /// }, + /// DrmFairplay = new Azure.Media.Inputs.StreamingPolicyCommonEncryptionCbcsDrmFairplayArgs + /// { + /// CustomLicenseAcquisitionUrlTemplate = "https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}", + /// AllowPersistentLicense = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Streaming Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Media/Transform.cs b/sdk/dotnet/Media/Transform.cs index b9bd9fca14..eff52a0276 100644 --- a/sdk/dotnet/Media/Transform.cs +++ b/sdk/dotnet/Media/Transform.cs @@ -12,6 +12,456 @@ namespace Pulumi.Azure.Media /// /// Manages a Transform. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleTransform = new Azure.Media.Transform("exampleTransform", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "My transform description", + /// Outputs = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputArgs + /// { + /// RelativePriority = "Normal", + /// OnErrorAction = "ContinueJob", + /// BuiltinPreset = new Azure.Media.Inputs.TransformOutputBuiltinPresetArgs + /// { + /// PresetName = "AACGoodQualityAudio", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### With Multiple Outputs + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// var exampleTransform = new Azure.Media.Transform("exampleTransform", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// MediaServicesAccountName = exampleServiceAccount.Name, + /// Description = "My transform description", + /// Outputs = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputArgs + /// { + /// RelativePriority = "Normal", + /// OnErrorAction = "ContinueJob", + /// BuiltinPreset = new Azure.Media.Inputs.TransformOutputBuiltinPresetArgs + /// { + /// PresetName = "AACGoodQualityAudio", + /// PresetConfiguration = new Azure.Media.Inputs.TransformOutputBuiltinPresetPresetConfigurationArgs + /// { + /// Complexity = "Balanced", + /// InterleaveOutput = "NonInterleavedOutput", + /// KeyFrameIntervalInSeconds = 123122.5, + /// MaxBitrateBps = 300000, + /// MaxHeight = 480, + /// MaxLayers = 14, + /// MinBitrateBps = 200000, + /// MinHeight = 360, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputArgs + /// { + /// RelativePriority = "Low", + /// OnErrorAction = "ContinueJob", + /// AudioAnalyzerPreset = new Azure.Media.Inputs.TransformOutputAudioAnalyzerPresetArgs + /// { + /// AudioLanguage = "en-US", + /// AudioAnalysisMode = "Basic", + /// ExperimentalOptions = + /// { + /// { "env", "test" }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputArgs + /// { + /// RelativePriority = "Low", + /// OnErrorAction = "StopProcessingJob", + /// FaceDetectorPreset = new Azure.Media.Inputs.TransformOutputFaceDetectorPresetArgs + /// { + /// AnalysisResolution = "StandardDefinition", + /// BlurType = "Med", + /// FaceRedactorMode = "Combined", + /// ExperimentalOptions = + /// { + /// { "env", "test" }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputArgs + /// { + /// RelativePriority = "Normal", + /// OnErrorAction = "StopProcessingJob", + /// VideoAnalyzerPreset = new Azure.Media.Inputs.TransformOutputVideoAnalyzerPresetArgs + /// { + /// AudioLanguage = "en-US", + /// AudioAnalysisMode = "Basic", + /// InsightsType = "AllInsights", + /// ExperimentalOptions = + /// { + /// { "env", "test" }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputArgs + /// { + /// RelativePriority = "Low", + /// OnErrorAction = "ContinueJob", + /// CustomPreset = new Azure.Media.Inputs.TransformOutputCustomPresetArgs + /// { + /// Codecs = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecArgs + /// { + /// AacAudio = new Azure.Media.Inputs.TransformOutputCustomPresetCodecAacAudioArgs + /// { + /// Bitrate = 128000, + /// Channels = 2, + /// SamplingRate = 48000, + /// Profile = "AacLc", + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecArgs + /// { + /// CopyAudio = new Azure.Media.Inputs.TransformOutputCustomPresetCodecCopyAudioArgs + /// { + /// Label = "test", + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecArgs + /// { + /// CopyVideo = new Azure.Media.Inputs.TransformOutputCustomPresetCodecCopyVideoArgs + /// { + /// Label = "test", + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecArgs + /// { + /// H264Video = new Azure.Media.Inputs.TransformOutputCustomPresetCodecH264VideoArgs + /// { + /// KeyFrameInterval = "PT1S", + /// StretchMode = "AutoSize", + /// SyncMode = "Auto", + /// SceneChangeDetectionEnabled = false, + /// RateControlMode = "ABR", + /// Complexity = "Quality", + /// Layers = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecH264VideoLayerArgs + /// { + /// Width = "64", + /// Height = "64", + /// Bitrate = 1045000, + /// MaxBitrate = 1045000, + /// BFrames = 3, + /// Slices = 0, + /// AdaptiveBFrameEnabled = true, + /// Profile = "Auto", + /// Level = "auto", + /// BufferWindow = "PT5S", + /// ReferenceFrames = 4, + /// Crf = 23, + /// EntropyMode = "Cabac", + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecH264VideoLayerArgs + /// { + /// Width = "64", + /// Height = "64", + /// Bitrate = 1000, + /// MaxBitrate = 1000, + /// BFrames = 3, + /// FrameRate = "32", + /// Slices = 1, + /// AdaptiveBFrameEnabled = true, + /// Profile = "High444", + /// Level = "auto", + /// BufferWindow = "PT5S", + /// ReferenceFrames = 4, + /// Crf = 23, + /// EntropyMode = "Cavlc", + /// }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecArgs + /// { + /// H265Video = new Azure.Media.Inputs.TransformOutputCustomPresetCodecH265VideoArgs + /// { + /// KeyFrameInterval = "PT2S", + /// StretchMode = "AutoSize", + /// SyncMode = "Auto", + /// SceneChangeDetectionEnabled = false, + /// Complexity = "Speed", + /// Layers = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecH265VideoLayerArgs + /// { + /// Width = "64", + /// Height = "64", + /// Bitrate = 1045000, + /// MaxBitrate = 1045000, + /// BFrames = 3, + /// Slices = 5, + /// AdaptiveBFrameEnabled = true, + /// Profile = "Auto", + /// Label = "test", + /// Level = "auto", + /// BufferWindow = "PT5S", + /// FrameRate = "32", + /// ReferenceFrames = 4, + /// Crf = 23, + /// }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecArgs + /// { + /// JpgImage = new Azure.Media.Inputs.TransformOutputCustomPresetCodecJpgImageArgs + /// { + /// StretchMode = "AutoSize", + /// SyncMode = "Auto", + /// Start = "10", + /// Range = "100%%", + /// SpriteColumn = 1, + /// Step = "10", + /// Layers = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecJpgImageLayerArgs + /// { + /// Quality = 70, + /// Height = "180", + /// Label = "test", + /// Width = "120", + /// }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecArgs + /// { + /// PngImage = new Azure.Media.Inputs.TransformOutputCustomPresetCodecPngImageArgs + /// { + /// StretchMode = "AutoSize", + /// SyncMode = "Auto", + /// Start = "{Best}", + /// Range = "80", + /// Step = "10", + /// Layers = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetCodecPngImageLayerArgs + /// { + /// Height = "180", + /// Label = "test", + /// Width = "120", + /// }, + /// }, + /// }, + /// }, + /// }, + /// Formats = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetFormatArgs + /// { + /// Jpg = new Azure.Media.Inputs.TransformOutputCustomPresetFormatJpgArgs + /// { + /// FilenamePattern = "test{Basename}", + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetFormatArgs + /// { + /// Mp4 = new Azure.Media.Inputs.TransformOutputCustomPresetFormatMp4Args + /// { + /// FilenamePattern = "test{Bitrate}", + /// OutputFiles = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetFormatMp4OutputFileArgs + /// { + /// Labels = new[] + /// { + /// "test", + /// "ppe", + /// }, + /// }, + /// }, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetFormatArgs + /// { + /// Png = new Azure.Media.Inputs.TransformOutputCustomPresetFormatPngArgs + /// { + /// FilenamePattern = "test{Basename}", + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetFormatArgs + /// { + /// TransportStream = new Azure.Media.Inputs.TransformOutputCustomPresetFormatTransportStreamArgs + /// { + /// FilenamePattern = "test{Bitrate}", + /// OutputFiles = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetFormatTransportStreamOutputFileArgs + /// { + /// Labels = new[] + /// { + /// "prod", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// Filter = new Azure.Media.Inputs.TransformOutputCustomPresetFilterArgs + /// { + /// CropRectangle = new Azure.Media.Inputs.TransformOutputCustomPresetFilterCropRectangleArgs + /// { + /// Height = "240", + /// Left = "30", + /// Top = "360", + /// Width = "70", + /// }, + /// Deinterlace = new Azure.Media.Inputs.TransformOutputCustomPresetFilterDeinterlaceArgs + /// { + /// Parity = "TopFieldFirst", + /// Mode = "AutoPixelAdaptive", + /// }, + /// FadeIn = new Azure.Media.Inputs.TransformOutputCustomPresetFilterFadeInArgs + /// { + /// Duration = "PT5S", + /// FadeColor = "0xFF0000", + /// Start = "10", + /// }, + /// FadeOut = new Azure.Media.Inputs.TransformOutputCustomPresetFilterFadeOutArgs + /// { + /// Duration = "90%%", + /// FadeColor = "#FF0C7B", + /// Start = "10%%", + /// }, + /// Rotation = "Auto", + /// Overlays = new[] + /// { + /// new Azure.Media.Inputs.TransformOutputCustomPresetFilterOverlayArgs + /// { + /// Audio = new Azure.Media.Inputs.TransformOutputCustomPresetFilterOverlayAudioArgs + /// { + /// InputLabel = "label.jpg", + /// Start = "PT5S", + /// End = "PT30S", + /// FadeInDuration = "PT1S", + /// FadeOutDuration = "PT2S", + /// AudioGainLevel = 1, + /// }, + /// }, + /// new Azure.Media.Inputs.TransformOutputCustomPresetFilterOverlayArgs + /// { + /// Video = new Azure.Media.Inputs.TransformOutputCustomPresetFilterOverlayVideoArgs + /// { + /// InputLabel = "label.jpg", + /// Start = "PT5S", + /// End = "PT30S", + /// FadeInDuration = "PT1S", + /// FadeOutDuration = "PT2S", + /// AudioGainLevel = 1, + /// Opacity = 1, + /// Position = new Azure.Media.Inputs.TransformOutputCustomPresetFilterOverlayVideoPositionArgs + /// { + /// Height = "180", + /// Left = "20", + /// Top = "240", + /// Width = "140", + /// }, + /// CropRectangle = new Azure.Media.Inputs.TransformOutputCustomPresetFilterOverlayVideoCropRectangleArgs + /// { + /// Height = "240", + /// Left = "30", + /// Top = "360", + /// Width = "70", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Transforms can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MediaServices/Account.cs b/sdk/dotnet/MediaServices/Account.cs index 1cb5aa056b..1ec838284c 100644 --- a/sdk/dotnet/MediaServices/Account.cs +++ b/sdk/dotnet/MediaServices/Account.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.MediaServices /// /// Manages a Media Services Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleServiceAccount = new Azure.Media.ServiceAccount("exampleServiceAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccounts = new[] + /// { + /// new Azure.Media.Inputs.ServiceAccountStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// IsPrimary = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MixedReality/GetSpatialAnchorsAccount.cs b/sdk/dotnet/MixedReality/GetSpatialAnchorsAccount.cs index bc5fde2a41..065853d07e 100644 --- a/sdk/dotnet/MixedReality/GetSpatialAnchorsAccount.cs +++ b/sdk/dotnet/MixedReality/GetSpatialAnchorsAccount.cs @@ -13,12 +13,66 @@ public static class GetSpatialAnchorsAccount { /// /// Get information about an Azure Spatial Anchors Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MixedReality.GetSpatialAnchorsAccount.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accountDomain"] = data.Azurerm_spatial_anchors_account.Account_domain, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSpatialAnchorsAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mixedreality/getSpatialAnchorsAccount:getSpatialAnchorsAccount", args ?? new GetSpatialAnchorsAccountArgs(), options.WithDefaults()); /// /// Get information about an Azure Spatial Anchors Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MixedReality.GetSpatialAnchorsAccount.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["accountDomain"] = data.Azurerm_spatial_anchors_account.Account_domain, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSpatialAnchorsAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mixedreality/getSpatialAnchorsAccount:getSpatialAnchorsAccount", args ?? new GetSpatialAnchorsAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MixedReality/SpatialAnchorsAccount.cs b/sdk/dotnet/MixedReality/SpatialAnchorsAccount.cs index 123574b877..1f735c0da0 100644 --- a/sdk/dotnet/MixedReality/SpatialAnchorsAccount.cs +++ b/sdk/dotnet/MixedReality/SpatialAnchorsAccount.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.MixedReality /// /// Manages an Azure Spatial Anchors Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpatialAnchorsAccount = new Azure.MixedReality.SpatialAnchorsAccount("exampleSpatialAnchorsAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spatial Anchors Account can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/GetNetwork.cs b/sdk/dotnet/Mobile/GetNetwork.cs index 6c65f8cade..3880009012 100644 --- a/sdk/dotnet/Mobile/GetNetwork.cs +++ b/sdk/dotnet/Mobile/GetNetwork.cs @@ -13,12 +13,58 @@ public static class GetNetwork { /// /// Get information about an Azure Mobile Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetwork:getNetwork", args ?? new GetNetworkArgs(), options.WithDefaults()); /// /// Get information about an Azure Mobile Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetwork:getNetwork", args ?? new GetNetworkInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkAttachedDataNetwork.cs b/sdk/dotnet/Mobile/GetNetworkAttachedDataNetwork.cs index ffeb0c13ae..240c0f13ba 100644 --- a/sdk/dotnet/Mobile/GetNetworkAttachedDataNetwork.cs +++ b/sdk/dotnet/Mobile/GetNetworkAttachedDataNetwork.cs @@ -13,12 +13,70 @@ public static class GetNetworkAttachedDataNetwork { /// /// Use this data source to access information about an existing Mobile Network Attached Data Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetworkPacketCoreControlPlane = Azure.Mobile.GetNetworkPacketCoreControlPlane.Invoke(new() + /// { + /// Name = "example-mnpccp", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkAttachedDataNetwork = Azure.Mobile.GetNetworkAttachedDataNetwork.Invoke(new() + /// { + /// MobileNetworkDataNetworkName = exampleNetworkPacketCoreControlPlane.Apply(getNetworkPacketCoreControlPlaneResult => getNetworkPacketCoreControlPlaneResult.Name), + /// MobileNetworkPacketCoreDataPlaneId = exampleNetworkPacketCoreControlPlane.Apply(getNetworkPacketCoreControlPlaneResult => getNetworkPacketCoreControlPlaneResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkAttachedDataNetworkArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkAttachedDataNetwork:getNetworkAttachedDataNetwork", args ?? new GetNetworkAttachedDataNetworkArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Mobile Network Attached Data Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetworkPacketCoreControlPlane = Azure.Mobile.GetNetworkPacketCoreControlPlane.Invoke(new() + /// { + /// Name = "example-mnpccp", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkAttachedDataNetwork = Azure.Mobile.GetNetworkAttachedDataNetwork.Invoke(new() + /// { + /// MobileNetworkDataNetworkName = exampleNetworkPacketCoreControlPlane.Apply(getNetworkPacketCoreControlPlaneResult => getNetworkPacketCoreControlPlaneResult.Name), + /// MobileNetworkPacketCoreDataPlaneId = exampleNetworkPacketCoreControlPlane.Apply(getNetworkPacketCoreControlPlaneResult => getNetworkPacketCoreControlPlaneResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkAttachedDataNetworkInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkAttachedDataNetwork:getNetworkAttachedDataNetwork", args ?? new GetNetworkAttachedDataNetworkInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkDataNetwork.cs b/sdk/dotnet/Mobile/GetNetworkDataNetwork.cs index e289382cd4..9f52f1c90f 100644 --- a/sdk/dotnet/Mobile/GetNetworkDataNetwork.cs +++ b/sdk/dotnet/Mobile/GetNetworkDataNetwork.cs @@ -13,12 +13,70 @@ public static class GetNetworkDataNetwork { /// /// Get information about a Mobile Network Data Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkDataNetwork = Azure.Mobile.GetNetworkDataNetwork.Invoke(new() + /// { + /// Name = "example-mndn", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkDataNetworkArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkDataNetwork:getNetworkDataNetwork", args ?? new GetNetworkDataNetworkArgs(), options.WithDefaults()); /// /// Get information about a Mobile Network Data Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkDataNetwork = Azure.Mobile.GetNetworkDataNetwork.Invoke(new() + /// { + /// Name = "example-mndn", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkDataNetworkInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkDataNetwork:getNetworkDataNetwork", args ?? new GetNetworkDataNetworkInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkPacketCoreControlPlane.cs b/sdk/dotnet/Mobile/GetNetworkPacketCoreControlPlane.cs index f9da037757..30f9a3204e 100644 --- a/sdk/dotnet/Mobile/GetNetworkPacketCoreControlPlane.cs +++ b/sdk/dotnet/Mobile/GetNetworkPacketCoreControlPlane.cs @@ -13,12 +13,58 @@ public static class GetNetworkPacketCoreControlPlane { /// /// Get information about a Mobile Network Packet Core Control Plane. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Mobile.GetNetworkPacketCoreControlPlane.Invoke(new() + /// { + /// Name = "example-mnpccp", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkPacketCoreControlPlaneArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkPacketCoreControlPlane:getNetworkPacketCoreControlPlane", args ?? new GetNetworkPacketCoreControlPlaneArgs(), options.WithDefaults()); /// /// Get information about a Mobile Network Packet Core Control Plane. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Mobile.GetNetworkPacketCoreControlPlane.Invoke(new() + /// { + /// Name = "example-mnpccp", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkPacketCoreControlPlaneInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkPacketCoreControlPlane:getNetworkPacketCoreControlPlane", args ?? new GetNetworkPacketCoreControlPlaneInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkPacketCoreDataPlane.cs b/sdk/dotnet/Mobile/GetNetworkPacketCoreDataPlane.cs index 3077835637..0f5daa4282 100644 --- a/sdk/dotnet/Mobile/GetNetworkPacketCoreDataPlane.cs +++ b/sdk/dotnet/Mobile/GetNetworkPacketCoreDataPlane.cs @@ -13,12 +13,70 @@ public static class GetNetworkPacketCoreDataPlane { /// /// Get information a Mobile Network Packet Core Data Plane. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetworkPacketCoreControlPlane = Azure.Mobile.GetNetworkPacketCoreControlPlane.Invoke(new() + /// { + /// Name = "example-mnpccp", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkPacketCoreDataPlane = Azure.Mobile.GetNetworkPacketCoreDataPlane.Invoke(new() + /// { + /// Name = "example-mnpcdp", + /// MobileNetworkPacketCoreControlPlaneId = exampleNetworkPacketCoreControlPlane.Apply(getNetworkPacketCoreControlPlaneResult => getNetworkPacketCoreControlPlaneResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkPacketCoreDataPlaneArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkPacketCoreDataPlane:getNetworkPacketCoreDataPlane", args ?? new GetNetworkPacketCoreDataPlaneArgs(), options.WithDefaults()); /// /// Get information a Mobile Network Packet Core Data Plane. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetworkPacketCoreControlPlane = Azure.Mobile.GetNetworkPacketCoreControlPlane.Invoke(new() + /// { + /// Name = "example-mnpccp", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkPacketCoreDataPlane = Azure.Mobile.GetNetworkPacketCoreDataPlane.Invoke(new() + /// { + /// Name = "example-mnpcdp", + /// MobileNetworkPacketCoreControlPlaneId = exampleNetworkPacketCoreControlPlane.Apply(getNetworkPacketCoreControlPlaneResult => getNetworkPacketCoreControlPlaneResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkPacketCoreDataPlaneInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkPacketCoreDataPlane:getNetworkPacketCoreDataPlane", args ?? new GetNetworkPacketCoreDataPlaneInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkService.cs b/sdk/dotnet/Mobile/GetNetworkService.cs index 9d88b283a4..ed368f61b1 100644 --- a/sdk/dotnet/Mobile/GetNetworkService.cs +++ b/sdk/dotnet/Mobile/GetNetworkService.cs @@ -13,12 +13,68 @@ public static class GetNetworkService { /// /// Get information about a Mobile Network Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkService = new Azure.Mobile.NetworkService("exampleNetworkService", new() + /// { + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkService:getNetworkService", args ?? new GetNetworkServiceArgs(), options.WithDefaults()); /// /// Get information about a Mobile Network Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkService = new Azure.Mobile.NetworkService("exampleNetworkService", new() + /// { + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkService:getNetworkService", args ?? new GetNetworkServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkSimGroup.cs b/sdk/dotnet/Mobile/GetNetworkSimGroup.cs index 2734678a27..113023380a 100644 --- a/sdk/dotnet/Mobile/GetNetworkSimGroup.cs +++ b/sdk/dotnet/Mobile/GetNetworkSimGroup.cs @@ -13,12 +13,70 @@ public static class GetNetworkSimGroup { /// /// Get information about a Mobile Network Sim Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// var exampleNetworkSimGroup = Azure.Mobile.GetNetworkSimGroup.Invoke(new() + /// { + /// Name = "example-mnsg", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkSimGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkSimGroup:getNetworkSimGroup", args ?? new GetNetworkSimGroupArgs(), options.WithDefaults()); /// /// Get information about a Mobile Network Sim Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// var exampleNetworkSimGroup = Azure.Mobile.GetNetworkSimGroup.Invoke(new() + /// { + /// Name = "example-mnsg", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkSimGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkSimGroup:getNetworkSimGroup", args ?? new GetNetworkSimGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkSimPolicy.cs b/sdk/dotnet/Mobile/GetNetworkSimPolicy.cs index b01e5c5dc5..7308bf0e76 100644 --- a/sdk/dotnet/Mobile/GetNetworkSimPolicy.cs +++ b/sdk/dotnet/Mobile/GetNetworkSimPolicy.cs @@ -13,12 +13,70 @@ public static class GetNetworkSimPolicy { /// /// Get information about a Mobile Network Sim Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkSimPolicy = Azure.Mobile.GetNetworkSimPolicy.Invoke(new() + /// { + /// Name = "example-mnsp", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkSimPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkSimPolicy:getNetworkSimPolicy", args ?? new GetNetworkSimPolicyArgs(), options.WithDefaults()); /// /// Get information about a Mobile Network Sim Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkSimPolicy = Azure.Mobile.GetNetworkSimPolicy.Invoke(new() + /// { + /// Name = "example-mnsp", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkSimPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkSimPolicy:getNetworkSimPolicy", args ?? new GetNetworkSimPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkSite.cs b/sdk/dotnet/Mobile/GetNetworkSite.cs index f6afd41752..e711433db2 100644 --- a/sdk/dotnet/Mobile/GetNetworkSite.cs +++ b/sdk/dotnet/Mobile/GetNetworkSite.cs @@ -13,12 +13,70 @@ public static class GetNetworkSite { /// /// Get information about a Mobile Network Site. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkSite = Azure.Mobile.GetNetworkSite.Invoke(new() + /// { + /// Name = "example-mns", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkSiteArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkSite:getNetworkSite", args ?? new GetNetworkSiteArgs(), options.WithDefaults()); /// /// Get information about a Mobile Network Site. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkSite = Azure.Mobile.GetNetworkSite.Invoke(new() + /// { + /// Name = "example-mns", + /// MobileNetworkId = exampleNetwork.Apply(getNetworkResult => getNetworkResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkSiteInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkSite:getNetworkSite", args ?? new GetNetworkSiteInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/GetNetworkSlice.cs b/sdk/dotnet/Mobile/GetNetworkSlice.cs index 7aaeda1290..bfb6a3159e 100644 --- a/sdk/dotnet/Mobile/GetNetworkSlice.cs +++ b/sdk/dotnet/Mobile/GetNetworkSlice.cs @@ -13,12 +13,70 @@ public static class GetNetworkSlice { /// /// Get information about a Mobile Network Slice. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkSlice = Azure.Mobile.GetNetworkSlice.Invoke(new() + /// { + /// Name = "example-mns", + /// MobileNetworkId = data.Azurerm_mobile_network.Test.Id, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkSliceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mobile/getNetworkSlice:getNetworkSlice", args ?? new GetNetworkSliceArgs(), options.WithDefaults()); /// /// Get information about a Mobile Network Slice. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleNetwork = Azure.Mobile.GetNetwork.Invoke(new() + /// { + /// Name = "example-mn", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// var exampleNetworkSlice = Azure.Mobile.GetNetworkSlice.Invoke(new() + /// { + /// Name = "example-mns", + /// MobileNetworkId = data.Azurerm_mobile_network.Test.Id, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkSliceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mobile/getNetworkSlice:getNetworkSlice", args ?? new GetNetworkSliceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Mobile/Network.cs b/sdk/dotnet/Mobile/Network.cs index 0ad8257739..d98bf3e4ad 100644 --- a/sdk/dotnet/Mobile/Network.cs +++ b/sdk/dotnet/Mobile/Network.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkDataNetwork.cs b/sdk/dotnet/Mobile/NetworkDataNetwork.cs index 2da61c56c8..ef5c104f06 100644 --- a/sdk/dotnet/Mobile/NetworkDataNetwork.cs +++ b/sdk/dotnet/Mobile/NetworkDataNetwork.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Data Network. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East Us", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleNetworkDataNetwork = new Azure.Mobile.NetworkDataNetwork("exampleNetworkDataNetwork", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// Description = "example description", + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Data Network can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkPacketCoreControlPlane.cs b/sdk/dotnet/Mobile/NetworkPacketCoreControlPlane.cs index 2cd67983e8..704ea0caaf 100644 --- a/sdk/dotnet/Mobile/NetworkPacketCoreControlPlane.cs +++ b/sdk/dotnet/Mobile/NetworkPacketCoreControlPlane.cs @@ -12,6 +12,78 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Packet Core Control Plane. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleNetworkSite = new Azure.Mobile.NetworkSite("exampleNetworkSite", new() + /// { + /// MobileNetworkId = azurerm_mobile_network.Test.Id, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleDevice = new Azure.DataboxEdge.Device("exampleDevice", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "EdgeP_Base-Standard", + /// }); + /// + /// var exampleNetworkPacketCoreControlPlane = new Azure.Mobile.NetworkPacketCoreControlPlane("exampleNetworkPacketCoreControlPlane", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "G0", + /// ControlPlaneAccessName = "default-interface", + /// ControlPlaneAccessIpv4Address = "192.168.1.199", + /// ControlPlaneAccessIpv4Gateway = "192.168.1.1", + /// ControlPlaneAccessIpv4Subnet = "192.168.1.0/25", + /// SiteIds = new[] + /// { + /// exampleNetworkSite.Id, + /// }, + /// LocalDiagnosticsAccess = new Azure.Mobile.Inputs.NetworkPacketCoreControlPlaneLocalDiagnosticsAccessArgs + /// { + /// AuthenticationType = "AAD", + /// }, + /// Platform = new Azure.Mobile.Inputs.NetworkPacketCoreControlPlanePlatformArgs + /// { + /// Type = "AKS-HCI", + /// EdgeDeviceId = exampleDevice.Id, + /// }, + /// InteroperabilitySettingsJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["key"] = "value", + /// }), + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Packet Core Control Plane can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkService.cs b/sdk/dotnet/Mobile/NetworkService.cs index d1625fe2d3..16a45fe544 100644 --- a/sdk/dotnet/Mobile/NetworkService.cs +++ b/sdk/dotnet/Mobile/NetworkService.cs @@ -12,6 +12,98 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleNetworkService = new Azure.Mobile.NetworkService("exampleNetworkService", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// ServicePrecedence = 0, + /// PccRules = new[] + /// { + /// new Azure.Mobile.Inputs.NetworkServicePccRuleArgs + /// { + /// Name = "default-rule", + /// Precedence = 1, + /// TrafficControlEnabled = true, + /// QosPolicy = new Azure.Mobile.Inputs.NetworkServicePccRuleQosPolicyArgs + /// { + /// AllocationAndRetentionPriorityLevel = 9, + /// QosIndicator = 9, + /// PreemptionCapability = "NotPreempt", + /// PreemptionVulnerability = "Preemptable", + /// GuaranteedBitRate = new Azure.Mobile.Inputs.NetworkServicePccRuleQosPolicyGuaranteedBitRateArgs + /// { + /// Downlink = "100 Mbps", + /// Uplink = "10 Mbps", + /// }, + /// MaximumBitRate = new Azure.Mobile.Inputs.NetworkServicePccRuleQosPolicyMaximumBitRateArgs + /// { + /// Downlink = "1 Gbps", + /// Uplink = "100 Mbps", + /// }, + /// }, + /// ServiceDataFlowTemplates = new[] + /// { + /// new Azure.Mobile.Inputs.NetworkServicePccRuleServiceDataFlowTemplateArgs + /// { + /// Direction = "Uplink", + /// Name = "IP-to-server", + /// Ports = new() { }, + /// Protocols = new[] + /// { + /// "ip", + /// }, + /// RemoteIpLists = new[] + /// { + /// "10.3.4.0/24", + /// }, + /// }, + /// }, + /// }, + /// }, + /// ServiceQosPolicy = new Azure.Mobile.Inputs.NetworkServiceServiceQosPolicyArgs + /// { + /// AllocationAndRetentionPriorityLevel = 9, + /// QosIndicator = 9, + /// PreemptionCapability = "NotPreempt", + /// PreemptionVulnerability = "Preemptable", + /// MaximumBitRate = new Azure.Mobile.Inputs.NetworkServiceServiceQosPolicyMaximumBitRateArgs + /// { + /// Downlink = "1 Gbps", + /// Uplink = "100 Mbps", + /// }, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkSim.cs b/sdk/dotnet/Mobile/NetworkSim.cs index 81f07a7564..41c45ea489 100644 --- a/sdk/dotnet/Mobile/NetworkSim.cs +++ b/sdk/dotnet/Mobile/NetworkSim.cs @@ -12,6 +12,89 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Sim. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleNetworkSimGroup = new Azure.Mobile.NetworkSimGroup("exampleNetworkSimGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// MobileNetworkId = exampleNetwork.Id, + /// }); + /// + /// var exampleNetworkSlice = new Azure.Mobile.NetworkSlice("exampleNetworkSlice", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// SingleNetworkSliceSelectionAssistanceInformation = new Azure.Mobile.Inputs.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs + /// { + /// SliceServiceType = 1, + /// }, + /// }); + /// + /// var exampleNetworkAttachedDataNetwork = new Azure.Mobile.NetworkAttachedDataNetwork("exampleNetworkAttachedDataNetwork", new() + /// { + /// MobileNetworkDataNetworkName = azurerm_mobile_network_data_network.Example.Name, + /// MobileNetworkPacketCoreDataPlaneId = azurerm_mobile_network_packet_core_data_plane.Example.Id, + /// Location = exampleResourceGroup.Location, + /// DnsAddresses = new[] + /// { + /// "1.1.1.1", + /// }, + /// UserEquipmentAddressPoolPrefixes = new[] + /// { + /// "2.4.0.0/24", + /// }, + /// UserEquipmentStaticAddressPoolPrefixes = new[] + /// { + /// "2.4.1.0/24", + /// }, + /// UserPlaneAccessName = "test", + /// UserPlaneAccessIpv4Address = "10.204.141.4", + /// UserPlaneAccessIpv4Gateway = "10.204.141.1", + /// UserPlaneAccessIpv4Subnet = "10.204.141.0/24", + /// }); + /// + /// var exampleNetworkSim = new Azure.Mobile.NetworkSim("exampleNetworkSim", new() + /// { + /// MobileNetworkSimGroupId = exampleNetworkSimGroup.Id, + /// AuthenticationKey = "00000000000000000000000000000000", + /// IntegratedCircuitCardIdentifier = "8900000000000000000", + /// InternationalMobileSubscriberIdentity = "000000000000000", + /// OperatorKeyCode = "00000000000000000000000000000000", + /// StaticIpConfigurations = new[] + /// { + /// new Azure.Mobile.Inputs.NetworkSimStaticIpConfigurationArgs + /// { + /// AttachedDataNetworkId = data.Azurerm_mobile_network_attached_data_network.Test.Id, + /// SliceId = azurerm_mobile_network_slice.Test.Id, + /// StaticIpv4Address = "2.4.0.1", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Sim can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkSimGroup.cs b/sdk/dotnet/Mobile/NetworkSimGroup.cs index e7893ef33b..b59b5b2f24 100644 --- a/sdk/dotnet/Mobile/NetworkSimGroup.cs +++ b/sdk/dotnet/Mobile/NetworkSimGroup.cs @@ -12,6 +12,69 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Sim Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleUserAssignedIdentity = Azure.Authorization.GetUserAssignedIdentity.Invoke(new() + /// { + /// Name = "name_of_user_assigned_identity", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = "example-kv", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// var exampleKey = Azure.KeyVault.GetKey.Invoke(new() + /// { + /// Name = "example-key", + /// KeyVaultId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// var exampleNetworkSimGroup = new Azure.Mobile.NetworkSimGroup("exampleNetworkSimGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// MobileNetworkId = exampleNetwork.Id, + /// EncryptionKeyUrl = exampleKey.Apply(getKeyResult => getKeyResult.Id), + /// Identity = new Azure.Mobile.Inputs.NetworkSimGroupIdentityArgs + /// { + /// Type = "SystemAssigned, UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Apply(getUserAssignedIdentityResult => getUserAssignedIdentityResult.Id), + /// }, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Sim Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkSimPolicy.cs b/sdk/dotnet/Mobile/NetworkSimPolicy.cs index b13926c26e..919da2f5a9 100644 --- a/sdk/dotnet/Mobile/NetworkSimPolicy.cs +++ b/sdk/dotnet/Mobile/NetworkSimPolicy.cs @@ -12,6 +12,127 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Sim Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleNetworkDataNetwork = new Azure.Mobile.NetworkDataNetwork("exampleNetworkDataNetwork", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleNetworkService = new Azure.Mobile.NetworkService("exampleNetworkService", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// ServicePrecedence = 0, + /// PccRules = new[] + /// { + /// new Azure.Mobile.Inputs.NetworkServicePccRuleArgs + /// { + /// Name = "default-rule", + /// Precedence = 1, + /// TrafficControlEnabled = true, + /// ServiceDataFlowTemplates = new[] + /// { + /// new Azure.Mobile.Inputs.NetworkServicePccRuleServiceDataFlowTemplateArgs + /// { + /// Direction = "Uplink", + /// Name = "IP-to-server", + /// Ports = new() { }, + /// Protocols = new[] + /// { + /// "ip", + /// }, + /// RemoteIpLists = new[] + /// { + /// "10.3.4.0/24", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleNetworkSlice = new Azure.Mobile.NetworkSlice("exampleNetworkSlice", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// SingleNetworkSliceSelectionAssistanceInformation = new Azure.Mobile.Inputs.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs + /// { + /// SliceServiceType = 1, + /// }, + /// }); + /// + /// var exampleNetworkSimPolicy = new Azure.Mobile.NetworkSimPolicy("exampleNetworkSimPolicy", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// RegistrationTimerInSeconds = 3240, + /// DefaultSliceId = exampleNetworkSlice.Id, + /// Slices = new[] + /// { + /// new Azure.Mobile.Inputs.NetworkSimPolicySliceArgs + /// { + /// DefaultDataNetworkId = exampleNetworkDataNetwork.Id, + /// SliceId = exampleNetworkSlice.Id, + /// DataNetworks = new[] + /// { + /// new Azure.Mobile.Inputs.NetworkSimPolicySliceDataNetworkArgs + /// { + /// DataNetworkId = exampleNetworkDataNetwork.Id, + /// AllocationAndRetentionPriorityLevel = 9, + /// DefaultSessionType = "IPv4", + /// QosIndicator = 9, + /// PreemptionCapability = "NotPreempt", + /// PreemptionVulnerability = "Preemptable", + /// AllowedServicesIds = new[] + /// { + /// exampleNetworkService.Id, + /// }, + /// SessionAggregateMaximumBitRate = new Azure.Mobile.Inputs.NetworkSimPolicySliceDataNetworkSessionAggregateMaximumBitRateArgs + /// { + /// Downlink = "1 Gbps", + /// Uplink = "500 Mbps", + /// }, + /// }, + /// }, + /// }, + /// }, + /// UserEquipmentAggregateMaximumBitRate = new Azure.Mobile.Inputs.NetworkSimPolicyUserEquipmentAggregateMaximumBitRateArgs + /// { + /// Downlink = "1 Gbps", + /// Uplink = "500 Mbps", + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Sim Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkSite.cs b/sdk/dotnet/Mobile/NetworkSite.cs index f39b96d407..85ea3b02c0 100644 --- a/sdk/dotnet/Mobile/NetworkSite.cs +++ b/sdk/dotnet/Mobile/NetworkSite.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Site. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDevice = new Azure.DataboxEdge.Device("exampleDevice", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "EdgeP_Base-Standard", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleNetworkSite = new Azure.Mobile.NetworkSite("exampleNetworkSite", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Site can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Mobile/NetworkSlice.cs b/sdk/dotnet/Mobile/NetworkSlice.cs index 299dbd02d9..e9f3e33cbf 100644 --- a/sdk/dotnet/Mobile/NetworkSlice.cs +++ b/sdk/dotnet/Mobile/NetworkSlice.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Mobile /// /// Manages a Mobile Network Slice. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetwork = new Azure.Mobile.Network("exampleNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// MobileCountryCode = "001", + /// MobileNetworkCode = "01", + /// }); + /// + /// var exampleNetworkSlice = new Azure.Mobile.NetworkSlice("exampleNetworkSlice", new() + /// { + /// MobileNetworkId = exampleNetwork.Id, + /// Location = exampleResourceGroup.Location, + /// Description = "an example slice", + /// SingleNetworkSliceSelectionAssistanceInformation = new Azure.Mobile.Inputs.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs + /// { + /// SliceServiceType = 1, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Mobile Network Slice can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/AadDiagnosticSetting.cs b/sdk/dotnet/Monitoring/AadDiagnosticSetting.cs index ba290cc6ed..0e134e7721 100644 --- a/sdk/dotnet/Monitoring/AadDiagnosticSetting.cs +++ b/sdk/dotnet/Monitoring/AadDiagnosticSetting.cs @@ -14,6 +14,77 @@ namespace Pulumi.Azure.Monitoring /// /// !> **Authentication** The API for this resource does not support service principal authentication. This resource can only be used with Azure CLI authentication. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountKind = "StorageV2", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleAadDiagnosticSetting = new Azure.Monitoring.AadDiagnosticSetting("exampleAadDiagnosticSetting", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// EnabledLogs = new[] + /// { + /// new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs + /// { + /// Category = "SignInLogs", + /// RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs + /// { + /// Enabled = true, + /// Days = 1, + /// }, + /// }, + /// new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs + /// { + /// Category = "AuditLogs", + /// RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs + /// { + /// Enabled = true, + /// Days = 1, + /// }, + /// }, + /// new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs + /// { + /// Category = "NonInteractiveUserSignInLogs", + /// RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs + /// { + /// Enabled = true, + /// Days = 1, + /// }, + /// }, + /// new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs + /// { + /// Category = "ServicePrincipalSignInLogs", + /// RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs + /// { + /// Enabled = true, + /// Days = 1, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Monitor Azure Active Directory Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/ActionGroup.cs b/sdk/dotnet/Monitoring/ActionGroup.cs index b2dec9c497..64772a6287 100644 --- a/sdk/dotnet/Monitoring/ActionGroup.cs +++ b/sdk/dotnet/Monitoring/ActionGroup.cs @@ -12,6 +12,157 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Action Group within Azure Monitor. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "p0action", + /// ArmRoleReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupArmRoleReceiverArgs + /// { + /// Name = "armroleaction", + /// RoleId = "de139f84-1756-47ae-9be6-808fbbe84772", + /// UseCommonAlertSchema = true, + /// }, + /// }, + /// AutomationRunbookReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupAutomationRunbookReceiverArgs + /// { + /// Name = "action_name_1", + /// AutomationAccountId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001", + /// RunbookName = "my runbook", + /// WebhookResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001/webHooks/webhook_alert", + /// IsGlobalRunbook = true, + /// ServiceUri = "https://s13events.azure-automation.net/webhooks?token=randomtoken", + /// UseCommonAlertSchema = true, + /// }, + /// }, + /// AzureAppPushReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupAzureAppPushReceiverArgs + /// { + /// Name = "pushtoadmin", + /// EmailAddress = "admin@contoso.com", + /// }, + /// }, + /// AzureFunctionReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupAzureFunctionReceiverArgs + /// { + /// Name = "funcaction", + /// FunctionAppResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-funcapp/providers/Microsoft.Web/sites/funcapp", + /// FunctionName = "myfunc", + /// HttpTriggerUrl = "https://example.com/trigger", + /// UseCommonAlertSchema = true, + /// }, + /// }, + /// EmailReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupEmailReceiverArgs + /// { + /// Name = "sendtoadmin", + /// EmailAddress = "admin@contoso.com", + /// }, + /// new Azure.Monitoring.Inputs.ActionGroupEmailReceiverArgs + /// { + /// Name = "sendtodevops", + /// EmailAddress = "devops@contoso.com", + /// UseCommonAlertSchema = true, + /// }, + /// }, + /// EventHubReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupEventHubReceiverArgs + /// { + /// Name = "sendtoeventhub", + /// EventHubNamespace = "eventhubnamespace", + /// EventHubName = "eventhub1", + /// SubscriptionId = "00000000-0000-0000-0000-000000000000", + /// UseCommonAlertSchema = false, + /// }, + /// }, + /// ItsmReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupItsmReceiverArgs + /// { + /// Name = "createorupdateticket", + /// WorkspaceId = Output.Tuple(current, exampleAnalyticsWorkspace.WorkspaceId).Apply(values => + /// { + /// var current = values.Item1; + /// var workspaceId = values.Item2; + /// return $"{current.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId)}|{workspaceId}"; + /// }), + /// ConnectionId = "53de6956-42b4-41ba-be3c-b154cdf17b13", + /// TicketConfiguration = "{\"PayloadRevision\":0,\"WorkItemType\":\"Incident\",\"UseTemplate\":false,\"WorkItemData\":\"{}\",\"CreateOneWIPerCI\":false}", + /// Region = "southcentralus", + /// }, + /// }, + /// LogicAppReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupLogicAppReceiverArgs + /// { + /// Name = "logicappaction", + /// ResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-logicapp/providers/Microsoft.Logic/workflows/logicapp", + /// CallbackUrl = "https://logicapptriggerurl/...", + /// UseCommonAlertSchema = true, + /// }, + /// }, + /// SmsReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupSmsReceiverArgs + /// { + /// Name = "oncallmsg", + /// CountryCode = "1", + /// PhoneNumber = "1231231234", + /// }, + /// }, + /// VoiceReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupVoiceReceiverArgs + /// { + /// Name = "remotesupport", + /// CountryCode = "86", + /// PhoneNumber = "13888888888", + /// }, + /// }, + /// WebhookReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupWebhookReceiverArgs + /// { + /// Name = "callmyapiaswell", + /// ServiceUri = "http://example.com/alert", + /// UseCommonAlertSchema = true, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Action Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/ActionRuleActionGroup.cs b/sdk/dotnet/Monitoring/ActionRuleActionGroup.cs index af3fc5808c..ace6c3e727 100644 --- a/sdk/dotnet/Monitoring/ActionRuleActionGroup.cs +++ b/sdk/dotnet/Monitoring/ActionRuleActionGroup.cs @@ -14,6 +14,48 @@ namespace Pulumi.Azure.Monitoring /// /// !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.monitoring.AlertProcessingRuleActionGroup` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "example", + /// }); + /// + /// var exampleActionRuleActionGroup = new Azure.Monitoring.ActionRuleActionGroup("exampleActionRuleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ActionGroupId = exampleActionGroup.Id, + /// Scope = new Azure.Monitoring.Inputs.ActionRuleActionGroupScopeArgs + /// { + /// Type = "ResourceGroup", + /// ResourceIds = new[] + /// { + /// exampleResourceGroup.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/ActionRuleSuppression.cs b/sdk/dotnet/Monitoring/ActionRuleSuppression.cs index 9ed36680fb..0db56740b4 100644 --- a/sdk/dotnet/Monitoring/ActionRuleSuppression.cs +++ b/sdk/dotnet/Monitoring/ActionRuleSuppression.cs @@ -14,6 +14,57 @@ namespace Pulumi.Azure.Monitoring /// /// !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.monitoring.AlertProcessingRuleSuppression` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleActionRuleSuppression = new Azure.Monitoring.ActionRuleSuppression("exampleActionRuleSuppression", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Monitoring.Inputs.ActionRuleSuppressionScopeArgs + /// { + /// Type = "ResourceGroup", + /// ResourceIds = new[] + /// { + /// exampleResourceGroup.Id, + /// }, + /// }, + /// Suppression = new Azure.Monitoring.Inputs.ActionRuleSuppressionSuppressionArgs + /// { + /// RecurrenceType = "Weekly", + /// Schedule = new Azure.Monitoring.Inputs.ActionRuleSuppressionSuppressionScheduleArgs + /// { + /// StartDateUtc = "2019-01-01T01:02:03Z", + /// EndDateUtc = "2019-01-03T15:02:07Z", + /// RecurrenceWeeklies = new[] + /// { + /// "Sunday", + /// "Monday", + /// "Friday", + /// "Saturday", + /// }, + /// }, + /// }, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/ActivityLogAlert.cs b/sdk/dotnet/Monitoring/ActivityLogAlert.cs index a89de153a6..e806397fd6 100644 --- a/sdk/dotnet/Monitoring/ActivityLogAlert.cs +++ b/sdk/dotnet/Monitoring/ActivityLogAlert.cs @@ -12,6 +12,73 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Activity Log Alert within Azure Monitor. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var mainActionGroup = new Azure.Monitoring.ActionGroup("mainActionGroup", new() + /// { + /// ResourceGroupName = example.Name, + /// ShortName = "p0action", + /// WebhookReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupWebhookReceiverArgs + /// { + /// Name = "callmyapi", + /// ServiceUri = "http://example.com/alert", + /// }, + /// }, + /// }); + /// + /// var toMonitor = new Azure.Storage.Account("toMonitor", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var mainActivityLogAlert = new Azure.Monitoring.ActivityLogAlert("mainActivityLogAlert", new() + /// { + /// ResourceGroupName = example.Name, + /// Scopes = new[] + /// { + /// example.Id, + /// }, + /// Description = "This alert will monitor a specific storage account updates.", + /// Criteria = new Azure.Monitoring.Inputs.ActivityLogAlertCriteriaArgs + /// { + /// ResourceId = toMonitor.Id, + /// OperationName = "Microsoft.Storage/storageAccounts/write", + /// Category = "Recommendation", + /// }, + /// Actions = new[] + /// { + /// new Azure.Monitoring.Inputs.ActivityLogAlertActionArgs + /// { + /// ActionGroupId = mainActionGroup.Id, + /// WebhookProperties = + /// { + /// { "from", "source" }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Activity log alerts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/AlertProcessingRuleActionGroup.cs b/sdk/dotnet/Monitoring/AlertProcessingRuleActionGroup.cs index 64b9c1164e..dd88478c13 100644 --- a/sdk/dotnet/Monitoring/AlertProcessingRuleActionGroup.cs +++ b/sdk/dotnet/Monitoring/AlertProcessingRuleActionGroup.cs @@ -12,6 +12,96 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Alert Processing Rule which apply action group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "action", + /// }); + /// + /// var exampleAlertProcessingRuleActionGroup = new Azure.Monitoring.AlertProcessingRuleActionGroup("exampleAlertProcessingRuleActionGroup", new() + /// { + /// ResourceGroupName = "example", + /// Scopes = new[] + /// { + /// exampleResourceGroup.Id, + /// }, + /// AddActionGroupIds = new[] + /// { + /// exampleActionGroup.Id, + /// }, + /// Condition = new Azure.Monitoring.Inputs.AlertProcessingRuleActionGroupConditionArgs + /// { + /// TargetResourceType = new Azure.Monitoring.Inputs.AlertProcessingRuleActionGroupConditionTargetResourceTypeArgs + /// { + /// Operator = "Equals", + /// Values = new[] + /// { + /// "Microsoft.Compute/VirtualMachines", + /// }, + /// }, + /// Severity = new Azure.Monitoring.Inputs.AlertProcessingRuleActionGroupConditionSeverityArgs + /// { + /// Operator = "Equals", + /// Values = new[] + /// { + /// "Sev0", + /// "Sev1", + /// "Sev2", + /// }, + /// }, + /// }, + /// Schedule = new Azure.Monitoring.Inputs.AlertProcessingRuleActionGroupScheduleArgs + /// { + /// EffectiveFrom = "2022-01-01T01:02:03", + /// EffectiveUntil = "2022-02-02T01:02:03", + /// TimeZone = "Pacific Standard Time", + /// Recurrence = new Azure.Monitoring.Inputs.AlertProcessingRuleActionGroupScheduleRecurrenceArgs + /// { + /// Dailies = new[] + /// { + /// new Azure.Monitoring.Inputs.AlertProcessingRuleActionGroupScheduleRecurrenceDailyArgs + /// { + /// StartTime = "17:00:00", + /// EndTime = "09:00:00", + /// }, + /// }, + /// Weeklies = new[] + /// { + /// new Azure.Monitoring.Inputs.AlertProcessingRuleActionGroupScheduleRecurrenceWeeklyArgs + /// { + /// DaysOfWeeks = new[] + /// { + /// "Saturday", + /// "Sunday", + /// }, + /// }, + /// }, + /// }, + /// }, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/AlertProcessingRuleSuppression.cs b/sdk/dotnet/Monitoring/AlertProcessingRuleSuppression.cs index 99ca665cc6..4ae0784525 100644 --- a/sdk/dotnet/Monitoring/AlertProcessingRuleSuppression.cs +++ b/sdk/dotnet/Monitoring/AlertProcessingRuleSuppression.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Alert Processing Rule which suppress notifications. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAlertProcessingRuleSuppression = new Azure.Monitoring.AlertProcessingRuleSuppression("exampleAlertProcessingRuleSuppression", new() + /// { + /// ResourceGroupName = "example", + /// Scopes = new[] + /// { + /// exampleResourceGroup.Id, + /// }, + /// Condition = new Azure.Monitoring.Inputs.AlertProcessingRuleSuppressionConditionArgs + /// { + /// TargetResourceType = new Azure.Monitoring.Inputs.AlertProcessingRuleSuppressionConditionTargetResourceTypeArgs + /// { + /// Operator = "Equals", + /// Values = new[] + /// { + /// "Microsoft.Compute/VirtualMachines", + /// }, + /// }, + /// Severity = new Azure.Monitoring.Inputs.AlertProcessingRuleSuppressionConditionSeverityArgs + /// { + /// Operator = "Equals", + /// Values = new[] + /// { + /// "Sev0", + /// "Sev1", + /// "Sev2", + /// }, + /// }, + /// }, + /// Schedule = new Azure.Monitoring.Inputs.AlertProcessingRuleSuppressionScheduleArgs + /// { + /// EffectiveFrom = "2022-01-01T01:02:03", + /// EffectiveUntil = "2022-02-02T01:02:03", + /// TimeZone = "Pacific Standard Time", + /// Recurrence = new Azure.Monitoring.Inputs.AlertProcessingRuleSuppressionScheduleRecurrenceArgs + /// { + /// Dailies = new[] + /// { + /// new Azure.Monitoring.Inputs.AlertProcessingRuleSuppressionScheduleRecurrenceDailyArgs + /// { + /// StartTime = "17:00:00", + /// EndTime = "09:00:00", + /// }, + /// }, + /// Weeklies = new[] + /// { + /// new Azure.Monitoring.Inputs.AlertProcessingRuleSuppressionScheduleRecurrenceWeeklyArgs + /// { + /// DaysOfWeeks = new[] + /// { + /// "Saturday", + /// "Sunday", + /// }, + /// }, + /// }, + /// }, + /// }, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/AutoscaleSetting.cs b/sdk/dotnet/Monitoring/AutoscaleSetting.cs index 9c44819cdb..545a965b5a 100644 --- a/sdk/dotnet/Monitoring/AutoscaleSetting.cs +++ b/sdk/dotnet/Monitoring/AutoscaleSetting.cs @@ -12,6 +12,354 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// UpgradeMode = "Manual", + /// Sku = "Standard_F2", + /// Instances = 2, + /// AdminUsername = "myadmin", + /// AdminSshKeys = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs + /// { + /// Username = "myadmin", + /// PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + /// }, + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "TestNetworkProfile", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "TestIPConfiguration", + /// Primary = true, + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// }, + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "StandardSSD_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// }); + /// + /// var exampleAutoscaleSetting = new Azure.Monitoring.AutoscaleSetting("exampleAutoscaleSetting", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// TargetResourceId = exampleLinuxVirtualMachineScaleSet.Id, + /// Profiles = new[] + /// { + /// new Azure.Monitoring.Inputs.AutoscaleSettingProfileArgs + /// { + /// Name = "defaultProfile", + /// Capacity = new Azure.Monitoring.Inputs.AutoscaleSettingProfileCapacityArgs + /// { + /// Default = 1, + /// Minimum = 1, + /// Maximum = 10, + /// }, + /// Rules = new[] + /// { + /// new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs + /// { + /// MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs + /// { + /// MetricName = "Percentage CPU", + /// MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id, + /// TimeGrain = "PT1M", + /// Statistic = "Average", + /// TimeWindow = "PT5M", + /// TimeAggregation = "Average", + /// Operator = "GreaterThan", + /// Threshold = 75, + /// MetricNamespace = "microsoft.compute/virtualmachinescalesets", + /// Dimensions = new[] + /// { + /// new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerDimensionArgs + /// { + /// Name = "AppName", + /// Operator = "Equals", + /// Values = new[] + /// { + /// "App1", + /// }, + /// }, + /// }, + /// }, + /// ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs + /// { + /// Direction = "Increase", + /// Type = "ChangeCount", + /// Value = 1, + /// Cooldown = "PT1M", + /// }, + /// }, + /// new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs + /// { + /// MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs + /// { + /// MetricName = "Percentage CPU", + /// MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id, + /// TimeGrain = "PT1M", + /// Statistic = "Average", + /// TimeWindow = "PT5M", + /// TimeAggregation = "Average", + /// Operator = "LessThan", + /// Threshold = 25, + /// }, + /// ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs + /// { + /// Direction = "Decrease", + /// Type = "ChangeCount", + /// Value = 1, + /// Cooldown = "PT1M", + /// }, + /// }, + /// }, + /// }, + /// }, + /// Predictive = new Azure.Monitoring.Inputs.AutoscaleSettingPredictiveArgs + /// { + /// ScaleMode = "Enabled", + /// LookAheadTime = "PT5M", + /// }, + /// Notification = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationArgs + /// { + /// Email = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationEmailArgs + /// { + /// SendToSubscriptionAdministrator = true, + /// SendToSubscriptionCoAdministrator = true, + /// CustomEmails = new[] + /// { + /// "admin@contoso.com", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### For Fixed Dates) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// UpgradeMode = "Manual", + /// Sku = "Standard_F2", + /// Instances = 2, + /// AdminUsername = "myadmin", + /// AdminSshKeys = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs + /// { + /// Username = "myadmin", + /// PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + /// }, + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "TestNetworkProfile", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "TestIPConfiguration", + /// Primary = true, + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// }, + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "StandardSSD_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// }); + /// + /// var exampleAutoscaleSetting = new Azure.Monitoring.AutoscaleSetting("exampleAutoscaleSetting", new() + /// { + /// Enabled = true, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// TargetResourceId = exampleLinuxVirtualMachineScaleSet.Id, + /// Profiles = new[] + /// { + /// new Azure.Monitoring.Inputs.AutoscaleSettingProfileArgs + /// { + /// Name = "forJuly", + /// Capacity = new Azure.Monitoring.Inputs.AutoscaleSettingProfileCapacityArgs + /// { + /// Default = 1, + /// Minimum = 1, + /// Maximum = 10, + /// }, + /// Rules = new[] + /// { + /// new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs + /// { + /// MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs + /// { + /// MetricName = "Percentage CPU", + /// MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id, + /// TimeGrain = "PT1M", + /// Statistic = "Average", + /// TimeWindow = "PT5M", + /// TimeAggregation = "Average", + /// Operator = "GreaterThan", + /// Threshold = 90, + /// }, + /// ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs + /// { + /// Direction = "Increase", + /// Type = "ChangeCount", + /// Value = 2, + /// Cooldown = "PT1M", + /// }, + /// }, + /// new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleArgs + /// { + /// MetricTrigger = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleMetricTriggerArgs + /// { + /// MetricName = "Percentage CPU", + /// MetricResourceId = exampleLinuxVirtualMachineScaleSet.Id, + /// TimeGrain = "PT1M", + /// Statistic = "Average", + /// TimeWindow = "PT5M", + /// TimeAggregation = "Average", + /// Operator = "LessThan", + /// Threshold = 10, + /// }, + /// ScaleAction = new Azure.Monitoring.Inputs.AutoscaleSettingProfileRuleScaleActionArgs + /// { + /// Direction = "Decrease", + /// Type = "ChangeCount", + /// Value = 2, + /// Cooldown = "PT1M", + /// }, + /// }, + /// }, + /// FixedDate = new Azure.Monitoring.Inputs.AutoscaleSettingProfileFixedDateArgs + /// { + /// Timezone = "Pacific Standard Time", + /// Start = "2020-07-01T00:00:00Z", + /// End = "2020-07-31T23:59:59Z", + /// }, + /// }, + /// }, + /// Notification = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationArgs + /// { + /// Email = new Azure.Monitoring.Inputs.AutoscaleSettingNotificationEmailArgs + /// { + /// SendToSubscriptionAdministrator = true, + /// SendToSubscriptionCoAdministrator = true, + /// CustomEmails = new[] + /// { + /// "admin@contoso.com", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// AutoScale Setting can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/DataCollectionEndpoint.cs b/sdk/dotnet/Monitoring/DataCollectionEndpoint.cs index ed5a623ae1..4639b1823c 100644 --- a/sdk/dotnet/Monitoring/DataCollectionEndpoint.cs +++ b/sdk/dotnet/Monitoring/DataCollectionEndpoint.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a Data Collection Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDataCollectionEndpoint = new Azure.Monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Kind = "Windows", + /// PublicNetworkAccessEnabled = true, + /// Description = "monitor_data_collection_endpoint example", + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Collection Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/DataCollectionRule.cs b/sdk/dotnet/Monitoring/DataCollectionRule.cs index 59bcf174e4..f28c051560 100644 --- a/sdk/dotnet/Monitoring/DataCollectionRule.cs +++ b/sdk/dotnet/Monitoring/DataCollectionRule.cs @@ -12,6 +12,320 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a Data Collection Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleAnalyticsSolution = new Azure.OperationalInsights.AnalyticsSolution("exampleAnalyticsSolution", new() + /// { + /// SolutionName = "WindowsEventForwarding", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// Plan = new Azure.OperationalInsights.Inputs.AnalyticsSolutionPlanArgs + /// { + /// Publisher = "Microsoft", + /// Product = "OMSGallery/WindowsEventForwarding", + /// }, + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 1, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleDataCollectionEndpoint = new Azure.Monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleDataCollectionRule = new Azure.Monitoring.DataCollectionRule("exampleDataCollectionRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// DataCollectionEndpointId = exampleDataCollectionEndpoint.Id, + /// Destinations = new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsArgs + /// { + /// LogAnalytics = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsLogAnalyticArgs + /// { + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// Name = "example-destination-log", + /// }, + /// }, + /// EventHub = new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsEventHubArgs + /// { + /// EventHubId = exampleEventHub.Id, + /// Name = "example-destination-eventhub", + /// }, + /// StorageBlobs = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsStorageBlobArgs + /// { + /// StorageAccountId = exampleAccount.Id, + /// ContainerName = exampleContainer.Name, + /// Name = "example-destination-storage", + /// }, + /// }, + /// AzureMonitorMetrics = new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsAzureMonitorMetricsArgs + /// { + /// Name = "example-destination-metrics", + /// }, + /// }, + /// DataFlows = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataFlowArgs + /// { + /// Streams = new[] + /// { + /// "Microsoft-InsightsMetrics", + /// }, + /// Destinations = new[] + /// { + /// "example-destination-metrics", + /// }, + /// }, + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataFlowArgs + /// { + /// Streams = new[] + /// { + /// "Microsoft-InsightsMetrics", + /// "Microsoft-Syslog", + /// "Microsoft-Perf", + /// }, + /// Destinations = new[] + /// { + /// "example-destination-log", + /// }, + /// }, + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataFlowArgs + /// { + /// Streams = new[] + /// { + /// "Custom-MyTableRawData", + /// }, + /// Destinations = new[] + /// { + /// "example-destination-log", + /// }, + /// OutputStream = "Microsoft-Syslog", + /// TransformKql = "source | project TimeGenerated = Time, Computer, Message = AdditionalContext", + /// }, + /// }, + /// DataSources = new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesArgs + /// { + /// Syslogs = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesSyslogArgs + /// { + /// FacilityNames = new[] + /// { + /// "*", + /// }, + /// LogLevels = new[] + /// { + /// "*", + /// }, + /// Name = "example-datasource-syslog", + /// Streams = new[] + /// { + /// "Microsoft-Syslog", + /// }, + /// }, + /// }, + /// IisLogs = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesIisLogArgs + /// { + /// Streams = new[] + /// { + /// "Microsoft-W3CIISLog", + /// }, + /// Name = "example-datasource-iis", + /// LogDirectories = new[] + /// { + /// "C:\\Logs\\W3SVC1", + /// }, + /// }, + /// }, + /// LogFiles = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesLogFileArgs + /// { + /// Name = "example-datasource-logfile", + /// Format = "text", + /// Streams = new[] + /// { + /// "Custom-MyTableRawData", + /// }, + /// FilePatterns = new[] + /// { + /// "C:\\JavaLogs\\*.log", + /// }, + /// Settings = new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesLogFileSettingsArgs + /// { + /// Text = new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesLogFileSettingsTextArgs + /// { + /// RecordStartTimestampFormat = "ISO 8601", + /// }, + /// }, + /// }, + /// }, + /// PerformanceCounters = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesPerformanceCounterArgs + /// { + /// Streams = new[] + /// { + /// "Microsoft-Perf", + /// "Microsoft-InsightsMetrics", + /// }, + /// SamplingFrequencyInSeconds = 60, + /// CounterSpecifiers = new[] + /// { + /// "Processor(*)\\% Processor Time", + /// }, + /// Name = "example-datasource-perfcounter", + /// }, + /// }, + /// WindowsEventLogs = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesWindowsEventLogArgs + /// { + /// Streams = new[] + /// { + /// "Microsoft-WindowsEvent", + /// }, + /// XPathQueries = new[] + /// { + /// "*![System/Level=1]", + /// }, + /// Name = "example-datasource-wineventlog", + /// }, + /// }, + /// Extensions = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataSourcesExtensionArgs + /// { + /// Streams = new[] + /// { + /// "Microsoft-WindowsEvent", + /// }, + /// InputDataSources = new[] + /// { + /// "example-datasource-wineventlog", + /// }, + /// ExtensionName = "example-extension-name", + /// ExtensionJson = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// ["a"] = 1, + /// ["b"] = "hello", + /// }), + /// Name = "example-datasource-extension", + /// }, + /// }, + /// }, + /// StreamDeclarations = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleStreamDeclarationArgs + /// { + /// StreamName = "Custom-MyTableRawData", + /// Columns = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleStreamDeclarationColumnArgs + /// { + /// Name = "Time", + /// Type = "datetime", + /// }, + /// new Azure.Monitoring.Inputs.DataCollectionRuleStreamDeclarationColumnArgs + /// { + /// Name = "Computer", + /// Type = "string", + /// }, + /// new Azure.Monitoring.Inputs.DataCollectionRuleStreamDeclarationColumnArgs + /// { + /// Name = "AdditionalContext", + /// Type = "string", + /// }, + /// }, + /// }, + /// }, + /// Identity = new Azure.Monitoring.Inputs.DataCollectionRuleIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Description = "data collection rule example", + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleAnalyticsSolution, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Collection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/DataCollectionRuleAssociation.cs b/sdk/dotnet/Monitoring/DataCollectionRuleAssociation.cs index 1887ff2775..5ac8b94c0f 100644 --- a/sdk/dotnet/Monitoring/DataCollectionRuleAssociation.cs +++ b/sdk/dotnet/Monitoring/DataCollectionRuleAssociation.cs @@ -12,6 +12,134 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a Data Collection Rule Association. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_B1ls", + /// AdminUsername = "adminuser", + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// AdminPassword = "example-Password@7890", + /// DisablePasswordAuthentication = false, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// }); + /// + /// var exampleDataCollectionRule = new Azure.Monitoring.DataCollectionRule("exampleDataCollectionRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Destinations = new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsArgs + /// { + /// AzureMonitorMetrics = new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsAzureMonitorMetricsArgs + /// { + /// Name = "example-destination-metrics", + /// }, + /// }, + /// DataFlows = new[] + /// { + /// new Azure.Monitoring.Inputs.DataCollectionRuleDataFlowArgs + /// { + /// Streams = new[] + /// { + /// "Microsoft-InsightsMetrics", + /// }, + /// Destinations = new[] + /// { + /// "example-destination-metrics", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleDataCollectionEndpoint = new Azure.Monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// // associate to a Data Collection Rule + /// var example1 = new Azure.Monitoring.DataCollectionRuleAssociation("example1", new() + /// { + /// TargetResourceId = exampleLinuxVirtualMachine.Id, + /// DataCollectionRuleId = exampleDataCollectionRule.Id, + /// Description = "example", + /// }); + /// + /// // associate to a Data Collection Endpoint + /// var example2 = new Azure.Monitoring.DataCollectionRuleAssociation("example2", new() + /// { + /// TargetResourceId = exampleLinuxVirtualMachine.Id, + /// DataCollectionEndpointId = exampleDataCollectionEndpoint.Id, + /// Description = "example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Collection Rules Association can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/DiagnosticSetting.cs b/sdk/dotnet/Monitoring/DiagnosticSetting.cs index 404893547c..96bbc85ab3 100644 --- a/sdk/dotnet/Monitoring/DiagnosticSetting.cs +++ b/sdk/dotnet/Monitoring/DiagnosticSetting.cs @@ -12,6 +12,72 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a Diagnostic Setting for an existing Resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SoftDeleteRetentionDays = 7, + /// PurgeProtectionEnabled = false, + /// SkuName = "standard", + /// }); + /// + /// var exampleDiagnosticSetting = new Azure.Monitoring.DiagnosticSetting("exampleDiagnosticSetting", new() + /// { + /// TargetResourceId = exampleKeyVault.Id, + /// StorageAccountId = exampleAccount.Id, + /// EnabledLogs = new[] + /// { + /// new Azure.Monitoring.Inputs.DiagnosticSettingEnabledLogArgs + /// { + /// Category = "AuditEvent", + /// RetentionPolicy = new Azure.Monitoring.Inputs.DiagnosticSettingEnabledLogRetentionPolicyArgs + /// { + /// Enabled = false, + /// }, + /// }, + /// }, + /// Metrics = new[] + /// { + /// new Azure.Monitoring.Inputs.DiagnosticSettingMetricArgs + /// { + /// Category = "AllMetrics", + /// RetentionPolicy = new Azure.Monitoring.Inputs.DiagnosticSettingMetricRetentionPolicyArgs + /// { + /// Enabled = false, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/GetActionGroup.cs b/sdk/dotnet/Monitoring/GetActionGroup.cs index c23a5b98c2..b7a9fde596 100644 --- a/sdk/dotnet/Monitoring/GetActionGroup.cs +++ b/sdk/dotnet/Monitoring/GetActionGroup.cs @@ -13,12 +13,66 @@ public static class GetActionGroup { /// /// Use this data source to access the properties of an Action Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetActionGroup.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// Name = "tfex-actiongroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["actionGroupId"] = example.Apply(getActionGroupResult => getActionGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetActionGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:monitoring/getActionGroup:getActionGroup", args ?? new GetActionGroupArgs(), options.WithDefaults()); /// /// Use this data source to access the properties of an Action Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetActionGroup.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// Name = "tfex-actiongroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["actionGroupId"] = example.Apply(getActionGroupResult => getActionGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetActionGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:monitoring/getActionGroup:getActionGroup", args ?? new GetActionGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Monitoring/GetDataCollectionEndpoint.cs b/sdk/dotnet/Monitoring/GetDataCollectionEndpoint.cs index b5bc6e3f8c..d3d1c49ca8 100644 --- a/sdk/dotnet/Monitoring/GetDataCollectionEndpoint.cs +++ b/sdk/dotnet/Monitoring/GetDataCollectionEndpoint.cs @@ -13,12 +13,66 @@ public static class GetDataCollectionEndpoint { /// /// Use this data source to access information about an existing Data Collection Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetDataCollectionEndpoint.Invoke(new() + /// { + /// Name = "example-mdce", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["endpointId"] = example.Apply(getDataCollectionEndpointResult => getDataCollectionEndpointResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDataCollectionEndpointArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:monitoring/getDataCollectionEndpoint:getDataCollectionEndpoint", args ?? new GetDataCollectionEndpointArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Collection Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetDataCollectionEndpoint.Invoke(new() + /// { + /// Name = "example-mdce", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["endpointId"] = example.Apply(getDataCollectionEndpointResult => getDataCollectionEndpointResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDataCollectionEndpointInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:monitoring/getDataCollectionEndpoint:getDataCollectionEndpoint", args ?? new GetDataCollectionEndpointInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Monitoring/GetDataCollectionRule.cs b/sdk/dotnet/Monitoring/GetDataCollectionRule.cs index d9d4495111..4c0439adc5 100644 --- a/sdk/dotnet/Monitoring/GetDataCollectionRule.cs +++ b/sdk/dotnet/Monitoring/GetDataCollectionRule.cs @@ -13,12 +13,66 @@ public static class GetDataCollectionRule { /// /// Use this data source to access information about an existing Data Collection Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetDataCollectionRule.Invoke(new() + /// { + /// Name = "example-rule", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ruleId"] = example.Apply(getDataCollectionRuleResult => getDataCollectionRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDataCollectionRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:monitoring/getDataCollectionRule:getDataCollectionRule", args ?? new GetDataCollectionRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Data Collection Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetDataCollectionRule.Invoke(new() + /// { + /// Name = "example-rule", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ruleId"] = example.Apply(getDataCollectionRuleResult => getDataCollectionRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDataCollectionRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:monitoring/getDataCollectionRule:getDataCollectionRule", args ?? new GetDataCollectionRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Monitoring/GetDiagnosticCategories.cs b/sdk/dotnet/Monitoring/GetDiagnosticCategories.cs index 855e6b805a..c4e8242192 100644 --- a/sdk/dotnet/Monitoring/GetDiagnosticCategories.cs +++ b/sdk/dotnet/Monitoring/GetDiagnosticCategories.cs @@ -13,12 +13,68 @@ public static class GetDiagnosticCategories { /// /// Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = azurerm_key_vault.Example.Name, + /// ResourceGroupName = azurerm_key_vault.Example.Resource_group_name, + /// }); + /// + /// var exampleDiagnosticCategories = Azure.Monitoring.GetDiagnosticCategories.Invoke(new() + /// { + /// ResourceId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDiagnosticCategoriesArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:monitoring/getDiagnosticCategories:getDiagnosticCategories", args ?? new GetDiagnosticCategoriesArgs(), options.WithDefaults()); /// /// Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new() + /// { + /// Name = azurerm_key_vault.Example.Name, + /// ResourceGroupName = azurerm_key_vault.Example.Resource_group_name, + /// }); + /// + /// var exampleDiagnosticCategories = Azure.Monitoring.GetDiagnosticCategories.Invoke(new() + /// { + /// ResourceId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDiagnosticCategoriesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:monitoring/getDiagnosticCategories:getDiagnosticCategories", args ?? new GetDiagnosticCategoriesInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Monitoring/GetLogProfile.cs b/sdk/dotnet/Monitoring/GetLogProfile.cs index b0d3fe9780..672f2f884c 100644 --- a/sdk/dotnet/Monitoring/GetLogProfile.cs +++ b/sdk/dotnet/Monitoring/GetLogProfile.cs @@ -15,6 +15,32 @@ public static class GetLogProfile /// Use this data source to access the properties of a Log Profile. /// /// !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetLogProfile.Invoke(new() + /// { + /// Name = "test-logprofile", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["logProfileStorageAccountId"] = example.Apply(getLogProfileResult => getLogProfileResult.StorageAccountId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetLogProfileArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:monitoring/getLogProfile:getLogProfile", args ?? new GetLogProfileArgs(), options.WithDefaults()); @@ -23,6 +49,32 @@ public static Task InvokeAsync(GetLogProfileArgs args, Invo /// Use this data source to access the properties of a Log Profile. /// /// !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetLogProfile.Invoke(new() + /// { + /// Name = "test-logprofile", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["logProfileStorageAccountId"] = example.Apply(getLogProfileResult => getLogProfileResult.StorageAccountId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetLogProfileInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:monitoring/getLogProfile:getLogProfile", args ?? new GetLogProfileInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Monitoring/GetScheduledQueryRulesAlert.cs b/sdk/dotnet/Monitoring/GetScheduledQueryRulesAlert.cs index 07520a780d..317a251ebb 100644 --- a/sdk/dotnet/Monitoring/GetScheduledQueryRulesAlert.cs +++ b/sdk/dotnet/Monitoring/GetScheduledQueryRulesAlert.cs @@ -13,12 +13,66 @@ public static class GetScheduledQueryRulesAlert { /// /// Use this data source to access the properties of an AlertingAction scheduled query rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetScheduledQueryRulesAlert.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// Name = "tfex-queryrule", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["queryRuleId"] = example.Apply(getScheduledQueryRulesAlertResult => getScheduledQueryRulesAlertResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetScheduledQueryRulesAlertArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:monitoring/getScheduledQueryRulesAlert:getScheduledQueryRulesAlert", args ?? new GetScheduledQueryRulesAlertArgs(), options.WithDefaults()); /// /// Use this data source to access the properties of an AlertingAction scheduled query rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetScheduledQueryRulesAlert.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// Name = "tfex-queryrule", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["queryRuleId"] = example.Apply(getScheduledQueryRulesAlertResult => getScheduledQueryRulesAlertResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetScheduledQueryRulesAlertInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:monitoring/getScheduledQueryRulesAlert:getScheduledQueryRulesAlert", args ?? new GetScheduledQueryRulesAlertInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Monitoring/GetScheduledQueryRulesLog.cs b/sdk/dotnet/Monitoring/GetScheduledQueryRulesLog.cs index 9513037b35..9a7c66df17 100644 --- a/sdk/dotnet/Monitoring/GetScheduledQueryRulesLog.cs +++ b/sdk/dotnet/Monitoring/GetScheduledQueryRulesLog.cs @@ -13,12 +13,66 @@ public static class GetScheduledQueryRulesLog { /// /// Use this data source to access the properties of a LogToMetricAction scheduled query rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetScheduledQueryRulesLog.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// Name = "tfex-queryrule", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["queryRuleId"] = example.Apply(getScheduledQueryRulesLogResult => getScheduledQueryRulesLogResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetScheduledQueryRulesLogArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:monitoring/getScheduledQueryRulesLog:getScheduledQueryRulesLog", args ?? new GetScheduledQueryRulesLogArgs(), options.WithDefaults()); /// /// Use this data source to access the properties of a LogToMetricAction scheduled query rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Monitoring.GetScheduledQueryRulesLog.Invoke(new() + /// { + /// ResourceGroupName = "example-rg", + /// Name = "tfex-queryrule", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["queryRuleId"] = example.Apply(getScheduledQueryRulesLogResult => getScheduledQueryRulesLogResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetScheduledQueryRulesLogInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:monitoring/getScheduledQueryRulesLog:getScheduledQueryRulesLog", args ?? new GetScheduledQueryRulesLogInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Monitoring/LogProfile.cs b/sdk/dotnet/Monitoring/LogProfile.cs index 50b8da61f9..6ea8fb3a7d 100644 --- a/sdk/dotnet/Monitoring/LogProfile.cs +++ b/sdk/dotnet/Monitoring/LogProfile.cs @@ -16,6 +16,62 @@ namespace Pulumi.Azure.Monitoring /// /// !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 2, + /// }); + /// + /// var exampleLogProfile = new Azure.Monitoring.LogProfile("exampleLogProfile", new() + /// { + /// Categories = new[] + /// { + /// "Action", + /// "Delete", + /// "Write", + /// }, + /// Locations = new[] + /// { + /// "westus", + /// "global", + /// }, + /// ServicebusRuleId = exampleEventHubNamespace.Id.Apply(id => $"{id}/authorizationrules/RootManageSharedAccessKey"), + /// StorageAccountId = exampleAccount.Id, + /// RetentionPolicy = new Azure.Monitoring.Inputs.LogProfileRetentionPolicyArgs + /// { + /// Enabled = true, + /// Days = 7, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Log Profile can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/LogzMonitor.cs b/sdk/dotnet/Monitoring/LogzMonitor.cs index bf940df029..a57e8d1139 100644 --- a/sdk/dotnet/Monitoring/LogzMonitor.cs +++ b/sdk/dotnet/Monitoring/LogzMonitor.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a logz Monitor. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLogzMonitor = new Azure.Monitoring.LogzMonitor("exampleLogzMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Plan = new Azure.Monitoring.Inputs.LogzMonitorPlanArgs + /// { + /// BillingCycle = "MONTHLY", + /// EffectiveDate = "2022-06-06T00:00:00Z", + /// UsageType = "COMMITTED", + /// }, + /// User = new Azure.Monitoring.Inputs.LogzMonitorUserArgs + /// { + /// Email = "user@example.com", + /// FirstName = "Example", + /// LastName = "User", + /// PhoneNumber = "+12313803556", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// logz Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/LogzSubAccount.cs b/sdk/dotnet/Monitoring/LogzSubAccount.cs index 58bd9fed6c..e498d4a8cd 100644 --- a/sdk/dotnet/Monitoring/LogzSubAccount.cs +++ b/sdk/dotnet/Monitoring/LogzSubAccount.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a logz Sub Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLogzMonitor = new Azure.Monitoring.LogzMonitor("exampleLogzMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Plan = new Azure.Monitoring.Inputs.LogzMonitorPlanArgs + /// { + /// BillingCycle = "MONTHLY", + /// EffectiveDate = "2022-06-06T00:00:00Z", + /// UsageType = "COMMITTED", + /// }, + /// User = new Azure.Monitoring.Inputs.LogzMonitorUserArgs + /// { + /// Email = "user@example.com", + /// FirstName = "Example", + /// LastName = "User", + /// PhoneNumber = "+12313803556", + /// }, + /// }); + /// + /// var exampleLogzSubAccount = new Azure.Monitoring.LogzSubAccount("exampleLogzSubAccount", new() + /// { + /// LogzMonitorId = exampleLogzMonitor.Id, + /// User = new Azure.Monitoring.Inputs.LogzSubAccountUserArgs + /// { + /// Email = exampleLogzMonitor.User.Apply(user => user.Email), + /// FirstName = exampleLogzMonitor.User.Apply(user => user.FirstName), + /// LastName = exampleLogzMonitor.User.Apply(user => user.LastName), + /// PhoneNumber = exampleLogzMonitor.User.Apply(user => user.PhoneNumber), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// logz SubAccounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/LogzSubAccountTagRule.cs b/sdk/dotnet/Monitoring/LogzSubAccountTagRule.cs index c01a9c3704..43d5b71141 100644 --- a/sdk/dotnet/Monitoring/LogzSubAccountTagRule.cs +++ b/sdk/dotnet/Monitoring/LogzSubAccountTagRule.cs @@ -12,6 +12,78 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a Logz Sub Account Tag Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLogzMonitor = new Azure.Monitoring.LogzMonitor("exampleLogzMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Plan = new Azure.Monitoring.Inputs.LogzMonitorPlanArgs + /// { + /// BillingCycle = "MONTHLY", + /// EffectiveDate = "2022-06-06T00:00:00Z", + /// UsageType = "COMMITTED", + /// }, + /// User = new Azure.Monitoring.Inputs.LogzMonitorUserArgs + /// { + /// Email = "user@example.com", + /// FirstName = "Example", + /// LastName = "User", + /// PhoneNumber = "+12313803556", + /// }, + /// }); + /// + /// var exampleLogzSubAccount = new Azure.Monitoring.LogzSubAccount("exampleLogzSubAccount", new() + /// { + /// LogzMonitorId = exampleLogzMonitor.Id, + /// User = new Azure.Monitoring.Inputs.LogzSubAccountUserArgs + /// { + /// Email = exampleLogzMonitor.User.Apply(user => user.Email), + /// FirstName = exampleLogzMonitor.User.Apply(user => user.FirstName), + /// LastName = exampleLogzMonitor.User.Apply(user => user.LastName), + /// PhoneNumber = exampleLogzMonitor.User.Apply(user => user.PhoneNumber), + /// }, + /// }); + /// + /// var exampleLogzSubAccountTagRule = new Azure.Monitoring.LogzSubAccountTagRule("exampleLogzSubAccountTagRule", new() + /// { + /// LogzSubAccountId = exampleLogzSubAccount.Id, + /// SendAadLogs = true, + /// SendActivityLogs = true, + /// SendSubscriptionLogs = true, + /// TagFilters = new[] + /// { + /// new Azure.Monitoring.Inputs.LogzSubAccountTagRuleTagFilterArgs + /// { + /// Name = "name1", + /// Action = "Include", + /// Value = "value1", + /// }, + /// new Azure.Monitoring.Inputs.LogzSubAccountTagRuleTagFilterArgs + /// { + /// Name = "name2", + /// Action = "Exclude", + /// Value = "value2", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Logz Sub Account Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/LogzTagRule.cs b/sdk/dotnet/Monitoring/LogzTagRule.cs index 1acde10a31..1e8f2901c3 100644 --- a/sdk/dotnet/Monitoring/LogzTagRule.cs +++ b/sdk/dotnet/Monitoring/LogzTagRule.cs @@ -12,6 +12,66 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a logz Tag Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLogzMonitor = new Azure.Monitoring.LogzMonitor("exampleLogzMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Plan = new Azure.Monitoring.Inputs.LogzMonitorPlanArgs + /// { + /// BillingCycle = "MONTHLY", + /// EffectiveDate = "2022-06-06T00:00:00Z", + /// UsageType = "COMMITTED", + /// }, + /// User = new Azure.Monitoring.Inputs.LogzMonitorUserArgs + /// { + /// Email = "user@example.com", + /// FirstName = "Example", + /// LastName = "User", + /// PhoneNumber = "+12313803556", + /// }, + /// }); + /// + /// var exampleLogzTagRule = new Azure.Monitoring.LogzTagRule("exampleLogzTagRule", new() + /// { + /// LogzMonitorId = exampleLogzMonitor.Id, + /// TagFilters = new[] + /// { + /// new Azure.Monitoring.Inputs.LogzTagRuleTagFilterArgs + /// { + /// Name = "name1", + /// Action = "Include", + /// Value = "value1", + /// }, + /// new Azure.Monitoring.Inputs.LogzTagRuleTagFilterArgs + /// { + /// Name = "name2", + /// Action = "Exclude", + /// Value = "value2", + /// }, + /// }, + /// SendAadLogs = true, + /// SendActivityLogs = true, + /// SendSubscriptionLogs = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// logz Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/MetricAlert.cs b/sdk/dotnet/Monitoring/MetricAlert.cs index 4a18bd6f5a..8c03af18f7 100644 --- a/sdk/dotnet/Monitoring/MetricAlert.cs +++ b/sdk/dotnet/Monitoring/MetricAlert.cs @@ -12,6 +12,86 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a Metric Alert within Azure Monitor. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var toMonitor = new Azure.Storage.Account("toMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var main = new Azure.Monitoring.ActionGroup("main", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "exampleact", + /// WebhookReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupWebhookReceiverArgs + /// { + /// Name = "callmyapi", + /// ServiceUri = "http://example.com/alert", + /// }, + /// }, + /// }); + /// + /// var exampleMetricAlert = new Azure.Monitoring.MetricAlert("exampleMetricAlert", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scopes = new[] + /// { + /// toMonitor.Id, + /// }, + /// Description = "Action will be triggered when Transactions count is greater than 50.", + /// Criterias = new[] + /// { + /// new Azure.Monitoring.Inputs.MetricAlertCriteriaArgs + /// { + /// MetricNamespace = "Microsoft.Storage/storageAccounts", + /// MetricName = "Transactions", + /// Aggregation = "Total", + /// Operator = "GreaterThan", + /// Threshold = 50, + /// Dimensions = new[] + /// { + /// new Azure.Monitoring.Inputs.MetricAlertCriteriaDimensionArgs + /// { + /// Name = "ApiName", + /// Operator = "Include", + /// Values = new[] + /// { + /// "*", + /// }, + /// }, + /// }, + /// }, + /// }, + /// Actions = new[] + /// { + /// new Azure.Monitoring.Inputs.MetricAlertActionArgs + /// { + /// ActionGroupId = main.Id, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Metric Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/PrivateLinkScope.cs b/sdk/dotnet/Monitoring/PrivateLinkScope.cs index 4da799187a..74a3af22b4 100644 --- a/sdk/dotnet/Monitoring/PrivateLinkScope.cs +++ b/sdk/dotnet/Monitoring/PrivateLinkScope.cs @@ -12,6 +12,29 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Azure Monitor Private Link Scope. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePrivateLinkScope = new Azure.Monitoring.PrivateLinkScope("examplePrivateLinkScope", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Monitor Private Link Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/PrivateLinkScopedService.cs b/sdk/dotnet/Monitoring/PrivateLinkScopedService.cs index f97876c12f..f51626d6d7 100644 --- a/sdk/dotnet/Monitoring/PrivateLinkScopedService.cs +++ b/sdk/dotnet/Monitoring/PrivateLinkScopedService.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Azure Monitor Private Link Scoped Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var examplePrivateLinkScope = new Azure.Monitoring.PrivateLinkScope("examplePrivateLinkScope", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePrivateLinkScopedService = new Azure.Monitoring.PrivateLinkScopedService("examplePrivateLinkScopedService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ScopeName = examplePrivateLinkScope.Name, + /// LinkedResourceId = exampleInsights.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Monitor Private Link Scoped Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/ScheduledQueryRulesLog.cs b/sdk/dotnet/Monitoring/ScheduledQueryRulesLog.cs index 62b6d0689a..0d66c216c1 100644 --- a/sdk/dotnet/Monitoring/ScheduledQueryRulesLog.cs +++ b/sdk/dotnet/Monitoring/ScheduledQueryRulesLog.cs @@ -12,6 +12,107 @@ namespace Pulumi.Azure.Monitoring /// /// Manages a LogToMetricAction Scheduled Query Rules resource within Azure Monitor. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "exampleact", + /// WebhookReceivers = new[] + /// { + /// new Azure.Monitoring.Inputs.ActionGroupWebhookReceiverArgs + /// { + /// Name = "callmyapi", + /// ServiceUri = "http://example.com/alert", + /// }, + /// }, + /// }); + /// + /// // Example: Creates alert using the new Scheduled Query Rules metric + /// var exampleMetricAlert = new Azure.Monitoring.MetricAlert("exampleMetricAlert", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scopes = new[] + /// { + /// exampleAnalyticsWorkspace.Id, + /// }, + /// Description = "Action will be triggered when Average_% Idle Time metric is less than 10.", + /// Frequency = "PT1M", + /// WindowSize = "PT5M", + /// Criterias = new[] + /// { + /// new Azure.Monitoring.Inputs.MetricAlertCriteriaArgs + /// { + /// MetricNamespace = "Microsoft.OperationalInsights/workspaces", + /// MetricName = "UsedCapacity", + /// Aggregation = "Average", + /// Operator = "LessThan", + /// Threshold = 10, + /// }, + /// }, + /// Actions = new[] + /// { + /// new Azure.Monitoring.Inputs.MetricAlertActionArgs + /// { + /// ActionGroupId = exampleActionGroup.Id, + /// }, + /// }, + /// }); + /// + /// // Example: LogToMetric Action for the named Computer + /// var exampleScheduledQueryRulesLog = new Azure.Monitoring.ScheduledQueryRulesLog("exampleScheduledQueryRulesLog", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Criteria = new Azure.Monitoring.Inputs.ScheduledQueryRulesLogCriteriaArgs + /// { + /// MetricName = "Average_% Idle Time", + /// Dimensions = new[] + /// { + /// new Azure.Monitoring.Inputs.ScheduledQueryRulesLogCriteriaDimensionArgs + /// { + /// Name = "Computer", + /// Operator = "Include", + /// Values = new[] + /// { + /// "targetVM", + /// }, + /// }, + /// }, + /// }, + /// DataSourceId = exampleAnalyticsWorkspace.Id, + /// Description = "Scheduled query rule LogToMetric example", + /// Enabled = true, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Scheduled Query Rule Log can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/SmartDetectorAlertRule.cs b/sdk/dotnet/Monitoring/SmartDetectorAlertRule.cs index e57c771104..b8b92fbd2b 100644 --- a/sdk/dotnet/Monitoring/SmartDetectorAlertRule.cs +++ b/sdk/dotnet/Monitoring/SmartDetectorAlertRule.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Monitor Smart Detector Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ApplicationType = "web", + /// }); + /// + /// var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ShortName = "example", + /// }); + /// + /// var exampleSmartDetectorAlertRule = new Azure.Monitoring.SmartDetectorAlertRule("exampleSmartDetectorAlertRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Severity = "Sev0", + /// ScopeResourceIds = new[] + /// { + /// exampleInsights.Id, + /// }, + /// Frequency = "PT1M", + /// DetectorType = "FailureAnomaliesDetector", + /// ActionGroup = new Azure.Monitoring.Inputs.SmartDetectorAlertRuleActionGroupArgs + /// { + /// Ids = new[] + /// { + /// exampleActionGroup.Id, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Monitor Smart Detector Alert Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Monitoring/Workspace.cs b/sdk/dotnet/Monitoring/Workspace.cs index 71216aca60..b31c03046b 100644 --- a/sdk/dotnet/Monitoring/Workspace.cs +++ b/sdk/dotnet/Monitoring/Workspace.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Monitoring /// /// Manages an Azure Monitor Workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleWorkspace = new Azure.Monitoring.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Monitor Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Msi/UserAssignedIdentity.cs b/sdk/dotnet/Msi/UserAssignedIdentity.cs index da5c7dda11..75c8db1823 100644 --- a/sdk/dotnet/Msi/UserAssignedIdentity.cs +++ b/sdk/dotnet/Msi/UserAssignedIdentity.cs @@ -14,6 +14,30 @@ namespace Pulumi.Azure.Msi /// /// Manages a User Assigned Identity. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/ActiveDirectoryAdministrator.cs b/sdk/dotnet/MySql/ActiveDirectoryAdministrator.cs index c9e6d7f6c6..d289fc7b28 100644 --- a/sdk/dotnet/MySql/ActiveDirectoryAdministrator.cs +++ b/sdk/dotnet/MySql/ActiveDirectoryAdministrator.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.MySql /// /// Allows you to set a user or group as the AD administrator for an MySQL server in Azure /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mysqladminun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SslEnforcementEnabled = true, + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// Version = "5.7", + /// }); + /// + /// var exampleActiveDirectoryAdministrator = new Azure.MySql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", new() + /// { + /// ServerName = exampleServer.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Login = "sqladmin", + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A MySQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/Configuration.cs b/sdk/dotnet/MySql/Configuration.cs index 4c25850350..421ba50e21 100644 --- a/sdk/dotnet/MySql/Configuration.cs +++ b/sdk/dotnet/MySql/Configuration.cs @@ -16,6 +16,50 @@ namespace Pulumi.Azure.MySql /// /// > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mysqladminun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// Version = "5.7", + /// AutoGrowEnabled = true, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = true, + /// InfrastructureEncryptionEnabled = true, + /// PublicNetworkAccessEnabled = false, + /// SslEnforcementEnabled = true, + /// SslMinimalTlsVersionEnforced = "TLS1_2", + /// }); + /// + /// var exampleConfiguration = new Azure.MySql.Configuration("exampleConfiguration", new() + /// { + /// Name = "interactive_timeout", + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Value = "600", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MySQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/Database.cs b/sdk/dotnet/MySql/Database.cs index 163b816503..e51e990b76 100644 --- a/sdk/dotnet/MySql/Database.cs +++ b/sdk/dotnet/MySql/Database.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.MySql /// /// Manages a MySQL Database within a MySQL Server /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mysqladminun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "GP_Gen5_2", + /// StorageMb = 5120, + /// Version = "5.7", + /// AutoGrowEnabled = true, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = true, + /// InfrastructureEncryptionEnabled = true, + /// PublicNetworkAccessEnabled = false, + /// SslEnforcementEnabled = true, + /// SslMinimalTlsVersionEnforced = "TLS1_2", + /// }); + /// + /// var exampleDatabase = new Azure.MySql.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Charset = "utf8", + /// Collation = "utf8_unicode_ci", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/FirewallRule.cs b/sdk/dotnet/MySql/FirewallRule.cs index ee84f00739..0b29a92060 100644 --- a/sdk/dotnet/MySql/FirewallRule.cs +++ b/sdk/dotnet/MySql/FirewallRule.cs @@ -13,6 +13,96 @@ namespace Pulumi.Azure.MySql /// Manages a Firewall Rule for a MySQL Server. /// /// ## Example Usage + /// ### Single IP Address) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Version = "5.7", + /// SkuName = "GP_Gen5_2", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleFirewallRule = new Azure.MySql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "40.112.8.12", + /// EndIpAddress = "40.112.8.12", + /// }); + /// + /// }); + /// ``` + /// ### IP Range) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer"); + /// + /// // ... + /// var exampleFirewallRule = new Azure.MySql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "40.112.0.0", + /// EndIpAddress = "40.112.255.255", + /// }); + /// + /// }); + /// ``` + /// ### Allow Access To Azure Services) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer"); + /// + /// // ... + /// var exampleFirewallRule = new Azure.MySql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "0.0.0.0", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/MySql/FlexibleDatabase.cs b/sdk/dotnet/MySql/FlexibleDatabase.cs index 98b658d71f..85dad30863 100644 --- a/sdk/dotnet/MySql/FlexibleDatabase.cs +++ b/sdk/dotnet/MySql/FlexibleDatabase.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.MySql /// /// Manages a MySQL Database within a MySQL Flexible Server /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.MySql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLogin = "mysqladminun", + /// AdministratorPassword = "H@Sh1CoR3!", + /// SkuName = "B_Standard_B1s", + /// }); + /// + /// var exampleFlexibleDatabase = new Azure.MySql.FlexibleDatabase("exampleFlexibleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleFlexibleServer.Name, + /// Charset = "utf8", + /// Collation = "utf8_unicode_ci", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/FlexibleServer.cs b/sdk/dotnet/MySql/FlexibleServer.cs index d8774343f1..5dd075348e 100644 --- a/sdk/dotnet/MySql/FlexibleServer.cs +++ b/sdk/dotnet/MySql/FlexibleServer.cs @@ -12,6 +12,93 @@ namespace Pulumi.Azure.MySql /// /// Manages a MySQL Flexible Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Storage", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "fs", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.DBforMySQL/flexibleServers", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleZoneVirtualNetworkLink = new Azure.PrivateDns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", new() + /// { + /// PrivateDnsZoneName = exampleZone.Name, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFlexibleServer = new Azure.MySql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLogin = "psqladmin", + /// AdministratorPassword = "H@Sh1CoR3!", + /// BackupRetentionDays = 7, + /// DelegatedSubnetId = exampleSubnet.Id, + /// PrivateDnsZoneId = exampleZone.Id, + /// SkuName = "GP_Standard_D2ds_v4", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleZoneVirtualNetworkLink, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MySQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/FlexibleServerConfiguration.cs b/sdk/dotnet/MySql/FlexibleServerConfiguration.cs index fa6b44dd6b..0a3ddf7b01 100644 --- a/sdk/dotnet/MySql/FlexibleServerConfiguration.cs +++ b/sdk/dotnet/MySql/FlexibleServerConfiguration.cs @@ -16,6 +16,40 @@ namespace Pulumi.Azure.MySql /// /// > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.MySql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLogin = "adminTerraform", + /// AdministratorPassword = "H@Sh1CoR3!", + /// SkuName = "GP_Standard_D2ds_v4", + /// }); + /// + /// var exampleFlexibleServerConfiguration = new Azure.MySql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleFlexibleServer.Name, + /// Value = "600", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MySQL Flexible Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/FlexibleServerFirewallRule.cs b/sdk/dotnet/MySql/FlexibleServerFirewallRule.cs index 3d20af84dc..65bf22ad74 100644 --- a/sdk/dotnet/MySql/FlexibleServerFirewallRule.cs +++ b/sdk/dotnet/MySql/FlexibleServerFirewallRule.cs @@ -13,6 +13,99 @@ namespace Pulumi.Azure.MySql /// Manages a Firewall Rule for a MySQL Flexible Server. /// /// ## Example Usage + /// ### Single IP Address) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.MySql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleFlexibleServerFirewallRule = new Azure.MySql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleFlexibleServer.Name, + /// StartIpAddress = "40.112.8.12", + /// EndIpAddress = "40.112.8.12", + /// }); + /// + /// }); + /// ``` + /// ### IP Range) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.MySql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleFlexibleServerFirewallRule = new Azure.MySql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleFlexibleServer.Name, + /// StartIpAddress = "40.112.0.0", + /// EndIpAddress = "40.112.255.255", + /// }); + /// + /// }); + /// ``` + /// ### Allow Access To Azure Services) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.MySql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleFlexibleServerFirewallRule = new Azure.MySql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleFlexibleServer.Name, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "0.0.0.0", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/MySql/GetFlexibleServer.cs b/sdk/dotnet/MySql/GetFlexibleServer.cs index 4b1a112e5a..f159a4dc9c 100644 --- a/sdk/dotnet/MySql/GetFlexibleServer.cs +++ b/sdk/dotnet/MySql/GetFlexibleServer.cs @@ -13,12 +13,66 @@ public static class GetFlexibleServer { /// /// Use this data source to access information about an existing MySQL Flexible Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MySql.GetFlexibleServer.Invoke(new() + /// { + /// Name = "existingMySqlFlexibleServer", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFlexibleServerResult => getFlexibleServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFlexibleServerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mysql/getFlexibleServer:getFlexibleServer", args ?? new GetFlexibleServerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing MySQL Flexible Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MySql.GetFlexibleServer.Invoke(new() + /// { + /// Name = "existingMySqlFlexibleServer", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFlexibleServerResult => getFlexibleServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFlexibleServerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mysql/getFlexibleServer:getFlexibleServer", args ?? new GetFlexibleServerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MySql/GetServer.cs b/sdk/dotnet/MySql/GetServer.cs index 2f507a1e39..45b66dc735 100644 --- a/sdk/dotnet/MySql/GetServer.cs +++ b/sdk/dotnet/MySql/GetServer.cs @@ -13,12 +13,66 @@ public static class GetServer { /// /// Use this data source to access information about an existing MySQL Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MySql.GetServer.Invoke(new() + /// { + /// Name = "existingMySqlServer", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:mysql/getServer:getServer", args ?? new GetServerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing MySQL Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.MySql.GetServer.Invoke(new() + /// { + /// Name = "existingMySqlServer", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:mysql/getServer:getServer", args ?? new GetServerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/MySql/Server.cs b/sdk/dotnet/MySql/Server.cs index 77972e3aae..8b11327454 100644 --- a/sdk/dotnet/MySql/Server.cs +++ b/sdk/dotnet/MySql/Server.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.MySql /// /// Manages a MySQL Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mysqladminun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// Version = "5.7", + /// AutoGrowEnabled = true, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = false, + /// InfrastructureEncryptionEnabled = false, + /// PublicNetworkAccessEnabled = true, + /// SslEnforcementEnabled = true, + /// SslMinimalTlsVersionEnforced = "TLS1_2", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MySQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/MySql/ServerKey.cs b/sdk/dotnet/MySql/ServerKey.cs index 660a4c507b..af3a6dd5f9 100644 --- a/sdk/dotnet/MySql/ServerKey.cs +++ b/sdk/dotnet/MySql/ServerKey.cs @@ -12,6 +12,126 @@ namespace Pulumi.Azure.MySql /// /// Manages a Customer Managed Key for a MySQL Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "GP_Gen5_2", + /// AdministratorLogin = "acctestun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SslEnforcementEnabled = true, + /// SslMinimalTlsVersionEnforced = "TLS1_1", + /// StorageMb = 51200, + /// Version = "5.7", + /// Identity = new Azure.MySql.Inputs.ServerIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var server = new Azure.KeyVault.AccessPolicy("server", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleServer.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "UnwrapKey", + /// "WrapKey", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var client = new Azure.KeyVault.AccessPolicy("client", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "Delete", + /// "List", + /// "Restore", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// "Purge", + /// "Encrypt", + /// "Decrypt", + /// "Sign", + /// "Verify", + /// "GetRotationPolicy", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// client, + /// server, + /// }, + /// }); + /// + /// var exampleServerKey = new Azure.MySql.ServerKey("exampleServerKey", new() + /// { + /// ServerId = exampleServer.Id, + /// KeyVaultKeyId = exampleKey.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A MySQL Server Key can be imported using the `resource id` of the MySQL Server Key, e.g. diff --git a/sdk/dotnet/MySql/VirtualNetworkRule.cs b/sdk/dotnet/MySql/VirtualNetworkRule.cs index 8ea9d353a2..a1c715f6df 100644 --- a/sdk/dotnet/MySql/VirtualNetworkRule.cs +++ b/sdk/dotnet/MySql/VirtualNetworkRule.cs @@ -14,6 +14,69 @@ namespace Pulumi.Azure.MySql /// /// > **NOTE:** MySQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mysql/concepts-data-access-and-security-vnet) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// }, + /// }); + /// + /// var exampleServer = new Azure.MySql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "mysqladminun", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "GP_Gen5_2", + /// StorageMb = 5120, + /// Version = "5.7", + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = false, + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleVirtualNetworkRule = new Azure.MySql.VirtualNetworkRule("exampleVirtualNetworkRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// SubnetId = @internal.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// MySQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NetApp/Account.cs b/sdk/dotnet/NetApp/Account.cs index 5d1c430ec7..8c5034bb0c 100644 --- a/sdk/dotnet/NetApp/Account.cs +++ b/sdk/dotnet/NetApp/Account.cs @@ -14,6 +14,42 @@ namespace Pulumi.Azure.NetApp /// /// > **NOTE:** Azure allows only one active directory can be joined to a single subscription at a time for NetApp Account. /// + /// ## NetApp Account Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.NetApp.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ActiveDirectory = new Azure.NetApp.Inputs.AccountActiveDirectoryArgs + /// { + /// Username = "aduser", + /// Password = "aduserpwd", + /// SmbServerName = "SMBSERVER", + /// DnsServers = new[] + /// { + /// "1.2.3.4", + /// }, + /// Domain = "westcentralus.com", + /// OrganizationalUnit = "OU=FirstLevel", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// NetApp Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NetApp/GetAccount.cs b/sdk/dotnet/NetApp/GetAccount.cs index 8222ca190f..8c7dc53f04 100644 --- a/sdk/dotnet/NetApp/GetAccount.cs +++ b/sdk/dotnet/NetApp/GetAccount.cs @@ -13,12 +13,58 @@ public static class GetAccount { /// /// Uses this data source to access information about an existing NetApp Account. + /// + /// ## NetApp Account Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetAccount.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// Name = "acctestnetappaccount", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappAccountId"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:netapp/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing NetApp Account. + /// + /// ## NetApp Account Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetAccount.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// Name = "acctestnetappaccount", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappAccountId"] = example.Apply(getAccountResult => getAccountResult.Id), + /// }; + /// }); + /// ``` /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:netapp/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NetApp/GetPool.cs b/sdk/dotnet/NetApp/GetPool.cs index 45320b981c..56d2be2625 100644 --- a/sdk/dotnet/NetApp/GetPool.cs +++ b/sdk/dotnet/NetApp/GetPool.cs @@ -13,12 +13,60 @@ public static class GetPool { /// /// Uses this data source to access information about an existing NetApp Pool. + /// + /// ## NetApp Pool Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetPool.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// AccountName = "acctestnetappaccount", + /// Name = "acctestnetapppool", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappPoolId"] = example.Apply(getPoolResult => getPoolResult.Id), + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetPoolArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:netapp/getPool:getPool", args ?? new GetPoolArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing NetApp Pool. + /// + /// ## NetApp Pool Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetPool.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// AccountName = "acctestnetappaccount", + /// Name = "acctestnetapppool", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappPoolId"] = example.Apply(getPoolResult => getPoolResult.Id), + /// }; + /// }); + /// ``` /// public static Output Invoke(GetPoolInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:netapp/getPool:getPool", args ?? new GetPoolInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NetApp/GetSnapshot.cs b/sdk/dotnet/NetApp/GetSnapshot.cs index 8605aff130..700f8dbcd4 100644 --- a/sdk/dotnet/NetApp/GetSnapshot.cs +++ b/sdk/dotnet/NetApp/GetSnapshot.cs @@ -13,12 +13,64 @@ public static class GetSnapshot { /// /// Uses this data source to access information about an existing NetApp Snapshot. + /// + /// ## NetApp Snapshot Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.NetApp.GetSnapshot.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// Name = "acctestnetappsnapshot", + /// AccountName = "acctestnetappaccount", + /// PoolName = "acctestnetapppool", + /// VolumeName = "acctestnetappvolume", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappSnapshotId"] = data.Azurerm_netapp_snapshot.Example.Id, + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetSnapshotArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:netapp/getSnapshot:getSnapshot", args ?? new GetSnapshotArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing NetApp Snapshot. + /// + /// ## NetApp Snapshot Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.NetApp.GetSnapshot.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// Name = "acctestnetappsnapshot", + /// AccountName = "acctestnetappaccount", + /// PoolName = "acctestnetapppool", + /// VolumeName = "acctestnetappvolume", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappSnapshotId"] = data.Azurerm_netapp_snapshot.Example.Id, + /// }; + /// }); + /// ``` /// public static Output Invoke(GetSnapshotInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:netapp/getSnapshot:getSnapshot", args ?? new GetSnapshotInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NetApp/GetSnapshotPolicy.cs b/sdk/dotnet/NetApp/GetSnapshotPolicy.cs index e339b52314..e3f3dfabf2 100644 --- a/sdk/dotnet/NetApp/GetSnapshotPolicy.cs +++ b/sdk/dotnet/NetApp/GetSnapshotPolicy.cs @@ -13,12 +13,72 @@ public static class GetSnapshotPolicy { /// /// Uses this data source to access information about an existing NetApp Snapshot Policy. + /// + /// ## NetApp Snapshot Policy Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetSnapshotPolicy.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// AccountName = "acctestnetappaccount", + /// Name = "example-snapshot-policy", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Id), + /// ["name"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Name), + /// ["enabled"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Enabled), + /// ["hourlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.HourlySchedules), + /// ["dailySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.DailySchedules), + /// ["weeklySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.WeeklySchedules), + /// ["monthlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.MonthlySchedules), + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetSnapshotPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:netapp/getSnapshotPolicy:getSnapshotPolicy", args ?? new GetSnapshotPolicyArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing NetApp Snapshot Policy. + /// + /// ## NetApp Snapshot Policy Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetSnapshotPolicy.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// AccountName = "acctestnetappaccount", + /// Name = "example-snapshot-policy", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Id), + /// ["name"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Name), + /// ["enabled"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Enabled), + /// ["hourlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.HourlySchedules), + /// ["dailySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.DailySchedules), + /// ["weeklySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.WeeklySchedules), + /// ["monthlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.MonthlySchedules), + /// }; + /// }); + /// ``` /// public static Output Invoke(GetSnapshotPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:netapp/getSnapshotPolicy:getSnapshotPolicy", args ?? new GetSnapshotPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NetApp/GetVolume.cs b/sdk/dotnet/NetApp/GetVolume.cs index 04a627d92f..10da870a7a 100644 --- a/sdk/dotnet/NetApp/GetVolume.cs +++ b/sdk/dotnet/NetApp/GetVolume.cs @@ -13,12 +13,62 @@ public static class GetVolume { /// /// Uses this data source to access information about an existing NetApp Volume. + /// + /// ## NetApp Volume Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetVolume.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// AccountName = "acctestnetappaccount", + /// PoolName = "acctestnetapppool", + /// Name = "example-volume", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappVolumeId"] = example.Apply(getVolumeResult => getVolumeResult.Id), + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetVolumeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:netapp/getVolume:getVolume", args ?? new GetVolumeArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing NetApp Volume. + /// + /// ## NetApp Volume Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetVolume.Invoke(new() + /// { + /// ResourceGroupName = "acctestRG", + /// AccountName = "acctestnetappaccount", + /// PoolName = "acctestnetapppool", + /// Name = "example-volume", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["netappVolumeId"] = example.Apply(getVolumeResult => getVolumeResult.Id), + /// }; + /// }); + /// ``` /// public static Output Invoke(GetVolumeInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:netapp/getVolume:getVolume", args ?? new GetVolumeInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NetApp/GetVolumeGroupSapHana.cs b/sdk/dotnet/NetApp/GetVolumeGroupSapHana.cs index 12dfad00dc..ee071177d9 100644 --- a/sdk/dotnet/NetApp/GetVolumeGroupSapHana.cs +++ b/sdk/dotnet/NetApp/GetVolumeGroupSapHana.cs @@ -13,12 +13,68 @@ public static class GetVolumeGroupSapHana { /// /// Use this data source to access information about an existing Application Volume Group for SAP HANA application. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetVolumeGroupSapHana.Invoke(new() + /// { + /// Name = "existing application volume group name", + /// ResourceGroupName = "resource group name where the account and volume group belong to", + /// AccountName = "existing account where the application volume group belong to", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getVolumeGroupSapHanaResult => getVolumeGroupSapHanaResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVolumeGroupSapHanaArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:netapp/getVolumeGroupSapHana:getVolumeGroupSapHana", args ?? new GetVolumeGroupSapHanaArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Application Volume Group for SAP HANA application. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetVolumeGroupSapHana.Invoke(new() + /// { + /// Name = "existing application volume group name", + /// ResourceGroupName = "resource group name where the account and volume group belong to", + /// AccountName = "existing account where the application volume group belong to", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getVolumeGroupSapHanaResult => getVolumeGroupSapHanaResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVolumeGroupSapHanaInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:netapp/getVolumeGroupSapHana:getVolumeGroupSapHana", args ?? new GetVolumeGroupSapHanaInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NetApp/GetVolumeQuotaRule.cs b/sdk/dotnet/NetApp/GetVolumeQuotaRule.cs index 1ade46c58e..767cfac9d8 100644 --- a/sdk/dotnet/NetApp/GetVolumeQuotaRule.cs +++ b/sdk/dotnet/NetApp/GetVolumeQuotaRule.cs @@ -13,12 +13,66 @@ public static class GetVolumeQuotaRule { /// /// Use this data source to access information about an existing Volume Quota Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetVolumeQuotaRule.Invoke(new() + /// { + /// Name = "exampleQuotaRule", + /// VolumeId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getVolumeQuotaRuleResult => getVolumeQuotaRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVolumeQuotaRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:netapp/getVolumeQuotaRule:getVolumeQuotaRule", args ?? new GetVolumeQuotaRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Volume Quota Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NetApp.GetVolumeQuotaRule.Invoke(new() + /// { + /// Name = "exampleQuotaRule", + /// VolumeId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getVolumeQuotaRuleResult => getVolumeQuotaRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVolumeQuotaRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:netapp/getVolumeQuotaRule:getVolumeQuotaRule", args ?? new GetVolumeQuotaRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NetApp/Pool.cs b/sdk/dotnet/NetApp/Pool.cs index 451c2fe009..91c56c4724 100644 --- a/sdk/dotnet/NetApp/Pool.cs +++ b/sdk/dotnet/NetApp/Pool.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.NetApp /// /// Manages a Pool within a NetApp Account. /// + /// ## NetApp Pool Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.NetApp.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePool = new Azure.NetApp.Pool("examplePool", new() + /// { + /// AccountName = exampleAccount.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceLevel = "Premium", + /// SizeInTb = 4, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// NetApp Pool can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NetApp/Snapshot.cs b/sdk/dotnet/NetApp/Snapshot.cs index c623333109..d4b8bf1756 100644 --- a/sdk/dotnet/NetApp/Snapshot.cs +++ b/sdk/dotnet/NetApp/Snapshot.cs @@ -12,6 +12,96 @@ namespace Pulumi.Azure.NetApp /// /// Manages a NetApp Snapshot. /// + /// ## NetApp Snapshot Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "netapp", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Netapp/volumes", + /// Actions = new[] + /// { + /// "Microsoft.Network/networkinterfaces/*", + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleAccount = new Azure.NetApp.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePool = new Azure.NetApp.Pool("examplePool", new() + /// { + /// AccountName = exampleAccount.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServiceLevel = "Premium", + /// SizeInTb = 4, + /// }); + /// + /// var exampleVolume = new Azure.NetApp.Volume("exampleVolume", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// PoolName = examplePool.Name, + /// VolumePath = "my-unique-file-path", + /// ServiceLevel = "Premium", + /// SubnetId = exampleSubnet.Id, + /// StorageQuotaInGb = 100, + /// }); + /// + /// var exampleSnapshot = new Azure.NetApp.Snapshot("exampleSnapshot", new() + /// { + /// AccountName = exampleAccount.Name, + /// PoolName = examplePool.Name, + /// VolumeName = exampleVolume.Name, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// NetApp Snapshot can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NetApp/SnapshotPolicy.cs b/sdk/dotnet/NetApp/SnapshotPolicy.cs index c28180ed3a..9a48c28c39 100644 --- a/sdk/dotnet/NetApp/SnapshotPolicy.cs +++ b/sdk/dotnet/NetApp/SnapshotPolicy.cs @@ -12,6 +12,73 @@ namespace Pulumi.Azure.NetApp /// /// Manages a NetApp Snapshot Policy. /// + /// ## NetApp Snapshot Policy Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleAccount = new Azure.NetApp.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSnapshotPolicy = new Azure.NetApp.SnapshotPolicy("exampleSnapshotPolicy", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// Enabled = true, + /// HourlySchedule = new Azure.NetApp.Inputs.SnapshotPolicyHourlyScheduleArgs + /// { + /// SnapshotsToKeep = 4, + /// Minute = 15, + /// }, + /// DailySchedule = new Azure.NetApp.Inputs.SnapshotPolicyDailyScheduleArgs + /// { + /// SnapshotsToKeep = 2, + /// Hour = 20, + /// Minute = 15, + /// }, + /// WeeklySchedule = new Azure.NetApp.Inputs.SnapshotPolicyWeeklyScheduleArgs + /// { + /// SnapshotsToKeep = 1, + /// DaysOfWeeks = new[] + /// { + /// "Monday", + /// "Friday", + /// }, + /// Hour = 23, + /// Minute = 0, + /// }, + /// MonthlySchedule = new Azure.NetApp.Inputs.SnapshotPolicyMonthlyScheduleArgs + /// { + /// SnapshotsToKeep = 1, + /// DaysOfMonths = new[] + /// { + /// 1, + /// 15, + /// 20, + /// 30, + /// }, + /// Hour = 5, + /// Minute = 45, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// NetApp Snapshot Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NetApp/VolumeQuotaRule.cs b/sdk/dotnet/NetApp/VolumeQuotaRule.cs index 92f7570142..08732802b2 100644 --- a/sdk/dotnet/NetApp/VolumeQuotaRule.cs +++ b/sdk/dotnet/NetApp/VolumeQuotaRule.cs @@ -12,6 +12,129 @@ namespace Pulumi.Azure.NetApp /// /// Manages a Volume Quota Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "netapp", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Netapp/volumes", + /// Actions = new[] + /// { + /// "Microsoft.Network/networkinterfaces/*", + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleAccount = new Azure.NetApp.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePool = new Azure.NetApp.Pool("examplePool", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// ServiceLevel = "Premium", + /// SizeInTb = 4, + /// }); + /// + /// var exampleVolume = new Azure.NetApp.Volume("exampleVolume", new() + /// { + /// Location = exampleResourceGroup.Location, + /// Zone = "1", + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountName = exampleAccount.Name, + /// PoolName = examplePool.Name, + /// VolumePath = "my-unique-file-path", + /// ServiceLevel = "Premium", + /// SubnetId = exampleSubnet.Id, + /// NetworkFeatures = "Basic", + /// Protocols = new[] + /// { + /// "NFSv4.1", + /// }, + /// SecurityStyle = "unix", + /// StorageQuotaInGb = 100, + /// SnapshotDirectoryVisible = false, + /// }); + /// + /// var quota1 = new Azure.NetApp.VolumeQuotaRule("quota1", new() + /// { + /// Location = exampleResourceGroup.Location, + /// VolumeId = exampleVolume.Id, + /// QuotaTarget = "3001", + /// QuotaSizeInKib = 1024, + /// QuotaType = "IndividualGroupQuota", + /// }); + /// + /// var quota2 = new Azure.NetApp.VolumeQuotaRule("quota2", new() + /// { + /// Location = exampleResourceGroup.Location, + /// VolumeId = exampleVolume.Id, + /// QuotaTarget = "2001", + /// QuotaSizeInKib = 1024, + /// QuotaType = "IndividualUserQuota", + /// }); + /// + /// var quota3 = new Azure.NetApp.VolumeQuotaRule("quota3", new() + /// { + /// Location = exampleResourceGroup.Location, + /// VolumeId = exampleVolume.Id, + /// QuotaSizeInKib = 1024, + /// QuotaType = "DefaultUserQuota", + /// }); + /// + /// var quota4 = new Azure.NetApp.VolumeQuotaRule("quota4", new() + /// { + /// Location = exampleResourceGroup.Location, + /// VolumeId = exampleVolume.Id, + /// QuotaSizeInKib = 1024, + /// QuotaType = "DefaultGroupQuota", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Volume Quota Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ApplicationGateway.cs b/sdk/dotnet/Network/ApplicationGateway.cs index df1d44246f..25301ad041 100644 --- a/sdk/dotnet/Network/ApplicationGateway.cs +++ b/sdk/dotnet/Network/ApplicationGateway.cs @@ -12,6 +12,152 @@ namespace Pulumi.Azure.Network /// /// Manages an Application Gateway. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.254.0.0/16", + /// }, + /// }); + /// + /// var frontend = new Azure.Network.Subnet("frontend", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.254.0.0/24", + /// }, + /// }); + /// + /// var backend = new Azure.Network.Subnet("backend", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.254.2.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllocationMethod = "Dynamic", + /// }); + /// + /// var backendAddressPoolName = exampleVirtualNetwork.Name.Apply(name => $"{name}-beap"); + /// + /// var frontendPortName = exampleVirtualNetwork.Name.Apply(name => $"{name}-feport"); + /// + /// var frontendIpConfigurationName = exampleVirtualNetwork.Name.Apply(name => $"{name}-feip"); + /// + /// var httpSettingName = exampleVirtualNetwork.Name.Apply(name => $"{name}-be-htst"); + /// + /// var listenerName = exampleVirtualNetwork.Name.Apply(name => $"{name}-httplstn"); + /// + /// var requestRoutingRuleName = exampleVirtualNetwork.Name.Apply(name => $"{name}-rqrt"); + /// + /// var redirectConfigurationName = exampleVirtualNetwork.Name.Apply(name => $"{name}-rdrcfg"); + /// + /// var network = new Azure.Network.ApplicationGateway("network", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Network.Inputs.ApplicationGatewaySkuArgs + /// { + /// Name = "Standard_v2", + /// Tier = "Standard_v2", + /// Capacity = 2, + /// }, + /// GatewayIpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.ApplicationGatewayGatewayIpConfigurationArgs + /// { + /// Name = "my-gateway-ip-configuration", + /// SubnetId = frontend.Id, + /// }, + /// }, + /// FrontendPorts = new[] + /// { + /// new Azure.Network.Inputs.ApplicationGatewayFrontendPortArgs + /// { + /// Name = frontendPortName, + /// Port = 80, + /// }, + /// }, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.ApplicationGatewayFrontendIpConfigurationArgs + /// { + /// Name = frontendIpConfigurationName, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// BackendAddressPools = new[] + /// { + /// new Azure.Network.Inputs.ApplicationGatewayBackendAddressPoolArgs + /// { + /// Name = backendAddressPoolName, + /// }, + /// }, + /// BackendHttpSettings = new[] + /// { + /// new Azure.Network.Inputs.ApplicationGatewayBackendHttpSettingArgs + /// { + /// Name = httpSettingName, + /// CookieBasedAffinity = "Disabled", + /// Path = "/path1/", + /// Port = 80, + /// Protocol = "Http", + /// RequestTimeout = 60, + /// }, + /// }, + /// HttpListeners = new[] + /// { + /// new Azure.Network.Inputs.ApplicationGatewayHttpListenerArgs + /// { + /// Name = listenerName, + /// FrontendIpConfigurationName = frontendIpConfigurationName, + /// FrontendPortName = frontendPortName, + /// Protocol = "Http", + /// }, + /// }, + /// RequestRoutingRules = new[] + /// { + /// new Azure.Network.Inputs.ApplicationGatewayRequestRoutingRuleArgs + /// { + /// Name = requestRoutingRuleName, + /// Priority = 9, + /// RuleType = "Basic", + /// HttpListenerName = listenerName, + /// BackendAddressPoolName = backendAddressPoolName, + /// BackendHttpSettingsName = httpSettingName, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Application Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ApplicationSecurityGroup.cs b/sdk/dotnet/Network/ApplicationSecurityGroup.cs index 910aca94a4..00b04addf9 100644 --- a/sdk/dotnet/Network/ApplicationSecurityGroup.cs +++ b/sdk/dotnet/Network/ApplicationSecurityGroup.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Network /// /// Manages an Application Security Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleApplicationSecurityGroup = new Azure.Network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "Hello", "World" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/BgpConnection.cs b/sdk/dotnet/Network/BgpConnection.cs index 896a1bae9c..8cd7b7403b 100644 --- a/sdk/dotnet/Network/BgpConnection.cs +++ b/sdk/dotnet/Network/BgpConnection.cs @@ -12,6 +12,81 @@ namespace Pulumi.Azure.Network /// /// Manages a Bgp Connection for a Virtual Hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.1.0/24", + /// }, + /// }); + /// + /// var exampleVirtualHubIp = new Azure.Network.VirtualHubIp("exampleVirtualHubIp", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// PrivateIpAddress = "10.5.1.18", + /// PrivateIpAllocationMethod = "Static", + /// PublicIpAddressId = examplePublicIp.Id, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// var exampleBgpConnection = new Azure.Network.BgpConnection("exampleBgpConnection", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// PeerAsn = 65514, + /// PeerIp = "169.254.21.5", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleVirtualHubIp, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Hub Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/DdosProtectionPlan.cs b/sdk/dotnet/Network/DdosProtectionPlan.cs index 4bc41ad35a..7ce3315334 100644 --- a/sdk/dotnet/Network/DdosProtectionPlan.cs +++ b/sdk/dotnet/Network/DdosProtectionPlan.cs @@ -16,6 +16,30 @@ namespace Pulumi.Azure.Network /// /// > **NOTE** The DDoS Protection Plan is a [high-cost service](https://azure.microsoft.com/en-us/pricing/details/ddos-protection/#pricing). Please keep this in mind while testing and learning. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleDdosProtectionPlan = new Azure.Network.DdosProtectionPlan("exampleDdosProtectionPlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure DDoS Protection Plan can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ExpressRouteCircuit.cs b/sdk/dotnet/Network/ExpressRouteCircuit.cs index 2b6170f510..e0f6f452a7 100644 --- a/sdk/dotnet/Network/ExpressRouteCircuit.cs +++ b/sdk/dotnet/Network/ExpressRouteCircuit.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Network /// /// Manages an ExpressRoute circuit. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleExpressRouteCircuit = new Azure.Network.ExpressRouteCircuit("exampleExpressRouteCircuit", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServiceProviderName = "Equinix", + /// PeeringLocation = "Silicon Valley", + /// BandwidthInMbps = 50, + /// Sku = new Azure.Network.Inputs.ExpressRouteCircuitSkuArgs + /// { + /// Tier = "Standard", + /// Family = "MeteredData", + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ExpressRoute circuits can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ExpressRouteCircuitAuthorization.cs b/sdk/dotnet/Network/ExpressRouteCircuitAuthorization.cs index 41ac76d886..20ed3e38f1 100644 --- a/sdk/dotnet/Network/ExpressRouteCircuitAuthorization.cs +++ b/sdk/dotnet/Network/ExpressRouteCircuitAuthorization.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Network /// /// Manages an ExpressRoute Circuit Authorization. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleExpressRouteCircuit = new Azure.Network.ExpressRouteCircuit("exampleExpressRouteCircuit", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServiceProviderName = "Equinix", + /// PeeringLocation = "Silicon Valley", + /// BandwidthInMbps = 50, + /// Sku = new Azure.Network.Inputs.ExpressRouteCircuitSkuArgs + /// { + /// Tier = "Standard", + /// Family = "MeteredData", + /// }, + /// AllowClassicOperations = false, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleExpressRouteCircuitAuthorization = new Azure.Network.ExpressRouteCircuitAuthorization("exampleExpressRouteCircuitAuthorization", new() + /// { + /// ExpressRouteCircuitName = exampleExpressRouteCircuit.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ExpressRoute Circuit Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ExpressRouteCircuitConnection.cs b/sdk/dotnet/Network/ExpressRouteCircuitConnection.cs index ae96dec8b5..d4e09b085a 100644 --- a/sdk/dotnet/Network/ExpressRouteCircuitConnection.cs +++ b/sdk/dotnet/Network/ExpressRouteCircuitConnection.cs @@ -12,6 +12,100 @@ namespace Pulumi.Azure.Network /// /// Manages an Express Route Circuit Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleExpressRoutePort = new Azure.Network.ExpressRoutePort("exampleExpressRoutePort", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PeeringLocation = "Equinix-Seattle-SE2", + /// BandwidthInGbps = 10, + /// Encapsulation = "Dot1Q", + /// }); + /// + /// var exampleExpressRouteCircuit = new Azure.Network.ExpressRouteCircuit("exampleExpressRouteCircuit", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ExpressRoutePortId = exampleExpressRoutePort.Id, + /// BandwidthInGbps = 5, + /// Sku = new Azure.Network.Inputs.ExpressRouteCircuitSkuArgs + /// { + /// Tier = "Standard", + /// Family = "MeteredData", + /// }, + /// }); + /// + /// var example2ExpressRoutePort = new Azure.Network.ExpressRoutePort("example2ExpressRoutePort", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PeeringLocation = "Allied-Toronto-King-West", + /// BandwidthInGbps = 10, + /// Encapsulation = "Dot1Q", + /// }); + /// + /// var example2ExpressRouteCircuit = new Azure.Network.ExpressRouteCircuit("example2ExpressRouteCircuit", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ExpressRoutePortId = example2ExpressRoutePort.Id, + /// BandwidthInGbps = 5, + /// Sku = new Azure.Network.Inputs.ExpressRouteCircuitSkuArgs + /// { + /// Tier = "Standard", + /// Family = "MeteredData", + /// }, + /// }); + /// + /// var exampleExpressRouteCircuitPeering = new Azure.Network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", new() + /// { + /// PeeringType = "AzurePrivatePeering", + /// ExpressRouteCircuitName = exampleExpressRouteCircuit.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SharedKey = "ItsASecret", + /// PeerAsn = 100, + /// PrimaryPeerAddressPrefix = "192.168.1.0/30", + /// SecondaryPeerAddressPrefix = "192.168.1.0/30", + /// VlanId = 100, + /// }); + /// + /// var example2ExpressRouteCircuitPeering = new Azure.Network.ExpressRouteCircuitPeering("example2ExpressRouteCircuitPeering", new() + /// { + /// PeeringType = "AzurePrivatePeering", + /// ExpressRouteCircuitName = example2ExpressRouteCircuit.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SharedKey = "ItsASecret", + /// PeerAsn = 100, + /// PrimaryPeerAddressPrefix = "192.168.1.0/30", + /// SecondaryPeerAddressPrefix = "192.168.1.0/30", + /// VlanId = 100, + /// }); + /// + /// var exampleExpressRouteCircuitConnection = new Azure.Network.ExpressRouteCircuitConnection("exampleExpressRouteCircuitConnection", new() + /// { + /// PeeringId = exampleExpressRouteCircuitPeering.Id, + /// PeerPeeringId = example2ExpressRouteCircuitPeering.Id, + /// AddressPrefixIpv4 = "192.169.9.0/29", + /// AuthorizationKey = "846a1918-b7a2-4917-b43c-8c4cdaee006a", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Express Route Circuit Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ExpressRouteCircuitPeering.cs b/sdk/dotnet/Network/ExpressRouteCircuitPeering.cs index 5cce0ccd24..68a7421a5e 100644 --- a/sdk/dotnet/Network/ExpressRouteCircuitPeering.cs +++ b/sdk/dotnet/Network/ExpressRouteCircuitPeering.cs @@ -13,6 +13,128 @@ namespace Pulumi.Azure.Network /// Manages an ExpressRoute Circuit Peering. /// /// ## Example Usage + /// ### Creating A Microsoft Peering) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleExpressRouteCircuit = new Azure.Network.ExpressRouteCircuit("exampleExpressRouteCircuit", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServiceProviderName = "Equinix", + /// PeeringLocation = "Silicon Valley", + /// BandwidthInMbps = 50, + /// Sku = new Azure.Network.Inputs.ExpressRouteCircuitSkuArgs + /// { + /// Tier = "Standard", + /// Family = "MeteredData", + /// }, + /// AllowClassicOperations = false, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleExpressRouteCircuitPeering = new Azure.Network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", new() + /// { + /// PeeringType = "MicrosoftPeering", + /// ExpressRouteCircuitName = exampleExpressRouteCircuit.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PeerAsn = 100, + /// PrimaryPeerAddressPrefix = "123.0.0.0/30", + /// SecondaryPeerAddressPrefix = "123.0.0.4/30", + /// Ipv4Enabled = true, + /// VlanId = 300, + /// MicrosoftPeeringConfig = new Azure.Network.Inputs.ExpressRouteCircuitPeeringMicrosoftPeeringConfigArgs + /// { + /// AdvertisedPublicPrefixes = new[] + /// { + /// "123.1.0.0/24", + /// }, + /// }, + /// Ipv6 = new Azure.Network.Inputs.ExpressRouteCircuitPeeringIpv6Args + /// { + /// PrimaryPeerAddressPrefix = "2002:db01::/126", + /// SecondaryPeerAddressPrefix = "2003:db01::/126", + /// Enabled = true, + /// MicrosoftPeering = new Azure.Network.Inputs.ExpressRouteCircuitPeeringIpv6MicrosoftPeeringArgs + /// { + /// AdvertisedPublicPrefixes = new[] + /// { + /// "2002:db01::/126", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Creating Azure Private Peering) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleExpressRouteCircuit = new Azure.Network.ExpressRouteCircuit("exampleExpressRouteCircuit", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServiceProviderName = "Equinix", + /// PeeringLocation = "Silicon Valley", + /// BandwidthInMbps = 50, + /// Sku = new Azure.Network.Inputs.ExpressRouteCircuitSkuArgs + /// { + /// Tier = "Standard", + /// Family = "MeteredData", + /// }, + /// AllowClassicOperations = false, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleExpressRouteCircuitPeering = new Azure.Network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", new() + /// { + /// PeeringType = "AzurePrivatePeering", + /// ExpressRouteCircuitName = exampleExpressRouteCircuit.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PeerAsn = 100, + /// PrimaryPeerAddressPrefix = "123.0.0.0/30", + /// SecondaryPeerAddressPrefix = "123.0.0.4/30", + /// Ipv4Enabled = true, + /// VlanId = 300, + /// Ipv6 = new Azure.Network.Inputs.ExpressRouteCircuitPeeringIpv6Args + /// { + /// PrimaryPeerAddressPrefix = "2002:db01::/126", + /// SecondaryPeerAddressPrefix = "2003:db01::/126", + /// Enabled = true, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Network/ExpressRouteConnection.cs b/sdk/dotnet/Network/ExpressRouteConnection.cs index ca517f0859..907b065766 100644 --- a/sdk/dotnet/Network/ExpressRouteConnection.cs +++ b/sdk/dotnet/Network/ExpressRouteConnection.cs @@ -14,6 +14,86 @@ namespace Pulumi.Azure.Network /// /// > **NOTE:** The provider status of the Express Route Circuit must be set as provisioned while creating the Express Route Connection. See more details [here](https://docs.microsoft.com/azure/expressroute/expressroute-howto-circuit-portal-resource-manager#send-the-service-key-to-your-connectivity-provider-for-provisioning). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.1.0/24", + /// }); + /// + /// var exampleExpressRouteGateway = new Azure.Network.ExpressRouteGateway("exampleExpressRouteGateway", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualHubId = exampleVirtualHub.Id, + /// ScaleUnits = 1, + /// }); + /// + /// var exampleExpressRoutePort = new Azure.Network.ExpressRoutePort("exampleExpressRoutePort", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PeeringLocation = "Equinix-Seattle-SE2", + /// BandwidthInGbps = 10, + /// Encapsulation = "Dot1Q", + /// }); + /// + /// var exampleExpressRouteCircuit = new Azure.Network.ExpressRouteCircuit("exampleExpressRouteCircuit", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ExpressRoutePortId = exampleExpressRoutePort.Id, + /// BandwidthInGbps = 5, + /// Sku = new Azure.Network.Inputs.ExpressRouteCircuitSkuArgs + /// { + /// Tier = "Standard", + /// Family = "MeteredData", + /// }, + /// }); + /// + /// var exampleExpressRouteCircuitPeering = new Azure.Network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", new() + /// { + /// PeeringType = "AzurePrivatePeering", + /// ExpressRouteCircuitName = exampleExpressRouteCircuit.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SharedKey = "ItsASecret", + /// PeerAsn = 100, + /// PrimaryPeerAddressPrefix = "192.168.1.0/30", + /// SecondaryPeerAddressPrefix = "192.168.2.0/30", + /// VlanId = 100, + /// }); + /// + /// var exampleExpressRouteConnection = new Azure.Network.ExpressRouteConnection("exampleExpressRouteConnection", new() + /// { + /// ExpressRouteGatewayId = exampleExpressRouteGateway.Id, + /// ExpressRouteCircuitPeeringId = exampleExpressRouteCircuitPeering.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Express Route Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ExpressRouteGateway.cs b/sdk/dotnet/Network/ExpressRouteGateway.cs index 6daea7bb9b..7e464f1c78 100644 --- a/sdk/dotnet/Network/ExpressRouteGateway.cs +++ b/sdk/dotnet/Network/ExpressRouteGateway.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Network /// /// Manages an ExpressRoute gateway. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.1.0/24", + /// }); + /// + /// var exampleExpressRouteGateway = new Azure.Network.ExpressRouteGateway("exampleExpressRouteGateway", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualHubId = exampleVirtualHub.Id, + /// ScaleUnits = 1, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ExpressRoute Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ExpressRoutePort.cs b/sdk/dotnet/Network/ExpressRoutePort.cs index 80d5cedd2e..309dbcaa0f 100644 --- a/sdk/dotnet/Network/ExpressRoutePort.cs +++ b/sdk/dotnet/Network/ExpressRoutePort.cs @@ -12,6 +12,33 @@ namespace Pulumi.Azure.Network /// /// Manages a Express Route Port. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleExpressRoutePort = new Azure.Network.ExpressRoutePort("exampleExpressRoutePort", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PeeringLocation = "Airtel-Chennai-CLS", + /// BandwidthInGbps = 10, + /// Encapsulation = "Dot1Q", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Express Route Ports can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/ExpressRoutePortAuthorization.cs b/sdk/dotnet/Network/ExpressRoutePortAuthorization.cs index fa27e95cc5..9faf417201 100644 --- a/sdk/dotnet/Network/ExpressRoutePortAuthorization.cs +++ b/sdk/dotnet/Network/ExpressRoutePortAuthorization.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.Network /// /// Manages an ExpressRoute Port Authorization. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleExpressRoutePort = new Azure.Network.ExpressRoutePort("exampleExpressRoutePort", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PeeringLocation = "Airtel-Chennai-CLS", + /// BandwidthInGbps = 10, + /// Encapsulation = "Dot1Q", + /// }); + /// + /// var exampleExpressRoutePortAuthorization = new Azure.Network.ExpressRoutePortAuthorization("exampleExpressRoutePortAuthorization", new() + /// { + /// ExpressRoutePortName = exampleExpressRoutePort.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ExpressRoute Port Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/Firewall.cs b/sdk/dotnet/Network/Firewall.cs index 351bdf88c6..5ba218cc80 100644 --- a/sdk/dotnet/Network/Firewall.cs +++ b/sdk/dotnet/Network/Firewall.cs @@ -12,6 +12,69 @@ namespace Pulumi.Azure.Network /// /// Manages an Azure Firewall. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleFirewall = new Azure.Network.Firewall("exampleFirewall", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "AZFW_VNet", + /// SkuTier = "Standard", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.FirewallIpConfigurationArgs + /// { + /// Name = "configuration", + /// SubnetId = exampleSubnet.Id, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Firewalls can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/FirewallApplicationRuleCollection.cs b/sdk/dotnet/Network/FirewallApplicationRuleCollection.cs index 2507f5d147..2014ac138b 100644 --- a/sdk/dotnet/Network/FirewallApplicationRuleCollection.cs +++ b/sdk/dotnet/Network/FirewallApplicationRuleCollection.cs @@ -12,6 +12,100 @@ namespace Pulumi.Azure.Network /// /// Manages an Application Rule Collection within an Azure Firewall. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleFirewall = new Azure.Network.Firewall("exampleFirewall", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "AZFW_VNet", + /// SkuTier = "Standard", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.FirewallIpConfigurationArgs + /// { + /// Name = "configuration", + /// SubnetId = exampleSubnet.Id, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleFirewallApplicationRuleCollection = new Azure.Network.FirewallApplicationRuleCollection("exampleFirewallApplicationRuleCollection", new() + /// { + /// AzureFirewallName = exampleFirewall.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Priority = 100, + /// Action = "Allow", + /// Rules = new[] + /// { + /// new Azure.Network.Inputs.FirewallApplicationRuleCollectionRuleArgs + /// { + /// Name = "testrule", + /// SourceAddresses = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// TargetFqdns = new[] + /// { + /// "*.google.com", + /// }, + /// Protocols = new[] + /// { + /// new Azure.Network.Inputs.FirewallApplicationRuleCollectionRuleProtocolArgs + /// { + /// Port = 443, + /// Type = "Https", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Firewall Application Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/FirewallNatRuleCollection.cs b/sdk/dotnet/Network/FirewallNatRuleCollection.cs index b3b67cafe9..2dc38231d4 100644 --- a/sdk/dotnet/Network/FirewallNatRuleCollection.cs +++ b/sdk/dotnet/Network/FirewallNatRuleCollection.cs @@ -12,6 +12,103 @@ namespace Pulumi.Azure.Network /// /// Manages a NAT Rule Collection within an Azure Firewall. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleFirewall = new Azure.Network.Firewall("exampleFirewall", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "AZFW_VNet", + /// SkuTier = "Standard", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.FirewallIpConfigurationArgs + /// { + /// Name = "configuration", + /// SubnetId = exampleSubnet.Id, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleFirewallNatRuleCollection = new Azure.Network.FirewallNatRuleCollection("exampleFirewallNatRuleCollection", new() + /// { + /// AzureFirewallName = exampleFirewall.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Priority = 100, + /// Action = "Dnat", + /// Rules = new[] + /// { + /// new Azure.Network.Inputs.FirewallNatRuleCollectionRuleArgs + /// { + /// Name = "testrule", + /// SourceAddresses = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// DestinationPorts = new[] + /// { + /// "53", + /// }, + /// DestinationAddresses = new[] + /// { + /// examplePublicIp.IpAddress, + /// }, + /// TranslatedPort = "53", + /// TranslatedAddress = "8.8.8.8", + /// Protocols = new[] + /// { + /// "TCP", + /// "UDP", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Firewall NAT Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/FirewallNetworkRuleCollection.cs b/sdk/dotnet/Network/FirewallNetworkRuleCollection.cs index f760dd7582..c6587e650c 100644 --- a/sdk/dotnet/Network/FirewallNetworkRuleCollection.cs +++ b/sdk/dotnet/Network/FirewallNetworkRuleCollection.cs @@ -12,6 +12,102 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Rule Collection within an Azure Firewall. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleFirewall = new Azure.Network.Firewall("exampleFirewall", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "AZFW_VNet", + /// SkuTier = "Standard", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.FirewallIpConfigurationArgs + /// { + /// Name = "configuration", + /// SubnetId = exampleSubnet.Id, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleFirewallNetworkRuleCollection = new Azure.Network.FirewallNetworkRuleCollection("exampleFirewallNetworkRuleCollection", new() + /// { + /// AzureFirewallName = exampleFirewall.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Priority = 100, + /// Action = "Allow", + /// Rules = new[] + /// { + /// new Azure.Network.Inputs.FirewallNetworkRuleCollectionRuleArgs + /// { + /// Name = "testrule", + /// SourceAddresses = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// DestinationPorts = new[] + /// { + /// "53", + /// }, + /// DestinationAddresses = new[] + /// { + /// "8.8.8.8", + /// "8.8.4.4", + /// }, + /// Protocols = new[] + /// { + /// "TCP", + /// "UDP", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Firewall Network Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/FirewallPolicy.cs b/sdk/dotnet/Network/FirewallPolicy.cs index d51d271e49..4957c99e35 100644 --- a/sdk/dotnet/Network/FirewallPolicy.cs +++ b/sdk/dotnet/Network/FirewallPolicy.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Network /// /// Manages a Firewall Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFirewallPolicy = new Azure.Network.FirewallPolicy("exampleFirewallPolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/GetApplicationGateway.cs b/sdk/dotnet/Network/GetApplicationGateway.cs index de2e5dc1f6..4adac34c8e 100644 --- a/sdk/dotnet/Network/GetApplicationGateway.cs +++ b/sdk/dotnet/Network/GetApplicationGateway.cs @@ -13,12 +13,66 @@ public static class GetApplicationGateway { /// /// Use this data source to access information about an existing Application Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetApplicationGateway.Invoke(new() + /// { + /// Name = "existing-app-gateway", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getApplicationGatewayResult => getApplicationGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetApplicationGatewayArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getApplicationGateway:getApplicationGateway", args ?? new GetApplicationGatewayArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Application Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetApplicationGateway.Invoke(new() + /// { + /// Name = "existing-app-gateway", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getApplicationGatewayResult => getApplicationGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetApplicationGatewayInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getApplicationGateway:getApplicationGateway", args ?? new GetApplicationGatewayInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetApplicationSecurityGroup.cs b/sdk/dotnet/Network/GetApplicationSecurityGroup.cs index 246a3015da..20e7ecb843 100644 --- a/sdk/dotnet/Network/GetApplicationSecurityGroup.cs +++ b/sdk/dotnet/Network/GetApplicationSecurityGroup.cs @@ -13,12 +13,66 @@ public static class GetApplicationSecurityGroup { /// /// Use this data source to access information about an existing Application Security Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetApplicationSecurityGroup.Invoke(new() + /// { + /// Name = "tf-appsecuritygroup", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["applicationSecurityGroupId"] = example.Apply(getApplicationSecurityGroupResult => getApplicationSecurityGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetApplicationSecurityGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getApplicationSecurityGroup:getApplicationSecurityGroup", args ?? new GetApplicationSecurityGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Application Security Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetApplicationSecurityGroup.Invoke(new() + /// { + /// Name = "tf-appsecuritygroup", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["applicationSecurityGroupId"] = example.Apply(getApplicationSecurityGroupResult => getApplicationSecurityGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetApplicationSecurityGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getApplicationSecurityGroup:getApplicationSecurityGroup", args ?? new GetApplicationSecurityGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetExpressRouteCircuit.cs b/sdk/dotnet/Network/GetExpressRouteCircuit.cs index c85cd85f5f..a6605d3be7 100644 --- a/sdk/dotnet/Network/GetExpressRouteCircuit.cs +++ b/sdk/dotnet/Network/GetExpressRouteCircuit.cs @@ -13,12 +13,68 @@ public static class GetExpressRouteCircuit { /// /// Use this data source to access information about an existing ExpressRoute circuit. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetExpressRouteCircuit.Invoke(new() + /// { + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// Name = azurerm_express_route_circuit.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["expressRouteCircuitId"] = example.Apply(getExpressRouteCircuitResult => getExpressRouteCircuitResult.Id), + /// ["serviceKey"] = example.Apply(getExpressRouteCircuitResult => getExpressRouteCircuitResult.ServiceKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetExpressRouteCircuitArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getExpressRouteCircuit:getExpressRouteCircuit", args ?? new GetExpressRouteCircuitArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing ExpressRoute circuit. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetExpressRouteCircuit.Invoke(new() + /// { + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// Name = azurerm_express_route_circuit.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["expressRouteCircuitId"] = example.Apply(getExpressRouteCircuitResult => getExpressRouteCircuitResult.Id), + /// ["serviceKey"] = example.Apply(getExpressRouteCircuitResult => getExpressRouteCircuitResult.ServiceKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetExpressRouteCircuitInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getExpressRouteCircuit:getExpressRouteCircuit", args ?? new GetExpressRouteCircuitInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetFirewall.cs b/sdk/dotnet/Network/GetFirewall.cs index a38323d73a..e691fa924d 100644 --- a/sdk/dotnet/Network/GetFirewall.cs +++ b/sdk/dotnet/Network/GetFirewall.cs @@ -13,12 +13,66 @@ public static class GetFirewall { /// /// Use this data source to access information about an existing Azure Firewall. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetFirewall.Invoke(new() + /// { + /// Name = "firewall1", + /// ResourceGroupName = "firewall-RG", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["firewallPrivateIp"] = example.Apply(getFirewallResult => getFirewallResult.IpConfigurations[0]?.PrivateIpAddress), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFirewallArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getFirewall:getFirewall", args ?? new GetFirewallArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure Firewall. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetFirewall.Invoke(new() + /// { + /// Name = "firewall1", + /// ResourceGroupName = "firewall-RG", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["firewallPrivateIp"] = example.Apply(getFirewallResult => getFirewallResult.IpConfigurations[0]?.PrivateIpAddress), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFirewallInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getFirewall:getFirewall", args ?? new GetFirewallInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetFirewallPolicy.cs b/sdk/dotnet/Network/GetFirewallPolicy.cs index d5b76e7e74..edd0888dc8 100644 --- a/sdk/dotnet/Network/GetFirewallPolicy.cs +++ b/sdk/dotnet/Network/GetFirewallPolicy.cs @@ -13,12 +13,66 @@ public static class GetFirewallPolicy { /// /// Use this data source to access information about an existing Firewall Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetFirewallPolicy.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFirewallPolicyResult => getFirewallPolicyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFirewallPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getFirewallPolicy:getFirewallPolicy", args ?? new GetFirewallPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Firewall Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetFirewallPolicy.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFirewallPolicyResult => getFirewallPolicyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFirewallPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getFirewallPolicy:getFirewallPolicy", args ?? new GetFirewallPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetGatewayConnection.cs b/sdk/dotnet/Network/GetGatewayConnection.cs index e2382f19e5..5ebf0d9d1d 100644 --- a/sdk/dotnet/Network/GetGatewayConnection.cs +++ b/sdk/dotnet/Network/GetGatewayConnection.cs @@ -13,12 +13,66 @@ public static class GetGatewayConnection { /// /// Use this data source to access information about an existing Virtual Network Gateway Connection. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetGatewayConnection.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualNetworkGatewayConnectionId"] = example.Apply(getGatewayConnectionResult => getGatewayConnectionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetGatewayConnectionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getGatewayConnection:getGatewayConnection", args ?? new GetGatewayConnectionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Virtual Network Gateway Connection. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetGatewayConnection.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualNetworkGatewayConnectionId"] = example.Apply(getGatewayConnectionResult => getGatewayConnectionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetGatewayConnectionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getGatewayConnection:getGatewayConnection", args ?? new GetGatewayConnectionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetIpGroup.cs b/sdk/dotnet/Network/GetIpGroup.cs index 5183225fb8..c4c2edae0b 100644 --- a/sdk/dotnet/Network/GetIpGroup.cs +++ b/sdk/dotnet/Network/GetIpGroup.cs @@ -13,12 +13,66 @@ public static class GetIpGroup { /// /// Use this data source to access information about an existing IP Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetIpGroup.Invoke(new() + /// { + /// Name = "example1-ipgroup", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["cidrs"] = example.Apply(getIpGroupResult => getIpGroupResult.Cidrs), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetIpGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getIpGroup:getIpGroup", args ?? new GetIpGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing IP Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetIpGroup.Invoke(new() + /// { + /// Name = "example1-ipgroup", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["cidrs"] = example.Apply(getIpGroupResult => getIpGroupResult.Cidrs), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetIpGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getIpGroup:getIpGroup", args ?? new GetIpGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetLocalNetworkGateway.cs b/sdk/dotnet/Network/GetLocalNetworkGateway.cs index 42abc5d287..16aa937aee 100644 --- a/sdk/dotnet/Network/GetLocalNetworkGateway.cs +++ b/sdk/dotnet/Network/GetLocalNetworkGateway.cs @@ -13,12 +13,66 @@ public static class GetLocalNetworkGateway { /// /// Use this data source to access information about an existing Local Network Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetLocalNetworkGateway.Invoke(new() + /// { + /// Name = "existing-local-network-gateway", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLocalNetworkGatewayResult => getLocalNetworkGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetLocalNetworkGatewayArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getLocalNetworkGateway:getLocalNetworkGateway", args ?? new GetLocalNetworkGatewayArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Local Network Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetLocalNetworkGateway.Invoke(new() + /// { + /// Name = "existing-local-network-gateway", + /// ResourceGroupName = "existing-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getLocalNetworkGatewayResult => getLocalNetworkGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetLocalNetworkGatewayInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getLocalNetworkGateway:getLocalNetworkGateway", args ?? new GetLocalNetworkGatewayInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetNetworkDdosProtectionPlan.cs b/sdk/dotnet/Network/GetNetworkDdosProtectionPlan.cs index 85402783fc..10e18f61f9 100644 --- a/sdk/dotnet/Network/GetNetworkDdosProtectionPlan.cs +++ b/sdk/dotnet/Network/GetNetworkDdosProtectionPlan.cs @@ -13,12 +13,66 @@ public static class GetNetworkDdosProtectionPlan { /// /// Use this data source to access information about an existing Azure Network DDoS Protection Plan. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkDdosProtectionPlan.Invoke(new() + /// { + /// Name = azurerm_network_ddos_protection_plan.Example.Name, + /// ResourceGroupName = azurerm_network_ddos_protection_plan.Example.Resource_group_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ddosProtectionPlanId"] = example.Apply(getNetworkDdosProtectionPlanResult => getNetworkDdosProtectionPlanResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkDdosProtectionPlanArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getNetworkDdosProtectionPlan:getNetworkDdosProtectionPlan", args ?? new GetNetworkDdosProtectionPlanArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure Network DDoS Protection Plan. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkDdosProtectionPlan.Invoke(new() + /// { + /// Name = azurerm_network_ddos_protection_plan.Example.Name, + /// ResourceGroupName = azurerm_network_ddos_protection_plan.Example.Resource_group_name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ddosProtectionPlanId"] = example.Apply(getNetworkDdosProtectionPlanResult => getNetworkDdosProtectionPlanResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkDdosProtectionPlanInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getNetworkDdosProtectionPlan:getNetworkDdosProtectionPlan", args ?? new GetNetworkDdosProtectionPlanInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetNetworkInterface.cs b/sdk/dotnet/Network/GetNetworkInterface.cs index a56dd66441..eb42f0b154 100644 --- a/sdk/dotnet/Network/GetNetworkInterface.cs +++ b/sdk/dotnet/Network/GetNetworkInterface.cs @@ -13,12 +13,66 @@ public static class GetNetworkInterface { /// /// Use this data source to access information about an existing Network Interface. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkInterface.Invoke(new() + /// { + /// Name = "acctest-nic", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["networkInterfaceId"] = example.Apply(getNetworkInterfaceResult => getNetworkInterfaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkInterfaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getNetworkInterface:getNetworkInterface", args ?? new GetNetworkInterfaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Network Interface. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkInterface.Invoke(new() + /// { + /// Name = "acctest-nic", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["networkInterfaceId"] = example.Apply(getNetworkInterfaceResult => getNetworkInterfaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkInterfaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getNetworkInterface:getNetworkInterface", args ?? new GetNetworkInterfaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetNetworkSecurityGroup.cs b/sdk/dotnet/Network/GetNetworkSecurityGroup.cs index 8db59d7948..92a3d57853 100644 --- a/sdk/dotnet/Network/GetNetworkSecurityGroup.cs +++ b/sdk/dotnet/Network/GetNetworkSecurityGroup.cs @@ -13,12 +13,66 @@ public static class GetNetworkSecurityGroup { /// /// Use this data source to access information about an existing Network Security Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkSecurityGroup.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["location"] = example.Apply(getNetworkSecurityGroupResult => getNetworkSecurityGroupResult.Location), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkSecurityGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getNetworkSecurityGroup:getNetworkSecurityGroup", args ?? new GetNetworkSecurityGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Network Security Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkSecurityGroup.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["location"] = example.Apply(getNetworkSecurityGroupResult => getNetworkSecurityGroupResult.Location), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkSecurityGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getNetworkSecurityGroup:getNetworkSecurityGroup", args ?? new GetNetworkSecurityGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetNetworkWatcher.cs b/sdk/dotnet/Network/GetNetworkWatcher.cs index 69f088dc0b..b2ec4196cf 100644 --- a/sdk/dotnet/Network/GetNetworkWatcher.cs +++ b/sdk/dotnet/Network/GetNetworkWatcher.cs @@ -13,12 +13,66 @@ public static class GetNetworkWatcher { /// /// Use this data source to access information about an existing Network Watcher. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkWatcher.Invoke(new() + /// { + /// Name = azurerm_network_watcher.Example.Name, + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["networkWatcherId"] = example.Apply(getNetworkWatcherResult => getNetworkWatcherResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNetworkWatcherArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getNetworkWatcher:getNetworkWatcher", args ?? new GetNetworkWatcherArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Network Watcher. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetNetworkWatcher.Invoke(new() + /// { + /// Name = azurerm_network_watcher.Example.Name, + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["networkWatcherId"] = example.Apply(getNetworkWatcherResult => getNetworkWatcherResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNetworkWatcherInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getNetworkWatcher:getNetworkWatcher", args ?? new GetNetworkWatcherInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetPublicIP.cs b/sdk/dotnet/Network/GetPublicIP.cs index a15381c56d..0b2228a002 100644 --- a/sdk/dotnet/Network/GetPublicIP.cs +++ b/sdk/dotnet/Network/GetPublicIP.cs @@ -16,6 +16,121 @@ public static class GetPublicIP /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetPublicIP.Invoke(new() + /// { + /// Name = "name_of_public_ip", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["domainNameLabel"] = example.Apply(getPublicIPResult => getPublicIPResult.DomainNameLabel), + /// ["publicIpAddress"] = example.Apply(getPublicIPResult => getPublicIPResult.IpAddress), + /// }; + /// }); + /// ``` + /// + /// {{% /example %}} + /// {{% example %}} + /// ### Retrieve The Dynamic Public IP Of A New VM) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// IdleTimeoutInMinutes = 30, + /// Tags = + /// { + /// { "environment", "test" }, + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Static", + /// PrivateIpAddress = "10.0.2.5", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleVirtualMachine = new Azure.Compute.VirtualMachine("exampleVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// }); + /// + /// // ... + /// var examplePublicIP = Azure.Network.GetPublicIP.Invoke(new() + /// { + /// Name = examplePublicIp.Name, + /// ResourceGroupName = exampleVirtualMachine.ResourceGroupName, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["publicIpAddress"] = examplePublicIp.IpAddress, + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Task InvokeAsync(GetPublicIPArgs args, InvokeOptions? options = null) @@ -26,6 +141,121 @@ public static Task InvokeAsync(GetPublicIPArgs args, InvokeOp /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetPublicIP.Invoke(new() + /// { + /// Name = "name_of_public_ip", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["domainNameLabel"] = example.Apply(getPublicIPResult => getPublicIPResult.DomainNameLabel), + /// ["publicIpAddress"] = example.Apply(getPublicIPResult => getPublicIPResult.IpAddress), + /// }; + /// }); + /// ``` + /// + /// {{% /example %}} + /// {{% example %}} + /// ### Retrieve The Dynamic Public IP Of A New VM) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// IdleTimeoutInMinutes = 30, + /// Tags = + /// { + /// { "environment", "test" }, + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Static", + /// PrivateIpAddress = "10.0.2.5", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleVirtualMachine = new Azure.Compute.VirtualMachine("exampleVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// }); + /// + /// // ... + /// var examplePublicIP = Azure.Network.GetPublicIP.Invoke(new() + /// { + /// Name = examplePublicIp.Name, + /// ResourceGroupName = exampleVirtualMachine.ResourceGroupName, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["publicIpAddress"] = examplePublicIp.IpAddress, + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Output Invoke(GetPublicIPInvokeArgs args, InvokeOptions? options = null) diff --git a/sdk/dotnet/Network/GetPublicIPs.cs b/sdk/dotnet/Network/GetPublicIPs.cs index f52f22e392..e14e4fe000 100644 --- a/sdk/dotnet/Network/GetPublicIPs.cs +++ b/sdk/dotnet/Network/GetPublicIPs.cs @@ -13,12 +13,58 @@ public static class GetPublicIPs { /// /// Use this data source to access information about a set of existing Public IP Addresses. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetPublicIPs.Invoke(new() + /// { + /// AttachmentStatus = "Attached", + /// ResourceGroupName = "pip-test", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPublicIPsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getPublicIPs:getPublicIPs", args ?? new GetPublicIPsArgs(), options.WithDefaults()); /// /// Use this data source to access information about a set of existing Public IP Addresses. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetPublicIPs.Invoke(new() + /// { + /// AttachmentStatus = "Attached", + /// ResourceGroupName = "pip-test", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPublicIPsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getPublicIPs:getPublicIPs", args ?? new GetPublicIPsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetPublicIpPrefix.cs b/sdk/dotnet/Network/GetPublicIpPrefix.cs index d9c9a7efd3..b3423447b5 100644 --- a/sdk/dotnet/Network/GetPublicIpPrefix.cs +++ b/sdk/dotnet/Network/GetPublicIpPrefix.cs @@ -16,6 +16,30 @@ public static class GetPublicIpPrefix /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetPublicIpPrefix.Invoke(new() + /// { + /// Name = "name_of_public_ip", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["publicIpPrefix"] = example.Apply(getPublicIpPrefixResult => getPublicIpPrefixResult.IpPrefix), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Task InvokeAsync(GetPublicIpPrefixArgs args, InvokeOptions? options = null) @@ -26,6 +50,30 @@ public static Task InvokeAsync(GetPublicIpPrefixArgs ar /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### Reference An Existing) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetPublicIpPrefix.Invoke(new() + /// { + /// Name = "name_of_public_ip", + /// ResourceGroupName = "name_of_resource_group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["publicIpPrefix"] = example.Apply(getPublicIpPrefixResult => getPublicIpPrefixResult.IpPrefix), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Output Invoke(GetPublicIpPrefixInvokeArgs args, InvokeOptions? options = null) diff --git a/sdk/dotnet/Network/GetRouteFilter.cs b/sdk/dotnet/Network/GetRouteFilter.cs index c4207b5ec1..8c454a5815 100644 --- a/sdk/dotnet/Network/GetRouteFilter.cs +++ b/sdk/dotnet/Network/GetRouteFilter.cs @@ -13,12 +13,66 @@ public static class GetRouteFilter { /// /// Use this data source to access information about an existing Route Filter. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetRouteFilter.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getRouteFilterResult => getRouteFilterResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRouteFilterArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getRouteFilter:getRouteFilter", args ?? new GetRouteFilterArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Route Filter. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetRouteFilter.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getRouteFilterResult => getRouteFilterResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRouteFilterInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getRouteFilter:getRouteFilter", args ?? new GetRouteFilterInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetRouteTable.cs b/sdk/dotnet/Network/GetRouteTable.cs index f386fcb174..75d36d4e48 100644 --- a/sdk/dotnet/Network/GetRouteTable.cs +++ b/sdk/dotnet/Network/GetRouteTable.cs @@ -13,12 +13,58 @@ public static class GetRouteTable { /// /// Use this data source to access information about an existing Route Table. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetRouteTable.Invoke(new() + /// { + /// Name = "myroutetable", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetRouteTableArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getRouteTable:getRouteTable", args ?? new GetRouteTableArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Route Table. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetRouteTable.Invoke(new() + /// { + /// Name = "myroutetable", + /// ResourceGroupName = "some-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetRouteTableInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getRouteTable:getRouteTable", args ?? new GetRouteTableInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetServiceTags.cs b/sdk/dotnet/Network/GetServiceTags.cs index d69009d157..99926fcc3e 100644 --- a/sdk/dotnet/Network/GetServiceTags.cs +++ b/sdk/dotnet/Network/GetServiceTags.cs @@ -13,12 +13,70 @@ public static class GetServiceTags { /// /// Use this data source to access information about Service Tags. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetServiceTags.Invoke(new() + /// { + /// Location = "westcentralus", + /// Service = "AzureKeyVault", + /// LocationFilter = "northeurope", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["addressPrefixes"] = example.Apply(getServiceTagsResult => getServiceTagsResult.AddressPrefixes), + /// ["ipv4Cidrs"] = example.Apply(getServiceTagsResult => getServiceTagsResult.Ipv4Cidrs), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceTagsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getServiceTags:getServiceTags", args ?? new GetServiceTagsArgs(), options.WithDefaults()); /// /// Use this data source to access information about Service Tags. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetServiceTags.Invoke(new() + /// { + /// Location = "westcentralus", + /// Service = "AzureKeyVault", + /// LocationFilter = "northeurope", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["addressPrefixes"] = example.Apply(getServiceTagsResult => getServiceTagsResult.AddressPrefixes), + /// ["ipv4Cidrs"] = example.Apply(getServiceTagsResult => getServiceTagsResult.Ipv4Cidrs), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceTagsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getServiceTags:getServiceTags", args ?? new GetServiceTagsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetSubnet.cs b/sdk/dotnet/Network/GetSubnet.cs index b5d6ce2209..df592f8afb 100644 --- a/sdk/dotnet/Network/GetSubnet.cs +++ b/sdk/dotnet/Network/GetSubnet.cs @@ -13,12 +13,68 @@ public static class GetSubnet { /// /// Use this data source to access information about an existing Subnet within a Virtual Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetSubnet.Invoke(new() + /// { + /// Name = "backend", + /// VirtualNetworkName = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["subnetId"] = example.Apply(getSubnetResult => getSubnetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSubnetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getSubnet:getSubnet", args ?? new GetSubnetArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Subnet within a Virtual Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetSubnet.Invoke(new() + /// { + /// Name = "backend", + /// VirtualNetworkName = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["subnetId"] = example.Apply(getSubnetResult => getSubnetResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSubnetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getSubnet:getSubnet", args ?? new GetSubnetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetTrafficManager.cs b/sdk/dotnet/Network/GetTrafficManager.cs index b97fab0a04..55376a3ca9 100644 --- a/sdk/dotnet/Network/GetTrafficManager.cs +++ b/sdk/dotnet/Network/GetTrafficManager.cs @@ -16,6 +16,29 @@ public static class GetTrafficManager /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### World) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetTrafficManager.Invoke(new() + /// { + /// Name = "World", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["locationCode"] = example.Apply(getTrafficManagerResult => getTrafficManagerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Task InvokeAsync(GetTrafficManagerArgs args, InvokeOptions? options = null) @@ -26,6 +49,29 @@ public static Task InvokeAsync(GetTrafficManagerArgs ar /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### World) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetTrafficManager.Invoke(new() + /// { + /// Name = "World", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["locationCode"] = example.Apply(getTrafficManagerResult => getTrafficManagerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Output Invoke(GetTrafficManagerInvokeArgs args, InvokeOptions? options = null) diff --git a/sdk/dotnet/Network/GetTrafficManagerProfile.cs b/sdk/dotnet/Network/GetTrafficManagerProfile.cs index 7c449c2a03..042d6b905f 100644 --- a/sdk/dotnet/Network/GetTrafficManagerProfile.cs +++ b/sdk/dotnet/Network/GetTrafficManagerProfile.cs @@ -13,12 +13,66 @@ public static class GetTrafficManagerProfile { /// /// Use this data source to access information about an existing Traffic Manager Profile. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetTrafficManagerProfile.Invoke(new() + /// { + /// Name = "test", + /// ResourceGroupName = "test", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["trafficRoutingMethod"] = example.Apply(getTrafficManagerProfileResult => getTrafficManagerProfileResult.TrafficRoutingMethod), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTrafficManagerProfileArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getTrafficManagerProfile:getTrafficManagerProfile", args ?? new GetTrafficManagerProfileArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Traffic Manager Profile. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetTrafficManagerProfile.Invoke(new() + /// { + /// Name = "test", + /// ResourceGroupName = "test", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["trafficRoutingMethod"] = example.Apply(getTrafficManagerProfileResult => getTrafficManagerProfileResult.TrafficRoutingMethod), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTrafficManagerProfileInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getTrafficManagerProfile:getTrafficManagerProfile", args ?? new GetTrafficManagerProfileInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetVirtualHub.cs b/sdk/dotnet/Network/GetVirtualHub.cs index f7f82b02b2..b9c952f4d2 100644 --- a/sdk/dotnet/Network/GetVirtualHub.cs +++ b/sdk/dotnet/Network/GetVirtualHub.cs @@ -13,12 +13,58 @@ public static class GetVirtualHub { /// /// Uses this data source to access information about an existing Virtual Hub. + /// + /// ## Virtual Hub Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualHub.Invoke(new() + /// { + /// Name = "example-hub", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualHubId"] = example.Apply(getVirtualHubResult => getVirtualHubResult.Id), + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetVirtualHubArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getVirtualHub:getVirtualHub", args ?? new GetVirtualHubArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing Virtual Hub. + /// + /// ## Virtual Hub Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualHub.Invoke(new() + /// { + /// Name = "example-hub", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualHubId"] = example.Apply(getVirtualHubResult => getVirtualHubResult.Id), + /// }; + /// }); + /// ``` /// public static Output Invoke(GetVirtualHubInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getVirtualHub:getVirtualHub", args ?? new GetVirtualHubInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetVirtualHubConnection.cs b/sdk/dotnet/Network/GetVirtualHubConnection.cs index 55be8d5da0..e30a46a2db 100644 --- a/sdk/dotnet/Network/GetVirtualHubConnection.cs +++ b/sdk/dotnet/Network/GetVirtualHubConnection.cs @@ -13,12 +13,60 @@ public static class GetVirtualHubConnection { /// /// Uses this data source to access information about an existing Virtual Hub Connection. + /// + /// ## Virtual Hub Connection Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualHubConnection.Invoke(new() + /// { + /// Name = "example-connection", + /// ResourceGroupName = "example-resources", + /// VirtualHubName = "example-hub-name", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualHubConnectionId"] = example.Apply(getVirtualHubConnectionResult => getVirtualHubConnectionResult.Id), + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetVirtualHubConnectionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getVirtualHubConnection:getVirtualHubConnection", args ?? new GetVirtualHubConnectionArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing Virtual Hub Connection. + /// + /// ## Virtual Hub Connection Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualHubConnection.Invoke(new() + /// { + /// Name = "example-connection", + /// ResourceGroupName = "example-resources", + /// VirtualHubName = "example-hub-name", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualHubConnectionId"] = example.Apply(getVirtualHubConnectionResult => getVirtualHubConnectionResult.Id), + /// }; + /// }); + /// ``` /// public static Output Invoke(GetVirtualHubConnectionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getVirtualHubConnection:getVirtualHubConnection", args ?? new GetVirtualHubConnectionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetVirtualHubRouteTable.cs b/sdk/dotnet/Network/GetVirtualHubRouteTable.cs index 0ae89a3110..873451c402 100644 --- a/sdk/dotnet/Network/GetVirtualHubRouteTable.cs +++ b/sdk/dotnet/Network/GetVirtualHubRouteTable.cs @@ -13,12 +13,60 @@ public static class GetVirtualHubRouteTable { /// /// Uses this data source to access information about an existing Virtual Hub Route Table. + /// + /// ## Virtual Hub Route Table Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualHubRouteTable.Invoke(new() + /// { + /// Name = "example-hub-route-table", + /// ResourceGroupName = "example-resources", + /// VirtualHubName = "example-hub-name", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualHubRouteTableId"] = example.Apply(getVirtualHubRouteTableResult => getVirtualHubRouteTableResult.Id), + /// }; + /// }); + /// ``` /// public static Task InvokeAsync(GetVirtualHubRouteTableArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getVirtualHubRouteTable:getVirtualHubRouteTable", args ?? new GetVirtualHubRouteTableArgs(), options.WithDefaults()); /// /// Uses this data source to access information about an existing Virtual Hub Route Table. + /// + /// ## Virtual Hub Route Table Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualHubRouteTable.Invoke(new() + /// { + /// Name = "example-hub-route-table", + /// ResourceGroupName = "example-resources", + /// VirtualHubName = "example-hub-name", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualHubRouteTableId"] = example.Apply(getVirtualHubRouteTableResult => getVirtualHubRouteTableResult.Id), + /// }; + /// }); + /// ``` /// public static Output Invoke(GetVirtualHubRouteTableInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getVirtualHubRouteTable:getVirtualHubRouteTable", args ?? new GetVirtualHubRouteTableInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetVirtualNetwork.cs b/sdk/dotnet/Network/GetVirtualNetwork.cs index 291fddbc6f..94f3d54917 100644 --- a/sdk/dotnet/Network/GetVirtualNetwork.cs +++ b/sdk/dotnet/Network/GetVirtualNetwork.cs @@ -13,12 +13,66 @@ public static class GetVirtualNetwork { /// /// Use this data source to access information about an existing Virtual Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualNetwork.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualNetworkId"] = example.Apply(getVirtualNetworkResult => getVirtualNetworkResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVirtualNetworkArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getVirtualNetwork:getVirtualNetwork", args ?? new GetVirtualNetworkArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Virtual Network. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualNetwork.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualNetworkId"] = example.Apply(getVirtualNetworkResult => getVirtualNetworkResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVirtualNetworkInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getVirtualNetwork:getVirtualNetwork", args ?? new GetVirtualNetworkInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetVirtualNetworkGateway.cs b/sdk/dotnet/Network/GetVirtualNetworkGateway.cs index 8f98672e9b..233e10a516 100644 --- a/sdk/dotnet/Network/GetVirtualNetworkGateway.cs +++ b/sdk/dotnet/Network/GetVirtualNetworkGateway.cs @@ -13,12 +13,66 @@ public static class GetVirtualNetworkGateway { /// /// Use this data source to access information about an existing Virtual Network Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualNetworkGateway.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualNetworkGatewayId"] = example.Apply(getVirtualNetworkGatewayResult => getVirtualNetworkGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVirtualNetworkGatewayArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getVirtualNetworkGateway:getVirtualNetworkGateway", args ?? new GetVirtualNetworkGatewayArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Virtual Network Gateway. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVirtualNetworkGateway.Invoke(new() + /// { + /// Name = "production", + /// ResourceGroupName = "networking", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["virtualNetworkGatewayId"] = example.Apply(getVirtualNetworkGatewayResult => getVirtualNetworkGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVirtualNetworkGatewayInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getVirtualNetworkGateway:getVirtualNetworkGateway", args ?? new GetVirtualNetworkGatewayInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/GetVpnGateway.cs b/sdk/dotnet/Network/GetVpnGateway.cs index 53cdeab702..66fd6a6430 100644 --- a/sdk/dotnet/Network/GetVpnGateway.cs +++ b/sdk/dotnet/Network/GetVpnGateway.cs @@ -13,12 +13,66 @@ public static class GetVpnGateway { /// /// Use this data source to access information about an existing VPN Gateway within a Virtual Hub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVpnGateway.Invoke(new() + /// { + /// Name = "existing-local-vpn_gateway", + /// ResourceGroupName = "existing-vpn_gateway", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermVpnGatewayId"] = example.Apply(getVpnGatewayResult => getVpnGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVpnGatewayArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:network/getVpnGateway:getVpnGateway", args ?? new GetVpnGatewayArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing VPN Gateway within a Virtual Hub. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetVpnGateway.Invoke(new() + /// { + /// Name = "existing-local-vpn_gateway", + /// ResourceGroupName = "existing-vpn_gateway", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["azurermVpnGatewayId"] = example.Apply(getVpnGatewayResult => getVpnGatewayResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVpnGatewayInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:network/getVpnGateway:getVpnGateway", args ?? new GetVpnGatewayInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Network/IPGroup.cs b/sdk/dotnet/Network/IPGroup.cs index 5657d352d3..c92ef89f6b 100644 --- a/sdk/dotnet/Network/IPGroup.cs +++ b/sdk/dotnet/Network/IPGroup.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.Network /// /// Manages an IP group that contains a list of CIDRs and/or IP addresses. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIPGroup = new Azure.Network.IPGroup("exampleIPGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Cidrs = new[] + /// { + /// "192.168.0.1", + /// "172.16.240.0/20", + /// "10.48.0.0/12", + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IP Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/IPGroupCIDR.cs b/sdk/dotnet/Network/IPGroupCIDR.cs index 501060379f..1e5feb8bba 100644 --- a/sdk/dotnet/Network/IPGroupCIDR.cs +++ b/sdk/dotnet/Network/IPGroupCIDR.cs @@ -16,6 +16,36 @@ namespace Pulumi.Azure.Network /// `azure.network.IPGroup` resource for the same IP Group. Doing so will cause a conflict and /// CIDRS will be removed. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleIPGroup = new Azure.Network.IPGroup("exampleIPGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleIPGroupCIDR = new Azure.Network.IPGroupCIDR("exampleIPGroupCIDR", new() + /// { + /// IpGroupId = exampleIPGroup.Id, + /// Cidr = "10.10.10.0/24", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// IP Group CIDRs can be imported using the `resource id` of the IP Group and the CIDR value (`/` characters have to be replaced by `_`), e.g. diff --git a/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationArgs.cs b/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationArgs.cs index 3ecab0c072..77c194ab7b 100644 --- a/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationArgs.cs +++ b/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationArgs.cs @@ -25,6 +25,16 @@ public sealed class ApplicationGatewayPrivateLinkConfigurationArgs : global::Pul /// One or more `ip_configuration` blocks as defined below. /// /// > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// public InputList IpConfigurations { diff --git a/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationGetArgs.cs b/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationGetArgs.cs index 4d0774b1d1..c400e15d6f 100644 --- a/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationGetArgs.cs +++ b/sdk/dotnet/Network/Inputs/ApplicationGatewayPrivateLinkConfigurationGetArgs.cs @@ -25,6 +25,16 @@ public sealed class ApplicationGatewayPrivateLinkConfigurationGetArgs : global:: /// One or more `ip_configuration` blocks as defined below. /// /// > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// public InputList IpConfigurations { diff --git a/sdk/dotnet/Network/LocalNetworkGateway.cs b/sdk/dotnet/Network/LocalNetworkGateway.cs index 599f4ca9b5..dfdc1c835e 100644 --- a/sdk/dotnet/Network/LocalNetworkGateway.cs +++ b/sdk/dotnet/Network/LocalNetworkGateway.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Network /// /// Manages a local network gateway connection over which specific connections can be configured. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var home = new Azure.Network.LocalNetworkGateway("home", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// GatewayAddress = "12.13.14.15", + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Local Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NatGateway.cs b/sdk/dotnet/Network/NatGateway.cs index b8ca8bc84a..d47408074b 100644 --- a/sdk/dotnet/Network/NatGateway.cs +++ b/sdk/dotnet/Network/NatGateway.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Network /// /// Manages an Azure NAT Gateway. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNatGateway = new Azure.Network.NatGateway("exampleNatGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// IdleTimeoutInMinutes = 10, + /// Zones = new[] + /// { + /// "1", + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// For more complete examples, please see the azure.network.NatGatewayPublicIpAssociation and azure.network.NatGatewayPublicIpPrefixAssociation resources. + /// /// ## Import /// /// NAT Gateway can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NatGatewayPublicIpAssociation.cs b/sdk/dotnet/Network/NatGatewayPublicIpAssociation.cs index 53cb2f0bab..638f26d2dc 100644 --- a/sdk/dotnet/Network/NatGatewayPublicIpAssociation.cs +++ b/sdk/dotnet/Network/NatGatewayPublicIpAssociation.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.Network /// /// Manages the association between a NAT Gateway and a Public IP. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleNatGateway = new Azure.Network.NatGateway("exampleNatGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleNatGatewayPublicIpAssociation = new Azure.Network.NatGatewayPublicIpAssociation("exampleNatGatewayPublicIpAssociation", new() + /// { + /// NatGatewayId = exampleNatGateway.Id, + /// PublicIpAddressId = examplePublicIp.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between NAT Gateway and Public IP Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NatGatewayPublicIpPrefixAssociation.cs b/sdk/dotnet/Network/NatGatewayPublicIpPrefixAssociation.cs index a02b5f01e2..87a1773eaf 100644 --- a/sdk/dotnet/Network/NatGatewayPublicIpPrefixAssociation.cs +++ b/sdk/dotnet/Network/NatGatewayPublicIpPrefixAssociation.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.Network /// /// Manages the association between a NAT Gateway and a Public IP Prefix. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIpPrefix = new Azure.Network.PublicIpPrefix("examplePublicIpPrefix", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PrefixLength = 30, + /// Zones = new[] + /// { + /// "1", + /// }, + /// }); + /// + /// var exampleNatGateway = new Azure.Network.NatGateway("exampleNatGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// }); + /// + /// var exampleNatGatewayPublicIpPrefixAssociation = new Azure.Network.NatGatewayPublicIpPrefixAssociation("exampleNatGatewayPublicIpPrefixAssociation", new() + /// { + /// NatGatewayId = exampleNatGateway.Id, + /// PublicIpPrefixId = examplePublicIpPrefix.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between NAT Gateway and Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkConnectionMonitor.cs b/sdk/dotnet/Network/NetworkConnectionMonitor.cs index 997497bba8..89875091f3 100644 --- a/sdk/dotnet/Network/NetworkConnectionMonitor.cs +++ b/sdk/dotnet/Network/NetworkConnectionMonitor.cs @@ -14,6 +14,190 @@ namespace Pulumi.Azure.Network /// /// > **NOTE:** Any Network Connection Monitor resource created with API versions 2019-06-01 or earlier (v1) are now incompatible with this provider, which now only supports v2. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkWatcher = new Azure.Network.NetworkWatcher("exampleNetworkWatcher", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleVirtualMachine = new Azure.Compute.VirtualMachine("exampleVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// VmSize = "Standard_D2s_v3", + /// StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs + /// { + /// Name = "osdisk-example01", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Standard_LRS", + /// }, + /// OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs + /// { + /// ComputerName = "hostnametest01", + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = false, + /// }, + /// }); + /// + /// var exampleExtension = new Azure.Compute.Extension("exampleExtension", new() + /// { + /// VirtualMachineId = exampleVirtualMachine.Id, + /// Publisher = "Microsoft.Azure.NetworkWatcher", + /// Type = "NetworkWatcherAgentLinux", + /// TypeHandlerVersion = "1.4", + /// AutoUpgradeMinorVersion = true, + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleNetworkConnectionMonitor = new Azure.Network.NetworkConnectionMonitor("exampleNetworkConnectionMonitor", new() + /// { + /// NetworkWatcherId = exampleNetworkWatcher.Id, + /// Location = exampleNetworkWatcher.Location, + /// Endpoints = new[] + /// { + /// new Azure.Network.Inputs.NetworkConnectionMonitorEndpointArgs + /// { + /// Name = "source", + /// TargetResourceId = exampleVirtualMachine.Id, + /// Filter = new Azure.Network.Inputs.NetworkConnectionMonitorEndpointFilterArgs + /// { + /// Items = new[] + /// { + /// new Azure.Network.Inputs.NetworkConnectionMonitorEndpointFilterItemArgs + /// { + /// Address = exampleVirtualMachine.Id, + /// Type = "AgentAddress", + /// }, + /// }, + /// Type = "Include", + /// }, + /// }, + /// new Azure.Network.Inputs.NetworkConnectionMonitorEndpointArgs + /// { + /// Name = "destination", + /// Address = "mycompany.io", + /// }, + /// }, + /// TestConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkConnectionMonitorTestConfigurationArgs + /// { + /// Name = "tcpName", + /// Protocol = "Tcp", + /// TestFrequencyInSeconds = 60, + /// TcpConfiguration = new Azure.Network.Inputs.NetworkConnectionMonitorTestConfigurationTcpConfigurationArgs + /// { + /// Port = 80, + /// }, + /// }, + /// }, + /// TestGroups = new[] + /// { + /// new Azure.Network.Inputs.NetworkConnectionMonitorTestGroupArgs + /// { + /// Name = "exampletg", + /// DestinationEndpoints = new[] + /// { + /// "destination", + /// }, + /// SourceEndpoints = new[] + /// { + /// "source", + /// }, + /// TestConfigurationNames = new[] + /// { + /// "tcpName", + /// }, + /// }, + /// }, + /// Notes = "examplenote", + /// OutputWorkspaceResourceIds = new[] + /// { + /// exampleAnalyticsWorkspace.Id, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleExtension, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Connection Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkInterface.cs b/sdk/dotnet/Network/NetworkInterface.cs index eb977db4b6..fc6866a2e7 100644 --- a/sdk/dotnet/Network/NetworkInterface.cs +++ b/sdk/dotnet/Network/NetworkInterface.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Interface. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Interfaces can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkInterfaceApplicationSecurityGroupAssociation.cs b/sdk/dotnet/Network/NetworkInterfaceApplicationSecurityGroupAssociation.cs index 1e22ffb4f1..899b3d8704 100644 --- a/sdk/dotnet/Network/NetworkInterfaceApplicationSecurityGroupAssociation.cs +++ b/sdk/dotnet/Network/NetworkInterfaceApplicationSecurityGroupAssociation.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.Network /// /// Manages the association between a Network Interface and a Application Security Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var exampleApplicationSecurityGroup = new Azure.Network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleNetworkInterfaceApplicationSecurityGroupAssociation = new Azure.Network.NetworkInterfaceApplicationSecurityGroupAssociation("exampleNetworkInterfaceApplicationSecurityGroupAssociation", new() + /// { + /// NetworkInterfaceId = exampleNetworkInterface.Id, + /// ApplicationSecurityGroupId = exampleApplicationSecurityGroup.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between Network Interfaces and Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkInterfaceBackendAddressPoolAssociation.cs b/sdk/dotnet/Network/NetworkInterfaceBackendAddressPoolAssociation.cs index 71c1926441..02bc4f2a9a 100644 --- a/sdk/dotnet/Network/NetworkInterfaceBackendAddressPoolAssociation.cs +++ b/sdk/dotnet/Network/NetworkInterfaceBackendAddressPoolAssociation.cs @@ -12,6 +12,92 @@ namespace Pulumi.Azure.Network /// /// Manages the association between a Network Interface and a Load Balancer's Backend Address Pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "primary", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleBackendAddressPool = new Azure.Lb.BackendAddressPool("exampleBackendAddressPool", new() + /// { + /// LoadbalancerId = exampleLoadBalancer.Id, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleNetworkInterfaceBackendAddressPoolAssociation = new Azure.Network.NetworkInterfaceBackendAddressPoolAssociation("exampleNetworkInterfaceBackendAddressPoolAssociation", new() + /// { + /// NetworkInterfaceId = exampleNetworkInterface.Id, + /// IpConfigurationName = "testconfiguration1", + /// BackendAddressPoolId = exampleBackendAddressPool.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between Network Interfaces and Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkInterfaceNatRuleAssociation.cs b/sdk/dotnet/Network/NetworkInterfaceNatRuleAssociation.cs index 2e10da104f..8f411e4e2e 100644 --- a/sdk/dotnet/Network/NetworkInterfaceNatRuleAssociation.cs +++ b/sdk/dotnet/Network/NetworkInterfaceNatRuleAssociation.cs @@ -12,6 +12,97 @@ namespace Pulumi.Azure.Network /// /// Manages the association between a Network Interface and a Load Balancer's NAT Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = "primary", + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleNatRule = new Azure.Lb.NatRule("exampleNatRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// LoadbalancerId = exampleLoadBalancer.Id, + /// Protocol = "Tcp", + /// FrontendPort = 3389, + /// BackendPort = 3389, + /// FrontendIpConfigurationName = "primary", + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleNetworkInterfaceNatRuleAssociation = new Azure.Network.NetworkInterfaceNatRuleAssociation("exampleNetworkInterfaceNatRuleAssociation", new() + /// { + /// NetworkInterfaceId = exampleNetworkInterface.Id, + /// IpConfigurationName = "testconfiguration1", + /// NatRuleId = exampleNatRule.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between Network Interfaces and Load Balancer NAT Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkInterfaceSecurityGroupAssociation.cs b/sdk/dotnet/Network/NetworkInterfaceSecurityGroupAssociation.cs index e71c38a43b..b7146a6996 100644 --- a/sdk/dotnet/Network/NetworkInterfaceSecurityGroupAssociation.cs +++ b/sdk/dotnet/Network/NetworkInterfaceSecurityGroupAssociation.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.Network /// /// Manages the association between a Network Interface and a Network Security Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleNetworkInterfaceSecurityGroupAssociation = new Azure.Network.NetworkInterfaceSecurityGroupAssociation("exampleNetworkInterfaceSecurityGroupAssociation", new() + /// { + /// NetworkInterfaceId = exampleNetworkInterface.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between Network Interfaces and Network Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManager.cs b/sdk/dotnet/Network/NetworkManager.cs index 06793afc05..6222e1e656 100644 --- a/sdk/dotnet/Network/NetworkManager.cs +++ b/sdk/dotnet/Network/NetworkManager.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Managers. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "Connectivity", + /// "SecurityAdmin", + /// }, + /// Description = "example network manager", + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Managers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerAdminRule.cs b/sdk/dotnet/Network/NetworkManagerAdminRule.cs index 00ac71bfdd..6e10f55ae3 100644 --- a/sdk/dotnet/Network/NetworkManagerAdminRule.cs +++ b/sdk/dotnet/Network/NetworkManagerAdminRule.cs @@ -12,6 +12,104 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Manager Admin Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "Connectivity", + /// "SecurityAdmin", + /// }, + /// Description = "example network manager", + /// }); + /// + /// var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// }); + /// + /// var exampleNetworkManagerSecurityAdminConfiguration = new Azure.Network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// }); + /// + /// var exampleNetworkManagerAdminRuleCollection = new Azure.Network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", new() + /// { + /// SecurityAdminConfigurationId = exampleNetworkManagerSecurityAdminConfiguration.Id, + /// NetworkGroupIds = new[] + /// { + /// exampleNetworkManagerNetworkGroup.Id, + /// }, + /// }); + /// + /// var exampleNetworkManagerAdminRule = new Azure.Network.NetworkManagerAdminRule("exampleNetworkManagerAdminRule", new() + /// { + /// AdminRuleCollectionId = exampleNetworkManagerAdminRuleCollection.Id, + /// Action = "Deny", + /// Direction = "Outbound", + /// Priority = 1, + /// Protocol = "Tcp", + /// SourcePortRanges = new[] + /// { + /// "80", + /// "1024-65535", + /// }, + /// DestinationPortRanges = new[] + /// { + /// "80", + /// }, + /// Sources = new[] + /// { + /// new Azure.Network.Inputs.NetworkManagerAdminRuleSourceArgs + /// { + /// AddressPrefixType = "ServiceTag", + /// AddressPrefix = "Internet", + /// }, + /// }, + /// Destinations = new[] + /// { + /// new Azure.Network.Inputs.NetworkManagerAdminRuleDestinationArgs + /// { + /// AddressPrefixType = "IPPrefix", + /// AddressPrefix = "10.1.0.1", + /// }, + /// new Azure.Network.Inputs.NetworkManagerAdminRuleDestinationArgs + /// { + /// AddressPrefixType = "IPPrefix", + /// AddressPrefix = "10.0.0.0/24", + /// }, + /// }, + /// Description = "example admin rule", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Admin Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerAdminRuleCollection.cs b/sdk/dotnet/Network/NetworkManagerAdminRuleCollection.cs index 08072c859e..93bbee6a64 100644 --- a/sdk/dotnet/Network/NetworkManagerAdminRuleCollection.cs +++ b/sdk/dotnet/Network/NetworkManagerAdminRuleCollection.cs @@ -12,6 +12,64 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Manager Admin Rule Collection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "Connectivity", + /// "SecurityAdmin", + /// }, + /// Description = "example network manager", + /// }); + /// + /// var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// }); + /// + /// var exampleNetworkManagerSecurityAdminConfiguration = new Azure.Network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// }); + /// + /// var exampleNetworkManagerAdminRuleCollection = new Azure.Network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", new() + /// { + /// SecurityAdminConfigurationId = exampleNetworkManagerSecurityAdminConfiguration.Id, + /// NetworkGroupIds = new[] + /// { + /// exampleNetworkManagerNetworkGroup.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Admin Rule Collection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerConnectivityConfiguration.cs b/sdk/dotnet/Network/NetworkManagerConnectivityConfiguration.cs index c3b1b0c284..fc9790e6e7 100644 --- a/sdk/dotnet/Network/NetworkManagerConnectivityConfiguration.cs +++ b/sdk/dotnet/Network/NetworkManagerConnectivityConfiguration.cs @@ -14,6 +14,80 @@ namespace Pulumi.Azure.Network /// /// > **Note:** The `azure.network.NetworkManagerConnectivityConfiguration` deployment may modify or delete existing Network Peering resource. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "Connectivity", + /// "SecurityAdmin", + /// }, + /// Description = "example network manager", + /// }); + /// + /// var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// FlowTimeoutInMinutes = 10, + /// }); + /// + /// var exampleNetworkManagerConnectivityConfiguration = new Azure.Network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// ConnectivityTopology = "HubAndSpoke", + /// AppliesToGroups = new[] + /// { + /// new Azure.Network.Inputs.NetworkManagerConnectivityConfigurationAppliesToGroupArgs + /// { + /// GroupConnectivity = "DirectlyConnected", + /// NetworkGroupId = exampleNetworkManagerNetworkGroup.Id, + /// }, + /// }, + /// Hub = new Azure.Network.Inputs.NetworkManagerConnectivityConfigurationHubArgs + /// { + /// ResourceId = exampleVirtualNetwork.Id, + /// ResourceType = "Microsoft.Network/virtualNetworks", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Connectivity Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerDeployment.cs b/sdk/dotnet/Network/NetworkManagerDeployment.cs index 77bc57dc0b..7987966b00 100644 --- a/sdk/dotnet/Network/NetworkManagerDeployment.cs +++ b/sdk/dotnet/Network/NetworkManagerDeployment.cs @@ -14,6 +14,91 @@ namespace Pulumi.Azure.Network /// /// > **NOTE on Virtual Network Peering:** Using Network Manager Deployment to deploy Connectivity Configuration may modify or delete existing Virtual Network Peering. At this time you should not use Network Peering resource in conjunction with Network Manager Deployment. Doing so may cause a conflict of Peering configurations. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "Connectivity", + /// "SecurityAdmin", + /// }, + /// Description = "example network manager", + /// }); + /// + /// var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// FlowTimeoutInMinutes = 10, + /// }); + /// + /// var exampleNetworkManagerConnectivityConfiguration = new Azure.Network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// ConnectivityTopology = "HubAndSpoke", + /// AppliesToGroups = new[] + /// { + /// new Azure.Network.Inputs.NetworkManagerConnectivityConfigurationAppliesToGroupArgs + /// { + /// GroupConnectivity = "None", + /// NetworkGroupId = exampleNetworkManagerNetworkGroup.Id, + /// }, + /// }, + /// Hub = new Azure.Network.Inputs.NetworkManagerConnectivityConfigurationHubArgs + /// { + /// ResourceId = exampleVirtualNetwork.Id, + /// ResourceType = "Microsoft.Network/virtualNetworks", + /// }, + /// }); + /// + /// var exampleNetworkManagerDeployment = new Azure.Network.NetworkManagerDeployment("exampleNetworkManagerDeployment", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// Location = "eastus", + /// ScopeAccess = "Connectivity", + /// ConfigurationIds = new[] + /// { + /// exampleNetworkManagerConnectivityConfiguration.Id, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerManagementGroupConnection.cs b/sdk/dotnet/Network/NetworkManagerManagementGroupConnection.cs index 6798d84307..55aefd0969 100644 --- a/sdk/dotnet/Network/NetworkManagerManagementGroupConnection.cs +++ b/sdk/dotnet/Network/NetworkManagerManagementGroupConnection.cs @@ -12,6 +12,78 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Manager Management Group Connection which may cross tenants. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleGroup = new Azure.Management.Group("exampleGroup"); + /// + /// var alt = Azure.Core.GetSubscription.Invoke(new() + /// { + /// SubscriptionId = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// var exampleGroupSubscriptionAssociation = new Azure.Management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", new() + /// { + /// ManagementGroupId = exampleGroup.Id, + /// SubscriptionId = alt.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }); + /// + /// var currentSubscription = Azure.Core.GetSubscription.Invoke(); + /// + /// var currentClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var networkContributor = new Azure.Authorization.Assignment("networkContributor", new() + /// { + /// Scope = exampleGroup.Id, + /// RoleDefinitionName = "Network Contributor", + /// PrincipalId = currentClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// currentSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "SecurityAdmin", + /// }, + /// }); + /// + /// var exampleNetworkManagerManagementGroupConnection = new Azure.Network.NetworkManagerManagementGroupConnection("exampleNetworkManagerManagementGroupConnection", new() + /// { + /// ManagementGroupId = exampleGroup.Id, + /// NetworkManagerId = exampleNetworkManager.Id, + /// Description = "example", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// networkContributor, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Management Group Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerNetworkGroup.cs b/sdk/dotnet/Network/NetworkManagerNetworkGroup.cs index 35c22a24b2..6014891f01 100644 --- a/sdk/dotnet/Network/NetworkManagerNetworkGroup.cs +++ b/sdk/dotnet/Network/NetworkManagerNetworkGroup.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Manager Network Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "Connectivity", + /// "SecurityAdmin", + /// }, + /// Description = "example network manager", + /// }); + /// + /// var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Network Group can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerScopeConnection.cs b/sdk/dotnet/Network/NetworkManagerScopeConnection.cs index 6d5174384f..1d182cbe49 100644 --- a/sdk/dotnet/Network/NetworkManagerScopeConnection.cs +++ b/sdk/dotnet/Network/NetworkManagerScopeConnection.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Manager Scope Connection which may cross tenants. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var currentClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var currentSubscription = Azure.Core.GetSubscription.Invoke(); + /// + /// var alt = Azure.Core.GetSubscription.Invoke(new() + /// { + /// SubscriptionId = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// currentSubscription.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "SecurityAdmin", + /// }, + /// }); + /// + /// var exampleNetworkManagerScopeConnection = new Azure.Network.NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// TenantId = currentClientConfig.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// TargetScopeId = alt.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Description = "example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Scope Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerStaticMember.cs b/sdk/dotnet/Network/NetworkManagerStaticMember.cs index c90eac14b1..f201a51591 100644 --- a/sdk/dotnet/Network/NetworkManagerStaticMember.cs +++ b/sdk/dotnet/Network/NetworkManagerStaticMember.cs @@ -12,6 +12,67 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Manager Static Member. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "Connectivity", + /// "SecurityAdmin", + /// }, + /// Description = "example network manager", + /// }); + /// + /// var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", new() + /// { + /// NetworkManagerId = exampleNetworkManager.Id, + /// Description = "example network group", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleNetworkManagerStaticMember = new Azure.Network.NetworkManagerStaticMember("exampleNetworkManagerStaticMember", new() + /// { + /// NetworkGroupId = exampleNetworkManagerNetworkGroup.Id, + /// TargetVirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Manager Static Member can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkManagerSubscriptionConnection.cs b/sdk/dotnet/Network/NetworkManagerSubscriptionConnection.cs index 83da80fd54..3c2318bcd4 100644 --- a/sdk/dotnet/Network/NetworkManagerSubscriptionConnection.cs +++ b/sdk/dotnet/Network/NetworkManagerSubscriptionConnection.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Manager Subscription Connection which may cross tenants. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleNetworkManager = new Azure.Network.NetworkManager("exampleNetworkManager", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs + /// { + /// SubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }, + /// ScopeAccesses = new[] + /// { + /// "SecurityAdmin", + /// }, + /// }); + /// + /// var exampleNetworkManagerSubscriptionConnection = new Azure.Network.NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", new() + /// { + /// SubscriptionId = current.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// NetworkManagerId = exampleNetworkManager.Id, + /// Description = "example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Subscription Network Manager Connection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkPacketCapture.cs b/sdk/dotnet/Network/NetworkPacketCapture.cs index 0ab00dd4a1..6eca1d5740 100644 --- a/sdk/dotnet/Network/NetworkPacketCapture.cs +++ b/sdk/dotnet/Network/NetworkPacketCapture.cs @@ -14,6 +14,136 @@ namespace Pulumi.Azure.Network /// /// !> **NOTE:** The `azure.network.NetworkPacketCapture` resource is deprecated and will be removed in favour of `azure.compute.PacketCapture` and `azure.compute.ScaleSetPacketCapture` in version 4.0 of the AzureRM Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkWatcher = new Azure.Network.NetworkWatcher("exampleNetworkWatcher", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "testconfiguration1", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleVirtualMachine = new Azure.Compute.VirtualMachine("exampleVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// VmSize = "Standard_F2", + /// StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs + /// { + /// Name = "osdisk", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Standard_LRS", + /// }, + /// OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs + /// { + /// ComputerName = "pctest-vm", + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = false, + /// }, + /// }); + /// + /// var exampleExtension = new Azure.Compute.Extension("exampleExtension", new() + /// { + /// VirtualMachineId = exampleVirtualMachine.Id, + /// Publisher = "Microsoft.Azure.NetworkWatcher", + /// Type = "NetworkWatcherAgentLinux", + /// TypeHandlerVersion = "1.4", + /// AutoUpgradeMinorVersion = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleNetworkPacketCapture = new Azure.Network.NetworkPacketCapture("exampleNetworkPacketCapture", new() + /// { + /// NetworkWatcherName = exampleNetworkWatcher.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TargetResourceId = exampleVirtualMachine.Id, + /// StorageLocation = new Azure.Network.Inputs.NetworkPacketCaptureStorageLocationArgs + /// { + /// StorageAccountId = exampleAccount.Id, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleExtension, + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `azure.compute.Extension` resource. + /// /// ## Import /// /// Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkSecurityGroup.cs b/sdk/dotnet/Network/NetworkSecurityGroup.cs index edef3a9b88..6be9ed68b4 100644 --- a/sdk/dotnet/Network/NetworkSecurityGroup.cs +++ b/sdk/dotnet/Network/NetworkSecurityGroup.cs @@ -16,6 +16,49 @@ namespace Pulumi.Azure.Network /// provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. /// At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SecurityRules = new[] + /// { + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "test123", + /// Priority = 100, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkSecurityRule.cs b/sdk/dotnet/Network/NetworkSecurityRule.cs index e7c6f4b635..e0dedbdedf 100644 --- a/sdk/dotnet/Network/NetworkSecurityRule.cs +++ b/sdk/dotnet/Network/NetworkSecurityRule.cs @@ -16,6 +16,44 @@ namespace Pulumi.Azure.Network /// provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. /// At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNetworkSecurityRule = new Azure.Network.NetworkSecurityRule("exampleNetworkSecurityRule", new() + /// { + /// Priority = 100, + /// Direction = "Outbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Security Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkWatcher.cs b/sdk/dotnet/Network/NetworkWatcher.cs index c9f0fe80e0..29525be77e 100644 --- a/sdk/dotnet/Network/NetworkWatcher.cs +++ b/sdk/dotnet/Network/NetworkWatcher.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Watcher. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkWatcher = new Azure.Network.NetworkWatcher("exampleNetworkWatcher", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/NetworkWatcherFlowLog.cs b/sdk/dotnet/Network/NetworkWatcherFlowLog.cs index 2212e03170..719eb167d0 100644 --- a/sdk/dotnet/Network/NetworkWatcherFlowLog.cs +++ b/sdk/dotnet/Network/NetworkWatcherFlowLog.cs @@ -10,6 +10,75 @@ namespace Pulumi.Azure.Network { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var testNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("testNetworkSecurityGroup", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// }); + /// + /// var testNetworkWatcher = new Azure.Network.NetworkWatcher("testNetworkWatcher", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// }); + /// + /// var testAccount = new Azure.Storage.Account("testAccount", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// AccountTier = "Standard", + /// AccountKind = "StorageV2", + /// AccountReplicationType = "LRS", + /// EnableHttpsTrafficOnly = true, + /// }); + /// + /// var testAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("testAnalyticsWorkspace", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var testNetworkWatcherFlowLog = new Azure.Network.NetworkWatcherFlowLog("testNetworkWatcherFlowLog", new() + /// { + /// NetworkWatcherName = testNetworkWatcher.Name, + /// ResourceGroupName = example.Name, + /// NetworkSecurityGroupId = testNetworkSecurityGroup.Id, + /// StorageAccountId = testAccount.Id, + /// Enabled = true, + /// RetentionPolicy = new Azure.Network.Inputs.NetworkWatcherFlowLogRetentionPolicyArgs + /// { + /// Enabled = true, + /// Days = 7, + /// }, + /// TrafficAnalytics = new Azure.Network.Inputs.NetworkWatcherFlowLogTrafficAnalyticsArgs + /// { + /// Enabled = true, + /// WorkspaceId = testAnalyticsWorkspace.WorkspaceId, + /// WorkspaceRegion = testAnalyticsWorkspace.Location, + /// WorkspaceResourceId = testAnalyticsWorkspace.Id, + /// IntervalInMinutes = 10, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Watcher Flow Logs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/Outputs/ApplicationGatewayPrivateLinkConfiguration.cs b/sdk/dotnet/Network/Outputs/ApplicationGatewayPrivateLinkConfiguration.cs index f33024e510..0887dfacd6 100644 --- a/sdk/dotnet/Network/Outputs/ApplicationGatewayPrivateLinkConfiguration.cs +++ b/sdk/dotnet/Network/Outputs/ApplicationGatewayPrivateLinkConfiguration.cs @@ -21,6 +21,16 @@ public sealed class ApplicationGatewayPrivateLinkConfiguration /// One or more `ip_configuration` blocks as defined below. /// /// > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// public readonly ImmutableArray IpConfigurations; /// diff --git a/sdk/dotnet/Network/PointToPointVpnGateway.cs b/sdk/dotnet/Network/PointToPointVpnGateway.cs index 00181df196..1b34cedead 100644 --- a/sdk/dotnet/Network/PointToPointVpnGateway.cs +++ b/sdk/dotnet/Network/PointToPointVpnGateway.cs @@ -12,6 +12,96 @@ namespace Pulumi.Azure.Network /// /// Manages a Point-to-Site VPN Gateway. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.0.0/23", + /// }); + /// + /// var exampleVpnServerConfiguration = new Azure.Network.VpnServerConfiguration("exampleVpnServerConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VpnAuthenticationTypes = new[] + /// { + /// "Certificate", + /// }, + /// ClientRootCertificates = new[] + /// { + /// new Azure.Network.Inputs.VpnServerConfigurationClientRootCertificateArgs + /// { + /// Name = "DigiCert-Federated-ID-Root-CA", + /// PublicCertData = @"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + /// MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + /// d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + /// Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + /// BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + /// Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + /// MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + /// QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + /// zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + /// GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + /// GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + /// Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + /// DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + /// HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + /// jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + /// 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + /// QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + /// uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + /// WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + /// M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + /// ", + /// }, + /// }, + /// }); + /// + /// var examplePointToPointVpnGateway = new Azure.Network.PointToPointVpnGateway("examplePointToPointVpnGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualHubId = exampleVirtualHub.Id, + /// VpnServerConfigurationId = exampleVpnServerConfiguration.Id, + /// ScaleUnit = 1, + /// ConnectionConfiguration = new Azure.Network.Inputs.PointToPointVpnGatewayConnectionConfigurationArgs + /// { + /// Name = "example-gateway-config", + /// VpnClientAddressPool = new Azure.Network.Inputs.PointToPointVpnGatewayConnectionConfigurationVpnClientAddressPoolArgs + /// { + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Point-to-Site VPN Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/Profile.cs b/sdk/dotnet/Network/Profile.cs index f4ee461ce1..8431fe333f 100644 --- a/sdk/dotnet/Network/Profile.cs +++ b/sdk/dotnet/Network/Profile.cs @@ -12,6 +12,77 @@ namespace Pulumi.Azure.Network /// /// Manages a Network Profile. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.1.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.1.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "delegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.ContainerInstance/containerGroups", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleProfile = new Azure.Network.Profile("exampleProfile", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// ContainerNetworkInterface = new Azure.Network.Inputs.ProfileContainerNetworkInterfaceArgs + /// { + /// Name = "examplecnic", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.ProfileContainerNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "exampleipconfig", + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Profile can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/PublicIp.cs b/sdk/dotnet/Network/PublicIp.cs index ad312bd32a..1e5c6aceca 100644 --- a/sdk/dotnet/Network/PublicIp.cs +++ b/sdk/dotnet/Network/PublicIp.cs @@ -14,6 +14,35 @@ namespace Pulumi.Azure.Network /// /// > **Note** If this resource is to be associated with a resource that requires disassociation before destruction (such as `azure.network.NetworkInterface`) it is recommended to set the `lifecycle` argument `create_before_destroy = true`. Otherwise, it can fail to disassociate on destruction. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllocationMethod = "Static", + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Public IPs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/PublicIpPrefix.cs b/sdk/dotnet/Network/PublicIpPrefix.cs index 06d743de53..0eda1017b6 100644 --- a/sdk/dotnet/Network/PublicIpPrefix.cs +++ b/sdk/dotnet/Network/PublicIpPrefix.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Network /// /// Manages a Public IP Prefix. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIpPrefix = new Azure.Network.PublicIpPrefix("examplePublicIpPrefix", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PrefixLength = 31, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/Route.cs b/sdk/dotnet/Network/Route.cs index 81bf5b0dd9..1afe5d9a33 100644 --- a/sdk/dotnet/Network/Route.cs +++ b/sdk/dotnet/Network/Route.cs @@ -16,6 +16,38 @@ namespace Pulumi.Azure.Network /// provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource. /// At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleRoute = new Azure.Network.Route("exampleRoute", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RouteTableName = exampleRouteTable.Name, + /// AddressPrefix = "10.1.0.0/16", + /// NextHopType = "VnetLocal", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Routes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/RouteFilter.cs b/sdk/dotnet/Network/RouteFilter.cs index a968ade9d1..8919c7914b 100644 --- a/sdk/dotnet/Network/RouteFilter.cs +++ b/sdk/dotnet/Network/RouteFilter.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Network /// /// Manages a Route Filter. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Network.RouteFilter("example", new() + /// { + /// Location = "East US", + /// ResourceGroupName = "example", + /// Rule = new Azure.Network.Inputs.RouteFilterRuleArgs + /// { + /// Access = "Allow", + /// Communities = new[] + /// { + /// "12076:52004", + /// }, + /// Name = "rule", + /// RuleType = "Community", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Route Filters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/RouteMap.cs b/sdk/dotnet/Network/RouteMap.cs index 2a9064d62c..1590519f7b 100644 --- a/sdk/dotnet/Network/RouteMap.cs +++ b/sdk/dotnet/Network/RouteMap.cs @@ -12,6 +12,79 @@ namespace Pulumi.Azure.Network /// /// Manages a Route Map. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.1.0/24", + /// }); + /// + /// var exampleRouteMap = new Azure.Network.RouteMap("exampleRouteMap", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// Rules = new[] + /// { + /// new Azure.Network.Inputs.RouteMapRuleArgs + /// { + /// Name = "rule1", + /// NextStepIfMatched = "Continue", + /// Actions = new[] + /// { + /// new Azure.Network.Inputs.RouteMapRuleActionArgs + /// { + /// Type = "Add", + /// Parameters = new[] + /// { + /// new Azure.Network.Inputs.RouteMapRuleActionParameterArgs + /// { + /// AsPaths = new[] + /// { + /// "22334", + /// }, + /// }, + /// }, + /// }, + /// }, + /// MatchCriterions = new[] + /// { + /// new Azure.Network.Inputs.RouteMapRuleMatchCriterionArgs + /// { + /// MatchCondition = "Contains", + /// RoutePrefixes = new[] + /// { + /// "10.0.0.0/8", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Route Maps can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/RouteServer.cs b/sdk/dotnet/Network/RouteServer.cs index 8e855adc33..aec84e93d5 100644 --- a/sdk/dotnet/Network/RouteServer.cs +++ b/sdk/dotnet/Network/RouteServer.cs @@ -12,6 +12,66 @@ namespace Pulumi.Azure.Network /// /// Manages an Azure Route Server /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleRouteServer = new Azure.Network.RouteServer("exampleRouteServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard", + /// PublicIpAddressId = examplePublicIp.Id, + /// SubnetId = exampleSubnet.Id, + /// BranchToBranchTrafficEnabled = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Route Server can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/RouteServerBgpConnection.cs b/sdk/dotnet/Network/RouteServerBgpConnection.cs index 54d7bb2d4e..b73a825afa 100644 --- a/sdk/dotnet/Network/RouteServerBgpConnection.cs +++ b/sdk/dotnet/Network/RouteServerBgpConnection.cs @@ -12,6 +12,73 @@ namespace Pulumi.Azure.Network /// /// Manages a Bgp Connection for a Route Server /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleRouteServer = new Azure.Network.RouteServer("exampleRouteServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard", + /// PublicIpAddressId = examplePublicIp.Id, + /// SubnetId = exampleSubnet.Id, + /// BranchToBranchTrafficEnabled = true, + /// }); + /// + /// var exampleRouteServerBgpConnection = new Azure.Network.RouteServerBgpConnection("exampleRouteServerBgpConnection", new() + /// { + /// RouteServerId = exampleRouteServer.Id, + /// PeerAsn = 65501, + /// PeerIp = "169.254.21.5", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Route Server Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/RouteTable.cs b/sdk/dotnet/Network/RouteTable.cs index e47971294f..c38cbcf678 100644 --- a/sdk/dotnet/Network/RouteTable.cs +++ b/sdk/dotnet/Network/RouteTable.cs @@ -15,6 +15,44 @@ namespace Pulumi.Azure.Network /// > **NOTE on Route Tables and Routes:** There is both a standalone `route` resource, and allows for Routes to be defined in-line within the `route_table` resource. /// At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DisableBgpRoutePropagation = false, + /// Routes = new[] + /// { + /// new Azure.Network.Inputs.RouteTableRouteArgs + /// { + /// Name = "route1", + /// AddressPrefix = "10.1.0.0/16", + /// NextHopType = "VnetLocal", + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/RoutingIntent.cs b/sdk/dotnet/Network/RoutingIntent.cs index ea87812efb..9ea8ecd9e1 100644 --- a/sdk/dotnet/Network/RoutingIntent.cs +++ b/sdk/dotnet/Network/RoutingIntent.cs @@ -12,6 +12,68 @@ namespace Pulumi.Azure.Network /// /// Manages a Virtual Hub Routing Intent. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.1.0/24", + /// }); + /// + /// var exampleFirewall = new Azure.Network.Firewall("exampleFirewall", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "AZFW_Hub", + /// SkuTier = "Standard", + /// VirtualHub = new Azure.Network.Inputs.FirewallVirtualHubArgs + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// PublicIpCount = 1, + /// }, + /// }); + /// + /// var exampleRoutingIntent = new Azure.Network.RoutingIntent("exampleRoutingIntent", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// RoutingPolicies = new[] + /// { + /// new Azure.Network.Inputs.RoutingIntentRoutingPolicyArgs + /// { + /// Name = "InternetTrafficPolicy", + /// Destinations = new[] + /// { + /// "Internet", + /// }, + /// NextHop = exampleFirewall.Id, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Hub Routing Intents can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/SecurityPartnerProvider.cs b/sdk/dotnet/Network/SecurityPartnerProvider.cs index f5abcc9db0..50dc8d3a6b 100644 --- a/sdk/dotnet/Network/SecurityPartnerProvider.cs +++ b/sdk/dotnet/Network/SecurityPartnerProvider.cs @@ -12,6 +12,63 @@ namespace Pulumi.Azure.Network /// /// Manages a Security Partner Provider which could be associated to virtual hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.2.0/24", + /// }); + /// + /// var exampleVpnGateway = new Azure.Network.VpnGateway("exampleVpnGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualHubId = exampleVirtualHub.Id, + /// }); + /// + /// var exampleSecurityPartnerProvider = new Azure.Network.SecurityPartnerProvider("exampleSecurityPartnerProvider", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualHubId = exampleVirtualHub.Id, + /// SecurityProviderName = "IBoss", + /// Tags = + /// { + /// { "ENV", "Prod" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleVpnGateway, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Security Partner Providers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/Subnet.cs b/sdk/dotnet/Network/Subnet.cs index 9050347673..2b08b262d9 100644 --- a/sdk/dotnet/Network/Subnet.cs +++ b/sdk/dotnet/Network/Subnet.cs @@ -16,6 +16,60 @@ namespace Pulumi.Azure.Network /// provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource. /// At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnets. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "delegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.ContainerInstance/containerGroups", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subnets can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/SubnetNatGatewayAssociation.cs b/sdk/dotnet/Network/SubnetNatGatewayAssociation.cs index 72326b8d34..8457db4e6a 100644 --- a/sdk/dotnet/Network/SubnetNatGatewayAssociation.cs +++ b/sdk/dotnet/Network/SubnetNatGatewayAssociation.cs @@ -12,6 +12,56 @@ namespace Pulumi.Azure.Network /// /// Associates a NAT Gateway with a Subnet within a Virtual Network. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNatGateway = new Azure.Network.NatGateway("exampleNatGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnetNatGatewayAssociation = new Azure.Network.SubnetNatGatewayAssociation("exampleSubnetNatGatewayAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// NatGatewayId = exampleNatGateway.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subnet NAT Gateway Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/dotnet/Network/SubnetNetworkSecurityGroupAssociation.cs b/sdk/dotnet/Network/SubnetNetworkSecurityGroupAssociation.cs index 1aca471039..7659443e28 100644 --- a/sdk/dotnet/Network/SubnetNetworkSecurityGroupAssociation.cs +++ b/sdk/dotnet/Network/SubnetNetworkSecurityGroupAssociation.cs @@ -12,6 +12,71 @@ namespace Pulumi.Azure.Network /// /// Associates a Network Security Group with a Subnet within a Virtual Network. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SecurityRules = new[] + /// { + /// new Azure.Network.Inputs.NetworkSecurityGroupSecurityRuleArgs + /// { + /// Name = "test123", + /// Priority = 100, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// }, + /// }, + /// }); + /// + /// var exampleSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subnet `<->` Network Security Group Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/dotnet/Network/SubnetRouteTableAssociation.cs b/sdk/dotnet/Network/SubnetRouteTableAssociation.cs index 4fd315abd0..6fbf3bee06 100644 --- a/sdk/dotnet/Network/SubnetRouteTableAssociation.cs +++ b/sdk/dotnet/Network/SubnetRouteTableAssociation.cs @@ -12,6 +12,66 @@ namespace Pulumi.Azure.Network /// /// Associates a Route Table with a Subnet within a Virtual Network. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Routes = new[] + /// { + /// new Azure.Network.Inputs.RouteTableRouteArgs + /// { + /// Name = "example", + /// AddressPrefix = "10.100.0.0/14", + /// NextHopType = "VirtualAppliance", + /// NextHopInIpAddress = "10.10.1.1", + /// }, + /// }, + /// }); + /// + /// var exampleSubnetRouteTableAssociation = new Azure.Network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// RouteTableId = exampleRouteTable.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Subnet Route Table Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/dotnet/Network/TrafficManagerAzureEndpoint.cs b/sdk/dotnet/Network/TrafficManagerAzureEndpoint.cs index f138fbb072..5bc4332e4c 100644 --- a/sdk/dotnet/Network/TrafficManagerAzureEndpoint.cs +++ b/sdk/dotnet/Network/TrafficManagerAzureEndpoint.cs @@ -12,6 +12,63 @@ namespace Pulumi.Azure.Network /// /// Manages an Azure Endpoint within a Traffic Manager Profile. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// DomainNameLabel = "example-public-ip", + /// }); + /// + /// var exampleTrafficManagerProfile = new Azure.Network.TrafficManagerProfile("exampleTrafficManagerProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// TrafficRoutingMethod = "Weighted", + /// DnsConfig = new Azure.Network.Inputs.TrafficManagerProfileDnsConfigArgs + /// { + /// RelativeName = "example-profile", + /// Ttl = 100, + /// }, + /// MonitorConfig = new Azure.Network.Inputs.TrafficManagerProfileMonitorConfigArgs + /// { + /// Protocol = "HTTP", + /// Port = 80, + /// Path = "/", + /// IntervalInSeconds = 30, + /// TimeoutInSeconds = 9, + /// ToleratedNumberOfFailures = 3, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleTrafficManagerAzureEndpoint = new Azure.Network.TrafficManagerAzureEndpoint("exampleTrafficManagerAzureEndpoint", new() + /// { + /// ProfileId = exampleTrafficManagerProfile.Id, + /// Weight = 100, + /// TargetResourceId = examplePublicIp.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/TrafficManagerExternalEndpoint.cs b/sdk/dotnet/Network/TrafficManagerExternalEndpoint.cs index 238f8140a1..e52ea7b3d8 100644 --- a/sdk/dotnet/Network/TrafficManagerExternalEndpoint.cs +++ b/sdk/dotnet/Network/TrafficManagerExternalEndpoint.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.Network /// /// Manages an External Endpoint within a Traffic Manager Profile. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTrafficManagerProfile = new Azure.Network.TrafficManagerProfile("exampleTrafficManagerProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// TrafficRoutingMethod = "Weighted", + /// DnsConfig = new Azure.Network.Inputs.TrafficManagerProfileDnsConfigArgs + /// { + /// RelativeName = "example-profile", + /// Ttl = 100, + /// }, + /// MonitorConfig = new Azure.Network.Inputs.TrafficManagerProfileMonitorConfigArgs + /// { + /// Protocol = "HTTP", + /// Port = 80, + /// Path = "/", + /// IntervalInSeconds = 30, + /// TimeoutInSeconds = 9, + /// ToleratedNumberOfFailures = 3, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleTrafficManagerExternalEndpoint = new Azure.Network.TrafficManagerExternalEndpoint("exampleTrafficManagerExternalEndpoint", new() + /// { + /// ProfileId = exampleTrafficManagerProfile.Id, + /// Weight = 100, + /// Target = "www.example.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// External Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/TrafficManagerNestedEndpoint.cs b/sdk/dotnet/Network/TrafficManagerNestedEndpoint.cs index 7719bd8e40..61c33a172b 100644 --- a/sdk/dotnet/Network/TrafficManagerNestedEndpoint.cs +++ b/sdk/dotnet/Network/TrafficManagerNestedEndpoint.cs @@ -12,6 +12,82 @@ namespace Pulumi.Azure.Network /// /// Manages a Nested Endpoint within a Traffic Manager Profile. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// DomainNameLabel = "example-pip", + /// }); + /// + /// var parent = new Azure.Network.TrafficManagerProfile("parent", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// TrafficRoutingMethod = "Weighted", + /// DnsConfig = new Azure.Network.Inputs.TrafficManagerProfileDnsConfigArgs + /// { + /// RelativeName = "parent-profile", + /// Ttl = 100, + /// }, + /// MonitorConfig = new Azure.Network.Inputs.TrafficManagerProfileMonitorConfigArgs + /// { + /// Protocol = "HTTP", + /// Port = 80, + /// Path = "/", + /// IntervalInSeconds = 30, + /// TimeoutInSeconds = 9, + /// ToleratedNumberOfFailures = 3, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var nested = new Azure.Network.TrafficManagerProfile("nested", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// TrafficRoutingMethod = "Priority", + /// DnsConfig = new Azure.Network.Inputs.TrafficManagerProfileDnsConfigArgs + /// { + /// RelativeName = "nested-profile", + /// Ttl = 30, + /// }, + /// MonitorConfig = new Azure.Network.Inputs.TrafficManagerProfileMonitorConfigArgs + /// { + /// Protocol = "HTTP", + /// Port = 443, + /// Path = "/", + /// }, + /// }); + /// + /// var exampleTrafficManagerNestedEndpoint = new Azure.Network.TrafficManagerNestedEndpoint("exampleTrafficManagerNestedEndpoint", new() + /// { + /// TargetResourceId = nested.Id, + /// Priority = 1, + /// ProfileId = parent.Id, + /// MinimumChildEndpoints = 9, + /// Weight = 5, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Nested Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/TrafficManagerProfile.cs b/sdk/dotnet/Network/TrafficManagerProfile.cs index 9df2a406c2..dad2b27611 100644 --- a/sdk/dotnet/Network/TrafficManagerProfile.cs +++ b/sdk/dotnet/Network/TrafficManagerProfile.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.Network /// /// Manages a Traffic Manager Profile to which multiple endpoints can be attached. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var server = new Random.RandomId("server", new() + /// { + /// Keepers = + /// { + /// { "azi_id", 1 }, + /// }, + /// ByteLength = 8, + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTrafficManagerProfile = new Azure.Network.TrafficManagerProfile("exampleTrafficManagerProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// TrafficRoutingMethod = "Weighted", + /// DnsConfig = new Azure.Network.Inputs.TrafficManagerProfileDnsConfigArgs + /// { + /// RelativeName = server.Hex, + /// Ttl = 100, + /// }, + /// MonitorConfig = new Azure.Network.Inputs.TrafficManagerProfileMonitorConfigArgs + /// { + /// Protocol = "HTTP", + /// Port = 80, + /// Path = "/", + /// IntervalInSeconds = 30, + /// TimeoutInSeconds = 9, + /// ToleratedNumberOfFailures = 3, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualHub.cs b/sdk/dotnet/Network/VirtualHub.cs index b8346b732f..cacf311333 100644 --- a/sdk/dotnet/Network/VirtualHub.cs +++ b/sdk/dotnet/Network/VirtualHub.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Network /// /// Manages a Virtual Hub within a Virtual WAN. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.0.0/23", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Hub's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualHubConnection.cs b/sdk/dotnet/Network/VirtualHubConnection.cs index 6d7dba5998..0d51e21ffa 100644 --- a/sdk/dotnet/Network/VirtualHubConnection.cs +++ b/sdk/dotnet/Network/VirtualHubConnection.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.Network /// /// Manages a Connection for a Virtual Hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "172.16.0.0/12", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.1.0/24", + /// }); + /// + /// var exampleVirtualHubConnection = new Azure.Network.VirtualHubConnection("exampleVirtualHubConnection", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// RemoteVirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Hub Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualHubIp.cs b/sdk/dotnet/Network/VirtualHubIp.cs index cf6103b228..5375161367 100644 --- a/sdk/dotnet/Network/VirtualHubIp.cs +++ b/sdk/dotnet/Network/VirtualHubIp.cs @@ -14,6 +14,68 @@ namespace Pulumi.Azure.Network /// /// > **NOTE** Virtual Hub IP only supports Standard Virtual Hub without Virtual Wan. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.1.0/24", + /// }, + /// }); + /// + /// var exampleVirtualHubIp = new Azure.Network.VirtualHubIp("exampleVirtualHubIp", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// PrivateIpAddress = "10.5.1.18", + /// PrivateIpAllocationMethod = "Static", + /// PublicIpAddressId = examplePublicIp.Id, + /// SubnetId = exampleSubnet.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Hub IPs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualHubRouteTable.cs b/sdk/dotnet/Network/VirtualHubRouteTable.cs index 2f82575888..ee496f3fce 100644 --- a/sdk/dotnet/Network/VirtualHubRouteTable.cs +++ b/sdk/dotnet/Network/VirtualHubRouteTable.cs @@ -12,6 +12,99 @@ namespace Pulumi.Azure.Network /// /// Manages a Virtual Hub Route Table. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.1.0/24", + /// }, + /// }); + /// + /// var exampleSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.2.0/24", + /// }); + /// + /// var exampleVirtualHubConnection = new Azure.Network.VirtualHubConnection("exampleVirtualHubConnection", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// RemoteVirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// var exampleVirtualHubRouteTable = new Azure.Network.VirtualHubRouteTable("exampleVirtualHubRouteTable", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// Labels = new[] + /// { + /// "label1", + /// }, + /// Routes = new[] + /// { + /// new Azure.Network.Inputs.VirtualHubRouteTableRouteArgs + /// { + /// Name = "example-route", + /// DestinationsType = "CIDR", + /// Destinations = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// NextHopType = "ResourceId", + /// NextHop = exampleVirtualHubConnection.Id, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Hub Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualHubRouteTableRoute.cs b/sdk/dotnet/Network/VirtualHubRouteTableRoute.cs index a7ee033eec..4994f92cfb 100644 --- a/sdk/dotnet/Network/VirtualHubRouteTableRoute.cs +++ b/sdk/dotnet/Network/VirtualHubRouteTableRoute.cs @@ -14,6 +14,101 @@ namespace Pulumi.Azure.Network /// /// > **Note:** Route table routes can managed with this resource, or in-line with the virtual_hub_route_table resource. Using both is not supported. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.1.0/24", + /// }, + /// }); + /// + /// var exampleSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.2.0/24", + /// }); + /// + /// var exampleVirtualHubRouteTable = new Azure.Network.VirtualHubRouteTable("exampleVirtualHubRouteTable", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// Labels = new[] + /// { + /// "label1", + /// }, + /// }); + /// + /// var exampleVirtualHubConnection = new Azure.Network.VirtualHubConnection("exampleVirtualHubConnection", new() + /// { + /// VirtualHubId = exampleVirtualHub.Id, + /// RemoteVirtualNetworkId = exampleVirtualNetwork.Id, + /// Routing = new Azure.Network.Inputs.VirtualHubConnectionRoutingArgs + /// { + /// AssociatedRouteTableId = exampleVirtualHubRouteTable.Id, + /// }, + /// }); + /// + /// var exampleVirtualHubRouteTableRoute = new Azure.Network.VirtualHubRouteTableRoute("exampleVirtualHubRouteTableRoute", new() + /// { + /// RouteTableId = exampleVirtualHubRouteTable.Id, + /// DestinationsType = "CIDR", + /// Destinations = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// NextHopType = "ResourceId", + /// NextHop = exampleVirtualHubConnection.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Hub Route Table Routes can be imported using `<Route Table Resource Id>/routes/<Route Name>`, e.g. diff --git a/sdk/dotnet/Network/VirtualNetwork.cs b/sdk/dotnet/Network/VirtualNetwork.cs index c632b3f84e..37c426cefd 100644 --- a/sdk/dotnet/Network/VirtualNetwork.cs +++ b/sdk/dotnet/Network/VirtualNetwork.cs @@ -19,6 +19,63 @@ namespace Pulumi.Azure.Network /// **NOTE on Virtual Networks and DNS Servers:** This provider currently provides both a standalone virtual network DNS Servers resource, and allows for DNS servers to be defined in-line within the Virtual Network resource. /// At this time you cannot use a Virtual Network with in-line DNS servers in conjunction with any Virtual Network DNS Servers resources. Doing so will cause a conflict of Virtual Network DNS Servers configurations and will overwrite virtual networks DNS servers. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// DnsServers = new[] + /// { + /// "10.0.0.4", + /// "10.0.0.5", + /// }, + /// Subnets = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkSubnetArgs + /// { + /// Name = "subnet1", + /// AddressPrefix = "10.0.1.0/24", + /// }, + /// new Azure.Network.Inputs.VirtualNetworkSubnetArgs + /// { + /// Name = "subnet2", + /// AddressPrefix = "10.0.2.0/24", + /// SecurityGroup = exampleNetworkSecurityGroup.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualNetworkDnsServers.cs b/sdk/dotnet/Network/VirtualNetworkDnsServers.cs index c82e7fb85f..41408fd688 100644 --- a/sdk/dotnet/Network/VirtualNetworkDnsServers.cs +++ b/sdk/dotnet/Network/VirtualNetworkDnsServers.cs @@ -10,6 +10,53 @@ namespace Pulumi.Azure.Network { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Subnets = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkSubnetArgs + /// { + /// Name = "subnet1", + /// AddressPrefix = "10.0.1.0/24", + /// }, + /// }, + /// }); + /// + /// var exampleVirtualNetworkDnsServers = new Azure.Network.VirtualNetworkDnsServers("exampleVirtualNetworkDnsServers", new() + /// { + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// DnsServers = new[] + /// { + /// "10.7.7.2", + /// "10.7.7.7", + /// "10.7.7.1", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Network DNS Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualNetworkGateway.cs b/sdk/dotnet/Network/VirtualNetworkGateway.cs index dbda843e3a..e9e367740d 100644 --- a/sdk/dotnet/Network/VirtualNetworkGateway.cs +++ b/sdk/dotnet/Network/VirtualNetworkGateway.cs @@ -14,6 +14,115 @@ namespace Pulumi.Azure.Network /// /// > **Note:** Please be aware that provisioning a Virtual Network Gateway takes a long time (between 30 minutes and 1 hour) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// }); + /// + /// var exampleVirtualNetworkGateway = new Azure.Network.VirtualNetworkGateway("exampleVirtualNetworkGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Type = "Vpn", + /// VpnType = "RouteBased", + /// ActiveActive = false, + /// EnableBgp = false, + /// Sku = "Basic", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkGatewayIpConfigurationArgs + /// { + /// Name = "vnetGatewayConfig", + /// PublicIpAddressId = examplePublicIp.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// VpnClientConfiguration = new Azure.Network.Inputs.VirtualNetworkGatewayVpnClientConfigurationArgs + /// { + /// AddressSpaces = new[] + /// { + /// "10.2.0.0/24", + /// }, + /// RootCertificates = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkGatewayVpnClientConfigurationRootCertificateArgs + /// { + /// Name = "DigiCert-Federated-ID-Root-CA", + /// PublicCertData = @"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + /// MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + /// d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + /// Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + /// BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + /// Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + /// MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + /// QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + /// zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + /// GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + /// GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + /// Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + /// DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + /// HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + /// jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + /// 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + /// QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + /// uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + /// WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + /// M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + /// ", + /// }, + /// }, + /// RevokedCertificates = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkGatewayVpnClientConfigurationRevokedCertificateArgs + /// { + /// Name = "Verizon-Global-Root-CA", + /// Thumbprint = "912198EEF23DCAC40939312FEE97DD560BAE49B1", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VirtualNetworkGatewayConnection.cs b/sdk/dotnet/Network/VirtualNetworkGatewayConnection.cs index 63984f7324..7fe62f1fbb 100644 --- a/sdk/dotnet/Network/VirtualNetworkGatewayConnection.cs +++ b/sdk/dotnet/Network/VirtualNetworkGatewayConnection.cs @@ -13,6 +13,229 @@ namespace Pulumi.Azure.Network /// Manages a connection in an existing Virtual Network Gateway. /// /// ## Example Usage + /// ### Site-to-Site connection + /// + /// The following example shows a connection between an Azure virtual network + /// and an on-premises VPN device and network. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var onpremiseLocalNetworkGateway = new Azure.Network.LocalNetworkGateway("onpremiseLocalNetworkGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// GatewayAddress = "168.62.225.23", + /// AddressSpaces = new[] + /// { + /// "10.1.1.0/24", + /// }, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// }); + /// + /// var exampleVirtualNetworkGateway = new Azure.Network.VirtualNetworkGateway("exampleVirtualNetworkGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Type = "Vpn", + /// VpnType = "RouteBased", + /// ActiveActive = false, + /// EnableBgp = false, + /// Sku = "Basic", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkGatewayIpConfigurationArgs + /// { + /// PublicIpAddressId = examplePublicIp.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// }); + /// + /// var onpremiseVirtualNetworkGatewayConnection = new Azure.Network.VirtualNetworkGatewayConnection("onpremiseVirtualNetworkGatewayConnection", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Type = "IPsec", + /// VirtualNetworkGatewayId = exampleVirtualNetworkGateway.Id, + /// LocalNetworkGatewayId = onpremiseLocalNetworkGateway.Id, + /// SharedKey = "4-v3ry-53cr37-1p53c-5h4r3d-k3y", + /// }); + /// + /// }); + /// ``` + /// ### VNet-to-VNet connection + /// + /// The following example shows a connection between two Azure virtual network + /// in different locations/regions. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var usResourceGroup = new Azure.Core.ResourceGroup("usResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var usVirtualNetwork = new Azure.Network.VirtualNetwork("usVirtualNetwork", new() + /// { + /// Location = usResourceGroup.Location, + /// ResourceGroupName = usResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var usGateway = new Azure.Network.Subnet("usGateway", new() + /// { + /// ResourceGroupName = usResourceGroup.Name, + /// VirtualNetworkName = usVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// var usPublicIp = new Azure.Network.PublicIp("usPublicIp", new() + /// { + /// Location = usResourceGroup.Location, + /// ResourceGroupName = usResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// }); + /// + /// var usVirtualNetworkGateway = new Azure.Network.VirtualNetworkGateway("usVirtualNetworkGateway", new() + /// { + /// Location = usResourceGroup.Location, + /// ResourceGroupName = usResourceGroup.Name, + /// Type = "Vpn", + /// VpnType = "RouteBased", + /// Sku = "Basic", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkGatewayIpConfigurationArgs + /// { + /// PublicIpAddressId = usPublicIp.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// SubnetId = usGateway.Id, + /// }, + /// }, + /// }); + /// + /// var europeResourceGroup = new Azure.Core.ResourceGroup("europeResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var europeVirtualNetwork = new Azure.Network.VirtualNetwork("europeVirtualNetwork", new() + /// { + /// Location = europeResourceGroup.Location, + /// ResourceGroupName = europeResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.1.0.0/16", + /// }, + /// }); + /// + /// var europeGateway = new Azure.Network.Subnet("europeGateway", new() + /// { + /// ResourceGroupName = europeResourceGroup.Name, + /// VirtualNetworkName = europeVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.1.1.0/24", + /// }, + /// }); + /// + /// var europePublicIp = new Azure.Network.PublicIp("europePublicIp", new() + /// { + /// Location = europeResourceGroup.Location, + /// ResourceGroupName = europeResourceGroup.Name, + /// AllocationMethod = "Dynamic", + /// }); + /// + /// var europeVirtualNetworkGateway = new Azure.Network.VirtualNetworkGateway("europeVirtualNetworkGateway", new() + /// { + /// Location = europeResourceGroup.Location, + /// ResourceGroupName = europeResourceGroup.Name, + /// Type = "Vpn", + /// VpnType = "RouteBased", + /// Sku = "Basic", + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.VirtualNetworkGatewayIpConfigurationArgs + /// { + /// PublicIpAddressId = europePublicIp.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// SubnetId = europeGateway.Id, + /// }, + /// }, + /// }); + /// + /// var usToEurope = new Azure.Network.VirtualNetworkGatewayConnection("usToEurope", new() + /// { + /// Location = usResourceGroup.Location, + /// ResourceGroupName = usResourceGroup.Name, + /// Type = "Vnet2Vnet", + /// VirtualNetworkGatewayId = usVirtualNetworkGateway.Id, + /// PeerVirtualNetworkGatewayId = europeVirtualNetworkGateway.Id, + /// SharedKey = "4-v3ry-53cr37-1p53c-5h4r3d-k3y", + /// }); + /// + /// var europeToUs = new Azure.Network.VirtualNetworkGatewayConnection("europeToUs", new() + /// { + /// Location = europeResourceGroup.Location, + /// ResourceGroupName = europeResourceGroup.Name, + /// Type = "Vnet2Vnet", + /// VirtualNetworkGatewayId = europeVirtualNetworkGateway.Id, + /// PeerVirtualNetworkGatewayId = usVirtualNetworkGateway.Id, + /// SharedKey = "4-v3ry-53cr37-1p53c-5h4r3d-k3y", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Network/VirtualNetworkPeering.cs b/sdk/dotnet/Network/VirtualNetworkPeering.cs index d72784ff09..746310dadc 100644 --- a/sdk/dotnet/Network/VirtualNetworkPeering.cs +++ b/sdk/dotnet/Network/VirtualNetworkPeering.cs @@ -13,6 +13,57 @@ namespace Pulumi.Azure.Network /// Manages a virtual network peering which allows resources to access other /// resources in the linked virtual network. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var example_1VirtualNetwork = new Azure.Network.VirtualNetwork("example-1VirtualNetwork", new() + /// { + /// ResourceGroupName = example.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Location = example.Location, + /// }); + /// + /// var example_2VirtualNetwork = new Azure.Network.VirtualNetwork("example-2VirtualNetwork", new() + /// { + /// ResourceGroupName = example.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// Location = example.Location, + /// }); + /// + /// var example_1VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-1VirtualNetworkPeering", new() + /// { + /// ResourceGroupName = example.Name, + /// VirtualNetworkName = example_1VirtualNetwork.Name, + /// RemoteVirtualNetworkId = example_2VirtualNetwork.Id, + /// }); + /// + /// var example_2VirtualNetworkPeering = new Azure.Network.VirtualNetworkPeering("example-2VirtualNetworkPeering", new() + /// { + /// ResourceGroupName = example.Name, + /// VirtualNetworkName = example_2VirtualNetwork.Name, + /// RemoteVirtualNetworkId = example_1VirtualNetwork.Id, + /// }); + /// + /// }); + /// ``` /// ## Note /// /// Virtual Network peerings cannot be created, updated or deleted concurrently. diff --git a/sdk/dotnet/Network/VirtualWan.cs b/sdk/dotnet/Network/VirtualWan.cs index 9b7eb62517..7ca59e7807 100644 --- a/sdk/dotnet/Network/VirtualWan.cs +++ b/sdk/dotnet/Network/VirtualWan.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.Network /// /// Manages a Virtual WAN. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Virtual WAN can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VnpGatewayNatRule.cs b/sdk/dotnet/Network/VnpGatewayNatRule.cs index 5e7af03057..a9c426c339 100644 --- a/sdk/dotnet/Network/VnpGatewayNatRule.cs +++ b/sdk/dotnet/Network/VnpGatewayNatRule.cs @@ -12,6 +12,65 @@ namespace Pulumi.Azure.Network /// /// Manages a VPN Gateway NAT Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressPrefix = "10.0.1.0/24", + /// VirtualWanId = exampleVirtualWan.Id, + /// }); + /// + /// var exampleVpnGateway = new Azure.Network.VpnGateway("exampleVpnGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualHubId = exampleVirtualHub.Id, + /// }); + /// + /// var exampleVnpGatewayNatRule = new Azure.Network.VnpGatewayNatRule("exampleVnpGatewayNatRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VpnGatewayId = exampleVpnGateway.Id, + /// ExternalMappings = new[] + /// { + /// new Azure.Network.Inputs.VnpGatewayNatRuleExternalMappingArgs + /// { + /// AddressSpace = "192.168.21.0/26", + /// }, + /// }, + /// InternalMappings = new[] + /// { + /// new Azure.Network.Inputs.VnpGatewayNatRuleInternalMappingArgs + /// { + /// AddressSpace = "10.4.0.0/26", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VPN Gateway NAT Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VpnGateway.cs b/sdk/dotnet/Network/VpnGateway.cs index 20a58e3357..aebafc0604 100644 --- a/sdk/dotnet/Network/VpnGateway.cs +++ b/sdk/dotnet/Network/VpnGateway.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.Network /// /// Manages a VPN Gateway within a Virtual Hub, which enables Site-to-Site communication. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.1.0/24", + /// }); + /// + /// var exampleVpnGateway = new Azure.Network.VpnGateway("exampleVpnGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualHubId = exampleVirtualHub.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VPN Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VpnGatewayConnection.cs b/sdk/dotnet/Network/VpnGatewayConnection.cs index e9669df226..fb67609f06 100644 --- a/sdk/dotnet/Network/VpnGatewayConnection.cs +++ b/sdk/dotnet/Network/VpnGatewayConnection.cs @@ -12,6 +12,84 @@ namespace Pulumi.Azure.Network /// /// Manages a VPN Gateway Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVirtualHub = new Azure.Network.VirtualHub("exampleVirtualHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressPrefix = "10.0.0.0/24", + /// }); + /// + /// var exampleVpnGateway = new Azure.Network.VpnGateway("exampleVpnGateway", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualHubId = exampleVirtualHub.Id, + /// }); + /// + /// var exampleVpnSite = new Azure.Network.VpnSite("exampleVpnSite", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualWanId = exampleVirtualWan.Id, + /// Links = new[] + /// { + /// new Azure.Network.Inputs.VpnSiteLinkArgs + /// { + /// Name = "link1", + /// IpAddress = "10.1.0.0", + /// }, + /// new Azure.Network.Inputs.VpnSiteLinkArgs + /// { + /// Name = "link2", + /// IpAddress = "10.2.0.0", + /// }, + /// }, + /// }); + /// + /// var exampleVpnGatewayConnection = new Azure.Network.VpnGatewayConnection("exampleVpnGatewayConnection", new() + /// { + /// VpnGatewayId = exampleVpnGateway.Id, + /// RemoteVpnSiteId = exampleVpnSite.Id, + /// VpnLinks = new[] + /// { + /// new Azure.Network.Inputs.VpnGatewayConnectionVpnLinkArgs + /// { + /// Name = "link1", + /// VpnSiteLinkId = exampleVpnSite.Links.Apply(links => links[0]?.Id), + /// }, + /// new Azure.Network.Inputs.VpnGatewayConnectionVpnLinkArgs + /// { + /// Name = "link2", + /// VpnSiteLinkId = exampleVpnSite.Links.Apply(links => links[1]?.Id), + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VPN Gateway Connections can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VpnServerConfiguration.cs b/sdk/dotnet/Network/VpnServerConfiguration.cs index c7866b4026..1e843cc418 100644 --- a/sdk/dotnet/Network/VpnServerConfiguration.cs +++ b/sdk/dotnet/Network/VpnServerConfiguration.cs @@ -12,6 +12,62 @@ namespace Pulumi.Azure.Network /// /// Manages a VPN Server Configuration. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var test = new Azure.Network.VpnServerConfiguration("test", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// VpnAuthenticationTypes = new[] + /// { + /// "Certificate", + /// }, + /// ClientRootCertificates = new[] + /// { + /// new Azure.Network.Inputs.VpnServerConfigurationClientRootCertificateArgs + /// { + /// Name = "DigiCert-Federated-ID-Root-CA", + /// PublicCertData = @"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + /// MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + /// d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + /// Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + /// BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + /// Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + /// MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + /// QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + /// zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + /// GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + /// GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + /// Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + /// DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + /// HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + /// jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + /// 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + /// QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + /// uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + /// WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + /// M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + /// ", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VPN Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VpnServerConfigurationPolicyGroup.cs b/sdk/dotnet/Network/VpnServerConfigurationPolicyGroup.cs index f30cfd7993..922b47c2eb 100644 --- a/sdk/dotnet/Network/VpnServerConfigurationPolicyGroup.cs +++ b/sdk/dotnet/Network/VpnServerConfigurationPolicyGroup.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.Network /// /// Manages a VPN Server Configuration Policy Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVpnServerConfiguration = new Azure.Network.VpnServerConfiguration("exampleVpnServerConfiguration", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VpnAuthenticationTypes = new[] + /// { + /// "Radius", + /// }, + /// Radius = new Azure.Network.Inputs.VpnServerConfigurationRadiusArgs + /// { + /// Servers = new[] + /// { + /// new Azure.Network.Inputs.VpnServerConfigurationRadiusServerArgs + /// { + /// Address = "10.105.1.1", + /// Secret = "vindicators-the-return-of-worldender", + /// Score = 15, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleVpnServerConfigurationPolicyGroup = new Azure.Network.VpnServerConfigurationPolicyGroup("exampleVpnServerConfigurationPolicyGroup", new() + /// { + /// VpnServerConfigurationId = exampleVpnServerConfiguration.Id, + /// Policies = new[] + /// { + /// new Azure.Network.Inputs.VpnServerConfigurationPolicyGroupPolicyArgs + /// { + /// Name = "policy1", + /// Type = "RadiusAzureGroupId", + /// Value = "6ad1bd08", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VPN Server Configuration Policy Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Network/VpnSite.cs b/sdk/dotnet/Network/VpnSite.cs index 133e2b352a..3a11385fa5 100644 --- a/sdk/dotnet/Network/VpnSite.cs +++ b/sdk/dotnet/Network/VpnSite.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Network /// /// Manages a VPN Site. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualWan = new Azure.Network.VirtualWan("exampleVirtualWan", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleVpnSite = new Azure.Network.VpnSite("exampleVpnSite", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualWanId = exampleVirtualWan.Id, + /// AddressCidrs = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Links = new[] + /// { + /// new Azure.Network.Inputs.VpnSiteLinkArgs + /// { + /// Name = "link1", + /// IpAddress = "10.0.0.1", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VPN Sites can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NetworkFunction/AzureTrafficCollector.cs b/sdk/dotnet/NetworkFunction/AzureTrafficCollector.cs index 503892b890..6de78410fe 100644 --- a/sdk/dotnet/NetworkFunction/AzureTrafficCollector.cs +++ b/sdk/dotnet/NetworkFunction/AzureTrafficCollector.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.NetworkFunction /// /// Manages a Network Function Azure Traffic Collector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleAzureTrafficCollector = new Azure.NetworkFunction.AzureTrafficCollector("exampleAzureTrafficCollector", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West US", + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network Function Azure Traffic Collector can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NewRelic/Monitor.cs b/sdk/dotnet/NewRelic/Monitor.cs index 7c3ed15b44..aa9d44ba4e 100644 --- a/sdk/dotnet/NewRelic/Monitor.cs +++ b/sdk/dotnet/NewRelic/Monitor.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.NewRelic /// /// Manages an Azure Native New Relic Monitor. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleMonitor = new Azure.NewRelic.Monitor("exampleMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Plan = new Azure.NewRelic.Inputs.MonitorPlanArgs + /// { + /// EffectiveDate = "2023-06-06T00:00:00Z", + /// }, + /// User = new Azure.NewRelic.Inputs.MonitorUserArgs + /// { + /// Email = "user@example.com", + /// FirstName = "Example", + /// LastName = "User", + /// PhoneNumber = "+12313803556", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Native New Relic Monitor can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NewRelic/TagRule.cs b/sdk/dotnet/NewRelic/TagRule.cs index c7e2364417..a3d6174bc2 100644 --- a/sdk/dotnet/NewRelic/TagRule.cs +++ b/sdk/dotnet/NewRelic/TagRule.cs @@ -12,6 +12,68 @@ namespace Pulumi.Azure.NewRelic /// /// Manages an Azure Native New Relic Tag Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleMonitor = new Azure.NewRelic.Monitor("exampleMonitor", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Plan = new Azure.NewRelic.Inputs.MonitorPlanArgs + /// { + /// EffectiveDate = "2023-06-06T00:00:00Z", + /// }, + /// User = new Azure.NewRelic.Inputs.MonitorUserArgs + /// { + /// Email = "user@example.com", + /// FirstName = "Example", + /// LastName = "User", + /// PhoneNumber = "+12313803556", + /// }, + /// }); + /// + /// var exampleTagRule = new Azure.NewRelic.TagRule("exampleTagRule", new() + /// { + /// MonitorId = exampleMonitor.Id, + /// AzureActiveDirectoryLogEnabled = true, + /// ActivityLogEnabled = true, + /// MetricEnabled = true, + /// SubscriptionLogEnabled = true, + /// LogTagFilters = new[] + /// { + /// new Azure.NewRelic.Inputs.TagRuleLogTagFilterArgs + /// { + /// Name = "key", + /// Action = "Include", + /// Value = "value", + /// }, + /// }, + /// MetricTagFilters = new[] + /// { + /// new Azure.NewRelic.Inputs.TagRuleMetricTagFilterArgs + /// { + /// Name = "key", + /// Action = "Exclude", + /// Value = "value", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Native New Relic Tag Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Nginx/Certificate.cs b/sdk/dotnet/Nginx/Certificate.cs index 0deb606132..87a4fd0c1d 100644 --- a/sdk/dotnet/Nginx/Certificate.cs +++ b/sdk/dotnet/Nginx/Certificate.cs @@ -12,6 +12,151 @@ namespace Pulumi.Azure.Nginx /// /// Manages a Certificate for an NGinx Deployment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "delegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "NGINX.NGINXPLUS/nginxDeployments", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleDeployment = new Azure.Nginx.Deployment("exampleDeployment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "publicpreview_Monthly_gmz7xq9ge3py", + /// Location = exampleResourceGroup.Location, + /// ManagedResourceGroup = "example", + /// DiagnoseSupportEnabled = true, + /// FrontendPublic = new Azure.Nginx.Inputs.DeploymentFrontendPublicArgs + /// { + /// IpAddresses = new[] + /// { + /// examplePublicIp.Id, + /// }, + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Nginx.Inputs.DeploymentNetworkInterfaceArgs + /// { + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Delete", + /// "DeleteIssuers", + /// "Get", + /// "GetIssuers", + /// "Import", + /// "List", + /// "ListIssuers", + /// "ManageContacts", + /// "ManageIssuers", + /// "SetIssuers", + /// "Update", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs + /// { + /// Contents = ReadFileBase64("certificate-to-import.pfx"), + /// Password = "", + /// }, + /// }); + /// + /// var exampleNginx_certificateCertificate = new Azure.Nginx.Certificate("exampleNginx/certificateCertificate", new() + /// { + /// NginxDeploymentId = exampleDeployment.Id, + /// KeyVirtualPath = "/src/cert/soservermekey.key", + /// CertificateVirtualPath = "/src/cert/server.cert", + /// KeyVaultSecretId = exampleCertificate.SecretId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// An Nginx Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Nginx/Deployment.cs b/sdk/dotnet/Nginx/Deployment.cs index d7643e92c8..e0438303fa 100644 --- a/sdk/dotnet/Nginx/Deployment.cs +++ b/sdk/dotnet/Nginx/Deployment.cs @@ -12,6 +12,96 @@ namespace Pulumi.Azure.Nginx /// /// Manages a Nginx Deployment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "delegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "NGINX.NGINXPLUS/nginxDeployments", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleDeployment = new Azure.Nginx.Deployment("exampleDeployment", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "publicpreview_Monthly_gmz7xq9ge3py", + /// Location = exampleResourceGroup.Location, + /// ManagedResourceGroup = "example", + /// DiagnoseSupportEnabled = true, + /// FrontendPublic = new Azure.Nginx.Inputs.DeploymentFrontendPublicArgs + /// { + /// IpAddresses = new[] + /// { + /// examplePublicIp.Id, + /// }, + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Nginx.Inputs.DeploymentNetworkInterfaceArgs + /// { + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// Capacity = 20, + /// Email = "user@test.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Nginx Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NotificationHub/AuthorizationRule.cs b/sdk/dotnet/NotificationHub/AuthorizationRule.cs index cb012b87f2..9e6fefaa14 100644 --- a/sdk/dotnet/NotificationHub/AuthorizationRule.cs +++ b/sdk/dotnet/NotificationHub/AuthorizationRule.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.NotificationHub /// /// Manages an Authorization Rule associated with a Notification Hub within a Notification Hub Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.NotificationHub.Namespace("exampleNamespace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// NamespaceType = "NotificationHub", + /// SkuName = "Free", + /// }); + /// + /// var exampleHub = new Azure.NotificationHub.Hub("exampleHub", new() + /// { + /// NamespaceName = exampleNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.NotificationHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// NotificationHubName = exampleHub.Name, + /// NamespaceName = exampleNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Manage = true, + /// Send = true, + /// Listen = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Notification Hub Authorization Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NotificationHub/GetHub.cs b/sdk/dotnet/NotificationHub/GetHub.cs index b21cfdff9c..ddb22a89f2 100644 --- a/sdk/dotnet/NotificationHub/GetHub.cs +++ b/sdk/dotnet/NotificationHub/GetHub.cs @@ -13,12 +13,68 @@ public static class GetHub { /// /// Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NotificationHub.GetHub.Invoke(new() + /// { + /// Name = "notification-hub", + /// NamespaceName = "namespace-name", + /// ResourceGroupName = "resource-group-name", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getHubResult => getHubResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetHubArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:notificationhub/getHub:getHub", args ?? new GetHubArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NotificationHub.GetHub.Invoke(new() + /// { + /// Name = "notification-hub", + /// NamespaceName = "namespace-name", + /// ResourceGroupName = "resource-group-name", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getHubResult => getHubResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetHubInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:notificationhub/getHub:getHub", args ?? new GetHubInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NotificationHub/GetNamespace.cs b/sdk/dotnet/NotificationHub/GetNamespace.cs index cad3d91415..b58241799d 100644 --- a/sdk/dotnet/NotificationHub/GetNamespace.cs +++ b/sdk/dotnet/NotificationHub/GetNamespace.cs @@ -13,12 +13,66 @@ public static class GetNamespace { /// /// Use this data source to access information about an existing Notification Hub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NotificationHub.GetNamespace.Invoke(new() + /// { + /// Name = "my-namespace", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["servicebusEndpoint"] = example.Apply(getNamespaceResult => getNamespaceResult.ServicebusEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNamespaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:notificationhub/getNamespace:getNamespace", args ?? new GetNamespaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Notification Hub Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.NotificationHub.GetNamespace.Invoke(new() + /// { + /// Name = "my-namespace", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["servicebusEndpoint"] = example.Apply(getNamespaceResult => getNamespaceResult.ServicebusEndpoint), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNamespaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:notificationhub/getNamespace:getNamespace", args ?? new GetNamespaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/NotificationHub/Hub.cs b/sdk/dotnet/NotificationHub/Hub.cs index bbbb473739..3469193c95 100644 --- a/sdk/dotnet/NotificationHub/Hub.cs +++ b/sdk/dotnet/NotificationHub/Hub.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.NotificationHub /// /// Manages a Notification Hub within a Notification Hub Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.NotificationHub.Namespace("exampleNamespace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// NamespaceType = "NotificationHub", + /// SkuName = "Free", + /// }); + /// + /// var exampleHub = new Azure.NotificationHub.Hub("exampleHub", new() + /// { + /// NamespaceName = exampleNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Notification Hubs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/NotificationHub/Namespace.cs b/sdk/dotnet/NotificationHub/Namespace.cs index 3e14f2079a..dc88ce7a2f 100644 --- a/sdk/dotnet/NotificationHub/Namespace.cs +++ b/sdk/dotnet/NotificationHub/Namespace.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.NotificationHub /// /// Manages a Notification Hub Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.NotificationHub.Namespace("exampleNamespace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// NamespaceType = "NotificationHub", + /// SkuName = "Free", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Notification Hub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/OperationalInsights/AnalyticsSolution.cs b/sdk/dotnet/OperationalInsights/AnalyticsSolution.cs index e3476b9b8e..72e7895fff 100644 --- a/sdk/dotnet/OperationalInsights/AnalyticsSolution.cs +++ b/sdk/dotnet/OperationalInsights/AnalyticsSolution.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.OperationalInsights /// /// Manages a Log Analytics (formally Operational Insights) Solution. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var workspace = new Random.RandomId("workspace", new() + /// { + /// Keepers = + /// { + /// { "group_name", exampleResourceGroup.Name }, + /// }, + /// ByteLength = 8, + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleAnalyticsSolution = new Azure.OperationalInsights.AnalyticsSolution("exampleAnalyticsSolution", new() + /// { + /// SolutionName = "ContainerInsights", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// Plan = new Azure.OperationalInsights.Inputs.AnalyticsSolutionPlanArgs + /// { + /// Publisher = "Microsoft", + /// Product = "OMSGallery/ContainerInsights", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Solutions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/OperationalInsights/AnalyticsWorkspace.cs b/sdk/dotnet/OperationalInsights/AnalyticsWorkspace.cs index 22191a3f69..acebcc14d6 100644 --- a/sdk/dotnet/OperationalInsights/AnalyticsWorkspace.cs +++ b/sdk/dotnet/OperationalInsights/AnalyticsWorkspace.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.OperationalInsights /// /// Manages a Log Analytics (formally Operational Insights) Workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/OperationalInsights/GetAnalyticsWorkspace.cs b/sdk/dotnet/OperationalInsights/GetAnalyticsWorkspace.cs index d210dbdd58..820eb01718 100644 --- a/sdk/dotnet/OperationalInsights/GetAnalyticsWorkspace.cs +++ b/sdk/dotnet/OperationalInsights/GetAnalyticsWorkspace.cs @@ -13,12 +13,66 @@ public static class GetAnalyticsWorkspace { /// /// Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.OperationalInsights.GetAnalyticsWorkspace.Invoke(new() + /// { + /// Name = "acctest-01", + /// ResourceGroupName = "acctest", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["logAnalyticsWorkspaceId"] = example.Apply(getAnalyticsWorkspaceResult => getAnalyticsWorkspaceResult.WorkspaceId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAnalyticsWorkspaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:operationalinsights/getAnalyticsWorkspace:getAnalyticsWorkspace", args ?? new GetAnalyticsWorkspaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.OperationalInsights.GetAnalyticsWorkspace.Invoke(new() + /// { + /// Name = "acctest-01", + /// ResourceGroupName = "acctest", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["logAnalyticsWorkspaceId"] = example.Apply(getAnalyticsWorkspaceResult => getAnalyticsWorkspaceResult.WorkspaceId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAnalyticsWorkspaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:operationalinsights/getAnalyticsWorkspace:getAnalyticsWorkspace", args ?? new GetAnalyticsWorkspaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/OperationalInsights/QueryPackQuery.cs b/sdk/dotnet/OperationalInsights/QueryPackQuery.cs index 76d6a39bcf..ed1a7ede85 100644 --- a/sdk/dotnet/OperationalInsights/QueryPackQuery.cs +++ b/sdk/dotnet/OperationalInsights/QueryPackQuery.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.OperationalInsights /// /// Manages a Log Analytics Query Pack Query. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleQueryPack = new Azure.LogAnalytics.QueryPack("exampleQueryPack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleQueryPackQuery = new Azure.OperationalInsights.QueryPackQuery("exampleQueryPackQuery", new() + /// { + /// QueryPackId = exampleQueryPack.Id, + /// Body = @"let newExceptionsTimeRange = 1d; + /// let timeRangeToCheckBefore = 7d; + /// exceptions + /// | where timestamp < ago(timeRangeToCheckBefore) + /// | summarize count() by problemId + /// | join kind= rightanti ( + /// exceptions + /// | where timestamp >= ago(newExceptionsTimeRange) + /// | extend stack = tostring(details[0].rawStack) + /// | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId + /// ) on problemId + /// | order by count_ desc + /// ", + /// DisplayName = "Exceptions - New in the last 24 hours", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Log Analytics Query Pack Queries can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Orbital/Contact.cs b/sdk/dotnet/Orbital/Contact.cs index a57b97bbe9..353f1a08a6 100644 --- a/sdk/dotnet/Orbital/Contact.cs +++ b/sdk/dotnet/Orbital/Contact.cs @@ -12,6 +12,136 @@ namespace Pulumi.Azure.Orbital /// /// Manages an orbital contact. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpacecraft = new Azure.Orbital.Spacecraft("exampleSpacecraft", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "westeurope", + /// NoradId = "12345", + /// Links = new[] + /// { + /// new Azure.Orbital.Inputs.SpacecraftLinkArgs + /// { + /// BandwidthMhz = 100, + /// CenterFrequencyMhz = 101, + /// Direction = "Uplink", + /// Polarization = "LHCP", + /// Name = "examplename", + /// }, + /// }, + /// TwoLineElements = new[] + /// { + /// "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + /// "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + /// }, + /// TitleLine = "AQUA", + /// Tags = + /// { + /// { "aks-managed-cluster-name", "9a57225d-a405-4d40-aa46-f13d2342abef" }, + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "orbitalgateway", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Orbital/orbitalGateways", + /// Actions = new[] + /// { + /// "Microsoft.Network/publicIPAddresses/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/read", + /// "Microsoft.Network/publicIPAddresses/read", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleContactProfile = new Azure.Orbital.ContactProfile("exampleContactProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MinimumVariableContactDuration = "PT1M", + /// AutoTracking = "disabled", + /// Links = new[] + /// { + /// new Azure.Orbital.Inputs.ContactProfileLinkArgs + /// { + /// Channels = new[] + /// { + /// new Azure.Orbital.Inputs.ContactProfileLinkChannelArgs + /// { + /// Name = "channelname", + /// BandwidthMhz = 100, + /// CenterFrequencyMhz = 101, + /// EndPoints = new[] + /// { + /// new Azure.Orbital.Inputs.ContactProfileLinkChannelEndPointArgs + /// { + /// EndPointName = "AQUA_command", + /// IpAddress = "10.0.1.0", + /// Port = "49153", + /// Protocol = "TCP", + /// }, + /// }, + /// }, + /// }, + /// Direction = "Uplink", + /// Name = "RHCP_UL", + /// Polarization = "RHCP", + /// }, + /// }, + /// NetworkConfigurationSubnetId = exampleSubnet.Id, + /// }); + /// + /// var exampleContact = new Azure.Orbital.Contact("exampleContact", new() + /// { + /// SpacecraftId = exampleSpacecraft.Id, + /// ReservationStartTime = "2020-07-16T20:35:00.00Z", + /// ReservationEndTime = "2020-07-16T20:55:00.00Z", + /// GroundStationName = "WESTUS2_0", + /// ContactProfileId = exampleContactProfile.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Orbital/ContactProfile.cs b/sdk/dotnet/Orbital/ContactProfile.cs index 9a9bfeb357..a4c70c7efe 100644 --- a/sdk/dotnet/Orbital/ContactProfile.cs +++ b/sdk/dotnet/Orbital/ContactProfile.cs @@ -12,6 +12,99 @@ namespace Pulumi.Azure.Orbital /// /// Manages a Contact profile. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "orbitalgateway", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Orbital/orbitalGateways", + /// Actions = new[] + /// { + /// "Microsoft.Network/publicIPAddresses/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/read", + /// "Microsoft.Network/publicIPAddresses/read", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleContactProfile = new Azure.Orbital.ContactProfile("exampleContactProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// MinimumVariableContactDuration = "PT1M", + /// AutoTracking = "disabled", + /// Links = new[] + /// { + /// new Azure.Orbital.Inputs.ContactProfileLinkArgs + /// { + /// Channels = new[] + /// { + /// new Azure.Orbital.Inputs.ContactProfileLinkChannelArgs + /// { + /// Name = "channelname", + /// BandwidthMhz = 100, + /// CenterFrequencyMhz = 101, + /// EndPoints = new[] + /// { + /// new Azure.Orbital.Inputs.ContactProfileLinkChannelEndPointArgs + /// { + /// EndPointName = "AQUA_command", + /// IpAddress = "10.0.1.0", + /// Port = "49513", + /// Protocol = "TCP", + /// }, + /// }, + /// }, + /// }, + /// Direction = "Uplink", + /// Name = "RHCP_UL", + /// Polarization = "RHCP", + /// }, + /// }, + /// NetworkConfigurationSubnetId = exampleSubnet.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Contact profile can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Orbital/Spacecraft.cs b/sdk/dotnet/Orbital/Spacecraft.cs index 0aae555251..07abc78572 100644 --- a/sdk/dotnet/Orbital/Spacecraft.cs +++ b/sdk/dotnet/Orbital/Spacecraft.cs @@ -12,6 +12,52 @@ namespace Pulumi.Azure.Orbital /// /// Manages a Spacecraft. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSpacecraft = new Azure.Orbital.Spacecraft("exampleSpacecraft", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "westeurope", + /// NoradId = "12345", + /// Links = new[] + /// { + /// new Azure.Orbital.Inputs.SpacecraftLinkArgs + /// { + /// BandwidthMhz = 100, + /// CenterFrequencyMhz = 101, + /// Direction = "Uplink", + /// Polarization = "LHCP", + /// Name = "examplename", + /// }, + /// }, + /// TwoLineElements = new[] + /// { + /// "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + /// "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + /// }, + /// TitleLine = "AQUA", + /// Tags = + /// { + /// { "aks-managed-cluster-name", "9a57225d-a405-4d40-aa46-f13d2342abef" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PaloAlto/LocalRulestack.cs b/sdk/dotnet/PaloAlto/LocalRulestack.cs index 2d62d69591..b8312111d7 100644 --- a/sdk/dotnet/PaloAlto/LocalRulestack.cs +++ b/sdk/dotnet/PaloAlto/LocalRulestack.cs @@ -12,6 +12,30 @@ namespace Pulumi.Azure.PaloAlto /// /// Manages a Palo Alto Networks Rulestack. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLocalRulestack = new Azure.PaloAlto.LocalRulestack("exampleLocalRulestack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Palo Alto Networks Rulestacks can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PaloAlto/LocalRulestackCertificate.cs b/sdk/dotnet/PaloAlto/LocalRulestackCertificate.cs index c7edaa4651..c8e7eeb493 100644 --- a/sdk/dotnet/PaloAlto/LocalRulestackCertificate.cs +++ b/sdk/dotnet/PaloAlto/LocalRulestackCertificate.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.PaloAlto /// /// Manages a Palo Alto Networks Rulestack Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLocalRulestack = new Azure.PaloAlto.LocalRulestack("exampleLocalRulestack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLocalRulestackCertificate = new Azure.PaloAlto.LocalRulestackCertificate("exampleLocalRulestackCertificate", new() + /// { + /// RulestackId = exampleLocalRulestack.Id, + /// SelfSigned = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Palo Alto Networks Rulestack Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PaloAlto/LocalRulestackFqdnList.cs b/sdk/dotnet/PaloAlto/LocalRulestackFqdnList.cs index 9b3ae4984a..64b3658c32 100644 --- a/sdk/dotnet/PaloAlto/LocalRulestackFqdnList.cs +++ b/sdk/dotnet/PaloAlto/LocalRulestackFqdnList.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.PaloAlto /// /// Manages a Palo Alto Local Rulestack FQDN List. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLocalRulestack = new Azure.PaloAlto.LocalRulestack("exampleLocalRulestack", new() + /// { + /// ResourceGroupName = azurerm_resrouce_group.Example.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLocalRulestackFqdnList = new Azure.PaloAlto.LocalRulestackFqdnList("exampleLocalRulestackFqdnList", new() + /// { + /// RulestackId = exampleLocalRulestack.Id, + /// FullyQualifiedDomainNames = new[] + /// { + /// "contoso.com", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Palo Alto Local Rulestack FQDN Lists can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PaloAlto/LocalRulestackOutboundTrustCertificateAssociation.cs b/sdk/dotnet/PaloAlto/LocalRulestackOutboundTrustCertificateAssociation.cs index 5aeb6dc07a..cc9753c860 100644 --- a/sdk/dotnet/PaloAlto/LocalRulestackOutboundTrustCertificateAssociation.cs +++ b/sdk/dotnet/PaloAlto/LocalRulestackOutboundTrustCertificateAssociation.cs @@ -11,6 +11,41 @@ namespace Pulumi.Azure.PaloAlto { /// /// Manages a Palo Alto Networks Rulestack Outbound Trust Certificate Association. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLocalRulestack = new Azure.PaloAlto.LocalRulestack("exampleLocalRulestack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLocalRulestackCertificate = new Azure.PaloAlto.LocalRulestackCertificate("exampleLocalRulestackCertificate", new() + /// { + /// RulestackId = exampleLocalRulestack.Id, + /// SelfSigned = true, + /// }); + /// + /// var exampleLocalRulestackOutboundTrustCertificateAssociation = new Azure.PaloAlto.LocalRulestackOutboundTrustCertificateAssociation("exampleLocalRulestackOutboundTrustCertificateAssociation", new() + /// { + /// CertificateId = exampleLocalRulestackCertificate.Id, + /// }); + /// + /// }); + /// ``` /// [AzureResourceType("azure:paloalto/localRulestackOutboundTrustCertificateAssociation:LocalRulestackOutboundTrustCertificateAssociation")] public partial class LocalRulestackOutboundTrustCertificateAssociation : global::Pulumi.CustomResource diff --git a/sdk/dotnet/PaloAlto/LocalRulestackOutboundUntrustCertificateAssociation.cs b/sdk/dotnet/PaloAlto/LocalRulestackOutboundUntrustCertificateAssociation.cs index ae6cefc8a6..0968c48366 100644 --- a/sdk/dotnet/PaloAlto/LocalRulestackOutboundUntrustCertificateAssociation.cs +++ b/sdk/dotnet/PaloAlto/LocalRulestackOutboundUntrustCertificateAssociation.cs @@ -11,6 +11,41 @@ namespace Pulumi.Azure.PaloAlto { /// /// Manages a Palo Alto Networks Rulestack Outbound Untrust Certificate Association. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLocalRulestack = new Azure.PaloAlto.LocalRulestack("exampleLocalRulestack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLocalRulestackCertificate = new Azure.PaloAlto.LocalRulestackCertificate("exampleLocalRulestackCertificate", new() + /// { + /// RulestackId = exampleLocalRulestack.Id, + /// SelfSigned = true, + /// }); + /// + /// var exampleLocalRulestackOutboundUntrustCertificateAssociation = new Azure.PaloAlto.LocalRulestackOutboundUntrustCertificateAssociation("exampleLocalRulestackOutboundUntrustCertificateAssociation", new() + /// { + /// CertificateId = exampleLocalRulestackCertificate.Id, + /// }); + /// + /// }); + /// ``` /// [AzureResourceType("azure:paloalto/localRulestackOutboundUntrustCertificateAssociation:LocalRulestackOutboundUntrustCertificateAssociation")] public partial class LocalRulestackOutboundUntrustCertificateAssociation : global::Pulumi.CustomResource diff --git a/sdk/dotnet/PaloAlto/LocalRulestackPrefixList.cs b/sdk/dotnet/PaloAlto/LocalRulestackPrefixList.cs index 6ff01b4568..2feaa87950 100644 --- a/sdk/dotnet/PaloAlto/LocalRulestackPrefixList.cs +++ b/sdk/dotnet/PaloAlto/LocalRulestackPrefixList.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.PaloAlto /// /// Manages a Palo Alto Local Rulestack Prefix List. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLocalRulestack = new Azure.PaloAlto.LocalRulestack("exampleLocalRulestack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLocalRulestackPrefixList = new Azure.PaloAlto.LocalRulestackPrefixList("exampleLocalRulestackPrefixList", new() + /// { + /// RulestackId = exampleLocalRulestack.Id, + /// PrefixLists = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Palo Alto Local Rulestack Prefix Lists can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PaloAlto/LocalRulestackRule.cs b/sdk/dotnet/PaloAlto/LocalRulestackRule.cs index 339df5f7b8..173f396634 100644 --- a/sdk/dotnet/PaloAlto/LocalRulestackRule.cs +++ b/sdk/dotnet/PaloAlto/LocalRulestackRule.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.PaloAlto /// /// Manages a Palo Alto Local Rulestack Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleLocalRulestack = new Azure.PaloAlto.LocalRulestack("exampleLocalRulestack", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLocalRulestackRule = new Azure.PaloAlto.LocalRulestackRule("exampleLocalRulestackRule", new() + /// { + /// RulestackId = exampleLocalRulestack.Id, + /// Priority = 1000, + /// Action = "Allow", + /// Applications = new[] + /// { + /// "any", + /// }, + /// Source = new Azure.PaloAlto.Inputs.LocalRulestackRuleSourceArgs + /// { + /// Cidrs = new[] + /// { + /// "10.0.0.0/8", + /// }, + /// }, + /// Destination = new Azure.PaloAlto.Inputs.LocalRulestackRuleDestinationArgs + /// { + /// Cidrs = new[] + /// { + /// "192.168.16.0/24", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Palo Alto Local Rulestack Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PaloAlto/NextGenerationFirewallVirtualNetworkPanorama.cs b/sdk/dotnet/PaloAlto/NextGenerationFirewallVirtualNetworkPanorama.cs index d9781a51ce..e0917d231e 100644 --- a/sdk/dotnet/PaloAlto/NextGenerationFirewallVirtualNetworkPanorama.cs +++ b/sdk/dotnet/PaloAlto/NextGenerationFirewallVirtualNetworkPanorama.cs @@ -12,6 +12,134 @@ namespace Pulumi.Azure.PaloAlto /// /// Manages a Palo Alto Next Generation Firewall Virtual Network Panorama. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "westeurope", + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// Sku = "Standard", + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = azurerm_resource_group.Test.Location, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// var trustSubnet = new Azure.Network.Subnet("trustSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.1.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "trusted", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "PaloAltoNetworks.Cloudngfw/firewalls", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var trustSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("trustSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = trustSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// var untrustSubnet = new Azure.Network.Subnet("untrustSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "untrusted", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "PaloAltoNetworks.Cloudngfw/firewalls", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var untrustSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("untrustSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = untrustSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// var exampleNextGenerationFirewallVirtualNetworkPanorama = new Azure.PaloAlto.NextGenerationFirewallVirtualNetworkPanorama("exampleNextGenerationFirewallVirtualNetworkPanorama", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PanoramaBase64Config = "e2RnbmFtZTogY25nZnctYXotZXhhbXBsZSwgdHBsbmFtZTogY25nZnctZXhhbXBsZS10ZW1wbGF0ZS1zdGFjaywgZXhhbXBsZS1wYW5vcmFtYS1zZXJ2ZXI6IDE5Mi4xNjguMC4xLCB2bS1hdXRoLWtleTogMDAwMDAwMDAwMDAwMDAwLCBleHBpcnk6IDIwMjQvMDcvMzF9Cg==", + /// NetworkProfile = new Azure.PaloAlto.Inputs.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileArgs + /// { + /// PublicIpAddressIds = new[] + /// { + /// examplePublicIp.Id, + /// }, + /// VnetConfiguration = new Azure.PaloAlto.Inputs.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileVnetConfigurationArgs + /// { + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// TrustedSubnetId = trustSubnet.Id, + /// UntrustedSubnetId = untrustSubnet.Id, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Palo Alto Next Generation Firewall Virtual Network Panoramas can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Pim/ActiveRoleAssignment.cs b/sdk/dotnet/Pim/ActiveRoleAssignment.cs index 72f6dd8bbf..dedf84aa83 100644 --- a/sdk/dotnet/Pim/ActiveRoleAssignment.cs +++ b/sdk/dotnet/Pim/ActiveRoleAssignment.cs @@ -13,6 +13,101 @@ namespace Pulumi.Azure.Pim /// Manages a Pim Active Role Assignment. /// /// ## Example Usage + /// ### Subscription) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Time = Pulumiverse.Time; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// Name = "Reader", + /// }); + /// + /// var exampleStatic = new Time.Static("exampleStatic"); + /// + /// var exampleActiveRoleAssignment = new Azure.Pim.ActiveRoleAssignment("exampleActiveRoleAssignment", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionId = Output.Tuple(primary, exampleRoleDefinition).Apply(values => + /// { + /// var primary = values.Item1; + /// var exampleRoleDefinition = values.Item2; + /// return $"{primary.Apply(getSubscriptionResult => getSubscriptionResult.Id)}{exampleRoleDefinition.Apply(getRoleDefinitionResult => getRoleDefinitionResult.Id)}"; + /// }), + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// Schedule = new Azure.Pim.Inputs.ActiveRoleAssignmentScheduleArgs + /// { + /// StartDateTime = exampleStatic.Rfc3339, + /// Expiration = new Azure.Pim.Inputs.ActiveRoleAssignmentScheduleExpirationArgs + /// { + /// DurationHours = 8, + /// }, + /// }, + /// Justification = "Expiration Duration Set", + /// Ticket = new Azure.Pim.Inputs.ActiveRoleAssignmentTicketArgs + /// { + /// Number = "1", + /// System = "example ticket system", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Management Group) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Time = Pulumiverse.Time; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// Name = "Reader", + /// }); + /// + /// var exampleGroup = new Azure.Management.Group("exampleGroup"); + /// + /// var exampleStatic = new Time.Static("exampleStatic"); + /// + /// var exampleActiveRoleAssignment = new Azure.Pim.ActiveRoleAssignment("exampleActiveRoleAssignment", new() + /// { + /// Scope = exampleGroup.Id, + /// RoleDefinitionId = exampleRoleDefinition.Apply(getRoleDefinitionResult => getRoleDefinitionResult.Id), + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// Schedule = new Azure.Pim.Inputs.ActiveRoleAssignmentScheduleArgs + /// { + /// StartDateTime = exampleStatic.Rfc3339, + /// Expiration = new Azure.Pim.Inputs.ActiveRoleAssignmentScheduleExpirationArgs + /// { + /// DurationHours = 8, + /// }, + /// }, + /// Justification = "Expiration Duration Set", + /// Ticket = new Azure.Pim.Inputs.ActiveRoleAssignmentTicketArgs + /// { + /// Number = "1", + /// System = "example ticket system", + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Pim/EligibleRoleAssignment.cs b/sdk/dotnet/Pim/EligibleRoleAssignment.cs index cf21dd0cc9..b8dfec98b7 100644 --- a/sdk/dotnet/Pim/EligibleRoleAssignment.cs +++ b/sdk/dotnet/Pim/EligibleRoleAssignment.cs @@ -13,6 +13,101 @@ namespace Pulumi.Azure.Pim /// Manages a Pim Eligible Role Assignment. /// /// ## Example Usage + /// ### Subscription) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Time = Pulumiverse.Time; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// Name = "Reader", + /// }); + /// + /// var exampleStatic = new Time.Static("exampleStatic"); + /// + /// var exampleEligibleRoleAssignment = new Azure.Pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionId = Output.Tuple(primary, exampleRoleDefinition).Apply(values => + /// { + /// var primary = values.Item1; + /// var exampleRoleDefinition = values.Item2; + /// return $"{primary.Apply(getSubscriptionResult => getSubscriptionResult.Id)}{exampleRoleDefinition.Apply(getRoleDefinitionResult => getRoleDefinitionResult.Id)}"; + /// }), + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// Schedule = new Azure.Pim.Inputs.EligibleRoleAssignmentScheduleArgs + /// { + /// StartDateTime = exampleStatic.Rfc3339, + /// Expiration = new Azure.Pim.Inputs.EligibleRoleAssignmentScheduleExpirationArgs + /// { + /// DurationHours = 8, + /// }, + /// }, + /// Justification = "Expiration Duration Set", + /// Ticket = new Azure.Pim.Inputs.EligibleRoleAssignmentTicketArgs + /// { + /// Number = "1", + /// System = "example ticket system", + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Management Group) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Time = Pulumiverse.Time; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = Azure.Authorization.GetRoleDefinition.Invoke(new() + /// { + /// Name = "Reader", + /// }); + /// + /// var exampleGroup = new Azure.Management.Group("exampleGroup"); + /// + /// var exampleStatic = new Time.Static("exampleStatic"); + /// + /// var exampleEligibleRoleAssignment = new Azure.Pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", new() + /// { + /// Scope = exampleGroup.Id, + /// RoleDefinitionId = exampleRoleDefinition.Apply(getRoleDefinitionResult => getRoleDefinitionResult.Id), + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// Schedule = new Azure.Pim.Inputs.EligibleRoleAssignmentScheduleArgs + /// { + /// StartDateTime = exampleStatic.Rfc3339, + /// Expiration = new Azure.Pim.Inputs.EligibleRoleAssignmentScheduleExpirationArgs + /// { + /// DurationHours = 8, + /// }, + /// }, + /// Justification = "Expiration Duration Set", + /// Ticket = new Azure.Pim.Inputs.EligibleRoleAssignmentTicketArgs + /// { + /// Number = "1", + /// System = "example ticket system", + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Policy/Definition.cs b/sdk/dotnet/Policy/Definition.cs index b376a9122f..4186f7f5d8 100644 --- a/sdk/dotnet/Policy/Definition.cs +++ b/sdk/dotnet/Policy/Definition.cs @@ -14,6 +14,57 @@ namespace Pulumi.Azure.Policy /// /// Policy definitions do not take effect until they are assigned to a scope using a Policy Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var policy = new Azure.Policy.Definition("policy", new() + /// { + /// DisplayName = "acceptance test policy definition", + /// Metadata = @" { + /// ""category"": ""General"" + /// } + /// + /// + /// ", + /// Mode = "Indexed", + /// Parameters = @" { + /// ""allowedLocations"": { + /// ""type"": ""Array"", + /// ""metadata"": { + /// ""description"": ""The list of allowed locations for resources."", + /// ""displayName"": ""Allowed locations"", + /// ""strongType"": ""location"" + /// } + /// } + /// } + /// + /// ", + /// PolicyRule = @" { + /// ""if"": { + /// ""not"": { + /// ""field"": ""location"", + /// ""in"": ""[parameters('allowedLocations')]"" + /// } + /// }, + /// ""then"": { + /// ""effect"": ""audit"" + /// } + /// } + /// + /// ", + /// PolicyType = "Custom", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Policy Definitions can be imported using the `policy name`, e.g. diff --git a/sdk/dotnet/Policy/GetPolicyAssignment.cs b/sdk/dotnet/Policy/GetPolicyAssignment.cs index 6da1eb5fcc..96fe2316a3 100644 --- a/sdk/dotnet/Policy/GetPolicyAssignment.cs +++ b/sdk/dotnet/Policy/GetPolicyAssignment.cs @@ -13,12 +13,66 @@ public static class GetPolicyAssignment { /// /// Use this data source to access information about an existing Policy Assignment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicyAssignment.Invoke(new() + /// { + /// Name = "existing", + /// ScopeId = data.Azurerm_resource_group.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicyAssignmentResult => getPolicyAssignmentResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPolicyAssignmentArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:policy/getPolicyAssignment:getPolicyAssignment", args ?? new GetPolicyAssignmentArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Policy Assignment. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicyAssignment.Invoke(new() + /// { + /// Name = "existing", + /// ScopeId = data.Azurerm_resource_group.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicyAssignmentResult => getPolicyAssignmentResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPolicyAssignmentInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:policy/getPolicyAssignment:getPolicyAssignment", args ?? new GetPolicyAssignmentInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Policy/GetPolicyDefintion.cs b/sdk/dotnet/Policy/GetPolicyDefintion.cs index 577ee2c369..9702d37295 100644 --- a/sdk/dotnet/Policy/GetPolicyDefintion.cs +++ b/sdk/dotnet/Policy/GetPolicyDefintion.cs @@ -13,12 +13,64 @@ public static class GetPolicyDefintion { /// /// Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicyDefintion.Invoke(new() + /// { + /// DisplayName = "Allowed resource types", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicyDefintionResult => getPolicyDefintionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPolicyDefintionArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:policy/getPolicyDefintion:getPolicyDefintion", args ?? new GetPolicyDefintionArgs(), options.WithDefaults()); /// /// Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicyDefintion.Invoke(new() + /// { + /// DisplayName = "Allowed resource types", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicyDefintionResult => getPolicyDefintionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPolicyDefintionInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:policy/getPolicyDefintion:getPolicyDefintion", args ?? new GetPolicyDefintionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Policy/GetPolicyDefintionBuiltIn.cs b/sdk/dotnet/Policy/GetPolicyDefintionBuiltIn.cs index 7fb1e19b3d..8596c09bc2 100644 --- a/sdk/dotnet/Policy/GetPolicyDefintionBuiltIn.cs +++ b/sdk/dotnet/Policy/GetPolicyDefintionBuiltIn.cs @@ -13,12 +13,64 @@ public static class GetPolicyDefintionBuiltIn { /// /// Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicyDefintionBuiltIn.Invoke(new() + /// { + /// DisplayName = "Allowed resource types", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicyDefintionBuiltInResult => getPolicyDefintionBuiltInResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPolicyDefintionBuiltInArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:policy/getPolicyDefintionBuiltIn:getPolicyDefintionBuiltIn", args ?? new GetPolicyDefintionBuiltInArgs(), options.WithDefaults()); /// /// Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicyDefintionBuiltIn.Invoke(new() + /// { + /// DisplayName = "Allowed resource types", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicyDefintionBuiltInResult => getPolicyDefintionBuiltInResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPolicyDefintionBuiltInInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:policy/getPolicyDefintionBuiltIn:getPolicyDefintionBuiltIn", args ?? new GetPolicyDefintionBuiltInInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Policy/GetPolicySetDefinition.cs b/sdk/dotnet/Policy/GetPolicySetDefinition.cs index fc17a732a2..e7a4836e53 100644 --- a/sdk/dotnet/Policy/GetPolicySetDefinition.cs +++ b/sdk/dotnet/Policy/GetPolicySetDefinition.cs @@ -13,12 +13,64 @@ public static class GetPolicySetDefinition { /// /// Use this data source to access information about an existing Policy Set Definition. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicySetDefinition.Invoke(new() + /// { + /// DisplayName = "Policy Set Definition Example", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicySetDefinitionResult => getPolicySetDefinitionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPolicySetDefinitionArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:policy/getPolicySetDefinition:getPolicySetDefinition", args ?? new GetPolicySetDefinitionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Policy Set Definition. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetPolicySetDefinition.Invoke(new() + /// { + /// DisplayName = "Policy Set Definition Example", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getPolicySetDefinitionResult => getPolicySetDefinitionResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPolicySetDefinitionInvokeArgs? args = null, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:policy/getPolicySetDefinition:getPolicySetDefinition", args ?? new GetPolicySetDefinitionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Policy/GetVirtualMachineConfigurationAssignment.cs b/sdk/dotnet/Policy/GetVirtualMachineConfigurationAssignment.cs index 218fa3a0ca..5c2cd78681 100644 --- a/sdk/dotnet/Policy/GetVirtualMachineConfigurationAssignment.cs +++ b/sdk/dotnet/Policy/GetVirtualMachineConfigurationAssignment.cs @@ -13,12 +13,68 @@ public static class GetVirtualMachineConfigurationAssignment { /// /// Use this data source to access information about an existing Guest Configuration Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetVirtualMachineConfigurationAssignment.Invoke(new() + /// { + /// Name = "AzureWindowsBaseline", + /// ResourceGroupName = "example-RG", + /// VirtualMachineName = "example-vm", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["complianceStatus"] = example.Apply(getVirtualMachineConfigurationAssignmentResult => getVirtualMachineConfigurationAssignmentResult.ComplianceStatus), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVirtualMachineConfigurationAssignmentArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:policy/getVirtualMachineConfigurationAssignment:getVirtualMachineConfigurationAssignment", args ?? new GetVirtualMachineConfigurationAssignmentArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Guest Configuration Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Policy.GetVirtualMachineConfigurationAssignment.Invoke(new() + /// { + /// Name = "AzureWindowsBaseline", + /// ResourceGroupName = "example-RG", + /// VirtualMachineName = "example-vm", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["complianceStatus"] = example.Apply(getVirtualMachineConfigurationAssignmentResult => getVirtualMachineConfigurationAssignmentResult.ComplianceStatus), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVirtualMachineConfigurationAssignmentInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:policy/getVirtualMachineConfigurationAssignment:getVirtualMachineConfigurationAssignment", args ?? new GetVirtualMachineConfigurationAssignmentInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Policy/PolicySetDefinition.cs b/sdk/dotnet/Policy/PolicySetDefinition.cs index 6d2783f483..2574be8901 100644 --- a/sdk/dotnet/Policy/PolicySetDefinition.cs +++ b/sdk/dotnet/Policy/PolicySetDefinition.cs @@ -14,6 +14,49 @@ namespace Pulumi.Azure.Policy /// /// > **NOTE:** Policy set definitions (also known as policy initiatives) do not take effect until they are assigned to a scope using a Policy Set Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Policy.PolicySetDefinition("example", new() + /// { + /// DisplayName = "Test Policy Set", + /// Parameters = @" { + /// ""allowedLocations"": { + /// ""type"": ""Array"", + /// ""metadata"": { + /// ""description"": ""The list of allowed locations for resources."", + /// ""displayName"": ""Allowed locations"", + /// ""strongType"": ""location"" + /// } + /// } + /// } + /// + /// ", + /// PolicyDefinitionReferences = new[] + /// { + /// new Azure.Policy.Inputs.PolicySetDefinitionPolicyDefinitionReferenceArgs + /// { + /// ParameterValues = @" { + /// ""listOfAllowedLocations"": {""value"": ""[parameters('allowedLocations')]""} + /// } + /// + /// ", + /// PolicyDefinitionId = "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", + /// }, + /// }, + /// PolicyType = "Custom", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Policy Set Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Policy/VirtualMachineConfigurationAssignment.cs b/sdk/dotnet/Policy/VirtualMachineConfigurationAssignment.cs index 44faff0a33..314836fd2d 100644 --- a/sdk/dotnet/Policy/VirtualMachineConfigurationAssignment.cs +++ b/sdk/dotnet/Policy/VirtualMachineConfigurationAssignment.cs @@ -14,6 +14,136 @@ namespace Pulumi.Azure.Policy /// /// > **NOTE:** You can create Guest Configuration Policies without defining a `azure.compute.Extension` resource, however the policies will not be executed until a `azure.compute.Extension` has been provisioned to the virtual machine. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleWindowsVirtualMachine = new Azure.Compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Size = "Standard_F2", + /// AdminUsername = "adminuser", + /// AdminPassword = "P@$$w0rd1234!", + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// Identity = new Azure.Compute.Inputs.WindowsVirtualMachineIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// OsDisk = new Azure.Compute.Inputs.WindowsVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.WindowsVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "MicrosoftWindowsServer", + /// Offer = "WindowsServer", + /// Sku = "2019-Datacenter", + /// Version = "latest", + /// }, + /// }); + /// + /// var exampleExtension = new Azure.Compute.Extension("exampleExtension", new() + /// { + /// VirtualMachineId = exampleWindowsVirtualMachine.Id, + /// Publisher = "Microsoft.GuestConfiguration", + /// Type = "ConfigurationforWindows", + /// TypeHandlerVersion = "1.29", + /// AutoUpgradeMinorVersion = true, + /// }); + /// + /// var exampleVirtualMachineConfigurationAssignment = new Azure.Policy.VirtualMachineConfigurationAssignment("exampleVirtualMachineConfigurationAssignment", new() + /// { + /// Location = exampleWindowsVirtualMachine.Location, + /// VirtualMachineId = exampleWindowsVirtualMachine.Id, + /// Configuration = new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationArgs + /// { + /// AssignmentType = "ApplyAndMonitor", + /// Version = "1.*", + /// Parameters = new[] + /// { + /// new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs + /// { + /// Name = "Minimum Password Length;ExpectedValue", + /// Value = "16", + /// }, + /// new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs + /// { + /// Name = "Minimum Password Age;ExpectedValue", + /// Value = "0", + /// }, + /// new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs + /// { + /// Name = "Maximum Password Age;ExpectedValue", + /// Value = "30,45", + /// }, + /// new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs + /// { + /// Name = "Enforce Password History;ExpectedValue", + /// Value = "10", + /// }, + /// new Azure.Policy.Inputs.VirtualMachineConfigurationAssignmentConfigurationParameterArgs + /// { + /// Name = "Password Must Meet Complexity Requirements;ExpectedValue", + /// Value = "1", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Policy Virtual Machine Configuration Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Portal/Dashboard.cs b/sdk/dotnet/Portal/Dashboard.cs index 568edf50bf..ccf50c63c4 100644 --- a/sdk/dotnet/Portal/Dashboard.cs +++ b/sdk/dotnet/Portal/Dashboard.cs @@ -14,6 +14,151 @@ namespace Pulumi.Azure.Portal /// /// !> **Note:** The `azure.portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.portal.PortalDashboard` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var config = new Config(); + /// var mdContent = config.Get("mdContent") ?? "# Hello all :)"; + /// var videoLink = config.Get("videoLink") ?? "https://www.youtube.com/watch?v=......"; + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var my_board = new Azure.Portal.Dashboard("my-board", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// Tags = + /// { + /// { "source", "managed" }, + /// }, + /// DashboardProperties = @$"{{ + /// ""lenses"": {{ + /// ""0"": {{ + /// ""order"": 0, + /// ""parts"": {{ + /// ""0"": {{ + /// ""position"": {{ + /// ""x"": 0, + /// ""y"": 0, + /// ""rowSpan"": 2, + /// ""colSpan"": 3 + /// }}, + /// ""metadata"": {{ + /// ""inputs"": [], + /// ""type"": ""Extension/HubsExtension/PartType/MarkdownPart"", + /// ""settings"": {{ + /// ""content"": {{ + /// ""settings"": {{ + /// ""content"": ""{mdContent}"", + /// ""subtitle"": """", + /// ""title"": """" + /// }} + /// }} + /// }} + /// }} + /// }}, + /// ""1"": {{ + /// ""position"": {{ + /// ""x"": 5, + /// ""y"": 0, + /// ""rowSpan"": 4, + /// ""colSpan"": 6 + /// }}, + /// ""metadata"": {{ + /// ""inputs"": [], + /// ""type"": ""Extension/HubsExtension/PartType/VideoPart"", + /// ""settings"": {{ + /// ""content"": {{ + /// ""settings"": {{ + /// ""title"": ""Important Information"", + /// ""subtitle"": """", + /// ""src"": ""{videoLink}"", + /// ""autoplay"": true + /// }} + /// }} + /// }} + /// }} + /// }}, + /// ""2"": {{ + /// ""position"": {{ + /// ""x"": 0, + /// ""y"": 4, + /// ""rowSpan"": 4, + /// ""colSpan"": 6 + /// }}, + /// ""metadata"": {{ + /// ""inputs"": [ + /// {{ + /// ""name"": ""ComponentId"", + /// ""value"": ""/subscriptions/{current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId)}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp"" + /// }} + /// ], + /// ""type"": ""Extension/AppInsightsExtension/PartType/AppMapGalPt"", + /// ""settings"": {{}}, + /// ""asset"": {{ + /// ""idInputName"": ""ComponentId"", + /// ""type"": ""ApplicationInsights"" + /// }} + /// }} + /// }} + /// }} + /// }} + /// }}, + /// ""metadata"": {{ + /// ""model"": {{ + /// ""timeRange"": {{ + /// ""value"": {{ + /// ""relative"": {{ + /// ""duration"": 24, + /// ""timeUnit"": 1 + /// }} + /// }}, + /// ""type"": ""MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"" + /// }}, + /// ""filterLocale"": {{ + /// ""value"": ""en-us"" + /// }}, + /// ""filters"": {{ + /// ""value"": {{ + /// ""MsPortalFx_TimeRange"": {{ + /// ""model"": {{ + /// ""format"": ""utc"", + /// ""granularity"": ""auto"", + /// ""relative"": ""24h"" + /// }}, + /// ""displayCache"": {{ + /// ""name"": ""UTC Time"", + /// ""value"": ""Past 24 hours"" + /// }}, + /// ""filteredPartIds"": [ + /// ""StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7"" + /// ] + /// }} + /// }} + /// }} + /// }} + /// }} + /// }} + /// ", + /// }); + /// + /// }); + /// ``` + /// + /// It is recommended to follow the steps outlined + /// [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + /// /// ## Import /// /// Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Portal/GetDashboard.cs b/sdk/dotnet/Portal/GetDashboard.cs index a23f03d640..22202c3be7 100644 --- a/sdk/dotnet/Portal/GetDashboard.cs +++ b/sdk/dotnet/Portal/GetDashboard.cs @@ -13,12 +13,66 @@ public static class GetDashboard { /// /// Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Portal.GetDashboard.Invoke(new() + /// { + /// Name = "existing-dashboard", + /// ResourceGroupName = "dashboard-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_dashboard.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDashboardArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:portal/getDashboard:getDashboard", args ?? new GetDashboardArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Portal.GetDashboard.Invoke(new() + /// { + /// Name = "existing-dashboard", + /// ResourceGroupName = "dashboard-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = data.Azurerm_dashboard.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDashboardInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:portal/getDashboard:getDashboard", args ?? new GetDashboardInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PostgreSql/ActiveDirectoryAdministrator.cs b/sdk/dotnet/PostgreSql/ActiveDirectoryAdministrator.cs index 45450c95cb..84fbaea0b6 100644 --- a/sdk/dotnet/PostgreSql/ActiveDirectoryAdministrator.cs +++ b/sdk/dotnet/PostgreSql/ActiveDirectoryAdministrator.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.PostgreSql /// /// Allows you to set a user or group as the AD administrator for an PostgreSQL server in Azure /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "9.6", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// SkuName = "GP_Gen5_2", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleActiveDirectoryAdministrator = new Azure.PostgreSql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", new() + /// { + /// ServerName = exampleServer.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Login = "sqladmin", + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A PostgreSQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/Configuration.cs b/sdk/dotnet/PostgreSql/Configuration.cs index fdd288da32..3a4a9703d7 100644 --- a/sdk/dotnet/PostgreSql/Configuration.cs +++ b/sdk/dotnet/PostgreSql/Configuration.cs @@ -16,6 +16,47 @@ namespace Pulumi.Azure.PostgreSql /// /// > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = false, + /// AutoGrowEnabled = true, + /// AdministratorLogin = "psqladmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// Version = "9.5", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleConfiguration = new Azure.PostgreSql.Configuration("exampleConfiguration", new() + /// { + /// Name = "backslash_quote", + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Value = "on", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/Database.cs b/sdk/dotnet/PostgreSql/Database.cs index 493434bba6..42b8868bee 100644 --- a/sdk/dotnet/PostgreSql/Database.cs +++ b/sdk/dotnet/PostgreSql/Database.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.PostgreSql /// /// Manages a PostgreSQL Database within a PostgreSQL Server /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "B_Gen5_2", + /// StorageMb = 5120, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = false, + /// AutoGrowEnabled = true, + /// AdministratorLogin = "psqladmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// Version = "9.5", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleDatabase = new Azure.PostgreSql.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// Charset = "UTF8", + /// Collation = "English_United States.1252", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PostgreSQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/FirewallRule.cs b/sdk/dotnet/PostgreSql/FirewallRule.cs index 7aae88862a..ee57ab502f 100644 --- a/sdk/dotnet/PostgreSql/FirewallRule.cs +++ b/sdk/dotnet/PostgreSql/FirewallRule.cs @@ -13,6 +13,68 @@ namespace Pulumi.Azure.PostgreSql /// Manages a Firewall Rule for a PostgreSQL Server /// /// ## Example Usage + /// ### Single IP Address) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "GP_Gen5_2", + /// Version = "11", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleFirewallRule = new Azure.PostgreSql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "40.112.8.12", + /// EndIpAddress = "40.112.8.12", + /// }); + /// + /// }); + /// ``` + /// ### IP Range) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer"); + /// + /// // ... + /// var exampleFirewallRule = new Azure.PostgreSql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// StartIpAddress = "40.112.0.0", + /// EndIpAddress = "40.112.255.255", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/PostgreSql/FlexibleServer.cs b/sdk/dotnet/PostgreSql/FlexibleServer.cs index cda51a7ba3..a7a038e08a 100644 --- a/sdk/dotnet/PostgreSql/FlexibleServer.cs +++ b/sdk/dotnet/PostgreSql/FlexibleServer.cs @@ -12,6 +12,95 @@ namespace Pulumi.Azure.PostgreSql /// /// Manages a PostgreSQL Flexible Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Storage", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "fs", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.DBforPostgreSQL/flexibleServers", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleZoneVirtualNetworkLink = new Azure.PrivateDns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", new() + /// { + /// PrivateDnsZoneName = exampleZone.Name, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12", + /// DelegatedSubnetId = exampleSubnet.Id, + /// PrivateDnsZoneId = exampleZone.Id, + /// AdministratorLogin = "psqladmin", + /// AdministratorPassword = "H@Sh1CoR3!", + /// Zone = "1", + /// StorageMb = 32768, + /// SkuName = "GP_Standard_D4s_v3", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleZoneVirtualNetworkLink, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PostgreSQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/FlexibleServerActiveDirectoryAdministrator.cs b/sdk/dotnet/PostgreSql/FlexibleServerActiveDirectoryAdministrator.cs index 1cd4870be9..7acda1c03a 100644 --- a/sdk/dotnet/PostgreSql/FlexibleServerActiveDirectoryAdministrator.cs +++ b/sdk/dotnet/PostgreSql/FlexibleServerActiveDirectoryAdministrator.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.PostgreSql /// /// Allows you to set a user or group as the AD administrator for a PostgreSQL Flexible Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleServicePrincipal = AzureAD.GetServicePrincipal.Invoke(new() + /// { + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLogin = "adminTerraform", + /// AdministratorPassword = "QAZwsx123", + /// StorageMb = 32768, + /// Version = "12", + /// SkuName = "GP_Standard_D2s_v3", + /// Zone = "2", + /// Authentication = new Azure.PostgreSql.Inputs.FlexibleServerAuthenticationArgs + /// { + /// ActiveDirectoryAuthEnabled = true, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }, + /// }); + /// + /// var exampleFlexibleServerActiveDirectoryAdministrator = new Azure.PostgreSql.FlexibleServerActiveDirectoryAdministrator("exampleFlexibleServerActiveDirectoryAdministrator", new() + /// { + /// ServerName = exampleFlexibleServer.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.ObjectId), + /// PrincipalName = exampleServicePrincipal.Apply(getServicePrincipalResult => getServicePrincipalResult.DisplayName), + /// PrincipalType = "ServicePrincipal", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A PostgreSQL Flexible Server Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/FlexibleServerConfiguration.cs b/sdk/dotnet/PostgreSql/FlexibleServerConfiguration.cs index fb809b3e8d..4938a15a55 100644 --- a/sdk/dotnet/PostgreSql/FlexibleServerConfiguration.cs +++ b/sdk/dotnet/PostgreSql/FlexibleServerConfiguration.cs @@ -12,6 +12,75 @@ namespace Pulumi.Azure.PostgreSql /// /// Sets a PostgreSQL Configuration value on a Azure PostgreSQL Flexible Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12", + /// AdministratorLogin = "psqladmin", + /// AdministratorPassword = "H@Sh1CoR3!", + /// StorageMb = 32768, + /// SkuName = "GP_Standard_D4s_v3", + /// }); + /// + /// var exampleFlexibleServerConfiguration = new Azure.PostgreSql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", new() + /// { + /// ServerId = exampleFlexibleServer.Id, + /// Value = "on", + /// }); + /// + /// }); + /// ``` + /// ### Azure Extensions + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12", + /// AdministratorLogin = "psqladmin", + /// AdministratorPassword = "H@Sh1CoR3!", + /// StorageMb = 32768, + /// SkuName = "GP_Standard_D4s_v3", + /// }); + /// + /// var exampleFlexibleServerConfiguration = new Azure.PostgreSql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", new() + /// { + /// ServerId = exampleFlexibleServer.Id, + /// Value = "CUBE,CITEXT,BTREE_GIST", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/FlexibleServerDatabase.cs b/sdk/dotnet/PostgreSql/FlexibleServerDatabase.cs index 0cbac675d0..673a16fc9c 100644 --- a/sdk/dotnet/PostgreSql/FlexibleServerDatabase.cs +++ b/sdk/dotnet/PostgreSql/FlexibleServerDatabase.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.PostgreSql /// /// Manages a PostgreSQL Flexible Server Database. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12", + /// AdministratorLogin = "psqladmin", + /// AdministratorPassword = "H@Sh1CoR3!", + /// StorageMb = 32768, + /// SkuName = "GP_Standard_D4s_v3", + /// }); + /// + /// var exampleFlexibleServerDatabase = new Azure.PostgreSql.FlexibleServerDatabase("exampleFlexibleServerDatabase", new() + /// { + /// ServerId = exampleFlexibleServer.Id, + /// Collation = "en_US.utf8", + /// Charset = "utf8", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure PostgreSQL Flexible Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/FlexibleServerFirewallRule.cs b/sdk/dotnet/PostgreSql/FlexibleServerFirewallRule.cs index 203644dffb..eb3ef5690d 100644 --- a/sdk/dotnet/PostgreSql/FlexibleServerFirewallRule.cs +++ b/sdk/dotnet/PostgreSql/FlexibleServerFirewallRule.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.PostgreSql /// /// Manages a PostgreSQL Flexible Server Firewall Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleFlexibleServer = new Azure.PostgreSql.FlexibleServer("exampleFlexibleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12", + /// AdministratorLogin = "psqladmin", + /// AdministratorPassword = "H@Sh1CoR3!", + /// StorageMb = 32768, + /// SkuName = "GP_Standard_D4s_v3", + /// }); + /// + /// var exampleFlexibleServerFirewallRule = new Azure.PostgreSql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", new() + /// { + /// ServerId = exampleFlexibleServer.Id, + /// StartIpAddress = "122.122.0.0", + /// EndIpAddress = "122.122.0.0", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PostgreSQL Flexible Server Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/GetFlexibleServer.cs b/sdk/dotnet/PostgreSql/GetFlexibleServer.cs index 9d82fdb29c..8d959fdcda 100644 --- a/sdk/dotnet/PostgreSql/GetFlexibleServer.cs +++ b/sdk/dotnet/PostgreSql/GetFlexibleServer.cs @@ -13,12 +13,66 @@ public static class GetFlexibleServer { /// /// Use this data source to access information about an existing PostgreSQL Flexible Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PostgreSql.GetFlexibleServer.Invoke(new() + /// { + /// Name = "existing-postgresql-fs", + /// ResourceGroupName = "existing-postgresql-resgroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFlexibleServerResult => getFlexibleServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFlexibleServerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:postgresql/getFlexibleServer:getFlexibleServer", args ?? new GetFlexibleServerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing PostgreSQL Flexible Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PostgreSql.GetFlexibleServer.Invoke(new() + /// { + /// Name = "existing-postgresql-fs", + /// ResourceGroupName = "existing-postgresql-resgroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFlexibleServerResult => getFlexibleServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFlexibleServerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:postgresql/getFlexibleServer:getFlexibleServer", args ?? new GetFlexibleServerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PostgreSql/GetServer.cs b/sdk/dotnet/PostgreSql/GetServer.cs index e7387750c2..b683872d29 100644 --- a/sdk/dotnet/PostgreSql/GetServer.cs +++ b/sdk/dotnet/PostgreSql/GetServer.cs @@ -13,12 +13,66 @@ public static class GetServer { /// /// Use this data source to access information about an existing PostgreSQL Azure Database Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PostgreSql.GetServer.Invoke(new() + /// { + /// Name = "postgresql-server-1", + /// ResourceGroupName = "api-rg-pro", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["postgresqlServerId"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:postgresql/getServer:getServer", args ?? new GetServerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing PostgreSQL Azure Database Server. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PostgreSql.GetServer.Invoke(new() + /// { + /// Name = "postgresql-server-1", + /// ResourceGroupName = "api-rg-pro", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["postgresqlServerId"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:postgresql/getServer:getServer", args ?? new GetServerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PostgreSql/Server.cs b/sdk/dotnet/PostgreSql/Server.cs index afd3258dba..0ff8bf5619 100644 --- a/sdk/dotnet/PostgreSql/Server.cs +++ b/sdk/dotnet/PostgreSql/Server.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.PostgreSql /// /// Manages a PostgreSQL Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "psqladmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "GP_Gen5_4", + /// Version = "11", + /// StorageMb = 640000, + /// BackupRetentionDays = 7, + /// GeoRedundantBackupEnabled = true, + /// AutoGrowEnabled = true, + /// PublicNetworkAccessEnabled = false, + /// SslEnforcementEnabled = true, + /// SslMinimalTlsVersionEnforced = "TLS1_2", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PostgreSQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PostgreSql/ServerKey.cs b/sdk/dotnet/PostgreSql/ServerKey.cs index 9c7c01720e..f5282f1b0b 100644 --- a/sdk/dotnet/PostgreSql/ServerKey.cs +++ b/sdk/dotnet/PostgreSql/ServerKey.cs @@ -12,6 +12,125 @@ namespace Pulumi.Azure.PostgreSql /// /// Manages a Customer Managed Key for a PostgreSQL Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AdministratorLogin = "psqladmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// SkuName = "GP_Gen5_2", + /// Version = "11", + /// StorageMb = 51200, + /// SslEnforcementEnabled = true, + /// Identity = new Azure.PostgreSql.Inputs.ServerIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var server = new Azure.KeyVault.AccessPolicy("server", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleServer.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "UnwrapKey", + /// "WrapKey", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var client = new Azure.KeyVault.AccessPolicy("client", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "Delete", + /// "List", + /// "Restore", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// "Purge", + /// "Encrypt", + /// "Decrypt", + /// "Sign", + /// "Verify", + /// "GetRotationPolicy", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// client, + /// server, + /// }, + /// }); + /// + /// var exampleServerKey = new Azure.PostgreSql.ServerKey("exampleServerKey", new() + /// { + /// ServerId = exampleServer.Id, + /// KeyVaultKeyId = exampleKey.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A PostgreSQL Server Key can be imported using the `resource id` of the PostgreSQL Server Key, e.g. diff --git a/sdk/dotnet/PostgreSql/VirtualNetworkRule.cs b/sdk/dotnet/PostgreSql/VirtualNetworkRule.cs index 557a16c772..59b0302a55 100644 --- a/sdk/dotnet/PostgreSql/VirtualNetworkRule.cs +++ b/sdk/dotnet/PostgreSql/VirtualNetworkRule.cs @@ -14,6 +14,69 @@ namespace Pulumi.Azure.PostgreSql /// /// > **NOTE:** PostgreSQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/postgresql/concepts-data-access-and-security-vnet) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// }, + /// }); + /// + /// var exampleServer = new Azure.PostgreSql.Server("exampleServer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "GP_Gen5_2", + /// StorageMb = 5120, + /// BackupRetentionDays = 7, + /// AdministratorLogin = "psqladmin", + /// AdministratorLoginPassword = "H@Sh1CoR3!", + /// Version = "9.5", + /// SslEnforcementEnabled = true, + /// }); + /// + /// var exampleVirtualNetworkRule = new Azure.PostgreSql.VirtualNetworkRule("exampleVirtualNetworkRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleServer.Name, + /// SubnetId = @internal.Id, + /// IgnoreMissingVnetServiceEndpoint = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PostgreSQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PowerBI/Embedded.cs b/sdk/dotnet/PowerBI/Embedded.cs index 166ae11b66..fac79f796b 100644 --- a/sdk/dotnet/PowerBI/Embedded.cs +++ b/sdk/dotnet/PowerBI/Embedded.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.PowerBI /// /// Manages a PowerBI Embedded. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEmbedded = new Azure.PowerBI.Embedded("exampleEmbedded", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "A1", + /// Administrators = new[] + /// { + /// "azsdktest@microsoft.com", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// PowerBI Embedded can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/AAAARecord.cs b/sdk/dotnet/PrivateDns/AAAARecord.cs index d853dddc6d..d3a7268e77 100644 --- a/sdk/dotnet/PrivateDns/AAAARecord.cs +++ b/sdk/dotnet/PrivateDns/AAAARecord.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage DNS AAAA Records within Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var testZone = new Azure.PrivateDns.Zone("testZone", new() + /// { + /// ResourceGroupName = example.Name, + /// }); + /// + /// var testAAAARecord = new Azure.PrivateDns.AAAARecord("testAAAARecord", new() + /// { + /// ZoneName = testZone.Name, + /// ResourceGroupName = example.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// "fd5d:70bc:930e:d008:0000:0000:0000:7334", + /// "fd5d:70bc:930e:d008::7335", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS AAAA Records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/ARecord.cs b/sdk/dotnet/PrivateDns/ARecord.cs index c316e06ae3..854c31d9c6 100644 --- a/sdk/dotnet/PrivateDns/ARecord.cs +++ b/sdk/dotnet/PrivateDns/ARecord.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage DNS A Records within Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleARecord = new Azure.PrivateDns.ARecord("exampleARecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// "10.0.180.17", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS A Records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/CnameRecord.cs b/sdk/dotnet/PrivateDns/CnameRecord.cs index 8ca3af2aa3..82d4b4e868 100644 --- a/sdk/dotnet/PrivateDns/CnameRecord.cs +++ b/sdk/dotnet/PrivateDns/CnameRecord.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage DNS CNAME Records within Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleCnameRecord = new Azure.PrivateDns.CnameRecord("exampleCnameRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Record = "contoso.com", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS CName Records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/GetAAAARecord.cs b/sdk/dotnet/PrivateDns/GetAAAARecord.cs index b2be00331b..e685dcd4ad 100644 --- a/sdk/dotnet/PrivateDns/GetAAAARecord.cs +++ b/sdk/dotnet/PrivateDns/GetAAAARecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.PrivateDns { public static class GetAAAARecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.AAAARecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsAaaaRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetAAAARecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getAAAARecord:getAAAARecord", args ?? new GetAAAARecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.AAAARecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsAaaaRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetAAAARecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getAAAARecord:getAAAARecord", args ?? new GetAAAARecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/PrivateDns/GetARecord.cs b/sdk/dotnet/PrivateDns/GetARecord.cs index d5e071fbb6..c9cb570fc8 100644 --- a/sdk/dotnet/PrivateDns/GetARecord.cs +++ b/sdk/dotnet/PrivateDns/GetARecord.cs @@ -11,9 +11,67 @@ namespace Pulumi.Azure.PrivateDns { public static class GetARecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetARecord.Invoke(new() + /// { + /// Name = "test", + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsARecordId"] = example.Apply(getARecordResult => getARecordResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetARecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getARecord:getARecord", args ?? new GetARecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetARecord.Invoke(new() + /// { + /// Name = "test", + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsARecordId"] = example.Apply(getARecordResult => getARecordResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetARecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getARecord:getARecord", args ?? new GetARecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/PrivateDns/GetCnameRecord.cs b/sdk/dotnet/PrivateDns/GetCnameRecord.cs index 8969e90dab..1d62ce3555 100644 --- a/sdk/dotnet/PrivateDns/GetCnameRecord.cs +++ b/sdk/dotnet/PrivateDns/GetCnameRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.PrivateDns { public static class GetCnameRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.CnameRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsCnameRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetCnameRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getCnameRecord:getCnameRecord", args ?? new GetCnameRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.CnameRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsCnameRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetCnameRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getCnameRecord:getCnameRecord", args ?? new GetCnameRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/PrivateDns/GetDnsZone.cs b/sdk/dotnet/PrivateDns/GetDnsZone.cs index 5216993eb0..6aa671a19d 100644 --- a/sdk/dotnet/PrivateDns/GetDnsZone.cs +++ b/sdk/dotnet/PrivateDns/GetDnsZone.cs @@ -13,12 +13,66 @@ public static class GetDnsZone { /// /// Use this data source to access information about an existing Private DNS Zone. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetDnsZone.Invoke(new() + /// { + /// Name = "contoso.internal", + /// ResourceGroupName = "contoso-dns", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsZoneId"] = example.Apply(getDnsZoneResult => getDnsZoneResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDnsZoneArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getDnsZone:getDnsZone", args ?? new GetDnsZoneArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Private DNS Zone. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetDnsZone.Invoke(new() + /// { + /// Name = "contoso.internal", + /// ResourceGroupName = "contoso-dns", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsZoneId"] = example.Apply(getDnsZoneResult => getDnsZoneResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDnsZoneInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getDnsZone:getDnsZone", args ?? new GetDnsZoneInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/GetMxRecord.cs b/sdk/dotnet/PrivateDns/GetMxRecord.cs index b415f89db1..3355a0031d 100644 --- a/sdk/dotnet/PrivateDns/GetMxRecord.cs +++ b/sdk/dotnet/PrivateDns/GetMxRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.PrivateDns { public static class GetMxRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.MxRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsMxRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetMxRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getMxRecord:getMxRecord", args ?? new GetMxRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.MxRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsMxRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetMxRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getMxRecord:getMxRecord", args ?? new GetMxRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/PrivateDns/GetPtrRecord.cs b/sdk/dotnet/PrivateDns/GetPtrRecord.cs index 380d7cbe5b..057f1060d4 100644 --- a/sdk/dotnet/PrivateDns/GetPtrRecord.cs +++ b/sdk/dotnet/PrivateDns/GetPtrRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.PrivateDns { public static class GetPtrRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.PTRRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsPtrRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetPtrRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getPtrRecord:getPtrRecord", args ?? new GetPtrRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.PTRRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsPtrRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetPtrRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getPtrRecord:getPtrRecord", args ?? new GetPtrRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/PrivateDns/GetResolver.cs b/sdk/dotnet/PrivateDns/GetResolver.cs index 2333500136..95b784af3f 100644 --- a/sdk/dotnet/PrivateDns/GetResolver.cs +++ b/sdk/dotnet/PrivateDns/GetResolver.cs @@ -13,12 +13,58 @@ public static class GetResolver { /// /// Gets information about an existing Private DNS Resolver. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.PrivateDns.GetResolver.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resourcegroup-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetResolverArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getResolver:getResolver", args ?? new GetResolverArgs(), options.WithDefaults()); /// /// Gets information about an existing Private DNS Resolver. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var test = Azure.PrivateDns.GetResolver.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resourcegroup-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetResolverInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getResolver:getResolver", args ?? new GetResolverInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/GetResolverDnsForwardingRuleset.cs b/sdk/dotnet/PrivateDns/GetResolverDnsForwardingRuleset.cs index 2579ad6c69..ff97db6e6f 100644 --- a/sdk/dotnet/PrivateDns/GetResolverDnsForwardingRuleset.cs +++ b/sdk/dotnet/PrivateDns/GetResolverDnsForwardingRuleset.cs @@ -13,12 +13,58 @@ public static class GetResolverDnsForwardingRuleset { /// /// Gets information about an existing Private DNS Resolver Dns Forwarding Ruleset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverDnsForwardingRuleset.Invoke(new() + /// { + /// Name = "example-ruleset", + /// ResourceGroupName = "example-ruleset-resourcegroup", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetResolverDnsForwardingRulesetArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getResolverDnsForwardingRuleset:getResolverDnsForwardingRuleset", args ?? new GetResolverDnsForwardingRulesetArgs(), options.WithDefaults()); /// /// Gets information about an existing Private DNS Resolver Dns Forwarding Ruleset. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverDnsForwardingRuleset.Invoke(new() + /// { + /// Name = "example-ruleset", + /// ResourceGroupName = "example-ruleset-resourcegroup", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetResolverDnsForwardingRulesetInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getResolverDnsForwardingRuleset:getResolverDnsForwardingRuleset", args ?? new GetResolverDnsForwardingRulesetInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/GetResolverForwardingRule.cs b/sdk/dotnet/PrivateDns/GetResolverForwardingRule.cs index c5e7704c93..606578de37 100644 --- a/sdk/dotnet/PrivateDns/GetResolverForwardingRule.cs +++ b/sdk/dotnet/PrivateDns/GetResolverForwardingRule.cs @@ -13,12 +13,58 @@ public static class GetResolverForwardingRule { /// /// Gets information about an existing Private DNS Resolver Forwarding Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverForwardingRule.Invoke(new() + /// { + /// DnsForwardingRulesetId = "example-forwarding-rulset-id", + /// Name = "example-rule", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetResolverForwardingRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getResolverForwardingRule:getResolverForwardingRule", args ?? new GetResolverForwardingRuleArgs(), options.WithDefaults()); /// /// Gets information about an existing Private DNS Resolver Forwarding Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverForwardingRule.Invoke(new() + /// { + /// DnsForwardingRulesetId = "example-forwarding-rulset-id", + /// Name = "example-rule", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetResolverForwardingRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getResolverForwardingRule:getResolverForwardingRule", args ?? new GetResolverForwardingRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/GetResolverInboundEndpoint.cs b/sdk/dotnet/PrivateDns/GetResolverInboundEndpoint.cs index ce94841e8c..18d768dbf3 100644 --- a/sdk/dotnet/PrivateDns/GetResolverInboundEndpoint.cs +++ b/sdk/dotnet/PrivateDns/GetResolverInboundEndpoint.cs @@ -13,12 +13,58 @@ public static class GetResolverInboundEndpoint { /// /// Gets information about an existing Private DNS Resolver Inbound Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverInboundEndpoint.Invoke(new() + /// { + /// Name = "example-drie", + /// PrivateDnsResolverId = "example-private-dns-resolver-id", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetResolverInboundEndpointArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getResolverInboundEndpoint:getResolverInboundEndpoint", args ?? new GetResolverInboundEndpointArgs(), options.WithDefaults()); /// /// Gets information about an existing Private DNS Resolver Inbound Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverInboundEndpoint.Invoke(new() + /// { + /// Name = "example-drie", + /// PrivateDnsResolverId = "example-private-dns-resolver-id", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetResolverInboundEndpointInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getResolverInboundEndpoint:getResolverInboundEndpoint", args ?? new GetResolverInboundEndpointInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/GetResolverOutboundEndpoint.cs b/sdk/dotnet/PrivateDns/GetResolverOutboundEndpoint.cs index 6cfed82ad9..03410d1cea 100644 --- a/sdk/dotnet/PrivateDns/GetResolverOutboundEndpoint.cs +++ b/sdk/dotnet/PrivateDns/GetResolverOutboundEndpoint.cs @@ -13,12 +13,58 @@ public static class GetResolverOutboundEndpoint { /// /// Gets information about an existing Private DNS Resolver Outbound Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverOutboundEndpoint.Invoke(new() + /// { + /// Name = "example-endpoint", + /// PrivateDnsResolverId = "example-private-dns-resolver-id", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetResolverOutboundEndpointArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getResolverOutboundEndpoint:getResolverOutboundEndpoint", args ?? new GetResolverOutboundEndpointArgs(), options.WithDefaults()); /// /// Gets information about an existing Private DNS Resolver Outbound Endpoint. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverOutboundEndpoint.Invoke(new() + /// { + /// Name = "example-endpoint", + /// PrivateDnsResolverId = "example-private-dns-resolver-id", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetResolverOutboundEndpointInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getResolverOutboundEndpoint:getResolverOutboundEndpoint", args ?? new GetResolverOutboundEndpointInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/GetResolverVirtualNetworkLink.cs b/sdk/dotnet/PrivateDns/GetResolverVirtualNetworkLink.cs index fab0e711db..2431904243 100644 --- a/sdk/dotnet/PrivateDns/GetResolverVirtualNetworkLink.cs +++ b/sdk/dotnet/PrivateDns/GetResolverVirtualNetworkLink.cs @@ -13,12 +13,58 @@ public static class GetResolverVirtualNetworkLink { /// /// Gets information about an existing Private DNS Resolver Virtual Network Link. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverVirtualNetworkLink.Invoke(new() + /// { + /// DnsForwardingRulesetId = "example-dns-forwarding-ruleset-id", + /// Name = "example-link", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetResolverVirtualNetworkLinkArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getResolverVirtualNetworkLink:getResolverVirtualNetworkLink", args ?? new GetResolverVirtualNetworkLinkArgs(), options.WithDefaults()); /// /// Gets information about an existing Private DNS Resolver Virtual Network Link. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetResolverVirtualNetworkLink.Invoke(new() + /// { + /// DnsForwardingRulesetId = "example-dns-forwarding-ruleset-id", + /// Name = "example-link", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetResolverVirtualNetworkLinkInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getResolverVirtualNetworkLink:getResolverVirtualNetworkLink", args ?? new GetResolverVirtualNetworkLinkInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/GetSrvRecord.cs b/sdk/dotnet/PrivateDns/GetSrvRecord.cs index d2eeb0679d..7baf9b24e0 100644 --- a/sdk/dotnet/PrivateDns/GetSrvRecord.cs +++ b/sdk/dotnet/PrivateDns/GetSrvRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.PrivateDns { public static class GetSrvRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.SRVRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsSrvRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetSrvRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getSrvRecord:getSrvRecord", args ?? new GetSrvRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.SRVRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsSrvRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetSrvRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getSrvRecord:getSrvRecord", args ?? new GetSrvRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/PrivateDns/GetTxtRecord.cs b/sdk/dotnet/PrivateDns/GetTxtRecord.cs index aa7952c9ee..7a1bfdbe40 100644 --- a/sdk/dotnet/PrivateDns/GetTxtRecord.cs +++ b/sdk/dotnet/PrivateDns/GetTxtRecord.cs @@ -11,9 +11,65 @@ namespace Pulumi.Azure.PrivateDns { public static class GetTxtRecord { + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.TxtRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsTxtRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Task InvokeAsync(GetTxtRecordArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getTxtRecord:getTxtRecord", args ?? new GetTxtRecordArgs(), options.WithDefaults()); + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.PrivateDns.TxtRecord("example", new() + /// { + /// ZoneName = "test-zone", + /// ResourceGroupName = "test-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsTxtRecordId"] = example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// public static Output Invoke(GetTxtRecordInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getTxtRecord:getTxtRecord", args ?? new GetTxtRecordInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/PrivateDns/GetZoneVirtualNetworkLink.cs b/sdk/dotnet/PrivateDns/GetZoneVirtualNetworkLink.cs index de24f72444..1776d5bf2b 100644 --- a/sdk/dotnet/PrivateDns/GetZoneVirtualNetworkLink.cs +++ b/sdk/dotnet/PrivateDns/GetZoneVirtualNetworkLink.cs @@ -13,12 +13,68 @@ public static class GetZoneVirtualNetworkLink { /// /// Use this data source to access information about an existing Private DNS zone Virtual Network Link. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetZoneVirtualNetworkLink.Invoke(new() + /// { + /// Name = "test", + /// ResourceGroupName = "test-rg", + /// PrivateDnsZoneName = "test-zone", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsARecordId"] = example.Apply(getZoneVirtualNetworkLinkResult => getZoneVirtualNetworkLinkResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetZoneVirtualNetworkLinkArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatedns/getZoneVirtualNetworkLink:getZoneVirtualNetworkLink", args ?? new GetZoneVirtualNetworkLinkArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Private DNS zone Virtual Network Link. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateDns.GetZoneVirtualNetworkLink.Invoke(new() + /// { + /// Name = "test", + /// ResourceGroupName = "test-rg", + /// PrivateDnsZoneName = "test-zone", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateDnsARecordId"] = example.Apply(getZoneVirtualNetworkLinkResult => getZoneVirtualNetworkLinkResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetZoneVirtualNetworkLinkInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatedns/getZoneVirtualNetworkLink:getZoneVirtualNetworkLink", args ?? new GetZoneVirtualNetworkLinkInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateDns/LinkService.cs b/sdk/dotnet/PrivateDns/LinkService.cs index 91e2aff24d..0235873803 100644 --- a/sdk/dotnet/PrivateDns/LinkService.cs +++ b/sdk/dotnet/PrivateDns/LinkService.cs @@ -14,6 +14,105 @@ namespace Pulumi.Azure.PrivateDns /// /// > **NOTE** Private Link is now in [GA](https://docs.microsoft.com/en-gb/azure/private-link/). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.1.0/24", + /// }, + /// EnforcePrivateLinkServiceNetworkPolicies = true, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Sku = "Standard", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Sku = "Standard", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = examplePublicIp.Name, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleLinkService = new Azure.PrivateDns.LinkService("exampleLinkService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AutoApprovalSubscriptionIds = new[] + /// { + /// "00000000-0000-0000-0000-000000000000", + /// }, + /// VisibilitySubscriptionIds = new[] + /// { + /// "00000000-0000-0000-0000-000000000000", + /// }, + /// LoadBalancerFrontendIpConfigurationIds = new[] + /// { + /// exampleLoadBalancer.FrontendIpConfigurations.Apply(frontendIpConfigurations => frontendIpConfigurations[0]?.Id), + /// }, + /// NatIpConfigurations = new[] + /// { + /// new Azure.PrivateDns.Inputs.LinkServiceNatIpConfigurationArgs + /// { + /// Name = "primary", + /// PrivateIpAddress = "10.5.1.17", + /// PrivateIpAddressVersion = "IPv4", + /// SubnetId = exampleSubnet.Id, + /// Primary = true, + /// }, + /// new Azure.PrivateDns.Inputs.LinkServiceNatIpConfigurationArgs + /// { + /// Name = "secondary", + /// PrivateIpAddress = "10.5.1.18", + /// PrivateIpAddressVersion = "IPv4", + /// SubnetId = exampleSubnet.Id, + /// Primary = false, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private Link Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/MxRecord.cs b/sdk/dotnet/PrivateDns/MxRecord.cs index 565239e0ac..6dd8ac1d7f 100644 --- a/sdk/dotnet/PrivateDns/MxRecord.cs +++ b/sdk/dotnet/PrivateDns/MxRecord.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage DNS MX Records within Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleMxRecord = new Azure.PrivateDns.MxRecord("exampleMxRecord", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ZoneName = exampleZone.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.PrivateDns.Inputs.MxRecordRecordArgs + /// { + /// Preference = 10, + /// Exchange = "mx1.contoso.com", + /// }, + /// new Azure.PrivateDns.Inputs.MxRecordRecordArgs + /// { + /// Preference = 20, + /// Exchange = "backupmx.contoso.com", + /// }, + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS MX Records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/PTRRecord.cs b/sdk/dotnet/PrivateDns/PTRRecord.cs index 518fe2d6be..ca58f07a2f 100644 --- a/sdk/dotnet/PrivateDns/PTRRecord.cs +++ b/sdk/dotnet/PrivateDns/PTRRecord.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage DNS PTR Records within Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var examplePTRRecord = new Azure.PrivateDns.PTRRecord("examplePTRRecord", new() + /// { + /// ZoneName = exampleZone.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// "test.example.com", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS PTR Records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/Resolver.cs b/sdk/dotnet/PrivateDns/Resolver.cs index 6fad046b22..922ba045a1 100644 --- a/sdk/dotnet/PrivateDns/Resolver.cs +++ b/sdk/dotnet/PrivateDns/Resolver.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.PrivateDns /// /// Manages a Private DNS Resolver. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var test = new Azure.PrivateDns.Resolver("test", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// DNS Resolver can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/ResolverDnsForwardingRuleset.cs b/sdk/dotnet/PrivateDns/ResolverDnsForwardingRuleset.cs index db921e15f6..b67139c0a4 100644 --- a/sdk/dotnet/PrivateDns/ResolverDnsForwardingRuleset.cs +++ b/sdk/dotnet/PrivateDns/ResolverDnsForwardingRuleset.cs @@ -12,6 +12,91 @@ namespace Pulumi.Azure.PrivateDns /// /// Manages a Private DNS Resolver Dns Forwarding Ruleset. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.64/28", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "Microsoft.Network.dnsResolvers", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// Name = "Microsoft.Network/dnsResolvers", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleResolver = new Azure.PrivateDns.Resolver("exampleResolver", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// var exampleResolverOutboundEndpoint = new Azure.PrivateDns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", new() + /// { + /// PrivateDnsResolverId = exampleResolver.Id, + /// Location = exampleResolver.Location, + /// SubnetId = exampleSubnet.Id, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// var exampleResolverDnsForwardingRuleset = new Azure.PrivateDns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PrivateDnsResolverOutboundEndpointIds = new[] + /// { + /// exampleResolverOutboundEndpoint.Id, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS Resolver Dns Forwarding Ruleset can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/ResolverForwardingRule.cs b/sdk/dotnet/PrivateDns/ResolverForwardingRule.cs index 865b43e4c0..a383c50822 100644 --- a/sdk/dotnet/PrivateDns/ResolverForwardingRule.cs +++ b/sdk/dotnet/PrivateDns/ResolverForwardingRule.cs @@ -12,6 +12,106 @@ namespace Pulumi.Azure.PrivateDns /// /// Manages a Private DNS Resolver Forwarding Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.64/28", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "Microsoft.Network.dnsResolvers", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// Name = "Microsoft.Network/dnsResolvers", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleResolver = new Azure.PrivateDns.Resolver("exampleResolver", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// var exampleResolverOutboundEndpoint = new Azure.PrivateDns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", new() + /// { + /// PrivateDnsResolverId = exampleResolver.Id, + /// Location = exampleResolver.Location, + /// SubnetId = exampleSubnet.Id, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// var exampleResolverDnsForwardingRuleset = new Azure.PrivateDns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PrivateDnsResolverOutboundEndpointIds = new[] + /// { + /// exampleResolverOutboundEndpoint.Id, + /// }, + /// }); + /// + /// var exampleResolverForwardingRule = new Azure.PrivateDns.ResolverForwardingRule("exampleResolverForwardingRule", new() + /// { + /// DnsForwardingRulesetId = exampleResolverDnsForwardingRuleset.Id, + /// DomainName = "onprem.local.", + /// Enabled = true, + /// TargetDnsServers = new[] + /// { + /// new Azure.PrivateDns.Inputs.ResolverForwardingRuleTargetDnsServerArgs + /// { + /// IpAddress = "10.10.0.1", + /// Port = 53, + /// }, + /// }, + /// Metadata = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS Resolver Forwarding Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/ResolverInboundEndpoint.cs b/sdk/dotnet/PrivateDns/ResolverInboundEndpoint.cs index 7f09a9bc99..e285ab1f11 100644 --- a/sdk/dotnet/PrivateDns/ResolverInboundEndpoint.cs +++ b/sdk/dotnet/PrivateDns/ResolverInboundEndpoint.cs @@ -12,6 +12,84 @@ namespace Pulumi.Azure.PrivateDns /// /// Manages a Private DNS Resolver Inbound Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleResolver = new Azure.PrivateDns.Resolver("exampleResolver", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/28", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "Microsoft.Network.dnsResolvers", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// Name = "Microsoft.Network/dnsResolvers", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleResolverInboundEndpoint = new Azure.PrivateDns.ResolverInboundEndpoint("exampleResolverInboundEndpoint", new() + /// { + /// PrivateDnsResolverId = exampleResolver.Id, + /// Location = exampleResolver.Location, + /// IpConfigurations = new[] + /// { + /// new Azure.PrivateDns.Inputs.ResolverInboundEndpointIpConfigurationArgs + /// { + /// PrivateIpAllocationMethod = "Dynamic", + /// SubnetId = exampleSubnet.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS Resolver Inbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/ResolverOutboundEndpoint.cs b/sdk/dotnet/PrivateDns/ResolverOutboundEndpoint.cs index 235d07d3ab..8863f64bf2 100644 --- a/sdk/dotnet/PrivateDns/ResolverOutboundEndpoint.cs +++ b/sdk/dotnet/PrivateDns/ResolverOutboundEndpoint.cs @@ -12,6 +12,77 @@ namespace Pulumi.Azure.PrivateDns /// /// Manages a Private DNS Resolver Outbound Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.64/28", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "Microsoft.Network.dnsResolvers", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// Name = "Microsoft.Network/dnsResolvers", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleResolver = new Azure.PrivateDns.Resolver("exampleResolver", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// var exampleResolverOutboundEndpoint = new Azure.PrivateDns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", new() + /// { + /// PrivateDnsResolverId = exampleResolver.Id, + /// Location = exampleResolver.Location, + /// SubnetId = exampleSubnet.Id, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS Resolver Outbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/ResolverVirtualNetworkLink.cs b/sdk/dotnet/PrivateDns/ResolverVirtualNetworkLink.cs index 55663715bc..80142fcf14 100644 --- a/sdk/dotnet/PrivateDns/ResolverVirtualNetworkLink.cs +++ b/sdk/dotnet/PrivateDns/ResolverVirtualNetworkLink.cs @@ -12,6 +12,101 @@ namespace Pulumi.Azure.PrivateDns /// /// Manages a Private DNS Resolver Virtual Network Link. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.64/28", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "Microsoft.Network.dnsResolvers", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// }, + /// Name = "Microsoft.Network/dnsResolvers", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleResolver = new Azure.PrivateDns.Resolver("exampleResolver", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// var exampleResolverOutboundEndpoint = new Azure.PrivateDns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", new() + /// { + /// PrivateDnsResolverId = exampleResolver.Id, + /// Location = exampleResolver.Location, + /// SubnetId = exampleSubnet.Id, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// var exampleResolverDnsForwardingRuleset = new Azure.PrivateDns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// PrivateDnsResolverOutboundEndpointIds = new[] + /// { + /// exampleResolverOutboundEndpoint.Id, + /// }, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// var exampleResolverVirtualNetworkLink = new Azure.PrivateDns.ResolverVirtualNetworkLink("exampleResolverVirtualNetworkLink", new() + /// { + /// DnsForwardingRulesetId = exampleResolverDnsForwardingRuleset.Id, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// Metadata = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS Resolver Virtual Network Link can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/SRVRecord.cs b/sdk/dotnet/PrivateDns/SRVRecord.cs index c737fed2e2..6600f8d3fd 100644 --- a/sdk/dotnet/PrivateDns/SRVRecord.cs +++ b/sdk/dotnet/PrivateDns/SRVRecord.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage DNS SRV Records within Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSRVRecord = new Azure.PrivateDns.SRVRecord("exampleSRVRecord", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ZoneName = exampleZone.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.PrivateDns.Inputs.SRVRecordRecordArgs + /// { + /// Priority = 1, + /// Weight = 5, + /// Port = 8080, + /// Target = "target1.contoso.com", + /// }, + /// new Azure.PrivateDns.Inputs.SRVRecordRecordArgs + /// { + /// Priority = 10, + /// Weight = 10, + /// Port = 8080, + /// Target = "target2.contoso.com", + /// }, + /// }, + /// Tags = + /// { + /// { "Environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS SRV Records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/TxtRecord.cs b/sdk/dotnet/PrivateDns/TxtRecord.cs index 1dfad54295..75ba933419 100644 --- a/sdk/dotnet/PrivateDns/TxtRecord.cs +++ b/sdk/dotnet/PrivateDns/TxtRecord.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage DNS TXT Records within Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleTxtRecord = new Azure.PrivateDns.TxtRecord("exampleTxtRecord", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ZoneName = exampleZone.Name, + /// Ttl = 300, + /// Records = new[] + /// { + /// new Azure.PrivateDns.Inputs.TxtRecordRecordArgs + /// { + /// Value = "v=spf1 mx ~all", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS TXT Records can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/Zone.cs b/sdk/dotnet/PrivateDns/Zone.cs index 6b82730a72..578bf2c091 100644 --- a/sdk/dotnet/PrivateDns/Zone.cs +++ b/sdk/dotnet/PrivateDns/Zone.cs @@ -12,6 +12,29 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage Private DNS zones within Azure DNS. These zones are hosted on Azure's name servers. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateDns/ZoneVirtualNetworkLink.cs b/sdk/dotnet/PrivateDns/ZoneVirtualNetworkLink.cs index 5e3f078fd1..0504f23f58 100644 --- a/sdk/dotnet/PrivateDns/ZoneVirtualNetworkLink.cs +++ b/sdk/dotnet/PrivateDns/ZoneVirtualNetworkLink.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.PrivateDns /// /// Enables you to manage Private DNS zone Virtual Network Links. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleZone = new Azure.PrivateDns.Zone("exampleZone", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleZoneVirtualNetworkLink = new Azure.PrivateDns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// PrivateDnsZoneName = exampleZone.Name, + /// VirtualNetworkId = exampleVirtualNetwork.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Private DNS Zone Virtual Network Links can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateLink/ApplicationSecurityGroupAssociation.cs b/sdk/dotnet/PrivateLink/ApplicationSecurityGroupAssociation.cs index f583d52a7a..c012253384 100644 --- a/sdk/dotnet/PrivateLink/ApplicationSecurityGroupAssociation.cs +++ b/sdk/dotnet/PrivateLink/ApplicationSecurityGroupAssociation.cs @@ -12,6 +12,133 @@ namespace Pulumi.Azure.PrivateLink /// /// Manages an association between Private Endpoint and Application Security Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// }); + /// + /// var service = new Azure.Network.Subnet("service", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.1.0/24", + /// }, + /// EnforcePrivateLinkServiceNetworkPolicies = true, + /// }); + /// + /// var endpoint = new Azure.Network.Subnet("endpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.2.0/24", + /// }, + /// EnforcePrivateLinkEndpointNetworkPolicies = true, + /// }); + /// + /// var examplePublicIp = new Azure.Network.PublicIp("examplePublicIp", new() + /// { + /// Sku = "Standard", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AllocationMethod = "Static", + /// }); + /// + /// var exampleLoadBalancer = new Azure.Lb.LoadBalancer("exampleLoadBalancer", new() + /// { + /// Sku = "Standard", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// FrontendIpConfigurations = new[] + /// { + /// new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs + /// { + /// Name = examplePublicIp.Name, + /// PublicIpAddressId = examplePublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var exampleLinkService = new Azure.PrivateDns.LinkService("exampleLinkService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AutoApprovalSubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId), + /// }, + /// VisibilitySubscriptionIds = new[] + /// { + /// current.Apply(getSubscriptionResult => getSubscriptionResult.SubscriptionId), + /// }, + /// NatIpConfigurations = new[] + /// { + /// new Azure.PrivateDns.Inputs.LinkServiceNatIpConfigurationArgs + /// { + /// Name = "primaryIpConfiguration", + /// Primary = true, + /// SubnetId = service.Id, + /// }, + /// }, + /// LoadBalancerFrontendIpConfigurationIds = new[] + /// { + /// exampleLoadBalancer.FrontendIpConfigurations.Apply(frontendIpConfigurations => frontendIpConfigurations[0]?.Id), + /// }, + /// }); + /// + /// var exampleEndpoint = new Azure.PrivateLink.Endpoint("exampleEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubnetId = endpoint.Id, + /// PrivateServiceConnection = new Azure.PrivateLink.Inputs.EndpointPrivateServiceConnectionArgs + /// { + /// Name = exampleLinkService.Name, + /// IsManualConnection = false, + /// PrivateConnectionResourceId = exampleLinkService.Id, + /// }, + /// }); + /// + /// var exampleApplicationSecurityGroup = new Azure.Network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleApplicationSecurityGroupAssociation = new Azure.PrivateLink.ApplicationSecurityGroupAssociation("exampleApplicationSecurityGroupAssociation", new() + /// { + /// PrivateEndpointId = exampleEndpoint.Id, + /// ApplicationSecurityGroupId = exampleApplicationSecurityGroup.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Associations between Private Endpoint and Application Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/PrivateLink/GetEndpointConnection.cs b/sdk/dotnet/PrivateLink/GetEndpointConnection.cs index d593cdd3df..5944990a5b 100644 --- a/sdk/dotnet/PrivateLink/GetEndpointConnection.cs +++ b/sdk/dotnet/PrivateLink/GetEndpointConnection.cs @@ -13,12 +13,66 @@ public static class GetEndpointConnection { /// /// Use this data source to access the connection status information about an existing Private Endpoint Connection. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateLink.GetEndpointConnection.Invoke(new() + /// { + /// Name = "example-private-endpoint", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateEndpointStatus"] = example.Apply(getEndpointConnectionResult => getEndpointConnectionResult.PrivateServiceConnections[0]?.Status), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEndpointConnectionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatelink/getEndpointConnection:getEndpointConnection", args ?? new GetEndpointConnectionArgs(), options.WithDefaults()); /// /// Use this data source to access the connection status information about an existing Private Endpoint Connection. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateLink.GetEndpointConnection.Invoke(new() + /// { + /// Name = "example-private-endpoint", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateEndpointStatus"] = example.Apply(getEndpointConnectionResult => getEndpointConnectionResult.PrivateServiceConnections[0]?.Status), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEndpointConnectionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatelink/getEndpointConnection:getEndpointConnection", args ?? new GetEndpointConnectionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateLink/GetService.cs b/sdk/dotnet/PrivateLink/GetService.cs index f9936e24b4..af21828687 100644 --- a/sdk/dotnet/PrivateLink/GetService.cs +++ b/sdk/dotnet/PrivateLink/GetService.cs @@ -13,12 +13,66 @@ public static class GetService { /// /// Use this data source to access information about an existing Private Link Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateLink.GetService.Invoke(new() + /// { + /// Name = "myPrivateLinkService", + /// ResourceGroupName = "PrivateLinkServiceRG", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateLinkServiceId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatelink/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Private Link Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateLink.GetService.Invoke(new() + /// { + /// Name = "myPrivateLinkService", + /// ResourceGroupName = "PrivateLinkServiceRG", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateLinkServiceId"] = example.Apply(getServiceResult => getServiceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatelink/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/PrivateLink/GetServiceEndpointConnections.cs b/sdk/dotnet/PrivateLink/GetServiceEndpointConnections.cs index 5f84317cc4..8f11cae1a1 100644 --- a/sdk/dotnet/PrivateLink/GetServiceEndpointConnections.cs +++ b/sdk/dotnet/PrivateLink/GetServiceEndpointConnections.cs @@ -13,12 +13,66 @@ public static class GetServiceEndpointConnections { /// /// Use this data source to access endpoint connection information about an existing Private Link Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateLink.GetServiceEndpointConnections.Invoke(new() + /// { + /// ServiceId = azurerm_private_link_service.Example.Id, + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateEndpointStatus"] = example.Apply(getServiceEndpointConnectionsResult => getServiceEndpointConnectionsResult.PrivateEndpointConnections[0]?.Status), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceEndpointConnectionsArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:privatelink/getServiceEndpointConnections:getServiceEndpointConnections", args ?? new GetServiceEndpointConnectionsArgs(), options.WithDefaults()); /// /// Use this data source to access endpoint connection information about an existing Private Link Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.PrivateLink.GetServiceEndpointConnections.Invoke(new() + /// { + /// ServiceId = azurerm_private_link_service.Example.Id, + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["privateEndpointStatus"] = example.Apply(getServiceEndpointConnectionsResult => getServiceEndpointConnectionsResult.PrivateEndpointConnections[0]?.Status), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceEndpointConnectionsInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:privatelink/getServiceEndpointConnections:getServiceEndpointConnections", args ?? new GetServiceEndpointConnectionsInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Proximity/GetPlacementGroup.cs b/sdk/dotnet/Proximity/GetPlacementGroup.cs index 306e111fd0..1276e371be 100644 --- a/sdk/dotnet/Proximity/GetPlacementGroup.cs +++ b/sdk/dotnet/Proximity/GetPlacementGroup.cs @@ -13,12 +13,66 @@ public static class GetPlacementGroup { /// /// Use this data source to access information about an existing Proximity Placement Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Proximity.GetPlacementGroup.Invoke(new() + /// { + /// Name = "tf-appsecuritygroup", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["proximityPlacementGroupId"] = example.Apply(getPlacementGroupResult => getPlacementGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPlacementGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:proximity/getPlacementGroup:getPlacementGroup", args ?? new GetPlacementGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Proximity Placement Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Proximity.GetPlacementGroup.Invoke(new() + /// { + /// Name = "tf-appsecuritygroup", + /// ResourceGroupName = "my-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["proximityPlacementGroupId"] = example.Apply(getPlacementGroupResult => getPlacementGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPlacementGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:proximity/getPlacementGroup:getPlacementGroup", args ?? new GetPlacementGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Proximity/PlacementGroup.cs b/sdk/dotnet/Proximity/PlacementGroup.cs index deb864911e..2f0149cb51 100644 --- a/sdk/dotnet/Proximity/PlacementGroup.cs +++ b/sdk/dotnet/Proximity/PlacementGroup.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Proximity /// /// Manages a proximity placement group for virtual machines, virtual machine scale sets and availability sets. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePlacementGroup = new Azure.Proximity.PlacementGroup("examplePlacementGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Proximity Placement Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Purview/Account.cs b/sdk/dotnet/Purview/Account.cs index 78bbe3435e..a9730d9dc4 100644 --- a/sdk/dotnet/Purview/Account.cs +++ b/sdk/dotnet/Purview/Account.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Purview /// /// Manages a Purview Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Purview.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Identity = new Azure.Purview.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Purview Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/RecoveryServices/GetVault.cs b/sdk/dotnet/RecoveryServices/GetVault.cs index 72bdc75d8f..920516195b 100644 --- a/sdk/dotnet/RecoveryServices/GetVault.cs +++ b/sdk/dotnet/RecoveryServices/GetVault.cs @@ -13,12 +13,58 @@ public static class GetVault { /// /// Use this data source to access information about an existing Recovery Services Vault. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var vault = Azure.RecoveryServices.GetVault.Invoke(new() + /// { + /// Name = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetVaultArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:recoveryservices/getVault:getVault", args ?? new GetVaultArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Recovery Services Vault. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var vault = Azure.RecoveryServices.GetVault.Invoke(new() + /// { + /// Name = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetVaultInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:recoveryservices/getVault:getVault", args ?? new GetVaultInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/RecoveryServices/Vault.cs b/sdk/dotnet/RecoveryServices/Vault.cs index 2f7da34b24..f09480e05d 100644 --- a/sdk/dotnet/RecoveryServices/Vault.cs +++ b/sdk/dotnet/RecoveryServices/Vault.cs @@ -12,6 +12,32 @@ namespace Pulumi.Azure.RecoveryServices /// /// Manages a Recovery Services Vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = "Standard", + /// SoftDeleteEnabled = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Recovery Services Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/RecoveryServices/VaultResourceGuardAssociation.cs b/sdk/dotnet/RecoveryServices/VaultResourceGuardAssociation.cs index 564cea2550..b98d329599 100644 --- a/sdk/dotnet/RecoveryServices/VaultResourceGuardAssociation.cs +++ b/sdk/dotnet/RecoveryServices/VaultResourceGuardAssociation.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.RecoveryServices /// /// Manages an association of a Resource Guard and Recovery Services Vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleResourceGuard = new Azure.DataProtection.ResourceGuard("exampleResourceGuard", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// SoftDeleteEnabled = true, + /// }); + /// + /// var test = new Azure.RecoveryServices.VaultResourceGuardAssociation("test", new() + /// { + /// VaultId = azurerm_recovery_services_vault.Test.Id, + /// ResourceGuardId = azurerm_data_protection_resource_guard.Test.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Redis/Cache.cs b/sdk/dotnet/Redis/Cache.cs index c9954f15dc..2852f6b568 100644 --- a/sdk/dotnet/Redis/Cache.cs +++ b/sdk/dotnet/Redis/Cache.cs @@ -14,6 +14,38 @@ namespace Pulumi.Azure.Redis /// /// > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines) /// + /// ## Example Usage + /// + /// This example provisions a Standard Redis Cache. + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// // NOTE: the Name used for Redis needs to be globally unique + /// var exampleCache = new Azure.Redis.Cache("exampleCache", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Capacity = 2, + /// Family = "C", + /// SkuName = "Standard", + /// EnableNonSslPort = false, + /// MinimumTlsVersion = "1.2", + /// RedisConfiguration = null, + /// }); + /// + /// }); + /// ``` /// ## Relevant Links /// /// * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq) diff --git a/sdk/dotnet/Redis/EnterpriseCluster.cs b/sdk/dotnet/Redis/EnterpriseCluster.cs index caac35186e..18f7d2587f 100644 --- a/sdk/dotnet/Redis/EnterpriseCluster.cs +++ b/sdk/dotnet/Redis/EnterpriseCluster.cs @@ -12,6 +12,31 @@ namespace Pulumi.Azure.Redis /// /// Manages a Redis Enterprise Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEnterpriseCluster = new Azure.Redis.EnterpriseCluster("exampleEnterpriseCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "EnterpriseFlash_F300-3", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Redis Enterprise Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Redis/EnterpriseDatabase.cs b/sdk/dotnet/Redis/EnterpriseDatabase.cs index 02a02a2b19..80bd5c3f5b 100644 --- a/sdk/dotnet/Redis/EnterpriseDatabase.cs +++ b/sdk/dotnet/Redis/EnterpriseDatabase.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.Redis /// /// Manages a Redis Enterprise Database. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEnterpriseCluster = new Azure.Redis.EnterpriseCluster("exampleEnterpriseCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "Enterprise_E20-4", + /// }); + /// + /// var example1 = new Azure.Redis.EnterpriseCluster("example1", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SkuName = "Enterprise_E20-4", + /// }); + /// + /// var exampleEnterpriseDatabase = new Azure.Redis.EnterpriseDatabase("exampleEnterpriseDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ClusterId = exampleEnterpriseCluster.Id, + /// ClientProtocol = "Encrypted", + /// ClusteringPolicy = "EnterpriseCluster", + /// EvictionPolicy = "NoEviction", + /// Port = 10000, + /// LinkedDatabaseIds = new[] + /// { + /// exampleEnterpriseCluster.Id.Apply(id => $"{id}/databases/default"), + /// example1.Id.Apply(id => $"{id}/databases/default"), + /// }, + /// LinkedDatabaseGroupNickname = "tftestGeoGroup", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Redis Enterprise Databases can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Redis/FirewallRule.cs b/sdk/dotnet/Redis/FirewallRule.cs index 0b0f1b9ba5..3caabc138d 100644 --- a/sdk/dotnet/Redis/FirewallRule.cs +++ b/sdk/dotnet/Redis/FirewallRule.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.Redis /// /// Manages a Firewall Rule associated with a Redis Cache. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var server = new Random.RandomId("server", new() + /// { + /// Keepers = + /// { + /// { "azi_id", 1 }, + /// }, + /// ByteLength = 8, + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCache = new Azure.Redis.Cache("exampleCache", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Capacity = 1, + /// Family = "P", + /// SkuName = "Premium", + /// EnableNonSslPort = false, + /// RedisConfiguration = new Azure.Redis.Inputs.CacheRedisConfigurationArgs + /// { + /// MaxmemoryReserved = 2, + /// MaxmemoryDelta = 2, + /// MaxmemoryPolicy = "allkeys-lru", + /// }, + /// }); + /// + /// var exampleFirewallRule = new Azure.Redis.FirewallRule("exampleFirewallRule", new() + /// { + /// RedisCacheName = exampleCache.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StartIp = "1.2.3.4", + /// EndIp = "2.3.4.5", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Redis Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Redis/GetCache.cs b/sdk/dotnet/Redis/GetCache.cs index db5233d969..e4f4c9fb9c 100644 --- a/sdk/dotnet/Redis/GetCache.cs +++ b/sdk/dotnet/Redis/GetCache.cs @@ -13,12 +13,68 @@ public static class GetCache { /// /// Use this data source to access information about an existing Redis Cache + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Redis.GetCache.Invoke(new() + /// { + /// Name = "myrediscache", + /// ResourceGroupName = "redis-cache", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["primaryAccessKey"] = example.Apply(getCacheResult => getCacheResult.PrimaryAccessKey), + /// ["hostname"] = example.Apply(getCacheResult => getCacheResult.Hostname), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetCacheArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:redis/getCache:getCache", args ?? new GetCacheArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Redis Cache + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Redis.GetCache.Invoke(new() + /// { + /// Name = "myrediscache", + /// ResourceGroupName = "redis-cache", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["primaryAccessKey"] = example.Apply(getCacheResult => getCacheResult.PrimaryAccessKey), + /// ["hostname"] = example.Apply(getCacheResult => getCacheResult.Hostname), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetCacheInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:redis/getCache:getCache", args ?? new GetCacheInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Redis/GetEnterpriseDatabase.cs b/sdk/dotnet/Redis/GetEnterpriseDatabase.cs index 898dbde8d4..a150b23bb8 100644 --- a/sdk/dotnet/Redis/GetEnterpriseDatabase.cs +++ b/sdk/dotnet/Redis/GetEnterpriseDatabase.cs @@ -13,12 +13,70 @@ public static class GetEnterpriseDatabase { /// /// Use this data source to access information about an existing Redis Enterprise Database + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Redis.GetEnterpriseDatabase.Invoke(new() + /// { + /// Name = "default", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// ClusterId = azurerm_redis_enterprise_cluster.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["redisEnterpriseDatabasePrimaryKey"] = example.Apply(getEnterpriseDatabaseResult => getEnterpriseDatabaseResult.PrimaryAccessKey), + /// ["redisEnterpriseDatabaseSecondaryKey"] = example.Apply(getEnterpriseDatabaseResult => getEnterpriseDatabaseResult.SecondaryAccessKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEnterpriseDatabaseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:redis/getEnterpriseDatabase:getEnterpriseDatabase", args ?? new GetEnterpriseDatabaseArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Redis Enterprise Database + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Redis.GetEnterpriseDatabase.Invoke(new() + /// { + /// Name = "default", + /// ResourceGroupName = azurerm_resource_group.Example.Name, + /// ClusterId = azurerm_redis_enterprise_cluster.Example.Id, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["redisEnterpriseDatabasePrimaryKey"] = example.Apply(getEnterpriseDatabaseResult => getEnterpriseDatabaseResult.PrimaryAccessKey), + /// ["redisEnterpriseDatabaseSecondaryKey"] = example.Apply(getEnterpriseDatabaseResult => getEnterpriseDatabaseResult.SecondaryAccessKey), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEnterpriseDatabaseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:redis/getEnterpriseDatabase:getEnterpriseDatabase", args ?? new GetEnterpriseDatabaseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationArgs.cs b/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationArgs.cs index 0db59a8ba5..4a1e7b909a 100644 --- a/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationArgs.cs +++ b/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationArgs.cs @@ -43,6 +43,16 @@ public Input? AofStorageConnectionString0 /// Second Storage Account connection string for AOF persistence. /// /// Example usage: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// public Input? AofStorageConnectionString1 { @@ -94,6 +104,16 @@ public Input? AofStorageConnectionString1 /// /// Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Input("notifyKeyspaceEvents")] public Input? NotifyKeyspaceEvents { get; set; } diff --git a/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationGetArgs.cs b/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationGetArgs.cs index 8024aa9497..ec2c3b2dcf 100644 --- a/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationGetArgs.cs +++ b/sdk/dotnet/Redis/Inputs/CacheRedisConfigurationGetArgs.cs @@ -43,6 +43,16 @@ public Input? AofStorageConnectionString0 /// Second Storage Account connection string for AOF persistence. /// /// Example usage: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// public Input? AofStorageConnectionString1 { @@ -94,6 +104,16 @@ public Input? AofStorageConnectionString1 /// /// Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// [Input("notifyKeyspaceEvents")] public Input? NotifyKeyspaceEvents { get; set; } diff --git a/sdk/dotnet/Redis/LinkedServer.cs b/sdk/dotnet/Redis/LinkedServer.cs index d02466af3e..226b109244 100644 --- a/sdk/dotnet/Redis/LinkedServer.cs +++ b/sdk/dotnet/Redis/LinkedServer.cs @@ -12,6 +12,70 @@ namespace Pulumi.Azure.Redis /// /// Manages a Redis Linked Server (ie Geo Location) /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example_primaryResourceGroup = new Azure.Core.ResourceGroup("example-primaryResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var example_primaryCache = new Azure.Redis.Cache("example-primaryCache", new() + /// { + /// Location = example_primaryResourceGroup.Location, + /// ResourceGroupName = example_primaryResourceGroup.Name, + /// Capacity = 1, + /// Family = "P", + /// SkuName = "Premium", + /// EnableNonSslPort = false, + /// RedisConfiguration = new Azure.Redis.Inputs.CacheRedisConfigurationArgs + /// { + /// MaxmemoryReserved = 2, + /// MaxmemoryDelta = 2, + /// MaxmemoryPolicy = "allkeys-lru", + /// }, + /// }); + /// + /// var example_secondaryResourceGroup = new Azure.Core.ResourceGroup("example-secondaryResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var example_secondaryCache = new Azure.Redis.Cache("example-secondaryCache", new() + /// { + /// Location = example_secondaryResourceGroup.Location, + /// ResourceGroupName = example_secondaryResourceGroup.Name, + /// Capacity = 1, + /// Family = "P", + /// SkuName = "Premium", + /// EnableNonSslPort = false, + /// RedisConfiguration = new Azure.Redis.Inputs.CacheRedisConfigurationArgs + /// { + /// MaxmemoryReserved = 2, + /// MaxmemoryDelta = 2, + /// MaxmemoryPolicy = "allkeys-lru", + /// }, + /// }); + /// + /// var example_link = new Azure.Redis.LinkedServer("example-link", new() + /// { + /// TargetRedisCacheName = example_primaryCache.Name, + /// ResourceGroupName = example_primaryCache.ResourceGroupName, + /// LinkedRedisCacheId = example_secondaryCache.Id, + /// LinkedRedisCacheLocation = example_secondaryCache.Location, + /// ServerRole = "Secondary", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Redis can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Redis/Outputs/CacheRedisConfiguration.cs b/sdk/dotnet/Redis/Outputs/CacheRedisConfiguration.cs index 7146cf8afa..e35a85151c 100644 --- a/sdk/dotnet/Redis/Outputs/CacheRedisConfiguration.cs +++ b/sdk/dotnet/Redis/Outputs/CacheRedisConfiguration.cs @@ -27,6 +27,16 @@ public sealed class CacheRedisConfiguration /// Second Storage Account connection string for AOF persistence. /// /// Example usage: + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// public readonly string? AofStorageConnectionString1; /// @@ -57,6 +67,16 @@ public sealed class CacheRedisConfiguration public readonly int? MaxmemoryReserved; /// /// Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// + /// return await Deployment.RunAsync(() => + /// { + /// }); + /// ``` /// public readonly string? NotifyKeyspaceEvents; /// diff --git a/sdk/dotnet/Relay/HybridConnection.cs b/sdk/dotnet/Relay/HybridConnection.cs index a09d287de8..0f996aa706 100644 --- a/sdk/dotnet/Relay/HybridConnection.cs +++ b/sdk/dotnet/Relay/HybridConnection.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Relay /// /// Manages an Azure Relay Hybrid Connection. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// Tags = + /// { + /// { "source", "managed" }, + /// }, + /// }); + /// + /// var exampleHybridConnection = new Azure.Relay.HybridConnection("exampleHybridConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RelayNamespaceName = exampleNamespace.Name, + /// RequiresClientAuthorization = false, + /// UserMetadata = "testmetadata", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Relay Hybrid Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Relay/HybridConnectionAuthorizationRule.cs b/sdk/dotnet/Relay/HybridConnectionAuthorizationRule.cs index 3ce7389b77..d3c75a548f 100644 --- a/sdk/dotnet/Relay/HybridConnectionAuthorizationRule.cs +++ b/sdk/dotnet/Relay/HybridConnectionAuthorizationRule.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.Relay /// /// Manages an Azure Relay Hybrid Connection Authorization Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// Tags = + /// { + /// { "source", "terraform" }, + /// }, + /// }); + /// + /// var exampleHybridConnection = new Azure.Relay.HybridConnection("exampleHybridConnection", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// RelayNamespaceName = exampleNamespace.Name, + /// RequiresClientAuthorization = false, + /// UserMetadata = "testmetadata", + /// }); + /// + /// var exampleHybridConnectionAuthorizationRule = new Azure.Relay.HybridConnectionAuthorizationRule("exampleHybridConnectionAuthorizationRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// HybridConnectionName = exampleHybridConnection.Name, + /// NamespaceName = exampleNamespace.Name, + /// Listen = true, + /// Send = true, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Relay Hybrid Connection Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Relay/Namespace.cs b/sdk/dotnet/Relay/Namespace.cs index 3e0328f5e7..c9b50a4e3a 100644 --- a/sdk/dotnet/Relay/Namespace.cs +++ b/sdk/dotnet/Relay/Namespace.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Relay /// /// Manages an Azure Relay Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Relay Namespace's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Relay/NamespaceAuthorizationRule.cs b/sdk/dotnet/Relay/NamespaceAuthorizationRule.cs index b59257b229..846996d82a 100644 --- a/sdk/dotnet/Relay/NamespaceAuthorizationRule.cs +++ b/sdk/dotnet/Relay/NamespaceAuthorizationRule.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Relay /// /// Manages an Azure Relay Namespace Authorization Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.Relay.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// SkuName = "Standard", + /// Tags = + /// { + /// { "source", "terraform" }, + /// }, + /// }); + /// + /// var exampleNamespaceAuthorizationRule = new Azure.Relay.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// NamespaceName = exampleNamespace.Name, + /// Listen = true, + /// Send = true, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Relay Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Role/Assignment.cs b/sdk/dotnet/Role/Assignment.cs index 38318871a2..32f9a90d83 100644 --- a/sdk/dotnet/Role/Assignment.cs +++ b/sdk/dotnet/Role/Assignment.cs @@ -13,6 +13,169 @@ namespace Pulumi.Azure.Role /// Assigns a given Principal (User or Group) to a given Role. /// /// ## Example Usage + /// ### Using A Built-In Role) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionName = "Reader", + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// ### Custom Role & Service Principal) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = new Azure.Authorization.RoleDefinition("exampleRoleDefinition", new() + /// { + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Resources/subscriptions/resourceGroups/read", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionId = exampleRoleDefinition.RoleDefinitionResourceId, + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// ### Custom Role & User) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleDefinition = new Azure.Authorization.RoleDefinition("exampleRoleDefinition", new() + /// { + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Resources/subscriptions/resourceGroups/read", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// RoleDefinitionId = exampleRoleDefinition.RoleDefinitionResourceId, + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// ### Custom Role & Management Group) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var exampleClientConfig = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleGroup = Azure.Management.GetGroup.Invoke(new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// }); + /// + /// var exampleRoleDefinition = new Azure.Authorization.RoleDefinition("exampleRoleDefinition", new() + /// { + /// RoleDefinitionId = "00000000-0000-0000-0000-000000000000", + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "Microsoft.Resources/subscriptions/resourceGroups/read", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// var exampleAssignment = new Azure.Authorization.Assignment("exampleAssignment", new() + /// { + /// Name = "00000000-0000-0000-0000-000000000000", + /// Scope = data.Azurerm_management_group.Primary.Id, + /// RoleDefinitionId = exampleRoleDefinition.RoleDefinitionResourceId, + /// PrincipalId = exampleClientConfig.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Role/Definition.cs b/sdk/dotnet/Role/Definition.cs index 2adbb24ed2..f91d073bec 100644 --- a/sdk/dotnet/Role/Definition.cs +++ b/sdk/dotnet/Role/Definition.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Role /// /// Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = Azure.Core.GetSubscription.Invoke(); + /// + /// var example = new Azure.Authorization.RoleDefinition("example", new() + /// { + /// Scope = primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// Description = "This is a custom role created", + /// Permissions = new[] + /// { + /// new Azure.Authorization.Inputs.RoleDefinitionPermissionArgs + /// { + /// Actions = new[] + /// { + /// "*", + /// }, + /// NotActions = new() { }, + /// }, + /// }, + /// AssignableScopes = new[] + /// { + /// primary.Apply(getSubscriptionResult => getSubscriptionResult.Id), + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Search/GetService.cs b/sdk/dotnet/Search/GetService.cs index 71553b7a5c..7ae80adb39 100644 --- a/sdk/dotnet/Search/GetService.cs +++ b/sdk/dotnet/Search/GetService.cs @@ -13,12 +13,68 @@ public static class GetService { /// /// Manages a Search Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = Azure.Search.GetService.Invoke(new() + /// { + /// Name = "example-search-service", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:search/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Manages a Search Service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = Azure.Search.GetService.Invoke(new() + /// { + /// Name = "example-search-service", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:search/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Search/Service.cs b/sdk/dotnet/Search/Service.cs index ab4453172f..2d99626376 100644 --- a/sdk/dotnet/Search/Service.cs +++ b/sdk/dotnet/Search/Service.cs @@ -13,6 +13,81 @@ namespace Pulumi.Azure.Search /// Manages a Search Service. /// /// ## Example Usage + /// ### Supporting API Keys) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.Search.Service("exampleService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "standard", + /// }); + /// + /// }); + /// ``` + /// ### Using Both AzureAD And API Keys) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.Search.Service("exampleService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "standard", + /// LocalAuthenticationEnabled = true, + /// AuthenticationFailureMode = "http403", + /// }); + /// + /// }); + /// ``` + /// ### Supporting Only AzureAD Authentication) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.Search.Service("exampleService", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "standard", + /// LocalAuthenticationEnabled = false, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/Search/SharedPrivateLinkService.cs b/sdk/dotnet/Search/SharedPrivateLinkService.cs index ec0b5af6fb..8b594c605a 100644 --- a/sdk/dotnet/Search/SharedPrivateLinkService.cs +++ b/sdk/dotnet/Search/SharedPrivateLinkService.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Search /// /// Manages the Shared Private Link Service for an Azure Search Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testResourceGroup = new Azure.Core.ResourceGroup("testResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var testService = new Azure.Search.Service("testService", new() + /// { + /// ResourceGroupName = testResourceGroup.Name, + /// Location = testResourceGroup.Location, + /// Sku = "standard", + /// }); + /// + /// var testAccount = new Azure.Storage.Account("testAccount", new() + /// { + /// ResourceGroupName = testResourceGroup.Name, + /// Location = testResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var testSharedPrivateLinkService = new Azure.Search.SharedPrivateLinkService("testSharedPrivateLinkService", new() + /// { + /// SearchServiceId = testService.Id, + /// SubresourceName = "blob", + /// TargetResourceId = testAccount.Id, + /// RequestMessage = "please approve", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Search Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/AdvancedThreatProtection.cs b/sdk/dotnet/SecurityCenter/AdvancedThreatProtection.cs index 07facecc37..382d758f74 100644 --- a/sdk/dotnet/SecurityCenter/AdvancedThreatProtection.cs +++ b/sdk/dotnet/SecurityCenter/AdvancedThreatProtection.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.SecurityCenter /// /// Manages a resources Advanced Threat Protection setting. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Tags = + /// { + /// { "environment", "example" }, + /// }, + /// }); + /// + /// var exampleAdvancedThreatProtection = new Azure.SecurityCenter.AdvancedThreatProtection("exampleAdvancedThreatProtection", new() + /// { + /// TargetResourceId = exampleAccount.Id, + /// Enabled = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Advanced Threat Protection can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/Assessment.cs b/sdk/dotnet/SecurityCenter/Assessment.cs index a239cfc6f3..6e20296d32 100644 --- a/sdk/dotnet/SecurityCenter/Assessment.cs +++ b/sdk/dotnet/SecurityCenter/Assessment.cs @@ -12,6 +12,108 @@ namespace Pulumi.Azure.SecurityCenter /// /// Manages the Security Center Assessment for Azure Security Center. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// }); + /// + /// var @internal = new Azure.Network.Subnet("internal", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachineScaleSet = new Azure.Compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = "Standard_F2", + /// Instances = 1, + /// AdminUsername = "adminuser", + /// AdminSshKeys = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetAdminSshKeyArgs + /// { + /// Username = "adminuser", + /// PublicKey = File.ReadAllText("~/.ssh/id_rsa.pub"), + /// }, + /// }, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetSourceImageReferenceArgs + /// { + /// Publisher = "Canonical", + /// Offer = "0001-com-ubuntu-server-focal", + /// Sku = "20_04-lts", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetOsDiskArgs + /// { + /// StorageAccountType = "Standard_LRS", + /// Caching = "ReadWrite", + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceArgs + /// { + /// Name = "example", + /// Primary = true, + /// IpConfigurations = new[] + /// { + /// new Azure.Compute.Inputs.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs + /// { + /// Name = "internal", + /// Primary = true, + /// SubnetId = @internal.Id, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleAssessmentPolicy = new Azure.SecurityCenter.AssessmentPolicy("exampleAssessmentPolicy", new() + /// { + /// DisplayName = "Test Display Name", + /// Severity = "Medium", + /// Description = "Test Description", + /// }); + /// + /// var exampleAssessment = new Azure.SecurityCenter.Assessment("exampleAssessment", new() + /// { + /// AssessmentPolicyId = exampleAssessmentPolicy.Id, + /// TargetResourceId = exampleLinuxVirtualMachineScaleSet.Id, + /// Status = new Azure.SecurityCenter.Inputs.AssessmentStatusArgs + /// { + /// Code = "Healthy", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Security Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/AssessmentPolicy.cs b/sdk/dotnet/SecurityCenter/AssessmentPolicy.cs index 04edb913a9..b1d184215f 100644 --- a/sdk/dotnet/SecurityCenter/AssessmentPolicy.cs +++ b/sdk/dotnet/SecurityCenter/AssessmentPolicy.cs @@ -12,6 +12,26 @@ namespace Pulumi.Azure.SecurityCenter /// /// Manages the Security Center Assessment Metadata for Azure Security Center. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.SecurityCenter.AssessmentPolicy("example", new() + /// { + /// Description = "Test Description", + /// DisplayName = "Test Display Name", + /// Severity = "Medium", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Security Assessments Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/AutoProvisioning.cs b/sdk/dotnet/SecurityCenter/AutoProvisioning.cs index 7b3cfa8aca..79a09d90d7 100644 --- a/sdk/dotnet/SecurityCenter/AutoProvisioning.cs +++ b/sdk/dotnet/SecurityCenter/AutoProvisioning.cs @@ -14,6 +14,24 @@ namespace Pulumi.Azure.SecurityCenter /// /// > **NOTE:** There is no resource name required, it will always be "default" /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.SecurityCenter.AutoProvisioning("example", new() + /// { + /// AutoProvision = "On", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Security Center Auto Provisioning can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/Automation.cs b/sdk/dotnet/SecurityCenter/Automation.cs index f0e9399b8d..b10dfb74d8 100644 --- a/sdk/dotnet/SecurityCenter/Automation.cs +++ b/sdk/dotnet/SecurityCenter/Automation.cs @@ -12,6 +12,94 @@ namespace Pulumi.Azure.SecurityCenter /// /// Manages Security Center Automation and Continuous Export. This resource supports three types of destination in the `action`, Logic Apps, Log Analytics and Event Hubs /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 2, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 2, + /// }); + /// + /// var exampleAuthorizationRule = new Azure.EventHub.AuthorizationRule("exampleAuthorizationRule", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Listen = true, + /// Send = false, + /// Manage = false, + /// }); + /// + /// var exampleAutomation = new Azure.SecurityCenter.Automation("exampleAutomation", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Actions = new[] + /// { + /// new Azure.SecurityCenter.Inputs.AutomationActionArgs + /// { + /// Type = "EventHub", + /// ResourceId = exampleEventHub.Id, + /// ConnectionString = exampleAuthorizationRule.PrimaryConnectionString, + /// }, + /// }, + /// Sources = new[] + /// { + /// new Azure.SecurityCenter.Inputs.AutomationSourceArgs + /// { + /// EventSource = "Alerts", + /// RuleSets = new[] + /// { + /// new Azure.SecurityCenter.Inputs.AutomationSourceRuleSetArgs + /// { + /// Rules = new[] + /// { + /// new Azure.SecurityCenter.Inputs.AutomationSourceRuleSetRuleArgs + /// { + /// PropertyPath = "properties.metadata.severity", + /// Operator = "Equals", + /// ExpectedValue = "High", + /// PropertyType = "String", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// Scopes = new[] + /// { + /// $"/subscriptions/{current.Apply(getClientConfigResult => getClientConfigResult.SubscriptionId)}", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Security Center Automations can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/Contact.cs b/sdk/dotnet/SecurityCenter/Contact.cs index 4bbb50a829..4be13363d8 100644 --- a/sdk/dotnet/SecurityCenter/Contact.cs +++ b/sdk/dotnet/SecurityCenter/Contact.cs @@ -14,6 +14,27 @@ namespace Pulumi.Azure.SecurityCenter /// /// > **NOTE:** Owner access permission is required. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.SecurityCenter.Contact("example", new() + /// { + /// AlertNotifications = true, + /// AlertsToAdmins = true, + /// Email = "contact@example.com", + /// Phone = "+1-555-555-5555", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The contact can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessment.cs b/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessment.cs index d18653f13b..c85f645b8c 100644 --- a/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessment.cs +++ b/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessment.cs @@ -17,6 +17,90 @@ namespace Pulumi.Azure.SecurityCenter /// > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. /// See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "vm-example", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Size = "Standard_B1s", + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// DisablePasswordAuthentication = false, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "OpenLogic", + /// Offer = "CentOS", + /// Sku = "7.5", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// }); + /// + /// var exampleServerVulnerabilityAssessment = new Azure.SecurityCenter.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", new() + /// { + /// VirtualMachineId = exampleLinuxVirtualMachine.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessmentVirtualMachine.cs b/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessmentVirtualMachine.cs index 03c9b7084e..77a03766a8 100644 --- a/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessmentVirtualMachine.cs +++ b/sdk/dotnet/SecurityCenter/ServerVulnerabilityAssessmentVirtualMachine.cs @@ -15,6 +15,90 @@ namespace Pulumi.Azure.SecurityCenter /// > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. /// See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }); + /// + /// var exampleNetworkInterface = new Azure.Network.NetworkInterface("exampleNetworkInterface", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "vm-example", + /// SubnetId = exampleSubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// }, + /// }, + /// }); + /// + /// var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Size = "Standard_B1s", + /// AdminUsername = "testadmin", + /// AdminPassword = "Password1234!", + /// DisablePasswordAuthentication = false, + /// SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs + /// { + /// Publisher = "OpenLogic", + /// Offer = "CentOS", + /// Sku = "7.5", + /// Version = "latest", + /// }, + /// OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs + /// { + /// Caching = "ReadWrite", + /// StorageAccountType = "Standard_LRS", + /// }, + /// NetworkInterfaceIds = new[] + /// { + /// exampleNetworkInterface.Id, + /// }, + /// }); + /// + /// var exampleServerVulnerabilityAssessmentVirtualMachine = new Azure.SecurityCenter.ServerVulnerabilityAssessmentVirtualMachine("exampleServerVulnerabilityAssessmentVirtualMachine", new() + /// { + /// VirtualMachineId = exampleLinuxVirtualMachine.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/Setting.cs b/sdk/dotnet/SecurityCenter/Setting.cs index c4a56e09db..3155f9674f 100644 --- a/sdk/dotnet/SecurityCenter/Setting.cs +++ b/sdk/dotnet/SecurityCenter/Setting.cs @@ -16,6 +16,25 @@ namespace Pulumi.Azure.SecurityCenter /// /// > **NOTE:** Deletion of this resource disables the setting. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.SecurityCenter.Setting("example", new() + /// { + /// Enabled = true, + /// SettingName = "MCAS", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The setting can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/StorageDefender.cs b/sdk/dotnet/SecurityCenter/StorageDefender.cs index d595a53abc..b3be368b6e 100644 --- a/sdk/dotnet/SecurityCenter/StorageDefender.cs +++ b/sdk/dotnet/SecurityCenter/StorageDefender.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.SecurityCenter /// /// Manages the Defender for Storage. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "westus2", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleStorageDefender = new Azure.SecurityCenter.StorageDefender("exampleStorageDefender", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The setting can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SecurityCenter/SubscriptionPricing.cs b/sdk/dotnet/SecurityCenter/SubscriptionPricing.cs index 4b3309208c..6cebc1798d 100644 --- a/sdk/dotnet/SecurityCenter/SubscriptionPricing.cs +++ b/sdk/dotnet/SecurityCenter/SubscriptionPricing.cs @@ -15,6 +15,65 @@ namespace Pulumi.Azure.SecurityCenter /// > **NOTE:** Deletion of this resource will reset the pricing tier to `Free` /// /// ## Example Usage + /// ### Basic usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.SecurityCenter.SubscriptionPricing("example", new() + /// { + /// ResourceType = "VirtualMachines", + /// Tier = "Standard", + /// }); + /// + /// }); + /// ``` + /// ### Using Extensions with Defender CSPM + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example1 = new Azure.SecurityCenter.SubscriptionPricing("example1", new() + /// { + /// Extensions = new[] + /// { + /// new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs + /// { + /// Name = "ContainerRegistriesVulnerabilityAssessments", + /// }, + /// new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs + /// { + /// AdditionalExtensionProperties = + /// { + /// { "ExclusionTags", "[]" }, + /// }, + /// Name = "AgentlessVmScanning", + /// }, + /// new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs + /// { + /// Name = "AgentlessDiscoveryForKubernetes", + /// }, + /// new Azure.SecurityCenter.Inputs.SubscriptionPricingExtensionArgs + /// { + /// Name = "SensitiveDataDiscovery", + /// }, + /// }, + /// ResourceType = "CloudPosture", + /// Tier = "Standard", + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/SecurityCenter/Workspace.cs b/sdk/dotnet/SecurityCenter/Workspace.cs index ea5a5f9ded..8d23b2e529 100644 --- a/sdk/dotnet/SecurityCenter/Workspace.cs +++ b/sdk/dotnet/SecurityCenter/Workspace.cs @@ -14,6 +14,37 @@ namespace Pulumi.Azure.SecurityCenter /// /// > **NOTE:** Owner access permission is required. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleWorkspace = new Azure.SecurityCenter.Workspace("exampleWorkspace", new() + /// { + /// Scope = "/subscriptions/00000000-0000-0000-0000-000000000000", + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// The contact can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleAnomalyBuiltIn.cs b/sdk/dotnet/Sentinel/AlertRuleAnomalyBuiltIn.cs index 861bdf8389..41775e2ef0 100644 --- a/sdk/dotnet/Sentinel/AlertRuleAnomalyBuiltIn.cs +++ b/sdk/dotnet/Sentinel/AlertRuleAnomalyBuiltIn.cs @@ -10,6 +10,51 @@ namespace Pulumi.Azure.Sentinel { /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// CustomerManagedKeyEnabled = false, + /// }); + /// + /// var exampleAlertRuleAnomaly = Azure.Sentinel.GetAlertRuleAnomaly.Invoke(new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "Potential data staging", + /// }); + /// + /// var exampleAlertRuleAnomalyBuiltIn = new Azure.Sentinel.AlertRuleAnomalyBuiltIn("exampleAlertRuleAnomalyBuiltIn", new() + /// { + /// DisplayName = "Potential data staging", + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// Mode = "Production", + /// Enabled = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleAnomalyDuplicate.cs b/sdk/dotnet/Sentinel/AlertRuleAnomalyDuplicate.cs index f2e276eb24..c0611b6515 100644 --- a/sdk/dotnet/Sentinel/AlertRuleAnomalyDuplicate.cs +++ b/sdk/dotnet/Sentinel/AlertRuleAnomalyDuplicate.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Duplicated Anomaly Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// CustomerManagedKeyEnabled = false, + /// }); + /// + /// var exampleAlertRuleAnomaly = Azure.Sentinel.GetAlertRuleAnomaly.Invoke(new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "UEBA Anomalous Sign In", + /// }); + /// + /// var exampleAlertRuleAnomalyDuplicate = new Azure.Sentinel.AlertRuleAnomalyDuplicate("exampleAlertRuleAnomalyDuplicate", new() + /// { + /// DisplayName = "example duplicated UEBA Anomalous Sign In", + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// BuiltInRuleId = exampleAlertRuleAnomaly.Apply(getAlertRuleAnomalyResult => getAlertRuleAnomalyResult.Id), + /// Enabled = true, + /// Mode = "Flighting", + /// ThresholdObservations = new[] + /// { + /// new Azure.Sentinel.Inputs.AlertRuleAnomalyDuplicateThresholdObservationArgs + /// { + /// Name = "Anomaly score threshold", + /// Value = "0.6", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleFusion.cs b/sdk/dotnet/Sentinel/AlertRuleFusion.cs index 128b3ffc6a..ec74f1bf81 100644 --- a/sdk/dotnet/Sentinel/AlertRuleFusion.cs +++ b/sdk/dotnet/Sentinel/AlertRuleFusion.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Fusion Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleAnalyticsSolution = new Azure.OperationalInsights.AnalyticsSolution("exampleAnalyticsSolution", new() + /// { + /// SolutionName = "SecurityInsights", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// Plan = new Azure.OperationalInsights.Inputs.AnalyticsSolutionPlanArgs + /// { + /// Publisher = "Microsoft", + /// Product = "OMSGallery/SecurityInsights", + /// }, + /// }); + /// + /// var exampleAlertRuleFusion = new Azure.Sentinel.AlertRuleFusion("exampleAlertRuleFusion", new() + /// { + /// LogAnalyticsWorkspaceId = exampleAnalyticsSolution.WorkspaceResourceId, + /// AlertRuleTemplateGuid = "f71aba3d-28fb-450b-b192-4e76a83015c8", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Fusion Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleMachineLearningBehaviorAnalytics.cs b/sdk/dotnet/Sentinel/AlertRuleMachineLearningBehaviorAnalytics.cs index 6dbad02d8b..d8d1db08e5 100644 --- a/sdk/dotnet/Sentinel/AlertRuleMachineLearningBehaviorAnalytics.cs +++ b/sdk/dotnet/Sentinel/AlertRuleMachineLearningBehaviorAnalytics.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Machine Learning Behavior Analytics Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleAlertRuleMachineLearningBehaviorAnalytics = new Azure.Sentinel.AlertRuleMachineLearningBehaviorAnalytics("exampleAlertRuleMachineLearningBehaviorAnalytics", new() + /// { + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id, + /// AlertRuleTemplateGuid = "737a2ce1-70a3-4968-9e90-3e6aca836abf", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Machine Learning Behavior Analytics Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleMsSecurityIncident.cs b/sdk/dotnet/Sentinel/AlertRuleMsSecurityIncident.cs index f322d4fc9c..cf49ad2392 100644 --- a/sdk/dotnet/Sentinel/AlertRuleMsSecurityIncident.cs +++ b/sdk/dotnet/Sentinel/AlertRuleMsSecurityIncident.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel MS Security Incident Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleAlertRuleMsSecurityIncident = new Azure.Sentinel.AlertRuleMsSecurityIncident("exampleAlertRuleMsSecurityIncident", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// ProductFilter = "Microsoft Cloud App Security", + /// DisplayName = "example rule", + /// SeverityFilters = new[] + /// { + /// "High", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel MS Security Incident Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleNrt.cs b/sdk/dotnet/Sentinel/AlertRuleNrt.cs index d0822d9a47..6d2c4e3a94 100644 --- a/sdk/dotnet/Sentinel/AlertRuleNrt.cs +++ b/sdk/dotnet/Sentinel/AlertRuleNrt.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel NRT Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "pergb2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleAlertRuleNrt = new Azure.Sentinel.AlertRuleNrt("exampleAlertRuleNrt", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "example", + /// Severity = "High", + /// Query = @"AzureActivity | + /// where OperationName == ""Create or Update Virtual Machine"" or OperationName ==""Create Deployment"" | + /// where ActivityStatus == ""Succeeded"" | + /// make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel NRT Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleScheduled.cs b/sdk/dotnet/Sentinel/AlertRuleScheduled.cs index 437d9222b8..613ddf10ec 100644 --- a/sdk/dotnet/Sentinel/AlertRuleScheduled.cs +++ b/sdk/dotnet/Sentinel/AlertRuleScheduled.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Scheduled Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleAlertRuleScheduled = new Azure.Sentinel.AlertRuleScheduled("exampleAlertRuleScheduled", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "example", + /// Severity = "High", + /// Query = @"AzureActivity | + /// where OperationName == ""Create or Update Virtual Machine"" or OperationName ==""Create Deployment"" | + /// where ActivityStatus == ""Succeeded"" | + /// make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Scheduled Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AlertRuleThreatIntelligence.cs b/sdk/dotnet/Sentinel/AlertRuleThreatIntelligence.cs index 695ead86d8..7b1c365243 100644 --- a/sdk/dotnet/Sentinel/AlertRuleThreatIntelligence.cs +++ b/sdk/dotnet/Sentinel/AlertRuleThreatIntelligence.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Threat Intelligence Alert Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "pergb2018", + /// }); + /// + /// var exampleAnalyticsSolution = new Azure.OperationalInsights.AnalyticsSolution("exampleAnalyticsSolution", new() + /// { + /// SolutionName = "SecurityInsights", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// Plan = new Azure.OperationalInsights.Inputs.AnalyticsSolutionPlanArgs + /// { + /// Publisher = "Microsoft", + /// Product = "OMSGallery/SecurityInsights", + /// }, + /// }); + /// + /// var exampleAlertRuleTemplate = Azure.Sentinel.GetAlertRuleTemplate.Invoke(new() + /// { + /// DisplayName = "(Preview) Microsoft Defender Threat Intelligence Analytics", + /// LogAnalyticsWorkspaceId = exampleAnalyticsSolution.WorkspaceResourceId, + /// }); + /// + /// var exampleAlertRuleThreatIntelligence = new Azure.Sentinel.AlertRuleThreatIntelligence("exampleAlertRuleThreatIntelligence", new() + /// { + /// LogAnalyticsWorkspaceId = exampleAnalyticsSolution.WorkspaceResourceId, + /// AlertRuleTemplateGuid = exampleAlertRuleTemplate.Apply(getAlertRuleTemplateResult => getAlertRuleTemplateResult.Name), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Threat Intelligence Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AuthomationRule.cs b/sdk/dotnet/Sentinel/AuthomationRule.cs index f1cd227492..97ceac791e 100644 --- a/sdk/dotnet/Sentinel/AuthomationRule.cs +++ b/sdk/dotnet/Sentinel/AuthomationRule.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Automation Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleAutomationRule = new Azure.Sentinel.AutomationRule("exampleAutomationRule", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "automation_rule1", + /// Order = 1, + /// ActionIncidents = new[] + /// { + /// new Azure.Sentinel.Inputs.AutomationRuleActionIncidentArgs + /// { + /// Order = 1, + /// Status = "Active", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/AutomationRule.cs b/sdk/dotnet/Sentinel/AutomationRule.cs index 85a1cb907f..6bfa66158e 100644 --- a/sdk/dotnet/Sentinel/AutomationRule.cs +++ b/sdk/dotnet/Sentinel/AutomationRule.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Automation Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleAutomationRule = new Azure.Sentinel.AutomationRule("exampleAutomationRule", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "automation_rule1", + /// Order = 1, + /// ActionIncidents = new[] + /// { + /// new Azure.Sentinel.Inputs.AutomationRuleActionIncidentArgs + /// { + /// Order = 1, + /// Status = "Active", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorAwsCloudTrail.cs b/sdk/dotnet/Sentinel/DataConnectorAwsCloudTrail.cs index 21db7e582f..a0233275ab 100644 --- a/sdk/dotnet/Sentinel/DataConnectorAwsCloudTrail.cs +++ b/sdk/dotnet/Sentinel/DataConnectorAwsCloudTrail.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a AWS CloudTrail Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorAwsCloudTrail = new Azure.Sentinel.DataConnectorAwsCloudTrail("exampleDataConnectorAwsCloudTrail", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// AwsRoleArn = "arn:aws:iam::000000000000:role/role1", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// AWS CloudTrail Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorAwsS3.cs b/sdk/dotnet/Sentinel/DataConnectorAwsS3.cs index 2a74fdf879..dd0ea30a4e 100644 --- a/sdk/dotnet/Sentinel/DataConnectorAwsS3.cs +++ b/sdk/dotnet/Sentinel/DataConnectorAwsS3.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a AWS S3 Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorAwsS3 = new Azure.Sentinel.DataConnectorAwsS3("exampleDataConnectorAwsS3", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// AwsRoleArn = "arn:aws:iam::000000000000:role/role1", + /// DestinationTable = "AWSGuardDuty", + /// SqsUrls = new[] + /// { + /// "https://sqs.us-east-1.amazonaws.com/000000000000/example", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// AWS S3 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorAzureActiveDirectory.cs b/sdk/dotnet/Sentinel/DataConnectorAzureActiveDirectory.cs index 07e78481a3..e11e7c485f 100644 --- a/sdk/dotnet/Sentinel/DataConnectorAzureActiveDirectory.cs +++ b/sdk/dotnet/Sentinel/DataConnectorAzureActiveDirectory.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Azure Active Directory Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorAzureActiveDirectory = new Azure.Sentinel.DataConnectorAzureActiveDirectory("exampleDataConnectorAzureActiveDirectory", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Active Directory Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorAzureAdvancedThreadProtection.cs b/sdk/dotnet/Sentinel/DataConnectorAzureAdvancedThreadProtection.cs index 2ed8789b82..51b58c095a 100644 --- a/sdk/dotnet/Sentinel/DataConnectorAzureAdvancedThreadProtection.cs +++ b/sdk/dotnet/Sentinel/DataConnectorAzureAdvancedThreadProtection.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.Sentinel /// /// !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorAzureAdvancedThreadProtection = new Azure.Sentinel.DataConnectorAzureAdvancedThreadProtection("exampleDataConnectorAzureAdvancedThreadProtection", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorAzureSecurityCenter.cs b/sdk/dotnet/Sentinel/DataConnectorAzureSecurityCenter.cs index ba760f250c..8ed8c0bbc0 100644 --- a/sdk/dotnet/Sentinel/DataConnectorAzureSecurityCenter.cs +++ b/sdk/dotnet/Sentinel/DataConnectorAzureSecurityCenter.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Azure Security Center Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorAzureSecurityCenter = new Azure.Sentinel.DataConnectorAzureSecurityCenter("exampleDataConnectorAzureSecurityCenter", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Security Center Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorDynamics365.cs b/sdk/dotnet/Sentinel/DataConnectorDynamics365.cs index cc89f834ab..ef4a7931a7 100644 --- a/sdk/dotnet/Sentinel/DataConnectorDynamics365.cs +++ b/sdk/dotnet/Sentinel/DataConnectorDynamics365.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Dynamics 365 Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorDynamics365 = new Azure.Sentinel.DataConnectorDynamics365("exampleDataConnectorDynamics365", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Dynamics 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorIot.cs b/sdk/dotnet/Sentinel/DataConnectorIot.cs index 8cb2371d4a..54af89e841 100644 --- a/sdk/dotnet/Sentinel/DataConnectorIot.cs +++ b/sdk/dotnet/Sentinel/DataConnectorIot.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages an Iot Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorIot = new Azure.Sentinel.DataConnectorIot("exampleDataConnectorIot", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Iot Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorMicrosoftCloudAppSecurity.cs b/sdk/dotnet/Sentinel/DataConnectorMicrosoftCloudAppSecurity.cs index 63dfb8ee17..6f98da7925 100644 --- a/sdk/dotnet/Sentinel/DataConnectorMicrosoftCloudAppSecurity.cs +++ b/sdk/dotnet/Sentinel/DataConnectorMicrosoftCloudAppSecurity.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.Sentinel /// /// !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorMicrosoftCloudAppSecurity = new Azure.Sentinel.DataConnectorMicrosoftCloudAppSecurity("exampleDataConnectorMicrosoftCloudAppSecurity", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Microsoft Cloud App Security Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorMicrosoftDefenderAdvancedThreatProtection.cs b/sdk/dotnet/Sentinel/DataConnectorMicrosoftDefenderAdvancedThreatProtection.cs index 2b48c4eb7c..0f688d5ebc 100644 --- a/sdk/dotnet/Sentinel/DataConnectorMicrosoftDefenderAdvancedThreatProtection.cs +++ b/sdk/dotnet/Sentinel/DataConnectorMicrosoftDefenderAdvancedThreatProtection.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Microsoft Defender Advanced Threat Protection Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorMicrosoftDefenderAdvancedThreatProtection = new Azure.Sentinel.DataConnectorMicrosoftDefenderAdvancedThreatProtection("exampleDataConnectorMicrosoftDefenderAdvancedThreatProtection", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Microsoft Defender Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatIntelligence.cs b/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatIntelligence.cs index a4c638850d..4d65d7de5f 100644 --- a/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatIntelligence.cs +++ b/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatIntelligence.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Microsoft Threat Intelligence Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorMicrosoftThreatIntelligence = new Azure.Sentinel.DataConnectorMicrosoftThreatIntelligence("exampleDataConnectorMicrosoftThreatIntelligence", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// MicrosoftEmergingThreatFeedLookbackDate = "1970-01-01T00:00:00Z", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// sentinels can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatProtection.cs b/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatProtection.cs index a3ab513d16..ec6c48a800 100644 --- a/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatProtection.cs +++ b/sdk/dotnet/Sentinel/DataConnectorMicrosoftThreatProtection.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Microsoft Threat Protection Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorMicrosoftThreatProtection = new Azure.Sentinel.DataConnectorMicrosoftThreatProtection("exampleDataConnectorMicrosoftThreatProtection", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Microsoft Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorOffice365.cs b/sdk/dotnet/Sentinel/DataConnectorOffice365.cs index 734e19434a..f29b5021b2 100644 --- a/sdk/dotnet/Sentinel/DataConnectorOffice365.cs +++ b/sdk/dotnet/Sentinel/DataConnectorOffice365.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Office 365 Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorOffice365 = new Azure.Sentinel.DataConnectorOffice365("exampleDataConnectorOffice365", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Office 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorOffice365Project.cs b/sdk/dotnet/Sentinel/DataConnectorOffice365Project.cs index dacc522ed5..638a322cbb 100644 --- a/sdk/dotnet/Sentinel/DataConnectorOffice365Project.cs +++ b/sdk/dotnet/Sentinel/DataConnectorOffice365Project.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages an Office 365 Project Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorOffice365Project = new Azure.Sentinel.DataConnectorOffice365Project("exampleDataConnectorOffice365Project", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Office 365 Project Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorOfficeAtp.cs b/sdk/dotnet/Sentinel/DataConnectorOfficeAtp.cs index 954d893a3e..f0fc6ee19f 100644 --- a/sdk/dotnet/Sentinel/DataConnectorOfficeAtp.cs +++ b/sdk/dotnet/Sentinel/DataConnectorOfficeAtp.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Office ATP Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorOfficeAtp = new Azure.Sentinel.DataConnectorOfficeAtp("exampleDataConnectorOfficeAtp", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Office ATP Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorOfficeIrm.cs b/sdk/dotnet/Sentinel/DataConnectorOfficeIrm.cs index 17d59cf2d3..8ddd1c82c5 100644 --- a/sdk/dotnet/Sentinel/DataConnectorOfficeIrm.cs +++ b/sdk/dotnet/Sentinel/DataConnectorOfficeIrm.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages an Office IRM Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorOfficeIrm = new Azure.Sentinel.DataConnectorOfficeIrm("exampleDataConnectorOfficeIrm", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Office IRM Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorOfficePowerBi.cs b/sdk/dotnet/Sentinel/DataConnectorOfficePowerBi.cs index e8d125d339..31cd8d8972 100644 --- a/sdk/dotnet/Sentinel/DataConnectorOfficePowerBi.cs +++ b/sdk/dotnet/Sentinel/DataConnectorOfficePowerBi.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages an Office Power BI Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorOfficePowerBi = new Azure.Sentinel.DataConnectorOfficePowerBi("exampleDataConnectorOfficePowerBi", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Office Power BI Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorThreatIntelligence.cs b/sdk/dotnet/Sentinel/DataConnectorThreatIntelligence.cs index 396f753c6f..595cafb140 100644 --- a/sdk/dotnet/Sentinel/DataConnectorThreatIntelligence.cs +++ b/sdk/dotnet/Sentinel/DataConnectorThreatIntelligence.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Threat Intelligence Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorThreatIntelligence = new Azure.Sentinel.DataConnectorThreatIntelligence("exampleDataConnectorThreatIntelligence", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Threat Intelligence Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/DataConnectorThreatIntelligenceTaxii.cs b/sdk/dotnet/Sentinel/DataConnectorThreatIntelligenceTaxii.cs index 69cef9d524..5dbf96654c 100644 --- a/sdk/dotnet/Sentinel/DataConnectorThreatIntelligenceTaxii.cs +++ b/sdk/dotnet/Sentinel/DataConnectorThreatIntelligenceTaxii.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Sentinel /// /// Manages an Threat Intelligence TAXII Data Connector. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleDataConnectorThreatIntelligenceTaxii = new Azure.Sentinel.DataConnectorThreatIntelligenceTaxii("exampleDataConnectorThreatIntelligenceTaxii", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "example", + /// ApiRootUrl = "https://foo/taxii2/api2/", + /// CollectionId = "someid", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Threat Intelligence TAXII Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/GetAlertRule.cs b/sdk/dotnet/Sentinel/GetAlertRule.cs index 21eff2dc9d..47b4c1d84b 100644 --- a/sdk/dotnet/Sentinel/GetAlertRule.cs +++ b/sdk/dotnet/Sentinel/GetAlertRule.cs @@ -13,12 +13,78 @@ public static class GetAlertRule { /// /// Use this data source to access information about an existing Sentinel Alert Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAnalyticsWorkspace = Azure.OperationalInsights.GetAnalyticsWorkspace.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleAlertRule = Azure.Sentinel.GetAlertRule.Invoke(new() + /// { + /// Name = "existing", + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Apply(getAnalyticsWorkspaceResult => getAnalyticsWorkspaceResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleAlertRule.Apply(getAlertRuleResult => getAlertRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAlertRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:sentinel/getAlertRule:getAlertRule", args ?? new GetAlertRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Sentinel Alert Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAnalyticsWorkspace = Azure.OperationalInsights.GetAnalyticsWorkspace.Invoke(new() + /// { + /// Name = "example", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// var exampleAlertRule = Azure.Sentinel.GetAlertRule.Invoke(new() + /// { + /// Name = "existing", + /// LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Apply(getAnalyticsWorkspaceResult => getAnalyticsWorkspaceResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleAlertRule.Apply(getAlertRuleResult => getAlertRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAlertRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:sentinel/getAlertRule:getAlertRule", args ?? new GetAlertRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Sentinel/GetAlertRuleAnomaly.cs b/sdk/dotnet/Sentinel/GetAlertRuleAnomaly.cs index d543d25ff8..7799373894 100644 --- a/sdk/dotnet/Sentinel/GetAlertRuleAnomaly.cs +++ b/sdk/dotnet/Sentinel/GetAlertRuleAnomaly.cs @@ -13,12 +13,102 @@ public static class GetAlertRuleAnomaly { /// /// Use this data source to access information about an existing Anomaly Alert Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// CustomerManagedKeyEnabled = false, + /// }); + /// + /// var exampleAlertRuleAnomaly = Azure.Sentinel.GetAlertRuleAnomaly.Invoke(new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "Potential data staging", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleAlertRuleAnomaly.Apply(getAlertRuleAnomalyResult => getAlertRuleAnomalyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAlertRuleAnomalyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:sentinel/getAlertRuleAnomaly:getAlertRuleAnomaly", args ?? new GetAlertRuleAnomalyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Anomaly Alert Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// CustomerManagedKeyEnabled = false, + /// }); + /// + /// var exampleAlertRuleAnomaly = Azure.Sentinel.GetAlertRuleAnomaly.Invoke(new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "Potential data staging", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleAlertRuleAnomaly.Apply(getAlertRuleAnomalyResult => getAlertRuleAnomalyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAlertRuleAnomalyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:sentinel/getAlertRuleAnomaly:getAlertRuleAnomaly", args ?? new GetAlertRuleAnomalyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Sentinel/GetAlertRuleTemplate.cs b/sdk/dotnet/Sentinel/GetAlertRuleTemplate.cs index 578088acd5..d8caa81dd0 100644 --- a/sdk/dotnet/Sentinel/GetAlertRuleTemplate.cs +++ b/sdk/dotnet/Sentinel/GetAlertRuleTemplate.cs @@ -13,12 +13,66 @@ public static class GetAlertRuleTemplate { /// /// Use this data source to access information about an existing Sentinel Alert Rule Template. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sentinel.GetAlertRuleTemplate.Invoke(new() + /// { + /// LogAnalyticsWorkspaceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", + /// DisplayName = "Create incidents based on Azure Security Center for IoT alerts", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getAlertRuleTemplateResult => getAlertRuleTemplateResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAlertRuleTemplateArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:sentinel/getAlertRuleTemplate:getAlertRuleTemplate", args ?? new GetAlertRuleTemplateArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Sentinel Alert Rule Template. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sentinel.GetAlertRuleTemplate.Invoke(new() + /// { + /// LogAnalyticsWorkspaceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", + /// DisplayName = "Create incidents based on Azure Security Center for IoT alerts", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getAlertRuleTemplateResult => getAlertRuleTemplateResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAlertRuleTemplateInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:sentinel/getAlertRuleTemplate:getAlertRuleTemplate", args ?? new GetAlertRuleTemplateInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Sentinel/LogAnalyticsWorkspaceOnboarding.cs b/sdk/dotnet/Sentinel/LogAnalyticsWorkspaceOnboarding.cs index 67b741b2fc..5266038288 100644 --- a/sdk/dotnet/Sentinel/LogAnalyticsWorkspaceOnboarding.cs +++ b/sdk/dotnet/Sentinel/LogAnalyticsWorkspaceOnboarding.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Security Insights Sentinel Onboarding. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// CustomerManagedKeyEnabled = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Security Insights Sentinel Onboarding States can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/Metadata.cs b/sdk/dotnet/Sentinel/Metadata.cs index e9984640e7..09f62da4fe 100644 --- a/sdk/dotnet/Sentinel/Metadata.cs +++ b/sdk/dotnet/Sentinel/Metadata.cs @@ -12,6 +12,65 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Metadata. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "pergb2018", + /// }); + /// + /// var exampleAnalyticsSolution = new Azure.OperationalInsights.AnalyticsSolution("exampleAnalyticsSolution", new() + /// { + /// SolutionName = "SecurityInsights", + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceResourceId = exampleAnalyticsWorkspace.Id, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// Plan = new Azure.OperationalInsights.Inputs.AnalyticsSolutionPlanArgs + /// { + /// Publisher = "Microsoft", + /// Product = "OMSGallery/SecurityInsights", + /// }, + /// }); + /// + /// var exampleAlertRuleNrt = new Azure.Sentinel.AlertRuleNrt("exampleAlertRuleNrt", new() + /// { + /// LogAnalyticsWorkspaceId = exampleAnalyticsSolution.WorkspaceResourceId, + /// DisplayName = "example", + /// Severity = "High", + /// Query = @"AzureActivity | + /// where OperationName == ""Create or Update Virtual Machine"" or OperationName ==""Create Deployment"" | + /// where ActivityStatus == ""Succeeded"" | + /// make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + /// ", + /// }); + /// + /// var exampleMetadata = new Azure.Sentinel.Metadata("exampleMetadata", new() + /// { + /// WorkspaceId = exampleAnalyticsSolution.WorkspaceResourceId, + /// ContentId = exampleAlertRuleNrt.Name, + /// Kind = "AnalyticsRule", + /// ParentId = exampleAlertRuleNrt.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Metadata can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/ThreatIntelligenceIndicator.cs b/sdk/dotnet/Sentinel/ThreatIntelligenceIndicator.cs index bc7265a3a6..566406022d 100644 --- a/sdk/dotnet/Sentinel/ThreatIntelligenceIndicator.cs +++ b/sdk/dotnet/Sentinel/ThreatIntelligenceIndicator.cs @@ -12,6 +12,54 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Threat Intelligence Indicator. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// RetentionInDays = 30, + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// WorkspaceName = exampleAnalyticsWorkspace.Name, + /// }); + /// + /// var exampleThreatIntelligenceIndicator = new Azure.Sentinel.ThreatIntelligenceIndicator("exampleThreatIntelligenceIndicator", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// PatternType = "domain-name", + /// Pattern = "http://example.com", + /// Source = "Microsoft Sentinel", + /// ValidateFromUtc = "2022-12-14T16:00:00Z", + /// DisplayName = "example-indicator", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// azurerm_sentinel_log_analytics_workspace_onboarding.Test, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Threat Intelligence Indicators can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/Watchlist.cs b/sdk/dotnet/Sentinel/Watchlist.cs index 0e2ad5ea84..b0b672b81b 100644 --- a/sdk/dotnet/Sentinel/Watchlist.cs +++ b/sdk/dotnet/Sentinel/Watchlist.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Watchlist. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleWatchlist = new Azure.Sentinel.Watchlist("exampleWatchlist", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "example-wl", + /// ItemSearchKey = "Key", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Watchlists can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sentinel/WatchlistItem.cs b/sdk/dotnet/Sentinel/WatchlistItem.cs index 6dab02a951..20006cd630 100644 --- a/sdk/dotnet/Sentinel/WatchlistItem.cs +++ b/sdk/dotnet/Sentinel/WatchlistItem.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.Sentinel /// /// Manages a Sentinel Watchlist Item. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "PerGB2018", + /// }); + /// + /// var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", new() + /// { + /// WorkspaceId = exampleAnalyticsWorkspace.Id, + /// }); + /// + /// var exampleWatchlist = new Azure.Sentinel.Watchlist("exampleWatchlist", new() + /// { + /// LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, + /// DisplayName = "example-wl", + /// ItemSearchKey = "Key", + /// }); + /// + /// var exampleWatchlistItem = new Azure.Sentinel.WatchlistItem("exampleWatchlistItem", new() + /// { + /// WatchlistId = exampleWatchlist.Id, + /// Properties = + /// { + /// { "k1", "v1" }, + /// { "k2", "v2" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Sentinel Watchlist Items can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/GetNamespace.cs b/sdk/dotnet/ServiceBus/GetNamespace.cs index 1c133c6243..6be9844d72 100644 --- a/sdk/dotnet/ServiceBus/GetNamespace.cs +++ b/sdk/dotnet/ServiceBus/GetNamespace.cs @@ -13,12 +13,66 @@ public static class GetNamespace { /// /// Use this data source to access information about an existing ServiceBus Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetNamespace.Invoke(new() + /// { + /// Name = "examplenamespace", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["location"] = example.Apply(getNamespaceResult => getNamespaceResult.Location), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNamespaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:servicebus/getNamespace:getNamespace", args ?? new GetNamespaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing ServiceBus Namespace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetNamespace.Invoke(new() + /// { + /// Name = "examplenamespace", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["location"] = example.Apply(getNamespaceResult => getNamespaceResult.Location), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNamespaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:servicebus/getNamespace:getNamespace", args ?? new GetNamespaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ServiceBus/GetNamespaceAuthorizationRule.cs b/sdk/dotnet/ServiceBus/GetNamespaceAuthorizationRule.cs index d42ea006c5..a30caa29dd 100644 --- a/sdk/dotnet/ServiceBus/GetNamespaceAuthorizationRule.cs +++ b/sdk/dotnet/ServiceBus/GetNamespaceAuthorizationRule.cs @@ -13,12 +13,66 @@ public static class GetNamespaceAuthorizationRule { /// /// Use this data source to access information about an existing ServiceBus Namespace Authorization Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetNamespaceAuthorizationRule.Invoke(new() + /// { + /// Name = "examplerule", + /// NamespaceId = "examplenamespace", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ruleId"] = example.Apply(getNamespaceAuthorizationRuleResult => getNamespaceAuthorizationRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetNamespaceAuthorizationRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:servicebus/getNamespaceAuthorizationRule:getNamespaceAuthorizationRule", args ?? new GetNamespaceAuthorizationRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing ServiceBus Namespace Authorization Rule. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetNamespaceAuthorizationRule.Invoke(new() + /// { + /// Name = "examplerule", + /// NamespaceId = "examplenamespace", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["ruleId"] = example.Apply(getNamespaceAuthorizationRuleResult => getNamespaceAuthorizationRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetNamespaceAuthorizationRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:servicebus/getNamespaceAuthorizationRule:getNamespaceAuthorizationRule", args ?? new GetNamespaceAuthorizationRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ServiceBus/GetQueue.cs b/sdk/dotnet/ServiceBus/GetQueue.cs index e709522a84..9990e79b30 100644 --- a/sdk/dotnet/ServiceBus/GetQueue.cs +++ b/sdk/dotnet/ServiceBus/GetQueue.cs @@ -13,12 +13,66 @@ public static class GetQueue { /// /// Use this data source to access information about an existing Service Bus Queue. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetQueue.Invoke(new() + /// { + /// Name = "existing", + /// NamespaceId = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getQueueResult => getQueueResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetQueueArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:servicebus/getQueue:getQueue", args ?? new GetQueueArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Service Bus Queue. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetQueue.Invoke(new() + /// { + /// Name = "existing", + /// NamespaceId = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getQueueResult => getQueueResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetQueueInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:servicebus/getQueue:getQueue", args ?? new GetQueueInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ServiceBus/GetQueueAuthorizationRule.cs b/sdk/dotnet/ServiceBus/GetQueueAuthorizationRule.cs index 0bf74155d7..ddbbf7d17f 100644 --- a/sdk/dotnet/ServiceBus/GetQueueAuthorizationRule.cs +++ b/sdk/dotnet/ServiceBus/GetQueueAuthorizationRule.cs @@ -13,12 +13,70 @@ public static class GetQueueAuthorizationRule { /// /// Use this data source to access information about an existing ServiceBus Queue Authorisation Rule within a ServiceBus Queue. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetQueueAuthorizationRule.Invoke(new() + /// { + /// Name = "example-tfex_name", + /// ResourceGroupName = "example-resources", + /// QueueName = "example-servicebus_queue", + /// NamespaceName = "example-namespace", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getQueueAuthorizationRuleResult => getQueueAuthorizationRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetQueueAuthorizationRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:servicebus/getQueueAuthorizationRule:getQueueAuthorizationRule", args ?? new GetQueueAuthorizationRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing ServiceBus Queue Authorisation Rule within a ServiceBus Queue. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetQueueAuthorizationRule.Invoke(new() + /// { + /// Name = "example-tfex_name", + /// ResourceGroupName = "example-resources", + /// QueueName = "example-servicebus_queue", + /// NamespaceName = "example-namespace", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getQueueAuthorizationRuleResult => getQueueAuthorizationRuleResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetQueueAuthorizationRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:servicebus/getQueueAuthorizationRule:getQueueAuthorizationRule", args ?? new GetQueueAuthorizationRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ServiceBus/GetSubscription.cs b/sdk/dotnet/ServiceBus/GetSubscription.cs index 86f49b8ea8..cbddd42df2 100644 --- a/sdk/dotnet/ServiceBus/GetSubscription.cs +++ b/sdk/dotnet/ServiceBus/GetSubscription.cs @@ -13,12 +13,66 @@ public static class GetSubscription { /// /// Use this data source to access information about an existing ServiceBus Subscription. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetSubscription.Invoke(new() + /// { + /// Name = "examplesubscription", + /// TopicId = "exampletopic", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["servicebusSubscription"] = data.Azurerm_servicebus_namespace.Example, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSubscriptionArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:servicebus/getSubscription:getSubscription", args ?? new GetSubscriptionArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing ServiceBus Subscription. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetSubscription.Invoke(new() + /// { + /// Name = "examplesubscription", + /// TopicId = "exampletopic", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["servicebusSubscription"] = data.Azurerm_servicebus_namespace.Example, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSubscriptionInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:servicebus/getSubscription:getSubscription", args ?? new GetSubscriptionInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ServiceBus/GetTopic.cs b/sdk/dotnet/ServiceBus/GetTopic.cs index c59a17fbae..3467895ed1 100644 --- a/sdk/dotnet/ServiceBus/GetTopic.cs +++ b/sdk/dotnet/ServiceBus/GetTopic.cs @@ -13,12 +13,66 @@ public static class GetTopic { /// /// Use this data source to access information about an existing Service Bus Topic. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetTopic.Invoke(new() + /// { + /// Name = "existing", + /// NamespaceId = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getTopicResult => getTopicResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTopicArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:servicebus/getTopic:getTopic", args ?? new GetTopicArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Service Bus Topic. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetTopic.Invoke(new() + /// { + /// Name = "existing", + /// NamespaceId = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getTopicResult => getTopicResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTopicInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:servicebus/getTopic:getTopic", args ?? new GetTopicInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ServiceBus/GetTopicAuthorizationRule.cs b/sdk/dotnet/ServiceBus/GetTopicAuthorizationRule.cs index 470ef1e18a..4bc1864cc4 100644 --- a/sdk/dotnet/ServiceBus/GetTopicAuthorizationRule.cs +++ b/sdk/dotnet/ServiceBus/GetTopicAuthorizationRule.cs @@ -13,12 +13,70 @@ public static class GetTopicAuthorizationRule { /// /// Use this data source to access information about a ServiceBus Topic Authorization Rule within a ServiceBus Topic. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetTopicAuthorizationRule.Invoke(new() + /// { + /// Name = "example-tfex_name", + /// ResourceGroupName = "example-resources", + /// NamespaceName = "example-namespace", + /// TopicName = "example-servicebus_topic", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["servicebusAuthorizationRuleId"] = data.Azurem_servicebus_topic_authorization_rule.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTopicAuthorizationRuleArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:servicebus/getTopicAuthorizationRule:getTopicAuthorizationRule", args ?? new GetTopicAuthorizationRuleArgs(), options.WithDefaults()); /// /// Use this data source to access information about a ServiceBus Topic Authorization Rule within a ServiceBus Topic. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.ServiceBus.GetTopicAuthorizationRule.Invoke(new() + /// { + /// Name = "example-tfex_name", + /// ResourceGroupName = "example-resources", + /// NamespaceName = "example-namespace", + /// TopicName = "example-servicebus_topic", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["servicebusAuthorizationRuleId"] = data.Azurem_servicebus_topic_authorization_rule.Example.Id, + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTopicAuthorizationRuleInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:servicebus/getTopicAuthorizationRule:getTopicAuthorizationRule", args ?? new GetTopicAuthorizationRuleInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/ServiceBus/Namespace.cs b/sdk/dotnet/ServiceBus/Namespace.cs index b992257a4c..b33a3eac7c 100644 --- a/sdk/dotnet/ServiceBus/Namespace.cs +++ b/sdk/dotnet/ServiceBus/Namespace.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.ServiceBus /// /// Manages a ServiceBus Namespace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/NamespaceAuthorizationRule.cs b/sdk/dotnet/ServiceBus/NamespaceAuthorizationRule.cs index dfbea5a300..175dec4281 100644 --- a/sdk/dotnet/ServiceBus/NamespaceAuthorizationRule.cs +++ b/sdk/dotnet/ServiceBus/NamespaceAuthorizationRule.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.ServiceBus /// /// Manages a ServiceBus Namespace authorization Rule within a ServiceBus. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleNamespaceAuthorizationRule = new Azure.ServiceBus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// Listen = true, + /// Send = true, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/NamespaceDisasterRecoveryConfig.cs b/sdk/dotnet/ServiceBus/NamespaceDisasterRecoveryConfig.cs index 79cce9d009..9ac2d4e65e 100644 --- a/sdk/dotnet/ServiceBus/NamespaceDisasterRecoveryConfig.cs +++ b/sdk/dotnet/ServiceBus/NamespaceDisasterRecoveryConfig.cs @@ -14,6 +14,55 @@ namespace Pulumi.Azure.ServiceBus /// /// > **NOTE:** Disaster Recovery Config is a Premium SKU only capability. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var primary = new Azure.ServiceBus.Namespace("primary", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Premium", + /// Capacity = 1, + /// }); + /// + /// var secondary = new Azure.ServiceBus.Namespace("secondary", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Premium", + /// Capacity = 1, + /// }); + /// + /// var exampleNamespaceAuthorizationRule = new Azure.ServiceBus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", new() + /// { + /// NamespaceId = azurerm_servicebus_namespace.Example.Id, + /// Listen = true, + /// Send = true, + /// Manage = false, + /// }); + /// + /// var exampleNamespaceDisasterRecoveryConfig = new Azure.ServiceBus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", new() + /// { + /// PrimaryNamespaceId = primary.Id, + /// PartnerNamespaceId = secondary.Id, + /// AliasAuthorizationRuleId = exampleNamespaceAuthorizationRule.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus DR configs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/NamespaceNetworkRuleSet.cs b/sdk/dotnet/ServiceBus/NamespaceNetworkRuleSet.cs index 9f26da0699..54360a08eb 100644 --- a/sdk/dotnet/ServiceBus/NamespaceNetworkRuleSet.cs +++ b/sdk/dotnet/ServiceBus/NamespaceNetworkRuleSet.cs @@ -12,6 +12,80 @@ namespace Pulumi.Azure.ServiceBus /// /// Manages a ServiceBus Namespace Network Rule Set. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Premium", + /// Capacity = 1, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "172.17.0.0/16", + /// }, + /// DnsServers = new[] + /// { + /// "10.0.0.4", + /// "10.0.0.5", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "172.17.0.0/24", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.ServiceBus", + /// }, + /// }); + /// + /// var exampleNamespaceNetworkRuleSet = new Azure.ServiceBus.NamespaceNetworkRuleSet("exampleNamespaceNetworkRuleSet", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// DefaultAction = "Deny", + /// PublicNetworkAccessEnabled = true, + /// NetworkRules = new[] + /// { + /// new Azure.ServiceBus.Inputs.NamespaceNetworkRuleSetNetworkRuleArgs + /// { + /// SubnetId = exampleSubnet.Id, + /// IgnoreMissingVnetServiceEndpoint = false, + /// }, + /// }, + /// IpRules = new[] + /// { + /// "1.1.1.1", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/Queue.cs b/sdk/dotnet/ServiceBus/Queue.cs index 743acaef66..c5d5704383 100644 --- a/sdk/dotnet/ServiceBus/Queue.cs +++ b/sdk/dotnet/ServiceBus/Queue.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.ServiceBus /// /// Manages a ServiceBus Queue. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleQueue = new Azure.ServiceBus.Queue("exampleQueue", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/QueueAuthorizationRule.cs b/sdk/dotnet/ServiceBus/QueueAuthorizationRule.cs index 66c117527d..f994d46cc9 100644 --- a/sdk/dotnet/ServiceBus/QueueAuthorizationRule.cs +++ b/sdk/dotnet/ServiceBus/QueueAuthorizationRule.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.ServiceBus /// /// Manages an Authorization Rule for a ServiceBus Queue. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleQueue = new Azure.ServiceBus.Queue("exampleQueue", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleQueueAuthorizationRule = new Azure.ServiceBus.QueueAuthorizationRule("exampleQueueAuthorizationRule", new() + /// { + /// QueueId = exampleQueue.Id, + /// Listen = true, + /// Send = true, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/Subscription.cs b/sdk/dotnet/ServiceBus/Subscription.cs index 42defbfda0..fdc0eb9d3a 100644 --- a/sdk/dotnet/ServiceBus/Subscription.cs +++ b/sdk/dotnet/ServiceBus/Subscription.cs @@ -12,6 +12,47 @@ namespace Pulumi.Azure.ServiceBus /// /// Manages a ServiceBus Subscription. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleSubscription = new Azure.ServiceBus.Subscription("exampleSubscription", new() + /// { + /// TopicId = exampleTopic.Id, + /// MaxDeliveryCount = 1, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/SubscriptionRule.cs b/sdk/dotnet/ServiceBus/SubscriptionRule.cs index 828a8e5430..5c70047a6b 100644 --- a/sdk/dotnet/ServiceBus/SubscriptionRule.cs +++ b/sdk/dotnet/ServiceBus/SubscriptionRule.cs @@ -13,6 +13,108 @@ namespace Pulumi.Azure.ServiceBus /// Manages a ServiceBus Subscription Rule. /// /// ## Example Usage + /// ### SQL Filter) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleSubscription = new Azure.ServiceBus.Subscription("exampleSubscription", new() + /// { + /// TopicId = exampleTopic.Id, + /// MaxDeliveryCount = 1, + /// }); + /// + /// var exampleSubscriptionRule = new Azure.ServiceBus.SubscriptionRule("exampleSubscriptionRule", new() + /// { + /// SubscriptionId = exampleSubscription.Id, + /// FilterType = "SqlFilter", + /// SqlFilter = "colour = 'red'", + /// }); + /// + /// }); + /// ``` + /// ### Correlation Filter) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleSubscription = new Azure.ServiceBus.Subscription("exampleSubscription", new() + /// { + /// TopicId = exampleTopic.Id, + /// MaxDeliveryCount = 1, + /// }); + /// + /// var exampleSubscriptionRule = new Azure.ServiceBus.SubscriptionRule("exampleSubscriptionRule", new() + /// { + /// SubscriptionId = exampleSubscription.Id, + /// FilterType = "CorrelationFilter", + /// CorrelationFilter = new Azure.ServiceBus.Inputs.SubscriptionRuleCorrelationFilterArgs + /// { + /// CorrelationId = "high", + /// Label = "red", + /// Properties = + /// { + /// { "customProperty", "value" }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` /// /// ## Import /// diff --git a/sdk/dotnet/ServiceBus/Topic.cs b/sdk/dotnet/ServiceBus/Topic.cs index b415ca5419..080b8e81d0 100644 --- a/sdk/dotnet/ServiceBus/Topic.cs +++ b/sdk/dotnet/ServiceBus/Topic.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.ServiceBus /// /// **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceBus/TopicAuthorizationRule.cs b/sdk/dotnet/ServiceBus/TopicAuthorizationRule.cs index ebf8377c87..598e42c478 100644 --- a/sdk/dotnet/ServiceBus/TopicAuthorizationRule.cs +++ b/sdk/dotnet/ServiceBus/TopicAuthorizationRule.cs @@ -12,6 +12,48 @@ namespace Pulumi.Azure.ServiceBus /// /// Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Tags = + /// { + /// { "source", "example" }, + /// }, + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// }); + /// + /// var exampleTopicAuthorizationRule = new Azure.ServiceBus.TopicAuthorizationRule("exampleTopicAuthorizationRule", new() + /// { + /// TopicId = exampleTopic.Id, + /// Listen = true, + /// Send = false, + /// Manage = false, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceFabric/Cluster.cs b/sdk/dotnet/ServiceFabric/Cluster.cs index 1c1265bd94..25e20f28a3 100644 --- a/sdk/dotnet/ServiceFabric/Cluster.cs +++ b/sdk/dotnet/ServiceFabric/Cluster.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.ServiceFabric /// /// Manages a Service Fabric Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.ServiceFabric.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ReliabilityLevel = "Bronze", + /// UpgradeMode = "Manual", + /// ClusterCodeVersion = "7.1.456.959", + /// VmImage = "Windows", + /// ManagementEndpoint = "https://example:80", + /// NodeTypes = new[] + /// { + /// new Azure.ServiceFabric.Inputs.ClusterNodeTypeArgs + /// { + /// Name = "first", + /// InstanceCount = 3, + /// IsPrimary = true, + /// ClientEndpointPort = 2020, + /// HttpEndpointPort = 80, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Service Fabric Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/ServiceFabric/ManagedCluster.cs b/sdk/dotnet/ServiceFabric/ManagedCluster.cs index 768db1d9ba..3d20c55b9c 100644 --- a/sdk/dotnet/ServiceFabric/ManagedCluster.cs +++ b/sdk/dotnet/ServiceFabric/ManagedCluster.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.ServiceFabric /// /// Manages a Resource Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.ServiceFabric.ManagedCluster("example", new() + /// { + /// ClientConnectionPort = 12345, + /// HttpGatewayPort = 4567, + /// LbRules = new[] + /// { + /// new Azure.ServiceFabric.Inputs.ManagedClusterLbRuleArgs + /// { + /// BackendPort = 38080, + /// FrontendPort = 80, + /// ProbeProtocol = "http", + /// ProbeRequestPath = "/test", + /// Protocol = "tcp", + /// }, + /// }, + /// Location = "West Europe", + /// NodeTypes = new[] + /// { + /// new Azure.ServiceFabric.Inputs.ManagedClusterNodeTypeArgs + /// { + /// ApplicationPortRange = "30000-49000", + /// DataDiskSizeGb = 130, + /// EphemeralPortRange = "10000-20000", + /// Name = "test1", + /// Primary = true, + /// VmImageOffer = "WindowsServer", + /// VmImagePublisher = "MicrosoftWindowsServer", + /// VmImageSku = "2019-Datacenter-with-Containers", + /// VmImageVersion = "latest", + /// VmInstanceCount = 5, + /// VmSize = "Standard_DS1_v2", + /// }, + /// }, + /// ResourceGroupName = "example", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SignalR/GetService.cs b/sdk/dotnet/SignalR/GetService.cs index ea6e4accb5..4a0a36dcb9 100644 --- a/sdk/dotnet/SignalR/GetService.cs +++ b/sdk/dotnet/SignalR/GetService.cs @@ -13,12 +13,58 @@ public static class GetService { /// /// Use this data source to access information about an existing Azure SignalR service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.SignalR.GetService.Invoke(new() + /// { + /// Name = "test-signalr", + /// ResourceGroupName = "signalr-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:signalr/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure SignalR service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.SignalR.GetService.Invoke(new() + /// { + /// Name = "test-signalr", + /// ResourceGroupName = "signalr-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:signalr/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/SignalR/Service.cs b/sdk/dotnet/SignalR/Service.cs index 52c0d0b580..433e02d456 100644 --- a/sdk/dotnet/SignalR/Service.cs +++ b/sdk/dotnet/SignalR/Service.cs @@ -12,6 +12,69 @@ namespace Pulumi.Azure.SignalR /// /// Manages an Azure SignalR service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var exampleService = new Azure.SignalR.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.SignalR.Inputs.ServiceSkuArgs + /// { + /// Name = "Free_F1", + /// Capacity = 1, + /// }, + /// Cors = new[] + /// { + /// new Azure.SignalR.Inputs.ServiceCorArgs + /// { + /// AllowedOrigins = new[] + /// { + /// "http://www.example.com", + /// }, + /// }, + /// }, + /// PublicNetworkAccessEnabled = false, + /// ConnectivityLogsEnabled = true, + /// MessagingLogsEnabled = true, + /// ServiceMode = "Default", + /// UpstreamEndpoints = new[] + /// { + /// new Azure.SignalR.Inputs.ServiceUpstreamEndpointArgs + /// { + /// CategoryPatterns = new[] + /// { + /// "connections", + /// "messages", + /// }, + /// EventPatterns = new[] + /// { + /// "*", + /// }, + /// HubPatterns = new[] + /// { + /// "hub1", + /// }, + /// UrlTemplate = "http://foo.com", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SignalR services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SignalR/ServiceCustomCertificate.cs b/sdk/dotnet/SignalR/ServiceCustomCertificate.cs index 1887c5654e..5dce71d409 100644 --- a/sdk/dotnet/SignalR/ServiceCustomCertificate.cs +++ b/sdk/dotnet/SignalR/ServiceCustomCertificate.cs @@ -12,6 +12,112 @@ namespace Pulumi.Azure.SignalR /// /// Manages an Azure SignalR Custom Certificate. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.SignalR.Service("exampleService", new() + /// { + /// Location = azurerm_resource_group.Test.Location, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// Sku = new Azure.SignalR.Inputs.ServiceSkuArgs + /// { + /// Name = "Premium_P1", + /// Capacity = 1, + /// }, + /// Identity = new Azure.SignalR.Inputs.ServiceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Get", + /// "List", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// "List", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = azurerm_signalr_service.Test.Identity[0].Principal_id, + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Get", + /// "List", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// "List", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs + /// { + /// Contents = ReadFileBase64("certificate-to-import.pfx"), + /// Password = "", + /// }, + /// }); + /// + /// var test = new Azure.SignalR.ServiceCustomCertificate("test", new() + /// { + /// SignalrServiceId = exampleService.Id, + /// CustomCertificateId = exampleCertificate.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// azurerm_key_vault_access_policy.Example, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Custom Certificate for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SignalR/ServiceCustomDomain.cs b/sdk/dotnet/SignalR/ServiceCustomDomain.cs index 188d5444fa..7496fdfd81 100644 --- a/sdk/dotnet/SignalR/ServiceCustomDomain.cs +++ b/sdk/dotnet/SignalR/ServiceCustomDomain.cs @@ -12,6 +12,119 @@ namespace Pulumi.Azure.SignalR /// /// Manages an Azure SignalR Custom Domain. /// + /// ## Example Usage + /// + /// ```csharp + /// using System; + /// using System.Collections.Generic; + /// using System.IO; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// private static string ReadFileBase64(string path) { + /// return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(path))); + /// } + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.SignalR.Service("exampleService", new() + /// { + /// Location = azurerm_resource_group.Test.Location, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// Sku = new Azure.SignalR.Inputs.ServiceSkuArgs + /// { + /// Name = "Premium_P1", + /// Capacity = 1, + /// }, + /// Identity = new Azure.SignalR.Inputs.ServiceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "premium", + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Get", + /// "List", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// "List", + /// }, + /// }, + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = azurerm_signalr_service.Test.Identity[0].Principal_id, + /// CertificatePermissions = new[] + /// { + /// "Create", + /// "Get", + /// "List", + /// }, + /// SecretPermissions = new[] + /// { + /// "Get", + /// "List", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleCertificate = new Azure.KeyVault.Certificate("exampleCertificate", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyVaultCertificate = new Azure.KeyVault.Inputs.CertificateCertificateArgs + /// { + /// Contents = ReadFileBase64("certificate-to-import.pfx"), + /// Password = "", + /// }, + /// }); + /// + /// var testServiceCustomCertificate = new Azure.SignalR.ServiceCustomCertificate("testServiceCustomCertificate", new() + /// { + /// SignalrServiceId = exampleService.Id, + /// CustomCertificateId = exampleCertificate.Id, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// azurerm_key_vault_access_policy.Example, + /// }, + /// }); + /// + /// var testServiceCustomDomain = new Azure.SignalR.ServiceCustomDomain("testServiceCustomDomain", new() + /// { + /// SignalrServiceId = azurerm_signalr_service.Test.Id, + /// DomainName = "tftest.com", + /// SignalrCustomCertificateId = testServiceCustomCertificate.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Custom Domain for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SignalR/ServiceNetworkAcl.cs b/sdk/dotnet/SignalR/ServiceNetworkAcl.cs index f77ffe30ec..5b178711ca 100644 --- a/sdk/dotnet/SignalR/ServiceNetworkAcl.cs +++ b/sdk/dotnet/SignalR/ServiceNetworkAcl.cs @@ -12,6 +12,97 @@ namespace Pulumi.Azure.SignalR /// /// Manages the Network ACL for a SignalR service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleService = new Azure.SignalR.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = new Azure.SignalR.Inputs.ServiceSkuArgs + /// { + /// Name = "Standard_S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.2.0/24", + /// }, + /// EnforcePrivateLinkEndpointNetworkPolicies = true, + /// }); + /// + /// var exampleEndpoint = new Azure.PrivateLink.Endpoint("exampleEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubnetId = exampleSubnet.Id, + /// PrivateServiceConnection = new Azure.PrivateLink.Inputs.EndpointPrivateServiceConnectionArgs + /// { + /// Name = "psc-sig-test", + /// IsManualConnection = false, + /// PrivateConnectionResourceId = exampleService.Id, + /// SubresourceNames = new[] + /// { + /// "signalr", + /// }, + /// }, + /// }); + /// + /// var exampleServiceNetworkAcl = new Azure.SignalR.ServiceNetworkAcl("exampleServiceNetworkAcl", new() + /// { + /// SignalrServiceId = exampleService.Id, + /// DefaultAction = "Deny", + /// PublicNetwork = new Azure.SignalR.Inputs.ServiceNetworkAclPublicNetworkArgs + /// { + /// AllowedRequestTypes = new[] + /// { + /// "ClientConnection", + /// }, + /// }, + /// PrivateEndpoints = new[] + /// { + /// new Azure.SignalR.Inputs.ServiceNetworkAclPrivateEndpointArgs + /// { + /// Id = exampleEndpoint.Id, + /// AllowedRequestTypes = new[] + /// { + /// "ServerConnection", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network ACLs for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SignalR/SharedPrivateLinkResource.cs b/sdk/dotnet/SignalR/SharedPrivateLinkResource.cs index 270e17b7f8..c25bd22bd9 100644 --- a/sdk/dotnet/SignalR/SharedPrivateLinkResource.cs +++ b/sdk/dotnet/SignalR/SharedPrivateLinkResource.cs @@ -12,6 +12,73 @@ namespace Pulumi.Azure.SignalR /// /// Manages the Shared Private Link Resource for a Signalr service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "ManageContacts", + /// }, + /// KeyPermissions = new[] + /// { + /// "Create", + /// }, + /// SecretPermissions = new[] + /// { + /// "Set", + /// }, + /// }, + /// }, + /// }); + /// + /// var test = new Azure.SignalR.Service("test", new() + /// { + /// Location = azurerm_resource_group.Test.Location, + /// ResourceGroupName = azurerm_resource_group.Test.Name, + /// Sku = new Azure.SignalR.Inputs.ServiceSkuArgs + /// { + /// Name = "Standard_S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleSharedPrivateLinkResource = new Azure.SignalR.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", new() + /// { + /// SignalrServiceId = azurerm_signalr_service.Example.Id, + /// SubResourceName = "vault", + /// TargetResourceId = exampleKeyVault.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Signalr Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/Fabric.cs b/sdk/dotnet/SiteRecovery/Fabric.cs index 1c208cf967..8aa45961ef 100644 --- a/sdk/dotnet/SiteRecovery/Fabric.cs +++ b/sdk/dotnet/SiteRecovery/Fabric.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a Azure Site Recovery Replication Fabric within a Recovery Services vault. Only Azure fabrics are supported at this time. Replication Fabrics serve as a container within an Azure region for other Site Recovery resources such as protection containers, protected items, network mappings. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = new Azure.Core.ResourceGroup("primary", new() + /// { + /// Location = "West US", + /// }); + /// + /// var secondary = new Azure.Core.ResourceGroup("secondary", new() + /// { + /// Location = "East US", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = secondary.Location, + /// ResourceGroupName = secondary.Name, + /// Sku = "Standard", + /// }); + /// + /// var fabric = new Azure.SiteRecovery.Fabric("fabric", new() + /// { + /// ResourceGroupName = secondary.Name, + /// RecoveryVaultName = vault.Name, + /// Location = primary.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/GetFabric.cs b/sdk/dotnet/SiteRecovery/GetFabric.cs index ffd8a987a3..fd0b09644a 100644 --- a/sdk/dotnet/SiteRecovery/GetFabric.cs +++ b/sdk/dotnet/SiteRecovery/GetFabric.cs @@ -13,12 +13,60 @@ public static class GetFabric { /// /// Use this data source to access information about an existing Site Recovery Replication Fabric. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var fabric = Azure.SiteRecovery.GetFabric.Invoke(new() + /// { + /// Name = "primary-fabric", + /// RecoveryVaultName = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFabricArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:siterecovery/getFabric:getFabric", args ?? new GetFabricArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Site Recovery Replication Fabric. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var fabric = Azure.SiteRecovery.GetFabric.Invoke(new() + /// { + /// Name = "primary-fabric", + /// RecoveryVaultName = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFabricInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:siterecovery/getFabric:getFabric", args ?? new GetFabricInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/SiteRecovery/GetProtectionContainer.cs b/sdk/dotnet/SiteRecovery/GetProtectionContainer.cs index 456b1ea639..a6395c62fd 100644 --- a/sdk/dotnet/SiteRecovery/GetProtectionContainer.cs +++ b/sdk/dotnet/SiteRecovery/GetProtectionContainer.cs @@ -13,12 +13,62 @@ public static class GetProtectionContainer { /// /// Use this data source to access information about an existing site recovery services protection container. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var container = Azure.SiteRecovery.GetProtectionContainer.Invoke(new() + /// { + /// Name = "primary-container", + /// RecoveryFabricName = "primary-fabric", + /// RecoveryVaultName = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetProtectionContainerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:siterecovery/getProtectionContainer:getProtectionContainer", args ?? new GetProtectionContainerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing site recovery services protection container. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var container = Azure.SiteRecovery.GetProtectionContainer.Invoke(new() + /// { + /// Name = "primary-container", + /// RecoveryFabricName = "primary-fabric", + /// RecoveryVaultName = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetProtectionContainerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:siterecovery/getProtectionContainer:getProtectionContainer", args ?? new GetProtectionContainerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/SiteRecovery/GetReplicationPolicy.cs b/sdk/dotnet/SiteRecovery/GetReplicationPolicy.cs index 36b917d727..7b7b906497 100644 --- a/sdk/dotnet/SiteRecovery/GetReplicationPolicy.cs +++ b/sdk/dotnet/SiteRecovery/GetReplicationPolicy.cs @@ -13,12 +13,60 @@ public static class GetReplicationPolicy { /// /// Use this data source to access information about an existing Azure Site Recovery replication policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var policy = Azure.SiteRecovery.GetReplicationPolicy.Invoke(new() + /// { + /// Name = "replication-policy", + /// RecoveryVaultName = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetReplicationPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:siterecovery/getReplicationPolicy:getReplicationPolicy", args ?? new GetReplicationPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure Site Recovery replication policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var policy = Azure.SiteRecovery.GetReplicationPolicy.Invoke(new() + /// { + /// Name = "replication-policy", + /// RecoveryVaultName = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetReplicationPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:siterecovery/getReplicationPolicy:getReplicationPolicy", args ?? new GetReplicationPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/SiteRecovery/GetReplicationRecoveryPlan.cs b/sdk/dotnet/SiteRecovery/GetReplicationRecoveryPlan.cs index ae3d4eb479..2fcba0136c 100644 --- a/sdk/dotnet/SiteRecovery/GetReplicationRecoveryPlan.cs +++ b/sdk/dotnet/SiteRecovery/GetReplicationRecoveryPlan.cs @@ -13,12 +13,70 @@ public static class GetReplicationRecoveryPlan { /// /// Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var vault = Azure.RecoveryServices.GetVault.Invoke(new() + /// { + /// Name = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// var example = Azure.SiteRecovery.GetReplicationRecoveryPlan.Invoke(new() + /// { + /// Name = "example-recovery-plan", + /// RecoveryVaultId = vault.Apply(getVaultResult => getVaultResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetReplicationRecoveryPlanArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:siterecovery/getReplicationRecoveryPlan:getReplicationRecoveryPlan", args ?? new GetReplicationRecoveryPlanArgs(), options.WithDefaults()); /// /// Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var vault = Azure.RecoveryServices.GetVault.Invoke(new() + /// { + /// Name = "tfex-recovery_vault", + /// ResourceGroupName = "tfex-resource_group", + /// }); + /// + /// var example = Azure.SiteRecovery.GetReplicationRecoveryPlan.Invoke(new() + /// { + /// Name = "example-recovery-plan", + /// RecoveryVaultId = vault.Apply(getVaultResult => getVaultResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetReplicationRecoveryPlanInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:siterecovery/getReplicationRecoveryPlan:getReplicationRecoveryPlan", args ?? new GetReplicationRecoveryPlanInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/SiteRecovery/HyperVReplicationPolicy.cs b/sdk/dotnet/SiteRecovery/HyperVReplicationPolicy.cs index d7472e7867..f89136439e 100644 --- a/sdk/dotnet/SiteRecovery/HyperVReplicationPolicy.cs +++ b/sdk/dotnet/SiteRecovery/HyperVReplicationPolicy.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a Azure Site Recovery replication policy for HyperV within a Recovery Vault. Replication policies define the frequency at which recovery points are created and how long they are stored. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "East US", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = "Standard", + /// }); + /// + /// var policy = new Azure.SiteRecovery.HyperVReplicationPolicy("policy", new() + /// { + /// RecoveryVaultId = vault.Id, + /// RecoveryPointRetentionInHours = 2, + /// ApplicationConsistentSnapshotFrequencyInHours = 1, + /// ReplicationIntervalInSeconds = 300, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/HyperVReplicationPolicyAssociation.cs b/sdk/dotnet/SiteRecovery/HyperVReplicationPolicyAssociation.cs index b3cf32ad0c..198689d190 100644 --- a/sdk/dotnet/SiteRecovery/HyperVReplicationPolicyAssociation.cs +++ b/sdk/dotnet/SiteRecovery/HyperVReplicationPolicyAssociation.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages an Azure Site Recovery replication policy for HyperV within a Recovery Vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleHyperVSite = new Azure.SiteRecovery.HyperVSite("exampleHyperVSite", new() + /// { + /// RecoveryVaultId = exampleVault.Id, + /// }); + /// + /// var exampleHyperVReplicationPolicy = new Azure.SiteRecovery.HyperVReplicationPolicy("exampleHyperVReplicationPolicy", new() + /// { + /// RecoveryVaultId = exampleVault.Id, + /// RecoveryPointRetentionInHours = 2, + /// ApplicationConsistentSnapshotFrequencyInHours = 1, + /// ReplicationIntervalInSeconds = 300, + /// }); + /// + /// var exampleHyperVReplicationPolicyAssociation = new Azure.SiteRecovery.HyperVReplicationPolicyAssociation("exampleHyperVReplicationPolicyAssociation", new() + /// { + /// HypervSiteId = exampleHyperVSite.Id, + /// PolicyId = exampleHyperVReplicationPolicy.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/HyperVSite.cs b/sdk/dotnet/SiteRecovery/HyperVSite.cs index 193510a302..8c576c3b47 100644 --- a/sdk/dotnet/SiteRecovery/HyperVSite.cs +++ b/sdk/dotnet/SiteRecovery/HyperVSite.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a HyperV Site in Recovery Service Vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "eastus", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// SoftDeleteEnabled = false, + /// }); + /// + /// var exampleHyperVSite = new Azure.SiteRecovery.HyperVSite("exampleHyperVSite", new() + /// { + /// RecoveryVaultId = exampleVault.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Recovery Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/HypervNetworkMapping.cs b/sdk/dotnet/SiteRecovery/HypervNetworkMapping.cs index 8fdd31cf63..fee562dd17 100644 --- a/sdk/dotnet/SiteRecovery/HypervNetworkMapping.cs +++ b/sdk/dotnet/SiteRecovery/HypervNetworkMapping.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a HyperV site recovery network mapping on Azure. A HyperV network mapping decides how to translate connected networks when a VM is migrated from HyperV VMM Center to Azure. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var targetResourceGroup = new Azure.Core.ResourceGroup("targetResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = targetResourceGroup.Location, + /// ResourceGroupName = targetResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var targetVirtualNetwork = new Azure.Network.VirtualNetwork("targetVirtualNetwork", new() + /// { + /// ResourceGroupName = targetResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.2.0/24", + /// }, + /// Location = targetResourceGroup.Location, + /// }); + /// + /// var recovery_mapping = new Azure.SiteRecovery.HypervNetworkMapping("recovery-mapping", new() + /// { + /// RecoveryVaultId = vault.Id, + /// SourceSystemCenterVirtualMachineManagerName = "my-vmm-server", + /// SourceNetworkName = "my-vmm-network", + /// TargetNetworkId = targetVirtualNetwork.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/NetworkMapping.cs b/sdk/dotnet/SiteRecovery/NetworkMapping.cs index 16077ff561..f4c1f8da30 100644 --- a/sdk/dotnet/SiteRecovery/NetworkMapping.cs +++ b/sdk/dotnet/SiteRecovery/NetworkMapping.cs @@ -12,6 +12,87 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a site recovery network mapping on Azure. A network mapping decides how to translate connected networks when a VM is migrated from one region to another. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primaryResourceGroup = new Azure.Core.ResourceGroup("primaryResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var secondaryResourceGroup = new Azure.Core.ResourceGroup("secondaryResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = secondaryResourceGroup.Location, + /// ResourceGroupName = secondaryResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var primaryFabric = new Azure.SiteRecovery.Fabric("primaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = primaryResourceGroup.Location, + /// }); + /// + /// var secondaryFabric = new Azure.SiteRecovery.Fabric("secondaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = secondaryResourceGroup.Location, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// primaryFabric, + /// }, + /// }); + /// + /// // Avoids issues with creating fabrics simultaneously + /// var primaryVirtualNetwork = new Azure.Network.VirtualNetwork("primaryVirtualNetwork", new() + /// { + /// ResourceGroupName = primaryResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = primaryResourceGroup.Location, + /// }); + /// + /// var secondaryVirtualNetwork = new Azure.Network.VirtualNetwork("secondaryVirtualNetwork", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.2.0/24", + /// }, + /// Location = secondaryResourceGroup.Location, + /// }); + /// + /// var recovery_mapping = new Azure.SiteRecovery.NetworkMapping("recovery-mapping", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// SourceRecoveryFabricName = "primary-fabric", + /// TargetRecoveryFabricName = "secondary-fabric", + /// SourceNetworkId = primaryVirtualNetwork.Id, + /// TargetNetworkId = secondaryVirtualNetwork.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/ProtectionContainer.cs b/sdk/dotnet/SiteRecovery/ProtectionContainer.cs index 56feb7ea00..df70519131 100644 --- a/sdk/dotnet/SiteRecovery/ProtectionContainer.cs +++ b/sdk/dotnet/SiteRecovery/ProtectionContainer.cs @@ -12,6 +12,50 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a Azure Site Recovery protection container. Protection containers serve as containers for replicated VMs and belong to a single region / recovery fabric. Protection containers can contain more than one replicated VM. To replicate a VM, a container must exist in both the source and target Azure regions. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primary = new Azure.Core.ResourceGroup("primary", new() + /// { + /// Location = "West US", + /// }); + /// + /// var secondary = new Azure.Core.ResourceGroup("secondary", new() + /// { + /// Location = "East US", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = secondary.Location, + /// ResourceGroupName = secondary.Name, + /// Sku = "Standard", + /// }); + /// + /// var fabric = new Azure.SiteRecovery.Fabric("fabric", new() + /// { + /// ResourceGroupName = secondary.Name, + /// RecoveryVaultName = vault.Name, + /// Location = primary.Location, + /// }); + /// + /// var protection_container = new Azure.SiteRecovery.ProtectionContainer("protection-container", new() + /// { + /// ResourceGroupName = secondary.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = fabric.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Protection Containers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/ProtectionContainerMapping.cs b/sdk/dotnet/SiteRecovery/ProtectionContainerMapping.cs index c5b6f21fba..4b4adb4409 100644 --- a/sdk/dotnet/SiteRecovery/ProtectionContainerMapping.cs +++ b/sdk/dotnet/SiteRecovery/ProtectionContainerMapping.cs @@ -12,6 +12,82 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a Azure recovery vault protection container mapping. A protection container mapping decides how to translate the protection container when a VM is migrated from one region to another. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primaryResourceGroup = new Azure.Core.ResourceGroup("primaryResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var secondaryResourceGroup = new Azure.Core.ResourceGroup("secondaryResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = secondaryResourceGroup.Location, + /// ResourceGroupName = secondaryResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var primaryFabric = new Azure.SiteRecovery.Fabric("primaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = primaryResourceGroup.Location, + /// }); + /// + /// var secondaryFabric = new Azure.SiteRecovery.Fabric("secondaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = secondaryResourceGroup.Location, + /// }); + /// + /// var primaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("primaryProtectionContainer", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = primaryFabric.Name, + /// }); + /// + /// var secondaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("secondaryProtectionContainer", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = secondaryFabric.Name, + /// }); + /// + /// var policy = new Azure.SiteRecovery.ReplicationPolicy("policy", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryPointRetentionInMinutes = 24 * 60, + /// ApplicationConsistentSnapshotFrequencyInMinutes = 4 * 60, + /// }); + /// + /// var container_mapping = new Azure.SiteRecovery.ProtectionContainerMapping("container-mapping", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = primaryFabric.Name, + /// RecoverySourceProtectionContainerName = primaryProtectionContainer.Name, + /// RecoveryTargetProtectionContainerId = secondaryProtectionContainer.Id, + /// RecoveryReplicationPolicyId = policy.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Protection Container Mappings can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/ReplicatedVM.cs b/sdk/dotnet/SiteRecovery/ReplicatedVM.cs index 88b961ea9e..313a2e8963 100644 --- a/sdk/dotnet/SiteRecovery/ReplicatedVM.cs +++ b/sdk/dotnet/SiteRecovery/ReplicatedVM.cs @@ -12,6 +12,248 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a VM replicated using Azure Site Recovery (Azure to Azure only). A replicated VM keeps a copiously updated image of the VM in another region in order to be able to start the VM in that region in case of a disaster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primaryResourceGroup = new Azure.Core.ResourceGroup("primaryResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var secondaryResourceGroup = new Azure.Core.ResourceGroup("secondaryResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var primaryVirtualNetwork = new Azure.Network.VirtualNetwork("primaryVirtualNetwork", new() + /// { + /// ResourceGroupName = primaryResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = primaryResourceGroup.Location, + /// }); + /// + /// var primarySubnet = new Azure.Network.Subnet("primarySubnet", new() + /// { + /// ResourceGroupName = primaryResourceGroup.Name, + /// VirtualNetworkName = primaryVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }); + /// + /// var primaryPublicIp = new Azure.Network.PublicIp("primaryPublicIp", new() + /// { + /// AllocationMethod = "Static", + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// Sku = "Basic", + /// }); + /// + /// var vmNetworkInterface = new Azure.Network.NetworkInterface("vmNetworkInterface", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "vm", + /// SubnetId = primarySubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// PublicIpAddressId = primaryPublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var vmVirtualMachine = new Azure.Compute.VirtualMachine("vmVirtualMachine", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// VmSize = "Standard_B1s", + /// NetworkInterfaceIds = new[] + /// { + /// vmNetworkInterface.Id, + /// }, + /// StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs + /// { + /// Publisher = "OpenLogic", + /// Offer = "CentOS", + /// Sku = "7.5", + /// Version = "latest", + /// }, + /// StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs + /// { + /// Name = "vm-os-disk", + /// OsType = "Linux", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Premium_LRS", + /// }, + /// OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs + /// { + /// AdminUsername = "test-admin-123", + /// AdminPassword = "test-pwd-123", + /// ComputerName = "vm", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = false, + /// }, + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = secondaryResourceGroup.Location, + /// ResourceGroupName = secondaryResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var primaryFabric = new Azure.SiteRecovery.Fabric("primaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = primaryResourceGroup.Location, + /// }); + /// + /// var secondaryFabric = new Azure.SiteRecovery.Fabric("secondaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = secondaryResourceGroup.Location, + /// }); + /// + /// var primaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("primaryProtectionContainer", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = primaryFabric.Name, + /// }); + /// + /// var secondaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("secondaryProtectionContainer", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = secondaryFabric.Name, + /// }); + /// + /// var policy = new Azure.SiteRecovery.ReplicationPolicy("policy", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryPointRetentionInMinutes = 24 * 60, + /// ApplicationConsistentSnapshotFrequencyInMinutes = 4 * 60, + /// }); + /// + /// var container_mapping = new Azure.SiteRecovery.ProtectionContainerMapping("container-mapping", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = primaryFabric.Name, + /// RecoverySourceProtectionContainerName = primaryProtectionContainer.Name, + /// RecoveryTargetProtectionContainerId = secondaryProtectionContainer.Id, + /// RecoveryReplicationPolicyId = policy.Id, + /// }); + /// + /// var secondaryVirtualNetwork = new Azure.Network.VirtualNetwork("secondaryVirtualNetwork", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.2.0/24", + /// }, + /// Location = secondaryResourceGroup.Location, + /// }); + /// + /// var network_mapping = new Azure.SiteRecovery.NetworkMapping("network-mapping", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// SourceRecoveryFabricName = primaryFabric.Name, + /// TargetRecoveryFabricName = secondaryFabric.Name, + /// SourceNetworkId = primaryVirtualNetwork.Id, + /// TargetNetworkId = secondaryVirtualNetwork.Id, + /// }); + /// + /// var primaryAccount = new Azure.Storage.Account("primaryAccount", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var secondarySubnet = new Azure.Network.Subnet("secondarySubnet", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// VirtualNetworkName = secondaryVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.2.0/24", + /// }, + /// }); + /// + /// var secondaryPublicIp = new Azure.Network.PublicIp("secondaryPublicIp", new() + /// { + /// AllocationMethod = "Static", + /// Location = secondaryResourceGroup.Location, + /// ResourceGroupName = secondaryResourceGroup.Name, + /// Sku = "Basic", + /// }); + /// + /// var vm_replication = new Azure.SiteRecovery.ReplicatedVM("vm-replication", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// SourceRecoveryFabricName = primaryFabric.Name, + /// SourceVmId = vmVirtualMachine.Id, + /// RecoveryReplicationPolicyId = policy.Id, + /// SourceRecoveryProtectionContainerName = primaryProtectionContainer.Name, + /// TargetResourceGroupId = secondaryResourceGroup.Id, + /// TargetRecoveryFabricId = secondaryFabric.Id, + /// TargetRecoveryProtectionContainerId = secondaryProtectionContainer.Id, + /// ManagedDisks = new[] + /// { + /// new Azure.SiteRecovery.Inputs.ReplicatedVMManagedDiskArgs + /// { + /// DiskId = vmVirtualMachine.StorageOsDisk.Apply(storageOsDisk => storageOsDisk.ManagedDiskId), + /// StagingStorageAccountId = primaryAccount.Id, + /// TargetResourceGroupId = secondaryResourceGroup.Id, + /// TargetDiskType = "Premium_LRS", + /// TargetReplicaDiskType = "Premium_LRS", + /// }, + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.SiteRecovery.Inputs.ReplicatedVMNetworkInterfaceArgs + /// { + /// SourceNetworkInterfaceId = vmNetworkInterface.Id, + /// TargetSubnetName = secondarySubnet.Name, + /// RecoveryPublicIpAddressId = secondaryPublicIp.Id, + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// container_mapping, + /// network_mapping, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Replicated VM's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/ReplicationPolicy.cs b/sdk/dotnet/SiteRecovery/ReplicationPolicy.cs index e9e8befb06..e3a6a99364 100644 --- a/sdk/dotnet/SiteRecovery/ReplicationPolicy.cs +++ b/sdk/dotnet/SiteRecovery/ReplicationPolicy.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a Azure Site Recovery replication policy within a recovery vault. Replication policies define the frequency at which recovery points are created and how long they are stored. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "East US", + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// Sku = "Standard", + /// }); + /// + /// var policy = new Azure.SiteRecovery.ReplicationPolicy("policy", new() + /// { + /// ResourceGroupName = example.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryPointRetentionInMinutes = 24 * 60, + /// ApplicationConsistentSnapshotFrequencyInMinutes = 4 * 60, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/ReplicationRecoveryPlan.cs b/sdk/dotnet/SiteRecovery/ReplicationRecoveryPlan.cs index ab156c95d8..9d2474f4aa 100644 --- a/sdk/dotnet/SiteRecovery/ReplicationRecoveryPlan.cs +++ b/sdk/dotnet/SiteRecovery/ReplicationRecoveryPlan.cs @@ -12,6 +12,267 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a Site Recovery Replication Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var primaryResourceGroup = new Azure.Core.ResourceGroup("primaryResourceGroup", new() + /// { + /// Location = "West US", + /// }); + /// + /// var secondaryResourceGroup = new Azure.Core.ResourceGroup("secondaryResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var primaryVirtualNetwork = new Azure.Network.VirtualNetwork("primaryVirtualNetwork", new() + /// { + /// ResourceGroupName = primaryResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// Location = primaryResourceGroup.Location, + /// }); + /// + /// var primarySubnet = new Azure.Network.Subnet("primarySubnet", new() + /// { + /// ResourceGroupName = primaryResourceGroup.Name, + /// VirtualNetworkName = primaryVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }); + /// + /// var primaryPublicIp = new Azure.Network.PublicIp("primaryPublicIp", new() + /// { + /// AllocationMethod = "Static", + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// Sku = "Basic", + /// }); + /// + /// var vmNetworkInterface = new Azure.Network.NetworkInterface("vmNetworkInterface", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// IpConfigurations = new[] + /// { + /// new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs + /// { + /// Name = "vm", + /// SubnetId = primarySubnet.Id, + /// PrivateIpAddressAllocation = "Dynamic", + /// PublicIpAddressId = primaryPublicIp.Id, + /// }, + /// }, + /// }); + /// + /// var vmVirtualMachine = new Azure.Compute.VirtualMachine("vmVirtualMachine", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// VmSize = "Standard_B1s", + /// NetworkInterfaceIds = new[] + /// { + /// vmNetworkInterface.Id, + /// }, + /// StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs + /// { + /// Publisher = "OpenLogic", + /// Offer = "CentOS", + /// Sku = "7.5", + /// Version = "latest", + /// }, + /// StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs + /// { + /// Name = "vm-os-disk", + /// OsType = "Linux", + /// Caching = "ReadWrite", + /// CreateOption = "FromImage", + /// ManagedDiskType = "Premium_LRS", + /// }, + /// OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs + /// { + /// AdminUsername = "test-admin-123", + /// AdminPassword = "test-pwd-123", + /// ComputerName = "vm", + /// }, + /// OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs + /// { + /// DisablePasswordAuthentication = false, + /// }, + /// }); + /// + /// var vault = new Azure.RecoveryServices.Vault("vault", new() + /// { + /// Location = secondaryResourceGroup.Location, + /// ResourceGroupName = secondaryResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var primaryFabric = new Azure.SiteRecovery.Fabric("primaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = primaryResourceGroup.Location, + /// }); + /// + /// var secondaryFabric = new Azure.SiteRecovery.Fabric("secondaryFabric", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// Location = secondaryResourceGroup.Location, + /// }); + /// + /// var primaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("primaryProtectionContainer", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = primaryFabric.Name, + /// }); + /// + /// var secondaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("secondaryProtectionContainer", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = secondaryFabric.Name, + /// }); + /// + /// var policy = new Azure.SiteRecovery.ReplicationPolicy("policy", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryPointRetentionInMinutes = 24 * 60, + /// ApplicationConsistentSnapshotFrequencyInMinutes = 4 * 60, + /// }); + /// + /// var container_mapping = new Azure.SiteRecovery.ProtectionContainerMapping("container-mapping", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// RecoveryFabricName = primaryFabric.Name, + /// RecoverySourceProtectionContainerName = primaryProtectionContainer.Name, + /// RecoveryTargetProtectionContainerId = secondaryProtectionContainer.Id, + /// RecoveryReplicationPolicyId = policy.Id, + /// }); + /// + /// var secondaryVirtualNetwork = new Azure.Network.VirtualNetwork("secondaryVirtualNetwork", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "192.168.2.0/24", + /// }, + /// Location = secondaryResourceGroup.Location, + /// }); + /// + /// var network_mapping = new Azure.SiteRecovery.NetworkMapping("network-mapping", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// SourceRecoveryFabricName = primaryFabric.Name, + /// TargetRecoveryFabricName = secondaryFabric.Name, + /// SourceNetworkId = primaryVirtualNetwork.Id, + /// TargetNetworkId = secondaryVirtualNetwork.Id, + /// }); + /// + /// var primaryAccount = new Azure.Storage.Account("primaryAccount", new() + /// { + /// Location = primaryResourceGroup.Location, + /// ResourceGroupName = primaryResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var secondarySubnet = new Azure.Network.Subnet("secondarySubnet", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// VirtualNetworkName = secondaryVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "192.168.2.0/24", + /// }, + /// }); + /// + /// var secondaryPublicIp = new Azure.Network.PublicIp("secondaryPublicIp", new() + /// { + /// AllocationMethod = "Static", + /// Location = secondaryResourceGroup.Location, + /// ResourceGroupName = secondaryResourceGroup.Name, + /// Sku = "Basic", + /// }); + /// + /// var vm_replication = new Azure.SiteRecovery.ReplicatedVM("vm-replication", new() + /// { + /// ResourceGroupName = secondaryResourceGroup.Name, + /// RecoveryVaultName = vault.Name, + /// SourceRecoveryFabricName = primaryFabric.Name, + /// SourceVmId = vmVirtualMachine.Id, + /// RecoveryReplicationPolicyId = policy.Id, + /// SourceRecoveryProtectionContainerName = primaryProtectionContainer.Name, + /// TargetResourceGroupId = secondaryResourceGroup.Id, + /// TargetRecoveryFabricId = secondaryFabric.Id, + /// TargetRecoveryProtectionContainerId = secondaryProtectionContainer.Id, + /// ManagedDisks = new[] + /// { + /// new Azure.SiteRecovery.Inputs.ReplicatedVMManagedDiskArgs + /// { + /// DiskId = vmVirtualMachine.StorageOsDisk.Apply(storageOsDisk => storageOsDisk.ManagedDiskId), + /// StagingStorageAccountId = primaryAccount.Id, + /// TargetResourceGroupId = secondaryResourceGroup.Id, + /// TargetDiskType = "Premium_LRS", + /// TargetReplicaDiskType = "Premium_LRS", + /// }, + /// }, + /// NetworkInterfaces = new[] + /// { + /// new Azure.SiteRecovery.Inputs.ReplicatedVMNetworkInterfaceArgs + /// { + /// SourceNetworkInterfaceId = vmNetworkInterface.Id, + /// TargetSubnetName = secondarySubnet.Name, + /// RecoveryPublicIpAddressId = secondaryPublicIp.Id, + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// container_mapping, + /// network_mapping, + /// }, + /// }); + /// + /// var example = new Azure.SiteRecovery.ReplicationRecoveryPlan("example", new() + /// { + /// RecoveryVaultId = vault.Id, + /// SourceRecoveryFabricId = primaryFabric.Id, + /// TargetRecoveryFabricId = secondaryFabric.Id, + /// ShutdownRecoveryGroup = null, + /// FailoverRecoveryGroup = null, + /// BootRecoveryGroups = new[] + /// { + /// new Azure.SiteRecovery.Inputs.ReplicationRecoveryPlanBootRecoveryGroupArgs + /// { + /// ReplicatedProtectedItems = new[] + /// { + /// vm_replication.Id, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/VMWareReplicationPolicy.cs b/sdk/dotnet/SiteRecovery/VMWareReplicationPolicy.cs index 334a822604..a2c3959290 100644 --- a/sdk/dotnet/SiteRecovery/VMWareReplicationPolicy.cs +++ b/sdk/dotnet/SiteRecovery/VMWareReplicationPolicy.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages a VMWare Replication Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "eastus", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// ClassicVmwareReplicationEnabled = true, + /// SoftDeleteEnabled = false, + /// }); + /// + /// var exampleVMWareReplicationPolicy = new Azure.SiteRecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", new() + /// { + /// RecoveryVaultId = exampleVault.Id, + /// RecoveryPointRetentionInMinutes = 1440, + /// ApplicationConsistentSnapshotFrequencyInMinutes = 240, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// VMWare Replication Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/SiteRecovery/VmwareReplicationPolicyAssociation.cs b/sdk/dotnet/SiteRecovery/VmwareReplicationPolicyAssociation.cs index bb7f9203b9..3b5c931f8e 100644 --- a/sdk/dotnet/SiteRecovery/VmwareReplicationPolicyAssociation.cs +++ b/sdk/dotnet/SiteRecovery/VmwareReplicationPolicyAssociation.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.SiteRecovery /// /// Manages an Azure Site Recovery replication policy for VMWare within a Recovery Vault. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleVault = new Azure.RecoveryServices.Vault("exampleVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleVMWareReplicationPolicy = new Azure.SiteRecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", new() + /// { + /// RecoveryVaultId = exampleVault.Id, + /// RecoveryPointRetentionInMinutes = 1440, + /// ApplicationConsistentSnapshotFrequencyInMinutes = 240, + /// }); + /// + /// var exampleVmwareReplicationPolicyAssociation = new Azure.SiteRecovery.VmwareReplicationPolicyAssociation("exampleVmwareReplicationPolicyAssociation", new() + /// { + /// RecoveryVaultId = exampleVault.Id, + /// PolicyId = exampleVMWareReplicationPolicy.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/ActiveDirectoryAdministrator.cs b/sdk/dotnet/Sql/ActiveDirectoryAdministrator.cs index 7fcfbeb572..56048ba091 100644 --- a/sdk/dotnet/Sql/ActiveDirectoryAdministrator.cs +++ b/sdk/dotnet/Sql/ActiveDirectoryAdministrator.cs @@ -14,6 +14,44 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.ActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azuread_administrator` block of the `azure.mssql.Server` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleActiveDirectoryAdministrator = new Azure.Sql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", new() + /// { + /// ServerName = exampleSqlServer.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Login = "sqladmin", + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/Database.cs b/sdk/dotnet/Sql/Database.cs index ee6f389ad6..72a3e87ab3 100644 --- a/sdk/dotnet/Sql/Database.cs +++ b/sdk/dotnet/Sql/Database.cs @@ -14,6 +14,56 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.Database` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Database` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// Tags = + /// { + /// { "environment", "production" }, + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDatabase = new Azure.Sql.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServerName = exampleSqlServer.Name, + /// Tags = + /// { + /// { "environment", "production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Databases can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/ElasticPool.cs b/sdk/dotnet/Sql/ElasticPool.cs index d46299b88a..fbdff91dfc 100644 --- a/sdk/dotnet/Sql/ElasticPool.cs +++ b/sdk/dotnet/Sql/ElasticPool.cs @@ -14,6 +14,47 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.ElasticPool` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ElasticPool` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleElasticPool = new Azure.Sql.ElasticPool("exampleElasticPool", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServerName = exampleSqlServer.Name, + /// Edition = "Basic", + /// Dtu = 50, + /// DbDtuMin = 0, + /// DbDtuMax = 5, + /// PoolSize = 5000, + /// }); + /// + /// }); + /// ``` + /// + /// > **NOTE on `azure.sql.ElasticPool`:** - The values of `edition`, `dtu`, and `pool_size` must be consistent with the [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). Any inconsistent argument configuration will be rejected. + /// /// ## Import /// /// SQL Elastic Pool's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/FailoverGroup.cs b/sdk/dotnet/Sql/FailoverGroup.cs index ae4933f141..0b5f98b775 100644 --- a/sdk/dotnet/Sql/FailoverGroup.cs +++ b/sdk/dotnet/Sql/FailoverGroup.cs @@ -14,6 +14,71 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.FailoverGroup` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.FailoverGroup` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var primary = new Azure.Sql.SqlServer("primary", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "sqladmin", + /// AdministratorLoginPassword = "pa$$w0rd", + /// }); + /// + /// var secondary = new Azure.Sql.SqlServer("secondary", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "sqladmin", + /// AdministratorLoginPassword = "pa$$w0rd", + /// }); + /// + /// var db1 = new Azure.Sql.Database("db1", new() + /// { + /// ResourceGroupName = primary.ResourceGroupName, + /// Location = primary.Location, + /// ServerName = primary.Name, + /// }); + /// + /// var exampleFailoverGroup = new Azure.Sql.FailoverGroup("exampleFailoverGroup", new() + /// { + /// ResourceGroupName = primary.ResourceGroupName, + /// ServerName = primary.Name, + /// Databases = new[] + /// { + /// db1.Id, + /// }, + /// PartnerServers = new[] + /// { + /// new Azure.Sql.Inputs.FailoverGroupPartnerServerArgs + /// { + /// Id = secondary.Id, + /// }, + /// }, + /// ReadWriteEndpointFailoverPolicy = new Azure.Sql.Inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgs + /// { + /// Mode = "Automatic", + /// GraceMinutes = 60, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/FirewallRule.cs b/sdk/dotnet/Sql/FirewallRule.cs index 80a27dcaa1..22d28af523 100644 --- a/sdk/dotnet/Sql/FirewallRule.cs +++ b/sdk/dotnet/Sql/FirewallRule.cs @@ -14,6 +14,41 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.FirewallRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.FirewallRule` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var exampleFirewallRule = new Azure.Sql.FirewallRule("exampleFirewallRule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// ServerName = exampleSqlServer.Name, + /// StartIpAddress = "10.0.17.62", + /// EndIpAddress = "10.0.17.62", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/GetDatabase.cs b/sdk/dotnet/Sql/GetDatabase.cs index f7ff7e4543..9f72ffcff2 100644 --- a/sdk/dotnet/Sql/GetDatabase.cs +++ b/sdk/dotnet/Sql/GetDatabase.cs @@ -15,6 +15,34 @@ public static class GetDatabase /// Use this data source to access information about an existing SQL Azure Database. /// /// > **Note:** The `azure.sql.Database` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Database` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sql.GetDatabase.Invoke(new() + /// { + /// Name = "example_db", + /// ServerName = "example_db_server", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sqlDatabaseId"] = example.Apply(getDatabaseResult => getDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetDatabaseArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:sql/getDatabase:getDatabase", args ?? new GetDatabaseArgs(), options.WithDefaults()); @@ -23,6 +51,34 @@ public static Task InvokeAsync(GetDatabaseArgs args, InvokeOp /// Use this data source to access information about an existing SQL Azure Database. /// /// > **Note:** The `azure.sql.Database` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Database` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sql.GetDatabase.Invoke(new() + /// { + /// Name = "example_db", + /// ServerName = "example_db_server", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sqlDatabaseId"] = example.Apply(getDatabaseResult => getDatabaseResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetDatabaseInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:sql/getDatabase:getDatabase", args ?? new GetDatabaseInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Sql/GetServer.cs b/sdk/dotnet/Sql/GetServer.cs index 33bb650f8a..c80c18d028 100644 --- a/sdk/dotnet/Sql/GetServer.cs +++ b/sdk/dotnet/Sql/GetServer.cs @@ -15,6 +15,33 @@ public static class GetServer /// Use this data source to access information about an existing SQL Azure Database Server. /// /// > **Note:** The `azure.sql.SqlServer` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Server` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sql.GetServer.Invoke(new() + /// { + /// Name = "examplesqlservername", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sqlServerId"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:sql/getServer:getServer", args ?? new GetServerArgs(), options.WithDefaults()); @@ -23,6 +50,33 @@ public static Task InvokeAsync(GetServerArgs args, InvokeOption /// Use this data source to access information about an existing SQL Azure Database Server. /// /// > **Note:** The `azure.sql.SqlServer` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Server` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sql.GetServer.Invoke(new() + /// { + /// Name = "examplesqlservername", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sqlServerId"] = example.Apply(getServerResult => getServerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:sql/getServer:getServer", args ?? new GetServerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Sql/GetSqlManagedInstance.cs b/sdk/dotnet/Sql/GetSqlManagedInstance.cs index e95af73347..66cedb76c9 100644 --- a/sdk/dotnet/Sql/GetSqlManagedInstance.cs +++ b/sdk/dotnet/Sql/GetSqlManagedInstance.cs @@ -15,6 +15,33 @@ public static class GetSqlManagedInstance /// Use this data source to access information about an existing SQL Managed Instance. /// /// > **Note:** The `azure.sql.ManagedInstance` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedInstance` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sql.GetSqlManagedInstance.Invoke(new() + /// { + /// Name = "example_mi", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sqlInstanceId"] = example.Apply(getSqlManagedInstanceResult => getSqlManagedInstanceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSqlManagedInstanceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:sql/getSqlManagedInstance:getSqlManagedInstance", args ?? new GetSqlManagedInstanceArgs(), options.WithDefaults()); @@ -23,6 +50,33 @@ public static Task InvokeAsync(GetSqlManagedInstanc /// Use this data source to access information about an existing SQL Managed Instance. /// /// > **Note:** The `azure.sql.ManagedInstance` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedInstance` data source instead. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Sql.GetSqlManagedInstance.Invoke(new() + /// { + /// Name = "example_mi", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sqlInstanceId"] = example.Apply(getSqlManagedInstanceResult => getSqlManagedInstanceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSqlManagedInstanceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:sql/getSqlManagedInstance:getSqlManagedInstance", args ?? new GetSqlManagedInstanceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Sql/ManagedDatabase.cs b/sdk/dotnet/Sql/ManagedDatabase.cs index 29a16da274..6c27dd21bf 100644 --- a/sdk/dotnet/Sql/ManagedDatabase.cs +++ b/sdk/dotnet/Sql/ManagedDatabase.cs @@ -14,6 +14,63 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.ManagedDatabase` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedDatabase` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// }); + /// + /// var exampleManagedInstance = new Azure.Sql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLogin = "mradministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// LicenseType = "BasePrice", + /// SubnetId = exampleSubnet.Id, + /// SkuName = "GP_Gen5", + /// Vcores = 4, + /// StorageSizeInGb = 32, + /// }); + /// + /// var exampleManagedDatabase = new Azure.Sql.ManagedDatabase("exampleManagedDatabase", new() + /// { + /// SqlManagedInstanceId = exampleManagedInstance.Id, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/ManagedInstance.cs b/sdk/dotnet/Sql/ManagedInstance.cs index 30297e3043..0e359f9a98 100644 --- a/sdk/dotnet/Sql/ManagedInstance.cs +++ b/sdk/dotnet/Sql/ManagedInstance.cs @@ -16,6 +16,236 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var allowManagementInbound = new Azure.Network.NetworkSecurityRule("allowManagementInbound", new() + /// { + /// Priority = 106, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRanges = new[] + /// { + /// "9000", + /// "9003", + /// "1438", + /// "1440", + /// "1452", + /// }, + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowMisubnetInbound = new Azure.Network.NetworkSecurityRule("allowMisubnetInbound", new() + /// { + /// Priority = 200, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "10.0.0.0/24", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowHealthProbeInbound = new Azure.Network.NetworkSecurityRule("allowHealthProbeInbound", new() + /// { + /// Priority = 300, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "AzureLoadBalancer", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowTdsInbound = new Azure.Network.NetworkSecurityRule("allowTdsInbound", new() + /// { + /// Priority = 1000, + /// Direction = "Inbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRange = "1433", + /// SourceAddressPrefix = "VirtualNetwork", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var denyAllInbound = new Azure.Network.NetworkSecurityRule("denyAllInbound", new() + /// { + /// Priority = 4096, + /// Direction = "Inbound", + /// Access = "Deny", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowManagementOutbound = new Azure.Network.NetworkSecurityRule("allowManagementOutbound", new() + /// { + /// Priority = 102, + /// Direction = "Outbound", + /// Access = "Allow", + /// Protocol = "Tcp", + /// SourcePortRange = "*", + /// DestinationPortRanges = new[] + /// { + /// "80", + /// "443", + /// "12000", + /// }, + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var allowMisubnetOutbound = new Azure.Network.NetworkSecurityRule("allowMisubnetOutbound", new() + /// { + /// Priority = 200, + /// Direction = "Outbound", + /// Access = "Allow", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "10.0.0.0/24", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var denyAllOutbound = new Azure.Network.NetworkSecurityRule("denyAllOutbound", new() + /// { + /// Priority = 4096, + /// Direction = "Outbound", + /// Access = "Deny", + /// Protocol = "*", + /// SourcePortRange = "*", + /// DestinationPortRange = "*", + /// SourceAddressPrefix = "*", + /// DestinationAddressPrefix = "*", + /// ResourceGroupName = exampleResourceGroup.Name, + /// NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.0.0/24", + /// }, + /// Delegations = new[] + /// { + /// new Azure.Network.Inputs.SubnetDelegationArgs + /// { + /// Name = "managedinstancedelegation", + /// ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs + /// { + /// Name = "Microsoft.Sql/managedInstances", + /// Actions = new[] + /// { + /// "Microsoft.Network/virtualNetworks/subnets/join/action", + /// "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + /// "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id, + /// }); + /// + /// var exampleRouteTable = new Azure.Network.RouteTable("exampleRouteTable", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// DisableBgpRoutePropagation = false, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleSubnet, + /// }, + /// }); + /// + /// var exampleSubnetRouteTableAssociation = new Azure.Network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", new() + /// { + /// SubnetId = exampleSubnet.Id, + /// RouteTableId = exampleRouteTable.Id, + /// }); + /// + /// var exampleManagedInstance = new Azure.Sql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLogin = "mradministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// LicenseType = "BasePrice", + /// SubnetId = exampleSubnet.Id, + /// SkuName = "GP_Gen5", + /// Vcores = 4, + /// StorageSizeInGb = 32, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleSubnetNetworkSecurityGroupAssociation, + /// exampleSubnetRouteTableAssociation, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/ManagedInstanceActiveDirectoryAdministrator.cs b/sdk/dotnet/Sql/ManagedInstanceActiveDirectoryAdministrator.cs index b9b933f4b4..adf3af9fee 100644 --- a/sdk/dotnet/Sql/ManagedInstanceActiveDirectoryAdministrator.cs +++ b/sdk/dotnet/Sql/ManagedInstanceActiveDirectoryAdministrator.cs @@ -14,6 +14,55 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.ManagedInstanceActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedInstanceActiveDirectoryAdministrator` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleManagedInstance = new Azure.Sql.ManagedInstance("exampleManagedInstance", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AdministratorLogin = "mradministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// LicenseType = "BasePrice", + /// SubnetId = azurerm_subnet.Example.Id, + /// SkuName = "GP_Gen5", + /// Vcores = 4, + /// StorageSizeInGb = 32, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// azurerm_subnet_network_security_group_association.Example, + /// azurerm_subnet_route_table_association.Example, + /// }, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleManagedInstanceActiveDirectoryAdministrator = new Azure.Sql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", new() + /// { + /// ManagedInstanceName = exampleManagedInstance.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Login = "sqladmin", + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/SqlServer.cs b/sdk/dotnet/Sql/SqlServer.cs index d53568e8e5..de0fc9566a 100644 --- a/sdk/dotnet/Sql/SqlServer.cs +++ b/sdk/dotnet/Sql/SqlServer.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.Sql /// /// Manages a Microsoft SQL Azure Database Server. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "mradministrator", + /// AdministratorLoginPassword = "thisIsDog11", + /// Tags = + /// { + /// { "environment", "production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Sql/VirtualNetworkRule.cs b/sdk/dotnet/Sql/VirtualNetworkRule.cs index d9c9119593..b59844871f 100644 --- a/sdk/dotnet/Sql/VirtualNetworkRule.cs +++ b/sdk/dotnet/Sql/VirtualNetworkRule.cs @@ -14,6 +14,64 @@ namespace Pulumi.Azure.Sql /// /// > **Note:** The `azure.sql.VirtualNetworkRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.VirtualNetworkRule` resource instead. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Core.ResourceGroup("example", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var vnet = new Azure.Network.VirtualNetwork("vnet", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// Location = example.Location, + /// ResourceGroupName = example.Name, + /// }); + /// + /// var subnet = new Azure.Network.Subnet("subnet", new() + /// { + /// ResourceGroupName = example.Name, + /// VirtualNetworkName = vnet.Name, + /// AddressPrefixes = new[] + /// { + /// "10.7.29.0/29", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// }, + /// }); + /// + /// var sqlserver = new Azure.Sql.SqlServer("sqlserver", new() + /// { + /// ResourceGroupName = example.Name, + /// Location = example.Location, + /// Version = "12.0", + /// AdministratorLogin = "4dm1n157r470r", + /// AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd", + /// }); + /// + /// var sqlvnetrule = new Azure.Sql.VirtualNetworkRule("sqlvnetrule", new() + /// { + /// ResourceGroupName = example.Name, + /// ServerName = sqlserver.Name, + /// SubnetId = subnet.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Stack/HciCluster.cs b/sdk/dotnet/Stack/HciCluster.cs index f7ff714f4c..4d84511b4d 100644 --- a/sdk/dotnet/Stack/HciCluster.cs +++ b/sdk/dotnet/Stack/HciCluster.cs @@ -12,6 +12,40 @@ namespace Pulumi.Azure.Stack /// /// Manages an Azure Stack HCI Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using AzureAD = Pulumi.AzureAD; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleApplication = AzureAD.GetApplication.Invoke(new() + /// { + /// DisplayName = "Allowed resource types", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleHciCluster = new Azure.Stack.HciCluster("exampleHciCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ClientId = exampleApplication.Apply(getApplicationResult => getApplicationResult.ApplicationId), + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Azure Stack HCI Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Account.cs b/sdk/dotnet/Storage/Account.cs index ed2cca64ce..f925905d26 100644 --- a/sdk/dotnet/Storage/Account.cs +++ b/sdk/dotnet/Storage/Account.cs @@ -12,6 +12,102 @@ namespace Pulumi.Azure.Storage /// /// Manages an Azure Storage Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### With Network Rules + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Sql", + /// "Microsoft.Storage", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// NetworkRules = new Azure.Storage.Inputs.AccountNetworkRulesArgs + /// { + /// DefaultAction = "Deny", + /// IpRules = new[] + /// { + /// "100.0.0.1", + /// }, + /// VirtualNetworkSubnetIds = new[] + /// { + /// exampleSubnet.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/AccountNetworkRules.cs b/sdk/dotnet/Storage/AccountNetworkRules.cs index 0aeb7ffc35..3d6d74a915 100644 --- a/sdk/dotnet/Storage/AccountNetworkRules.cs +++ b/sdk/dotnet/Storage/AccountNetworkRules.cs @@ -18,6 +18,78 @@ namespace Pulumi.Azure.Storage /// /// > **NOTE:** Deleting this resource updates the storage account back to the default values it had when the storage account was created. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// AddressSpaces = new[] + /// { + /// "10.0.0.0/16", + /// }, + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.0.2.0/24", + /// }, + /// ServiceEndpoints = new[] + /// { + /// "Microsoft.Storage", + /// }, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleAccountNetworkRules = new Azure.Storage.AccountNetworkRules("exampleAccountNetworkRules", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// DefaultAction = "Allow", + /// IpRules = new[] + /// { + /// "127.0.0.1", + /// }, + /// VirtualNetworkSubnetIds = new[] + /// { + /// exampleSubnet.Id, + /// }, + /// Bypasses = new[] + /// { + /// "Metrics", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Account Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Blob.cs b/sdk/dotnet/Storage/Blob.cs index 4a609bac5e..49235cdcaa 100644 --- a/sdk/dotnet/Storage/Blob.cs +++ b/sdk/dotnet/Storage/Blob.cs @@ -12,6 +12,46 @@ namespace Pulumi.Azure.Storage /// /// Manages a Blob within a Storage Container. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleBlob = new Azure.Storage.Blob("exampleBlob", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// StorageContainerName = exampleContainer.Name, + /// Type = "Block", + /// Source = new FileAsset("some-local-file.zip"), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/BlobInventoryPolicy.cs b/sdk/dotnet/Storage/BlobInventoryPolicy.cs index 723b1b6cab..cdc23b3fd8 100644 --- a/sdk/dotnet/Storage/BlobInventoryPolicy.cs +++ b/sdk/dotnet/Storage/BlobInventoryPolicy.cs @@ -12,6 +12,63 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Blob Inventory Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// BlobProperties = new Azure.Storage.Inputs.AccountBlobPropertiesArgs + /// { + /// VersioningEnabled = true, + /// }, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleBlobInventoryPolicy = new Azure.Storage.BlobInventoryPolicy("exampleBlobInventoryPolicy", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// Rules = new[] + /// { + /// new Azure.Storage.Inputs.BlobInventoryPolicyRuleArgs + /// { + /// Name = "rule1", + /// StorageContainerName = exampleContainer.Name, + /// Format = "Csv", + /// Schedule = "Daily", + /// Scope = "Container", + /// SchemaFields = new[] + /// { + /// "Name", + /// "Last-Modified", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Blob Inventory Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Container.cs b/sdk/dotnet/Storage/Container.cs index 3ebd6ce0cb..569d68fca3 100644 --- a/sdk/dotnet/Storage/Container.cs +++ b/sdk/dotnet/Storage/Container.cs @@ -12,6 +12,42 @@ namespace Pulumi.Azure.Storage /// /// Manages a Container within an Azure Storage Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Containers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/CustomerManagedKey.cs b/sdk/dotnet/Storage/CustomerManagedKey.cs index 807ac18f92..c93e584065 100644 --- a/sdk/dotnet/Storage/CustomerManagedKey.cs +++ b/sdk/dotnet/Storage/CustomerManagedKey.cs @@ -14,6 +14,123 @@ namespace Pulumi.Azure.Storage /// /// > **NOTE:** It's possible to define a Customer Managed Key both within the `azure.storage.Account` resource via the `customer_managed_key` block and by using the `azure.storage.CustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Storage Account, since there'll be conflicts. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// Identity = new Azure.Storage.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var storage = new Azure.KeyVault.AccessPolicy("storage", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = exampleAccount.Identity.Apply(identity => identity?.PrincipalId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// KeyPermissions = new[] + /// { + /// "Get", + /// "UnwrapKey", + /// "WrapKey", + /// }, + /// }); + /// + /// var client = new Azure.KeyVault.AccessPolicy("client", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// SecretPermissions = new[] + /// { + /// "Get", + /// }, + /// KeyPermissions = new[] + /// { + /// "Get", + /// "Create", + /// "Delete", + /// "List", + /// "Restore", + /// "Recover", + /// "UnwrapKey", + /// "WrapKey", + /// "Purge", + /// "Encrypt", + /// "Decrypt", + /// "Sign", + /// "Verify", + /// "GetRotationPolicy", + /// "SetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "decrypt", + /// "encrypt", + /// "sign", + /// "unwrapKey", + /// "verify", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// client, + /// storage, + /// }, + /// }); + /// + /// var exampleCustomerManagedKey = new Azure.Storage.CustomerManagedKey("exampleCustomerManagedKey", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// KeyVaultId = exampleKeyVault.Id, + /// KeyName = exampleKey.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Customer Managed Keys for a Storage Account can be imported using the `resource id` of the Storage Account, e.g. diff --git a/sdk/dotnet/Storage/DataLakeGen2Filesystem.cs b/sdk/dotnet/Storage/DataLakeGen2Filesystem.cs index 9fc4c0b50d..415e864e94 100644 --- a/sdk/dotnet/Storage/DataLakeGen2Filesystem.cs +++ b/sdk/dotnet/Storage/DataLakeGen2Filesystem.cs @@ -14,6 +14,43 @@ namespace Pulumi.Azure.Storage /// /// > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// Properties = + /// { + /// { "hello", "aGVsbG8=" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Lake Gen2 File System's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/DataLakeGen2Path.cs b/sdk/dotnet/Storage/DataLakeGen2Path.cs index f22677514d..1afdddf559 100644 --- a/sdk/dotnet/Storage/DataLakeGen2Path.cs +++ b/sdk/dotnet/Storage/DataLakeGen2Path.cs @@ -14,6 +14,47 @@ namespace Pulumi.Azure.Storage /// /// > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleDataLakeGen2Path = new Azure.Storage.DataLakeGen2Path("exampleDataLakeGen2Path", new() + /// { + /// Path = "example", + /// FilesystemName = exampleDataLakeGen2Filesystem.Name, + /// StorageAccountId = exampleAccount.Id, + /// Resource = "directory", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Data Lake Gen2 Paths can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/EncryptionScope.cs b/sdk/dotnet/Storage/EncryptionScope.cs index 3e96055f0e..0c4c1c3b77 100644 --- a/sdk/dotnet/Storage/EncryptionScope.cs +++ b/sdk/dotnet/Storage/EncryptionScope.cs @@ -14,6 +14,42 @@ namespace Pulumi.Azure.Storage /// /// > **Note:** Storage Encryption Scopes are in Preview [more information can be found here](https://docs.microsoft.com/azure/storage/blobs/encryption-scope-manage). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// Identity = new Azure.Storage.Inputs.AccountIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleEncryptionScope = new Azure.Storage.EncryptionScope("exampleEncryptionScope", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// Source = "Microsoft.Storage", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Encryption Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/GetAccount.cs b/sdk/dotnet/Storage/GetAccount.cs index 99f7639d92..ded41158ec 100644 --- a/sdk/dotnet/Storage/GetAccount.cs +++ b/sdk/dotnet/Storage/GetAccount.cs @@ -13,12 +13,66 @@ public static class GetAccount { /// /// Use this data source to access information about an existing Storage Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "packerimages", + /// ResourceGroupName = "packer-storage", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["storageAccountTier"] = example.Apply(getAccountResult => getAccountResult.AccountTier), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getAccount:getAccount", args ?? new GetAccountArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Account. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "packerimages", + /// ResourceGroupName = "packer-storage", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["storageAccountTier"] = example.Apply(getAccountResult => getAccountResult.AccountTier), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getAccount:getAccount", args ?? new GetAccountInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetAccountBlobContainerSAS.cs b/sdk/dotnet/Storage/GetAccountBlobContainerSAS.cs index 39b2ba53d0..aaa7841deb 100644 --- a/sdk/dotnet/Storage/GetAccountBlobContainerSAS.cs +++ b/sdk/dotnet/Storage/GetAccountBlobContainerSAS.cs @@ -15,6 +15,70 @@ public static class GetAccountBlobContainerSAS /// Use this data source to obtain a Shared Access Signature (SAS Token) for an existing Storage Account Blob Container. /// /// Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var rg = new Azure.Core.ResourceGroup("rg", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var storage = new Azure.Storage.Account("storage", new() + /// { + /// ResourceGroupName = rg.Name, + /// Location = rg.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var container = new Azure.Storage.Container("container", new() + /// { + /// StorageAccountName = storage.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var example = Azure.Storage.GetAccountBlobContainerSAS.Invoke(new() + /// { + /// ConnectionString = storage.PrimaryConnectionString, + /// ContainerName = container.Name, + /// HttpsOnly = true, + /// IpAddress = "168.1.5.65", + /// Start = "2018-03-21", + /// Expiry = "2018-03-21", + /// Permissions = new Azure.Storage.Inputs.GetAccountBlobContainerSASPermissionsInputArgs + /// { + /// Read = true, + /// Add = true, + /// Create = false, + /// Write = false, + /// Delete = true, + /// List = true, + /// }, + /// CacheControl = "max-age=5", + /// ContentDisposition = "inline", + /// ContentEncoding = "deflate", + /// ContentLanguage = "en-US", + /// ContentType = "application/json", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sasUrlQueryString"] = example.Apply(getAccountBlobContainerSASResult => getAccountBlobContainerSASResult.Sas), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountBlobContainerSASArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getAccountBlobContainerSAS:getAccountBlobContainerSAS", args ?? new GetAccountBlobContainerSASArgs(), options.WithDefaults()); @@ -23,6 +87,70 @@ public static Task InvokeAsync(GetAccountBlobC /// Use this data source to obtain a Shared Access Signature (SAS Token) for an existing Storage Account Blob Container. /// /// Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var rg = new Azure.Core.ResourceGroup("rg", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var storage = new Azure.Storage.Account("storage", new() + /// { + /// ResourceGroupName = rg.Name, + /// Location = rg.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var container = new Azure.Storage.Container("container", new() + /// { + /// StorageAccountName = storage.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var example = Azure.Storage.GetAccountBlobContainerSAS.Invoke(new() + /// { + /// ConnectionString = storage.PrimaryConnectionString, + /// ContainerName = container.Name, + /// HttpsOnly = true, + /// IpAddress = "168.1.5.65", + /// Start = "2018-03-21", + /// Expiry = "2018-03-21", + /// Permissions = new Azure.Storage.Inputs.GetAccountBlobContainerSASPermissionsInputArgs + /// { + /// Read = true, + /// Add = true, + /// Create = false, + /// Write = false, + /// Delete = true, + /// List = true, + /// }, + /// CacheControl = "max-age=5", + /// ContentDisposition = "inline", + /// ContentEncoding = "deflate", + /// ContentLanguage = "en-US", + /// ContentType = "application/json", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sasUrlQueryString"] = example.Apply(getAccountBlobContainerSASResult => getAccountBlobContainerSASResult.Sas), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountBlobContainerSASInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getAccountBlobContainerSAS:getAccountBlobContainerSAS", args ?? new GetAccountBlobContainerSASInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetAccountSAS.cs b/sdk/dotnet/Storage/GetAccountSAS.cs index d2d6e9d769..9d68b35736 100644 --- a/sdk/dotnet/Storage/GetAccountSAS.cs +++ b/sdk/dotnet/Storage/GetAccountSAS.cs @@ -18,6 +18,79 @@ public static class GetAccountSAS /// /// Note that this is an [Account SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas) /// and *not* a [Service SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-a-service-sas). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleAccountSAS = Azure.Storage.GetAccountSAS.Invoke(new() + /// { + /// ConnectionString = exampleAccount.PrimaryConnectionString, + /// HttpsOnly = true, + /// SignedVersion = "2017-07-29", + /// ResourceTypes = new Azure.Storage.Inputs.GetAccountSASResourceTypesInputArgs + /// { + /// Service = true, + /// Container = false, + /// Object = false, + /// }, + /// Services = new Azure.Storage.Inputs.GetAccountSASServicesInputArgs + /// { + /// Blob = true, + /// Queue = false, + /// Table = false, + /// File = false, + /// }, + /// Start = "2018-03-21T00:00:00Z", + /// Expiry = "2020-03-21T00:00:00Z", + /// Permissions = new Azure.Storage.Inputs.GetAccountSASPermissionsInputArgs + /// { + /// Read = true, + /// Write = true, + /// Delete = false, + /// List = false, + /// Add = true, + /// Create = true, + /// Update = false, + /// Process = false, + /// Tag = false, + /// Filter = false, + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sasUrlQueryString"] = exampleAccountSAS.Apply(getAccountSASResult => getAccountSASResult.Sas), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetAccountSASArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getAccountSAS:getAccountSAS", args ?? new GetAccountSASArgs(), options.WithDefaults()); @@ -29,6 +102,79 @@ public static Task InvokeAsync(GetAccountSASArgs args, Invo /// /// Note that this is an [Account SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas) /// and *not* a [Service SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-a-service-sas). + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }); + /// + /// var exampleAccountSAS = Azure.Storage.GetAccountSAS.Invoke(new() + /// { + /// ConnectionString = exampleAccount.PrimaryConnectionString, + /// HttpsOnly = true, + /// SignedVersion = "2017-07-29", + /// ResourceTypes = new Azure.Storage.Inputs.GetAccountSASResourceTypesInputArgs + /// { + /// Service = true, + /// Container = false, + /// Object = false, + /// }, + /// Services = new Azure.Storage.Inputs.GetAccountSASServicesInputArgs + /// { + /// Blob = true, + /// Queue = false, + /// Table = false, + /// File = false, + /// }, + /// Start = "2018-03-21T00:00:00Z", + /// Expiry = "2020-03-21T00:00:00Z", + /// Permissions = new Azure.Storage.Inputs.GetAccountSASPermissionsInputArgs + /// { + /// Read = true, + /// Write = true, + /// Delete = false, + /// List = false, + /// Add = true, + /// Create = true, + /// Update = false, + /// Process = false, + /// Tag = false, + /// Filter = false, + /// }, + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["sasUrlQueryString"] = exampleAccountSAS.Apply(getAccountSASResult => getAccountSASResult.Sas), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetAccountSASInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getAccountSAS:getAccountSAS", args ?? new GetAccountSASInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetBlob.cs b/sdk/dotnet/Storage/GetBlob.cs index f53d2ab429..05c3c84453 100644 --- a/sdk/dotnet/Storage/GetBlob.cs +++ b/sdk/dotnet/Storage/GetBlob.cs @@ -13,12 +13,60 @@ public static class GetBlob { /// /// Use this data source to access information about an existing Storage Blob. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetBlob.Invoke(new() + /// { + /// Name = "example-blob-name", + /// StorageAccountName = "example-storage-account-name", + /// StorageContainerName = "example-storage-container-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetBlobArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getBlob:getBlob", args ?? new GetBlobArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Blob. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetBlob.Invoke(new() + /// { + /// Name = "example-blob-name", + /// StorageAccountName = "example-storage-account-name", + /// StorageContainerName = "example-storage-container-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetBlobInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getBlob:getBlob", args ?? new GetBlobInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetEncryptionScope.cs b/sdk/dotnet/Storage/GetEncryptionScope.cs index 40cde6a5ea..80e018f311 100644 --- a/sdk/dotnet/Storage/GetEncryptionScope.cs +++ b/sdk/dotnet/Storage/GetEncryptionScope.cs @@ -13,12 +13,78 @@ public static class GetEncryptionScope { /// /// Use this data source to access information about an existing Storage Encryption Scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = "resourcegroupname", + /// }); + /// + /// var exampleEncryptionScope = Azure.Storage.GetEncryptionScope.Invoke(new() + /// { + /// Name = "existingStorageES", + /// StorageAccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleEncryptionScope.Apply(getEncryptionScopeResult => getEncryptionScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetEncryptionScopeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getEncryptionScope:getEncryptionScope", args ?? new GetEncryptionScopeArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Encryption Scope. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = "resourcegroupname", + /// }); + /// + /// var exampleEncryptionScope = Azure.Storage.GetEncryptionScope.Invoke(new() + /// { + /// Name = "existingStorageES", + /// StorageAccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = exampleEncryptionScope.Apply(getEncryptionScopeResult => getEncryptionScopeResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetEncryptionScopeInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getEncryptionScope:getEncryptionScope", args ?? new GetEncryptionScopeInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetPolicy.cs b/sdk/dotnet/Storage/GetPolicy.cs index bdd15fb4b5..c7a7761f44 100644 --- a/sdk/dotnet/Storage/GetPolicy.cs +++ b/sdk/dotnet/Storage/GetPolicy.cs @@ -13,12 +13,68 @@ public static class GetPolicy { /// /// Use this data source to access information about an existing Storage Management Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = "resourcegroupname", + /// }); + /// + /// var examplePolicy = Azure.Storage.GetPolicy.Invoke(new() + /// { + /// StorageAccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getPolicy:getPolicy", args ?? new GetPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Management Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleAccount = Azure.Storage.GetAccount.Invoke(new() + /// { + /// Name = "storageaccountname", + /// ResourceGroupName = "resourcegroupname", + /// }); + /// + /// var examplePolicy = Azure.Storage.GetPolicy.Invoke(new() + /// { + /// StorageAccountId = exampleAccount.Apply(getAccountResult => getAccountResult.Id), + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getPolicy:getPolicy", args ?? new GetPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetShare.cs b/sdk/dotnet/Storage/GetShare.cs index dac858a357..a3b47a2234 100644 --- a/sdk/dotnet/Storage/GetShare.cs +++ b/sdk/dotnet/Storage/GetShare.cs @@ -13,12 +13,66 @@ public static class GetShare { /// /// Use this data source to access information about an existing File Share. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetShare.Invoke(new() + /// { + /// Name = "existing", + /// StorageAccountName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getShareResult => getShareResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetShareArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getShare:getShare", args ?? new GetShareArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing File Share. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetShare.Invoke(new() + /// { + /// Name = "existing", + /// StorageAccountName = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getShareResult => getShareResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetShareInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getShare:getShare", args ?? new GetShareInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetStorageContainer.cs b/sdk/dotnet/Storage/GetStorageContainer.cs index 5f745def76..3b9b7e8825 100644 --- a/sdk/dotnet/Storage/GetStorageContainer.cs +++ b/sdk/dotnet/Storage/GetStorageContainer.cs @@ -13,12 +13,58 @@ public static class GetStorageContainer { /// /// Use this data source to access information about an existing Storage Container. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetStorageContainer.Invoke(new() + /// { + /// Name = "example-container-name", + /// StorageAccountName = "example-storage-account-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetStorageContainerArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getStorageContainer:getStorageContainer", args ?? new GetStorageContainerArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Container. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetStorageContainer.Invoke(new() + /// { + /// Name = "example-container-name", + /// StorageAccountName = "example-storage-account-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetStorageContainerInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getStorageContainer:getStorageContainer", args ?? new GetStorageContainerInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetSync.cs b/sdk/dotnet/Storage/GetSync.cs index ba70508781..fe611c59d9 100644 --- a/sdk/dotnet/Storage/GetSync.cs +++ b/sdk/dotnet/Storage/GetSync.cs @@ -13,12 +13,66 @@ public static class GetSync { /// /// Use this data source to access information about an existing Storage Sync. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetSync.Invoke(new() + /// { + /// Name = "existingStorageSyncName", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSyncResult => getSyncResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSyncArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getSync:getSync", args ?? new GetSyncArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Sync. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetSync.Invoke(new() + /// { + /// Name = "existingStorageSyncName", + /// ResourceGroupName = "existingResGroup", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSyncResult => getSyncResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSyncInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getSync:getSync", args ?? new GetSyncInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetSyncGroup.cs b/sdk/dotnet/Storage/GetSyncGroup.cs index f0da981325..c20cf1ace9 100644 --- a/sdk/dotnet/Storage/GetSyncGroup.cs +++ b/sdk/dotnet/Storage/GetSyncGroup.cs @@ -13,12 +13,66 @@ public static class GetSyncGroup { /// /// Use this data source to access information about an existing Storage Sync Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetSyncGroup.Invoke(new() + /// { + /// Name = "existing-ss-group", + /// StorageSyncId = "existing-ss-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSyncGroupResult => getSyncGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetSyncGroupArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getSyncGroup:getSyncGroup", args ?? new GetSyncGroupArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Sync Group. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetSyncGroup.Invoke(new() + /// { + /// Name = "existing-ss-group", + /// StorageSyncId = "existing-ss-id", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getSyncGroupResult => getSyncGroupResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetSyncGroupInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getSyncGroup:getSyncGroup", args ?? new GetSyncGroupInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/GetTableEntity.cs b/sdk/dotnet/Storage/GetTableEntity.cs index e6812f0ed5..a89ffcde12 100644 --- a/sdk/dotnet/Storage/GetTableEntity.cs +++ b/sdk/dotnet/Storage/GetTableEntity.cs @@ -13,12 +13,62 @@ public static class GetTableEntity { /// /// Use this data source to access information about an existing Storage Table Entity. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetTableEntity.Invoke(new() + /// { + /// PartitionKey = "example-partition-key", + /// RowKey = "example-row-key", + /// StorageAccountName = "example-storage-account-name", + /// TableName = "example-table-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetTableEntityArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:storage/getTableEntity:getTableEntity", args ?? new GetTableEntityArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Storage Table Entity. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Storage.GetTableEntity.Invoke(new() + /// { + /// PartitionKey = "example-partition-key", + /// RowKey = "example-row-key", + /// StorageAccountName = "example-storage-account-name", + /// TableName = "example-table-name", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetTableEntityInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:storage/getTableEntity:getTableEntity", args ?? new GetTableEntityInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Storage/LocalUser.cs b/sdk/dotnet/Storage/LocalUser.cs index abff066181..5267b917a1 100644 --- a/sdk/dotnet/Storage/LocalUser.cs +++ b/sdk/dotnet/Storage/LocalUser.cs @@ -12,6 +12,73 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Account Local User. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "WestEurope", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "StorageV2", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleLocalUser = new Azure.Storage.LocalUser("exampleLocalUser", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// SshKeyEnabled = true, + /// SshPasswordEnabled = true, + /// HomeDirectory = "example_path", + /// SshAuthorizedKeys = new[] + /// { + /// new Azure.Storage.Inputs.LocalUserSshAuthorizedKeyArgs + /// { + /// Description = "key1", + /// Key = local.First_public_key, + /// }, + /// new Azure.Storage.Inputs.LocalUserSshAuthorizedKeyArgs + /// { + /// Description = "key2", + /// Key = local.Second_public_key, + /// }, + /// }, + /// PermissionScopes = new[] + /// { + /// new Azure.Storage.Inputs.LocalUserPermissionScopeArgs + /// { + /// Permissions = new Azure.Storage.Inputs.LocalUserPermissionScopePermissionsArgs + /// { + /// Read = true, + /// Create = true, + /// }, + /// Service = "blob", + /// ResourceName = exampleContainer.Name, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Account Local Users can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/ManagementPolicy.cs b/sdk/dotnet/Storage/ManagementPolicy.cs index 892047f809..17d3193948 100644 --- a/sdk/dotnet/Storage/ManagementPolicy.cs +++ b/sdk/dotnet/Storage/ManagementPolicy.cs @@ -12,6 +12,117 @@ namespace Pulumi.Azure.Storage /// /// Manages an Azure Storage Account Management Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "BlobStorage", + /// }); + /// + /// var exampleManagementPolicy = new Azure.Storage.ManagementPolicy("exampleManagementPolicy", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// Rules = new[] + /// { + /// new Azure.Storage.Inputs.ManagementPolicyRuleArgs + /// { + /// Name = "rule1", + /// Enabled = true, + /// Filters = new Azure.Storage.Inputs.ManagementPolicyRuleFiltersArgs + /// { + /// PrefixMatches = new[] + /// { + /// "container1/prefix1", + /// }, + /// BlobTypes = new[] + /// { + /// "blockBlob", + /// }, + /// MatchBlobIndexTags = new[] + /// { + /// new Azure.Storage.Inputs.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs + /// { + /// Name = "tag1", + /// Operation = "==", + /// Value = "val1", + /// }, + /// }, + /// }, + /// Actions = new Azure.Storage.Inputs.ManagementPolicyRuleActionsArgs + /// { + /// BaseBlob = new Azure.Storage.Inputs.ManagementPolicyRuleActionsBaseBlobArgs + /// { + /// TierToCoolAfterDaysSinceModificationGreaterThan = 10, + /// TierToArchiveAfterDaysSinceModificationGreaterThan = 50, + /// DeleteAfterDaysSinceModificationGreaterThan = 100, + /// }, + /// Snapshot = new Azure.Storage.Inputs.ManagementPolicyRuleActionsSnapshotArgs + /// { + /// DeleteAfterDaysSinceCreationGreaterThan = 30, + /// }, + /// }, + /// }, + /// new Azure.Storage.Inputs.ManagementPolicyRuleArgs + /// { + /// Name = "rule2", + /// Enabled = false, + /// Filters = new Azure.Storage.Inputs.ManagementPolicyRuleFiltersArgs + /// { + /// PrefixMatches = new[] + /// { + /// "container2/prefix1", + /// "container2/prefix2", + /// }, + /// BlobTypes = new[] + /// { + /// "blockBlob", + /// }, + /// }, + /// Actions = new Azure.Storage.Inputs.ManagementPolicyRuleActionsArgs + /// { + /// BaseBlob = new Azure.Storage.Inputs.ManagementPolicyRuleActionsBaseBlobArgs + /// { + /// TierToCoolAfterDaysSinceModificationGreaterThan = 11, + /// TierToArchiveAfterDaysSinceModificationGreaterThan = 51, + /// DeleteAfterDaysSinceModificationGreaterThan = 101, + /// }, + /// Snapshot = new Azure.Storage.Inputs.ManagementPolicyRuleActionsSnapshotArgs + /// { + /// ChangeTierToArchiveAfterDaysSinceCreation = 90, + /// ChangeTierToCoolAfterDaysSinceCreation = 23, + /// DeleteAfterDaysSinceCreationGreaterThan = 31, + /// }, + /// Version = new Azure.Storage.Inputs.ManagementPolicyRuleActionsVersionArgs + /// { + /// ChangeTierToArchiveAfterDaysSinceCreation = 9, + /// ChangeTierToCoolAfterDaysSinceCreation = 90, + /// DeleteAfterDaysSinceCreation = 3, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Account Management Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Mover.cs b/sdk/dotnet/Storage/Mover.cs index d267da0e6a..34db84ed6b 100644 --- a/sdk/dotnet/Storage/Mover.cs +++ b/sdk/dotnet/Storage/Mover.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Mover. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleMover = new Azure.Storage.Mover("exampleMover", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// Description = "Example Storage Mover Description", + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Mover can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/MoverAgent.cs b/sdk/dotnet/Storage/MoverAgent.cs index 899350496f..7d2b8d2b06 100644 --- a/sdk/dotnet/Storage/MoverAgent.cs +++ b/sdk/dotnet/Storage/MoverAgent.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Mover Agent. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var exampleMover = new Azure.Storage.Mover("exampleMover", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleMoverAgent = new Azure.Storage.MoverAgent("exampleMoverAgent", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// ArcVirtualMachineId = exampleResourceGroup.Id.Apply(id => $"{id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName"), + /// ArcVirtualMachineUuid = "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", + /// Description = "Example Agent Description", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Mover Agent can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/MoverJobDefinition.cs b/sdk/dotnet/Storage/MoverJobDefinition.cs index 9770de16e1..c4aef2f139 100644 --- a/sdk/dotnet/Storage/MoverJobDefinition.cs +++ b/sdk/dotnet/Storage/MoverJobDefinition.cs @@ -12,6 +12,82 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Mover Job Definition. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleMover = new Azure.Storage.Mover("exampleMover", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleMoverAgent = new Azure.Storage.MoverAgent("exampleMoverAgent", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// ArcVirtualMachineId = exampleResourceGroup.Id.Apply(id => $"{id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName"), + /// ArcVirtualMachineUuid = "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AllowNestedItemsToBePublic = true, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "blob", + /// }); + /// + /// var exampleMoverTargetEndpoint = new Azure.Storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// StorageAccountId = exampleAccount.Id, + /// StorageContainerName = exampleContainer.Name, + /// }); + /// + /// var exampleMoverSourceEndpoint = new Azure.Storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// Host = "192.168.0.1", + /// }); + /// + /// var exampleMoverProject = new Azure.Storage.MoverProject("exampleMoverProject", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// }); + /// + /// var exampleMoverJobDefinition = new Azure.Storage.MoverJobDefinition("exampleMoverJobDefinition", new() + /// { + /// StorageMoverProjectId = exampleMoverProject.Id, + /// AgentName = exampleMoverAgent.Name, + /// CopyMode = "Additive", + /// SourceName = exampleMoverSourceEndpoint.Name, + /// SourceSubPath = "/", + /// TargetName = exampleMoverTargetEndpoint.Name, + /// TargetSubPath = "/", + /// Description = "Example Job Definition Description", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Mover Job Definition can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/MoverProject.cs b/sdk/dotnet/Storage/MoverProject.cs index e972454917..bcad0ec57e 100644 --- a/sdk/dotnet/Storage/MoverProject.cs +++ b/sdk/dotnet/Storage/MoverProject.cs @@ -12,6 +12,36 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Mover Project. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleMover = new Azure.Storage.Mover("exampleMover", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleMoverProject = new Azure.Storage.MoverProject("exampleMoverProject", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// Description = "Example Project Description", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Mover Project can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/MoverSourceEndpoint.cs b/sdk/dotnet/Storage/MoverSourceEndpoint.cs index aea92bc0e1..4378f3d45c 100644 --- a/sdk/dotnet/Storage/MoverSourceEndpoint.cs +++ b/sdk/dotnet/Storage/MoverSourceEndpoint.cs @@ -12,6 +12,38 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Mover Source Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleMover = new Azure.Storage.Mover("exampleMover", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// }); + /// + /// var exampleMoverSourceEndpoint = new Azure.Storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// Export = "/", + /// Host = "192.168.0.1", + /// NfsVersion = "NFSv3", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Mover Source Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/MoverTargetEndpoint.cs b/sdk/dotnet/Storage/MoverTargetEndpoint.cs index 6af50f0492..7f7bc7b4e2 100644 --- a/sdk/dotnet/Storage/MoverTargetEndpoint.cs +++ b/sdk/dotnet/Storage/MoverTargetEndpoint.cs @@ -12,6 +12,53 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Mover Target Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AllowNestedItemsToBePublic = true, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "blob", + /// }); + /// + /// var exampleMover = new Azure.Storage.Mover("exampleMover", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = "West Europe", + /// }); + /// + /// var exampleMoverTargetEndpoint = new Azure.Storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", new() + /// { + /// StorageMoverId = exampleMover.Id, + /// StorageAccountId = exampleAccount.Id, + /// StorageContainerName = exampleContainer.Name, + /// Description = "Example Storage Container Endpoint Description", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Mover Target Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/ObjectReplication.cs b/sdk/dotnet/Storage/ObjectReplication.cs index 35c975aeba..8902afc041 100644 --- a/sdk/dotnet/Storage/ObjectReplication.cs +++ b/sdk/dotnet/Storage/ObjectReplication.cs @@ -12,6 +12,81 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Object Replication. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var srcResourceGroup = new Azure.Core.ResourceGroup("srcResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var srcAccount = new Azure.Storage.Account("srcAccount", new() + /// { + /// ResourceGroupName = srcResourceGroup.Name, + /// Location = srcResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// BlobProperties = new Azure.Storage.Inputs.AccountBlobPropertiesArgs + /// { + /// VersioningEnabled = true, + /// ChangeFeedEnabled = true, + /// }, + /// }); + /// + /// var srcContainer = new Azure.Storage.Container("srcContainer", new() + /// { + /// StorageAccountName = srcAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var dstResourceGroup = new Azure.Core.ResourceGroup("dstResourceGroup", new() + /// { + /// Location = "East US", + /// }); + /// + /// var dstAccount = new Azure.Storage.Account("dstAccount", new() + /// { + /// ResourceGroupName = dstResourceGroup.Name, + /// Location = dstResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// BlobProperties = new Azure.Storage.Inputs.AccountBlobPropertiesArgs + /// { + /// VersioningEnabled = true, + /// ChangeFeedEnabled = true, + /// }, + /// }); + /// + /// var dstContainer = new Azure.Storage.Container("dstContainer", new() + /// { + /// StorageAccountName = dstAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var example = new Azure.Storage.ObjectReplication("example", new() + /// { + /// SourceStorageAccountId = srcAccount.Id, + /// DestinationStorageAccountId = dstAccount.Id, + /// Rules = new[] + /// { + /// new Azure.Storage.Inputs.ObjectReplicationRuleArgs + /// { + /// SourceContainerName = srcContainer.Name, + /// DestinationContainerName = dstContainer.Name, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Object Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Queue.cs b/sdk/dotnet/Storage/Queue.cs index 4abf0f55e1..e16b460dab 100644 --- a/sdk/dotnet/Storage/Queue.cs +++ b/sdk/dotnet/Storage/Queue.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.Storage /// /// Manages a Queue within an Azure Storage Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleQueue = new Azure.Storage.Queue("exampleQueue", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Share.cs b/sdk/dotnet/Storage/Share.cs index 5b8580111d..65de5f33cc 100644 --- a/sdk/dotnet/Storage/Share.cs +++ b/sdk/dotnet/Storage/Share.cs @@ -14,6 +14,54 @@ namespace Pulumi.Azure.Storage /// /// > **Note:** The storage share supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts. For further information, refer to the section "What storage tiers are supported in Azure Files?" of [documentation](https://docs.microsoft.com/azure/storage/files/storage-files-faq#general). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleShare = new Azure.Storage.Share("exampleShare", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// Quota = 50, + /// Acls = new[] + /// { + /// new Azure.Storage.Inputs.ShareAclArgs + /// { + /// Id = "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI", + /// AccessPolicies = new[] + /// { + /// new Azure.Storage.Inputs.ShareAclAccessPolicyArgs + /// { + /// Permissions = "rwdl", + /// Start = "2019-07-02T09:38:21.0000000Z", + /// Expiry = "2019-07-02T10:38:21.0000000Z", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Shares can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/ShareDirectory.cs b/sdk/dotnet/Storage/ShareDirectory.cs index 760757f368..51f7e3b9ae 100644 --- a/sdk/dotnet/Storage/ShareDirectory.cs +++ b/sdk/dotnet/Storage/ShareDirectory.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Storage /// /// Manages a Directory within an Azure Storage File Share. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleShare = new Azure.Storage.Share("exampleShare", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// Quota = 50, + /// }); + /// + /// var exampleShareDirectory = new Azure.Storage.ShareDirectory("exampleShareDirectory", new() + /// { + /// ShareName = exampleShare.Name, + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/ShareFile.cs b/sdk/dotnet/Storage/ShareFile.cs index 126bf32a03..adab84aaee 100644 --- a/sdk/dotnet/Storage/ShareFile.cs +++ b/sdk/dotnet/Storage/ShareFile.cs @@ -12,6 +12,44 @@ namespace Pulumi.Azure.Storage /// /// Manages a File within an Azure Storage File Share. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleShare = new Azure.Storage.Share("exampleShare", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// Quota = 50, + /// }); + /// + /// var exampleShareFile = new Azure.Storage.ShareFile("exampleShareFile", new() + /// { + /// StorageShareId = exampleShare.Id, + /// Source = "some-local-file.zip", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Sync.cs b/sdk/dotnet/Storage/Sync.cs index 1d082572a9..d5230ff4ac 100644 --- a/sdk/dotnet/Storage/Sync.cs +++ b/sdk/dotnet/Storage/Sync.cs @@ -12,6 +12,34 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Sync. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSync = new Azure.Storage.Sync("exampleSync", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Tags = + /// { + /// { "foo", "bar" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Syncs can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/SyncCloudEndpoint.cs b/sdk/dotnet/Storage/SyncCloudEndpoint.cs index 2d34911e79..c8aa9703fc 100644 --- a/sdk/dotnet/Storage/SyncCloudEndpoint.cs +++ b/sdk/dotnet/Storage/SyncCloudEndpoint.cs @@ -14,6 +14,70 @@ namespace Pulumi.Azure.Storage /// /// > **NOTE:** Please ensure Azure File Sync has access to the storage account in your subscription, which indicates that `Microsoft.StorageSync` is assigned role `Reader and Data Access` ( refer to details [here](https://docs.microsoft.com/azure/storage/files/storage-sync-files-troubleshoot?tabs=portal1%2Cazure-portal#common-troubleshooting-steps)). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSync = new Azure.Storage.Sync("exampleSync", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSyncGroup = new Azure.Storage.SyncGroup("exampleSyncGroup", new() + /// { + /// StorageSyncId = exampleSync.Id, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleShare = new Azure.Storage.Share("exampleShare", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// Quota = 50, + /// Acls = new[] + /// { + /// new Azure.Storage.Inputs.ShareAclArgs + /// { + /// Id = "GhostedRecall", + /// AccessPolicies = new[] + /// { + /// new Azure.Storage.Inputs.ShareAclAccessPolicyArgs + /// { + /// Permissions = "r", + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleSyncCloudEndpoint = new Azure.Storage.SyncCloudEndpoint("exampleSyncCloudEndpoint", new() + /// { + /// StorageSyncGroupId = exampleSyncGroup.Id, + /// FileShareName = exampleShare.Name, + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Sync Cloud Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/SyncGroup.cs b/sdk/dotnet/Storage/SyncGroup.cs index c7f3819948..ccd34a82e1 100644 --- a/sdk/dotnet/Storage/SyncGroup.cs +++ b/sdk/dotnet/Storage/SyncGroup.cs @@ -12,6 +12,35 @@ namespace Pulumi.Azure.Storage /// /// Manages a Storage Sync Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleSync = new Azure.Storage.Sync("exampleSync", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleSyncGroup = new Azure.Storage.SyncGroup("exampleSyncGroup", new() + /// { + /// StorageSyncId = exampleSync.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Storage Sync Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/Table.cs b/sdk/dotnet/Storage/Table.cs index 32db094a51..6d3dddca75 100644 --- a/sdk/dotnet/Storage/Table.cs +++ b/sdk/dotnet/Storage/Table.cs @@ -12,6 +12,37 @@ namespace Pulumi.Azure.Storage /// /// Manages a Table within an Azure Storage Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleTable = new Azure.Storage.Table("exampleTable", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Table's within a Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Storage/TableEntity.cs b/sdk/dotnet/Storage/TableEntity.cs index 1e6bb9a172..1ddb526aaf 100644 --- a/sdk/dotnet/Storage/TableEntity.cs +++ b/sdk/dotnet/Storage/TableEntity.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.Storage /// /// Manages an Entity within a Table in an Azure Storage Account. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleTable = new Azure.Storage.Table("exampleTable", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleTableEntity = new Azure.Storage.TableEntity("exampleTableEntity", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// TableName = exampleTable.Name, + /// PartitionKey = "examplepartition", + /// RowKey = "examplerow", + /// Entity = + /// { + /// { "example", "example" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Entities within a Table in an Azure Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/Cluster.cs b/sdk/dotnet/StreamAnalytics/Cluster.cs index 7f6729efde..fad37f0a24 100644 --- a/sdk/dotnet/StreamAnalytics/Cluster.cs +++ b/sdk/dotnet/StreamAnalytics/Cluster.cs @@ -12,6 +12,31 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Cluster. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleCluster = new Azure.StreamAnalytics.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StreamingCapacity = 36, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/FunctionJavaScriptUDF.cs b/sdk/dotnet/StreamAnalytics/FunctionJavaScriptUDF.cs index 3ea044828d..b336e37ed5 100644 --- a/sdk/dotnet/StreamAnalytics/FunctionJavaScriptUDF.cs +++ b/sdk/dotnet/StreamAnalytics/FunctionJavaScriptUDF.cs @@ -12,6 +12,51 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a JavaScript UDF Function within Stream Analytics Streaming Job. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = Azure.Core.GetResourceGroup.Invoke(new() + /// { + /// Name = "example-resources", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Apply(getResourceGroupResult => getResourceGroupResult.Name), + /// }); + /// + /// var exampleFunctionJavaScriptUDF = new Azure.StreamAnalytics.FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// Script = @"function getRandomNumber(in) { + /// return in; + /// } + /// ", + /// Inputs = new[] + /// { + /// new Azure.StreamAnalytics.Inputs.FunctionJavaScriptUDFInputArgs + /// { + /// Type = "bigint", + /// }, + /// }, + /// Output = new Azure.StreamAnalytics.Inputs.FunctionJavaScriptUDFOutputArgs + /// { + /// Type = "bigint", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics JavaScript UDF Functions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/FunctionJavascriptUda.cs b/sdk/dotnet/StreamAnalytics/FunctionJavascriptUda.cs index b2b2187a04..c0209c8ef7 100644 --- a/sdk/dotnet/StreamAnalytics/FunctionJavascriptUda.cs +++ b/sdk/dotnet/StreamAnalytics/FunctionJavascriptUda.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a JavaScript UDA Function within a Stream Analytics Streaming Job. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = Azure.Core.GetResourceGroup.Invoke(new() + /// { + /// Name = "example-resources", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Apply(getResourceGroupResult => getResourceGroupResult.Name), + /// }); + /// + /// var exampleFunctionJavascriptUda = new Azure.StreamAnalytics.FunctionJavascriptUda("exampleFunctionJavascriptUda", new() + /// { + /// StreamAnalyticsJobId = exampleJob.Apply(getJobResult => getJobResult.Id), + /// Script = @"function main() { + /// this.init = function () { + /// this.state = 0; + /// } + /// + /// this.accumulate = function (value, timestamp) { + /// this.state += value; + /// } + /// + /// this.computeResult = function () { + /// return this.state; + /// } + /// } + /// ", + /// Inputs = new[] + /// { + /// new Azure.StreamAnalytics.Inputs.FunctionJavascriptUdaInputArgs + /// { + /// Type = "bigint", + /// }, + /// }, + /// Output = new Azure.StreamAnalytics.Inputs.FunctionJavascriptUdaOutputArgs + /// { + /// Type = "bigint", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics JavaScript UDA Functions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/GetJob.cs b/sdk/dotnet/StreamAnalytics/GetJob.cs index d3c0d95379..1ac7a21452 100644 --- a/sdk/dotnet/StreamAnalytics/GetJob.cs +++ b/sdk/dotnet/StreamAnalytics/GetJob.cs @@ -13,12 +13,66 @@ public static class GetJob { /// /// Use this data source to access information about an existing Stream Analytics Job. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["jobId"] = example.Apply(getJobResult => getJobResult.JobId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetJobArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:streamanalytics/getJob:getJob", args ?? new GetJobArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Stream Analytics Job. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = "example-resources", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["jobId"] = example.Apply(getJobResult => getJobResult.JobId), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetJobInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:streamanalytics/getJob:getJob", args ?? new GetJobInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/StreamAnalytics/Job.cs b/sdk/dotnet/StreamAnalytics/Job.cs index 5124249466..91b3befc11 100644 --- a/sdk/dotnet/StreamAnalytics/Job.cs +++ b/sdk/dotnet/StreamAnalytics/Job.cs @@ -12,6 +12,45 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Job. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = new Azure.StreamAnalytics.Job("exampleJob", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CompatibilityLevel = "1.2", + /// DataLocale = "en-GB", + /// EventsLateArrivalMaxDelayInSeconds = 60, + /// EventsOutOfOrderMaxDelayInSeconds = 50, + /// EventsOutOfOrderPolicy = "Adjust", + /// OutputErrorPolicy = "Drop", + /// StreamingUnits = 3, + /// Tags = + /// { + /// { "environment", "Example" }, + /// }, + /// TransformationQuery = @" SELECT * + /// INTO [YourOutputAlias] + /// FROM [YourInputAlias] + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/JobSchedule.cs b/sdk/dotnet/StreamAnalytics/JobSchedule.cs index c8c15f835d..a69c07d0c4 100644 --- a/sdk/dotnet/StreamAnalytics/JobSchedule.cs +++ b/sdk/dotnet/StreamAnalytics/JobSchedule.cs @@ -12,6 +12,116 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Job Schedule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleBlob = new Azure.Storage.Blob("exampleBlob", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// StorageContainerName = exampleContainer.Name, + /// Type = "Block", + /// Source = new FileAsset("example.csv"), + /// }); + /// + /// var exampleJob = new Azure.StreamAnalytics.Job("exampleJob", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CompatibilityLevel = "1.2", + /// DataLocale = "en-GB", + /// EventsLateArrivalMaxDelayInSeconds = 60, + /// EventsOutOfOrderMaxDelayInSeconds = 50, + /// EventsOutOfOrderPolicy = "Adjust", + /// OutputErrorPolicy = "Drop", + /// StreamingUnits = 3, + /// Tags = + /// { + /// { "environment", "Example" }, + /// }, + /// TransformationQuery = @" SELECT * + /// INTO [exampleoutput] + /// FROM [exampleinput] + /// ", + /// }); + /// + /// var exampleStreamInputBlob = new Azure.StreamAnalytics.StreamInputBlob("exampleStreamInputBlob", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Name, + /// ResourceGroupName = exampleJob.ResourceGroupName, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// StorageContainerName = exampleContainer.Name, + /// PathPattern = "", + /// DateFormat = "yyyy/MM/dd", + /// TimeFormat = "HH", + /// Serialization = new Azure.StreamAnalytics.Inputs.StreamInputBlobSerializationArgs + /// { + /// Type = "Csv", + /// Encoding = "UTF8", + /// FieldDelimiter = ",", + /// }, + /// }); + /// + /// var exampleOutputBlob = new Azure.StreamAnalytics.OutputBlob("exampleOutputBlob", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Name, + /// ResourceGroupName = exampleJob.ResourceGroupName, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// StorageContainerName = exampleContainer.Name, + /// PathPattern = "example-{date}-{time}", + /// DateFormat = "yyyy-MM-dd", + /// TimeFormat = "HH", + /// Serialization = new Azure.StreamAnalytics.Inputs.OutputBlobSerializationArgs + /// { + /// Type = "Avro", + /// }, + /// }); + /// + /// var exampleJobSchedule = new Azure.StreamAnalytics.JobSchedule("exampleJobSchedule", new() + /// { + /// StreamAnalyticsJobId = exampleJob.Id, + /// StartMode = "CustomTime", + /// StartTime = "2022-09-21T00:00:00Z", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleJob, + /// exampleStreamInputBlob, + /// exampleOutputBlob, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/ManagedPrivateEndpoint.cs b/sdk/dotnet/StreamAnalytics/ManagedPrivateEndpoint.cs index 8c35f50a23..be614845c6 100644 --- a/sdk/dotnet/StreamAnalytics/ManagedPrivateEndpoint.cs +++ b/sdk/dotnet/StreamAnalytics/ManagedPrivateEndpoint.cs @@ -12,6 +12,49 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Managed Private Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleCluster = new Azure.StreamAnalytics.Cluster("exampleCluster", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StreamingCapacity = 36, + /// }); + /// + /// var exampleManagedPrivateEndpoint = new Azure.StreamAnalytics.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// StreamAnalyticsClusterName = exampleCluster.Name, + /// TargetResourceId = exampleAccount.Id, + /// SubresourceName = "blob", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Private Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputBlob.cs b/sdk/dotnet/StreamAnalytics/OutputBlob.cs index 9f9b4d62a7..d757f26714 100644 --- a/sdk/dotnet/StreamAnalytics/OutputBlob.cs +++ b/sdk/dotnet/StreamAnalytics/OutputBlob.cs @@ -12,6 +12,62 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output to Blob Storage. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleOutputBlob = new Azure.StreamAnalytics.OutputBlob("exampleOutputBlob", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// StorageContainerName = exampleContainer.Name, + /// PathPattern = "some-pattern", + /// DateFormat = "yyyy-MM-dd", + /// TimeFormat = "HH", + /// Serialization = new Azure.StreamAnalytics.Inputs.OutputBlobSerializationArgs + /// { + /// Type = "Csv", + /// Encoding = "UTF8", + /// FieldDelimiter = ",", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Outputs to Blob Storage can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputCosmosdb.cs b/sdk/dotnet/StreamAnalytics/OutputCosmosdb.cs index 2144f2e318..740547a0c7 100644 --- a/sdk/dotnet/StreamAnalytics/OutputCosmosdb.cs +++ b/sdk/dotnet/StreamAnalytics/OutputCosmosdb.cs @@ -12,6 +12,76 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output to CosmosDB. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAccount = new Azure.CosmosDB.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// OfferType = "Standard", + /// Kind = "GlobalDocumentDB", + /// ConsistencyPolicy = new Azure.CosmosDB.Inputs.AccountConsistencyPolicyArgs + /// { + /// ConsistencyLevel = "BoundedStaleness", + /// MaxIntervalInSeconds = 10, + /// MaxStalenessPrefix = 200, + /// }, + /// GeoLocations = new[] + /// { + /// new Azure.CosmosDB.Inputs.AccountGeoLocationArgs + /// { + /// Location = exampleResourceGroup.Location, + /// FailoverPriority = 0, + /// }, + /// }, + /// }); + /// + /// var exampleSqlDatabase = new Azure.CosmosDB.SqlDatabase("exampleSqlDatabase", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// Throughput = 400, + /// }); + /// + /// var exampleSqlContainer = new Azure.CosmosDB.SqlContainer("exampleSqlContainer", new() + /// { + /// ResourceGroupName = exampleAccount.ResourceGroupName, + /// AccountName = exampleAccount.Name, + /// DatabaseName = exampleSqlDatabase.Name, + /// PartitionKeyPath = "foo", + /// }); + /// + /// var exampleOutputCosmosdb = new Azure.StreamAnalytics.OutputCosmosdb("exampleOutputCosmosdb", new() + /// { + /// StreamAnalyticsJobId = exampleJob.Apply(getJobResult => getJobResult.Id), + /// CosmosdbAccountKey = exampleAccount.PrimaryKey, + /// CosmosdbSqlDatabaseId = exampleSqlDatabase.Id, + /// ContainerName = exampleSqlContainer.Name, + /// DocumentId = "exampledocumentid", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Outputs for CosmosDB can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputEventHub.cs b/sdk/dotnet/StreamAnalytics/OutputEventHub.cs index 2a12cb0074..af03aa015b 100644 --- a/sdk/dotnet/StreamAnalytics/OutputEventHub.cs +++ b/sdk/dotnet/StreamAnalytics/OutputEventHub.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output to an EventHub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 1, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// var exampleOutputEventHub = new Azure.StreamAnalytics.OutputEventHub("exampleOutputEventHub", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// EventhubName = exampleEventHub.Name, + /// ServicebusNamespace = exampleEventHubNamespace.Name, + /// SharedAccessPolicyKey = exampleEventHubNamespace.DefaultPrimaryKey, + /// SharedAccessPolicyName = "RootManageSharedAccessKey", + /// Serialization = new Azure.StreamAnalytics.Inputs.OutputEventHubSerializationArgs + /// { + /// Type = "Avro", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Outputs to an EventHub can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputFunction.cs b/sdk/dotnet/StreamAnalytics/OutputFunction.cs index 08dfbc3020..db3cc4a292 100644 --- a/sdk/dotnet/StreamAnalytics/OutputFunction.cs +++ b/sdk/dotnet/StreamAnalytics/OutputFunction.cs @@ -12,6 +12,76 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output Function. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var examplePlan = new Azure.AppService.Plan("examplePlan", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Kind = "FunctionApp", + /// Reserved = true, + /// Sku = new Azure.AppService.Inputs.PlanSkuArgs + /// { + /// Tier = "Dynamic", + /// Size = "Y1", + /// }, + /// }); + /// + /// var exampleFunctionApp = new Azure.AppService.FunctionApp("exampleFunctionApp", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AppServicePlanId = examplePlan.Id, + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// OsType = "linux", + /// Version = "~3", + /// }); + /// + /// var exampleJob = new Azure.StreamAnalytics.Job("exampleJob", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StreamingUnits = 3, + /// TransformationQuery = @" SELECT * + /// INTO [YourOutputAlias] + /// FROM [YourInputAlias] + /// ", + /// }); + /// + /// var exampleOutputFunction = new Azure.StreamAnalytics.OutputFunction("exampleOutputFunction", new() + /// { + /// ResourceGroupName = exampleJob.ResourceGroupName, + /// StreamAnalyticsJobName = exampleJob.Name, + /// FunctionApp = exampleFunctionApp.Name, + /// FunctionName = "examplefunctionname", + /// ApiKey = "exampleapikey", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Output Functions can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputMssql.cs b/sdk/dotnet/StreamAnalytics/OutputMssql.cs index 093d48edb9..f1e227410b 100644 --- a/sdk/dotnet/StreamAnalytics/OutputMssql.cs +++ b/sdk/dotnet/StreamAnalytics/OutputMssql.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output to Microsoft SQL Server Database. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleSqlServer = new Azure.Sql.SqlServer("exampleSqlServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "dbadmin", + /// AdministratorLoginPassword = "example-password", + /// }); + /// + /// var exampleDatabase = new Azure.Sql.Database("exampleDatabase", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// ServerName = exampleSqlServer.Name, + /// RequestedServiceObjectiveName = "S0", + /// Collation = "SQL_LATIN1_GENERAL_CP1_CI_AS", + /// MaxSizeBytes = "268435456000", + /// CreateMode = "Default", + /// }); + /// + /// var exampleOutputMssql = new Azure.StreamAnalytics.OutputMssql("exampleOutputMssql", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// Server = exampleSqlServer.FullyQualifiedDomainName, + /// User = exampleSqlServer.AdministratorLogin, + /// Password = exampleSqlServer.AdministratorLoginPassword, + /// Database = exampleDatabase.Name, + /// Table = "ExampleTable", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Outputs to Microsoft SQL Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputPowerbi.cs b/sdk/dotnet/StreamAnalytics/OutputPowerbi.cs index 24d7449b44..499a9616d4 100644 --- a/sdk/dotnet/StreamAnalytics/OutputPowerbi.cs +++ b/sdk/dotnet/StreamAnalytics/OutputPowerbi.cs @@ -12,6 +12,39 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output powerBI. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = Azure.Core.GetResourceGroup.Invoke(new() + /// { + /// Name = "example-resources", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Apply(getResourceGroupResult => getResourceGroupResult.Name), + /// }); + /// + /// var exampleOutputPowerbi = new Azure.StreamAnalytics.OutputPowerbi("exampleOutputPowerbi", new() + /// { + /// StreamAnalyticsJobId = exampleJob.Apply(getJobResult => getJobResult.Id), + /// Dataset = "example-dataset", + /// Table = "example-table", + /// GroupId = "00000000-0000-0000-0000-000000000000", + /// GroupName = "some-group-name", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Output to Power BI can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputServiceBusQueue.cs b/sdk/dotnet/StreamAnalytics/OutputServiceBusQueue.cs index ee7332b618..0ad8e34089 100644 --- a/sdk/dotnet/StreamAnalytics/OutputServiceBusQueue.cs +++ b/sdk/dotnet/StreamAnalytics/OutputServiceBusQueue.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output to a ServiceBus Queue. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleQueue = new Azure.ServiceBus.Queue("exampleQueue", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleOutputServiceBusQueue = new Azure.StreamAnalytics.OutputServiceBusQueue("exampleOutputServiceBusQueue", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// QueueName = exampleQueue.Name, + /// ServicebusNamespace = exampleNamespace.Name, + /// SharedAccessPolicyKey = exampleNamespace.DefaultPrimaryKey, + /// SharedAccessPolicyName = "RootManageSharedAccessKey", + /// Serialization = new Azure.StreamAnalytics.Inputs.OutputServiceBusQueueSerializationArgs + /// { + /// Type = "Csv", + /// Format = "Array", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Output ServiceBus Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputServicebusTopic.cs b/sdk/dotnet/StreamAnalytics/OutputServicebusTopic.cs index dbddabd359..c5c85403a7 100644 --- a/sdk/dotnet/StreamAnalytics/OutputServicebusTopic.cs +++ b/sdk/dotnet/StreamAnalytics/OutputServicebusTopic.cs @@ -12,6 +12,63 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output to a ServiceBus Topic. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleNamespace = new Azure.ServiceBus.Namespace("exampleNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// }); + /// + /// var exampleTopic = new Azure.ServiceBus.Topic("exampleTopic", new() + /// { + /// NamespaceId = exampleNamespace.Id, + /// EnablePartitioning = true, + /// }); + /// + /// var exampleOutputServicebusTopic = new Azure.StreamAnalytics.OutputServicebusTopic("exampleOutputServicebusTopic", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// TopicName = exampleTopic.Name, + /// ServicebusNamespace = exampleNamespace.Name, + /// SharedAccessPolicyKey = exampleNamespace.DefaultPrimaryKey, + /// SharedAccessPolicyName = "RootManageSharedAccessKey", + /// PropertyColumns = new[] + /// { + /// "col1", + /// "col2", + /// }, + /// Serialization = new Azure.StreamAnalytics.Inputs.OutputServicebusTopicSerializationArgs + /// { + /// Type = "Csv", + /// Format = "Array", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Output ServiceBus Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputSynapse.cs b/sdk/dotnet/StreamAnalytics/OutputSynapse.cs index 60bc4fbe33..3bb6bdbdfe 100644 --- a/sdk/dotnet/StreamAnalytics/OutputSynapse.cs +++ b/sdk/dotnet/StreamAnalytics/OutputSynapse.cs @@ -12,6 +12,69 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output to an Azure Synapse Analytics Workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleOutputSynapse = new Azure.StreamAnalytics.OutputSynapse("exampleOutputSynapse", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// Server = exampleWorkspace.ConnectivityEndpoints.Apply(connectivityEndpoints => connectivityEndpoints.SqlOnDemand), + /// User = exampleWorkspace.SqlAdministratorLogin, + /// Password = exampleWorkspace.SqlAdministratorLoginPassword, + /// Database = "master", + /// Table = "ExampleTable", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// A Stream Analytics Output to an Azure Synapse Analytics Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/OutputTable.cs b/sdk/dotnet/StreamAnalytics/OutputTable.cs index 6e06b3d803..1452e615a0 100644 --- a/sdk/dotnet/StreamAnalytics/OutputTable.cs +++ b/sdk/dotnet/StreamAnalytics/OutputTable.cs @@ -12,6 +12,55 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Output Table. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleTable = new Azure.Storage.Table("exampleTable", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleOutputTable = new Azure.StreamAnalytics.OutputTable("exampleOutputTable", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// Table = exampleTable.Name, + /// PartitionKey = "foo", + /// RowKey = "bar", + /// BatchSize = 100, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Output to Table can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/ReferenceInputBlob.cs b/sdk/dotnet/StreamAnalytics/ReferenceInputBlob.cs index dfabc11e25..dfd65d54d7 100644 --- a/sdk/dotnet/StreamAnalytics/ReferenceInputBlob.cs +++ b/sdk/dotnet/StreamAnalytics/ReferenceInputBlob.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Reference Input Blob. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-blob-storage). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var test = new Azure.StreamAnalytics.ReferenceInputBlob("test", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// StorageContainerName = exampleContainer.Name, + /// PathPattern = "some-random-pattern", + /// DateFormat = "yyyy/MM/dd", + /// TimeFormat = "HH", + /// Serialization = new Azure.StreamAnalytics.Inputs.ReferenceInputBlobSerializationArgs + /// { + /// Type = "Json", + /// Encoding = "UTF8", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Reference Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/ReferenceInputMssql.cs b/sdk/dotnet/StreamAnalytics/ReferenceInputMssql.cs index c590526202..19b9482e67 100644 --- a/sdk/dotnet/StreamAnalytics/ReferenceInputMssql.cs +++ b/sdk/dotnet/StreamAnalytics/ReferenceInputMssql.cs @@ -12,6 +12,60 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Reference Input from MS SQL. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-sql-database). /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleServer = new Azure.MSSql.Server("exampleServer", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Version = "12.0", + /// AdministratorLogin = "admin", + /// AdministratorLoginPassword = "password", + /// }); + /// + /// var exampleDatabase = new Azure.MSSql.Database("exampleDatabase", new() + /// { + /// ServerId = exampleServer.Id, + /// }); + /// + /// var exampleReferenceInputMssql = new Azure.StreamAnalytics.ReferenceInputMssql("exampleReferenceInputMssql", new() + /// { + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// Server = exampleServer.FullyQualifiedDomainName, + /// Database = exampleDatabase.Name, + /// Username = "exampleuser", + /// Password = "examplepassword", + /// RefreshType = "RefreshPeriodicallyWithFull", + /// RefreshIntervalDuration = "00:20:00", + /// FullSnapshotQuery = @" SELECT * + /// INTO [YourOutputAlias] + /// FROM [YourInputAlias] + /// ", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/StreamInputBlob.cs b/sdk/dotnet/StreamAnalytics/StreamInputBlob.cs index ad908dbb25..18b3018452 100644 --- a/sdk/dotnet/StreamAnalytics/StreamInputBlob.cs +++ b/sdk/dotnet/StreamAnalytics/StreamInputBlob.cs @@ -12,6 +12,61 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Stream Input Blob. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleStreamInputBlob = new Azure.StreamAnalytics.StreamInputBlob("exampleStreamInputBlob", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// StorageAccountName = exampleAccount.Name, + /// StorageAccountKey = exampleAccount.PrimaryAccessKey, + /// StorageContainerName = exampleContainer.Name, + /// PathPattern = "some-random-pattern", + /// DateFormat = "yyyy/MM/dd", + /// TimeFormat = "HH", + /// Serialization = new Azure.StreamAnalytics.Inputs.StreamInputBlobSerializationArgs + /// { + /// Type = "Json", + /// Encoding = "UTF8", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Stream Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/StreamInputEventHub.cs b/sdk/dotnet/StreamAnalytics/StreamInputEventHub.cs index 2c9f841ba3..54671e734c 100644 --- a/sdk/dotnet/StreamAnalytics/StreamInputEventHub.cs +++ b/sdk/dotnet/StreamAnalytics/StreamInputEventHub.cs @@ -14,6 +14,69 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Stream Input EventHub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 1, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleStreamInputEventHub = new Azure.StreamAnalytics.StreamInputEventHub("exampleStreamInputEventHub", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// EventhubConsumerGroupName = exampleConsumerGroup.Name, + /// EventhubName = exampleEventHub.Name, + /// ServicebusNamespace = exampleEventHubNamespace.Name, + /// SharedAccessPolicyKey = exampleEventHubNamespace.DefaultPrimaryKey, + /// SharedAccessPolicyName = "RootManageSharedAccessKey", + /// Serialization = new Azure.StreamAnalytics.Inputs.StreamInputEventHubSerializationArgs + /// { + /// Type = "Json", + /// Encoding = "UTF8", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/StreamInputEventHubV2.cs b/sdk/dotnet/StreamAnalytics/StreamInputEventHubV2.cs index b962f21f81..e4bf1da015 100644 --- a/sdk/dotnet/StreamAnalytics/StreamInputEventHubV2.cs +++ b/sdk/dotnet/StreamAnalytics/StreamInputEventHubV2.cs @@ -14,6 +14,68 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Stream Input EventHub V2. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleEventHubNamespace = new Azure.EventHub.EventHubNamespace("exampleEventHubNamespace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard", + /// Capacity = 1, + /// }); + /// + /// var exampleEventHub = new Azure.EventHub.EventHub("exampleEventHub", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// PartitionCount = 2, + /// MessageRetention = 1, + /// }); + /// + /// var exampleConsumerGroup = new Azure.EventHub.ConsumerGroup("exampleConsumerGroup", new() + /// { + /// NamespaceName = exampleEventHubNamespace.Name, + /// EventhubName = exampleEventHub.Name, + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleStreamInputEventHubV2 = new Azure.StreamAnalytics.StreamInputEventHubV2("exampleStreamInputEventHubV2", new() + /// { + /// StreamAnalyticsJobId = exampleJob.Apply(getJobResult => getJobResult.Id), + /// EventhubConsumerGroupName = exampleConsumerGroup.Name, + /// EventhubName = exampleEventHub.Name, + /// ServicebusNamespace = exampleEventHubNamespace.Name, + /// SharedAccessPolicyKey = exampleEventHubNamespace.DefaultPrimaryKey, + /// SharedAccessPolicyName = "RootManageSharedAccessKey", + /// Serialization = new Azure.StreamAnalytics.Inputs.StreamInputEventHubV2SerializationArgs + /// { + /// Type = "Json", + /// Encoding = "UTF8", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/StreamAnalytics/StreamInputIotHub.cs b/sdk/dotnet/StreamAnalytics/StreamInputIotHub.cs index 6490548ab9..98ccfebb56 100644 --- a/sdk/dotnet/StreamAnalytics/StreamInputIotHub.cs +++ b/sdk/dotnet/StreamAnalytics/StreamInputIotHub.cs @@ -12,6 +12,57 @@ namespace Pulumi.Azure.StreamAnalytics /// /// Manages a Stream Analytics Stream Input IoTHub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleJob = Azure.StreamAnalytics.GetJob.Invoke(new() + /// { + /// Name = "example-job", + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleIoTHub = new Azure.Iot.IoTHub("exampleIoTHub", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// Sku = new Azure.Iot.Inputs.IoTHubSkuArgs + /// { + /// Name = "S1", + /// Capacity = 1, + /// }, + /// }); + /// + /// var exampleStreamInputIotHub = new Azure.StreamAnalytics.StreamInputIotHub("exampleStreamInputIotHub", new() + /// { + /// StreamAnalyticsJobName = exampleJob.Apply(getJobResult => getJobResult.Name), + /// ResourceGroupName = exampleJob.Apply(getJobResult => getJobResult.ResourceGroupName), + /// Endpoint = "messages/events", + /// EventhubConsumerGroupName = "$Default", + /// IothubNamespace = exampleIoTHub.Name, + /// SharedAccessPolicyKey = exampleIoTHub.SharedAccessPolicies.Apply(sharedAccessPolicies => sharedAccessPolicies[0].PrimaryKey), + /// SharedAccessPolicyName = "iothubowner", + /// Serialization = new Azure.StreamAnalytics.Inputs.StreamInputIotHubSerializationArgs + /// { + /// Type = "Json", + /// Encoding = "UTF8", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Stream Analytics Stream Input IoTHub's can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/FirewallRule.cs b/sdk/dotnet/Synapse/FirewallRule.cs index 08dc3e2b6b..01ba3a03a7 100644 --- a/sdk/dotnet/Synapse/FirewallRule.cs +++ b/sdk/dotnet/Synapse/FirewallRule.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.Synapse /// /// Allows you to Manages a Synapse Firewall Rule. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleFirewallRule = new Azure.Synapse.FirewallRule("exampleFirewallRule", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "255.255.255.255", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Firewall Rule can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/GetWorkspace.cs b/sdk/dotnet/Synapse/GetWorkspace.cs index 45cd5d0d3f..5f126c11ff 100644 --- a/sdk/dotnet/Synapse/GetWorkspace.cs +++ b/sdk/dotnet/Synapse/GetWorkspace.cs @@ -13,12 +13,66 @@ public static class GetWorkspace { /// /// Use this data source to access information about an existing Synapse Workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Synapse.GetWorkspace.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getWorkspaceResult => getWorkspaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetWorkspaceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:synapse/getWorkspace:getWorkspace", args ?? new GetWorkspaceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Synapse Workspace. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Synapse.GetWorkspace.Invoke(new() + /// { + /// Name = "existing", + /// ResourceGroupName = "example-resource-group", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getWorkspaceResult => getWorkspaceResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetWorkspaceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:synapse/getWorkspace:getWorkspace", args ?? new GetWorkspaceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Synapse/IntegrationRuntimeAzure.cs b/sdk/dotnet/Synapse/IntegrationRuntimeAzure.cs index d18cb553c6..c135323790 100644 --- a/sdk/dotnet/Synapse/IntegrationRuntimeAzure.cs +++ b/sdk/dotnet/Synapse/IntegrationRuntimeAzure.cs @@ -12,6 +12,70 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Azure Integration Runtime. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// ManagedVirtualNetworkEnabled = true, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleFirewallRule = new Azure.Synapse.FirewallRule("exampleFirewallRule", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "255.255.255.255", + /// }); + /// + /// var exampleIntegrationRuntimeAzure = new Azure.Synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/IntegrationRuntimeSelfHosted.cs b/sdk/dotnet/Synapse/IntegrationRuntimeSelfHosted.cs index b2d17c4a4c..04e197fefa 100644 --- a/sdk/dotnet/Synapse/IntegrationRuntimeSelfHosted.cs +++ b/sdk/dotnet/Synapse/IntegrationRuntimeSelfHosted.cs @@ -12,6 +12,69 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Self-hosted Integration Runtime. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// ManagedVirtualNetworkEnabled = true, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleFirewallRule = new Azure.Synapse.FirewallRule("exampleFirewallRule", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "255.255.255.255", + /// }); + /// + /// var exampleIntegrationRuntimeSelfHosted = new Azure.Synapse.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Self-hosted Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/LinkedService.cs b/sdk/dotnet/Synapse/LinkedService.cs index 0ad2d02df6..3033fea5ac 100644 --- a/sdk/dotnet/Synapse/LinkedService.cs +++ b/sdk/dotnet/Synapse/LinkedService.cs @@ -12,6 +12,85 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Linked Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// ManagedVirtualNetworkEnabled = true, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleFirewallRule = new Azure.Synapse.FirewallRule("exampleFirewallRule", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "255.255.255.255", + /// }); + /// + /// var exampleIntegrationRuntimeAzure = new Azure.Synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleLinkedService = new Azure.Synapse.LinkedService("exampleLinkedService", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Type = "AzureBlobStorage", + /// TypePropertiesJson = exampleAccount.PrimaryConnectionString.Apply(primaryConnectionString => @$"{{ + /// ""connectionString"": ""{primaryConnectionString}"" + /// }} + /// "), + /// IntegrationRuntime = new Azure.Synapse.Inputs.LinkedServiceIntegrationRuntimeArgs + /// { + /// Name = exampleIntegrationRuntimeAzure.Name, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleFirewallRule, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/ManagedPrivateEndpoint.cs b/sdk/dotnet/Synapse/ManagedPrivateEndpoint.cs index 336986ec5f..47c0c94220 100644 --- a/sdk/dotnet/Synapse/ManagedPrivateEndpoint.cs +++ b/sdk/dotnet/Synapse/ManagedPrivateEndpoint.cs @@ -12,6 +12,82 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Managed Private Endpoint. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// ManagedVirtualNetworkEnabled = true, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleFirewallRule = new Azure.Synapse.FirewallRule("exampleFirewallRule", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "255.255.255.255", + /// }); + /// + /// var exampleConnect = new Azure.Storage.Account("exampleConnect", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "BlobStorage", + /// }); + /// + /// var exampleManagedPrivateEndpoint = new Azure.Synapse.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// TargetResourceId = exampleConnect.Id, + /// SubresourceName = "blob", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleFirewallRule, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/PrivateLinkHub.cs b/sdk/dotnet/Synapse/PrivateLinkHub.cs index 22b3317e33..b14ebca30a 100644 --- a/sdk/dotnet/Synapse/PrivateLinkHub.cs +++ b/sdk/dotnet/Synapse/PrivateLinkHub.cs @@ -12,6 +12,25 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Private Link Hub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Azure.Synapse.PrivateLinkHub("example", new() + /// { + /// Location = "West Europe", + /// ResourceGroupName = "example-rg", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Private Link Hub can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/RoleAssignment.cs b/sdk/dotnet/Synapse/RoleAssignment.cs index e1a19fe4f6..5946b92c41 100644 --- a/sdk/dotnet/Synapse/RoleAssignment.cs +++ b/sdk/dotnet/Synapse/RoleAssignment.cs @@ -12,6 +12,74 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Role Assignment. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleFirewallRule = new Azure.Synapse.FirewallRule("exampleFirewallRule", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// StartIpAddress = "0.0.0.0", + /// EndIpAddress = "255.255.255.255", + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleRoleAssignment = new Azure.Synapse.RoleAssignment("exampleRoleAssignment", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// RoleName = "Synapse SQL Administrator", + /// PrincipalId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleFirewallRule, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Role Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/SqlPool.cs b/sdk/dotnet/Synapse/SqlPool.cs index ae3896c3fc..101af72e0b 100644 --- a/sdk/dotnet/Synapse/SqlPool.cs +++ b/sdk/dotnet/Synapse/SqlPool.cs @@ -12,6 +12,59 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse SQL Pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "BlobStorage", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSqlPool = new Azure.Synapse.SqlPool("exampleSqlPool", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// SkuName = "DW100c", + /// CreateMode = "Default", + /// StorageAccountType = "GRS", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse SQL Pool can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/SqlPoolExtendedAuditingPolicy.cs b/sdk/dotnet/Synapse/SqlPoolExtendedAuditingPolicy.cs index e176e1a096..b07fd50220 100644 --- a/sdk/dotnet/Synapse/SqlPoolExtendedAuditingPolicy.cs +++ b/sdk/dotnet/Synapse/SqlPoolExtendedAuditingPolicy.cs @@ -12,6 +12,75 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse SQL Pool Extended Auditing Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "BlobStorage", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSqlPool = new Azure.Synapse.SqlPool("exampleSqlPool", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// SkuName = "DW100c", + /// CreateMode = "Default", + /// }); + /// + /// var auditLogs = new Azure.Storage.Account("auditLogs", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleSqlPoolExtendedAuditingPolicy = new Azure.Synapse.SqlPoolExtendedAuditingPolicy("exampleSqlPoolExtendedAuditingPolicy", new() + /// { + /// SqlPoolId = exampleSqlPool.Id, + /// StorageEndpoint = auditLogs.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = auditLogs.PrimaryAccessKey, + /// StorageAccountAccessKeyIsSecondary = false, + /// RetentionInDays = 6, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse SQL Pool Extended Auditing Policys can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/SqlPoolSecurityAlertPolicy.cs b/sdk/dotnet/Synapse/SqlPoolSecurityAlertPolicy.cs index e18334091e..ba751423c2 100644 --- a/sdk/dotnet/Synapse/SqlPoolSecurityAlertPolicy.cs +++ b/sdk/dotnet/Synapse/SqlPoolSecurityAlertPolicy.cs @@ -12,6 +12,91 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Security Alert Policy for a Synapse SQL Pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// AadAdmin = new Azure.Synapse.Inputs.WorkspaceAadAdminArgs + /// { + /// Login = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// TenantId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var exampleSqlPool = new Azure.Synapse.SqlPool("exampleSqlPool", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// SkuName = "DW100c", + /// CreateMode = "Default", + /// }); + /// + /// var auditLogs = new Azure.Storage.Account("auditLogs", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleSqlPoolSecurityAlertPolicy = new Azure.Synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", new() + /// { + /// SqlPoolId = exampleSqlPool.Id, + /// PolicyState = "Enabled", + /// StorageEndpoint = auditLogs.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = auditLogs.PrimaryAccessKey, + /// DisabledAlerts = new[] + /// { + /// "Sql_Injection", + /// "Data_Exfiltration", + /// }, + /// RetentionDays = 20, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse SQL Pool Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessment.cs b/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessment.cs index 29429cfb6c..331c02acf5 100644 --- a/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessment.cs +++ b/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessment.cs @@ -12,6 +12,118 @@ namespace Pulumi.Azure.Synapse /// /// Manages the Vulnerability Assessment for a Synapse SQL Pool. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// AadAdmin = new Azure.Synapse.Inputs.WorkspaceAadAdminArgs + /// { + /// Login = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// TenantId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var exampleSqlPool = new Azure.Synapse.SqlPool("exampleSqlPool", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// SkuName = "DW100c", + /// CreateMode = "Default", + /// }); + /// + /// var auditLogs = new Azure.Storage.Account("auditLogs", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleSqlPoolSecurityAlertPolicy = new Azure.Synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", new() + /// { + /// SqlPoolId = exampleSqlPool.Id, + /// PolicyState = "Enabled", + /// StorageEndpoint = auditLogs.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = auditLogs.PrimaryAccessKey, + /// DisabledAlerts = new[] + /// { + /// "Sql_Injection", + /// "Data_Exfiltration", + /// }, + /// RetentionDays = 20, + /// }); + /// + /// var exampleSqlPoolVulnerabilityAssessment = new Azure.Synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", new() + /// { + /// SqlPoolSecurityAlertPolicyId = exampleSqlPoolSecurityAlertPolicy.Id, + /// StorageContainerPath = Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values => + /// { + /// var primaryBlobEndpoint = values.Item1; + /// var name = values.Item2; + /// return $"{primaryBlobEndpoint}{name}/"; + /// }), + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// RecurringScans = new Azure.Synapse.Inputs.SqlPoolVulnerabilityAssessmentRecurringScansArgs + /// { + /// Enabled = true, + /// EmailSubscriptionAdminsEnabled = true, + /// Emails = new[] + /// { + /// "email@example1.com", + /// "email@example2.com", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse SQL Pool Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessmentBaseline.cs b/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessmentBaseline.cs index 25640a11d4..7646b14cdb 100644 --- a/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessmentBaseline.cs +++ b/sdk/dotnet/Synapse/SqlPoolVulnerabilityAssessmentBaseline.cs @@ -12,6 +12,109 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse SQL Pool Vulnerability Assessment Rule Baseline. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSqlPool = new Azure.Synapse.SqlPool("exampleSqlPool", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// SkuName = "DW100c", + /// CreateMode = "Default", + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// ContainerAccessType = "private", + /// }); + /// + /// var exampleSqlPoolSecurityAlertPolicy = new Azure.Synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", new() + /// { + /// SqlPoolId = exampleSqlPool.Id, + /// PolicyState = "Enabled", + /// StorageEndpoint = exampleAccount.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// var exampleSqlPoolVulnerabilityAssessment = new Azure.Synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", new() + /// { + /// SqlPoolSecurityAlertPolicyId = exampleSqlPoolSecurityAlertPolicy.Id, + /// StorageContainerPath = Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values => + /// { + /// var primaryBlobEndpoint = values.Item1; + /// var name = values.Item2; + /// return $"{primaryBlobEndpoint}{name}/"; + /// }), + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// }); + /// + /// var exampleSqlPoolVulnerabilityAssessmentBaseline = new Azure.Synapse.SqlPoolVulnerabilityAssessmentBaseline("exampleSqlPoolVulnerabilityAssessmentBaseline", new() + /// { + /// RuleName = "VA1017", + /// SqlPoolVulnerabilityAssessmentId = exampleSqlPoolVulnerabilityAssessment.Id, + /// Baselines = new[] + /// { + /// new Azure.Synapse.Inputs.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs + /// { + /// Results = new[] + /// { + /// "userA", + /// "SELECT", + /// }, + /// }, + /// new Azure.Synapse.Inputs.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs + /// { + /// Results = new[] + /// { + /// "userB", + /// "SELECT", + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse SQL Pool Vulnerability Assessment Rule Baselines can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/SqlPoolWorkloadClassifier.cs b/sdk/dotnet/Synapse/SqlPoolWorkloadClassifier.cs index e655ae6548..92f5e8d471 100644 --- a/sdk/dotnet/Synapse/SqlPoolWorkloadClassifier.cs +++ b/sdk/dotnet/Synapse/SqlPoolWorkloadClassifier.cs @@ -12,6 +12,80 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse SQL Pool Workload Classifier. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSqlPool = new Azure.Synapse.SqlPool("exampleSqlPool", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// SkuName = "DW100c", + /// CreateMode = "Default", + /// }); + /// + /// var exampleSqlPoolWorkloadGroup = new Azure.Synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", new() + /// { + /// SqlPoolId = exampleSqlPool.Id, + /// Importance = "normal", + /// MaxResourcePercent = 100, + /// MinResourcePercent = 0, + /// MaxResourcePercentPerRequest = 3, + /// MinResourcePercentPerRequest = 3, + /// QueryExecutionTimeoutInSeconds = 0, + /// }); + /// + /// var exampleSqlPoolWorkloadClassifier = new Azure.Synapse.SqlPoolWorkloadClassifier("exampleSqlPoolWorkloadClassifier", new() + /// { + /// WorkloadGroupId = exampleSqlPoolWorkloadGroup.Id, + /// Context = "example_context", + /// EndTime = "14:00", + /// Importance = "high", + /// Label = "example_label", + /// MemberName = "dbo", + /// StartTime = "12:00", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse SQL Pool Workload Classifiers can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/SqlPoolWorkloadGroup.cs b/sdk/dotnet/Synapse/SqlPoolWorkloadGroup.cs index 5a069c154c..bf6c29cdbc 100644 --- a/sdk/dotnet/Synapse/SqlPoolWorkloadGroup.cs +++ b/sdk/dotnet/Synapse/SqlPoolWorkloadGroup.cs @@ -12,6 +12,69 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse SQL Pool Workload Group. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "west europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountKind = "BlobStorage", + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var exampleSqlPool = new Azure.Synapse.SqlPool("exampleSqlPool", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// SkuName = "DW100c", + /// CreateMode = "Default", + /// }); + /// + /// var exampleSqlPoolWorkloadGroup = new Azure.Synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", new() + /// { + /// SqlPoolId = exampleSqlPool.Id, + /// Importance = "normal", + /// MaxResourcePercent = 100, + /// MinResourcePercent = 0, + /// MaxResourcePercentPerRequest = 3, + /// MinResourcePercentPerRequest = 3, + /// QueryExecutionTimeoutInSeconds = 0, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse SQL Pool Workload Groups can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/Workspace.cs b/sdk/dotnet/Synapse/Workspace.cs index 5c06048d67..9ee28f879d 100644 --- a/sdk/dotnet/Synapse/Workspace.cs +++ b/sdk/dotnet/Synapse/Workspace.cs @@ -12,6 +12,201 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// AadAdmin = new Azure.Synapse.Inputs.WorkspaceAadAdminArgs + /// { + /// Login = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// TenantId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// ### Creating A Workspace With Customer Managed Key And Azure AD Admin + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var deployer = new Azure.KeyVault.AccessPolicy("deployer", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// "Delete", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "unwrapKey", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// deployer, + /// }, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// CustomerManagedKey = new Azure.Synapse.Inputs.WorkspaceCustomerManagedKeyArgs + /// { + /// KeyVersionlessId = exampleKey.VersionlessId, + /// KeyName = "enckey", + /// }, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var workspacePolicy = new Azure.KeyVault.AccessPolicy("workspacePolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = exampleWorkspace.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleWorkspace.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "WrapKey", + /// "UnwrapKey", + /// }, + /// }); + /// + /// var exampleWorkspaceKey = new Azure.Synapse.WorkspaceKey("exampleWorkspaceKey", new() + /// { + /// CustomerManagedKeyVersionlessId = exampleKey.VersionlessId, + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Active = true, + /// CustomerManagedKeyName = "enckey", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// workspacePolicy, + /// }, + /// }); + /// + /// var exampleWorkspaceAadAdmin = new Azure.Synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Login = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// TenantId = "00000000-0000-0000-0000-000000000000", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleWorkspaceKey, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/WorkspaceAadAdmin.cs b/sdk/dotnet/Synapse/WorkspaceAadAdmin.cs index 239b569fac..d76a2126cb 100644 --- a/sdk/dotnet/Synapse/WorkspaceAadAdmin.cs +++ b/sdk/dotnet/Synapse/WorkspaceAadAdmin.cs @@ -12,6 +12,108 @@ namespace Pulumi.Azure.Synapse /// /// Manages an Azure Active Directory Administrator setting for a Synapse Workspace /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var deployer = new Azure.KeyVault.AccessPolicy("deployer", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// "Delete", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "unwrapKey", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// deployer, + /// }, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var exampleWorkspaceAadAdmin = new Azure.Synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Login = "AzureAD Admin", + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/WorkspaceExtendedAuditingPolicy.cs b/sdk/dotnet/Synapse/WorkspaceExtendedAuditingPolicy.cs index d74f350137..d3ac81b6b0 100644 --- a/sdk/dotnet/Synapse/WorkspaceExtendedAuditingPolicy.cs +++ b/sdk/dotnet/Synapse/WorkspaceExtendedAuditingPolicy.cs @@ -12,6 +12,68 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Synapse Workspace Extended Auditing Policy. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "BlobStorage", + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// var auditLogs = new Azure.Storage.Account("auditLogs", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleWorkspaceExtendedAuditingPolicy = new Azure.Synapse.WorkspaceExtendedAuditingPolicy("exampleWorkspaceExtendedAuditingPolicy", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// StorageEndpoint = auditLogs.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = auditLogs.PrimaryAccessKey, + /// StorageAccountAccessKeyIsSecondary = false, + /// RetentionInDays = 6, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Workspace Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/WorkspaceKey.cs b/sdk/dotnet/Synapse/WorkspaceKey.cs index 009d124aa4..a33f715e49 100644 --- a/sdk/dotnet/Synapse/WorkspaceKey.cs +++ b/sdk/dotnet/Synapse/WorkspaceKey.cs @@ -14,6 +14,132 @@ namespace Pulumi.Azure.Synapse /// /// > **Note:** Keys that are actively protecting a workspace cannot be deleted. When the keys resource is deleted, if the key is inactive it will be deleted, if it is active it will not be deleted. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var deployer = new Azure.KeyVault.AccessPolicy("deployer", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// "Delete", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "unwrapKey", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// deployer, + /// }, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// CustomerManagedKey = new Azure.Synapse.Inputs.WorkspaceCustomerManagedKeyArgs + /// { + /// KeyVersionlessId = exampleKey.VersionlessId, + /// KeyName = "enckey", + /// }, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var workspacePolicy = new Azure.KeyVault.AccessPolicy("workspacePolicy", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = exampleWorkspace.Identity.Apply(identity => identity?.TenantId), + /// ObjectId = exampleWorkspace.Identity.Apply(identity => identity?.PrincipalId), + /// KeyPermissions = new[] + /// { + /// "Get", + /// "WrapKey", + /// "UnwrapKey", + /// }, + /// }); + /// + /// var exampleWorkspaceKey = new Azure.Synapse.WorkspaceKey("exampleWorkspaceKey", new() + /// { + /// CustomerManagedKeyVersionlessId = exampleKey.VersionlessId, + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Active = true, + /// CustomerManagedKeyName = "enckey", + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// workspacePolicy, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Workspace Keys can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/WorkspaceSecurityAlertPolicy.cs b/sdk/dotnet/Synapse/WorkspaceSecurityAlertPolicy.cs index b1b661ce1b..29c1b3c1c5 100644 --- a/sdk/dotnet/Synapse/WorkspaceSecurityAlertPolicy.cs +++ b/sdk/dotnet/Synapse/WorkspaceSecurityAlertPolicy.cs @@ -12,6 +12,84 @@ namespace Pulumi.Azure.Synapse /// /// Manages a Security Alert Policy for a Synapse Workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// AadAdmin = new Azure.Synapse.Inputs.WorkspaceAadAdminArgs + /// { + /// Login = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// TenantId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var auditLogs = new Azure.Storage.Account("auditLogs", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleWorkspaceSecurityAlertPolicy = new Azure.Synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// PolicyState = "Enabled", + /// StorageEndpoint = auditLogs.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = auditLogs.PrimaryAccessKey, + /// DisabledAlerts = new[] + /// { + /// "Sql_Injection", + /// "Data_Exfiltration", + /// }, + /// RetentionDays = 20, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Workspace Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/WorkspaceSqlAadAdmin.cs b/sdk/dotnet/Synapse/WorkspaceSqlAadAdmin.cs index 11e9527a4b..fedf61882a 100644 --- a/sdk/dotnet/Synapse/WorkspaceSqlAadAdmin.cs +++ b/sdk/dotnet/Synapse/WorkspaceSqlAadAdmin.cs @@ -12,6 +12,108 @@ namespace Pulumi.Azure.Synapse /// /// Manages an Azure Active Directory SQL Administrator setting for a Synapse Workspace /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// PurgeProtectionEnabled = true, + /// }); + /// + /// var deployer = new Azure.KeyVault.AccessPolicy("deployer", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// KeyPermissions = new[] + /// { + /// "Create", + /// "Get", + /// "Delete", + /// "Purge", + /// "GetRotationPolicy", + /// }, + /// }); + /// + /// var exampleKey = new Azure.KeyVault.Key("exampleKey", new() + /// { + /// KeyVaultId = exampleKeyVault.Id, + /// KeyType = "RSA", + /// KeySize = 2048, + /// KeyOpts = new[] + /// { + /// "unwrapKey", + /// "wrapKey", + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// deployer, + /// }, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var exampleWorkspaceSqlAadAdmin = new Azure.Synapse.WorkspaceSqlAadAdmin("exampleWorkspaceSqlAadAdmin", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// Login = "AzureAD Admin", + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Synapse/WorkspaceVulnerabilityAssessment.cs b/sdk/dotnet/Synapse/WorkspaceVulnerabilityAssessment.cs index 974e8f1a1e..2f03dd101d 100644 --- a/sdk/dotnet/Synapse/WorkspaceVulnerabilityAssessment.cs +++ b/sdk/dotnet/Synapse/WorkspaceVulnerabilityAssessment.cs @@ -12,6 +12,111 @@ namespace Pulumi.Azure.Synapse /// /// Manages the Vulnerability Assessment for a Synapse Workspace. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// AccountKind = "StorageV2", + /// IsHnsEnabled = true, + /// }); + /// + /// var exampleContainer = new Azure.Storage.Container("exampleContainer", new() + /// { + /// StorageAccountName = exampleAccount.Name, + /// }); + /// + /// var exampleDataLakeGen2Filesystem = new Azure.Storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", new() + /// { + /// StorageAccountId = exampleAccount.Id, + /// }); + /// + /// var exampleWorkspace = new Azure.Synapse.Workspace("exampleWorkspace", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// StorageDataLakeGen2FilesystemId = exampleDataLakeGen2Filesystem.Id, + /// SqlAdministratorLogin = "sqladminuser", + /// SqlAdministratorLoginPassword = "H@Sh1CoR3!", + /// AadAdmin = new Azure.Synapse.Inputs.WorkspaceAadAdminArgs + /// { + /// Login = "AzureAD Admin", + /// ObjectId = "00000000-0000-0000-0000-000000000000", + /// TenantId = "00000000-0000-0000-0000-000000000000", + /// }, + /// Identity = new Azure.Synapse.Inputs.WorkspaceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// Tags = + /// { + /// { "Env", "production" }, + /// }, + /// }); + /// + /// var auditLogs = new Azure.Storage.Account("auditLogs", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "LRS", + /// }); + /// + /// var exampleWorkspaceSecurityAlertPolicy = new Azure.Synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", new() + /// { + /// SynapseWorkspaceId = exampleWorkspace.Id, + /// PolicyState = "Enabled", + /// StorageEndpoint = auditLogs.PrimaryBlobEndpoint, + /// StorageAccountAccessKey = auditLogs.PrimaryAccessKey, + /// DisabledAlerts = new[] + /// { + /// "Sql_Injection", + /// "Data_Exfiltration", + /// }, + /// RetentionDays = 20, + /// }); + /// + /// var exampleWorkspaceVulnerabilityAssessment = new Azure.Synapse.WorkspaceVulnerabilityAssessment("exampleWorkspaceVulnerabilityAssessment", new() + /// { + /// WorkspaceSecurityAlertPolicyId = exampleWorkspaceSecurityAlertPolicy.Id, + /// StorageContainerPath = Output.Tuple(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).Apply(values => + /// { + /// var primaryBlobEndpoint = values.Item1; + /// var name = values.Item2; + /// return $"{primaryBlobEndpoint}{name}/"; + /// }), + /// StorageAccountAccessKey = exampleAccount.PrimaryAccessKey, + /// RecurringScans = new Azure.Synapse.Inputs.WorkspaceVulnerabilityAssessmentRecurringScansArgs + /// { + /// Enabled = true, + /// EmailSubscriptionAdminsEnabled = true, + /// Emails = new[] + /// { + /// "email@example1.com", + /// "email@example2.com", + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Synapse Workspace Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/TrafficManager/GetGeographicalLocation.cs b/sdk/dotnet/TrafficManager/GetGeographicalLocation.cs index 7af12b6403..ad228ed2ab 100644 --- a/sdk/dotnet/TrafficManager/GetGeographicalLocation.cs +++ b/sdk/dotnet/TrafficManager/GetGeographicalLocation.cs @@ -17,6 +17,29 @@ public static class GetGeographicalLocation /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### World) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetTrafficManager.Invoke(new() + /// { + /// Name = "World", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["locationCode"] = example.Apply(getTrafficManagerResult => getTrafficManagerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Task InvokeAsync(GetGeographicalLocationArgs args, InvokeOptions? options = null) @@ -27,6 +50,29 @@ public static Task InvokeAsync(GetGeographicalLoc /// /// {{% examples %}} /// ## Example Usage + /// {{% example %}} + /// ### World) + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Network.GetTrafficManager.Invoke(new() + /// { + /// Name = "World", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["locationCode"] = example.Apply(getTrafficManagerResult => getTrafficManagerResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} /// {{% /examples %}} /// public static Output Invoke(GetGeographicalLocationInvokeArgs args, InvokeOptions? options = null) diff --git a/sdk/dotnet/TrafficManager/Profile.cs b/sdk/dotnet/TrafficManager/Profile.cs index 8fa6be9394..817c2d59e7 100644 --- a/sdk/dotnet/TrafficManager/Profile.cs +++ b/sdk/dotnet/TrafficManager/Profile.cs @@ -12,6 +12,58 @@ namespace Pulumi.Azure.TrafficManager /// /// Manages a Traffic Manager Profile to which multiple endpoints can be attached. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// using Random = Pulumi.Random; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var server = new Random.RandomId("server", new() + /// { + /// Keepers = + /// { + /// { "azi_id", 1 }, + /// }, + /// ByteLength = 8, + /// }); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleTrafficManagerProfile = new Azure.Network.TrafficManagerProfile("exampleTrafficManagerProfile", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// TrafficRoutingMethod = "Weighted", + /// DnsConfig = new Azure.Network.Inputs.TrafficManagerProfileDnsConfigArgs + /// { + /// RelativeName = server.Hex, + /// Ttl = 100, + /// }, + /// MonitorConfig = new Azure.Network.Inputs.TrafficManagerProfileMonitorConfigArgs + /// { + /// Protocol = "HTTP", + /// Port = 80, + /// Path = "/", + /// IntervalInSeconds = 30, + /// TimeoutInSeconds = 9, + /// ToleratedNumberOfFailures = 3, + /// }, + /// Tags = + /// { + /// { "environment", "Production" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/VideoAnalyzer/Analyzer.cs b/sdk/dotnet/VideoAnalyzer/Analyzer.cs index 48aa494ca8..6adce6b42b 100644 --- a/sdk/dotnet/VideoAnalyzer/Analyzer.cs +++ b/sdk/dotnet/VideoAnalyzer/Analyzer.cs @@ -14,6 +14,82 @@ namespace Pulumi.Azure.VideoAnalyzer /// /// !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `azure.videoanalyzer.Analyzer` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var contributor = new Azure.Authorization.Assignment("contributor", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Storage Blob Data Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var reader = new Azure.Authorization.Assignment("reader", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Reader", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var exampleAnalyzer = new Azure.VideoAnalyzer.Analyzer("exampleAnalyzer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccount = new Azure.VideoAnalyzer.Inputs.AnalyzerStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// UserAssignedIdentityId = exampleUserAssignedIdentity.Id, + /// }, + /// Identity = new Azure.VideoAnalyzer.Inputs.AnalyzerIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// contributor, + /// reader, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Video Analyzer can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/VideoAnalyzer/EdgeModule.cs b/sdk/dotnet/VideoAnalyzer/EdgeModule.cs index a222b3e7ed..8cbc9aad71 100644 --- a/sdk/dotnet/VideoAnalyzer/EdgeModule.cs +++ b/sdk/dotnet/VideoAnalyzer/EdgeModule.cs @@ -14,6 +14,89 @@ namespace Pulumi.Azure.VideoAnalyzer /// /// !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `azure.videoanalyzer.EdgeModule` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleAccount = new Azure.Storage.Account("exampleAccount", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AccountTier = "Standard", + /// AccountReplicationType = "GRS", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var contributor = new Azure.Authorization.Assignment("contributor", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Storage Blob Data Contributor", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var reader = new Azure.Authorization.Assignment("reader", new() + /// { + /// Scope = exampleAccount.Id, + /// RoleDefinitionName = "Reader", + /// PrincipalId = exampleUserAssignedIdentity.PrincipalId, + /// }); + /// + /// var exampleAnalyzer = new Azure.VideoAnalyzer.Analyzer("exampleAnalyzer", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// StorageAccount = new Azure.VideoAnalyzer.Inputs.AnalyzerStorageAccountArgs + /// { + /// Id = exampleAccount.Id, + /// UserAssignedIdentityId = exampleUserAssignedIdentity.Id, + /// }, + /// Identity = new Azure.VideoAnalyzer.Inputs.AnalyzerIdentityArgs + /// { + /// Type = "UserAssigned", + /// IdentityIds = new[] + /// { + /// exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// Tags = + /// { + /// { "environment", "staging" }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleUserAssignedIdentity, + /// contributor, + /// reader, + /// }, + /// }); + /// + /// var exampleEdgeModule = new Azure.VideoAnalyzer.EdgeModule("exampleEdgeModule", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VideoAnalyzerName = exampleAnalyzer.Name, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Video Analyzer Edge Module can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Voice/ServicesCommunicationsGateway.cs b/sdk/dotnet/Voice/ServicesCommunicationsGateway.cs index 010ffe06de..3fa17d19e6 100644 --- a/sdk/dotnet/Voice/ServicesCommunicationsGateway.cs +++ b/sdk/dotnet/Voice/ServicesCommunicationsGateway.cs @@ -16,6 +16,97 @@ namespace Pulumi.Azure.Voice /// /// !> **NOTE:** Access to Azure Communications Gateway is restricted, see [`Get access to Azure Communications Gateway for your Azure subscription`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#9-get-access-to-azure-communications-gateway-for-your-azure-subscription) for details. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using System.Text.Json; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var exampleServicesCommunicationsGateway = new Azure.Voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", new() + /// { + /// Location = "West Europe", + /// ResourceGroupName = exampleResourceGroup.Name, + /// Connectivity = "PublicAddress", + /// Codecs = "PCMA", + /// E911Type = "DirectToEsrp", + /// Platforms = new[] + /// { + /// "OperatorConnect", + /// "TeamsPhoneMobile", + /// }, + /// ServiceLocations = new[] + /// { + /// new Azure.Voice.Inputs.ServicesCommunicationsGatewayServiceLocationArgs + /// { + /// Location = "eastus", + /// AllowedMediaSourceAddressPrefixes = new[] + /// { + /// "10.1.2.0/24", + /// }, + /// AllowedSignalingSourceAddressPrefixes = new[] + /// { + /// "10.1.1.0/24", + /// }, + /// EsrpAddresses = new[] + /// { + /// "198.51.100.3", + /// }, + /// OperatorAddresses = new[] + /// { + /// "198.51.100.1", + /// }, + /// }, + /// new Azure.Voice.Inputs.ServicesCommunicationsGatewayServiceLocationArgs + /// { + /// Location = "eastus2", + /// AllowedMediaSourceAddressPrefixes = new[] + /// { + /// "10.2.2.0/24", + /// }, + /// AllowedSignalingSourceAddressPrefixes = new[] + /// { + /// "10.2.1.0/24", + /// }, + /// EsrpAddresses = new[] + /// { + /// "198.51.100.4", + /// }, + /// OperatorAddresses = new[] + /// { + /// "198.51.100.2", + /// }, + /// }, + /// }, + /// AutoGeneratedDomainNameLabelScope = "SubscriptionReuse", + /// ApiBridge = JsonSerializer.Serialize(new Dictionary<string, object?> + /// { + /// }), + /// EmergencyDialStrings = new[] + /// { + /// "911", + /// "933", + /// }, + /// OnPremMcpEnabled = false, + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// MicrosoftTeamsVoicemailPilotNumber = "1", + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Voice Services Communications Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Voice/ServicesCommunicationsGatewayTestLine.cs b/sdk/dotnet/Voice/ServicesCommunicationsGatewayTestLine.cs index 8f33dd3713..02cdb61fae 100644 --- a/sdk/dotnet/Voice/ServicesCommunicationsGatewayTestLine.cs +++ b/sdk/dotnet/Voice/ServicesCommunicationsGatewayTestLine.cs @@ -12,6 +12,41 @@ namespace Pulumi.Azure.Voice /// /// Manages a Voice Services Communications Gateway Test Line. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Central US", + /// }); + /// + /// var exampleServicesCommunicationsGateway = new Azure.Voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// }); + /// + /// var exampleServicesCommunicationsGatewayTestLine = new Azure.Voice.ServicesCommunicationsGatewayTestLine("exampleServicesCommunicationsGatewayTestLine", new() + /// { + /// Location = "West Central US", + /// VoiceServicesCommunicationsGatewayId = exampleServicesCommunicationsGateway.Id, + /// PhoneNumber = "123456789", + /// Purpose = "Automated", + /// Tags = + /// { + /// { "key", "value" }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Voice Services Communications Gateway Test Line can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/Waf/GetFirewallPolicy.cs b/sdk/dotnet/Waf/GetFirewallPolicy.cs index e4d85b37b5..12699c3128 100644 --- a/sdk/dotnet/Waf/GetFirewallPolicy.cs +++ b/sdk/dotnet/Waf/GetFirewallPolicy.cs @@ -13,12 +13,66 @@ public static class GetFirewallPolicy { /// /// Use this data source to access information about an existing Web Application Firewall Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Waf.GetFirewallPolicy.Invoke(new() + /// { + /// ResourceGroupName = "existing", + /// Name = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFirewallPolicyResult => getFirewallPolicyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetFirewallPolicyArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:waf/getFirewallPolicy:getFirewallPolicy", args ?? new GetFirewallPolicyArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Web Application Firewall Policy. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.Waf.GetFirewallPolicy.Invoke(new() + /// { + /// ResourceGroupName = "existing", + /// Name = "existing", + /// }); + /// + /// return new Dictionary<string, object?> + /// { + /// ["id"] = example.Apply(getFirewallPolicyResult => getFirewallPolicyResult.Id), + /// }; + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetFirewallPolicyInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:waf/getFirewallPolicy:getFirewallPolicy", args ?? new GetFirewallPolicyInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/Waf/Policy.cs b/sdk/dotnet/Waf/Policy.cs index bc91e82a6c..825251944d 100644 --- a/sdk/dotnet/Waf/Policy.cs +++ b/sdk/dotnet/Waf/Policy.cs @@ -12,6 +12,159 @@ namespace Pulumi.Azure.Waf /// /// Manages a Azure Web Application Firewall Policy instance. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "West Europe", + /// }); + /// + /// var examplePolicy = new Azure.Waf.Policy("examplePolicy", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// CustomRules = new[] + /// { + /// new Azure.Waf.Inputs.PolicyCustomRuleArgs + /// { + /// Name = "Rule1", + /// Priority = 1, + /// RuleType = "MatchRule", + /// MatchConditions = new[] + /// { + /// new Azure.Waf.Inputs.PolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariables = new[] + /// { + /// new Azure.Waf.Inputs.PolicyCustomRuleMatchConditionMatchVariableArgs + /// { + /// VariableName = "RemoteAddr", + /// }, + /// }, + /// Operator = "IPMatch", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "192.168.1.0/24", + /// "10.0.0.0/24", + /// }, + /// }, + /// }, + /// Action = "Block", + /// }, + /// new Azure.Waf.Inputs.PolicyCustomRuleArgs + /// { + /// Name = "Rule2", + /// Priority = 2, + /// RuleType = "MatchRule", + /// MatchConditions = new[] + /// { + /// new Azure.Waf.Inputs.PolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariables = new[] + /// { + /// new Azure.Waf.Inputs.PolicyCustomRuleMatchConditionMatchVariableArgs + /// { + /// VariableName = "RemoteAddr", + /// }, + /// }, + /// Operator = "IPMatch", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "192.168.1.0/24", + /// }, + /// }, + /// new Azure.Waf.Inputs.PolicyCustomRuleMatchConditionArgs + /// { + /// MatchVariables = new[] + /// { + /// new Azure.Waf.Inputs.PolicyCustomRuleMatchConditionMatchVariableArgs + /// { + /// VariableName = "RequestHeaders", + /// Selector = "UserAgent", + /// }, + /// }, + /// Operator = "Contains", + /// NegationCondition = false, + /// MatchValues = new[] + /// { + /// "Windows", + /// }, + /// }, + /// }, + /// Action = "Block", + /// }, + /// }, + /// PolicySettings = new Azure.Waf.Inputs.PolicyPolicySettingsArgs + /// { + /// Enabled = true, + /// Mode = "Prevention", + /// RequestBodyCheck = true, + /// FileUploadLimitInMb = 100, + /// MaxRequestBodySizeInKb = 128, + /// }, + /// ManagedRules = new Azure.Waf.Inputs.PolicyManagedRulesArgs + /// { + /// Exclusions = new[] + /// { + /// new Azure.Waf.Inputs.PolicyManagedRulesExclusionArgs + /// { + /// MatchVariable = "RequestHeaderNames", + /// Selector = "x-company-secret-header", + /// SelectorMatchOperator = "Equals", + /// }, + /// new Azure.Waf.Inputs.PolicyManagedRulesExclusionArgs + /// { + /// MatchVariable = "RequestCookieNames", + /// Selector = "too-tasty", + /// SelectorMatchOperator = "EndsWith", + /// }, + /// }, + /// ManagedRuleSets = new[] + /// { + /// new Azure.Waf.Inputs.PolicyManagedRulesManagedRuleSetArgs + /// { + /// Type = "OWASP", + /// Version = "3.2", + /// RuleGroupOverrides = new[] + /// { + /// new Azure.Waf.Inputs.PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs + /// { + /// RuleGroupName = "REQUEST-920-PROTOCOL-ENFORCEMENT", + /// Rules = new[] + /// { + /// new Azure.Waf.Inputs.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs + /// { + /// Id = "920300", + /// Enabled = true, + /// Action = "Log", + /// }, + /// new Azure.Waf.Inputs.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs + /// { + /// Id = "920440", + /// Enabled = true, + /// Action = "Block", + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/WebPubSub/GetPrivateLinkResource.cs b/sdk/dotnet/WebPubSub/GetPrivateLinkResource.cs index 0208b543e3..c34ccdb92d 100644 --- a/sdk/dotnet/WebPubSub/GetPrivateLinkResource.cs +++ b/sdk/dotnet/WebPubSub/GetPrivateLinkResource.cs @@ -13,12 +13,82 @@ public static class GetPrivateLinkResource { /// /// Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testResourceGroup = new Azure.Core.ResourceGroup("testResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var testService = new Azure.WebPubSub.Service("testService", new() + /// { + /// Location = testResourceGroup.Location, + /// ResourceGroupName = testResourceGroup.Name, + /// Sku = "Standard_S1", + /// Capacity = 1, + /// }); + /// + /// var testPrivateLinkResource = Azure.WebPubSub.GetPrivateLinkResource.Invoke(new() + /// { + /// WebPubsubId = testService.Id, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetPrivateLinkResourceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:webpubsub/getPrivateLinkResource:getPrivateLinkResource", args ?? new GetPrivateLinkResourceArgs(), options.WithDefaults()); /// /// Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var testResourceGroup = new Azure.Core.ResourceGroup("testResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var testService = new Azure.WebPubSub.Service("testService", new() + /// { + /// Location = testResourceGroup.Location, + /// ResourceGroupName = testResourceGroup.Name, + /// Sku = "Standard_S1", + /// Capacity = 1, + /// }); + /// + /// var testPrivateLinkResource = Azure.WebPubSub.GetPrivateLinkResource.Invoke(new() + /// { + /// WebPubsubId = testService.Id, + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetPrivateLinkResourceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:webpubsub/getPrivateLinkResource:getPrivateLinkResource", args ?? new GetPrivateLinkResourceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/WebPubSub/GetService.cs b/sdk/dotnet/WebPubSub/GetService.cs index 948ad14e8b..d5191b3b3a 100644 --- a/sdk/dotnet/WebPubSub/GetService.cs +++ b/sdk/dotnet/WebPubSub/GetService.cs @@ -13,12 +13,58 @@ public static class GetService { /// /// Use this data source to access information about an existing Azure Web Pubsub service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.WebPubSub.GetService.Invoke(new() + /// { + /// Name = "test-webpubsub", + /// ResourceGroupName = "wps-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Task InvokeAsync(GetServiceArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync("azure:webpubsub/getService:getService", args ?? new GetServiceArgs(), options.WithDefaults()); /// /// Use this data source to access information about an existing Azure Web Pubsub service. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Azure.WebPubSub.GetService.Invoke(new() + /// { + /// Name = "test-webpubsub", + /// ResourceGroupName = "wps-resource-group", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} /// public static Output Invoke(GetServiceInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("azure:webpubsub/getService:getService", args ?? new GetServiceInvokeArgs(), options.WithDefaults()); diff --git a/sdk/dotnet/WebPubSub/Hub.cs b/sdk/dotnet/WebPubSub/Hub.cs index 20a2433888..f8b0c13275 100644 --- a/sdk/dotnet/WebPubSub/Hub.cs +++ b/sdk/dotnet/WebPubSub/Hub.cs @@ -12,6 +12,119 @@ namespace Pulumi.Azure.WebPubSub /// /// Manages the hub settings for a Web Pubsub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("exampleUserAssignedIdentity", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// }); + /// + /// var exampleService = new Azure.WebPubSub.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard_S1", + /// Capacity = 1, + /// }); + /// + /// var exampleHub = new Azure.WebPubSub.Hub("exampleHub", new() + /// { + /// WebPubsubId = exampleService.Id, + /// EventHandlers = new[] + /// { + /// new Azure.WebPubSub.Inputs.HubEventHandlerArgs + /// { + /// UrlTemplate = "https://test.com/api/{hub}/{event}", + /// UserEventPattern = "*", + /// SystemEvents = new[] + /// { + /// "connect", + /// "connected", + /// }, + /// }, + /// new Azure.WebPubSub.Inputs.HubEventHandlerArgs + /// { + /// UrlTemplate = "https://test.com/api/{hub}/{event}", + /// UserEventPattern = "event1, event2", + /// SystemEvents = new[] + /// { + /// "connected", + /// }, + /// Auth = new Azure.WebPubSub.Inputs.HubEventHandlerAuthArgs + /// { + /// ManagedIdentityId = exampleUserAssignedIdentity.Id, + /// }, + /// }, + /// }, + /// EventListeners = new[] + /// { + /// new Azure.WebPubSub.Inputs.HubEventListenerArgs + /// { + /// SystemEventNameFilters = new[] + /// { + /// "connected", + /// }, + /// UserEventNameFilters = new[] + /// { + /// "event1", + /// "event2", + /// }, + /// EventhubNamespaceName = azurerm_eventhub_namespace.Test.Name, + /// EventhubName = azurerm_eventhub.Test1.Name, + /// }, + /// new Azure.WebPubSub.Inputs.HubEventListenerArgs + /// { + /// SystemEventNameFilters = new[] + /// { + /// "connected", + /// }, + /// UserEventNameFilters = new[] + /// { + /// "*", + /// }, + /// EventhubNamespaceName = azurerm_eventhub_namespace.Test.Name, + /// EventhubName = azurerm_eventhub.Test1.Name, + /// }, + /// new Azure.WebPubSub.Inputs.HubEventListenerArgs + /// { + /// SystemEventNameFilters = new[] + /// { + /// "connected", + /// }, + /// UserEventNameFilters = new[] + /// { + /// "event1", + /// }, + /// EventhubNamespaceName = azurerm_eventhub_namespace.Test.Name, + /// EventhubName = azurerm_eventhub.Test1.Name, + /// }, + /// }, + /// AnonymousConnectionsEnabled = true, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleService, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Web Pubsub Hub can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/WebPubSub/NetworkAcl.cs b/sdk/dotnet/WebPubSub/NetworkAcl.cs index 54556765d7..c02a174208 100644 --- a/sdk/dotnet/WebPubSub/NetworkAcl.cs +++ b/sdk/dotnet/WebPubSub/NetworkAcl.cs @@ -12,6 +12,101 @@ namespace Pulumi.Azure.WebPubSub /// /// Manages the Network ACL for a Web Pubsub. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleService = new Azure.WebPubSub.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard_S1", + /// Capacity = 1, + /// }); + /// + /// var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// AddressSpaces = new[] + /// { + /// "10.5.0.0/16", + /// }, + /// }); + /// + /// var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// VirtualNetworkName = exampleVirtualNetwork.Name, + /// AddressPrefixes = new[] + /// { + /// "10.5.2.0/24", + /// }, + /// EnforcePrivateLinkEndpointNetworkPolicies = true, + /// }); + /// + /// var exampleEndpoint = new Azure.PrivateLink.Endpoint("exampleEndpoint", new() + /// { + /// ResourceGroupName = exampleResourceGroup.Name, + /// Location = exampleResourceGroup.Location, + /// SubnetId = exampleSubnet.Id, + /// PrivateServiceConnection = new Azure.PrivateLink.Inputs.EndpointPrivateServiceConnectionArgs + /// { + /// Name = "psc-sig-test", + /// IsManualConnection = false, + /// PrivateConnectionResourceId = exampleService.Id, + /// SubresourceNames = new[] + /// { + /// "webpubsub", + /// }, + /// }, + /// }); + /// + /// var exampleNetworkAcl = new Azure.WebPubSub.NetworkAcl("exampleNetworkAcl", new() + /// { + /// WebPubsubId = exampleService.Id, + /// DefaultAction = "Allow", + /// PublicNetwork = new Azure.WebPubSub.Inputs.NetworkAclPublicNetworkArgs + /// { + /// DeniedRequestTypes = new[] + /// { + /// "ClientConnection", + /// }, + /// }, + /// PrivateEndpoints = new[] + /// { + /// new Azure.WebPubSub.Inputs.NetworkAclPrivateEndpointArgs + /// { + /// Id = exampleEndpoint.Id, + /// DeniedRequestTypes = new[] + /// { + /// "RESTAPI", + /// "ClientConnection", + /// }, + /// }, + /// }, + /// }, new CustomResourceOptions + /// { + /// DependsOn = new[] + /// { + /// exampleEndpoint, + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Network ACLs for a Web Pubsub service can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/WebPubSub/Service.cs b/sdk/dotnet/WebPubSub/Service.cs index b9016c652c..2fb751abf6 100644 --- a/sdk/dotnet/WebPubSub/Service.cs +++ b/sdk/dotnet/WebPubSub/Service.cs @@ -12,6 +12,43 @@ namespace Pulumi.Azure.WebPubSub /// /// Manages an Azure Web PubSub Service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleService = new Azure.WebPubSub.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard_S1", + /// Capacity = 1, + /// PublicNetworkAccessEnabled = false, + /// LiveTrace = new Azure.WebPubSub.Inputs.ServiceLiveTraceArgs + /// { + /// Enabled = true, + /// MessagingLogsEnabled = true, + /// ConnectivityLogsEnabled = false, + /// }, + /// Identity = new Azure.WebPubSub.Inputs.ServiceIdentityArgs + /// { + /// Type = "SystemAssigned", + /// }, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Web PubSub services can be imported using the `resource id`, e.g. diff --git a/sdk/dotnet/WebPubSub/SharedPrivateLinkResource.cs b/sdk/dotnet/WebPubSub/SharedPrivateLinkResource.cs index caa0c89c7b..830d097b2e 100644 --- a/sdk/dotnet/WebPubSub/SharedPrivateLinkResource.cs +++ b/sdk/dotnet/WebPubSub/SharedPrivateLinkResource.cs @@ -12,6 +12,70 @@ namespace Pulumi.Azure.WebPubSub /// /// Manages the Shared Private Link Resource for a Web Pubsub service. /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Azure = Pulumi.Azure; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var current = Azure.Core.GetClientConfig.Invoke(); + /// + /// var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new() + /// { + /// Location = "east us", + /// }); + /// + /// var exampleKeyVault = new Azure.KeyVault.KeyVault("exampleKeyVault", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// SkuName = "standard", + /// SoftDeleteRetentionDays = 7, + /// AccessPolicies = new[] + /// { + /// new Azure.KeyVault.Inputs.KeyVaultAccessPolicyArgs + /// { + /// TenantId = current.Apply(getClientConfigResult => getClientConfigResult.TenantId), + /// ObjectId = current.Apply(getClientConfigResult => getClientConfigResult.ObjectId), + /// CertificatePermissions = new[] + /// { + /// "managecontacts", + /// }, + /// KeyPermissions = new[] + /// { + /// "create", + /// }, + /// SecretPermissions = new[] + /// { + /// "set", + /// }, + /// }, + /// }, + /// }); + /// + /// var exampleService = new Azure.WebPubSub.Service("exampleService", new() + /// { + /// Location = exampleResourceGroup.Location, + /// ResourceGroupName = exampleResourceGroup.Name, + /// Sku = "Standard_S1", + /// Capacity = 1, + /// }); + /// + /// var exampleSharedPrivateLinkResource = new Azure.WebPubSub.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", new() + /// { + /// WebPubsubId = exampleService.Id, + /// SubresourceName = "vault", + /// TargetResourceId = exampleKeyVault.Id, + /// }); + /// + /// }); + /// ``` + /// /// ## Import /// /// Web Pubsub Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/aadb2c/directory.go b/sdk/go/azure/aadb2c/directory.go index 3eee9139c8..5857cbd561 100644 --- a/sdk/go/azure/aadb2c/directory.go +++ b/sdk/go/azure/aadb2c/directory.go @@ -15,6 +15,37 @@ import ( // Manages an AAD B2C Directory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/aadb2c" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := aadb2c.NewDirectory(ctx, "example", &aadb2c.DirectoryArgs{ +// CountryCode: pulumi.String("US"), +// DataResidencyLocation: pulumi.String("United States"), +// DisplayName: pulumi.String("example-b2c-tenant"), +// DomainName: pulumi.String("exampleb2ctenant.onmicrosoft.com"), +// ResourceGroupName: pulumi.String("example-rg"), +// SkuName: pulumi.String("PremiumP1"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // AAD B2C Directories can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/aadb2c/getDirectory.go b/sdk/go/azure/aadb2c/getDirectory.go index 75e4175028..55feafb2e7 100644 --- a/sdk/go/azure/aadb2c/getDirectory.go +++ b/sdk/go/azure/aadb2c/getDirectory.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing AAD B2C Directory. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/aadb2c" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := aadb2c.LookupDirectory(ctx, &aadb2c.LookupDirectoryArgs{ +// ResourceGroupName: "example-rg", +// DomainName: "exampleb2ctenant.onmicrosoft.com", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("tenantId", example.TenantId) +// return nil +// }) +// } +// +// ``` func LookupDirectory(ctx *pulumi.Context, args *LookupDirectoryArgs, opts ...pulumi.InvokeOption) (*LookupDirectoryResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDirectoryResult diff --git a/sdk/go/azure/advisor/getRecommendations.go b/sdk/go/azure/advisor/getRecommendations.go index 0920009d1c..e21cbca2e5 100644 --- a/sdk/go/azure/advisor/getRecommendations.go +++ b/sdk/go/azure/advisor/getRecommendations.go @@ -13,6 +13,39 @@ import ( ) // Use this data source to access information about an existing Advisor Recommendations. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/advisor" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := advisor.GetRecommendations(ctx, &advisor.GetRecommendationsArgs{ +// FilterByCategories: []string{ +// "security", +// "cost", +// }, +// FilterByResourceGroups: []string{ +// "example-resgroups", +// }, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("recommendations", example.Recommendations) +// return nil +// }) +// } +// +// ``` func GetRecommendations(ctx *pulumi.Context, args *GetRecommendationsArgs, opts ...pulumi.InvokeOption) (*GetRecommendationsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRecommendationsResult diff --git a/sdk/go/azure/analysisservices/server.go b/sdk/go/azure/analysisservices/server.go index 8a1e51afd3..77df8958fb 100644 --- a/sdk/go/azure/analysisservices/server.go +++ b/sdk/go/azure/analysisservices/server.go @@ -15,6 +15,57 @@ import ( // Manages an Analysis Services Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/analysisservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = analysisservices.NewServer(ctx, "server", &analysisservices.ServerArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: pulumi.String("S0"), +// AdminUsers: pulumi.StringArray{ +// pulumi.String("myuser@domain.tld"), +// }, +// EnablePowerBiService: pulumi.Bool(true), +// Ipv4FirewallRules: analysisservices.ServerIpv4FirewallRuleArray{ +// &analysisservices.ServerIpv4FirewallRuleArgs{ +// Name: pulumi.String("myRule1"), +// RangeStart: pulumi.String("210.117.252.0"), +// RangeEnd: pulumi.String("210.117.252.255"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "abc": pulumi.String("123"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// > **NOTE:** The server resource will automatically be started and stopped during an update if it is in `paused` state. +// // ## Import // // Analysis Services Server can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/api.go b/sdk/go/azure/apimanagement/api.go index 499a580d2d..a6e63f1a57 100644 --- a/sdk/go/azure/apimanagement/api.go +++ b/sdk/go/azure/apimanagement/api.go @@ -15,6 +15,60 @@ import ( // Manages an API within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApi(ctx, "exampleApi", &apimanagement.ApiArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// Revision: pulumi.String("1"), +// DisplayName: pulumi.String("Example API"), +// Path: pulumi.String("example"), +// Protocols: pulumi.StringArray{ +// pulumi.String("https"), +// }, +// Import: &apimanagement.ApiImportArgs{ +// ContentFormat: pulumi.String("swagger-link-json"), +// ContentValue: pulumi.String("http://conferenceapi.azurewebsites.net/?format=json"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiDiagnostic.go b/sdk/go/azure/apimanagement/apiDiagnostic.go index 264e04b3da..fffec7286f 100644 --- a/sdk/go/azure/apimanagement/apiDiagnostic.go +++ b/sdk/go/azure/apimanagement/apiDiagnostic.go @@ -15,6 +15,126 @@ import ( // Manages a API Management Service API Diagnostics Logs. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@mycompany.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleApi, err := apimanagement.NewApi(ctx, "exampleApi", &apimanagement.ApiArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// Revision: pulumi.String("1"), +// DisplayName: pulumi.String("Example API"), +// Path: pulumi.String("example"), +// Protocols: pulumi.StringArray{ +// pulumi.String("https"), +// }, +// Import: &apimanagement.ApiImportArgs{ +// ContentFormat: pulumi.String("swagger-link-json"), +// ContentValue: pulumi.String("http://conferenceapi.azurewebsites.net/?format=json"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleLogger, err := apimanagement.NewLogger(ctx, "exampleLogger", &apimanagement.LoggerArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsights: &apimanagement.LoggerApplicationInsightsArgs{ +// InstrumentationKey: exampleInsights.InstrumentationKey, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiDiagnostic(ctx, "exampleApiDiagnostic", &apimanagement.ApiDiagnosticArgs{ +// Identifier: pulumi.String("applicationinsights"), +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// ApiName: exampleApi.Name, +// ApiManagementLoggerId: exampleLogger.ID(), +// SamplingPercentage: pulumi.Float64(5), +// AlwaysLogErrors: pulumi.Bool(true), +// LogClientIp: pulumi.Bool(true), +// Verbosity: pulumi.String("verbose"), +// HttpCorrelationProtocol: pulumi.String("W3C"), +// FrontendRequest: &apimanagement.ApiDiagnosticFrontendRequestArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("accept"), +// pulumi.String("origin"), +// }, +// }, +// FrontendResponse: &apimanagement.ApiDiagnosticFrontendResponseArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("content-length"), +// pulumi.String("origin"), +// }, +// }, +// BackendRequest: &apimanagement.ApiDiagnosticBackendRequestArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("accept"), +// pulumi.String("origin"), +// }, +// }, +// BackendResponse: &apimanagement.ApiDiagnosticBackendResponseArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("content-length"), +// pulumi.String("origin"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Service API Diagnostics Logs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiOperation.go b/sdk/go/azure/apimanagement/apiOperation.go index c81d4c548d..b497dec61d 100644 --- a/sdk/go/azure/apimanagement/apiOperation.go +++ b/sdk/go/azure/apimanagement/apiOperation.go @@ -15,6 +15,53 @@ import ( // Manages an API Operation within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{ +// Name: "search-api", +// ApiManagementName: "search-api-management", +// ResourceGroupName: "search-service", +// Revision: "2", +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiOperation(ctx, "exampleApiOperation", &apimanagement.ApiOperationArgs{ +// OperationId: pulumi.String("user-delete"), +// ApiName: *pulumi.String(exampleApi.Name), +// ApiManagementName: *pulumi.String(exampleApi.ApiManagementName), +// ResourceGroupName: *pulumi.String(exampleApi.ResourceGroupName), +// DisplayName: pulumi.String("Delete User Operation"), +// Method: pulumi.String("DELETE"), +// UrlTemplate: pulumi.String("/users/{id}/delete"), +// Description: pulumi.String("This can only be done by the logged in user."), +// Responses: apimanagement.ApiOperationResponseArray{ +// &apimanagement.ApiOperationResponseArgs{ +// StatusCode: pulumi.Int(200), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Operation's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiOperationPolicy.go b/sdk/go/azure/apimanagement/apiOperationPolicy.go index 10e850171d..7898f60a51 100644 --- a/sdk/go/azure/apimanagement/apiOperationPolicy.go +++ b/sdk/go/azure/apimanagement/apiOperationPolicy.go @@ -15,6 +15,80 @@ import ( // Manages an API Management API Operation Policy // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleApi, err := apimanagement.NewApi(ctx, "exampleApi", &apimanagement.ApiArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// Revision: pulumi.String("1"), +// }) +// if err != nil { +// return err +// } +// exampleApiOperation, err := apimanagement.NewApiOperation(ctx, "exampleApiOperation", &apimanagement.ApiOperationArgs{ +// OperationId: pulumi.String("acctest-operation"), +// ApiName: exampleApi.Name, +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// DisplayName: pulumi.String("DELETE Resource"), +// Method: pulumi.String("DELETE"), +// UrlTemplate: pulumi.String("/resource"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiOperationPolicy(ctx, "exampleApiOperationPolicy", &apimanagement.ApiOperationPolicyArgs{ +// ApiName: exampleApiOperation.ApiName, +// ApiManagementName: exampleApiOperation.ApiManagementName, +// ResourceGroupName: exampleApiOperation.ResourceGroupName, +// OperationId: exampleApiOperation.OperationId, +// XmlContent: pulumi.String(` +// +// +// +// +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Operation Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiOperationTag.go b/sdk/go/azure/apimanagement/apiOperationTag.go index 9533e8cd1f..a32c689822 100644 --- a/sdk/go/azure/apimanagement/apiOperationTag.go +++ b/sdk/go/azure/apimanagement/apiOperationTag.go @@ -15,6 +15,60 @@ import ( // Manages a API Management API Operation Tag. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{ +// Name: "search-api", +// ApiManagementName: "search-api-management", +// ResourceGroupName: "search-service", +// Revision: "2", +// }, nil) +// if err != nil { +// return err +// } +// exampleApiOperation, err := apimanagement.NewApiOperation(ctx, "exampleApiOperation", &apimanagement.ApiOperationArgs{ +// OperationId: pulumi.String("user-delete"), +// ApiName: *pulumi.String(exampleApi.Name), +// ApiManagementName: *pulumi.String(exampleApi.ApiManagementName), +// ResourceGroupName: *pulumi.String(exampleApi.ResourceGroupName), +// DisplayName: pulumi.String("Delete User Operation"), +// Method: pulumi.String("DELETE"), +// UrlTemplate: pulumi.String("/users/{id}/delete"), +// Description: pulumi.String("This can only be done by the logged in user."), +// Responses: apimanagement.ApiOperationResponseArray{ +// &apimanagement.ApiOperationResponseArgs{ +// StatusCode: pulumi.Int(200), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiOperationTag(ctx, "exampleApiOperationTag", &apimanagement.ApiOperationTagArgs{ +// ApiOperationId: exampleApiOperation.ID(), +// DisplayName: pulumi.String("example-Tag"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Operation Tags can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiPolicy.go b/sdk/go/azure/apimanagement/apiPolicy.go index c882b5a64b..263144c3ee 100644 --- a/sdk/go/azure/apimanagement/apiPolicy.go +++ b/sdk/go/azure/apimanagement/apiPolicy.go @@ -15,6 +15,51 @@ import ( // Manages an API Management API Policy // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{ +// Name: "my-api", +// ApiManagementName: "example-apim", +// ResourceGroupName: "search-service", +// Revision: "2", +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiPolicy(ctx, "exampleApiPolicy", &apimanagement.ApiPolicyArgs{ +// ApiName: *pulumi.String(exampleApi.Name), +// ApiManagementName: *pulumi.String(exampleApi.ApiManagementName), +// ResourceGroupName: *pulumi.String(exampleApi.ResourceGroupName), +// XmlContent: pulumi.String(` +// +// +// +// +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiRelease.go b/sdk/go/azure/apimanagement/apiRelease.go index 8b9d66c503..69f50f2c19 100644 --- a/sdk/go/azure/apimanagement/apiRelease.go +++ b/sdk/go/azure/apimanagement/apiRelease.go @@ -15,6 +15,66 @@ import ( // Manages a API Management API Release. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleApi, err := apimanagement.NewApi(ctx, "exampleApi", &apimanagement.ApiArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// Revision: pulumi.String("1"), +// DisplayName: pulumi.String("Example API"), +// Path: pulumi.String("example"), +// Protocols: pulumi.StringArray{ +// pulumi.String("https"), +// }, +// Import: &apimanagement.ApiImportArgs{ +// ContentFormat: pulumi.String("swagger-link-json"), +// ContentValue: pulumi.String("http://conferenceapi.azurewebsites.net/?format=json"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiRelease(ctx, "exampleApiRelease", &apimanagement.ApiReleaseArgs{ +// ApiId: exampleApi.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Releases can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiSchema.go b/sdk/go/azure/apimanagement/apiSchema.go index 7bc72f496c..98a5a420c6 100644 --- a/sdk/go/azure/apimanagement/apiSchema.go +++ b/sdk/go/azure/apimanagement/apiSchema.go @@ -15,6 +15,56 @@ import ( // Manages an API Schema within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{ +// Name: "search-api", +// ApiManagementName: "search-api-management", +// ResourceGroupName: "search-service", +// Revision: "2", +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiSchema(ctx, "exampleApiSchema", &apimanagement.ApiSchemaArgs{ +// ApiName: *pulumi.String(exampleApi.Name), +// ApiManagementName: *pulumi.String(exampleApi.ApiManagementName), +// ResourceGroupName: *pulumi.String(exampleApi.ResourceGroupName), +// SchemaId: pulumi.String("example-schema"), +// ContentType: pulumi.String("application/vnd.ms-azure-apim.xsd+xml"), +// Value: readFileOrPanic("api_management_api_schema.xml"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiTag.go b/sdk/go/azure/apimanagement/apiTag.go index cf986ca7f5..96c9e38bc6 100644 --- a/sdk/go/azure/apimanagement/apiTag.go +++ b/sdk/go/azure/apimanagement/apiTag.go @@ -15,6 +15,61 @@ import ( // Manages the Assignment of an API Management API Tag to an API. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService := apimanagement.LookupServiceOutput(ctx, apimanagement.GetServiceOutputArgs{ +// Name: pulumi.String("example-apim"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleApi, err := apimanagement.NewApi(ctx, "exampleApi", &apimanagement.ApiArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.ApplyT(func(exampleService apimanagement.GetServiceResult) (*string, error) { +// return &exampleService.Name, nil +// }).(pulumi.StringPtrOutput), +// Revision: pulumi.String("1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewTag(ctx, "exampleTag", &apimanagement.TagArgs{ +// ApiManagementId: exampleService.ApplyT(func(exampleService apimanagement.GetServiceResult) (*string, error) { +// return &exampleService.Id, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiTag(ctx, "exampleApiTag", &apimanagement.ApiTagArgs{ +// ApiId: exampleApi.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Tags can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/apiVersionSet.go b/sdk/go/azure/apimanagement/apiVersionSet.go index b1fe36311c..dc6a4044b9 100644 --- a/sdk/go/azure/apimanagement/apiVersionSet.go +++ b/sdk/go/azure/apimanagement/apiVersionSet.go @@ -15,6 +15,52 @@ import ( // Manages an API Version Set within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewApiVersionSet(ctx, "exampleApiVersionSet", &apimanagement.ApiVersionSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// DisplayName: pulumi.String("ExampleAPIVersionSet"), +// VersioningScheme: pulumi.String("Segment"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Version Set can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/authorizationServer.go b/sdk/go/azure/apimanagement/authorizationServer.go index a8bc5c6017..364aaae818 100644 --- a/sdk/go/azure/apimanagement/authorizationServer.go +++ b/sdk/go/azure/apimanagement/authorizationServer.go @@ -15,6 +15,50 @@ import ( // Manages an Authorization Server within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "search-api", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewAuthorizationServer(ctx, "exampleAuthorizationServer", &apimanagement.AuthorizationServerArgs{ +// ApiManagementName: *pulumi.String(exampleService.Name), +// ResourceGroupName: *pulumi.String(exampleService.ResourceGroupName), +// DisplayName: pulumi.String("Test Server"), +// AuthorizationEndpoint: pulumi.String("https://example.mydomain.com/client/authorize"), +// ClientId: pulumi.String("42424242-4242-4242-4242-424242424242"), +// ClientRegistrationEndpoint: pulumi.String("https://example.mydomain.com/client/register"), +// GrantTypes: pulumi.StringArray{ +// pulumi.String("authorizationCode"), +// }, +// AuthorizationMethods: pulumi.StringArray{ +// pulumi.String("GET"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Authorization Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/backend.go b/sdk/go/azure/apimanagement/backend.go index 31658a963c..8fae15f068 100644 --- a/sdk/go/azure/apimanagement/backend.go +++ b/sdk/go/azure/apimanagement/backend.go @@ -15,6 +15,52 @@ import ( // Manages a backend within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewBackend(ctx, "exampleBackend", &apimanagement.BackendArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// Protocol: pulumi.String("http"), +// Url: pulumi.String("https://backend"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management backends can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/certificate.go b/sdk/go/azure/apimanagement/certificate.go index b10948d7e4..cd88d48005 100644 --- a/sdk/go/azure/apimanagement/certificate.go +++ b/sdk/go/azure/apimanagement/certificate.go @@ -16,6 +16,175 @@ import ( // Manages an Certificate within an API Management Service. // // ## Example Usage +// ### With Base64 Certificate) +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewCertificate(ctx, "exampleCertificate", &apimanagement.CertificateArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Data: filebase64OrPanic("example.pfx"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Key Vault Certificate) +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// Identity: &apimanagement.ServiceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "exampleAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleService.Identity.ApplyT(func(identity apimanagement.ServiceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Certificate: &keyvault.CertificateCertificateArgs{ +// Contents: filebase64OrPanic("example_cert.pfx"), +// Password: pulumi.String("terraform"), +// }, +// CertificatePolicy: &keyvault.CertificateCertificatePolicyArgs{ +// IssuerParameters: &keyvault.CertificateCertificatePolicyIssuerParametersArgs{ +// Name: pulumi.String("Self"), +// }, +// KeyProperties: &keyvault.CertificateCertificatePolicyKeyPropertiesArgs{ +// Exportable: pulumi.Bool(true), +// KeySize: pulumi.Int(2048), +// KeyType: pulumi.String("RSA"), +// ReuseKey: pulumi.Bool(false), +// }, +// SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{ +// ContentType: pulumi.String("application/x-pkcs12"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewCertificate(ctx, "exampleApimanagement/certificateCertificate", &apimanagement.CertificateArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// KeyVaultSecretId: exampleCertificate.SecretId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/apimanagement/customDomain.go b/sdk/go/azure/apimanagement/customDomain.go index 0d7e4f202d..d9c65b42a0 100644 --- a/sdk/go/azure/apimanagement/customDomain.go +++ b/sdk/go/azure/apimanagement/customDomain.go @@ -19,6 +19,117 @@ import ( // // > **Note:** It's possible to define Custom Domains both within the `apimanagement.Service` resource via the `hostnameConfigurations` block and by using this resource. However it's not possible to use both methods to manage Custom Domains within an API Management Service, since there will be conflicts. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{ +// Name: "mykeyvault", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: *pulumi.String(exampleKeyVault.Id), +// CertificatePolicy: &keyvault.CertificateCertificatePolicyArgs{ +// IssuerParameters: &keyvault.CertificateCertificatePolicyIssuerParametersArgs{ +// Name: pulumi.String("Self"), +// }, +// KeyProperties: &keyvault.CertificateCertificatePolicyKeyPropertiesArgs{ +// Exportable: pulumi.Bool(true), +// KeySize: pulumi.Int(2048), +// KeyType: pulumi.String("RSA"), +// ReuseKey: pulumi.Bool(true), +// }, +// LifetimeActions: keyvault.CertificateCertificatePolicyLifetimeActionArray{ +// &keyvault.CertificateCertificatePolicyLifetimeActionArgs{ +// Action: &keyvault.CertificateCertificatePolicyLifetimeActionActionArgs{ +// ActionType: pulumi.String("AutoRenew"), +// }, +// Trigger: &keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs{ +// DaysBeforeExpiry: pulumi.Int(30), +// }, +// }, +// }, +// SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{ +// ContentType: pulumi.String("application/x-pkcs12"), +// }, +// X509CertificateProperties: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs{ +// KeyUsages: pulumi.StringArray{ +// pulumi.String("cRLSign"), +// pulumi.String("dataEncipherment"), +// pulumi.String("digitalSignature"), +// pulumi.String("keyAgreement"), +// pulumi.String("keyCertSign"), +// pulumi.String("keyEncipherment"), +// }, +// Subject: pulumi.String("CN=api.example.com"), +// ValidityInMonths: pulumi.Int(12), +// SubjectAlternativeNames: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs{ +// DnsNames: pulumi.StringArray{ +// pulumi.String("api.example.com"), +// pulumi.String("portal.example.com"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewCustomDomain(ctx, "exampleCustomDomain", &apimanagement.CustomDomainArgs{ +// ApiManagementId: exampleService.ID(), +// Gateways: apimanagement.CustomDomainGatewayArray{ +// &apimanagement.CustomDomainGatewayArgs{ +// HostName: pulumi.String("api.example.com"), +// KeyVaultId: exampleCertificate.VersionlessSecretId, +// }, +// }, +// DeveloperPortals: apimanagement.CustomDomainDeveloperPortalArray{ +// &apimanagement.CustomDomainDeveloperPortalArgs{ +// HostName: pulumi.String("portal.example.com"), +// KeyVaultId: exampleCertificate.VersionlessSecretId, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/diagnostic.go b/sdk/go/azure/apimanagement/diagnostic.go index ea2f629152..be15c9129d 100644 --- a/sdk/go/azure/apimanagement/diagnostic.go +++ b/sdk/go/azure/apimanagement/diagnostic.go @@ -15,6 +15,108 @@ import ( // Manages an API Management Service Diagnostic. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@mycompany.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleLogger, err := apimanagement.NewLogger(ctx, "exampleLogger", &apimanagement.LoggerArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsights: &apimanagement.LoggerApplicationInsightsArgs{ +// InstrumentationKey: exampleInsights.InstrumentationKey, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewDiagnostic(ctx, "exampleDiagnostic", &apimanagement.DiagnosticArgs{ +// Identifier: pulumi.String("applicationinsights"), +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// ApiManagementLoggerId: exampleLogger.ID(), +// SamplingPercentage: pulumi.Float64(5), +// AlwaysLogErrors: pulumi.Bool(true), +// LogClientIp: pulumi.Bool(true), +// Verbosity: pulumi.String("verbose"), +// HttpCorrelationProtocol: pulumi.String("W3C"), +// FrontendRequest: &apimanagement.DiagnosticFrontendRequestArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("accept"), +// pulumi.String("origin"), +// }, +// }, +// FrontendResponse: &apimanagement.DiagnosticFrontendResponseArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("content-length"), +// pulumi.String("origin"), +// }, +// }, +// BackendRequest: &apimanagement.DiagnosticBackendRequestArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("accept"), +// pulumi.String("origin"), +// }, +// }, +// BackendResponse: &apimanagement.DiagnosticBackendResponseArgs{ +// BodyBytes: pulumi.Int(32), +// HeadersToLogs: pulumi.StringArray{ +// pulumi.String("content-type"), +// pulumi.String("content-length"), +// pulumi.String("origin"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Diagnostics can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/emailTemplate.go b/sdk/go/azure/apimanagement/emailTemplate.go index 69399ec2f5..39a493774e 100644 --- a/sdk/go/azure/apimanagement/emailTemplate.go +++ b/sdk/go/azure/apimanagement/emailTemplate.go @@ -15,6 +15,69 @@ import ( // Manages a API Management Email Template. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewEmailTemplate(ctx, "exampleEmailTemplate", &apimanagement.EmailTemplateArgs{ +// TemplateName: pulumi.String("ConfirmSignUpIdentityDefault"), +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// Subject: pulumi.String("Customized confirmation email for your new $OrganizationName API account"), +// Body: pulumi.String(` +// +// +// +// +// +// Customized Letter Title +// +// +// +// +//

Dear $DevFirstName $DevLastName,

+// +// +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Email Templates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/gateway.go b/sdk/go/azure/apimanagement/gateway.go index f7aa644d98..bd37cb60e4 100644 --- a/sdk/go/azure/apimanagement/gateway.go +++ b/sdk/go/azure/apimanagement/gateway.go @@ -15,6 +15,56 @@ import ( // Manages an API Management Gateway. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Consumption_0"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewGateway(ctx, "exampleGateway", &apimanagement.GatewayArgs{ +// ApiManagementId: exampleService.ID(), +// Description: pulumi.String("Example API Management gateway"), +// LocationData: &apimanagement.GatewayLocationDataArgs{ +// Name: pulumi.String("example name"), +// City: pulumi.String("example city"), +// District: pulumi.String("example district"), +// Region: pulumi.String("example region"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/gatewayApi.go b/sdk/go/azure/apimanagement/gatewayApi.go index e7d2db08c0..5c7e881327 100644 --- a/sdk/go/azure/apimanagement/gatewayApi.go +++ b/sdk/go/azure/apimanagement/gatewayApi.go @@ -15,6 +15,56 @@ import ( // Manages a API Management Gateway API. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "example-api", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{ +// Name: "search-api", +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleService.ResourceGroupName, +// Revision: "2", +// }, nil) +// if err != nil { +// return err +// } +// exampleGateway, err := apimanagement.LookupGateway(ctx, &apimanagement.LookupGatewayArgs{ +// Name: "example-gateway", +// ApiManagementId: exampleService.Id, +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewGatewayApi(ctx, "exampleGatewayApi", &apimanagement.GatewayApiArgs{ +// GatewayId: *pulumi.String(exampleGateway.Id), +// ApiId: *pulumi.String(exampleApi.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Gateway APIs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/gatewayCertificateAuthority.go b/sdk/go/azure/apimanagement/gatewayCertificateAuthority.go index c7445b92af..5cadac1093 100644 --- a/sdk/go/azure/apimanagement/gatewayCertificateAuthority.go +++ b/sdk/go/azure/apimanagement/gatewayCertificateAuthority.go @@ -15,6 +15,84 @@ import ( // Manages an API Management Gateway Certificate Authority. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Consumption_0"), +// }) +// if err != nil { +// return err +// } +// exampleGateway, err := apimanagement.NewGateway(ctx, "exampleGateway", &apimanagement.GatewayArgs{ +// ApiManagementId: exampleService.ID(), +// Description: pulumi.String("Example API Management gateway"), +// LocationData: &apimanagement.GatewayLocationDataArgs{ +// Name: pulumi.String("example name"), +// City: pulumi.String("example city"), +// District: pulumi.String("example district"), +// Region: pulumi.String("example region"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := apimanagement.NewCertificate(ctx, "exampleCertificate", &apimanagement.CertificateArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Data: filebase64OrPanic("example.pfx"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewGatewayCertificateAuthority(ctx, "exampleGatewayCertificateAuthority", &apimanagement.GatewayCertificateAuthorityArgs{ +// ApiManagementId: exampleService.ID(), +// CertificateName: exampleCertificate.Name, +// GatewayName: exampleGateway.Name, +// IsTrusted: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Gateway Certificate Authority can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/gatewayHostNameConfiguration.go b/sdk/go/azure/apimanagement/gatewayHostNameConfiguration.go index 0a39edf84f..865ca1afa6 100644 --- a/sdk/go/azure/apimanagement/gatewayHostNameConfiguration.go +++ b/sdk/go/azure/apimanagement/gatewayHostNameConfiguration.go @@ -15,6 +15,88 @@ import ( // Manages an API Management Gateway Host Name Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Consumption_0"), +// }) +// if err != nil { +// return err +// } +// exampleGateway, err := apimanagement.NewGateway(ctx, "exampleGateway", &apimanagement.GatewayArgs{ +// ApiManagementId: exampleService.ID(), +// Description: pulumi.String("Example API Management gateway"), +// LocationData: &apimanagement.GatewayLocationDataArgs{ +// Name: pulumi.String("example name"), +// City: pulumi.String("example city"), +// District: pulumi.String("example district"), +// Region: pulumi.String("example region"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := apimanagement.NewCertificate(ctx, "exampleCertificate", &apimanagement.CertificateArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Data: filebase64OrPanic("example.pfx"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewGatewayHostNameConfiguration(ctx, "exampleGatewayHostNameConfiguration", &apimanagement.GatewayHostNameConfigurationArgs{ +// ApiManagementId: exampleService.ID(), +// GatewayName: exampleGateway.Name, +// CertificateId: exampleCertificate.ID(), +// HostName: pulumi.String("example-host-name"), +// RequestClientCertificateEnabled: pulumi.Bool(true), +// Http2Enabled: pulumi.Bool(true), +// Tls10Enabled: pulumi.Bool(true), +// Tls11Enabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Gateway Host Name Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/getApi.go b/sdk/go/azure/apimanagement/getApi.go index 7d799b0774..e049c24bed 100644 --- a/sdk/go/azure/apimanagement/getApi.go +++ b/sdk/go/azure/apimanagement/getApi.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about an existing API Management API. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{ +// Name: "search-api", +// ApiManagementName: "search-api-management", +// ResourceGroupName: "search-service", +// Revision: "2", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("apiManagementApiId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupApi(ctx *pulumi.Context, args *LookupApiArgs, opts ...pulumi.InvokeOption) (*LookupApiResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupApiResult diff --git a/sdk/go/azure/apimanagement/getApiVersionSet.go b/sdk/go/azure/apimanagement/getApiVersionSet.go index bfba95900f..16dc711221 100644 --- a/sdk/go/azure/apimanagement/getApiVersionSet.go +++ b/sdk/go/azure/apimanagement/getApiVersionSet.go @@ -13,6 +13,35 @@ import ( ) // Uses this data source to access information about an API Version Set within an API Management Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := apimanagement.LookupApiVersionSet(ctx, &apimanagement.LookupApiVersionSetArgs{ +// ResourceGroupName: "example-resources", +// ApiManagementName: "example-api", +// Name: "example-api-version-set", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("apiManagementApiVersionSetId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupApiVersionSet(ctx *pulumi.Context, args *LookupApiVersionSetArgs, opts ...pulumi.InvokeOption) (*LookupApiVersionSetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupApiVersionSetResult diff --git a/sdk/go/azure/apimanagement/getGateway.go b/sdk/go/azure/apimanagement/getGateway.go index 597885c49d..60e9d63e3b 100644 --- a/sdk/go/azure/apimanagement/getGateway.go +++ b/sdk/go/azure/apimanagement/getGateway.go @@ -13,6 +13,40 @@ import ( ) // Use this data source to access information about an existing API Management Gateway. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "example-apim", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.LookupGateway(ctx, &apimanagement.LookupGatewayArgs{ +// Name: "example-api-gateway", +// ApiManagementId: exampleService.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupGateway(ctx *pulumi.Context, args *LookupGatewayArgs, opts ...pulumi.InvokeOption) (*LookupGatewayResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupGatewayResult diff --git a/sdk/go/azure/apimanagement/getGatewayHostNameConfiguration.go b/sdk/go/azure/apimanagement/getGatewayHostNameConfiguration.go index fb7244bcb9..ce8a2dda19 100644 --- a/sdk/go/azure/apimanagement/getGatewayHostNameConfiguration.go +++ b/sdk/go/azure/apimanagement/getGatewayHostNameConfiguration.go @@ -13,6 +13,49 @@ import ( ) // Use this data source to access information about an existing API Management Gateway Host Configuration. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "example-apim", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleGateway, err := apimanagement.LookupGateway(ctx, &apimanagement.LookupGatewayArgs{ +// Name: "example-gateway", +// ApiManagementId: data.Azurerm_api_management.Main.Id, +// }, nil) +// if err != nil { +// return err +// } +// exampleGatewayHostNameConfiguration, err := apimanagement.LookupGatewayHostNameConfiguration(ctx, &apimanagement.LookupGatewayHostNameConfigurationArgs{ +// Name: "example-host-configuration", +// ApiManagementId: exampleService.Id, +// GatewayName: exampleGateway.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("hostName", exampleGatewayHostNameConfiguration.HostName) +// return nil +// }) +// } +// +// ``` func LookupGatewayHostNameConfiguration(ctx *pulumi.Context, args *LookupGatewayHostNameConfigurationArgs, opts ...pulumi.InvokeOption) (*LookupGatewayHostNameConfigurationResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupGatewayHostNameConfigurationResult diff --git a/sdk/go/azure/apimanagement/getGroup.go b/sdk/go/azure/apimanagement/getGroup.go index 1fb7a61beb..c71ed538e5 100644 --- a/sdk/go/azure/apimanagement/getGroup.go +++ b/sdk/go/azure/apimanagement/getGroup.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing API Management Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := apimanagement.LookupGroup(ctx, &apimanagement.LookupGroupArgs{ +// Name: "my-group", +// ApiManagementName: "example-apim", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("groupType", example.Type) +// return nil +// }) +// } +// +// ``` func LookupGroup(ctx *pulumi.Context, args *LookupGroupArgs, opts ...pulumi.InvokeOption) (*LookupGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupGroupResult diff --git a/sdk/go/azure/apimanagement/getProduct.go b/sdk/go/azure/apimanagement/getProduct.go index ba6f8a3d95..b29553aca7 100644 --- a/sdk/go/azure/apimanagement/getProduct.go +++ b/sdk/go/azure/apimanagement/getProduct.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing API Management Product. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{ +// ProductId: "my-product", +// ApiManagementName: "example-apim", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("productTerms", example.Terms) +// return nil +// }) +// } +// +// ``` func LookupProduct(ctx *pulumi.Context, args *LookupProductArgs, opts ...pulumi.InvokeOption) (*LookupProductResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupProductResult diff --git a/sdk/go/azure/apimanagement/getService.go b/sdk/go/azure/apimanagement/getService.go index 997ccef50a..60c0feb03a 100644 --- a/sdk/go/azure/apimanagement/getService.go +++ b/sdk/go/azure/apimanagement/getService.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing API Management Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "search-api", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("apiManagementId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/apimanagement/globalSchema.go b/sdk/go/azure/apimanagement/globalSchema.go index d1b0d98594..8f7322a12a 100644 --- a/sdk/go/azure/apimanagement/globalSchema.go +++ b/sdk/go/azure/apimanagement/globalSchema.go @@ -15,6 +15,63 @@ import ( // Manages a Global Schema within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Consumption_0"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewGlobalSchema(ctx, "exampleGlobalSchema", &apimanagement.GlobalSchemaArgs{ +// SchemaId: pulumi.String("example-schema1"), +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Type: pulumi.String("xml"), +// Value: readFileOrPanic("api_management_api_schema.xml"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/group.go b/sdk/go/azure/apimanagement/group.go index 7951a22cc9..e99420bcdf 100644 --- a/sdk/go/azure/apimanagement/group.go +++ b/sdk/go/azure/apimanagement/group.go @@ -15,6 +15,52 @@ import ( // Manages an API Management Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewGroup(ctx, "exampleGroup", &apimanagement.GroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// DisplayName: pulumi.String("Example Group"), +// Description: pulumi.String("This is an example API management group."), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/groupUser.go b/sdk/go/azure/apimanagement/groupUser.go index ba560a0b58..11e367e3c6 100644 --- a/sdk/go/azure/apimanagement/groupUser.go +++ b/sdk/go/azure/apimanagement/groupUser.go @@ -15,6 +15,43 @@ import ( // Manages an API Management User Assignment to a Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleUser, err := apimanagement.LookupUser(ctx, &apimanagement.LookupUserArgs{ +// UserId: "my-user", +// ApiManagementName: "example-apim", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewGroupUser(ctx, "exampleGroupUser", &apimanagement.GroupUserArgs{ +// UserId: *pulumi.String(exampleUser.Id), +// GroupName: pulumi.String("example-group"), +// ResourceGroupName: *pulumi.String(exampleUser.ResourceGroupName), +// ApiManagementName: *pulumi.String(exampleUser.ApiManagementName), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Group Users can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/identityProviderAad.go b/sdk/go/azure/apimanagement/identityProviderAad.go index 6d6951f061..30d0f3e922 100644 --- a/sdk/go/azure/apimanagement/identityProviderAad.go +++ b/sdk/go/azure/apimanagement/identityProviderAad.go @@ -15,6 +15,55 @@ import ( // Manages an API Management AAD Identity Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@mycompany.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewIdentityProviderAad(ctx, "exampleIdentityProviderAad", &apimanagement.IdentityProviderAadArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// ClientId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// ClientSecret: pulumi.String("00000000000000000000000000000000"), +// AllowedTenants: pulumi.StringArray{ +// pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management AAD Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/identityProviderAadb2c.go b/sdk/go/azure/apimanagement/identityProviderAadb2c.go index e60dff6be5..be9aeeb7dc 100644 --- a/sdk/go/azure/apimanagement/identityProviderAadb2c.go +++ b/sdk/go/azure/apimanagement/identityProviderAadb2c.go @@ -15,6 +15,73 @@ import ( // Manages an API Management Azure AD B2C Identity Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleApplication, err := azuread.NewApplication(ctx, "exampleApplication", &azuread.ApplicationArgs{ +// DisplayName: pulumi.String("acctestam-example"), +// }) +// if err != nil { +// return err +// } +// exampleApplicationPassword, err := azuread.NewApplicationPassword(ctx, "exampleApplicationPassword", &azuread.ApplicationPasswordArgs{ +// ApplicationObjectId: exampleApplication.ObjectId, +// EndDateRelative: pulumi.String("36h"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewIdentityProviderAadb2c(ctx, "exampleIdentityProviderAadb2c", &apimanagement.IdentityProviderAadb2cArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// ClientId: exampleApplication.ApplicationId, +// ClientSecret: pulumi.String("P@55w0rD!"), +// AllowedTenant: pulumi.String("myb2ctenant.onmicrosoft.com"), +// SigninTenant: pulumi.String("myb2ctenant.onmicrosoft.com"), +// Authority: pulumi.String("myb2ctenant.b2clogin.com"), +// SigninPolicy: pulumi.String("B2C_1_Login"), +// SignupPolicy: pulumi.String("B2C_1_Signup"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleApplicationPassword, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Azure AD B2C Identity Providers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/identityProviderFacebook.go b/sdk/go/azure/apimanagement/identityProviderFacebook.go index 0a7f9f973e..b1cbd62fe5 100644 --- a/sdk/go/azure/apimanagement/identityProviderFacebook.go +++ b/sdk/go/azure/apimanagement/identityProviderFacebook.go @@ -15,6 +15,52 @@ import ( // Manages an API Management Facebook Identity Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@mycompany.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewIdentityProviderFacebook(ctx, "exampleIdentityProviderFacebook", &apimanagement.IdentityProviderFacebookArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// AppId: pulumi.String("00000000000000000000000000000000"), +// AppSecret: pulumi.String("00000000000000000000000000000000"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Facebook Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/identityProviderGoogle.go b/sdk/go/azure/apimanagement/identityProviderGoogle.go index 61bfba98b0..a6fe98922a 100644 --- a/sdk/go/azure/apimanagement/identityProviderGoogle.go +++ b/sdk/go/azure/apimanagement/identityProviderGoogle.go @@ -15,6 +15,52 @@ import ( // Manages an API Management Google Identity Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@mycompany.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewIdentityProviderGoogle(ctx, "exampleIdentityProviderGoogle", &apimanagement.IdentityProviderGoogleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// ClientId: pulumi.String("00000000.apps.googleusercontent.com"), +// ClientSecret: pulumi.String("00000000000000000000000000000000"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Google Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/identityProviderMicrosoft.go b/sdk/go/azure/apimanagement/identityProviderMicrosoft.go index 31df01d318..13cb6d4b37 100644 --- a/sdk/go/azure/apimanagement/identityProviderMicrosoft.go +++ b/sdk/go/azure/apimanagement/identityProviderMicrosoft.go @@ -15,6 +15,52 @@ import ( // Manages an API Management Microsoft Identity Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@mycompany.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewIdentityProviderMicrosoft(ctx, "exampleIdentityProviderMicrosoft", &apimanagement.IdentityProviderMicrosoftArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// ClientId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// ClientSecret: pulumi.String("00000000000000000000000000000000"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Microsoft Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/identityProviderTwitter.go b/sdk/go/azure/apimanagement/identityProviderTwitter.go index 0d767f7729..fcdd876ac6 100644 --- a/sdk/go/azure/apimanagement/identityProviderTwitter.go +++ b/sdk/go/azure/apimanagement/identityProviderTwitter.go @@ -15,6 +15,52 @@ import ( // Manages an API Management Twitter Identity Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@mycompany.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewIdentityProviderTwitter(ctx, "exampleIdentityProviderTwitter", &apimanagement.IdentityProviderTwitterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// ApiKey: pulumi.String("00000000000000000000000000000000"), +// ApiSecretKey: pulumi.String("00000000000000000000000000000000"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Twitter Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/logger.go b/sdk/go/azure/apimanagement/logger.go index 02ccfbaafa..2c321bb6b1 100644 --- a/sdk/go/azure/apimanagement/logger.go +++ b/sdk/go/azure/apimanagement/logger.go @@ -15,6 +15,63 @@ import ( // Manages a Logger within an API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("other"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewLogger(ctx, "exampleLogger", &apimanagement.LoggerArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// ResourceId: exampleInsights.ID(), +// ApplicationInsights: &apimanagement.LoggerApplicationInsightsArgs{ +// InstrumentationKey: exampleInsights.InstrumentationKey, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Loggers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/namedValue.go b/sdk/go/azure/apimanagement/namedValue.go index 54495a62c4..7b9107f60d 100644 --- a/sdk/go/azure/apimanagement/namedValue.go +++ b/sdk/go/azure/apimanagement/namedValue.go @@ -15,6 +15,52 @@ import ( // Manages an API Management Named Value. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewNamedValue(ctx, "exampleNamedValue", &apimanagement.NamedValueArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// DisplayName: pulumi.String("ExampleProperty"), +// Value: pulumi.String("Example Value"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Properties can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/notificationRecipientEmail.go b/sdk/go/azure/apimanagement/notificationRecipientEmail.go index 6b18dd645d..68e0521a0c 100644 --- a/sdk/go/azure/apimanagement/notificationRecipientEmail.go +++ b/sdk/go/azure/apimanagement/notificationRecipientEmail.go @@ -15,6 +15,51 @@ import ( // Manages a API Management Notification Recipient Email. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewNotificationRecipientEmail(ctx, "exampleNotificationRecipientEmail", &apimanagement.NotificationRecipientEmailArgs{ +// ApiManagementId: exampleService.ID(), +// NotificationType: pulumi.String("AccountClosedPublisher"), +// Email: pulumi.String("foo@bar.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Notification Recipient Emails can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/notificationRecipientUser.go b/sdk/go/azure/apimanagement/notificationRecipientUser.go index 7bb6b48e1c..04c1966842 100644 --- a/sdk/go/azure/apimanagement/notificationRecipientUser.go +++ b/sdk/go/azure/apimanagement/notificationRecipientUser.go @@ -15,6 +15,63 @@ import ( // Manages a API Management Notification Recipient User. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleUser, err := apimanagement.NewUser(ctx, "exampleUser", &apimanagement.UserArgs{ +// UserId: pulumi.String("123"), +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// Email: pulumi.String("foo@bar.com"), +// State: pulumi.String("active"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewNotificationRecipientUser(ctx, "exampleNotificationRecipientUser", &apimanagement.NotificationRecipientUserArgs{ +// ApiManagementId: exampleService.ID(), +// NotificationType: pulumi.String("AccountClosedPublisher"), +// UserId: exampleUser.UserId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Notification Recipient Users can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/openIdConnectProvider.go b/sdk/go/azure/apimanagement/openIdConnectProvider.go index e001e1172e..af974ef45c 100644 --- a/sdk/go/azure/apimanagement/openIdConnectProvider.go +++ b/sdk/go/azure/apimanagement/openIdConnectProvider.go @@ -15,6 +15,54 @@ import ( // Manages an OpenID Connect Provider within a API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewOpenIdConnectProvider(ctx, "exampleOpenIdConnectProvider", &apimanagement.OpenIdConnectProviderArgs{ +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// ClientId: pulumi.String("00001111-2222-3333-4444-555566667777"), +// ClientSecret: pulumi.String("00001111-423egvwdcsjx-00001111"), +// DisplayName: pulumi.String("Example Provider"), +// MetadataEndpoint: pulumi.String("https://example.com/example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management OpenID Connect Providers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/policy.go b/sdk/go/azure/apimanagement/policy.go index b40fc0257a..06f9cad76f 100644 --- a/sdk/go/azure/apimanagement/policy.go +++ b/sdk/go/azure/apimanagement/policy.go @@ -17,6 +17,69 @@ import ( // // > **NOTE:** This resource will, upon creation, **overwrite any existing policy in the API Management service**, as there is no feasible way to test whether the policy has been modified from the default. Similarly, when this resource is destroyed, the API Management service will revert to its default policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewNamedValue(ctx, "exampleNamedValue", &apimanagement.NamedValueArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApiManagementName: exampleService.Name, +// DisplayName: pulumi.String("ExampleProperty"), +// Value: pulumi.String("Example Value"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewPolicy(ctx, "examplePolicy", &apimanagement.PolicyArgs{ +// ApiManagementId: exampleService.ID(), +// XmlContent: readFileOrPanic("example.xml"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management service Policys can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/product.go b/sdk/go/azure/apimanagement/product.go index e85a8f4aac..fe33c6fd08 100644 --- a/sdk/go/azure/apimanagement/product.go +++ b/sdk/go/azure/apimanagement/product.go @@ -15,6 +15,55 @@ import ( // Manages an API Management Product. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewProduct(ctx, "exampleProduct", &apimanagement.ProductArgs{ +// ProductId: pulumi.String("test-product"), +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// DisplayName: pulumi.String("Test Product"), +// SubscriptionRequired: pulumi.Bool(true), +// ApprovalRequired: pulumi.Bool(true), +// Published: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/productApi.go b/sdk/go/azure/apimanagement/productApi.go index b7f63700e7..97c5fec82d 100644 --- a/sdk/go/azure/apimanagement/productApi.go +++ b/sdk/go/azure/apimanagement/productApi.go @@ -15,6 +15,59 @@ import ( // Manages an API Management API Assignment to a Product. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "example-api", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{ +// Name: "search-api", +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleService.ResourceGroupName, +// Revision: "2", +// }, nil) +// if err != nil { +// return err +// } +// exampleProduct, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{ +// ProductId: "my-product", +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleService.ResourceGroupName, +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewProductApi(ctx, "exampleProductApi", &apimanagement.ProductApiArgs{ +// ApiName: *pulumi.String(exampleApi.Name), +// ProductId: *pulumi.String(exampleProduct.ProductId), +// ApiManagementName: *pulumi.String(exampleService.Name), +// ResourceGroupName: *pulumi.String(exampleService.ResourceGroupName), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Product API's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/productGroup.go b/sdk/go/azure/apimanagement/productGroup.go index 6b3809a4e3..58489c9a4b 100644 --- a/sdk/go/azure/apimanagement/productGroup.go +++ b/sdk/go/azure/apimanagement/productGroup.go @@ -15,6 +15,58 @@ import ( // Manages an API Management Product Assignment to a Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "example-api", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleProduct, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{ +// ProductId: "my-product", +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleService.ResourceGroupName, +// }, nil) +// if err != nil { +// return err +// } +// exampleGroup, err := apimanagement.LookupGroup(ctx, &apimanagement.LookupGroupArgs{ +// Name: "my-group", +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleService.ResourceGroupName, +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewProductGroup(ctx, "exampleProductGroup", &apimanagement.ProductGroupArgs{ +// ProductId: *pulumi.String(exampleProduct.ProductId), +// GroupName: *pulumi.String(exampleGroup.Name), +// ApiManagementName: *pulumi.String(exampleService.Name), +// ResourceGroupName: *pulumi.String(exampleService.ResourceGroupName), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Product Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/productPolicy.go b/sdk/go/azure/apimanagement/productPolicy.go index 4caaa138b6..5c628c2fd5 100644 --- a/sdk/go/azure/apimanagement/productPolicy.go +++ b/sdk/go/azure/apimanagement/productPolicy.go @@ -15,6 +15,50 @@ import ( // Manages an API Management Product Policy // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleProduct, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{ +// ProductId: "my-product", +// ApiManagementName: "example-apim", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewProductPolicy(ctx, "exampleProductPolicy", &apimanagement.ProductPolicyArgs{ +// ProductId: *pulumi.String(exampleProduct.ProductId), +// ApiManagementName: *pulumi.String(exampleProduct.ApiManagementName), +// ResourceGroupName: *pulumi.String(exampleProduct.ResourceGroupName), +// XmlContent: pulumi.String(` +// +// +// +// +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Product Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/productTag.go b/sdk/go/azure/apimanagement/productTag.go index dd77bad1db..8917fcc133 100644 --- a/sdk/go/azure/apimanagement/productTag.go +++ b/sdk/go/azure/apimanagement/productTag.go @@ -15,6 +15,69 @@ import ( // Manages an API Management Product tag // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// exampleProduct, err := apimanagement.NewProduct(ctx, "exampleProduct", &apimanagement.ProductArgs{ +// ProductId: pulumi.String("test-product"), +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// DisplayName: pulumi.String("Test Product"), +// SubscriptionRequired: pulumi.Bool(true), +// ApprovalRequired: pulumi.Bool(true), +// Published: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewTag(ctx, "exampleTag", &apimanagement.TagArgs{ +// ApiManagementId: exampleService.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewProductTag(ctx, "exampleProductTag", &apimanagement.ProductTagArgs{ +// ApiManagementProductId: exampleProduct.ProductId, +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/redisCache.go b/sdk/go/azure/apimanagement/redisCache.go index 964d72cede..bf6dbb4ce9 100644 --- a/sdk/go/azure/apimanagement/redisCache.go +++ b/sdk/go/azure/apimanagement/redisCache.go @@ -15,6 +15,67 @@ import ( // Manages a API Management Redis Cache. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("pub1"), +// PublisherEmail: pulumi.String("pub1@email.com"), +// SkuName: pulumi.String("Consumption_0"), +// }) +// if err != nil { +// return err +// } +// exampleCache, err := redis.NewCache(ctx, "exampleCache", &redis.CacheArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Capacity: pulumi.Int(1), +// Family: pulumi.String("C"), +// SkuName: pulumi.String("Basic"), +// EnableNonSslPort: pulumi.Bool(false), +// MinimumTlsVersion: pulumi.String("1.2"), +// RedisConfiguration: nil, +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewRedisCache(ctx, "exampleRedisCache", &apimanagement.RedisCacheArgs{ +// ApiManagementId: exampleService.ID(), +// ConnectionString: exampleCache.PrimaryConnectionString, +// Description: pulumi.String("Redis cache instances"), +// RedisCacheId: exampleCache.ID(), +// CacheLocation: pulumi.String("East Us"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Redis Caches can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/service.go b/sdk/go/azure/apimanagement/service.go index cc35b03f15..c5dbf21b53 100644 --- a/sdk/go/azure/apimanagement/service.go +++ b/sdk/go/azure/apimanagement/service.go @@ -13,6 +13,43 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/subscription.go b/sdk/go/azure/apimanagement/subscription.go index 94b5deb044..7c740224d1 100644 --- a/sdk/go/azure/apimanagement/subscription.go +++ b/sdk/go/azure/apimanagement/subscription.go @@ -15,6 +15,59 @@ import ( // Manages a Subscription within a API Management Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{ +// Name: "example-apim", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleProduct, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{ +// ProductId: "00000000-0000-0000-0000-000000000000", +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleService.ResourceGroupName, +// }, nil) +// if err != nil { +// return err +// } +// exampleUser, err := apimanagement.LookupUser(ctx, &apimanagement.LookupUserArgs{ +// UserId: "11111111-1111-1111-1111-111111111111", +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleService.ResourceGroupName, +// }, nil) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewSubscription(ctx, "exampleSubscription", &apimanagement.SubscriptionArgs{ +// ApiManagementName: *pulumi.String(exampleService.Name), +// ResourceGroupName: *pulumi.String(exampleService.ResourceGroupName), +// UserId: *pulumi.String(exampleUser.Id), +// ProductId: *pulumi.String(exampleProduct.Id), +// DisplayName: pulumi.String("Parser API"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/tag.go b/sdk/go/azure/apimanagement/tag.go index 0a52cc45dd..b51798a7a4 100644 --- a/sdk/go/azure/apimanagement/tag.go +++ b/sdk/go/azure/apimanagement/tag.go @@ -15,6 +15,49 @@ import ( // Manages a API Management Tag. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@terraform.io"), +// SkuName: pulumi.String("Consumption_0"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewTag(ctx, "exampleTag", &apimanagement.TagArgs{ +// ApiManagementId: exampleService.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Tags can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/apimanagement/user.go b/sdk/go/azure/apimanagement/user.go index 18273cb392..95ae8a7d7c 100644 --- a/sdk/go/azure/apimanagement/user.go +++ b/sdk/go/azure/apimanagement/user.go @@ -15,6 +15,55 @@ import ( // Manages an API Management User. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PublisherName: pulumi.String("My Company"), +// PublisherEmail: pulumi.String("company@exmaple.com"), +// SkuName: pulumi.String("Developer_1"), +// }) +// if err != nil { +// return err +// } +// _, err = apimanagement.NewUser(ctx, "exampleUser", &apimanagement.UserArgs{ +// UserId: pulumi.String("5931a75ae4bbd512288c680b"), +// ApiManagementName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// Email: pulumi.String("user@example.com"), +// State: pulumi.String("active"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Management Users can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appconfiguration/configurationFeature.go b/sdk/go/azure/appconfiguration/configurationFeature.go index 5bed3cd800..897092d252 100644 --- a/sdk/go/azure/appconfiguration/configurationFeature.go +++ b/sdk/go/azure/appconfiguration/configurationFeature.go @@ -17,6 +17,62 @@ import ( // // > **Note:** App Configuration Features are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). This is similar to providing App Configuration Keys. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// appconf, err := appconfiguration.NewConfigurationStore(ctx, "appconf", &appconfiguration.ConfigurationStoreArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "appconfDataowner", &authorization.AssignmentArgs{ +// Scope: appconf.ID(), +// RoleDefinitionName: pulumi.String("App Configuration Data Owner"), +// PrincipalId: *pulumi.String(current.ObjectId), +// }) +// if err != nil { +// return err +// } +// _, err = appconfiguration.NewConfigurationFeature(ctx, "test", &appconfiguration.ConfigurationFeatureArgs{ +// ConfigurationStoreId: appconf.ID(), +// Description: pulumi.String("test description"), +// Label: pulumi.String("test-ackeylabel"), +// Enabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Configuration Features can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appconfiguration/configurationKey.go b/sdk/go/azure/appconfiguration/configurationKey.go index b013338925..ede38f6bc0 100644 --- a/sdk/go/azure/appconfiguration/configurationKey.go +++ b/sdk/go/azure/appconfiguration/configurationKey.go @@ -18,6 +18,156 @@ import ( // > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). // // ## Example Usage +// ### `Kv` Type +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// appconf, err := appconfiguration.NewConfigurationStore(ctx, "appconf", &appconfiguration.ConfigurationStoreArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// appconfDataowner, err := authorization.NewAssignment(ctx, "appconfDataowner", &authorization.AssignmentArgs{ +// Scope: appconf.ID(), +// RoleDefinitionName: pulumi.String("App Configuration Data Owner"), +// PrincipalId: *pulumi.String(current.ObjectId), +// }) +// if err != nil { +// return err +// } +// _, err = appconfiguration.NewConfigurationKey(ctx, "test", &appconfiguration.ConfigurationKeyArgs{ +// ConfigurationStoreId: appconf.ID(), +// Key: pulumi.String("appConfKey1"), +// Label: pulumi.String("somelabel"), +// Value: pulumi.String("a test"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// appconfDataowner, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### `Vault` Type +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// appconf, err := appconfiguration.NewConfigurationStore(ctx, "appconf", &appconfiguration.ConfigurationStoreArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// kv, err := keyvault.NewKeyVault(ctx, "kv", &keyvault.KeyVaultArgs{ +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// kvs, err := keyvault.NewSecret(ctx, "kvs", &keyvault.SecretArgs{ +// Value: pulumi.String("szechuan"), +// KeyVaultId: kv.ID(), +// }) +// if err != nil { +// return err +// } +// appconfDataowner, err := authorization.NewAssignment(ctx, "appconfDataowner", &authorization.AssignmentArgs{ +// Scope: appconf.ID(), +// RoleDefinitionName: pulumi.String("App Configuration Data Owner"), +// PrincipalId: *pulumi.String(current.ObjectId), +// }) +// if err != nil { +// return err +// } +// _, err = appconfiguration.NewConfigurationKey(ctx, "test", &appconfiguration.ConfigurationKeyArgs{ +// ConfigurationStoreId: pulumi.Any(azurerm_app_configuration.Test.Id), +// Key: pulumi.String("key1"), +// Type: pulumi.String("vault"), +// Label: pulumi.String("label1"), +// VaultKeyReference: kvs.VersionlessId, +// }, pulumi.DependsOn([]pulumi.Resource{ +// appconfDataowner, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appconfiguration/configurationStore.go b/sdk/go/azure/appconfiguration/configurationStore.go index d9b63f5f4b..cb91985418 100644 --- a/sdk/go/azure/appconfiguration/configurationStore.go +++ b/sdk/go/azure/appconfiguration/configurationStore.go @@ -13,6 +13,186 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appconfiguration.NewConfigurationStore(ctx, "appconf", &appconfiguration.ConfigurationStoreArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Encryption) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// server, err := keyvault.NewAccessPolicy(ctx, "server", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: exampleUserAssignedIdentity.PrincipalId, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// client, err := keyvault.NewAccessPolicy(ctx, "client", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("List"), +// pulumi.String("Restore"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// pulumi.String("Purge"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("Verify"), +// pulumi.String("GetRotationPolicy"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// client, +// server, +// })) +// if err != nil { +// return err +// } +// _, err = appconfiguration.NewConfigurationStore(ctx, "exampleConfigurationStore", &appconfiguration.ConfigurationStoreArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("standard"), +// LocalAuthEnabled: pulumi.Bool(true), +// PublicNetworkAccess: pulumi.String("Enabled"), +// PurgeProtectionEnabled: pulumi.Bool(false), +// SoftDeleteRetentionDays: pulumi.Int(1), +// Identity: &appconfiguration.ConfigurationStoreIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Encryption: &appconfiguration.ConfigurationStoreEncryptionArgs{ +// KeyVaultKeyIdentifier: exampleKey.ID(), +// IdentityClientId: exampleUserAssignedIdentity.ClientId, +// }, +// Replicas: appconfiguration.ConfigurationStoreReplicaArray{ +// &appconfiguration.ConfigurationStoreReplicaArgs{ +// Name: pulumi.String("replica1"), +// Location: pulumi.String("West US"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("development"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// client, +// server, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appconfiguration/getConfigurationKey.go b/sdk/go/azure/appconfiguration/getConfigurationKey.go index cc77a10ff5..a9129fa450 100644 --- a/sdk/go/azure/appconfiguration/getConfigurationKey.go +++ b/sdk/go/azure/appconfiguration/getConfigurationKey.go @@ -15,6 +15,35 @@ import ( // Use this data source to access information about an existing Azure App Configuration Key. // // > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// test, err := appconfiguration.LookupConfigurationKey(ctx, &appconfiguration.LookupConfigurationKeyArgs{ +// ConfigurationStoreId: azurerm_app_configuration.Appconf.Id, +// Key: "appConfKey1", +// Label: pulumi.StringRef("somelabel"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("value", test.Value) +// return nil +// }) +// } +// +// ``` func LookupConfigurationKey(ctx *pulumi.Context, args *LookupConfigurationKeyArgs, opts ...pulumi.InvokeOption) (*LookupConfigurationKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupConfigurationKeyResult diff --git a/sdk/go/azure/appconfiguration/getConfigurationKeys.go b/sdk/go/azure/appconfiguration/getConfigurationKeys.go index 9ba3b714ca..636d9383c5 100644 --- a/sdk/go/azure/appconfiguration/getConfigurationKeys.go +++ b/sdk/go/azure/appconfiguration/getConfigurationKeys.go @@ -15,6 +15,33 @@ import ( // Use this data source to access information about existing Azure App Configuration Keys. // // > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// test, err := appconfiguration.GetConfigurationKeys(ctx, &appconfiguration.GetConfigurationKeysArgs{ +// ConfigurationStoreId: azurerm_app_configuration.Appconf.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("value", test.Items) +// return nil +// }) +// } +// +// ``` func GetConfigurationKeys(ctx *pulumi.Context, args *GetConfigurationKeysArgs, opts ...pulumi.InvokeOption) (*GetConfigurationKeysResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetConfigurationKeysResult diff --git a/sdk/go/azure/appconfiguration/getConfigurationStore.go b/sdk/go/azure/appconfiguration/getConfigurationStore.go index 198922b90b..0328cd2e06 100644 --- a/sdk/go/azure/appconfiguration/getConfigurationStore.go +++ b/sdk/go/azure/appconfiguration/getConfigurationStore.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing App Configuration. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appconfiguration.LookupConfigurationStore(ctx, &appconfiguration.LookupConfigurationStoreArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupConfigurationStore(ctx *pulumi.Context, args *LookupConfigurationStoreArgs, opts ...pulumi.InvokeOption) (*LookupConfigurationStoreResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupConfigurationStoreResult diff --git a/sdk/go/azure/appconfiguration/licationLoadBalancer.go b/sdk/go/azure/appconfiguration/licationLoadBalancer.go index 173fb43df5..83c399fb73 100644 --- a/sdk/go/azure/appconfiguration/licationLoadBalancer.go +++ b/sdk/go/azure/appconfiguration/licationLoadBalancer.go @@ -15,6 +15,40 @@ import ( // Manages an Application Gateway for Containers (ALB). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appconfiguration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appconfiguration.NewLicationLoadBalancer(ctx, "exampleLicationLoadBalancer", &appconfiguration.LicationLoadBalancerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Gateway for Containers (ALB) can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/analyticsItem.go b/sdk/go/azure/appinsights/analyticsItem.go index 2c45cd6c12..182d666b68 100644 --- a/sdk/go/azure/appinsights/analyticsItem.go +++ b/sdk/go/azure/appinsights/analyticsItem.go @@ -15,6 +15,50 @@ import ( // Manages an Application Insights Analytics Item component. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// _, err = appinsights.NewAnalyticsItem(ctx, "exampleAnalyticsItem", &appinsights.AnalyticsItemArgs{ +// ApplicationInsightsId: exampleInsights.ID(), +// Content: pulumi.String("requests //simple example query"), +// Scope: pulumi.String("shared"), +// Type: pulumi.String("query"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Insights Analytics Items can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/apiKey.go b/sdk/go/azure/appinsights/apiKey.go index 478aed8377..ce56b2e7d1 100644 --- a/sdk/go/azure/appinsights/apiKey.go +++ b/sdk/go/azure/appinsights/apiKey.go @@ -15,6 +15,93 @@ import ( // Manages an Application Insights API key. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// readTelemetry, err := appinsights.NewApiKey(ctx, "readTelemetry", &appinsights.ApiKeyArgs{ +// ApplicationInsightsId: exampleInsights.ID(), +// ReadPermissions: pulumi.StringArray{ +// pulumi.String("aggregate"), +// pulumi.String("api"), +// pulumi.String("draft"), +// pulumi.String("extendqueries"), +// pulumi.String("search"), +// }, +// }) +// if err != nil { +// return err +// } +// writeAnnotations, err := appinsights.NewApiKey(ctx, "writeAnnotations", &appinsights.ApiKeyArgs{ +// ApplicationInsightsId: exampleInsights.ID(), +// WritePermissions: pulumi.StringArray{ +// pulumi.String("annotations"), +// }, +// }) +// if err != nil { +// return err +// } +// authenticateSdkControlChannelApiKey, err := appinsights.NewApiKey(ctx, "authenticateSdkControlChannelApiKey", &appinsights.ApiKeyArgs{ +// ApplicationInsightsId: exampleInsights.ID(), +// ReadPermissions: pulumi.StringArray{ +// pulumi.String("agentconfig"), +// }, +// }) +// if err != nil { +// return err +// } +// fullPermissions, err := appinsights.NewApiKey(ctx, "fullPermissions", &appinsights.ApiKeyArgs{ +// ApplicationInsightsId: exampleInsights.ID(), +// ReadPermissions: pulumi.StringArray{ +// pulumi.String("agentconfig"), +// pulumi.String("aggregate"), +// pulumi.String("api"), +// pulumi.String("draft"), +// pulumi.String("extendqueries"), +// pulumi.String("search"), +// }, +// WritePermissions: pulumi.StringArray{ +// pulumi.String("annotations"), +// }, +// }) +// if err != nil { +// return err +// } +// ctx.Export("readTelemetryApiKey", readTelemetry.ApiKey) +// ctx.Export("writeAnnotationsApiKey", writeAnnotations.ApiKey) +// ctx.Export("authenticateSdkControlChannel", authenticateSdkControlChannelApiKey.ApiKey) +// ctx.Export("fullPermissionsApiKey", fullPermissions.ApiKey) +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Insights API keys can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/getInsights.go b/sdk/go/azure/appinsights/getInsights.go index f97a09dbb7..10deb8b587 100644 --- a/sdk/go/azure/appinsights/getInsights.go +++ b/sdk/go/azure/appinsights/getInsights.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Application Insights component. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appinsights.LookupInsights(ctx, &appinsights.LookupInsightsArgs{ +// Name: "production", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("applicationInsightsInstrumentationKey", example.InstrumentationKey) +// return nil +// }) +// } +// +// ``` func LookupInsights(ctx *pulumi.Context, args *LookupInsightsArgs, opts ...pulumi.InvokeOption) (*LookupInsightsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupInsightsResult diff --git a/sdk/go/azure/appinsights/insights.go b/sdk/go/azure/appinsights/insights.go index 4c2b14a6e7..8fc8c3bd1d 100644 --- a/sdk/go/azure/appinsights/insights.go +++ b/sdk/go/azure/appinsights/insights.go @@ -15,6 +15,90 @@ import ( // Manages an Application Insights component. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("instrumentationKey", exampleInsights.InstrumentationKey) +// ctx.Export("appId", exampleInsights.AppId) +// return nil +// }) +// } +// +// ``` +// ### Workspace Mode +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("instrumentationKey", exampleInsights.InstrumentationKey) +// ctx.Export("appId", exampleInsights.AppId) +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Insights instances can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/smartDetectionRule.go b/sdk/go/azure/appinsights/smartDetectionRule.go index b5da5b644b..0be6f8a098 100644 --- a/sdk/go/azure/appinsights/smartDetectionRule.go +++ b/sdk/go/azure/appinsights/smartDetectionRule.go @@ -15,6 +15,48 @@ import ( // Manages an Application Insights Smart Detection Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// _, err = appinsights.NewSmartDetectionRule(ctx, "exampleSmartDetectionRule", &appinsights.SmartDetectionRuleArgs{ +// ApplicationInsightsId: exampleInsights.ID(), +// Enabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Insights Smart Detection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/standardWebTest.go b/sdk/go/azure/appinsights/standardWebTest.go index d6394e1436..21c54ada82 100644 --- a/sdk/go/azure/appinsights/standardWebTest.go +++ b/sdk/go/azure/appinsights/standardWebTest.go @@ -15,6 +15,55 @@ import ( // Manages a Application Insights Standard WebTest. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// _, err = appinsights.NewStandardWebTest(ctx, "exampleStandardWebTest", &appinsights.StandardWebTestArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// ApplicationInsightsId: exampleInsights.ID(), +// GeoLocations: pulumi.StringArray{ +// pulumi.String("example"), +// }, +// Request: &appinsights.StandardWebTestRequestArgs{ +// Url: pulumi.String("http://www.example.com"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Insights Standard WebTests can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/webTest.go b/sdk/go/azure/appinsights/webTest.go index 8b46e7e41c..a41a9fef3a 100644 --- a/sdk/go/azure/appinsights/webTest.go +++ b/sdk/go/azure/appinsights/webTest.go @@ -15,6 +15,67 @@ import ( // Manages an Application Insights WebTest. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleWebTest, err := appinsights.NewWebTest(ctx, "exampleWebTest", &appinsights.WebTestArgs{ +// Location: exampleInsights.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// Kind: pulumi.String("ping"), +// Frequency: pulumi.Int(300), +// Timeout: pulumi.Int(60), +// Enabled: pulumi.Bool(true), +// GeoLocations: pulumi.StringArray{ +// pulumi.String("us-tx-sn1-azr"), +// pulumi.String("us-il-ch1-azr"), +// }, +// Configuration: pulumi.String(` +// +// +// +// +// +// `), +// +// }) +// if err != nil { +// return err +// } +// ctx.Export("webtestId", exampleWebTest.ID()) +// ctx.Export("webtestsSyntheticId", exampleWebTest.SyntheticMonitorId) +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Insights Web Tests can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/workbook.go b/sdk/go/azure/appinsights/workbook.go index ebb0f71620..ef17f42192 100644 --- a/sdk/go/azure/appinsights/workbook.go +++ b/sdk/go/azure/appinsights/workbook.go @@ -15,6 +15,67 @@ import ( // Manages an Azure Workbook. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "version": "Notebook/1.0", +// "items": []map[string]interface{}{ +// map[string]interface{}{ +// "type": 1, +// "content": map[string]interface{}{ +// "json": "Test2022", +// }, +// "name": "text - 0", +// }, +// }, +// "isLocked": false, +// "fallbackResourceIds": []string{ +// "Azure Monitor", +// }, +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = appinsights.NewWorkbook(ctx, "exampleWorkbook", &appinsights.WorkbookArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DisplayName: pulumi.String("workbook1"), +// DataJson: pulumi.String(json0), +// Tags: pulumi.StringMap{ +// "ENV": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Workbooks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appinsights/workbookTemplate.go b/sdk/go/azure/appinsights/workbookTemplate.go index 259472ad73..36ae6e1df0 100644 --- a/sdk/go/azure/appinsights/workbookTemplate.go +++ b/sdk/go/azure/appinsights/workbookTemplate.go @@ -15,6 +15,109 @@ import ( // Manages an Application Insights Workbook Template. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "version": "Notebook/1.0", +// "items": []map[string]interface{}{ +// map[string]interface{}{ +// "type": 1, +// "content": map[string]interface{}{ +// "json": "## New workbook\n---\n\nWelcome to your new workbook.", +// }, +// "name": "text - 2", +// }, +// }, +// "styleSettings": nil, +// "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// tmpJSON1, err := json.Marshal(map[string]interface{}{ +// "ar": []map[string]interface{}{ +// map[string]interface{}{ +// "galleries": []map[string]interface{}{ +// map[string]interface{}{ +// "name": "test", +// "category": "Failures", +// "type": "tsg", +// "resourceType": "microsoft.insights/components", +// "order": 100, +// }, +// }, +// "templateData": map[string]interface{}{ +// "version": "Notebook/1.0", +// "items": []map[string]interface{}{ +// map[string]interface{}{ +// "type": 1, +// "content": map[string]interface{}{ +// "json": "## New workbook\n---\n\nWelcome to your new workbook.", +// }, +// "name": "text - 2", +// }, +// }, +// "styleSettings": nil, +// "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// json1 := string(tmpJSON1) +// _, err = appinsights.NewWorkbookTemplate(ctx, "exampleWorkbookTemplate", &appinsights.WorkbookTemplateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// Author: pulumi.String("test author"), +// Priority: pulumi.Int(1), +// Galleries: appinsights.WorkbookTemplateGalleryArray{ +// &appinsights.WorkbookTemplateGalleryArgs{ +// Category: pulumi.String("workbook"), +// Name: pulumi.String("test"), +// Order: pulumi.Int(100), +// ResourceType: pulumi.String("microsoft.insights/components"), +// Type: pulumi.String("tsg"), +// }, +// }, +// TemplateData: pulumi.String(json0), +// Localized: pulumi.String(json1), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Insights Workbook Template can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/getSpringCloudApp.go b/sdk/go/azure/appplatform/getSpringCloudApp.go index f354807976..675f84e126 100644 --- a/sdk/go/azure/appplatform/getSpringCloudApp.go +++ b/sdk/go/azure/appplatform/getSpringCloudApp.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Spring Cloud Application. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appplatform.LookupSpringCloudApp(ctx, &appplatform.LookupSpringCloudAppArgs{ +// Name: azurerm_spring_cloud_app.Example.Name, +// ResourceGroupName: azurerm_spring_cloud_app.Example.Resource_group_name, +// ServiceName: azurerm_spring_cloud_app.Example.Service_name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("springCloudAppId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupSpringCloudApp(ctx *pulumi.Context, args *LookupSpringCloudAppArgs, opts ...pulumi.InvokeOption) (*LookupSpringCloudAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSpringCloudAppResult diff --git a/sdk/go/azure/appplatform/getSpringCloudService.go b/sdk/go/azure/appplatform/getSpringCloudService.go index 97a8430a6d..ba38e0ad26 100644 --- a/sdk/go/azure/appplatform/getSpringCloudService.go +++ b/sdk/go/azure/appplatform/getSpringCloudService.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Spring Cloud Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appplatform.LookupSpringCloudService(ctx, &appplatform.LookupSpringCloudServiceArgs{ +// Name: azurerm_spring_cloud_service.Example.Name, +// ResourceGroupName: azurerm_spring_cloud_service.Example.Resource_group_name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("springCloudServiceId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupSpringCloudService(ctx *pulumi.Context, args *LookupSpringCloudServiceArgs, opts ...pulumi.InvokeOption) (*LookupSpringCloudServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSpringCloudServiceResult diff --git a/sdk/go/azure/appplatform/springCloudAccelerator.go b/sdk/go/azure/appplatform/springCloudAccelerator.go index 6104acc355..19d406f52d 100644 --- a/sdk/go/azure/appplatform/springCloudAccelerator.go +++ b/sdk/go/azure/appplatform/springCloudAccelerator.go @@ -17,6 +17,47 @@ import ( // // Manages a Spring Cloud Accelerator. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudAccelerator(ctx, "exampleSpringCloudAccelerator", &appplatform.SpringCloudAcceleratorArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudActiveDeployment.go b/sdk/go/azure/appplatform/springCloudActiveDeployment.go index 43494db16e..ad6f9bca98 100644 --- a/sdk/go/azure/appplatform/springCloudActiveDeployment.go +++ b/sdk/go/azure/appplatform/springCloudActiveDeployment.go @@ -15,6 +15,73 @@ import ( // Manages an Active Azure Spring Cloud Deployment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// Identity: &appplatform.SpringCloudAppIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudJavaDeployment, err := appplatform.NewSpringCloudJavaDeployment(ctx, "exampleSpringCloudJavaDeployment", &appplatform.SpringCloudJavaDeploymentArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// InstanceCount: pulumi.Int(2), +// JvmOptions: pulumi.String("-XX:+PrintGC"), +// RuntimeVersion: pulumi.String("Java_11"), +// Quota: &appplatform.SpringCloudJavaDeploymentQuotaArgs{ +// Cpu: pulumi.String("2"), +// Memory: pulumi.String("4Gi"), +// }, +// EnvironmentVariables: pulumi.StringMap{ +// "Env": pulumi.String("Staging"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudActiveDeployment(ctx, "exampleSpringCloudActiveDeployment", &appplatform.SpringCloudActiveDeploymentArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// DeploymentName: exampleSpringCloudJavaDeployment.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Active Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudApiPortal.go b/sdk/go/azure/appplatform/springCloudApiPortal.go index 80816b742f..97522dc1ef 100644 --- a/sdk/go/azure/appplatform/springCloudApiPortal.go +++ b/sdk/go/azure/appplatform/springCloudApiPortal.go @@ -17,6 +17,67 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudGateway, err := appplatform.NewSpringCloudGateway(ctx, "exampleSpringCloudGateway", &appplatform.SpringCloudGatewayArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudApiPortal(ctx, "exampleSpringCloudApiPortal", &appplatform.SpringCloudApiPortalArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// GatewayIds: pulumi.StringArray{ +// exampleSpringCloudGateway.ID(), +// }, +// HttpsOnlyEnabled: pulumi.Bool(false), +// PublicNetworkAccessEnabled: pulumi.Bool(true), +// InstanceCount: pulumi.Int(1), +// Sso: &appplatform.SpringCloudApiPortalSsoArgs{ +// ClientId: pulumi.String("test"), +// ClientSecret: pulumi.String("secret"), +// IssuerUri: pulumi.String("https://www.example.com/issueToken"), +// Scopes: pulumi.StringArray{ +// pulumi.String("read"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud API Portals can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudApiPortalCustomDomain.go b/sdk/go/azure/appplatform/springCloudApiPortalCustomDomain.go index 07eb32ccc8..27796406bf 100644 --- a/sdk/go/azure/appplatform/springCloudApiPortalCustomDomain.go +++ b/sdk/go/azure/appplatform/springCloudApiPortalCustomDomain.go @@ -17,6 +17,62 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudGateway, err := appplatform.NewSpringCloudGateway(ctx, "exampleSpringCloudGateway", &appplatform.SpringCloudGatewayArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApiPortal, err := appplatform.NewSpringCloudApiPortal(ctx, "exampleSpringCloudApiPortal", &appplatform.SpringCloudApiPortalArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// GatewayIds: pulumi.StringArray{ +// exampleSpringCloudGateway.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudApiPortalCustomDomain(ctx, "exampleSpringCloudApiPortalCustomDomain", &appplatform.SpringCloudApiPortalCustomDomainArgs{ +// SpringCloudApiPortalId: exampleSpringCloudApiPortal.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud API Portal Domains can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudApp.go b/sdk/go/azure/appplatform/springCloudApp.go index 4b3d988c23..e40a1f2103 100644 --- a/sdk/go/azure/appplatform/springCloudApp.go +++ b/sdk/go/azure/appplatform/springCloudApp.go @@ -15,6 +15,50 @@ import ( // Manage an Azure Spring Cloud Application. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// Identity: &appplatform.SpringCloudAppIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Application can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudAppCosmosDBAssociation.go b/sdk/go/azure/appplatform/springCloudAppCosmosDBAssociation.go index deb2cf8077..017fd3a3d8 100644 --- a/sdk/go/azure/appplatform/springCloudAppCosmosDBAssociation.go +++ b/sdk/go/azure/appplatform/springCloudAppCosmosDBAssociation.go @@ -15,6 +15,75 @@ import ( // Associates a Spring Cloud Application with a CosmosDB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudAppCosmosDBAssociation(ctx, "exampleSpringCloudAppCosmosDBAssociation", &appplatform.SpringCloudAppCosmosDBAssociationArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// CosmosdbAccountId: exampleAccount.ID(), +// ApiType: pulumi.String("table"), +// CosmosdbAccessKey: exampleAccount.PrimaryKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Application CosmosDB Association can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudAppMysqlAssociation.go b/sdk/go/azure/appplatform/springCloudAppMysqlAssociation.go index 7ad8863760..a10fa2f51b 100644 --- a/sdk/go/azure/appplatform/springCloudAppMysqlAssociation.go +++ b/sdk/go/azure/appplatform/springCloudAppMysqlAssociation.go @@ -15,6 +15,81 @@ import ( // Associates a Spring Cloud Application with a MySQL Database. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mysqladminun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// Version: pulumi.String("5.7"), +// SslEnforcementEnabled: pulumi.Bool(true), +// SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := mysql.NewDatabase(ctx, "exampleDatabase", &mysql.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Charset: pulumi.String("utf8"), +// Collation: pulumi.String("utf8_unicode_ci"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudAppMysqlAssociation(ctx, "exampleSpringCloudAppMysqlAssociation", &appplatform.SpringCloudAppMysqlAssociationArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// MysqlServerId: exampleServer.ID(), +// DatabaseName: exampleDatabase.Name, +// Username: exampleServer.AdministratorLogin, +// Password: exampleServer.AdministratorLoginPassword, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Application MySQL Association can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudAppRedisAssociation.go b/sdk/go/azure/appplatform/springCloudAppRedisAssociation.go index 4c130a4ded..56957144a1 100644 --- a/sdk/go/azure/appplatform/springCloudAppRedisAssociation.go +++ b/sdk/go/azure/appplatform/springCloudAppRedisAssociation.go @@ -15,6 +15,68 @@ import ( // Associates a Spring Cloud Application with a Redis Cache. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// }) +// if err != nil { +// return err +// } +// exampleCache, err := redis.NewCache(ctx, "exampleCache", &redis.CacheArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Capacity: pulumi.Int(0), +// Family: pulumi.String("C"), +// SkuName: pulumi.String("Basic"), +// EnableNonSslPort: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudAppRedisAssociation(ctx, "exampleSpringCloudAppRedisAssociation", &appplatform.SpringCloudAppRedisAssociationArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// RedisCacheId: exampleCache.ID(), +// RedisAccessKey: exampleCache.PrimaryAccessKey, +// SslEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Application Redis Association can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.go b/sdk/go/azure/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.go index 0b851d892f..18fd8a396e 100644 --- a/sdk/go/azure/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.go +++ b/sdk/go/azure/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.go @@ -17,6 +17,62 @@ import ( // // Manages a Spring Cloud Application Performance Monitoring resource for Application Insights. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudApplicationInsightsApplicationPerformanceMonitoring(ctx, "exampleSpringCloudApplicationInsightsApplicationPerformanceMonitoring", &appplatform.SpringCloudApplicationInsightsApplicationPerformanceMonitoringArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// ConnectionString: exampleInsights.InstrumentationKey, +// GloballyEnabled: pulumi.Bool(true), +// RoleName: pulumi.String("test-role"), +// RoleInstance: pulumi.String("test-instance"), +// SamplingPercentage: pulumi.Int(50), +// SamplingRequestsPerSecond: pulumi.Int(10), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Application Performance Monitoring resource for Application Insights can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudApplicationLiveView.go b/sdk/go/azure/appplatform/springCloudApplicationLiveView.go index 41da653127..d634fb8be9 100644 --- a/sdk/go/azure/appplatform/springCloudApplicationLiveView.go +++ b/sdk/go/azure/appplatform/springCloudApplicationLiveView.go @@ -17,6 +17,47 @@ import ( // // Manages a Spring Cloud Application Live View. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudApplicationLiveView(ctx, "exampleSpringCloudApplicationLiveView", &appplatform.SpringCloudApplicationLiveViewArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Application Live Views can be imported using the `resource id`, e.g. g diff --git a/sdk/go/azure/appplatform/springCloudBuildDeployment.go b/sdk/go/azure/appplatform/springCloudBuildDeployment.go index 6fefdfab82..f3ebb58d95 100644 --- a/sdk/go/azure/appplatform/springCloudBuildDeployment.go +++ b/sdk/go/azure/appplatform/springCloudBuildDeployment.go @@ -17,6 +17,64 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleSpringCloudService.ResourceGroupName, +// ServiceName: exampleSpringCloudService.Name, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudBuildDeployment(ctx, "exampleSpringCloudBuildDeployment", &appplatform.SpringCloudBuildDeploymentArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// BuildResultId: pulumi.String(""), +// InstanceCount: pulumi.Int(2), +// EnvironmentVariables: pulumi.StringMap{ +// "Foo": pulumi.String("Bar"), +// "Env": pulumi.String("Staging"), +// }, +// Quota: &appplatform.SpringCloudBuildDeploymentQuotaArgs{ +// Cpu: pulumi.String("2"), +// Memory: pulumi.String("4Gi"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Build Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudBuildPackBinding.go b/sdk/go/azure/appplatform/springCloudBuildPackBinding.go index cfae187082..56490a2e03 100644 --- a/sdk/go/azure/appplatform/springCloudBuildPackBinding.go +++ b/sdk/go/azure/appplatform/springCloudBuildPackBinding.go @@ -17,6 +17,76 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudBuilder, err := appplatform.NewSpringCloudBuilder(ctx, "exampleSpringCloudBuilder", &appplatform.SpringCloudBuilderArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// BuildPackGroups: appplatform.SpringCloudBuilderBuildPackGroupArray{ +// &appplatform.SpringCloudBuilderBuildPackGroupArgs{ +// Name: pulumi.String("mix"), +// BuildPackIds: pulumi.StringArray{ +// pulumi.String("tanzu-Build Packs/java-azure"), +// }, +// }, +// }, +// Stack: &appplatform.SpringCloudBuilderStackArgs{ +// Id: pulumi.String("io.Build Packs.stacks.bionic"), +// Version: pulumi.String("base"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudBuildPackBinding(ctx, "exampleSpringCloudBuildPackBinding", &appplatform.SpringCloudBuildPackBindingArgs{ +// SpringCloudBuilderId: exampleSpringCloudBuilder.ID(), +// BindingType: pulumi.String("ApplicationInsights"), +// Launch: &appplatform.SpringCloudBuildPackBindingLaunchArgs{ +// Properties: pulumi.StringMap{ +// "abc": pulumi.String("def"), +// "any-string": pulumi.String("any-string"), +// "sampling-rate": pulumi.String("12.0"), +// }, +// Secrets: pulumi.StringMap{ +// "connection-string": pulumi.String("XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Build Pack Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudBuilder.go b/sdk/go/azure/appplatform/springCloudBuilder.go index e35ffb05b5..04ee2d5b18 100644 --- a/sdk/go/azure/appplatform/springCloudBuilder.go +++ b/sdk/go/azure/appplatform/springCloudBuilder.go @@ -17,6 +17,59 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudBuilder(ctx, "exampleSpringCloudBuilder", &appplatform.SpringCloudBuilderArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// BuildPackGroups: appplatform.SpringCloudBuilderBuildPackGroupArray{ +// &appplatform.SpringCloudBuilderBuildPackGroupArgs{ +// Name: pulumi.String("mix"), +// BuildPackIds: pulumi.StringArray{ +// pulumi.String("tanzu-buildpacks/java-azure"), +// }, +// }, +// }, +// Stack: &appplatform.SpringCloudBuilderStackArgs{ +// Id: pulumi.String("io.buildpacks.stacks.bionic"), +// Version: pulumi.String("base"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Builders can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudCertificate.go b/sdk/go/azure/appplatform/springCloudCertificate.go index 3a5ef1bc47..d6ed4a7320 100644 --- a/sdk/go/azure/appplatform/springCloudCertificate.go +++ b/sdk/go/azure/appplatform/springCloudCertificate.go @@ -15,6 +15,139 @@ import ( // Manages an Azure Spring Cloud Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("Azure Spring Cloud Resource Provider"), +// }, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// }, +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("Update"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(exampleServicePrincipal.ObjectId), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// CertificatePolicy: &keyvault.CertificateCertificatePolicyArgs{ +// IssuerParameters: &keyvault.CertificateCertificatePolicyIssuerParametersArgs{ +// Name: pulumi.String("Self"), +// }, +// KeyProperties: &keyvault.CertificateCertificatePolicyKeyPropertiesArgs{ +// Exportable: pulumi.Bool(true), +// KeySize: pulumi.Int(2048), +// KeyType: pulumi.String("RSA"), +// ReuseKey: pulumi.Bool(true), +// }, +// LifetimeActions: keyvault.CertificateCertificatePolicyLifetimeActionArray{ +// &keyvault.CertificateCertificatePolicyLifetimeActionArgs{ +// Action: &keyvault.CertificateCertificatePolicyLifetimeActionActionArgs{ +// ActionType: pulumi.String("AutoRenew"), +// }, +// Trigger: &keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs{ +// DaysBeforeExpiry: pulumi.Int(30), +// }, +// }, +// }, +// SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{ +// ContentType: pulumi.String("application/x-pkcs12"), +// }, +// X509CertificateProperties: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs{ +// KeyUsages: pulumi.StringArray{ +// pulumi.String("cRLSign"), +// pulumi.String("dataEncipherment"), +// pulumi.String("digitalSignature"), +// pulumi.String("keyAgreement"), +// pulumi.String("keyCertSign"), +// pulumi.String("keyEncipherment"), +// }, +// Subject: pulumi.String("CN=contoso.com"), +// ValidityInMonths: pulumi.Int(12), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudCertificate(ctx, "exampleSpringCloudCertificate", &appplatform.SpringCloudCertificateArgs{ +// ResourceGroupName: exampleSpringCloudService.ResourceGroupName, +// ServiceName: exampleSpringCloudService.Name, +// KeyVaultCertificateId: exampleCertificate.ID(), +// ExcludePrivateKey: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudConfigurationService.go b/sdk/go/azure/appplatform/springCloudConfigurationService.go index f6eb8d0258..ba27c9e79f 100644 --- a/sdk/go/azure/appplatform/springCloudConfigurationService.go +++ b/sdk/go/azure/appplatform/springCloudConfigurationService.go @@ -17,6 +17,64 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudConfigurationService(ctx, "exampleSpringCloudConfigurationService", &appplatform.SpringCloudConfigurationServiceArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// Repositories: appplatform.SpringCloudConfigurationServiceRepositoryArray{ +// &appplatform.SpringCloudConfigurationServiceRepositoryArgs{ +// Name: pulumi.String("fake"), +// Label: pulumi.String("master"), +// Patterns: pulumi.StringArray{ +// pulumi.String("app/dev"), +// }, +// Uri: pulumi.String("https://github.com/Azure-Samples/piggymetrics"), +// SearchPaths: pulumi.StringArray{ +// pulumi.String("dir1"), +// pulumi.String("dir2"), +// }, +// StrictHostKeyChecking: pulumi.Bool(false), +// Username: pulumi.String("adminuser"), +// Password: pulumi.String("H@Sh1CoR3!"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Configuration Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudConnection.go b/sdk/go/azure/appplatform/springCloudConnection.go index 132f18588b..52afe95a6d 100644 --- a/sdk/go/azure/appplatform/springCloudConnection.go +++ b/sdk/go/azure/appplatform/springCloudConnection.go @@ -15,6 +15,104 @@ import ( // Manages a service connector for spring cloud app. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("BoundedStaleness"), +// MaxIntervalInSeconds: pulumi.Int(10), +// MaxStalenessPrefix: pulumi.Int(200), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/definition"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// Identity: &appplatform.SpringCloudAppIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudJavaDeployment, err := appplatform.NewSpringCloudJavaDeployment(ctx, "exampleSpringCloudJavaDeployment", &appplatform.SpringCloudJavaDeploymentArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudConnection(ctx, "exampleSpringCloudConnection", &appplatform.SpringCloudConnectionArgs{ +// SpringCloudId: exampleSpringCloudJavaDeployment.ID(), +// TargetResourceId: exampleSqlDatabase.ID(), +// Authentication: &appplatform.SpringCloudConnectionAuthenticationArgs{ +// Type: pulumi.String("systemAssignedIdentity"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Connector for spring cloud can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudContainerDeployment.go b/sdk/go/azure/appplatform/springCloudContainerDeployment.go index 04da11bd4c..2c81c3c0a7 100644 --- a/sdk/go/azure/appplatform/springCloudContainerDeployment.go +++ b/sdk/go/azure/appplatform/springCloudContainerDeployment.go @@ -15,6 +15,70 @@ import ( // Manages a Spring Cloud Container Deployment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleSpringCloudService.ResourceGroupName, +// ServiceName: exampleSpringCloudService.Name, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudContainerDeployment(ctx, "exampleSpringCloudContainerDeployment", &appplatform.SpringCloudContainerDeploymentArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// InstanceCount: pulumi.Int(2), +// Arguments: pulumi.StringArray{ +// pulumi.String("-cp"), +// pulumi.String("/app/resources:/app/classes:/app/libs/*"), +// pulumi.String("hello.Application"), +// }, +// Commands: pulumi.StringArray{ +// pulumi.String("java"), +// }, +// EnvironmentVariables: pulumi.StringMap{ +// "Foo": pulumi.String("Bar"), +// "Env": pulumi.String("Staging"), +// }, +// Server: pulumi.String("docker.io"), +// Image: pulumi.String("springio/gs-spring-boot-docker"), +// LanguageFramework: pulumi.String("springboot"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Container Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudCustomizedAccelerator.go b/sdk/go/azure/appplatform/springCloudCustomizedAccelerator.go index 7b4d47ef28..7381588822 100644 --- a/sdk/go/azure/appplatform/springCloudCustomizedAccelerator.go +++ b/sdk/go/azure/appplatform/springCloudCustomizedAccelerator.go @@ -15,6 +15,65 @@ import ( // Manages a Spring Cloud Customized Accelerator. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudAccelerator, err := appplatform.NewSpringCloudAccelerator(ctx, "exampleSpringCloudAccelerator", &appplatform.SpringCloudAcceleratorArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudCustomizedAccelerator(ctx, "exampleSpringCloudCustomizedAccelerator", &appplatform.SpringCloudCustomizedAcceleratorArgs{ +// SpringCloudAcceleratorId: exampleSpringCloudAccelerator.ID(), +// GitRepository: &appplatform.SpringCloudCustomizedAcceleratorGitRepositoryArgs{ +// Url: pulumi.String("https://github.com/Azure-Samples/piggymetrics"), +// GitTag: pulumi.String("spring.version.2.0.3"), +// IntervalInSeconds: pulumi.Int(100), +// }, +// AcceleratorTags: pulumi.StringArray{ +// pulumi.String("tag-a"), +// pulumi.String("tag-b"), +// }, +// Description: pulumi.String("example description"), +// DisplayName: pulumi.String("example name"), +// IconUrl: pulumi.String("https://images.freecreatives.com/wp-content/uploads/2015/05/smiley-559124_640.jpg"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Customized Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudDevToolPortal.go b/sdk/go/azure/appplatform/springCloudDevToolPortal.go index 33c4e37c96..cb179b2334 100644 --- a/sdk/go/azure/appplatform/springCloudDevToolPortal.go +++ b/sdk/go/azure/appplatform/springCloudDevToolPortal.go @@ -17,6 +17,66 @@ import ( // // Manages a Spring Cloud Dev Tool Portal. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudDevToolPortal(ctx, "exampleSpringCloudDevToolPortal", &appplatform.SpringCloudDevToolPortalArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// PublicNetworkAccessEnabled: pulumi.Bool(true), +// Sso: &appplatform.SpringCloudDevToolPortalSsoArgs{ +// ClientId: pulumi.String("example id"), +// ClientSecret: pulumi.String("example secret"), +// MetadataUrl: pulumi.String(fmt.Sprintf("https://login.microsoftonline.com/%v/v2.0/.well-known/openid-configuration", current.TenantId)), +// Scopes: pulumi.StringArray{ +// pulumi.String("openid"), +// pulumi.String("profile"), +// pulumi.String("email"), +// }, +// }, +// ApplicationAcceleratorEnabled: pulumi.Bool(true), +// ApplicationLiveViewEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Dev Tool Portals can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudGateway.go b/sdk/go/azure/appplatform/springCloudGateway.go index 0868e00a09..5dbd9701d6 100644 --- a/sdk/go/azure/appplatform/springCloudGateway.go +++ b/sdk/go/azure/appplatform/springCloudGateway.go @@ -17,6 +17,85 @@ import ( // // Manages a Spring Cloud Gateway. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudGateway(ctx, "exampleSpringCloudGateway", &appplatform.SpringCloudGatewayArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// HttpsOnly: pulumi.Bool(false), +// PublicNetworkAccessEnabled: pulumi.Bool(true), +// InstanceCount: pulumi.Int(2), +// ApiMetadata: &appplatform.SpringCloudGatewayApiMetadataArgs{ +// Description: pulumi.String("example description"), +// DocumentationUrl: pulumi.String("https://www.example.com/docs"), +// ServerUrl: pulumi.String("https://wwww.example.com"), +// Title: pulumi.String("example title"), +// Version: pulumi.String("1.0"), +// }, +// Cors: &appplatform.SpringCloudGatewayCorsArgs{ +// CredentialsAllowed: pulumi.Bool(false), +// AllowedHeaders: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// AllowedMethods: pulumi.StringArray{ +// pulumi.String("PUT"), +// }, +// AllowedOrigins: pulumi.StringArray{ +// pulumi.String("example.com"), +// }, +// ExposedHeaders: pulumi.StringArray{ +// pulumi.String("x-example-header"), +// }, +// MaxAgeSeconds: pulumi.Int(86400), +// }, +// Quota: &appplatform.SpringCloudGatewayQuotaArgs{ +// Cpu: pulumi.String("1"), +// Memory: pulumi.String("2Gi"), +// }, +// Sso: &appplatform.SpringCloudGatewaySsoArgs{ +// ClientId: pulumi.String("example id"), +// ClientSecret: pulumi.String("example secret"), +// IssuerUri: pulumi.String("https://www.test.com/issueToken"), +// Scopes: pulumi.StringArray{ +// pulumi.String("read"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudGatewayCustomDomain.go b/sdk/go/azure/appplatform/springCloudGatewayCustomDomain.go index 4cb3e44545..6de130af70 100644 --- a/sdk/go/azure/appplatform/springCloudGatewayCustomDomain.go +++ b/sdk/go/azure/appplatform/springCloudGatewayCustomDomain.go @@ -17,6 +17,53 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudGateway, err := appplatform.NewSpringCloudGateway(ctx, "exampleSpringCloudGateway", &appplatform.SpringCloudGatewayArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudGatewayCustomDomain(ctx, "exampleSpringCloudGatewayCustomDomain", &appplatform.SpringCloudGatewayCustomDomainArgs{ +// SpringCloudGatewayId: exampleSpringCloudGateway.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Gateway Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudGatewayRouteConfig.go b/sdk/go/azure/appplatform/springCloudGatewayRouteConfig.go index 72bae8b404..91ca45a14a 100644 --- a/sdk/go/azure/appplatform/springCloudGatewayRouteConfig.go +++ b/sdk/go/azure/appplatform/springCloudGatewayRouteConfig.go @@ -17,6 +17,83 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("E0"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudGateway, err := appplatform.NewSpringCloudGateway(ctx, "exampleSpringCloudGateway", &appplatform.SpringCloudGatewayArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudGatewayRouteConfig(ctx, "exampleSpringCloudGatewayRouteConfig", &appplatform.SpringCloudGatewayRouteConfigArgs{ +// SpringCloudGatewayId: exampleSpringCloudGateway.ID(), +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// Protocol: pulumi.String("HTTPS"), +// Routes: appplatform.SpringCloudGatewayRouteConfigRouteArray{ +// &appplatform.SpringCloudGatewayRouteConfigRouteArgs{ +// Description: pulumi.String("example description"), +// Filters: pulumi.StringArray{ +// pulumi.String("StripPrefix=2"), +// pulumi.String("RateLimit=1,1s"), +// }, +// Order: pulumi.Int(1), +// Predicates: pulumi.StringArray{ +// pulumi.String("Path=/api5/customer/**"), +// }, +// SsoValidationEnabled: pulumi.Bool(true), +// Title: pulumi.String("myApp route config"), +// TokenRelay: pulumi.Bool(true), +// Uri: pulumi.String("https://www.example.com"), +// ClassificationTags: pulumi.StringArray{ +// pulumi.String("tag1"), +// pulumi.String("tag2"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Gateway Route Configs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudJavaDeployment.go b/sdk/go/azure/appplatform/springCloudJavaDeployment.go index c417e9c7ba..cc59f6920a 100644 --- a/sdk/go/azure/appplatform/springCloudJavaDeployment.go +++ b/sdk/go/azure/appplatform/springCloudJavaDeployment.go @@ -17,6 +17,67 @@ import ( // // > **NOTE:** This resource is applicable only for Spring Cloud Service with basic and standard tier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "exampleSpringCloudApp", &appplatform.SpringCloudAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceName: exampleSpringCloudService.Name, +// Identity: &appplatform.SpringCloudAppIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudJavaDeployment(ctx, "exampleSpringCloudJavaDeployment", &appplatform.SpringCloudJavaDeploymentArgs{ +// SpringCloudAppId: exampleSpringCloudApp.ID(), +// InstanceCount: pulumi.Int(2), +// JvmOptions: pulumi.String("-XX:+PrintGC"), +// Quota: &appplatform.SpringCloudJavaDeploymentQuotaArgs{ +// Cpu: pulumi.String("2"), +// Memory: pulumi.String("4Gi"), +// }, +// RuntimeVersion: pulumi.String("Java_11"), +// EnvironmentVariables: pulumi.StringMap{ +// "Foo": pulumi.String("Bar"), +// "Env": pulumi.String("Staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudService.go b/sdk/go/azure/appplatform/springCloudService.go index eaa68041b5..9510a21885 100644 --- a/sdk/go/azure/appplatform/springCloudService.go +++ b/sdk/go/azure/appplatform/springCloudService.go @@ -15,6 +15,65 @@ import ( // Manages an Azure Spring Cloud Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("S0"), +// ConfigServerGitSetting: &appplatform.SpringCloudServiceConfigServerGitSettingArgs{ +// Uri: pulumi.String("https://github.com/Azure-Samples/piggymetrics"), +// Label: pulumi.String("config"), +// SearchPaths: pulumi.StringArray{ +// pulumi.String("dir1"), +// pulumi.String("dir2"), +// }, +// }, +// Trace: &appplatform.SpringCloudServiceTraceArgs{ +// ConnectionString: exampleInsights.ConnectionString, +// SampleRate: pulumi.Float64(10), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appplatform/springCloudStorage.go b/sdk/go/azure/appplatform/springCloudStorage.go index 5dceb6fdd7..c7d2747a76 100644 --- a/sdk/go/azure/appplatform/springCloudStorage.go +++ b/sdk/go/azure/appplatform/springCloudStorage.go @@ -15,6 +15,58 @@ import ( // Manages a Spring Cloud Storage. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "exampleSpringCloudService", &appplatform.SpringCloudServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = appplatform.NewSpringCloudStorage(ctx, "exampleSpringCloudStorage", &appplatform.SpringCloudStorageArgs{ +// SpringCloudServiceId: exampleSpringCloudService.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spring Cloud Storages can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/activeSlot.go b/sdk/go/azure/appservice/activeSlot.go index 1f654012ba..58385db486 100644 --- a/sdk/go/azure/appservice/activeSlot.go +++ b/sdk/go/azure/appservice/activeSlot.go @@ -18,6 +18,56 @@ import ( // !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.WebAppActiveSlot` resource instead. // // > **Note:** When using Slots - the `appSettings`, `connectionString` and `siteConfig` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := random.NewRandomId(ctx, "server", nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", nil) +// if err != nil { +// return err +// } +// _, err = appservice.NewPlan(ctx, "examplePlan", nil) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", nil) +// if err != nil { +// return err +// } +// exampleSlot, err := appservice.NewSlot(ctx, "exampleSlot", nil) +// if err != nil { +// return err +// } +// _, err = appservice.NewActiveSlot(ctx, "exampleActiveSlot", &appservice.ActiveSlotArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AppServiceName: exampleAppService.Name, +// AppServiceSlotName: exampleSlot.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type ActiveSlot struct { pulumi.CustomResourceState diff --git a/sdk/go/azure/appservice/appConnection.go b/sdk/go/azure/appservice/appConnection.go index f4c42ef001..a4ec5a470b 100644 --- a/sdk/go/azure/appservice/appConnection.go +++ b/sdk/go/azure/appservice/appConnection.go @@ -15,6 +15,110 @@ import ( // Manages a service connector for function app. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("BoundedStaleness"), +// MaxIntervalInSeconds: pulumi.Int(10), +// MaxStalenessPrefix: pulumi.Int(200), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/definition"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleStorage/accountAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("P1v2"), +// OsType: pulumi.String("Linux"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionApp(ctx, "test", &appservice.FunctionAppArgs{ +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// AppServicePlanId: pulumi.Any(azurerm_app_service_plan.Test.Id), +// StorageAccountName: pulumi.Any(azurerm_storage_account.Test.Name), +// StorageAccountAccessKey: pulumi.Any(azurerm_storage_account.Test.Primary_access_key), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewAppConnection(ctx, "exampleAppConnection", &appservice.AppConnectionArgs{ +// FunctionAppId: pulumi.Any(azurerm_function_app.Example.Id), +// TargetResourceId: pulumi.Any(azurerm_cosmosdb_account.Test.Id), +// Authentication: &appservice.AppConnectionAuthenticationArgs{ +// Type: pulumi.String("systemAssignedIdentity"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/appService.go b/sdk/go/azure/appservice/appService.go index f5a24a6774..b535a658a2 100644 --- a/sdk/go/azure/appservice/appService.go +++ b/sdk/go/azure/appservice/appService.go @@ -19,6 +19,68 @@ import ( // // > **Note:** When using Slots - the `appSettings`, `connectionString` and `siteConfig` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. // +// ## Example Usage +// +// This example provisions a Windows App Service. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// SiteConfig: &appservice.AppServiceSiteConfigArgs{ +// DotnetFrameworkVersion: pulumi.String("v4.0"), +// ScmType: pulumi.String("LocalGit"), +// }, +// AppSettings: pulumi.StringMap{ +// "SOME_KEY": pulumi.String("some-value"), +// }, +// ConnectionStrings: appservice.AppServiceConnectionStringArray{ +// &appservice.AppServiceConnectionStringArgs{ +// Name: pulumi.String("Database"), +// Type: pulumi.String("SQLServer"), +// Value: pulumi.String("Server=some-server.mydomain.com;Integrated Security=SSPI"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/certificate.go b/sdk/go/azure/appservice/certificate.go index d08fcb5128..eea7b790ee 100644 --- a/sdk/go/azure/appservice/certificate.go +++ b/sdk/go/azure/appservice/certificate.go @@ -15,6 +15,55 @@ import ( // Manages an App Service certificate. // +// ## Example Usage +// +// This example provisions an App Service Certificate from a Local File. +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewCertificate(ctx, "exampleCertificate", &appservice.CertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PfxBlob: filebase64OrPanic("certificate.pfx"), +// Password: pulumi.String("password123!"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/certificateOrder.go b/sdk/go/azure/appservice/certificateOrder.go index 40e3664f75..217049219e 100644 --- a/sdk/go/azure/appservice/certificateOrder.go +++ b/sdk/go/azure/appservice/certificateOrder.go @@ -15,6 +15,42 @@ import ( // Manages an App Service Certificate Order. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewCertificateOrder(ctx, "exampleCertificateOrder", &appservice.CertificateOrderArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("global"), +// DistinguishedName: pulumi.String("CN=example.com"), +// ProductType: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Certificate Orders can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/connection.go b/sdk/go/azure/appservice/connection.go index 77f4e707c3..3c1c764191 100644 --- a/sdk/go/azure/appservice/connection.go +++ b/sdk/go/azure/appservice/connection.go @@ -15,6 +15,99 @@ import ( // Manages a service connector for app service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("BoundedStaleness"), +// MaxIntervalInSeconds: pulumi.Int(10), +// MaxStalenessPrefix: pulumi.Int(200), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/definition"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("P1v2"), +// OsType: pulumi.String("Linux"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxWebApp, err := appservice.NewLinuxWebApp(ctx, "exampleLinuxWebApp", &appservice.LinuxWebAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewConnection(ctx, "exampleConnection", &appservice.ConnectionArgs{ +// AppServiceId: exampleLinuxWebApp.ID(), +// TargetResourceId: exampleSqlDatabase.ID(), +// Authentication: &appservice.ConnectionAuthenticationArgs{ +// Type: pulumi.String("systemAssignedIdentity"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/customHostnameBinding.go b/sdk/go/azure/appservice/customHostnameBinding.go index 6f5717c2f3..1709381e39 100644 --- a/sdk/go/azure/appservice/customHostnameBinding.go +++ b/sdk/go/azure/appservice/customHostnameBinding.go @@ -15,6 +15,70 @@ import ( // Manages a Hostname Binding within an App Service (or Function App). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{ +// Keepers: pulumi.Map{ +// "azi_id": pulumi.Any(1), +// }, +// ByteLength: pulumi.Int(8), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewCustomHostnameBinding(ctx, "exampleCustomHostnameBinding", &appservice.CustomHostnameBindingArgs{ +// Hostname: pulumi.String("www.mywebsite.com"), +// AppServiceName: exampleAppService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/environment.go b/sdk/go/azure/appservice/environment.go index f099e30f8b..60911a1cbe 100644 --- a/sdk/go/azure/appservice/environment.go +++ b/sdk/go/azure/appservice/environment.go @@ -15,6 +15,84 @@ import ( // Manages an App Service Environment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// ase, err := network.NewSubnet(ctx, "ase", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnet(ctx, "gateway", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewEnvironment(ctx, "exampleEnvironment", &appservice.EnvironmentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SubnetId: ase.ID(), +// PricingTier: pulumi.String("I2"), +// FrontEndScaleFactor: pulumi.Int(10), +// InternalLoadBalancingMode: pulumi.String("Web, Publishing"), +// AllowedUserIpCidrs: pulumi.StringArray{ +// pulumi.String("11.22.33.44/32"), +// pulumi.String("55.66.77.0/24"), +// }, +// ClusterSettings: appservice.EnvironmentClusterSettingArray{ +// &appservice.EnvironmentClusterSettingArgs{ +// Name: pulumi.String("DisableTls1.0"), +// Value: pulumi.String("1"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The App Service Environment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/functionApp.go b/sdk/go/azure/appservice/functionApp.go index f2118f7a17..05437756cf 100644 --- a/sdk/go/azure/appservice/functionApp.go +++ b/sdk/go/azure/appservice/functionApp.go @@ -21,6 +21,184 @@ import ( // For an example, check the `appservice.VirtualNetworkSwiftConnection` documentation. // // ## Example Usage +// ### With App Service Plan) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionApp(ctx, "exampleFunctionApp", &appservice.FunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### In A Consumption Plan) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("FunctionApp"), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Dynamic"), +// Size: pulumi.String("Y1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionApp(ctx, "exampleFunctionApp", &appservice.FunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Linux) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("Linux"), +// Reserved: pulumi.Bool(true), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Dynamic"), +// Size: pulumi.String("Y1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionApp(ctx, "exampleFunctionApp", &appservice.FunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// OsType: pulumi.String("linux"), +// Version: pulumi.String("~3"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// > **Note:** Version `~3` or `~4` is required for Linux Function Apps. // // ## Import // diff --git a/sdk/go/azure/appservice/functionAppActiveSlot.go b/sdk/go/azure/appservice/functionAppActiveSlot.go index 4624783d97..cbbdbab286 100644 --- a/sdk/go/azure/appservice/functionAppActiveSlot.go +++ b/sdk/go/azure/appservice/functionAppActiveSlot.go @@ -16,6 +16,144 @@ import ( // Manages a Function App Active Slot. // // ## Example Usage +// ### Windows Function App +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("Y1"), +// }) +// if err != nil { +// return err +// } +// exampleWindowsFunctionApp, err := appservice.NewWindowsFunctionApp(ctx, "exampleWindowsFunctionApp", &appservice.WindowsFunctionAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageAccountName: exampleAccount.Name, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// exampleWindowsFunctionAppSlot, err := appservice.NewWindowsFunctionAppSlot(ctx, "exampleWindowsFunctionAppSlot", &appservice.WindowsFunctionAppSlotArgs{ +// FunctionAppId: exampleWindowsFunctionApp.ID(), +// StorageAccountName: exampleAccount.Name, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionAppActiveSlot(ctx, "exampleFunctionAppActiveSlot", &appservice.FunctionAppActiveSlotArgs{ +// SlotId: exampleWindowsFunctionAppSlot.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Linux Function App +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("Y1"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxFunctionApp, err := appservice.NewLinuxFunctionApp(ctx, "exampleLinuxFunctionApp", &appservice.LinuxFunctionAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServicePlanId: exampleServicePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// exampleLinuxFunctionAppSlot, err := appservice.NewLinuxFunctionAppSlot(ctx, "exampleLinuxFunctionAppSlot", &appservice.LinuxFunctionAppSlotArgs{ +// FunctionAppId: exampleLinuxFunctionApp.Name, +// StorageAccountName: exampleAccount.Name, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionAppActiveSlot(ctx, "exampleFunctionAppActiveSlot", &appservice.FunctionAppActiveSlotArgs{ +// SlotId: exampleLinuxFunctionAppSlot.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/functionAppFunction.go b/sdk/go/azure/appservice/functionAppFunction.go index 32527d0b56..903527004c 100644 --- a/sdk/go/azure/appservice/functionAppFunction.go +++ b/sdk/go/azure/appservice/functionAppFunction.go @@ -16,6 +16,223 @@ import ( // Manages a Function App Function. // // ## Example Usage +// ### Basic HTTP Trigger +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("S1"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxFunctionApp, err := appservice.NewLinuxFunctionApp(ctx, "exampleLinuxFunctionApp", &appservice.LinuxFunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServicePlanId: exampleServicePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// SiteConfig: &appservice.LinuxFunctionAppSiteConfigArgs{ +// ApplicationStack: &appservice.LinuxFunctionAppSiteConfigApplicationStackArgs{ +// PythonVersion: pulumi.String("3.9"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "name": "Azure", +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// tmpJSON1, err := json.Marshal(map[string]interface{}{ +// "bindings": []interface{}{ +// map[string]interface{}{ +// "authLevel": "function", +// "direction": "in", +// "methods": []string{ +// "get", +// "post", +// }, +// "name": "req", +// "type": "httpTrigger", +// }, +// map[string]interface{}{ +// "direction": "out", +// "name": "$return", +// "type": "http", +// }, +// }, +// }) +// if err != nil { +// return err +// } +// json1 := string(tmpJSON1) +// _, err = appservice.NewFunctionAppFunction(ctx, "exampleFunctionAppFunction", &appservice.FunctionAppFunctionArgs{ +// FunctionAppId: exampleLinuxFunctionApp.ID(), +// Language: pulumi.String("Python"), +// TestData: pulumi.String(json0), +// ConfigJson: pulumi.String(json1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### HTTP Trigger With Code Upload +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("S1"), +// }) +// if err != nil { +// return err +// } +// exampleWindowsFunctionApp, err := appservice.NewWindowsFunctionApp(ctx, "exampleWindowsFunctionApp", &appservice.WindowsFunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServicePlanId: exampleServicePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// SiteConfig: &appservice.WindowsFunctionAppSiteConfigArgs{ +// ApplicationStack: &appservice.WindowsFunctionAppSiteConfigApplicationStackArgs{ +// DotnetVersion: pulumi.String("6"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "name": "Azure", +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// tmpJSON1, err := json.Marshal(map[string]interface{}{ +// "bindings": []interface{}{ +// map[string]interface{}{ +// "authLevel": "function", +// "direction": "in", +// "methods": []string{ +// "get", +// "post", +// }, +// "name": "req", +// "type": "httpTrigger", +// }, +// map[string]interface{}{ +// "direction": "out", +// "name": "$return", +// "type": "http", +// }, +// }, +// }) +// if err != nil { +// return err +// } +// json1 := string(tmpJSON1) +// _, err = appservice.NewFunctionAppFunction(ctx, "exampleFunctionAppFunction", &appservice.FunctionAppFunctionArgs{ +// FunctionAppId: exampleWindowsFunctionApp.ID(), +// Language: pulumi.String("CSharp"), +// Files: appservice.FunctionAppFunctionFileArray{ +// &appservice.FunctionAppFunctionFileArgs{ +// Name: pulumi.String("run.csx"), +// Content: readFileOrPanic("exampledata/run.csx"), +// }, +// }, +// TestData: pulumi.String(json0), +// ConfigJson: pulumi.String(json1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/functionAppHybridConnection.go b/sdk/go/azure/appservice/functionAppHybridConnection.go index 0de514d756..7933d66375 100644 --- a/sdk/go/azure/appservice/functionAppHybridConnection.go +++ b/sdk/go/azure/appservice/functionAppHybridConnection.go @@ -15,6 +15,97 @@ import ( // Manages a Function App Hybrid Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("S1"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleHybridConnection, err := relay.NewHybridConnection(ctx, "exampleHybridConnection", &relay.HybridConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RelayNamespaceName: exampleNamespace.Name, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleWindowsWebApp, err := appservice.NewWindowsWebApp(ctx, "exampleWindowsWebApp", &appservice.WindowsWebAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewWindowsFunctionApp(ctx, "exampleWindowsFunctionApp", &appservice.WindowsFunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServicePlanId: exampleServicePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionAppHybridConnection(ctx, "exampleFunctionAppHybridConnection", &appservice.FunctionAppHybridConnectionArgs{ +// FunctionAppId: exampleWindowsWebApp.ID(), +// RelayId: exampleHybridConnection.ID(), +// Hostname: pulumi.String("myhostname.example"), +// Port: pulumi.Int(8081), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // a Function App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/functionAppSlot.go b/sdk/go/azure/appservice/functionAppSlot.go index d459d5195b..c7e0450eaa 100644 --- a/sdk/go/azure/appservice/functionAppSlot.go +++ b/sdk/go/azure/appservice/functionAppSlot.go @@ -18,6 +18,74 @@ import ( // !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.LinuxFunctionAppSlot` resources instead. // // ## Example Usage +// ### With App Service Plan) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleFunctionApp, err := appservice.NewFunctionApp(ctx, "exampleFunctionApp", &appservice.FunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewFunctionAppSlot(ctx, "exampleFunctionAppSlot", &appservice.FunctionAppSlotArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// FunctionAppName: exampleFunctionApp.Name, +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/getAppService.go b/sdk/go/azure/appservice/getAppService.go index 2378ffa14c..92212fd5db 100644 --- a/sdk/go/azure/appservice/getAppService.go +++ b/sdk/go/azure/appservice/getAppService.go @@ -15,6 +15,34 @@ import ( // Use this data source to access information about an existing App Service. // // !> **Note:** The `appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.LinuxWebApp` data sources instead. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupAppService(ctx, &appservice.LookupAppServiceArgs{ +// Name: "search-app-service", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("appServiceId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupAppService(ctx *pulumi.Context, args *LookupAppServiceArgs, opts ...pulumi.InvokeOption) (*LookupAppServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAppServiceResult diff --git a/sdk/go/azure/appservice/getAppServiceEnvironment.go b/sdk/go/azure/appservice/getAppServiceEnvironment.go index 567e86cfec..2d8df8fa9c 100644 --- a/sdk/go/azure/appservice/getAppServiceEnvironment.go +++ b/sdk/go/azure/appservice/getAppServiceEnvironment.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing App Service Environment. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.GetAppServiceEnvironment(ctx, &appservice.GetAppServiceEnvironmentArgs{ +// Name: "existing-ase", +// ResourceGroupName: "existing-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetAppServiceEnvironment(ctx *pulumi.Context, args *GetAppServiceEnvironmentArgs, opts ...pulumi.InvokeOption) (*GetAppServiceEnvironmentResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAppServiceEnvironmentResult diff --git a/sdk/go/azure/appservice/getAppServicePlan.go b/sdk/go/azure/appservice/getAppServicePlan.go index 54f881430d..9903326602 100644 --- a/sdk/go/azure/appservice/getAppServicePlan.go +++ b/sdk/go/azure/appservice/getAppServicePlan.go @@ -15,6 +15,34 @@ import ( // Use this data source to access information about an existing App Service Plan (formerly known as a `Server Farm`). // // !> **Note:** The `appservice.Plan` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.ServicePlan` data source instead. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.GetAppServicePlan(ctx, &appservice.GetAppServicePlanArgs{ +// Name: "search-app-service-plan", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("appServicePlanId", example.Id) +// return nil +// }) +// } +// +// ``` func GetAppServicePlan(ctx *pulumi.Context, args *GetAppServicePlanArgs, opts ...pulumi.InvokeOption) (*GetAppServicePlanResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAppServicePlanResult diff --git a/sdk/go/azure/appservice/getCertificate.go b/sdk/go/azure/appservice/getCertificate.go index e2c6f28993..8ffb392e13 100644 --- a/sdk/go/azure/appservice/getCertificate.go +++ b/sdk/go/azure/appservice/getCertificate.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an App Service Certificate. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupCertificate(ctx, &appservice.LookupCertificateArgs{ +// Name: "example-app-service-certificate", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("appServiceCertificateId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupCertificate(ctx *pulumi.Context, args *LookupCertificateArgs, opts ...pulumi.InvokeOption) (*LookupCertificateResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupCertificateResult diff --git a/sdk/go/azure/appservice/getCertificateOrder.go b/sdk/go/azure/appservice/getCertificateOrder.go index cf2ee6208e..b69b5ea798 100644 --- a/sdk/go/azure/appservice/getCertificateOrder.go +++ b/sdk/go/azure/appservice/getCertificateOrder.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing App Service Certificate Order. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupCertificateOrder(ctx, &appservice.LookupCertificateOrderArgs{ +// Name: "example-cert-order", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("certificateOrderId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupCertificateOrder(ctx *pulumi.Context, args *LookupCertificateOrderArgs, opts ...pulumi.InvokeOption) (*LookupCertificateOrderResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupCertificateOrderResult diff --git a/sdk/go/azure/appservice/getEnvironmentV3.go b/sdk/go/azure/appservice/getEnvironmentV3.go index 477bd4e2a3..bcb72f69d3 100644 --- a/sdk/go/azure/appservice/getEnvironmentV3.go +++ b/sdk/go/azure/appservice/getEnvironmentV3.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing 3rd Generation (v3) App Service Environment. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupEnvironmentV3(ctx, &appservice.LookupEnvironmentV3Args{ +// Name: "example-ASE", +// ResourceGroupName: "example-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupEnvironmentV3(ctx *pulumi.Context, args *LookupEnvironmentV3Args, opts ...pulumi.InvokeOption) (*LookupEnvironmentV3Result, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupEnvironmentV3Result diff --git a/sdk/go/azure/appservice/getFunctionApp.go b/sdk/go/azure/appservice/getFunctionApp.go index 26212c1d96..ef13f03b0e 100644 --- a/sdk/go/azure/appservice/getFunctionApp.go +++ b/sdk/go/azure/appservice/getFunctionApp.go @@ -15,6 +15,33 @@ import ( // Use this data source to access information about a Function App. // // !> **Note:** The `appservice.FunctionApp` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.LinuxFunctionApp` data sources instead. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := appservice.LookupFunctionApp(ctx, &appservice.LookupFunctionAppArgs{ +// Name: "test-azure-functions", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFunctionApp(ctx *pulumi.Context, args *LookupFunctionAppArgs, opts ...pulumi.InvokeOption) (*LookupFunctionAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFunctionAppResult diff --git a/sdk/go/azure/appservice/getFunctionAppHostKeys.go b/sdk/go/azure/appservice/getFunctionAppHostKeys.go index 1b8bd72fae..23c50656fa 100644 --- a/sdk/go/azure/appservice/getFunctionAppHostKeys.go +++ b/sdk/go/azure/appservice/getFunctionAppHostKeys.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to fetch the Host Keys of an existing Function App +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := appservice.GetFunctionAppHostKeys(ctx, &appservice.GetFunctionAppHostKeysArgs{ +// Name: "example-function", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetFunctionAppHostKeys(ctx *pulumi.Context, args *GetFunctionAppHostKeysArgs, opts ...pulumi.InvokeOption) (*GetFunctionAppHostKeysResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetFunctionAppHostKeysResult diff --git a/sdk/go/azure/appservice/getLinuxFunctionApp.go b/sdk/go/azure/appservice/getLinuxFunctionApp.go index 5a03003107..92ebcffd54 100644 --- a/sdk/go/azure/appservice/getLinuxFunctionApp.go +++ b/sdk/go/azure/appservice/getLinuxFunctionApp.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Linux Function App. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupLinuxFunctionApp(ctx, &appservice.LookupLinuxFunctionAppArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupLinuxFunctionApp(ctx *pulumi.Context, args *LookupLinuxFunctionAppArgs, opts ...pulumi.InvokeOption) (*LookupLinuxFunctionAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupLinuxFunctionAppResult diff --git a/sdk/go/azure/appservice/getLinuxWebApp.go b/sdk/go/azure/appservice/getLinuxWebApp.go index 15ef7b4dcf..400a61be0d 100644 --- a/sdk/go/azure/appservice/getLinuxWebApp.go +++ b/sdk/go/azure/appservice/getLinuxWebApp.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Linux Web App. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupLinuxWebApp(ctx, &appservice.LookupLinuxWebAppArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupLinuxWebApp(ctx *pulumi.Context, args *LookupLinuxWebAppArgs, opts ...pulumi.InvokeOption) (*LookupLinuxWebAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupLinuxWebAppResult diff --git a/sdk/go/azure/appservice/getServicePlan.go b/sdk/go/azure/appservice/getServicePlan.go index e852d5e0ab..146ebbd636 100644 --- a/sdk/go/azure/appservice/getServicePlan.go +++ b/sdk/go/azure/appservice/getServicePlan.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Service Plan. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupServicePlan(ctx, &appservice.LookupServicePlanArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupServicePlan(ctx *pulumi.Context, args *LookupServicePlanArgs, opts ...pulumi.InvokeOption) (*LookupServicePlanResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServicePlanResult diff --git a/sdk/go/azure/appservice/getSourceControlToken.go b/sdk/go/azure/appservice/getSourceControlToken.go index 3ecae03b4a..c3888e195c 100644 --- a/sdk/go/azure/appservice/getSourceControlToken.go +++ b/sdk/go/azure/appservice/getSourceControlToken.go @@ -12,6 +12,32 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := appservice.LookupSourceControlToken(ctx, &appservice.LookupSourceControlTokenArgs{ +// Type: "GitHub", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", data.Azurerm_app_service_github_token.Example.Id) +// return nil +// }) +// } +// +// ``` func LookupSourceControlToken(ctx *pulumi.Context, args *LookupSourceControlTokenArgs, opts ...pulumi.InvokeOption) (*LookupSourceControlTokenResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSourceControlTokenResult diff --git a/sdk/go/azure/appservice/getWindowsFunctionApp.go b/sdk/go/azure/appservice/getWindowsFunctionApp.go index 1abd98a5c9..74237f6b1b 100644 --- a/sdk/go/azure/appservice/getWindowsFunctionApp.go +++ b/sdk/go/azure/appservice/getWindowsFunctionApp.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Windows Function App. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupWindowsFunctionApp(ctx, &appservice.LookupWindowsFunctionAppArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupWindowsFunctionApp(ctx *pulumi.Context, args *LookupWindowsFunctionAppArgs, opts ...pulumi.InvokeOption) (*LookupWindowsFunctionAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupWindowsFunctionAppResult diff --git a/sdk/go/azure/appservice/getWindowsWebApp.go b/sdk/go/azure/appservice/getWindowsWebApp.go index 86beadf14f..e592804f30 100644 --- a/sdk/go/azure/appservice/getWindowsWebApp.go +++ b/sdk/go/azure/appservice/getWindowsWebApp.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Windows Web App. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := appservice.LookupWindowsWebApp(ctx, &appservice.LookupWindowsWebAppArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupWindowsWebApp(ctx *pulumi.Context, args *LookupWindowsWebAppArgs, opts ...pulumi.InvokeOption) (*LookupWindowsWebAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupWindowsWebAppResult diff --git a/sdk/go/azure/appservice/hybridConnection.go b/sdk/go/azure/appservice/hybridConnection.go index 2dfc79e0ff..84937e18fb 100644 --- a/sdk/go/azure/appservice/hybridConnection.go +++ b/sdk/go/azure/appservice/hybridConnection.go @@ -17,6 +17,82 @@ import ( // // !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.FunctionAppHybridConnection` resources instead. // +// ## Example Usage +// +// This example provisions an App Service, a Relay Hybrid Connection, and a Service Bus using their outputs to create the App Service Hybrid Connection. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleHybridConnection, err := relay.NewHybridConnection(ctx, "exampleHybridConnection", &relay.HybridConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RelayNamespaceName: exampleNamespace.Name, +// UserMetadata: pulumi.String("examplemetadata"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewHybridConnection(ctx, "exampleAppservice/hybridConnectionHybridConnection", &appservice.HybridConnectionArgs{ +// AppServiceName: exampleAppService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// RelayId: exampleHybridConnection.ID(), +// Hostname: pulumi.String("testhostname.example"), +// Port: pulumi.Int(8080), +// SendKeyName: pulumi.String("exampleSharedAccessKey"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Hybrid Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/linuxFunctionApp.go b/sdk/go/azure/appservice/linuxFunctionApp.go index 504d2edb90..bf6c87221f 100644 --- a/sdk/go/azure/appservice/linuxFunctionApp.go +++ b/sdk/go/azure/appservice/linuxFunctionApp.go @@ -15,6 +15,63 @@ import ( // Manages a Linux Function App. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("Y1"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewLinuxFunctionApp(ctx, "exampleLinuxFunctionApp", &appservice.LinuxFunctionAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Linux Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/linuxFunctionAppSlot.go b/sdk/go/azure/appservice/linuxFunctionAppSlot.go index c4f6a29e41..6df4bb566c 100644 --- a/sdk/go/azure/appservice/linuxFunctionAppSlot.go +++ b/sdk/go/azure/appservice/linuxFunctionAppSlot.go @@ -15,6 +15,70 @@ import ( // Manages a Linux Function App Slot. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("Y1"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxFunctionApp, err := appservice.NewLinuxFunctionApp(ctx, "exampleLinuxFunctionApp", &appservice.LinuxFunctionAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServicePlanId: exampleServicePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewLinuxFunctionAppSlot(ctx, "exampleLinuxFunctionAppSlot", &appservice.LinuxFunctionAppSlotArgs{ +// FunctionAppId: exampleLinuxFunctionApp.ID(), +// StorageAccountName: exampleAccount.Name, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Linux Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/linuxWebApp.go b/sdk/go/azure/appservice/linuxWebApp.go index ee8002befa..039c4674c1 100644 --- a/sdk/go/azure/appservice/linuxWebApp.go +++ b/sdk/go/azure/appservice/linuxWebApp.go @@ -15,6 +15,51 @@ import ( // Manages a Linux Web App. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("P1v2"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewLinuxWebApp(ctx, "exampleLinuxWebApp", &appservice.LinuxWebAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleServicePlan.Location, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/linuxWebAppSlot.go b/sdk/go/azure/appservice/linuxWebAppSlot.go index f663807922..a1b55d8858 100644 --- a/sdk/go/azure/appservice/linuxWebAppSlot.go +++ b/sdk/go/azure/appservice/linuxWebAppSlot.go @@ -15,6 +15,58 @@ import ( // Manages a Linux Web App Slot. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("P1v2"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxWebApp, err := appservice.NewLinuxWebApp(ctx, "exampleLinuxWebApp", &appservice.LinuxWebAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleServicePlan.Location, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewLinuxWebAppSlot(ctx, "exampleLinuxWebAppSlot", &appservice.LinuxWebAppSlotArgs{ +// AppServiceId: exampleLinuxWebApp.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/plan.go b/sdk/go/azure/appservice/plan.go index 14f459edfc..8d65e39e0a 100644 --- a/sdk/go/azure/appservice/plan.go +++ b/sdk/go/azure/appservice/plan.go @@ -18,6 +18,159 @@ import ( // !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.ServicePlan` resource instead. // // ## Example Usage +// ### Dedicated) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Shared / Consumption Plan) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("FunctionApp"), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Dynamic"), +// Size: pulumi.String("Y1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Linux) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("Linux"), +// Reserved: pulumi.Bool(true), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Windows Container) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("xenon"), +// IsXenon: pulumi.Bool(true), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("PremiumContainer"), +// Size: pulumi.String("PC2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/publicCertificate.go b/sdk/go/azure/appservice/publicCertificate.go index 45633bdedf..d314c5dba5 100644 --- a/sdk/go/azure/appservice/publicCertificate.go +++ b/sdk/go/azure/appservice/publicCertificate.go @@ -15,6 +15,73 @@ import ( // Manages an App Service Public Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewPublicCertificate(ctx, "examplePublicCertificate", &appservice.PublicCertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AppServiceName: exampleAppService.Name, +// CertificateName: pulumi.String("example-public-certificate"), +// CertificateLocation: pulumi.String("Unknown"), +// Blob: filebase64OrPanic("app_service_public_certificate.cer"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Public Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/servicePlan.go b/sdk/go/azure/appservice/servicePlan.go index 9d81e13366..cce1104346 100644 --- a/sdk/go/azure/appservice/servicePlan.go +++ b/sdk/go/azure/appservice/servicePlan.go @@ -15,6 +15,42 @@ import ( // Manages an App Service: Service Plan. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("P1v2"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // AppServices can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/slot.go b/sdk/go/azure/appservice/slot.go index c3a320547e..faecc49f62 100644 --- a/sdk/go/azure/appservice/slot.go +++ b/sdk/go/azure/appservice/slot.go @@ -20,6 +20,170 @@ import ( // > **Note:** When using Slots - the `appSettings`, `connectionString` and `siteConfig` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. // // ## Example Usage +// ### NET 4.X) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{ +// Keepers: pulumi.Map{ +// "azi_id": pulumi.Any(1), +// }, +// ByteLength: pulumi.Int(8), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// SiteConfig: &appservice.AppServiceSiteConfigArgs{ +// DotnetFrameworkVersion: pulumi.String("v4.0"), +// }, +// AppSettings: pulumi.StringMap{ +// "SOME_KEY": pulumi.String("some-value"), +// }, +// ConnectionStrings: appservice.AppServiceConnectionStringArray{ +// &appservice.AppServiceConnectionStringArgs{ +// Name: pulumi.String("Database"), +// Type: pulumi.String("SQLServer"), +// Value: pulumi.String("Server=some-server.mydomain.com;Integrated Security=SSPI"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewSlot(ctx, "exampleSlot", &appservice.SlotArgs{ +// AppServiceName: exampleAppService.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// SiteConfig: &appservice.SlotSiteConfigArgs{ +// DotnetFrameworkVersion: pulumi.String("v4.0"), +// }, +// AppSettings: pulumi.StringMap{ +// "SOME_KEY": pulumi.String("some-value"), +// }, +// ConnectionStrings: appservice.SlotConnectionStringArray{ +// &appservice.SlotConnectionStringArgs{ +// Name: pulumi.String("Database"), +// Type: pulumi.String("SQLServer"), +// Value: pulumi.String("Server=some-server.mydomain.com;Integrated Security=SSPI"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Java 1.8) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{ +// Keepers: pulumi.Map{ +// "azi_id": pulumi.Any(1), +// }, +// ByteLength: pulumi.Int(8), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// SiteConfig: &appservice.AppServiceSiteConfigArgs{ +// JavaVersion: pulumi.String("1.8"), +// JavaContainer: pulumi.String("JETTY"), +// JavaContainerVersion: pulumi.String("9.3"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewSlot(ctx, "exampleSlot", &appservice.SlotArgs{ +// AppServiceName: exampleAppService.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// SiteConfig: &appservice.SlotSiteConfigArgs{ +// JavaVersion: pulumi.String("1.8"), +// JavaContainer: pulumi.String("JETTY"), +// JavaContainerVersion: pulumi.String("9.3"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/slotCustomHostnameBinding.go b/sdk/go/azure/appservice/slotCustomHostnameBinding.go index 7c4fb2a68d..cb577249f4 100644 --- a/sdk/go/azure/appservice/slotCustomHostnameBinding.go +++ b/sdk/go/azure/appservice/slotCustomHostnameBinding.go @@ -15,6 +15,68 @@ import ( // Manages a Hostname Binding within an App Service Slot. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// exampleSlot, err := appservice.NewSlot(ctx, "exampleSlot", &appservice.SlotArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServiceName: exampleAppService.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewSlotCustomHostnameBinding(ctx, "exampleSlotCustomHostnameBinding", &appservice.SlotCustomHostnameBindingArgs{ +// AppServiceSlotId: exampleSlot.ID(), +// Hostname: pulumi.String("www.mywebsite.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/slotVirtualNetworkSwiftConnection.go b/sdk/go/azure/appservice/slotVirtualNetworkSwiftConnection.go index d32075cec7..25e2b259ac 100644 --- a/sdk/go/azure/appservice/slotVirtualNetworkSwiftConnection.go +++ b/sdk/go/azure/appservice/slotVirtualNetworkSwiftConnection.go @@ -15,6 +15,101 @@ import ( // Manages an App Service Slot's Virtual Network Association (this is for the [Regional VNet Integration](https://docs.microsoft.com/azure/app-service/web-sites-integrate-with-vnet#regional-vnet-integration) which is still in preview). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("example-delegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Web/serverFarms"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewSlot(ctx, "example-staging", &appservice.SlotArgs{ +// AppServiceName: exampleAppService.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewSlotVirtualNetworkSwiftConnection(ctx, "exampleSlotVirtualNetworkSwiftConnection", &appservice.SlotVirtualNetworkSwiftConnectionArgs{ +// SlotName: example_staging.Name, +// AppServiceId: exampleAppService.ID(), +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Slot Virtual Network Associations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/sourceCodeToken.go b/sdk/go/azure/appservice/sourceCodeToken.go index 4c6d3d8941..9569693c87 100644 --- a/sdk/go/azure/appservice/sourceCodeToken.go +++ b/sdk/go/azure/appservice/sourceCodeToken.go @@ -19,6 +19,33 @@ import ( // // > **NOTE:** Source Control Tokens are configured at the subscription level, not on each App Service - as such this can only be configured Subscription-wide // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := appservice.NewSourceCodeToken(ctx, "example", &appservice.SourceCodeTokenArgs{ +// Token: pulumi.String("7e57735e77e577e57"), +// Type: pulumi.String("GitHub"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Source Control Token's can be imported using the `type`, e.g. diff --git a/sdk/go/azure/appservice/sourceControl.go b/sdk/go/azure/appservice/sourceControl.go index a855ada00f..ddc0424517 100644 --- a/sdk/go/azure/appservice/sourceControl.go +++ b/sdk/go/azure/appservice/sourceControl.go @@ -15,6 +15,59 @@ import ( // Manages an App Service Web App or Function App Source Control Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("P1v2"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxWebApp, err := appservice.NewLinuxWebApp(ctx, "exampleLinuxWebApp", &appservice.LinuxWebAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleServicePlan.Location, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewSourceControl(ctx, "exampleSourceControl", &appservice.SourceControlArgs{ +// AppId: exampleLinuxWebApp.ID(), +// RepoUrl: pulumi.String("https://github.com/Azure-Samples/python-docs-hello-world"), +// Branch: pulumi.String("master"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Source Controls can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/sourceControlSlot.go b/sdk/go/azure/appservice/sourceControlSlot.go index 397d69af05..0031132e58 100644 --- a/sdk/go/azure/appservice/sourceControlSlot.go +++ b/sdk/go/azure/appservice/sourceControlSlot.go @@ -15,6 +15,66 @@ import ( // Manages an App Service Source Control Slot. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// SkuName: pulumi.String("P1v2"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxWebApp, err := appservice.NewLinuxWebApp(ctx, "exampleLinuxWebApp", &appservice.LinuxWebAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleServicePlan.Location, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// exampleLinuxWebAppSlot, err := appservice.NewLinuxWebAppSlot(ctx, "exampleLinuxWebAppSlot", &appservice.LinuxWebAppSlotArgs{ +// AppServiceId: exampleLinuxWebApp.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewSourceControlSlot(ctx, "exampleSourceControlSlot", &appservice.SourceControlSlotArgs{ +// SlotId: exampleLinuxWebAppSlot.ID(), +// RepoUrl: pulumi.String("https://github.com/Azure-Samples/python-docs-hello-world"), +// Branch: pulumi.String("master"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // an App Service Source Control Slot can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/sourceControlToken.go b/sdk/go/azure/appservice/sourceControlToken.go index bd452cd434..3c561b11e6 100644 --- a/sdk/go/azure/appservice/sourceControlToken.go +++ b/sdk/go/azure/appservice/sourceControlToken.go @@ -13,6 +13,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := appservice.NewSourceControlToken(ctx, "example", &appservice.SourceControlTokenArgs{ +// Token: pulumi.String("ghp_sometokenvaluesecretsauce"), +// Type: pulumi.String("GitHub"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // App Service Source GitHub Tokens can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/staticSite.go b/sdk/go/azure/appservice/staticSite.go index 9625b0602e..69ee8063e8 100644 --- a/sdk/go/azure/appservice/staticSite.go +++ b/sdk/go/azure/appservice/staticSite.go @@ -17,6 +17,33 @@ import ( // // ->**NOTE:** After the Static Site is provisioned, you'll need to associate your target repository, which contains your web app, to the Static Site, by following the [Azure Static Site document](https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := appservice.NewStaticSite(ctx, "example", &appservice.StaticSiteArgs{ +// Location: pulumi.String("West Europe"), +// ResourceGroupName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Static Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/staticSiteCustomDomain.go b/sdk/go/azure/appservice/staticSiteCustomDomain.go index e1d2eeb260..bd01dff045 100644 --- a/sdk/go/azure/appservice/staticSiteCustomDomain.go +++ b/sdk/go/azure/appservice/staticSiteCustomDomain.go @@ -14,6 +14,118 @@ import ( ) // ## Example Usage +// ### CNAME validation +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleStaticSite, err := appservice.NewStaticSite(ctx, "exampleStaticSite", &appservice.StaticSiteArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleCNameRecord, err := dns.NewCNameRecord(ctx, "exampleCNameRecord", &dns.CNameRecordArgs{ +// ZoneName: pulumi.String("contoso.com"), +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Record: exampleStaticSite.DefaultHostName, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewStaticSiteCustomDomain(ctx, "exampleStaticSiteCustomDomain", &appservice.StaticSiteCustomDomainArgs{ +// StaticSiteId: exampleStaticSite.ID(), +// DomainName: pulumi.All(exampleCNameRecord.Name, exampleCNameRecord.ZoneName).ApplyT(func(_args []interface{}) (string, error) { +// name := _args[0].(string) +// zoneName := _args[1].(string) +// return fmt.Sprintf("%v.%v", name, zoneName), nil +// }).(pulumi.StringOutput), +// ValidationType: pulumi.String("cname-delegation"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### TXT validation +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleStaticSite, err := appservice.NewStaticSite(ctx, "exampleStaticSite", &appservice.StaticSiteArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleStaticSiteCustomDomain, err := appservice.NewStaticSiteCustomDomain(ctx, "exampleStaticSiteCustomDomain", &appservice.StaticSiteCustomDomainArgs{ +// StaticSiteId: exampleStaticSite.ID(), +// DomainName: pulumi.String("my-domain.contoso.com"), +// ValidationType: pulumi.String("dns-txt-token"), +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewTxtRecord(ctx, "exampleTxtRecord", &dns.TxtRecordArgs{ +// ZoneName: pulumi.String("contoso.com"), +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: dns.TxtRecordRecordArray{ +// &dns.TxtRecordRecordArgs{ +// Value: exampleStaticSiteCustomDomain.ValidationToken, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/virtualNetworkSwiftConnection.go b/sdk/go/azure/appservice/virtualNetworkSwiftConnection.go index 6c53c3b1c1..72f47b1af9 100644 --- a/sdk/go/azure/appservice/virtualNetworkSwiftConnection.go +++ b/sdk/go/azure/appservice/virtualNetworkSwiftConnection.go @@ -37,6 +37,186 @@ import ( // Multiple apps in the same App Service plan can use the same VNet. // // ## Example Usage +// ### With App Service) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("example-delegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Web/serverFarms"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewVirtualNetworkSwiftConnection(ctx, "exampleVirtualNetworkSwiftConnection", &appservice.VirtualNetworkSwiftConnectionArgs{ +// AppServiceId: exampleAppService.ID(), +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Function App) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("example-delegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Web/serverFarms"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Standard"), +// Size: pulumi.String("S1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleFunctionApp, err := appservice.NewFunctionApp(ctx, "exampleFunctionApp", &appservice.FunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewVirtualNetworkSwiftConnection(ctx, "exampleVirtualNetworkSwiftConnection", &appservice.VirtualNetworkSwiftConnectionArgs{ +// AppServiceId: exampleFunctionApp.ID(), +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/webAppActiveSlot.go b/sdk/go/azure/appservice/webAppActiveSlot.go index fd2141502e..a174aa056b 100644 --- a/sdk/go/azure/appservice/webAppActiveSlot.go +++ b/sdk/go/azure/appservice/webAppActiveSlot.go @@ -16,6 +16,63 @@ import ( // Manages a Web App Active Slot. // // ## Example Usage +// ### Windows Web App +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("P1v2"), +// }) +// if err != nil { +// return err +// } +// exampleWindowsWebApp, err := appservice.NewWindowsWebApp(ctx, "exampleWindowsWebApp", &appservice.WindowsWebAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleServicePlan.Location, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// exampleWindowsWebAppSlot, err := appservice.NewWindowsWebAppSlot(ctx, "exampleWindowsWebAppSlot", &appservice.WindowsWebAppSlotArgs{ +// AppServiceId: exampleWindowsWebApp.Name, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewWebAppActiveSlot(ctx, "exampleWebAppActiveSlot", &appservice.WebAppActiveSlotArgs{ +// SlotId: exampleWindowsWebAppSlot.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/appservice/webAppHybridConnection.go b/sdk/go/azure/appservice/webAppHybridConnection.go index ba8212e6d4..2227f27029 100644 --- a/sdk/go/azure/appservice/webAppHybridConnection.go +++ b/sdk/go/azure/appservice/webAppHybridConnection.go @@ -15,6 +15,76 @@ import ( // Manages a Web App Hybrid Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("S1"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleHybridConnection, err := relay.NewHybridConnection(ctx, "exampleHybridConnection", &relay.HybridConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RelayNamespaceName: exampleNamespace.Name, +// }) +// if err != nil { +// return err +// } +// exampleWindowsWebApp, err := appservice.NewWindowsWebApp(ctx, "exampleWindowsWebApp", &appservice.WindowsWebAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewWebAppHybridConnection(ctx, "exampleWebAppHybridConnection", &appservice.WebAppHybridConnectionArgs{ +// WebAppId: exampleWindowsWebApp.ID(), +// RelayId: exampleHybridConnection.ID(), +// Hostname: pulumi.String("myhostname.example"), +// Port: pulumi.Int(8081), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // a Web App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/windowsFunctionApp.go b/sdk/go/azure/appservice/windowsFunctionApp.go index 2f8149156a..c8a64e9e24 100644 --- a/sdk/go/azure/appservice/windowsFunctionApp.go +++ b/sdk/go/azure/appservice/windowsFunctionApp.go @@ -15,6 +15,63 @@ import ( // Manages a Windows Function App. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("Y1"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewWindowsFunctionApp(ctx, "exampleWindowsFunctionApp", &appservice.WindowsFunctionAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Windows Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/windowsFunctionAppSlot.go b/sdk/go/azure/appservice/windowsFunctionAppSlot.go index 2c12b21982..8283b08348 100644 --- a/sdk/go/azure/appservice/windowsFunctionAppSlot.go +++ b/sdk/go/azure/appservice/windowsFunctionAppSlot.go @@ -15,6 +15,70 @@ import ( // Manages a Windows Function App Slot. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("Y1"), +// }) +// if err != nil { +// return err +// } +// exampleWindowsFunctionApp, err := appservice.NewWindowsFunctionApp(ctx, "exampleWindowsFunctionApp", &appservice.WindowsFunctionAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageAccountName: exampleAccount.Name, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewWindowsFunctionAppSlot(ctx, "exampleWindowsFunctionAppSlot", &appservice.WindowsFunctionAppSlotArgs{ +// FunctionAppId: exampleWindowsFunctionApp.ID(), +// StorageAccountName: exampleAccount.Name, +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Windows Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/windowsWebApp.go b/sdk/go/azure/appservice/windowsWebApp.go index d8fc0d22d2..11938e3b46 100644 --- a/sdk/go/azure/appservice/windowsWebApp.go +++ b/sdk/go/azure/appservice/windowsWebApp.go @@ -15,6 +15,51 @@ import ( // Manages a Windows Web App. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("P1v2"), +// OsType: pulumi.String("Windows"), +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewWindowsWebApp(ctx, "exampleWindowsWebApp", &appservice.WindowsWebAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleServicePlan.Location, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/appservice/windowsWebAppSlot.go b/sdk/go/azure/appservice/windowsWebAppSlot.go index 6581254ef6..4fa831150e 100644 --- a/sdk/go/azure/appservice/windowsWebAppSlot.go +++ b/sdk/go/azure/appservice/windowsWebAppSlot.go @@ -15,6 +15,58 @@ import ( // Manages a Windows Web App Slot. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServicePlan, err := appservice.NewServicePlan(ctx, "exampleServicePlan", &appservice.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Windows"), +// SkuName: pulumi.String("P1v2"), +// }) +// if err != nil { +// return err +// } +// exampleWindowsWebApp, err := appservice.NewWindowsWebApp(ctx, "exampleWindowsWebApp", &appservice.WindowsWebAppArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleServicePlan.Location, +// ServicePlanId: exampleServicePlan.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// _, err = appservice.NewWindowsWebAppSlot(ctx, "exampleWindowsWebAppSlot", &appservice.WindowsWebAppSlotArgs{ +// AppServiceId: exampleWindowsWebApp.ID(), +// SiteConfig: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/arc/privateLinkScope.go b/sdk/go/azure/arc/privateLinkScope.go index 5aecb040cb..eca1e3381b 100644 --- a/sdk/go/azure/arc/privateLinkScope.go +++ b/sdk/go/azure/arc/privateLinkScope.go @@ -15,6 +15,40 @@ import ( // Manages an Azure Arc Private Link Scope. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arc" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// _, err = arc.NewPrivateLinkScope(ctx, "examplePrivateLinkScope", &arc.PrivateLinkScopeArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Arc Private Link Scope can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/arc/resourceBridgeAppliance.go b/sdk/go/azure/arc/resourceBridgeAppliance.go index 9a6c17080b..194953b9af 100644 --- a/sdk/go/azure/arc/resourceBridgeAppliance.go +++ b/sdk/go/azure/arc/resourceBridgeAppliance.go @@ -15,6 +15,48 @@ import ( // Manages an Arc Resource Bridge Appliance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arc" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = arc.NewResourceBridgeAppliance(ctx, "exampleResourceBridgeAppliance", &arc.ResourceBridgeApplianceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Distro: pulumi.String("AKSEdge"), +// InfrastructureProvider: pulumi.String("VMWare"), +// Identity: &arc.ResourceBridgeApplianceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "hello": pulumi.String("world"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Arc Resource Bridge Appliance can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/arckubernetes/clusterExtension.go b/sdk/go/azure/arckubernetes/clusterExtension.go index 1d04e3c80a..df70b4643c 100644 --- a/sdk/go/azure/arckubernetes/clusterExtension.go +++ b/sdk/go/azure/arckubernetes/clusterExtension.go @@ -15,6 +15,65 @@ import ( // Manages an Arc Kubernetes Cluster Extension. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arckubernetes" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := arckubernetes.NewCluster(ctx, "exampleCluster", &arckubernetes.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// AgentPublicKeyCertificate: filebase64OrPanic("testdata/public.cer"), +// Identity: &arckubernetes.ClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "ENV": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = arckubernetes.NewClusterExtension(ctx, "exampleClusterExtension", &arckubernetes.ClusterExtensionArgs{ +// ClusterId: exampleCluster.ID(), +// ExtensionType: pulumi.String("microsoft.flux"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Arc Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/go/azure/arckubernetes/fluxConfiguration.go b/sdk/go/azure/arckubernetes/fluxConfiguration.go index 966ea9e972..84c21a77a5 100644 --- a/sdk/go/azure/arckubernetes/fluxConfiguration.go +++ b/sdk/go/azure/arckubernetes/fluxConfiguration.go @@ -15,6 +15,84 @@ import ( // Manages an Arc Kubernetes Flux Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arckubernetes" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = arckubernetes.NewCluster(ctx, "exampleCluster", &arckubernetes.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// AgentPublicKeyCertificate: filebase64OrPanic("testdata/public.cer"), +// Identity: &arckubernetes.ClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "ENV": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleClusterExtension, err := arckubernetes.NewClusterExtension(ctx, "exampleClusterExtension", &arckubernetes.ClusterExtensionArgs{ +// ClusterId: pulumi.Any(azurerm_arc_kubernetes_cluster.Test.Id), +// ExtensionType: pulumi.String("microsoft.flux"), +// }) +// if err != nil { +// return err +// } +// _, err = arckubernetes.NewFluxConfiguration(ctx, "exampleFluxConfiguration", &arckubernetes.FluxConfigurationArgs{ +// ClusterId: pulumi.Any(azurerm_arc_kubernetes_cluster.Test.Id), +// Namespace: pulumi.String("flux"), +// GitRepository: &arckubernetes.FluxConfigurationGitRepositoryArgs{ +// Url: pulumi.String("https://github.com/Azure/arc-k8s-demo"), +// ReferenceType: pulumi.String("branch"), +// ReferenceValue: pulumi.String("main"), +// }, +// Kustomizations: arckubernetes.FluxConfigurationKustomizationArray{ +// &arckubernetes.FluxConfigurationKustomizationArgs{ +// Name: pulumi.String("kustomization-1"), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleClusterExtension, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Arc Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/go/azure/arcmachine/get.go b/sdk/go/azure/arcmachine/get.go index 25e263ebcb..393ad3c879 100644 --- a/sdk/go/azure/arcmachine/get.go +++ b/sdk/go/azure/arcmachine/get.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Azure Arc machine. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arcmachine" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := arcmachine.Get(ctx, &arcmachine.GetArgs{ +// Name: "existing-hcmachine", +// ResourceGroupName: "existing-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func Get(ctx *pulumi.Context, args *GetArgs, opts ...pulumi.InvokeOption) (*GetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetResult diff --git a/sdk/go/azure/attestation/provider.go b/sdk/go/azure/attestation/provider.go index 3a6052cb66..0c1cf92ec0 100644 --- a/sdk/go/azure/attestation/provider.go +++ b/sdk/go/azure/attestation/provider.go @@ -15,6 +15,51 @@ import ( // Manages an Attestation Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/attestation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = attestation.NewProvider(ctx, "exampleProvider", &attestation.ProviderArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PolicySigningCertificateData: readFileOrPanic("./example/cert.pem"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Attestation Providers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/authorization/assignment.go b/sdk/go/azure/authorization/assignment.go index fea418ba3a..8829465f0b 100644 --- a/sdk/go/azure/authorization/assignment.go +++ b/sdk/go/azure/authorization/assignment.go @@ -16,6 +16,214 @@ import ( // Assigns a given Principal (User or Group) to a given Role. // // ## Example Usage +// ### Using A Built-In Role) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionName: pulumi.String("Reader"), +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Custom Role & Service Principal) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.NewRoleDefinition(ctx, "exampleRoleDefinition", &authorization.RoleDefinitionArgs{ +// RoleDefinitionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Resources/subscriptions/resourceGroups/read"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Name: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionId: exampleRoleDefinition.RoleDefinitionResourceId, +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Custom Role & User) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.NewRoleDefinition(ctx, "exampleRoleDefinition", &authorization.RoleDefinitionArgs{ +// RoleDefinitionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Resources/subscriptions/resourceGroups/read"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Name: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionId: exampleRoleDefinition.RoleDefinitionResourceId, +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Custom Role & Management Group) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.NewRoleDefinition(ctx, "exampleRoleDefinition", &authorization.RoleDefinitionArgs{ +// RoleDefinitionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Resources/subscriptions/resourceGroups/read"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Name: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: pulumi.Any(data.Azurerm_management_group.Primary.Id), +// RoleDefinitionId: exampleRoleDefinition.RoleDefinitionResourceId, +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/authorization/getUserAssignedIdentity.go b/sdk/go/azure/authorization/getUserAssignedIdentity.go index e17b063518..af919172ba 100644 --- a/sdk/go/azure/authorization/getUserAssignedIdentity.go +++ b/sdk/go/azure/authorization/getUserAssignedIdentity.go @@ -15,6 +15,35 @@ import ( // Use this data source to access information about an existing User Assigned Identity. // // ## Example Usage +// ### Reference An Existing) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := authorization.LookupUserAssignedIdentity(ctx, &authorization.LookupUserAssignedIdentityArgs{ +// Name: "name_of_user_assigned_identity", +// ResourceGroupName: "name_of_resource_group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("uaiClientId", example.ClientId) +// ctx.Export("uaiPrincipalId", example.PrincipalId) +// ctx.Export("uaiTenantId", example.TenantId) +// return nil +// }) +// } +// +// ``` func LookupUserAssignedIdentity(ctx *pulumi.Context, args *LookupUserAssignedIdentityArgs, opts ...pulumi.InvokeOption) (*LookupUserAssignedIdentityResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupUserAssignedIdentityResult diff --git a/sdk/go/azure/authorization/roleDefinition.go b/sdk/go/azure/authorization/roleDefinition.go index c0be95ecaa..2c727bcb83 100644 --- a/sdk/go/azure/authorization/roleDefinition.go +++ b/sdk/go/azure/authorization/roleDefinition.go @@ -15,6 +15,49 @@ import ( // Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewRoleDefinition(ctx, "example", &authorization.RoleDefinitionArgs{ +// Scope: *pulumi.String(primary.Id), +// Description: pulumi.String("This is a custom role created"), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/authorization/userAssignedIdentity.go b/sdk/go/azure/authorization/userAssignedIdentity.go index b16c30540b..8f68160a18 100644 --- a/sdk/go/azure/authorization/userAssignedIdentity.go +++ b/sdk/go/azure/authorization/userAssignedIdentity.go @@ -17,6 +17,40 @@ import ( // // Manages a User Assigned Identity. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/go/azure/automanage/configuration.go b/sdk/go/azure/automanage/configuration.go index 94bdb59b99..5ff00f06a0 100644 --- a/sdk/go/azure/automanage/configuration.go +++ b/sdk/go/azure/automanage/configuration.go @@ -15,6 +15,101 @@ import ( // Manages an Automanage Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automanage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = automanage.NewConfiguration(ctx, "exampleConfiguration", &automanage.ConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Antimalware: &automanage.ConfigurationAntimalwareArgs{ +// Exclusions: &automanage.ConfigurationAntimalwareExclusionsArgs{ +// Extensions: pulumi.String("exe;dll"), +// Paths: pulumi.String("C:\\Windows\\Temp;D:\\Temp"), +// Processes: pulumi.String("svchost.exe;notepad.exe"), +// }, +// RealTimeProtectionEnabled: pulumi.Bool(true), +// ScheduledScanEnabled: pulumi.Bool(true), +// ScheduledScanType: pulumi.String("Quick"), +// ScheduledScanDay: pulumi.Int(1), +// ScheduledScanTimeInMinutes: pulumi.Int(1339), +// }, +// AzureSecurityBaseline: &automanage.ConfigurationAzureSecurityBaselineArgs{ +// AssignmentType: pulumi.String("ApplyAndAutoCorrect"), +// }, +// AutomationAccountEnabled: pulumi.Bool(true), +// Backup: &automanage.ConfigurationBackupArgs{ +// PolicyName: pulumi.String("acctest-backup-policy-%d"), +// TimeZone: pulumi.String("UTC"), +// InstantRpRetentionRangeInDays: pulumi.Int(2), +// SchedulePolicy: &automanage.ConfigurationBackupSchedulePolicyArgs{ +// ScheduleRunFrequency: pulumi.String("Daily"), +// ScheduleRunDays: pulumi.StringArray{ +// pulumi.String("Monday"), +// pulumi.String("Tuesday"), +// }, +// ScheduleRunTimes: pulumi.StringArray{ +// pulumi.String("12:00"), +// }, +// SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"), +// }, +// RetentionPolicy: &automanage.ConfigurationBackupRetentionPolicyArgs{ +// RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"), +// DailySchedule: &automanage.ConfigurationBackupRetentionPolicyDailyScheduleArgs{ +// RetentionTimes: pulumi.StringArray{ +// pulumi.String("12:00"), +// }, +// RetentionDuration: &automanage.ConfigurationBackupRetentionPolicyDailyScheduleRetentionDurationArgs{ +// Count: pulumi.Int(7), +// DurationType: pulumi.String("Days"), +// }, +// }, +// WeeklySchedule: &automanage.ConfigurationBackupRetentionPolicyWeeklyScheduleArgs{ +// RetentionTimes: pulumi.StringArray{ +// pulumi.String("14:00"), +// }, +// RetentionDuration: &automanage.ConfigurationBackupRetentionPolicyWeeklyScheduleRetentionDurationArgs{ +// Count: pulumi.Int(4), +// DurationType: pulumi.String("Weeks"), +// }, +// }, +// }, +// }, +// BootDiagnosticsEnabled: pulumi.Bool(true), +// DefenderForCloudEnabled: pulumi.Bool(true), +// GuestConfigurationEnabled: pulumi.Bool(true), +// LogAnalyticsEnabled: pulumi.Bool(true), +// StatusChangeAlertEnabled: pulumi.Bool(true), +// Tags: pulumi.StringMap{ +// "env": pulumi.String("test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automanage Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/account.go b/sdk/go/azure/automation/account.go index 905582649b..c9b3f9ec6a 100644 --- a/sdk/go/azure/automation/account.go +++ b/sdk/go/azure/automation/account.go @@ -15,6 +15,44 @@ import ( // Manages a Automation Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("development"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/boolVariable.go b/sdk/go/azure/automation/boolVariable.go index 79d5020558..7cac42da99 100644 --- a/sdk/go/azure/automation/boolVariable.go +++ b/sdk/go/azure/automation/boolVariable.go @@ -15,6 +15,49 @@ import ( // Manages a boolean variable in Azure Automation // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewBoolVariable(ctx, "exampleBoolVariable", &automation.BoolVariableArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Value: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Bool Variable can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/certificate.go b/sdk/go/azure/automation/certificate.go index bcf26f8056..523fca6609 100644 --- a/sdk/go/azure/automation/certificate.go +++ b/sdk/go/azure/automation/certificate.go @@ -15,6 +15,62 @@ import ( // Manages an Automation Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewCertificate(ctx, "exampleCertificate", &automation.CertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Description: pulumi.String("This is an example certificate"), +// Base64: filebase64OrPanic("certificate.pfx"), +// Exportable: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/connection.go b/sdk/go/azure/automation/connection.go index 9475daec4e..0e1edb5680 100644 --- a/sdk/go/azure/automation/connection.go +++ b/sdk/go/azure/automation/connection.go @@ -15,6 +15,59 @@ import ( // Manages an Automation Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewConnection(ctx, "exampleConnection", &automation.ConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Type: pulumi.String("AzureServicePrincipal"), +// Values: pulumi.StringMap{ +// "ApplicationId": pulumi.String("00000000-0000-0000-0000-000000000000"), +// "TenantId": *pulumi.String(exampleClientConfig.TenantId), +// "SubscriptionId": *pulumi.String(exampleClientConfig.SubscriptionId), +// "CertificateThumbprint": pulumi.String("sample-certificate-thumbprint"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/connectionCertificate.go b/sdk/go/azure/automation/connectionCertificate.go index 178c7170cd..10adb22da6 100644 --- a/sdk/go/azure/automation/connectionCertificate.go +++ b/sdk/go/azure/automation/connectionCertificate.go @@ -15,6 +15,73 @@ import ( // Manages an Automation Connection with type `Azure`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := automation.NewCertificate(ctx, "exampleCertificate", &automation.CertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Base64: filebase64OrPanic("certificate.pfx"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewConnectionCertificate(ctx, "exampleConnectionCertificate", &automation.ConnectionCertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// AutomationCertificateName: exampleCertificate.Name, +// SubscriptionId: *pulumi.String(exampleClientConfig.SubscriptionId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/connectionClassicCertificate.go b/sdk/go/azure/automation/connectionClassicCertificate.go index 88a1d5c376..0fca5a0ba0 100644 --- a/sdk/go/azure/automation/connectionClassicCertificate.go +++ b/sdk/go/azure/automation/connectionClassicCertificate.go @@ -15,6 +15,55 @@ import ( // Manages an Automation Connection with type `AzureClassicCertificate`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewConnectionClassicCertificate(ctx, "exampleConnectionClassicCertificate", &automation.ConnectionClassicCertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// CertificateAssetName: pulumi.String("cert1"), +// SubscriptionName: pulumi.String("subs1"), +// SubscriptionId: *pulumi.String(exampleClientConfig.SubscriptionId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/connectionServicePrincipal.go b/sdk/go/azure/automation/connectionServicePrincipal.go index 94efc02e80..1233104007 100644 --- a/sdk/go/azure/automation/connectionServicePrincipal.go +++ b/sdk/go/azure/automation/connectionServicePrincipal.go @@ -15,6 +15,66 @@ import ( // Manages an Automation Connection with type `AzureServicePrincipal`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewConnectionServicePrincipal(ctx, "exampleConnectionServicePrincipal", &automation.ConnectionServicePrincipalArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// ApplicationId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: *pulumi.String(exampleClientConfig.TenantId), +// SubscriptionId: *pulumi.String(exampleClientConfig.SubscriptionId), +// CertificateThumbprint: readFileOrPanic("automation_certificate_test.thumb"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/connectionType.go b/sdk/go/azure/automation/connectionType.go index 9fd8cf5f16..32802d6153 100644 --- a/sdk/go/azure/automation/connectionType.go +++ b/sdk/go/azure/automation/connectionType.go @@ -15,6 +15,58 @@ import ( // Manages anAutomation Connection Type. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewConnectionType(ctx, "exampleConnectionType", &automation.ConnectionTypeArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Fields: automation.ConnectionTypeFieldArray{ +// &automation.ConnectionTypeFieldArgs{ +// Name: pulumi.String("example"), +// Type: pulumi.String("string"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/credential.go b/sdk/go/azure/automation/credential.go index 75c05ef580..83a547af30 100644 --- a/sdk/go/azure/automation/credential.go +++ b/sdk/go/azure/automation/credential.go @@ -15,6 +15,51 @@ import ( // Manages a Automation Credential. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewCredential(ctx, "exampleCredential", &automation.CredentialArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Username: pulumi.String("example_user"), +// Password: pulumi.String("example_pwd"), +// Description: pulumi.String("This is an example credential"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/dateTimeVariable.go b/sdk/go/azure/automation/dateTimeVariable.go index e40beff718..ff0211decf 100644 --- a/sdk/go/azure/automation/dateTimeVariable.go +++ b/sdk/go/azure/automation/dateTimeVariable.go @@ -15,6 +15,49 @@ import ( // Manages a DateTime variable in Azure Automation // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewDateTimeVariable(ctx, "exampleDateTimeVariable", &automation.DateTimeVariableArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Value: pulumi.String("2019-04-24T21:40:54.074Z"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation DateTime Variable can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/dscConfiguration.go b/sdk/go/azure/automation/dscConfiguration.go index 6a50c186c4..cc2355d7b8 100644 --- a/sdk/go/azure/automation/dscConfiguration.go +++ b/sdk/go/azure/automation/dscConfiguration.go @@ -15,6 +15,50 @@ import ( // Manages a Automation DSC Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewDscConfiguration(ctx, "exampleDscConfiguration", &automation.DscConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Location: exampleResourceGroup.Location, +// ContentEmbedded: pulumi.String("configuration test {}"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation DSC Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/dscNodeConfiguration.go b/sdk/go/azure/automation/dscNodeConfiguration.go index ed7a6419a8..93fd6684a2 100644 --- a/sdk/go/azure/automation/dscNodeConfiguration.go +++ b/sdk/go/azure/automation/dscNodeConfiguration.go @@ -15,6 +15,86 @@ import ( // Manages a Automation DSC Node Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleDscConfiguration, err := automation.NewDscConfiguration(ctx, "exampleDscConfiguration", &automation.DscConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Location: exampleResourceGroup.Location, +// ContentEmbedded: pulumi.String("configuration test {}"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewDscNodeConfiguration(ctx, "exampleDscNodeConfiguration", &automation.DscNodeConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// ContentEmbedded: pulumi.String(`instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref +// +// { +// ResourceID = "[File]bla"; +// Ensure = "Present"; +// Contents = "bogus Content"; +// DestinationPath = "c:\\bogus.txt"; +// ModuleName = "PSDesiredStateConfiguration"; +// SourceInfo = "::3::9::file"; +// ModuleVersion = "1.0"; +// ConfigurationName = "bla"; +// }; +// +// instance of OMI_ConfigurationDocument +// +// { +// Version="2.0.0"; +// MinimumCompatibleVersion = "1.0.0"; +// CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"}; +// Author="bogusAuthor"; +// GenerationDate="06/15/2018 14:06:24"; +// GenerationHost="bogusComputer"; +// Name="test"; +// }; +// +// `), +// +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleDscConfiguration, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation DSC Node Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/getAccount.go b/sdk/go/azure/automation/getAccount.go index 25ad323dc2..dea1275e21 100644 --- a/sdk/go/azure/automation/getAccount.go +++ b/sdk/go/azure/automation/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Automation Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := automation.LookupAccount(ctx, &automation.LookupAccountArgs{ +// Name: "example-account", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("automationAccountId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/automation/getBoolVariable.go b/sdk/go/azure/automation/getBoolVariable.go index 22a05e82f2..5dff1be556 100644 --- a/sdk/go/azure/automation/getBoolVariable.go +++ b/sdk/go/azure/automation/getBoolVariable.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Automation Bool Variable. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := automation.LookupBoolVariable(ctx, &automation.LookupBoolVariableArgs{ +// Name: "tfex-example-var", +// ResourceGroupName: "tfex-example-rg", +// AutomationAccountName: "tfex-example-account", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("variableId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupBoolVariable(ctx *pulumi.Context, args *LookupBoolVariableArgs, opts ...pulumi.InvokeOption) (*LookupBoolVariableResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBoolVariableResult diff --git a/sdk/go/azure/automation/getDateTimeVariable.go b/sdk/go/azure/automation/getDateTimeVariable.go index cce29514a6..ae3e1c8f14 100644 --- a/sdk/go/azure/automation/getDateTimeVariable.go +++ b/sdk/go/azure/automation/getDateTimeVariable.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Automation Datetime Variable. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := automation.LookupDateTimeVariable(ctx, &automation.LookupDateTimeVariableArgs{ +// Name: "tfex-example-var", +// ResourceGroupName: "tfex-example-rg", +// AutomationAccountName: "tfex-example-account", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("variableId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDateTimeVariable(ctx *pulumi.Context, args *LookupDateTimeVariableArgs, opts ...pulumi.InvokeOption) (*LookupDateTimeVariableResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDateTimeVariableResult diff --git a/sdk/go/azure/automation/getIntVariable.go b/sdk/go/azure/automation/getIntVariable.go index d0ac523c34..9dc8ba7238 100644 --- a/sdk/go/azure/automation/getIntVariable.go +++ b/sdk/go/azure/automation/getIntVariable.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Automation Int Variable. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := automation.LookupIntVariable(ctx, &automation.LookupIntVariableArgs{ +// Name: "tfex-example-var", +// ResourceGroupName: "tfex-example-rg", +// AutomationAccountName: "tfex-example-account", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("variableId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupIntVariable(ctx *pulumi.Context, args *LookupIntVariableArgs, opts ...pulumi.InvokeOption) (*LookupIntVariableResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupIntVariableResult diff --git a/sdk/go/azure/automation/getStringVariable.go b/sdk/go/azure/automation/getStringVariable.go index 9cf2290814..39730092d0 100644 --- a/sdk/go/azure/automation/getStringVariable.go +++ b/sdk/go/azure/automation/getStringVariable.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Automation String Variable. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := automation.LookupStringVariable(ctx, &automation.LookupStringVariableArgs{ +// Name: "tfex-example-var", +// ResourceGroupName: "tfex-example-rg", +// AutomationAccountName: "tfex-example-account", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("variableId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupStringVariable(ctx *pulumi.Context, args *LookupStringVariableArgs, opts ...pulumi.InvokeOption) (*LookupStringVariableResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupStringVariableResult diff --git a/sdk/go/azure/automation/getVariables.go b/sdk/go/azure/automation/getVariables.go index 241a7b4308..ce326c6c37 100644 --- a/sdk/go/azure/automation/getVariables.go +++ b/sdk/go/azure/automation/getVariables.go @@ -13,6 +13,40 @@ import ( ) // Use this data source to get all variables in an Automation Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := automation.LookupAccount(ctx, &automation.LookupAccountArgs{ +// Name: "example-account", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// _, err = automation.GetVariables(ctx, &automation.GetVariablesArgs{ +// AutomationAccountId: exampleAccount.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("stringVars", data.Azurerm_automation_variable_string.Example.String) +// return nil +// }) +// } +// +// ``` func GetVariables(ctx *pulumi.Context, args *GetVariablesArgs, opts ...pulumi.InvokeOption) (*GetVariablesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetVariablesResult diff --git a/sdk/go/azure/automation/hybridRunbookWorker.go b/sdk/go/azure/automation/hybridRunbookWorker.go index 243ce2e97a..7ab83ad180 100644 --- a/sdk/go/azure/automation/hybridRunbookWorker.go +++ b/sdk/go/azure/automation/hybridRunbookWorker.go @@ -15,6 +15,118 @@ import ( // Manages a Automation Hybrid Runbook Worker. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleHybridRunbookWorkerGroup, err := automation.NewHybridRunbookWorkerGroup(ctx, "exampleHybridRunbookWorkerGroup", &automation.HybridRunbookWorkerGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("vm-example"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Size: pulumi.String("Standard_B1s"), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// DisablePasswordAuthentication: pulumi.Bool(false), +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("OpenLogic"), +// Offer: pulumi.String("CentOS"), +// Sku: pulumi.String("7.5"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewHybridRunbookWorker(ctx, "exampleHybridRunbookWorker", &automation.HybridRunbookWorkerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// WorkerGroupName: exampleHybridRunbookWorkerGroup.Name, +// VmResourceId: exampleLinuxVirtualMachine.ID(), +// WorkerId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/hybridRunbookWorkerGroup.go b/sdk/go/azure/automation/hybridRunbookWorkerGroup.go index 677a6746d8..531bfbe629 100644 --- a/sdk/go/azure/automation/hybridRunbookWorkerGroup.go +++ b/sdk/go/azure/automation/hybridRunbookWorkerGroup.go @@ -15,6 +15,48 @@ import ( // Manages a Automation Hybrid Runbook Worker Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewHybridRunbookWorkerGroup(ctx, "exampleHybridRunbookWorkerGroup", &automation.HybridRunbookWorkerGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/intVariable.go b/sdk/go/azure/automation/intVariable.go index 68ef7b95cc..da7ab8bc68 100644 --- a/sdk/go/azure/automation/intVariable.go +++ b/sdk/go/azure/automation/intVariable.go @@ -15,6 +15,49 @@ import ( // Manages a integer variable in Azure Automation // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewIntVariable(ctx, "exampleIntVariable", &automation.IntVariableArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Value: pulumi.Int(1234), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Int Variable can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/jobSchedule.go b/sdk/go/azure/automation/jobSchedule.go index 1b4167232a..e0f28fc55c 100644 --- a/sdk/go/azure/automation/jobSchedule.go +++ b/sdk/go/azure/automation/jobSchedule.go @@ -15,6 +15,41 @@ import ( // Links an Automation Runbook and Schedule. // +// ## Example Usage +// +// This is an example of just the Job Schedule. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := automation.NewJobSchedule(ctx, "example", &automation.JobScheduleArgs{ +// AutomationAccountName: pulumi.String("tf-automation-account"), +// Parameters: pulumi.StringMap{ +// "resourcegroup": pulumi.String("tf-rgr-vm"), +// "vmname": pulumi.String("TF-VM-01"), +// }, +// ResourceGroupName: pulumi.String("tf-rgr-automation"), +// RunbookName: pulumi.String("Get-VirtualMachine"), +// ScheduleName: pulumi.String("hour"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Job Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/module.go b/sdk/go/azure/automation/module.go index 691f861b9f..0b727f8f4f 100644 --- a/sdk/go/azure/automation/module.go +++ b/sdk/go/azure/automation/module.go @@ -15,6 +15,51 @@ import ( // Manages a Automation Module. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewModule(ctx, "exampleModule", &automation.ModuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// ModuleLink: &automation.ModuleModuleLinkArgs{ +// Uri: pulumi.String("https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Modules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/python3Package.go b/sdk/go/azure/automation/python3Package.go index 213ce2d523..f730c03cb3 100644 --- a/sdk/go/azure/automation/python3Package.go +++ b/sdk/go/azure/automation/python3Package.go @@ -15,6 +15,55 @@ import ( // Manages a Automation Python3 Package. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("%[2]s"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewPython3Package(ctx, "examplePython3Package", &automation.Python3PackageArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// ContentUri: pulumi.String("https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz"), +// ContentVersion: pulumi.String("2.31.0"), +// HashAlgorithm: pulumi.String("sha256"), +// HashValue: pulumi.String("942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("foo"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Python3 Packages can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/runBook.go b/sdk/go/azure/automation/runBook.go index e945c0f87c..835b1902af 100644 --- a/sdk/go/azure/automation/runBook.go +++ b/sdk/go/azure/automation/runBook.go @@ -15,6 +15,112 @@ import ( // Manages a Automation Runbook. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewRunBook(ctx, "exampleRunBook", &automation.RunBookArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// LogVerbose: pulumi.Bool(true), +// LogProgress: pulumi.Bool(true), +// Description: pulumi.String("This is an example runbook"), +// RunbookType: pulumi.String("PowerShellWorkflow"), +// PublishContentLink: &automation.RunBookPublishContentLinkArgs{ +// Uri: pulumi.String("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Custom Content +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-local/sdk/go/local" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleFile, err := local.LookupFile(ctx, &local.LookupFileArgs{ +// Filename: fmt.Sprintf("%v/example.ps1", path.Module), +// }, nil) +// if err != nil { +// return err +// } +// _, err = automation.NewRunBook(ctx, "exampleRunBook", &automation.RunBookArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// LogVerbose: pulumi.Bool(true), +// LogProgress: pulumi.Bool(true), +// Description: pulumi.String("This is an example runbook"), +// RunbookType: pulumi.String("PowerShell"), +// Content: *pulumi.String(exampleFile.Content), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Runbooks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/schedule.go b/sdk/go/azure/automation/schedule.go index 5ca8cbfd69..63c98a1f5f 100644 --- a/sdk/go/azure/automation/schedule.go +++ b/sdk/go/azure/automation/schedule.go @@ -15,6 +15,56 @@ import ( // Manages a Automation Schedule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewSchedule(ctx, "exampleSchedule", &automation.ScheduleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Frequency: pulumi.String("Week"), +// Interval: pulumi.Int(1), +// Timezone: pulumi.String("Australia/Perth"), +// StartTime: pulumi.String("2014-04-15T18:00:15+02:00"), +// Description: pulumi.String("This is an example schedule"), +// WeekDays: pulumi.StringArray{ +// pulumi.String("Friday"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/softwareUpdateConfiguration.go b/sdk/go/azure/automation/softwareUpdateConfiguration.go index 92b0b51595..074ad664b2 100644 --- a/sdk/go/azure/automation/softwareUpdateConfiguration.go +++ b/sdk/go/azure/automation/softwareUpdateConfiguration.go @@ -15,6 +15,85 @@ import ( // Manages an Automation Software Update Configuraion. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleRunBook, err := automation.NewRunBook(ctx, "exampleRunBook", &automation.RunBookArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// LogVerbose: pulumi.Bool(true), +// LogProgress: pulumi.Bool(true), +// Description: pulumi.String("This is a example runbook for terraform acceptance example"), +// RunbookType: pulumi.String("Python3"), +// Content: pulumi.String("# Some example content\n# for Terraform acceptance example\n"), +// Tags: pulumi.StringMap{ +// "ENV": pulumi.String("runbook_test"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewSoftwareUpdateConfiguration(ctx, "exampleSoftwareUpdateConfiguration", &automation.SoftwareUpdateConfigurationArgs{ +// AutomationAccountId: exampleAccount.ID(), +// OperatingSystem: pulumi.String("Linux"), +// Linuxes: automation.SoftwareUpdateConfigurationLinuxArray{ +// &automation.SoftwareUpdateConfigurationLinuxArgs{ +// ClassificationIncluded: pulumi.String("Security"), +// ExcludedPackages: pulumi.StringArray{ +// pulumi.String("apt"), +// }, +// IncludedPackages: pulumi.StringArray{ +// pulumi.String("vim"), +// }, +// Reboot: pulumi.String("IfRequired"), +// }, +// }, +// PreTasks: automation.SoftwareUpdateConfigurationPreTaskArray{ +// &automation.SoftwareUpdateConfigurationPreTaskArgs{ +// Source: exampleRunBook.Name, +// Parameters: pulumi.StringMap{ +// "COMPUTER_NAME": pulumi.String("Foo"), +// }, +// }, +// }, +// Duration: pulumi.String("PT2H2M2S"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automations Software Update Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/sourceControl.go b/sdk/go/azure/automation/sourceControl.go index 0d0e2ed3db..89c76188ae 100644 --- a/sdk/go/azure/automation/sourceControl.go +++ b/sdk/go/azure/automation/sourceControl.go @@ -15,6 +15,55 @@ import ( // Manages an Automation Source Control. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewSourceControl(ctx, "exampleSourceControl", &automation.SourceControlArgs{ +// AutomationAccountId: exampleAccount.ID(), +// FolderPath: pulumi.String("runbook"), +// Security: &automation.SourceControlSecurityArgs{ +// Token: pulumi.String("ghp_xxx"), +// TokenType: pulumi.String("PersonalAccessToken"), +// }, +// RepositoryUrl: pulumi.String("https://github.com/foo/bat.git"), +// SourceControlType: pulumi.String("GitHub"), +// Branch: pulumi.String("main"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/stringVariable.go b/sdk/go/azure/automation/stringVariable.go index e4b3ab70b2..ff968936a8 100644 --- a/sdk/go/azure/automation/stringVariable.go +++ b/sdk/go/azure/automation/stringVariable.go @@ -15,6 +15,49 @@ import ( // Manages a string variable in Azure Automation // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewStringVariable(ctx, "exampleStringVariable", &automation.StringVariableArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Value: pulumi.String("Hello, Basic Test."), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation String Variable can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/variableObject.go b/sdk/go/azure/automation/variableObject.go index 0e9a7a756c..92a5e47420 100644 --- a/sdk/go/azure/automation/variableObject.go +++ b/sdk/go/azure/automation/variableObject.go @@ -15,6 +15,59 @@ import ( // Manages an object variable in Azure Automation // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "greeting": "Hello, Terraform Basic Test.", +// "language": "en", +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = automation.NewVariableObject(ctx, "exampleVariableObject", &automation.VariableObjectArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// Value: pulumi.String(json0), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Object Variable can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/watcher.go b/sdk/go/azure/automation/watcher.go index 724fe67891..e8433046b5 100644 --- a/sdk/go/azure/automation/watcher.go +++ b/sdk/go/azure/automation/watcher.go @@ -15,6 +15,80 @@ import ( // Manages an Automation Wacher. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleHybridRunbookWorkerGroup, err := automation.NewHybridRunbookWorkerGroup(ctx, "exampleHybridRunbookWorkerGroup", &automation.HybridRunbookWorkerGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleRunBook, err := automation.NewRunBook(ctx, "exampleRunBook", &automation.RunBookArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// LogVerbose: pulumi.Bool(true), +// LogProgress: pulumi.Bool(true), +// Description: pulumi.String("This is an example runbook"), +// RunbookType: pulumi.String("PowerShellWorkflow"), +// PublishContentLink: &automation.RunBookPublishContentLinkArgs{ +// Uri: pulumi.String("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewWatcher(ctx, "exampleWatcher", &automation.WatcherArgs{ +// AutomationAccountId: exampleAccount.ID(), +// Location: pulumi.String("West Europe"), +// ScriptName: exampleRunBook.Name, +// ScriptRunOn: exampleHybridRunbookWorkerGroup.Name, +// Description: pulumi.String("example-watcher desc"), +// ExecutionFrequencyInSeconds: pulumi.Int(42), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// ScriptParameters: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/automation/webhook.go b/sdk/go/azure/automation/webhook.go index f58c81deda..a06224a015 100644 --- a/sdk/go/azure/automation/webhook.go +++ b/sdk/go/azure/automation/webhook.go @@ -15,6 +15,69 @@ import ( // Manages an Automation Runbook's Webhook. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleRunBook, err := automation.NewRunBook(ctx, "exampleRunBook", &automation.RunBookArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// LogVerbose: pulumi.Bool(true), +// LogProgress: pulumi.Bool(true), +// Description: pulumi.String("This is an example runbook"), +// RunbookType: pulumi.String("PowerShellWorkflow"), +// PublishContentLink: &automation.RunBookPublishContentLinkArgs{ +// Uri: pulumi.String("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = automation.NewWebhook(ctx, "exampleWebhook", &automation.WebhookArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AutomationAccountName: exampleAccount.Name, +// ExpiryTime: pulumi.String("2021-12-31T00:00:00Z"), +// Enabled: pulumi.Bool(true), +// RunbookName: exampleRunBook.Name, +// Parameters: pulumi.StringMap{ +// "input": pulumi.String("parameter"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Automation Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/avs/cluster.go b/sdk/go/azure/avs/cluster.go index 07f53c415e..b5fc34156f 100644 --- a/sdk/go/azure/avs/cluster.go +++ b/sdk/go/azure/avs/cluster.go @@ -15,6 +15,56 @@ import ( // Manages a VMware Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/avs" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePrivateCloud, err := avs.NewPrivateCloud(ctx, "examplePrivateCloud", &avs.PrivateCloudArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("av36"), +// ManagementCluster: &avs.PrivateCloudManagementClusterArgs{ +// Size: pulumi.Int(3), +// }, +// NetworkSubnetCidr: pulumi.String("192.168.48.0/22"), +// InternetConnectionEnabled: pulumi.Bool(false), +// NsxtPassword: pulumi.String("QazWsx13$Edc"), +// VcenterPassword: pulumi.String("WsxEdc23$Rfv"), +// }) +// if err != nil { +// return err +// } +// _, err = avs.NewCluster(ctx, "exampleCluster", &avs.ClusterArgs{ +// VmwareCloudId: examplePrivateCloud.ID(), +// ClusterNodeCount: pulumi.Int(3), +// SkuName: pulumi.String("av36"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VMware Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/avs/expressRouteAuthorization.go b/sdk/go/azure/avs/expressRouteAuthorization.go index 488d2ac505..8523669248 100644 --- a/sdk/go/azure/avs/expressRouteAuthorization.go +++ b/sdk/go/azure/avs/expressRouteAuthorization.go @@ -15,6 +15,54 @@ import ( // Manages an Express Route VMware Authorization. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/avs" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePrivateCloud, err := avs.NewPrivateCloud(ctx, "examplePrivateCloud", &avs.PrivateCloudArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("av36"), +// ManagementCluster: &avs.PrivateCloudManagementClusterArgs{ +// Size: pulumi.Int(3), +// }, +// NetworkSubnetCidr: pulumi.String("192.168.48.0/22"), +// InternetConnectionEnabled: pulumi.Bool(false), +// NsxtPassword: pulumi.String("QazWsx13$Edc"), +// VcenterPassword: pulumi.String("WsxEdc23$Rfv"), +// }) +// if err != nil { +// return err +// } +// _, err = avs.NewExpressRouteAuthorization(ctx, "exampleExpressRouteAuthorization", &avs.ExpressRouteAuthorizationArgs{ +// PrivateCloudId: examplePrivateCloud.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VMware Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/avs/getPrivateCloud.go b/sdk/go/azure/avs/getPrivateCloud.go index 2ad1ef2154..d3f3840e3b 100644 --- a/sdk/go/azure/avs/getPrivateCloud.go +++ b/sdk/go/azure/avs/getPrivateCloud.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about an existing VMware Private Cloud. +// +// ## Example Usage +// +// > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/avs" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := avs.LookupPrivateCloud(ctx, &avs.LookupPrivateCloudArgs{ +// Name: "existing-vmware-private-cloud", +// ResourceGroupName: "existing-resgroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupPrivateCloud(ctx *pulumi.Context, args *LookupPrivateCloudArgs, opts ...pulumi.InvokeOption) (*LookupPrivateCloudResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPrivateCloudResult diff --git a/sdk/go/azure/avs/privateCloud.go b/sdk/go/azure/avs/privateCloud.go index 044d3d8403..030abe0a5f 100644 --- a/sdk/go/azure/avs/privateCloud.go +++ b/sdk/go/azure/avs/privateCloud.go @@ -15,6 +15,50 @@ import ( // Manages a VMware Private Cloud. // +// ## Example Usage +// +// > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/avs" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = avs.NewPrivateCloud(ctx, "examplePrivateCloud", &avs.PrivateCloudArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("av36"), +// ManagementCluster: &avs.PrivateCloudManagementClusterArgs{ +// Size: pulumi.Int(3), +// }, +// NetworkSubnetCidr: pulumi.String("192.168.48.0/22"), +// InternetConnectionEnabled: pulumi.Bool(false), +// NsxtPassword: pulumi.String("QazWsx13$Edc"), +// VcenterPassword: pulumi.String("WsxEdc23$Rfv"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VMware Private Clouds can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/backup/containerStorageAccount.go b/sdk/go/azure/backup/containerStorageAccount.go index 859f1d4147..8c1c1975dc 100644 --- a/sdk/go/azure/backup/containerStorageAccount.go +++ b/sdk/go/azure/backup/containerStorageAccount.go @@ -15,6 +15,60 @@ import ( // Manages registration of a storage account with Azure Backup. Storage accounts must be registered with an Azure Recovery Vault in order to backup file shares within the storage account. Registering a storage account with a vault creates what is known as a protection container within Azure Recovery Services. Once the container is created, Azure file shares within the storage account can be backed up using the `backup.ProtectedFileShare` resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// sa, err := storage.NewAccount(ctx, "sa", &storage.AccountArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = backup.NewContainerStorageAccount(ctx, "container", &backup.ContainerStorageAccountArgs{ +// ResourceGroupName: example.Name, +// RecoveryVaultName: vault.Name, +// StorageAccountId: sa.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Storage Account Containers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/backup/getPolicyFileshare.go b/sdk/go/azure/backup/getPolicyFileshare.go index 4cd84aba52..b0fccb0b5b 100644 --- a/sdk/go/azure/backup/getPolicyFileshare.go +++ b/sdk/go/azure/backup/getPolicyFileshare.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing File Share Backup Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := backup.GetPolicyFileshare(ctx, &backup.GetPolicyFileshareArgs{ +// Name: "policy", +// RecoveryVaultName: "recovery_vault", +// ResourceGroupName: "resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetPolicyFileshare(ctx *pulumi.Context, args *GetPolicyFileshareArgs, opts ...pulumi.InvokeOption) (*GetPolicyFileshareResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPolicyFileshareResult diff --git a/sdk/go/azure/backup/getPolicyVM.go b/sdk/go/azure/backup/getPolicyVM.go index 6e8161a7c4..9e2efdacd9 100644 --- a/sdk/go/azure/backup/getPolicyVM.go +++ b/sdk/go/azure/backup/getPolicyVM.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing VM Backup Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := backup.LookupPolicyVM(ctx, &backup.LookupPolicyVMArgs{ +// Name: "policy", +// RecoveryVaultName: "recovery_vault", +// ResourceGroupName: "resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupPolicyVM(ctx *pulumi.Context, args *LookupPolicyVMArgs, opts ...pulumi.InvokeOption) (*LookupPolicyVMResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPolicyVMResult diff --git a/sdk/go/azure/backup/policyFileShare.go b/sdk/go/azure/backup/policyFileShare.go index d394f40236..b2edb46b29 100644 --- a/sdk/go/azure/backup/policyFileShare.go +++ b/sdk/go/azure/backup/policyFileShare.go @@ -15,6 +15,89 @@ import ( // Manages an Azure File Share Backup Policy within a Recovery Services vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = backup.NewPolicyFileShare(ctx, "policy", &backup.PolicyFileShareArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: exampleVault.Name, +// Timezone: pulumi.String("UTC"), +// Backup: &backup.PolicyFileShareBackupArgs{ +// Frequency: pulumi.String("Daily"), +// Time: pulumi.String("23:00"), +// }, +// RetentionDaily: &backup.PolicyFileShareRetentionDailyArgs{ +// Count: pulumi.Int(10), +// }, +// RetentionWeekly: &backup.PolicyFileShareRetentionWeeklyArgs{ +// Count: pulumi.Int(7), +// Weekdays: pulumi.StringArray{ +// pulumi.String("Sunday"), +// pulumi.String("Wednesday"), +// pulumi.String("Friday"), +// pulumi.String("Saturday"), +// }, +// }, +// RetentionMonthly: &backup.PolicyFileShareRetentionMonthlyArgs{ +// Count: pulumi.Int(7), +// Weekdays: pulumi.StringArray{ +// pulumi.String("Sunday"), +// pulumi.String("Wednesday"), +// }, +// Weeks: pulumi.StringArray{ +// pulumi.String("First"), +// pulumi.String("Last"), +// }, +// }, +// RetentionYearly: &backup.PolicyFileShareRetentionYearlyArgs{ +// Count: pulumi.Int(7), +// Weekdays: pulumi.StringArray{ +// pulumi.String("Sunday"), +// }, +// Weeks: pulumi.StringArray{ +// pulumi.String("Last"), +// }, +// Months: pulumi.StringArray{ +// pulumi.String("January"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure File Share Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/backup/policyVM.go b/sdk/go/azure/backup/policyVM.go index cde4ae378c..eff3765b26 100644 --- a/sdk/go/azure/backup/policyVM.go +++ b/sdk/go/azure/backup/policyVM.go @@ -15,6 +15,89 @@ import ( // Manages an Azure Backup VM Backup Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = backup.NewPolicyVM(ctx, "examplePolicyVM", &backup.PolicyVMArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: exampleVault.Name, +// Timezone: pulumi.String("UTC"), +// Backup: &backup.PolicyVMBackupArgs{ +// Frequency: pulumi.String("Daily"), +// Time: pulumi.String("23:00"), +// }, +// RetentionDaily: &backup.PolicyVMRetentionDailyArgs{ +// Count: pulumi.Int(10), +// }, +// RetentionWeekly: &backup.PolicyVMRetentionWeeklyArgs{ +// Count: pulumi.Int(42), +// Weekdays: pulumi.StringArray{ +// pulumi.String("Sunday"), +// pulumi.String("Wednesday"), +// pulumi.String("Friday"), +// pulumi.String("Saturday"), +// }, +// }, +// RetentionMonthly: &backup.PolicyVMRetentionMonthlyArgs{ +// Count: pulumi.Int(7), +// Weekdays: pulumi.StringArray{ +// pulumi.String("Sunday"), +// pulumi.String("Wednesday"), +// }, +// Weeks: pulumi.StringArray{ +// pulumi.String("First"), +// pulumi.String("Last"), +// }, +// }, +// RetentionYearly: &backup.PolicyVMRetentionYearlyArgs{ +// Count: pulumi.Int(77), +// Weekdays: pulumi.StringArray{ +// pulumi.String("Sunday"), +// }, +// Weeks: pulumi.StringArray{ +// pulumi.String("Last"), +// }, +// Months: pulumi.StringArray{ +// pulumi.String("January"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VM Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/backup/policyVMWorkload.go b/sdk/go/azure/backup/policyVMWorkload.go index 34f7f53c00..24562fb5dd 100644 --- a/sdk/go/azure/backup/policyVMWorkload.go +++ b/sdk/go/azure/backup/policyVMWorkload.go @@ -15,6 +15,76 @@ import ( // Manages an Azure VM Workload Backup Policy within a Recovery Services vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// SoftDeleteEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = backup.NewPolicyVMWorkload(ctx, "examplePolicyVMWorkload", &backup.PolicyVMWorkloadArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: exampleVault.Name, +// WorkloadType: pulumi.String("SQLDataBase"), +// Settings: &backup.PolicyVMWorkloadSettingsArgs{ +// TimeZone: pulumi.String("UTC"), +// CompressionEnabled: pulumi.Bool(false), +// }, +// ProtectionPolicies: backup.PolicyVMWorkloadProtectionPolicyArray{ +// &backup.PolicyVMWorkloadProtectionPolicyArgs{ +// PolicyType: pulumi.String("Full"), +// Backup: &backup.PolicyVMWorkloadProtectionPolicyBackupArgs{ +// Frequency: pulumi.String("Daily"), +// Time: pulumi.String("15:00"), +// }, +// RetentionDaily: &backup.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs{ +// Count: pulumi.Int(8), +// }, +// }, +// &backup.PolicyVMWorkloadProtectionPolicyArgs{ +// PolicyType: pulumi.String("Log"), +// Backup: &backup.PolicyVMWorkloadProtectionPolicyBackupArgs{ +// FrequencyInMinutes: pulumi.Int(15), +// }, +// SimpleRetention: &backup.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs{ +// Count: pulumi.Int(8), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure VM Workload Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/backup/protectedFileShare.go b/sdk/go/azure/backup/protectedFileShare.go index 9557c72f68..ccd679ef61 100644 --- a/sdk/go/azure/backup/protectedFileShare.go +++ b/sdk/go/azure/backup/protectedFileShare.go @@ -15,6 +15,91 @@ import ( // Manages an Azure Backup Protected File Share to enable backups for file shares within an Azure Storage Account // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// sa, err := storage.NewAccount(ctx, "sa", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleShare, err := storage.NewShare(ctx, "exampleShare", &storage.ShareArgs{ +// StorageAccountName: sa.Name, +// Quota: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = backup.NewContainerStorageAccount(ctx, "protection-container", &backup.ContainerStorageAccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// StorageAccountId: sa.ID(), +// }) +// if err != nil { +// return err +// } +// examplePolicyFileShare, err := backup.NewPolicyFileShare(ctx, "examplePolicyFileShare", &backup.PolicyFileShareArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Backup: &backup.PolicyFileShareBackupArgs{ +// Frequency: pulumi.String("Daily"), +// Time: pulumi.String("23:00"), +// }, +// RetentionDaily: &backup.PolicyFileShareRetentionDailyArgs{ +// Count: pulumi.Int(10), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = backup.NewProtectedFileShare(ctx, "share1", &backup.ProtectedFileShareArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// SourceStorageAccountId: protection_container.StorageAccountId, +// SourceFileShareName: exampleShare.Name, +// BackupPolicyId: examplePolicyFileShare.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Backup Protected File Shares can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/backup/protectedVM.go b/sdk/go/azure/backup/protectedVM.go index 9eb9f146e4..ea8cc39d58 100644 --- a/sdk/go/azure/backup/protectedVM.go +++ b/sdk/go/azure/backup/protectedVM.go @@ -15,6 +15,72 @@ import ( // Manages Azure Backup for an Azure VM // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// examplePolicyVM, err := backup.NewPolicyVM(ctx, "examplePolicyVM", &backup.PolicyVMArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: exampleVault.Name, +// Backup: &backup.PolicyVMBackupArgs{ +// Frequency: pulumi.String("Daily"), +// Time: pulumi.String("23:00"), +// }, +// RetentionDaily: &backup.PolicyVMRetentionDailyArgs{ +// Count: pulumi.Int(10), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualMachine := compute.LookupVirtualMachineOutput(ctx, compute.GetVirtualMachineOutputArgs{ +// Name: pulumi.String("example-vm"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// _, err = backup.NewProtectedVM(ctx, "vm1", &backup.ProtectedVMArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RecoveryVaultName: exampleVault.Name, +// SourceVmId: exampleVirtualMachine.ApplyT(func(exampleVirtualMachine compute.GetVirtualMachineResult) (*string, error) { +// return &exampleVirtualMachine.Id, nil +// }).(pulumi.StringPtrOutput), +// BackupPolicyId: examplePolicyVM.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Recovery Services Protected VMs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/batch/account.go b/sdk/go/azure/batch/account.go index 4def23d5ba..5cae1c07cd 100644 --- a/sdk/go/azure/batch/account.go +++ b/sdk/go/azure/batch/account.go @@ -15,6 +15,56 @@ import ( // Manages an Azure Batch account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewAccount(ctx, "exampleBatch/accountAccount", &batch.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PoolAllocationMode: pulumi.String("BatchService"), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountAuthenticationMode: pulumi.String("StorageKeys"), +// Tags: pulumi.StringMap{ +// "env": pulumi.String("test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Batch Account can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/batch/application.go b/sdk/go/azure/batch/application.go index 0e2b9f96d1..96039d809f 100644 --- a/sdk/go/azure/batch/application.go +++ b/sdk/go/azure/batch/application.go @@ -15,6 +15,60 @@ import ( // Manages Azure Batch Application instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewAccount(ctx, "exampleBatch/accountAccount", &batch.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PoolAllocationMode: pulumi.String("BatchService"), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountAuthenticationMode: pulumi.String("StorageKeys"), +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewApplication(ctx, "exampleApplication", &batch.ApplicationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleBatch / accountAccount.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Batch Applications can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/batch/certificate.go b/sdk/go/azure/batch/certificate.go index d28736e277..3a4bdbc881 100644 --- a/sdk/go/azure/batch/certificate.go +++ b/sdk/go/azure/batch/certificate.go @@ -15,6 +15,79 @@ import ( // Manages a certificate in an Azure Batch account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewAccount(ctx, "exampleBatch/accountAccount", &batch.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PoolAllocationMode: pulumi.String("BatchService"), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountAuthenticationMode: pulumi.String("StorageKeys"), +// Tags: pulumi.StringMap{ +// "env": pulumi.String("test"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewCertificate(ctx, "exampleCertificate", &batch.CertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleBatch / accountAccount.Name, +// Certificate: filebase64OrPanic("certificate.pfx"), +// Format: pulumi.String("Pfx"), +// Password: pulumi.String("password"), +// Thumbprint: pulumi.String("42C107874FD0E4A9583292A2F1098E8FE4B2EDDA"), +// ThumbprintAlgorithm: pulumi.String("SHA1"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Batch Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/batch/getAccount.go b/sdk/go/azure/batch/getAccount.go index cd6b908c35..eafab5ceab 100644 --- a/sdk/go/azure/batch/getAccount.go +++ b/sdk/go/azure/batch/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Batch Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := batch.LookupAccount(ctx, &batch.LookupAccountArgs{ +// Name: "testbatchaccount", +// ResourceGroupName: "test", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("poolAllocationMode", example.PoolAllocationMode) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/batch/getApplication.go b/sdk/go/azure/batch/getApplication.go index d54534451a..7398d571f3 100644 --- a/sdk/go/azure/batch/getApplication.go +++ b/sdk/go/azure/batch/getApplication.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Batch Application instance. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := batch.LookupApplication(ctx, &batch.LookupApplicationArgs{ +// Name: "testapplication", +// ResourceGroupName: "test", +// AccountName: "testbatchaccount", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("batchApplicationId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupApplication(ctx *pulumi.Context, args *LookupApplicationArgs, opts ...pulumi.InvokeOption) (*LookupApplicationResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupApplicationResult diff --git a/sdk/go/azure/batch/getCertificate.go b/sdk/go/azure/batch/getCertificate.go index a165a8b66e..6c19bd1266 100644 --- a/sdk/go/azure/batch/getCertificate.go +++ b/sdk/go/azure/batch/getCertificate.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing certificate in a Batch Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := batch.LookupCertificate(ctx, &batch.LookupCertificateArgs{ +// Name: "SHA1-42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", +// AccountName: "examplebatchaccount", +// ResourceGroupName: "example", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("thumbprint", example.Thumbprint) +// return nil +// }) +// } +// +// ``` func LookupCertificate(ctx *pulumi.Context, args *LookupCertificateArgs, opts ...pulumi.InvokeOption) (*LookupCertificateResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupCertificateResult diff --git a/sdk/go/azure/batch/getPool.go b/sdk/go/azure/batch/getPool.go index 5c0b28f396..71dcc2f5da 100644 --- a/sdk/go/azure/batch/getPool.go +++ b/sdk/go/azure/batch/getPool.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Batch pool +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := batch.LookupPool(ctx, &batch.LookupPoolArgs{ +// AccountName: "testbatchaccount", +// Name: "testbatchpool", +// ResourceGroupName: "test", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupPool(ctx *pulumi.Context, args *LookupPoolArgs, opts ...pulumi.InvokeOption) (*LookupPoolResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPoolResult diff --git a/sdk/go/azure/batch/job.go b/sdk/go/azure/batch/job.go index ba3f8f881f..057e2d60b6 100644 --- a/sdk/go/azure/batch/job.go +++ b/sdk/go/azure/batch/job.go @@ -15,6 +15,64 @@ import ( // Manages a Batch Job. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := batch.NewAccount(ctx, "exampleAccount", &batch.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// examplePool, err := batch.NewPool(ctx, "examplePool", &batch.PoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// NodeAgentSkuId: pulumi.String("batch.node.ubuntu 16.04"), +// VmSize: pulumi.String("Standard_A1"), +// FixedScale: &batch.PoolFixedScaleArgs{ +// TargetDedicatedNodes: pulumi.Int(1), +// }, +// StorageImageReference: &batch.PoolStorageImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("UbuntuServer"), +// Sku: pulumi.String("16.04.0-LTS"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewJob(ctx, "exampleJob", &batch.JobArgs{ +// BatchPoolId: examplePool.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Batch Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/batch/pool.go b/sdk/go/azure/batch/pool.go index beb15bca12..e6f2ba0b86 100644 --- a/sdk/go/azure/batch/pool.go +++ b/sdk/go/azure/batch/pool.go @@ -15,6 +15,138 @@ import ( // Manages an Azure Batch pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/batch" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewAccount(ctx, "exampleBatch/accountAccount", &batch.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PoolAllocationMode: pulumi.String("BatchService"), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountAuthenticationMode: pulumi.String("StorageKeys"), +// Tags: pulumi.StringMap{ +// "env": pulumi.String("test"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := batch.NewCertificate(ctx, "exampleCertificate", &batch.CertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleBatch / accountAccount.Name, +// Certificate: filebase64OrPanic("certificate.cer"), +// Format: pulumi.String("Cer"), +// Thumbprint: pulumi.String("312d31a79fa0cef49c00f769afc2b73e9f4edf34"), +// ThumbprintAlgorithm: pulumi.String("SHA1"), +// }) +// if err != nil { +// return err +// } +// _, err = batch.NewPool(ctx, "examplePool", &batch.PoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleBatch / accountAccount.Name, +// DisplayName: pulumi.String("Test Acc Pool Auto"), +// VmSize: pulumi.String("Standard_A1"), +// NodeAgentSkuId: pulumi.String("batch.node.ubuntu 20.04"), +// AutoScale: &batch.PoolAutoScaleArgs{ +// EvaluationInterval: pulumi.String("PT15M"), +// Formula: pulumi.String(` startingNumberOfVMs = 1; +// maxNumberofVMs = 25; +// pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(180 * TimeInterval_Second); +// pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(180 * TimeInterval_Second)); +// $TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples); +// +// `), +// +// }, +// StorageImageReference: &batch.PoolStorageImageReferenceArgs{ +// Publisher: pulumi.String("microsoft-azure-batch"), +// Offer: pulumi.String("ubuntu-server-container"), +// Sku: pulumi.String("20-04-lts"), +// Version: pulumi.String("latest"), +// }, +// ContainerConfiguration: &batch.PoolContainerConfigurationArgs{ +// Type: pulumi.String("DockerCompatible"), +// ContainerRegistries: batch.PoolContainerConfigurationContainerRegistryArray{ +// &batch.PoolContainerConfigurationContainerRegistryArgs{ +// RegistryServer: pulumi.String("docker.io"), +// UserName: pulumi.String("login"), +// Password: pulumi.String("apassword"), +// }, +// }, +// }, +// StartTask: &batch.PoolStartTaskArgs{ +// CommandLine: pulumi.String("echo 'Hello World from $env'"), +// TaskRetryMaximum: pulumi.Int(1), +// WaitForSuccess: pulumi.Bool(true), +// CommonEnvironmentProperties: pulumi.StringMap{ +// "env": pulumi.String("TEST"), +// }, +// UserIdentity: &batch.PoolStartTaskUserIdentityArgs{ +// AutoUser: &batch.PoolStartTaskUserIdentityAutoUserArgs{ +// ElevationLevel: pulumi.String("NonAdmin"), +// Scope: pulumi.String("Task"), +// }, +// }, +// }, +// Certificates: batch.PoolCertificateArray{ +// &batch.PoolCertificateArgs{ +// Id: exampleCertificate.ID(), +// StoreLocation: pulumi.String("CurrentUser"), +// Visibilities: pulumi.StringArray{ +// pulumi.String("StartTask"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Batch Pools can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/billing/accountCostManagementExport.go b/sdk/go/azure/billing/accountCostManagementExport.go index 2eec8c6b90..fac47e4640 100644 --- a/sdk/go/azure/billing/accountCostManagementExport.go +++ b/sdk/go/azure/billing/accountCostManagementExport.go @@ -15,6 +15,66 @@ import ( // Manages a Cost Management Export for a Billing Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/billing" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = billing.NewAccountCostManagementExport(ctx, "exampleAccountCostManagementExport", &billing.AccountCostManagementExportArgs{ +// BillingAccountId: pulumi.String("example"), +// RecurrenceType: pulumi.String("Monthly"), +// RecurrencePeriodStartDate: pulumi.String("2020-08-18T00:00:00Z"), +// RecurrencePeriodEndDate: pulumi.String("2020-09-18T00:00:00Z"), +// ExportDataStorageLocation: &billing.AccountCostManagementExportExportDataStorageLocationArgs{ +// ContainerId: exampleContainer.ResourceManagerId, +// RootFolderPath: pulumi.String("/root/updated"), +// }, +// ExportDataOptions: &billing.AccountCostManagementExportExportDataOptionsArgs{ +// Type: pulumi.String("Usage"), +// TimeFrame: pulumi.String("WeekToDate"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Billing Account Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/billing/getEnrollmentAccountScope.go b/sdk/go/azure/billing/getEnrollmentAccountScope.go index 5f05150efb..8899860848 100644 --- a/sdk/go/azure/billing/getEnrollmentAccountScope.go +++ b/sdk/go/azure/billing/getEnrollmentAccountScope.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Enrollment Account Billing Scope. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/billing" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := billing.GetEnrollmentAccountScope(ctx, &billing.GetEnrollmentAccountScopeArgs{ +// BillingAccountName: "existing", +// EnrollmentAccountName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetEnrollmentAccountScope(ctx *pulumi.Context, args *GetEnrollmentAccountScopeArgs, opts ...pulumi.InvokeOption) (*GetEnrollmentAccountScopeResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetEnrollmentAccountScopeResult diff --git a/sdk/go/azure/billing/getMcaAccountScope.go b/sdk/go/azure/billing/getMcaAccountScope.go index 8d94e9abaa..f01d26e029 100644 --- a/sdk/go/azure/billing/getMcaAccountScope.go +++ b/sdk/go/azure/billing/getMcaAccountScope.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access an ID for your MCA Account billing scope. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/billing" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := billing.GetMcaAccountScope(ctx, &billing.GetMcaAccountScopeArgs{ +// BillingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", +// BillingProfileName: "PE2Q-NOIT-BG7-TGB", +// InvoiceSectionName: "MTT4-OBS7-PJA-TGB", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetMcaAccountScope(ctx *pulumi.Context, args *GetMcaAccountScopeArgs, opts ...pulumi.InvokeOption) (*GetMcaAccountScopeResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetMcaAccountScopeResult diff --git a/sdk/go/azure/billing/getMpaAccountScope.go b/sdk/go/azure/billing/getMpaAccountScope.go index 3e0741268b..18e03b9916 100644 --- a/sdk/go/azure/billing/getMpaAccountScope.go +++ b/sdk/go/azure/billing/getMpaAccountScope.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access an ID for your MPA Account billing scope. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/billing" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := billing.GetMpaAccountScope(ctx, &billing.GetMpaAccountScopeArgs{ +// BillingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", +// CustomerName: "2281f543-7321-4cf9-1e23-edb4Oc31a31c", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetMpaAccountScope(ctx *pulumi.Context, args *GetMpaAccountScopeArgs, opts ...pulumi.InvokeOption) (*GetMpaAccountScopeResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetMpaAccountScopeResult diff --git a/sdk/go/azure/blueprint/assignment.go b/sdk/go/azure/blueprint/assignment.go index d8d2df2769..eb8c2c66a4 100644 --- a/sdk/go/azure/blueprint/assignment.go +++ b/sdk/go/azure/blueprint/assignment.go @@ -19,6 +19,120 @@ import ( // // > **NOTE:** Azure Blueprint Assignments can only be applied to Subscriptions. Assignments to Management Groups is not currently supported by the service or by this provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/blueprint" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleSubscription, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleDefinition, err := blueprint.GetDefinition(ctx, &blueprint.GetDefinitionArgs{ +// Name: "exampleBlueprint", +// ScopeId: exampleSubscription.Id, +// }, nil) +// if err != nil { +// return err +// } +// examplePublishedVersion, err := blueprint.GetPublishedVersion(ctx, &blueprint.GetPublishedVersionArgs{ +// ScopeId: exampleDefinition.ScopeId, +// BlueprintName: exampleDefinition.Name, +// Version: "v1.0.0", +// }, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// operator, err := authorization.NewAssignment(ctx, "operator", &authorization.AssignmentArgs{ +// Scope: *pulumi.String(exampleSubscription.Id), +// RoleDefinitionName: pulumi.String("Blueprint Operator"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// owner, err := authorization.NewAssignment(ctx, "owner", &authorization.AssignmentArgs{ +// Scope: *pulumi.String(exampleSubscription.Id), +// RoleDefinitionName: pulumi.String("Owner"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// _, err = blueprint.NewAssignment(ctx, "exampleAssignment", &blueprint.AssignmentArgs{ +// TargetSubscriptionId: *pulumi.String(exampleSubscription.Id), +// VersionId: *pulumi.String(examplePublishedVersion.Id), +// Location: exampleResourceGroup.Location, +// LockMode: pulumi.String("AllResourcesDoNotDelete"), +// LockExcludePrincipals: pulumi.StringArray{ +// *pulumi.String(current.ObjectId), +// }, +// Identity: &blueprint.AssignmentIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// ResourceGroups: pulumi.String(` { +// "ResourceGroup": { +// "name": "exampleRG-bp" +// } +// } +// +// `), +// +// ParameterValues: pulumi.String(` { +// "allowedlocationsforresourcegroups_listOfAllowedLocations": { +// "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"] +// } +// } +// +// `), +// +// }, pulumi.DependsOn([]pulumi.Resource{ +// operator, +// owner, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Blueprint Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/blueprint/getDefinition.go b/sdk/go/azure/blueprint/getDefinition.go index 716ca47c05..2c7ae7d4c5 100644 --- a/sdk/go/azure/blueprint/getDefinition.go +++ b/sdk/go/azure/blueprint/getDefinition.go @@ -15,6 +15,45 @@ import ( // Use this data source to access information about an existing Azure Blueprint Definition // // > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/blueprint" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// root, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef(current.TenantId), +// }, nil) +// if err != nil { +// return err +// } +// _, err = blueprint.GetDefinition(ctx, &blueprint.GetDefinitionArgs{ +// Name: "exampleManagementGroupBP", +// ScopeId: root.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetDefinition(ctx *pulumi.Context, args *GetDefinitionArgs, opts ...pulumi.InvokeOption) (*GetDefinitionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetDefinitionResult diff --git a/sdk/go/azure/blueprint/getPublishedVersion.go b/sdk/go/azure/blueprint/getPublishedVersion.go index c076855687..7f9ffac2e8 100644 --- a/sdk/go/azure/blueprint/getPublishedVersion.go +++ b/sdk/go/azure/blueprint/getPublishedVersion.go @@ -15,6 +15,39 @@ import ( // Use this data source to access information about an existing Blueprint Published Version // // > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/blueprint" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = blueprint.GetPublishedVersion(ctx, &blueprint.GetPublishedVersionArgs{ +// ScopeId: current.Id, +// BlueprintName: "exampleBluePrint", +// Version: "dev_v2.3", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetPublishedVersion(ctx *pulumi.Context, args *GetPublishedVersionArgs, opts ...pulumi.InvokeOption) (*GetPublishedVersionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPublishedVersionResult diff --git a/sdk/go/azure/bot/channelAlexa.go b/sdk/go/azure/bot/channelAlexa.go index 91f7f854e2..475cd2258b 100644 --- a/sdk/go/azure/bot/channelAlexa.go +++ b/sdk/go/azure/bot/channelAlexa.go @@ -17,6 +17,55 @@ import ( // // > **Note** A bot can only have a single Alexa Channel associated with it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelAlexa(ctx, "exampleChannelAlexa", &bot.ChannelAlexaArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkillId: pulumi.String("amzn1.ask.skill.00000000-0000-0000-0000-000000000000"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Alexa Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelDirectLine.go b/sdk/go/azure/bot/channelDirectLine.go index c9b29b3398..618c1a8f96 100644 --- a/sdk/go/azure/bot/channelDirectLine.go +++ b/sdk/go/azure/bot/channelDirectLine.go @@ -15,6 +15,60 @@ import ( // Manages a Directline integration for a Bot Channel // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelDirectLine(ctx, "exampleChannelDirectLine", &bot.ChannelDirectLineArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sites: bot.ChannelDirectLineSiteArray{ +// &bot.ChannelDirectLineSiteArgs{ +// Name: pulumi.String("default"), +// Enabled: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Directline Channel for a Bot can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelDirectLineSpeech.go b/sdk/go/azure/bot/channelDirectLineSpeech.go index 359a632abc..1bddb5a391 100644 --- a/sdk/go/azure/bot/channelDirectLineSpeech.go +++ b/sdk/go/azure/bot/channelDirectLineSpeech.go @@ -15,6 +15,66 @@ import ( // Manages a Direct Line Speech integration for a Bot Channel // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cognitive.NewAccount(ctx, "exampleAccount", &cognitive.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.String("SpeechServices"), +// SkuName: pulumi.String("S0"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelDirectLineSpeech(ctx, "exampleChannelDirectLineSpeech", &bot.ChannelDirectLineSpeechArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// CognitiveServiceLocation: exampleAccount.Location, +// CognitiveServiceAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Direct Line Speech Channels can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelEmail.go b/sdk/go/azure/bot/channelEmail.go index f3f14fb0c1..b3213bb0c6 100644 --- a/sdk/go/azure/bot/channelEmail.go +++ b/sdk/go/azure/bot/channelEmail.go @@ -17,6 +17,56 @@ import ( // // > **Note** A bot can only have a single Email Channel associated with it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelEmail(ctx, "exampleChannelEmail", &bot.ChannelEmailArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// EmailAddress: pulumi.String("example.com"), +// EmailPassword: pulumi.String("123456"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Email Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelFacebook.go b/sdk/go/azure/bot/channelFacebook.go index 18cee065ed..9924c0f6c8 100644 --- a/sdk/go/azure/bot/channelFacebook.go +++ b/sdk/go/azure/bot/channelFacebook.go @@ -17,6 +17,62 @@ import ( // // > **Note** A bot can only have a single Facebook Channel associated with it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelFacebook(ctx, "exampleChannelFacebook", &bot.ChannelFacebookArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FacebookApplicationId: pulumi.String("563490254873576"), +// FacebookApplicationSecret: pulumi.String("8976d2536445ad5b976dee8437b9beb0"), +// Pages: bot.ChannelFacebookPageArray{ +// &bot.ChannelFacebookPageArgs{ +// Id: pulumi.String("876248795081953"), +// AccessToken: pulumi.String("CGGCec3UAFPMBAKwK3Ft8SEpO8ZCuvpNBI5DClaJCDfqJj2BgEHCKxcY0FDarmUQap6XxpZC9GWCW4nZCzjcKosAZAP7SO44X8Q8gAntbDIXgYUBGp9xtS8wUkwgKPobUePcOOVFkvClxvYZByuiQxoTiK9fQ9jZCPEorbmZCsKDZAx4VLnrNwCTZAPUwXxO61gfq4ZD"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Facebook Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelLine.go b/sdk/go/azure/bot/channelLine.go index d1ce0fe54d..3b1d9ca4a6 100644 --- a/sdk/go/azure/bot/channelLine.go +++ b/sdk/go/azure/bot/channelLine.go @@ -17,6 +17,60 @@ import ( // // > **Note** A bot can only have a single Line Channel associated with it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelLine(ctx, "exampleChannelLine", &bot.ChannelLineArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LineChannels: bot.ChannelLineLineChannelArray{ +// &bot.ChannelLineLineChannelArgs{ +// AccessToken: pulumi.String("asdfdsdfTYUIOIoj1231hkjhk"), +// Secret: pulumi.String("aagfdgfd123567"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Line Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelSlack.go b/sdk/go/azure/bot/channelSlack.go index 2ff43efc14..fdc8b9aef3 100644 --- a/sdk/go/azure/bot/channelSlack.go +++ b/sdk/go/azure/bot/channelSlack.go @@ -17,6 +17,57 @@ import ( // // > **Note** A bot can only have a single Slack Channel associated with it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelSlack(ctx, "exampleChannelSlack", &bot.ChannelSlackArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ClientId: pulumi.String("exampleId"), +// ClientSecret: pulumi.String("exampleSecret"), +// VerificationToken: pulumi.String("exampleVerificationToken"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Slack Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelSms.go b/sdk/go/azure/bot/channelSms.go index a43a372a09..55f3c26643 100644 --- a/sdk/go/azure/bot/channelSms.go +++ b/sdk/go/azure/bot/channelSms.go @@ -17,6 +17,57 @@ import ( // // > **Note** A bot can only have a single SMS Channel associated with it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelSms(ctx, "exampleChannelSms", &bot.ChannelSmsArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SmsChannelAccountSecurityId: pulumi.String("BG61f7cf5157f439b084e98256409c2815"), +// SmsChannelAuthToken: pulumi.String("jh8980432610052ed4e29565c5e232f"), +// PhoneNumber: pulumi.String("+12313803556"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The SMS Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelTeams.go b/sdk/go/azure/bot/channelTeams.go index 4560be1b0b..e0e9e3d35d 100644 --- a/sdk/go/azure/bot/channelTeams.go +++ b/sdk/go/azure/bot/channelTeams.go @@ -17,6 +17,54 @@ import ( // // > **Note** A bot can only have a single MS Teams Channel associated with it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelTeams(ctx, "exampleChannelTeams", &bot.ChannelTeamsArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Microsoft Teams Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelWebChat.go b/sdk/go/azure/bot/channelWebChat.go index 66cb9b868d..17bda02598 100644 --- a/sdk/go/azure/bot/channelWebChat.go +++ b/sdk/go/azure/bot/channelWebChat.go @@ -15,6 +15,59 @@ import ( // Manages a Web Chat integration for a Bot Channel // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelWebChat(ctx, "exampleChannelWebChat", &bot.ChannelWebChatArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sites: bot.ChannelWebChatSiteArray{ +// &bot.ChannelWebChatSiteArgs{ +// Name: pulumi.String("TestSite"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Web Chat Channels can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/channelsRegistration.go b/sdk/go/azure/bot/channelsRegistration.go index d0396e69e0..b29fbbefef 100644 --- a/sdk/go/azure/bot/channelsRegistration.go +++ b/sdk/go/azure/bot/channelsRegistration.go @@ -15,6 +15,46 @@ import ( // Manages a Bot Channels Registration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Bot Channels Registration can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/connection.go b/sdk/go/azure/bot/connection.go index 7a3ce25a6c..6bf1055817 100644 --- a/sdk/go/azure/bot/connection.go +++ b/sdk/go/azure/bot/connection.go @@ -15,6 +15,57 @@ import ( // Manages a Bot Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "exampleChannelsRegistration", &bot.ChannelsRegistrationArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewConnection(ctx, "exampleConnection", &bot.ConnectionArgs{ +// BotName: exampleChannelsRegistration.Name, +// Location: exampleChannelsRegistration.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceProviderName: pulumi.String("box"), +// ClientId: pulumi.String("exampleId"), +// ClientSecret: pulumi.String("exampleSecret"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Bot Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/healthbot.go b/sdk/go/azure/bot/healthbot.go index 0506b7bbfd..4f9d0181f7 100644 --- a/sdk/go/azure/bot/healthbot.go +++ b/sdk/go/azure/bot/healthbot.go @@ -15,6 +15,41 @@ import ( // Manages a Healthbot Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewHealthbot(ctx, "exampleHealthbot", &bot.HealthbotArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("F0"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Healthbot Service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/serviceAzureBot.go b/sdk/go/azure/bot/serviceAzureBot.go index ca5427f7ca..ffde35b37a 100644 --- a/sdk/go/azure/bot/serviceAzureBot.go +++ b/sdk/go/azure/bot/serviceAzureBot.go @@ -15,6 +15,74 @@ import ( // Manages an Azure Bot Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleApiKey, err := appinsights.NewApiKey(ctx, "exampleApiKey", &appinsights.ApiKeyArgs{ +// ApplicationInsightsId: exampleInsights.ID(), +// ReadPermissions: pulumi.StringArray{ +// pulumi.String("aggregate"), +// pulumi.String("api"), +// pulumi.String("draft"), +// pulumi.String("extendqueries"), +// pulumi.String("search"), +// }, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = bot.NewServiceAzureBot(ctx, "exampleServiceAzureBot", &bot.ServiceAzureBotArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("global"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// Sku: pulumi.String("F0"), +// Endpoint: pulumi.String("https://example.com"), +// DeveloperAppInsightsApiKey: exampleApiKey.ApiKey, +// DeveloperAppInsightsApplicationId: exampleInsights.AppId, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Bot Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/bot/webApp.go b/sdk/go/azure/bot/webApp.go index f45cafb92b..57f839120c 100644 --- a/sdk/go/azure/bot/webApp.go +++ b/sdk/go/azure/bot/webApp.go @@ -15,6 +15,46 @@ import ( // Manages a Bot Web App. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = bot.NewWebApp(ctx, "exampleWebApp", &bot.WebAppArgs{ +// Location: pulumi.String("global"), +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("F0"), +// MicrosoftAppId: *pulumi.String(current.ClientId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Bot Web App's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/endpoint.go b/sdk/go/azure/cdn/endpoint.go index 1f26559085..3c17379e4a 100644 --- a/sdk/go/azure/cdn/endpoint.go +++ b/sdk/go/azure/cdn/endpoint.go @@ -13,6 +13,55 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleProfile, err := cdn.NewProfile(ctx, "exampleProfile", &cdn.ProfileArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard_Verizon"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewEndpoint(ctx, "exampleEndpoint", &cdn.EndpointArgs{ +// ProfileName: exampleProfile.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Origins: cdn.EndpointOriginArray{ +// &cdn.EndpointOriginArgs{ +// Name: pulumi.String("example"), +// HostName: pulumi.String("www.contoso.com"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CDN Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/endpointCustomDomain.go b/sdk/go/azure/cdn/endpointCustomDomain.go index 6855b1256a..c9cca29c32 100644 --- a/sdk/go/azure/cdn/endpointCustomDomain.go +++ b/sdk/go/azure/cdn/endpointCustomDomain.go @@ -15,6 +15,93 @@ import ( // Manages a Custom Domain for a CDN Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleProfile, err := cdn.NewProfile(ctx, "exampleProfile", &cdn.ProfileArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard_Verizon"), +// }) +// if err != nil { +// return err +// } +// exampleEndpoint, err := cdn.NewEndpoint(ctx, "exampleEndpoint", &cdn.EndpointArgs{ +// ProfileName: exampleProfile.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Origins: cdn.EndpointOriginArray{ +// &cdn.EndpointOriginArgs{ +// Name: pulumi.String("example"), +// HostName: exampleAccount.PrimaryBlobHost, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.LookupZone(ctx, &dns.LookupZoneArgs{ +// Name: "example-domain.com", +// ResourceGroupName: pulumi.StringRef("domain-rg"), +// }, nil) +// if err != nil { +// return err +// } +// exampleCNameRecord, err := dns.NewCNameRecord(ctx, "exampleCNameRecord", &dns.CNameRecordArgs{ +// ZoneName: *pulumi.String(exampleZone.Name), +// ResourceGroupName: *pulumi.String(exampleZone.ResourceGroupName), +// Ttl: pulumi.Int(3600), +// TargetResourceId: exampleEndpoint.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewEndpointCustomDomain(ctx, "exampleEndpointCustomDomain", &cdn.EndpointCustomDomainArgs{ +// CdnEndpointId: exampleEndpoint.ID(), +// HostName: exampleCNameRecord.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v.%v", name, exampleZone.Name), nil +// }).(pulumi.StringOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CDN Endpoint Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorCustomDomain.go b/sdk/go/azure/cdn/frontdoorCustomDomain.go index 783e8ceaa9..e88b6ff7fd 100644 --- a/sdk/go/azure/cdn/frontdoorCustomDomain.go +++ b/sdk/go/azure/cdn/frontdoorCustomDomain.go @@ -13,6 +13,92 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleFrontdoorProfile, err := cdn.NewFrontdoorProfile(ctx, "exampleFrontdoorProfile", &cdn.FrontdoorProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard_AzureFrontDoor"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewFrontdoorCustomDomain(ctx, "exampleFrontdoorCustomDomain", &cdn.FrontdoorCustomDomainArgs{ +// CdnFrontdoorProfileId: exampleFrontdoorProfile.ID(), +// DnsZoneId: exampleZone.ID(), +// HostName: pulumi.String("contoso.fabrikam.com"), +// Tls: &cdn.FrontdoorCustomDomainTlsArgs{ +// CertificateType: pulumi.String("ManagedCertificate"), +// MinimumTlsVersion: pulumi.String("TLS12"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ## Example CNAME Record Usage +// +// !>**IMPORTANT:** You **must** include the `dependsOn` meta-argument which references both the `cdn.FrontdoorRoute` and the `cdn.FrontdoorSecurityPolicy` that are associated with your Custom Domain. The reason for these `dependsOn` meta-arguments is because all of the resources for the Custom Domain need to be associated within Front Door before the CNAME record can be written to the domains DNS, else the CNAME validation will fail and Front Door will not enable traffic to the Domain. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := dns.NewCNameRecord(ctx, "example", &dns.CNameRecordArgs{ +// ZoneName: pulumi.Any(azurerm_dns_zone.Example.Name), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name), +// Ttl: pulumi.Int(3600), +// Record: pulumi.Any(azurerm_cdn_frontdoor_endpoint.Example.Host_name), +// }, pulumi.DependsOn([]pulumi.Resource{ +// azurerm_cdn_frontdoor_route.Example, +// azurerm_cdn_frontdoor_security_policy.Example, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Door Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorEndpoint.go b/sdk/go/azure/cdn/frontdoorEndpoint.go index 0452582c8b..b7745d0e50 100644 --- a/sdk/go/azure/cdn/frontdoorEndpoint.go +++ b/sdk/go/azure/cdn/frontdoorEndpoint.go @@ -15,6 +15,49 @@ import ( // Manages a Front Door (standard/premium) Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFrontdoorProfile, err := cdn.NewFrontdoorProfile(ctx, "exampleFrontdoorProfile", &cdn.FrontdoorProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard_AzureFrontDoor"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewFrontdoorEndpoint(ctx, "exampleFrontdoorEndpoint", &cdn.FrontdoorEndpointArgs{ +// CdnFrontdoorProfileId: exampleFrontdoorProfile.ID(), +// Tags: pulumi.StringMap{ +// "ENV": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Door Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorFirewallPolicy.go b/sdk/go/azure/cdn/frontdoorFirewallPolicy.go index 254b01c268..a271420d12 100644 --- a/sdk/go/azure/cdn/frontdoorFirewallPolicy.go +++ b/sdk/go/azure/cdn/frontdoorFirewallPolicy.go @@ -15,6 +15,159 @@ import ( // Manages a Front Door (standard/premium) Firewall Policy instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFrontdoorProfile, err := cdn.NewFrontdoorProfile(ctx, "exampleFrontdoorProfile", &cdn.FrontdoorProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Premium_AzureFrontDoor"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewFrontdoorFirewallPolicy(ctx, "exampleFrontdoorFirewallPolicy", &cdn.FrontdoorFirewallPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: exampleFrontdoorProfile.SkuName, +// Enabled: pulumi.Bool(true), +// Mode: pulumi.String("Prevention"), +// RedirectUrl: pulumi.String("https://www.contoso.com"), +// CustomBlockResponseStatusCode: pulumi.Int(403), +// CustomBlockResponseBody: pulumi.String("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), +// CustomRules: cdn.FrontdoorFirewallPolicyCustomRuleArray{ +// &cdn.FrontdoorFirewallPolicyCustomRuleArgs{ +// Name: pulumi.String("Rule1"), +// Enabled: pulumi.Bool(true), +// Priority: pulumi.Int(1), +// RateLimitDurationInMinutes: pulumi.Int(1), +// RateLimitThreshold: pulumi.Int(10), +// Type: pulumi.String("MatchRule"), +// Action: pulumi.String("Block"), +// MatchConditions: cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArray{ +// &cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs{ +// MatchVariable: pulumi.String("RemoteAddr"), +// Operator: pulumi.String("IPMatch"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// pulumi.String("10.0.0.0/24"), +// }, +// }, +// }, +// }, +// &cdn.FrontdoorFirewallPolicyCustomRuleArgs{ +// Name: pulumi.String("Rule2"), +// Enabled: pulumi.Bool(true), +// Priority: pulumi.Int(2), +// RateLimitDurationInMinutes: pulumi.Int(1), +// RateLimitThreshold: pulumi.Int(10), +// Type: pulumi.String("MatchRule"), +// Action: pulumi.String("Block"), +// MatchConditions: cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArray{ +// &cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs{ +// MatchVariable: pulumi.String("RemoteAddr"), +// Operator: pulumi.String("IPMatch"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }, +// &cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs{ +// MatchVariable: pulumi.String("RequestHeader"), +// Selector: pulumi.String("UserAgent"), +// Operator: pulumi.String("Contains"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("windows"), +// }, +// Transforms: pulumi.StringArray{ +// pulumi.String("Lowercase"), +// pulumi.String("Trim"), +// }, +// }, +// }, +// }, +// }, +// ManagedRules: cdn.FrontdoorFirewallPolicyManagedRuleArray{ +// &cdn.FrontdoorFirewallPolicyManagedRuleArgs{ +// Type: pulumi.String("DefaultRuleSet"), +// Version: pulumi.String("1.0"), +// Exclusions: cdn.FrontdoorFirewallPolicyManagedRuleExclusionArray{ +// &cdn.FrontdoorFirewallPolicyManagedRuleExclusionArgs{ +// MatchVariable: pulumi.String("QueryStringArgNames"), +// Operator: pulumi.String("Equals"), +// Selector: pulumi.String("not_suspicious"), +// }, +// }, +// Overrides: cdn.FrontdoorFirewallPolicyManagedRuleOverrideArray{ +// &cdn.FrontdoorFirewallPolicyManagedRuleOverrideArgs{ +// RuleGroupName: pulumi.String("PHP"), +// Rules: cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArray{ +// &cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs{ +// RuleId: pulumi.String("933100"), +// Enabled: pulumi.Bool(false), +// Action: pulumi.String("Block"), +// }, +// }, +// }, +// &cdn.FrontdoorFirewallPolicyManagedRuleOverrideArgs{ +// RuleGroupName: pulumi.String("SQLI"), +// Exclusions: cdn.FrontdoorFirewallPolicyManagedRuleOverrideExclusionArray{ +// &cdn.FrontdoorFirewallPolicyManagedRuleOverrideExclusionArgs{ +// MatchVariable: pulumi.String("QueryStringArgNames"), +// Operator: pulumi.String("Equals"), +// Selector: pulumi.String("really_not_suspicious"), +// }, +// }, +// Rules: cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArray{ +// &cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs{ +// RuleId: pulumi.String("942200"), +// Action: pulumi.String("Block"), +// Exclusions: cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleExclusionArray{ +// &cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleExclusionArgs{ +// MatchVariable: pulumi.String("QueryStringArgNames"), +// Operator: pulumi.String("Equals"), +// Selector: pulumi.String("innocent"), +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// &cdn.FrontdoorFirewallPolicyManagedRuleArgs{ +// Type: pulumi.String("Microsoft_BotManagerRuleSet"), +// Version: pulumi.String("1.0"), +// Action: pulumi.String("Log"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Door Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorOriginGroup.go b/sdk/go/azure/cdn/frontdoorOriginGroup.go index 12296b0848..6c9fe1b198 100644 --- a/sdk/go/azure/cdn/frontdoorOriginGroup.go +++ b/sdk/go/azure/cdn/frontdoorOriginGroup.go @@ -15,6 +15,59 @@ import ( // Manages a Front Door (standard/premium) Origin Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFrontdoorProfile, err := cdn.NewFrontdoorProfile(ctx, "exampleFrontdoorProfile", &cdn.FrontdoorProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard_AzureFrontDoor"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewFrontdoorOriginGroup(ctx, "exampleFrontdoorOriginGroup", &cdn.FrontdoorOriginGroupArgs{ +// CdnFrontdoorProfileId: exampleFrontdoorProfile.ID(), +// SessionAffinityEnabled: pulumi.Bool(true), +// RestoreTrafficTimeToHealedOrNewEndpointInMinutes: pulumi.Int(10), +// HealthProbe: &cdn.FrontdoorOriginGroupHealthProbeArgs{ +// IntervalInSeconds: pulumi.Int(240), +// Path: pulumi.String("/healthProbe"), +// Protocol: pulumi.String("Https"), +// RequestType: pulumi.String("HEAD"), +// }, +// LoadBalancing: &cdn.FrontdoorOriginGroupLoadBalancingArgs{ +// AdditionalLatencyInMilliseconds: pulumi.Int(0), +// SampleSize: pulumi.Int(16), +// SuccessfulSamplesRequired: pulumi.Int(3), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Door Origin Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorProfile.go b/sdk/go/azure/cdn/frontdoorProfile.go index d6b5f3c812..c84773f40b 100644 --- a/sdk/go/azure/cdn/frontdoorProfile.go +++ b/sdk/go/azure/cdn/frontdoorProfile.go @@ -15,6 +15,43 @@ import ( // Manages a Front Door (standard/premium) Profile which contains a collection of endpoints and origin groups. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewFrontdoorProfile(ctx, "exampleFrontdoorProfile", &cdn.FrontdoorProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard_AzureFrontDoor"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Door Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorRouteDisableLinkToDefaultDomain.go b/sdk/go/azure/cdn/frontdoorRouteDisableLinkToDefaultDomain.go index fb81ca75ed..fe01520ab2 100644 --- a/sdk/go/azure/cdn/frontdoorRouteDisableLinkToDefaultDomain.go +++ b/sdk/go/azure/cdn/frontdoorRouteDisableLinkToDefaultDomain.go @@ -17,6 +17,36 @@ import ( // // !>**IMPORTANT:** This resource has been deprecated and should not be used for new deployments. The `cdn.FrontdoorRouteDisableLinkToDefaultDomain` resource will be removed from the 4.0 AzureRM provider. Please use the `linkToDefaultDomain` field in the `cdn.FrontdoorRoute` resource to control this value. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.NewFrontdoorRouteDisableLinkToDefaultDomain(ctx, "example", &cdn.FrontdoorRouteDisableLinkToDefaultDomainArgs{ +// CdnFrontdoorRouteId: pulumi.Any(azurerm_cdn_frontdoor_route.Example.Id), +// CdnFrontdoorCustomDomainIds: pulumi.StringArray{ +// azurerm_cdn_frontdoor_custom_domain.Contoso.Id, +// azurerm_cdn_frontdoor_custom_domain.Fabrikam.Id, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // FrontDoor Route Disable Link To Default Domain can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorRuleSet.go b/sdk/go/azure/cdn/frontdoorRuleSet.go index 4cbe6a26e1..04b699bf52 100644 --- a/sdk/go/azure/cdn/frontdoorRuleSet.go +++ b/sdk/go/azure/cdn/frontdoorRuleSet.go @@ -15,6 +15,46 @@ import ( // Manages a Front Door (standard/premium) Rule Set. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFrontdoorProfile, err := cdn.NewFrontdoorProfile(ctx, "exampleFrontdoorProfile", &cdn.FrontdoorProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard_AzureFrontDoor"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewFrontdoorRuleSet(ctx, "exampleFrontdoorRuleSet", &cdn.FrontdoorRuleSetArgs{ +// CdnFrontdoorProfileId: exampleFrontdoorProfile.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Door Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/frontdoorSecret.go b/sdk/go/azure/cdn/frontdoorSecret.go index 5992f0e063..4cd9def96d 100644 --- a/sdk/go/azure/cdn/frontdoorSecret.go +++ b/sdk/go/azure/cdn/frontdoorSecret.go @@ -15,6 +15,124 @@ import ( // Manages a Front Door (standard/premium) Secret. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// frontdoor, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("Microsoft.Azure.Cdn"), +// }, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// NetworkAcls: &keyvault.KeyVaultNetworkAclsArgs{ +// DefaultAction: pulumi.String("Deny"), +// Bypass: pulumi.String("AzureServices"), +// IpRules: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// }, +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(frontdoor.ObjectId), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Import"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Certificate: &keyvault.CertificateCertificateArgs{ +// Contents: filebase64OrPanic("my-certificate.pfx"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleFrontdoorProfile, err := cdn.NewFrontdoorProfile(ctx, "exampleFrontdoorProfile", &cdn.FrontdoorProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard_AzureFrontDoor"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewFrontdoorSecret(ctx, "exampleFrontdoorSecret", &cdn.FrontdoorSecretArgs{ +// CdnFrontdoorProfileId: exampleFrontdoorProfile.ID(), +// Secret: &cdn.FrontdoorSecretSecretArgs{ +// CustomerCertificates: cdn.FrontdoorSecretSecretCustomerCertificateArray{ +// &cdn.FrontdoorSecretSecretCustomerCertificateArgs{ +// KeyVaultCertificateId: exampleCertificate.ID(), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Door Secrets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cdn/getFrontdoorCustomDomain.go b/sdk/go/azure/cdn/getFrontdoorCustomDomain.go index b562a5aa32..a9d357dc5b 100644 --- a/sdk/go/azure/cdn/getFrontdoorCustomDomain.go +++ b/sdk/go/azure/cdn/getFrontdoorCustomDomain.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Front Door (standard/premium) Custom Domain. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.LookupFrontdoorCustomDomain(ctx, &cdn.LookupFrontdoorCustomDomainArgs{ +// Name: azurerm_cdn_frontdoor_custom_domain.Example.Name, +// ProfileName: azurerm_cdn_frontdoor_profile.Example.Name, +// ResourceGroupName: azurerm_cdn_frontdoor_profile.Example.Resource_group_name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFrontdoorCustomDomain(ctx *pulumi.Context, args *LookupFrontdoorCustomDomainArgs, opts ...pulumi.InvokeOption) (*LookupFrontdoorCustomDomainResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFrontdoorCustomDomainResult diff --git a/sdk/go/azure/cdn/getFrontdoorEndpoint.go b/sdk/go/azure/cdn/getFrontdoorEndpoint.go index 21f43bcd99..f8e6d12f29 100644 --- a/sdk/go/azure/cdn/getFrontdoorEndpoint.go +++ b/sdk/go/azure/cdn/getFrontdoorEndpoint.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Front Door (standard/premium) Endpoint. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.LookupFrontdoorEndpoint(ctx, &cdn.LookupFrontdoorEndpointArgs{ +// Name: "existing-endpoint", +// ProfileName: "existing-cdn-profile", +// ResourceGroupName: "existing-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFrontdoorEndpoint(ctx *pulumi.Context, args *LookupFrontdoorEndpointArgs, opts ...pulumi.InvokeOption) (*LookupFrontdoorEndpointResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFrontdoorEndpointResult diff --git a/sdk/go/azure/cdn/getFrontdoorFirewallPolicy.go b/sdk/go/azure/cdn/getFrontdoorFirewallPolicy.go index 2fa9f8ee5f..5bc2ec0fcd 100644 --- a/sdk/go/azure/cdn/getFrontdoorFirewallPolicy.go +++ b/sdk/go/azure/cdn/getFrontdoorFirewallPolicy.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.LookupFrontdoorFirewallPolicy(ctx, &cdn.LookupFrontdoorFirewallPolicyArgs{ +// Name: "examplecdnfdwafpolicy", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFrontdoorFirewallPolicy(ctx *pulumi.Context, args *LookupFrontdoorFirewallPolicyArgs, opts ...pulumi.InvokeOption) (*LookupFrontdoorFirewallPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFrontdoorFirewallPolicyResult diff --git a/sdk/go/azure/cdn/getFrontdoorOriginGroup.go b/sdk/go/azure/cdn/getFrontdoorOriginGroup.go index 9a97811624..d92466fd0f 100644 --- a/sdk/go/azure/cdn/getFrontdoorOriginGroup.go +++ b/sdk/go/azure/cdn/getFrontdoorOriginGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Front Door (standard/premium) Origin Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.LookupFrontdoorOriginGroup(ctx, &cdn.LookupFrontdoorOriginGroupArgs{ +// Name: "example-origin-group", +// ProfileName: "example-profile", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFrontdoorOriginGroup(ctx *pulumi.Context, args *LookupFrontdoorOriginGroupArgs, opts ...pulumi.InvokeOption) (*LookupFrontdoorOriginGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFrontdoorOriginGroupResult diff --git a/sdk/go/azure/cdn/getFrontdoorProfile.go b/sdk/go/azure/cdn/getFrontdoorProfile.go index 634675713b..e417ca4283 100644 --- a/sdk/go/azure/cdn/getFrontdoorProfile.go +++ b/sdk/go/azure/cdn/getFrontdoorProfile.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Front Door (standard/premium) Profile. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.LookupFrontdoorProfile(ctx, &cdn.LookupFrontdoorProfileArgs{ +// Name: "existing-cdn-profile", +// ResourceGroupName: "existing-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFrontdoorProfile(ctx *pulumi.Context, args *LookupFrontdoorProfileArgs, opts ...pulumi.InvokeOption) (*LookupFrontdoorProfileResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFrontdoorProfileResult diff --git a/sdk/go/azure/cdn/getFrontdoorRuleSet.go b/sdk/go/azure/cdn/getFrontdoorRuleSet.go index db22fdfdf6..23303c80e7 100644 --- a/sdk/go/azure/cdn/getFrontdoorRuleSet.go +++ b/sdk/go/azure/cdn/getFrontdoorRuleSet.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Front Door (standard/premium) Rule Set. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.LookupFrontdoorRuleSet(ctx, &cdn.LookupFrontdoorRuleSetArgs{ +// Name: "existing-rule-set", +// ProfileName: "existing-profile", +// ResourceGroupName: "existing-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFrontdoorRuleSet(ctx *pulumi.Context, args *LookupFrontdoorRuleSetArgs, opts ...pulumi.InvokeOption) (*LookupFrontdoorRuleSetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFrontdoorRuleSetResult diff --git a/sdk/go/azure/cdn/getFrontdoorSecret.go b/sdk/go/azure/cdn/getFrontdoorSecret.go index 3ff046eb77..26e3ef90d3 100644 --- a/sdk/go/azure/cdn/getFrontdoorSecret.go +++ b/sdk/go/azure/cdn/getFrontdoorSecret.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Front Door (standard/premium) Secret. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cdn.LookupFrontdoorSecret(ctx, &cdn.LookupFrontdoorSecretArgs{ +// Name: "example-secret", +// ProfileName: "example-profile", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFrontdoorSecret(ctx *pulumi.Context, args *LookupFrontdoorSecretArgs, opts ...pulumi.InvokeOption) (*LookupFrontdoorSecretResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFrontdoorSecretResult diff --git a/sdk/go/azure/cdn/getProfile.go b/sdk/go/azure/cdn/getProfile.go index 21ade5e5e7..b3fe78a3e7 100644 --- a/sdk/go/azure/cdn/getProfile.go +++ b/sdk/go/azure/cdn/getProfile.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing CDN Profile. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := cdn.LookupProfile(ctx, &cdn.LookupProfileArgs{ +// Name: "myfirstcdnprofile", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("cdnProfileId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupProfile(ctx *pulumi.Context, args *LookupProfileArgs, opts ...pulumi.InvokeOption) (*LookupProfileResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupProfileResult diff --git a/sdk/go/azure/cdn/profile.go b/sdk/go/azure/cdn/profile.go index 541524125b..6afcbe0f29 100644 --- a/sdk/go/azure/cdn/profile.go +++ b/sdk/go/azure/cdn/profile.go @@ -13,6 +13,45 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cdn" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = cdn.NewProfile(ctx, "exampleProfile", &cdn.ProfileArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard_Verizon"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// "cost_center": pulumi.String("MSFT"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CDN Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cognitive/account.go b/sdk/go/azure/cognitive/account.go index 674222360a..e98ce0a4d5 100644 --- a/sdk/go/azure/cognitive/account.go +++ b/sdk/go/azure/cognitive/account.go @@ -17,6 +17,45 @@ import ( // // > **Note:** Version v2.65.0 of the Azure Provider and later will attempt to Purge the Cognitive Account during deletion. This feature can be disabled using the `features` block within the `provider` block, see the provider documentation on the features block for more information. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = cognitive.NewAccount(ctx, "exampleAccount", &cognitive.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.String("Face"), +// SkuName: pulumi.String("S0"), +// Tags: pulumi.StringMap{ +// "Acceptance": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cognitive Service Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cognitive/accountCustomerManagedKey.go b/sdk/go/azure/cognitive/accountCustomerManagedKey.go index af07859fe0..a3dc23e0a4 100644 --- a/sdk/go/azure/cognitive/accountCustomerManagedKey.go +++ b/sdk/go/azure/cognitive/accountCustomerManagedKey.go @@ -17,6 +17,168 @@ import ( // // > **NOTE:** It's possible to define a Customer Managed Key both within the `cognitive.Account` resource via the `customerManagedKey` block and by using the `cognitive.AccountCustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Cognitive Account, since there'll be conflicts. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cognitive.NewAccount(ctx, "exampleAccount", &cognitive.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.String("Face"), +// SkuName: pulumi.String("E0"), +// CustomSubdomainName: pulumi.String("example-account"), +// Identity: &cognitive.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned, UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: exampleAccount.Identity.ApplyT(func(identity cognitive.AccountIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleAccount.Identity.ApplyT(func(identity cognitive.AccountIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("List"), +// pulumi.String("Restore"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// pulumi.String("Purge"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("Verify"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("List"), +// pulumi.String("Restore"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// pulumi.String("Purge"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("Verify"), +// pulumi.String("GetRotationPolicy"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: exampleUserAssignedIdentity.TenantId, +// ObjectId: exampleUserAssignedIdentity.PrincipalId, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("List"), +// pulumi.String("Restore"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// pulumi.String("Purge"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("Verify"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = cognitive.NewAccountCustomerManagedKey(ctx, "exampleAccountCustomerManagedKey", &cognitive.AccountCustomerManagedKeyArgs{ +// CognitiveAccountId: exampleAccount.ID(), +// KeyVaultKeyId: exampleKey.ID(), +// IdentityClientId: exampleUserAssignedIdentity.ClientId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Customer Managed Keys for a Cognitive Account can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cognitive/deployment.go b/sdk/go/azure/cognitive/deployment.go index 7ede72b703..29aa82cce7 100644 --- a/sdk/go/azure/cognitive/deployment.go +++ b/sdk/go/azure/cognitive/deployment.go @@ -15,6 +15,56 @@ import ( // Manages a Cognitive Services Account Deployment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cognitive.NewAccount(ctx, "exampleAccount", &cognitive.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.String("OpenAI"), +// SkuName: pulumi.String("S0"), +// }) +// if err != nil { +// return err +// } +// _, err = cognitive.NewDeployment(ctx, "exampleDeployment", &cognitive.DeploymentArgs{ +// CognitiveAccountId: exampleAccount.ID(), +// Model: &cognitive.DeploymentModelArgs{ +// Format: pulumi.String("OpenAI"), +// Name: pulumi.String("text-curie-001"), +// Version: pulumi.String("1"), +// }, +// Scale: &cognitive.DeploymentScaleArgs{ +// Type: pulumi.String("Standard"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cognitive Services Account Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cognitive/getAccount.go b/sdk/go/azure/cognitive/getAccount.go index e8151adeae..3eb0ba1368 100644 --- a/sdk/go/azure/cognitive/getAccount.go +++ b/sdk/go/azure/cognitive/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Cognitive Services Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// test, err := cognitive.LookupAccount(ctx, &cognitive.LookupAccountArgs{ +// Name: "example-account", +// ResourceGroupName: "cognitive_account_rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("primaryAccessKey", test.PrimaryAccessKey) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/communication/emailService.go b/sdk/go/azure/communication/emailService.go index 3fe035f520..93a7046cb4 100644 --- a/sdk/go/azure/communication/emailService.go +++ b/sdk/go/azure/communication/emailService.go @@ -15,6 +15,40 @@ import ( // Manages an Email Communication Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/communication" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = communication.NewEmailService(ctx, "exampleEmailService", &communication.EmailServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// DataLocation: pulumi.String("United States"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/communication/getService.go b/sdk/go/azure/communication/getService.go index 4472e6e664..69a38087b8 100644 --- a/sdk/go/azure/communication/getService.go +++ b/sdk/go/azure/communication/getService.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Communication Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/communication" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := communication.LookupService(ctx, &communication.LookupServiceArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/communication/service.go b/sdk/go/azure/communication/service.go index f9ecd2d02c..ff9b59a18b 100644 --- a/sdk/go/azure/communication/service.go +++ b/sdk/go/azure/communication/service.go @@ -15,6 +15,40 @@ import ( // Manages a Communication Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/communication" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = communication.NewService(ctx, "exampleService", &communication.ServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// DataLocation: pulumi.String("United States"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/availabilitySet.go b/sdk/go/azure/compute/availabilitySet.go index c1924a1d5b..667deb8a75 100644 --- a/sdk/go/azure/compute/availabilitySet.go +++ b/sdk/go/azure/compute/availabilitySet.go @@ -15,6 +15,43 @@ import ( // Manages an Availability Set for Virtual Machines. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewAvailabilitySet(ctx, "exampleAvailabilitySet", &compute.AvailabilitySetArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Availability Sets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/bastionHost.go b/sdk/go/azure/compute/bastionHost.go index a78fbf2ef8..a8bb7197eb 100644 --- a/sdk/go/azure/compute/bastionHost.go +++ b/sdk/go/azure/compute/bastionHost.go @@ -15,6 +15,77 @@ import ( // Manages a Bastion Host. // +// ## Example Usage +// +// This example deploys an Azure Bastion Host Instance to a target virtual network. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.1.224/27"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewBastionHost(ctx, "exampleBastionHost", &compute.BastionHostArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfiguration: &compute.BastionHostIpConfigurationArgs{ +// Name: pulumi.String("configuration"), +// SubnetId: exampleSubnet.ID(), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Bastion Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/capacityReservation.go b/sdk/go/azure/compute/capacityReservation.go index 966d66ad79..0c6263beb8 100644 --- a/sdk/go/azure/compute/capacityReservation.go +++ b/sdk/go/azure/compute/capacityReservation.go @@ -15,6 +15,50 @@ import ( // Manages a Capacity Reservation within a Capacity Reservation Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCapacityReservationGroup, err := compute.NewCapacityReservationGroup(ctx, "exampleCapacityReservationGroup", &compute.CapacityReservationGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewCapacityReservation(ctx, "exampleCapacityReservation", &compute.CapacityReservationArgs{ +// CapacityReservationGroupId: exampleCapacityReservationGroup.ID(), +// Sku: &compute.CapacityReservationSkuArgs{ +// Name: pulumi.String("Standard_D2s_v3"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Capacity Reservations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/capacityReservationGroup.go b/sdk/go/azure/compute/capacityReservationGroup.go index b0b611b705..d5dbe7c4a6 100644 --- a/sdk/go/azure/compute/capacityReservationGroup.go +++ b/sdk/go/azure/compute/capacityReservationGroup.go @@ -15,6 +15,40 @@ import ( // Manages a Capacity Reservation Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewCapacityReservationGroup(ctx, "exampleCapacityReservationGroup", &compute.CapacityReservationGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Capacity Reservation Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/dataDiskAttachment.go b/sdk/go/azure/compute/dataDiskAttachment.go index 676de38c0b..5c4e7b80ab 100644 --- a/sdk/go/azure/compute/dataDiskAttachment.go +++ b/sdk/go/azure/compute/dataDiskAttachment.go @@ -19,6 +19,127 @@ import ( // // > **Please Note:** only Managed Disks are supported via this separate resource, Unmanaged Disks can be attached using the `storageDataDisk` block in the `compute.VirtualMachine` resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// cfg := config.New(ctx, "") +// prefix := "example" +// if param := cfg.Get("prefix"); param != "" { +// prefix = param +// } +// vmName := fmt.Sprintf("%v-vm", prefix) +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// mainVirtualNetwork, err := network.NewVirtualNetwork(ctx, "mainVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: mainVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// mainNetworkInterface, err := network.NewNetworkInterface(ctx, "mainNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// SubnetId: internal.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualMachine, err := compute.NewVirtualMachine(ctx, "exampleVirtualMachine", &compute.VirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkInterfaceIds: pulumi.StringArray{ +// mainNetworkInterface.ID(), +// }, +// VmSize: pulumi.String("Standard_F2"), +// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{ +// Name: pulumi.String("myosdisk1"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Standard_LRS"), +// }, +// OsProfile: &compute.VirtualMachineOsProfileArgs{ +// ComputerName: pulumi.String(vmName), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// }, +// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(false), +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "exampleManagedDisk", &compute.ManagedDiskArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccountType: pulumi.String("Standard_LRS"), +// CreateOption: pulumi.String("Empty"), +// DiskSizeGb: pulumi.Int(10), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewDataDiskAttachment(ctx, "exampleDataDiskAttachment", &compute.DataDiskAttachmentArgs{ +// ManagedDiskId: exampleManagedDisk.ID(), +// VirtualMachineId: exampleVirtualMachine.ID(), +// Lun: pulumi.Int(10), +// Caching: pulumi.String("ReadWrite"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Machines Data Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/dedicatedHost.go b/sdk/go/azure/compute/dedicatedHost.go index 23773fcd4c..50b89c482a 100644 --- a/sdk/go/azure/compute/dedicatedHost.go +++ b/sdk/go/azure/compute/dedicatedHost.go @@ -15,6 +15,50 @@ import ( // Manage a Dedicated Host within a Dedicated Host Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleDedicatedHostGroup, err := compute.NewDedicatedHostGroup(ctx, "exampleDedicatedHostGroup", &compute.DedicatedHostGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PlatformFaultDomainCount: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewDedicatedHost(ctx, "exampleDedicatedHost", &compute.DedicatedHostArgs{ +// Location: exampleResourceGroup.Location, +// DedicatedHostGroupId: exampleDedicatedHostGroup.ID(), +// SkuName: pulumi.String("DSv3-Type1"), +// PlatformFaultDomain: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dedicated Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/dedicatedHostGroup.go b/sdk/go/azure/compute/dedicatedHostGroup.go index 5fd713320e..f45eddf557 100644 --- a/sdk/go/azure/compute/dedicatedHostGroup.go +++ b/sdk/go/azure/compute/dedicatedHostGroup.go @@ -15,6 +15,41 @@ import ( // Manage a Dedicated Host Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewDedicatedHostGroup(ctx, "exampleDedicatedHostGroup", &compute.DedicatedHostGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PlatformFaultDomainCount: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dedicated Host Group can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/diskAccess.go b/sdk/go/azure/compute/diskAccess.go index f41d9f8fc4..2489173854 100644 --- a/sdk/go/azure/compute/diskAccess.go +++ b/sdk/go/azure/compute/diskAccess.go @@ -15,6 +15,33 @@ import ( // Manages a Disk Access. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.NewDiskAccess(ctx, "example", &compute.DiskAccessArgs{ +// Location: pulumi.String("West Europe"), +// ResourceGroupName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Disk Access resource can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/diskEncryptionSet.go b/sdk/go/azure/compute/diskEncryptionSet.go index 800660823b..abbbad2ccd 100644 --- a/sdk/go/azure/compute/diskEncryptionSet.go +++ b/sdk/go/azure/compute/diskEncryptionSet.go @@ -17,6 +17,258 @@ import ( // // > **NOTE:** At this time the Key Vault used to store the Active Key for this Disk Encryption Set must have both Soft Delete & Purge Protection enabled - which are not yet supported by this provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// EnabledForDiskEncryption: pulumi.Bool(true), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-user", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Update"), +// pulumi.String("List"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// example_user, +// })) +// if err != nil { +// return err +// } +// exampleDiskEncryptionSet, err := compute.NewDiskEncryptionSet(ctx, "exampleDiskEncryptionSet", &compute.DiskEncryptionSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// KeyVaultKeyId: exampleKey.ID(), +// Identity: &compute.DiskEncryptionSetIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-diskAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Update"), +// pulumi.String("List"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example-diskAssignment", &authorization.AssignmentArgs{ +// Scope: exampleKeyVault.ID(), +// RoleDefinitionName: pulumi.String("Key Vault Crypto Service Encryption User"), +// PrincipalId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Automatic Key Rotation Enabled +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// EnabledForDiskEncryption: pulumi.Bool(true), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-user", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Update"), +// pulumi.String("List"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// example_user, +// })) +// if err != nil { +// return err +// } +// exampleDiskEncryptionSet, err := compute.NewDiskEncryptionSet(ctx, "exampleDiskEncryptionSet", &compute.DiskEncryptionSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// KeyVaultKeyId: exampleKey.VersionlessId, +// AutoKeyRotationEnabled: pulumi.Bool(true), +// Identity: &compute.DiskEncryptionSetIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-diskAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Update"), +// pulumi.String("List"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example-diskAssignment", &authorization.AssignmentArgs{ +// Scope: exampleKeyVault.ID(), +// RoleDefinitionName: pulumi.String("Key Vault Crypto Service Encryption User"), +// PrincipalId: exampleDiskEncryptionSet.Identity.ApplyT(func(identity compute.DiskEncryptionSetIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Disk Encryption Sets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/diskPool.go b/sdk/go/azure/compute/diskPool.go index 11199accd6..2a13fba599 100644 --- a/sdk/go/azure/compute/diskPool.go +++ b/sdk/go/azure/compute/diskPool.go @@ -17,6 +17,77 @@ import ( // // !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleVirtualNetwork.ResourceGroupName, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("diskspool"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/read"), +// }, +// Name: pulumi.String("Microsoft.StoragePool/diskPools"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewDiskPool(ctx, "exampleDiskPool", &compute.DiskPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("Basic_B1"), +// SubnetId: exampleSubnet.ID(), +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Disk Pools can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/diskPoolIscsiTarget.go b/sdk/go/azure/compute/diskPoolIscsiTarget.go index d321a3d276..7151e446fd 100644 --- a/sdk/go/azure/compute/diskPoolIscsiTarget.go +++ b/sdk/go/azure/compute/diskPoolIscsiTarget.go @@ -19,6 +19,134 @@ import ( // // !> **Note:** Each Disk Pool can have a maximum of 1 iSCSI Target. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("diskspool"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/read"), +// }, +// Name: pulumi.String("Microsoft.StoragePool/diskPools"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleDiskPool, err := compute.NewDiskPool(ctx, "exampleDiskPool", &compute.DiskPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubnetId: exampleSubnet.ID(), +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// SkuName: pulumi.String("Basic_B1"), +// }) +// if err != nil { +// return err +// } +// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "exampleManagedDisk", &compute.ManagedDiskArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CreateOption: pulumi.String("Empty"), +// StorageAccountType: pulumi.String("Premium_LRS"), +// DiskSizeGb: pulumi.Int(4), +// MaxShares: pulumi.Int(2), +// Zone: pulumi.String("1"), +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("StoragePool Resource Provider"), +// }, nil) +// if err != nil { +// return err +// } +// roles := []string{ +// "Disk Pool Operator", +// "Virtual Machine Contributor", +// } +// var exampleAssignment []*authorization.Assignment +// for index := 0; index < len(roles); index++ { +// key0 := index +// val0 := index +// __res, err := authorization.NewAssignment(ctx, fmt.Sprintf("exampleAssignment-%v", key0), &authorization.AssignmentArgs{ +// PrincipalId: *pulumi.String(exampleServicePrincipal.Id), +// RoleDefinitionName: roles[val0], +// Scope: exampleManagedDisk.ID(), +// }) +// if err != nil { +// return err +// } +// exampleAssignment = append(exampleAssignment, __res) +// } +// exampleDiskPoolManagedDiskAttachment, err := compute.NewDiskPoolManagedDiskAttachment(ctx, "exampleDiskPoolManagedDiskAttachment", &compute.DiskPoolManagedDiskAttachmentArgs{ +// DiskPoolId: exampleDiskPool.ID(), +// ManagedDiskId: exampleManagedDisk.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// _, err = compute.NewDiskPoolIscsiTarget(ctx, "exampleDiskPoolIscsiTarget", &compute.DiskPoolIscsiTargetArgs{ +// AclMode: pulumi.String("Dynamic"), +// DisksPoolId: exampleDiskPool.ID(), +// TargetIqn: pulumi.String("iqn.2021-11.com.microsoft:test"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleDiskPoolManagedDiskAttachment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // iSCSI Targets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/diskPoolIscsiTargetLun.go b/sdk/go/azure/compute/diskPoolIscsiTargetLun.go index 503b8c64a8..4af62801a7 100644 --- a/sdk/go/azure/compute/diskPoolIscsiTargetLun.go +++ b/sdk/go/azure/compute/diskPoolIscsiTargetLun.go @@ -17,6 +17,141 @@ import ( // // !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("diskspool"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/read"), +// }, +// Name: pulumi.String("Microsoft.StoragePool/diskPools"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleDiskPool, err := compute.NewDiskPool(ctx, "exampleDiskPool", &compute.DiskPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubnetId: exampleSubnet.ID(), +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// SkuName: pulumi.String("Basic_B1"), +// }) +// if err != nil { +// return err +// } +// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "exampleManagedDisk", &compute.ManagedDiskArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CreateOption: pulumi.String("Empty"), +// StorageAccountType: pulumi.String("Premium_LRS"), +// DiskSizeGb: pulumi.Int(4), +// MaxShares: pulumi.Int(2), +// Zone: pulumi.String("1"), +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("StoragePool Resource Provider"), +// }, nil) +// if err != nil { +// return err +// } +// roles := []string{ +// "Disk Pool Operator", +// "Virtual Machine Contributor", +// } +// var exampleAssignment []*authorization.Assignment +// for index := 0; index < len(roles); index++ { +// key0 := index +// val0 := index +// __res, err := authorization.NewAssignment(ctx, fmt.Sprintf("exampleAssignment-%v", key0), &authorization.AssignmentArgs{ +// PrincipalId: *pulumi.String(exampleServicePrincipal.Id), +// RoleDefinitionName: roles[val0], +// Scope: exampleManagedDisk.ID(), +// }) +// if err != nil { +// return err +// } +// exampleAssignment = append(exampleAssignment, __res) +// } +// exampleDiskPoolManagedDiskAttachment, err := compute.NewDiskPoolManagedDiskAttachment(ctx, "exampleDiskPoolManagedDiskAttachment", &compute.DiskPoolManagedDiskAttachmentArgs{ +// DiskPoolId: exampleDiskPool.ID(), +// ManagedDiskId: exampleManagedDisk.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// exampleDiskPoolIscsiTarget, err := compute.NewDiskPoolIscsiTarget(ctx, "exampleDiskPoolIscsiTarget", &compute.DiskPoolIscsiTargetArgs{ +// AclMode: pulumi.String("Dynamic"), +// DisksPoolId: exampleDiskPool.ID(), +// TargetIqn: pulumi.String("iqn.2021-11.com.microsoft:test"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleDiskPoolManagedDiskAttachment, +// })) +// if err != nil { +// return err +// } +// _, err = compute.NewDiskPoolIscsiTargetLun(ctx, "exampleDiskPoolIscsiTargetLun", &compute.DiskPoolIscsiTargetLunArgs{ +// IscsiTargetId: exampleDiskPoolIscsiTarget.ID(), +// DiskPoolManagedDiskAttachmentId: exampleDiskPoolManagedDiskAttachment.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // iSCSI Target Luns can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/diskPoolManagedDiskAttachment.go b/sdk/go/azure/compute/diskPoolManagedDiskAttachment.go index 5b87a1d10e..9f33d9e476 100644 --- a/sdk/go/azure/compute/diskPoolManagedDiskAttachment.go +++ b/sdk/go/azure/compute/diskPoolManagedDiskAttachment.go @@ -25,6 +25,124 @@ import ( // // > **Note:** You must provide the StoragePool resource provider RBAC permissions to the disks that will be added to the disk pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("diskspool"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/read"), +// }, +// Name: pulumi.String("Microsoft.StoragePool/diskPools"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleDiskPool, err := compute.NewDiskPool(ctx, "exampleDiskPool", &compute.DiskPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubnetId: exampleSubnet.ID(), +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// SkuName: pulumi.String("Basic_B1"), +// }) +// if err != nil { +// return err +// } +// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "exampleManagedDisk", &compute.ManagedDiskArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CreateOption: pulumi.String("Empty"), +// StorageAccountType: pulumi.String("Premium_LRS"), +// DiskSizeGb: pulumi.Int(4), +// MaxShares: pulumi.Int(2), +// Zone: pulumi.String("1"), +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("StoragePool Resource Provider"), +// }, nil) +// if err != nil { +// return err +// } +// roles := []string{ +// "Disk Pool Operator", +// "Virtual Machine Contributor", +// } +// var exampleAssignment []*authorization.Assignment +// for index := 0; index < len(roles); index++ { +// key0 := index +// val0 := index +// __res, err := authorization.NewAssignment(ctx, fmt.Sprintf("exampleAssignment-%v", key0), &authorization.AssignmentArgs{ +// PrincipalId: *pulumi.String(exampleServicePrincipal.Id), +// RoleDefinitionName: roles[val0], +// Scope: exampleManagedDisk.ID(), +// }) +// if err != nil { +// return err +// } +// exampleAssignment = append(exampleAssignment, __res) +// } +// _, err = compute.NewDiskPoolManagedDiskAttachment(ctx, "exampleDiskPoolManagedDiskAttachment", &compute.DiskPoolManagedDiskAttachmentArgs{ +// DiskPoolId: exampleDiskPool.ID(), +// ManagedDiskId: exampleManagedDisk.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Disks Pool Managed Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/extension.go b/sdk/go/azure/compute/extension.go index b3013ac76c..bab9a8cf3b 100644 --- a/sdk/go/azure/compute/extension.go +++ b/sdk/go/azure/compute/extension.go @@ -20,6 +20,119 @@ import ( // // > **NOTE:** Custom Script Extensions require that the Azure Virtual Machine Guest Agent is running on the Virtual Machine. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_F2"), +// AdminUsername: pulumi.String("adminuser"), +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// AdminSshKeys: compute.LinuxVirtualMachineAdminSshKeyArray{ +// &compute.LinuxVirtualMachineAdminSshKeyArgs{ +// Username: pulumi.String("adminuser"), +// PublicKey: readFileOrPanic("~/.ssh/id_rsa.pub"), +// }, +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewExtension(ctx, "exampleExtension", &compute.ExtensionArgs{ +// VirtualMachineId: exampleLinuxVirtualMachine.ID(), +// Publisher: pulumi.String("Microsoft.Azure.Extensions"), +// Type: pulumi.String("CustomScript"), +// TypeHandlerVersion: pulumi.String("2.0"), +// Settings: pulumi.String(" {\n \"commandToExecute\": \"hostname && uptime\"\n }\n"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Machine Extensions can be imported using the `resource id`, e.g. @@ -63,6 +176,20 @@ type Extension struct { // The type of extension, available types for a publisher can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` Type pulumi.StringOutput `pulumi:"type"` // Specifies the version of the extension to use, available versions can be found using the Azure CLI. TypeHandlerVersion pulumi.StringOutput `pulumi:"typeHandlerVersion"` @@ -150,6 +277,20 @@ type extensionState struct { // The type of extension, available types for a publisher can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` Type *string `pulumi:"type"` // Specifies the version of the extension to use, available versions can be found using the Azure CLI. TypeHandlerVersion *string `pulumi:"typeHandlerVersion"` @@ -189,6 +330,20 @@ type ExtensionState struct { // The type of extension, available types for a publisher can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` Type pulumi.StringPtrInput // Specifies the version of the extension to use, available versions can be found using the Azure CLI. TypeHandlerVersion pulumi.StringPtrInput @@ -232,6 +387,20 @@ type extensionArgs struct { // The type of extension, available types for a publisher can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` Type string `pulumi:"type"` // Specifies the version of the extension to use, available versions can be found using the Azure CLI. TypeHandlerVersion string `pulumi:"typeHandlerVersion"` @@ -272,6 +441,20 @@ type ExtensionArgs struct { // The type of extension, available types for a publisher can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` Type pulumi.StringInput // Specifies the version of the extension to use, available versions can be found using the Azure CLI. TypeHandlerVersion pulumi.StringInput @@ -453,6 +636,23 @@ func (o ExtensionOutput) Tags() pulumi.StringMapOutput { // The type of extension, available types for a publisher can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` func (o ExtensionOutput) Type() pulumi.StringOutput { return o.ApplyT(func(v *Extension) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput) } diff --git a/sdk/go/azure/compute/galleryApplication.go b/sdk/go/azure/compute/galleryApplication.go index adf6d46371..f2d624dc9c 100644 --- a/sdk/go/azure/compute/galleryApplication.go +++ b/sdk/go/azure/compute/galleryApplication.go @@ -15,6 +15,48 @@ import ( // Manages a Gallery Application. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "exampleSharedImageGallery", &compute.SharedImageGalleryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewGalleryApplication(ctx, "exampleGalleryApplication", &compute.GalleryApplicationArgs{ +// GalleryId: exampleSharedImageGallery.ID(), +// Location: exampleResourceGroup.Location, +// SupportedOsType: pulumi.String("Linux"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Gallery Applications can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/galleryApplicationVersion.go b/sdk/go/azure/compute/galleryApplicationVersion.go index 6b86ffd709..03ad8a55e1 100644 --- a/sdk/go/azure/compute/galleryApplicationVersion.go +++ b/sdk/go/azure/compute/galleryApplicationVersion.go @@ -15,6 +15,94 @@ import ( // Manages a Gallery Application Version. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "exampleSharedImageGallery", &compute.SharedImageGalleryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleGalleryApplication, err := compute.NewGalleryApplication(ctx, "exampleGalleryApplication", &compute.GalleryApplicationArgs{ +// GalleryId: exampleSharedImageGallery.ID(), +// Location: exampleResourceGroup.Location, +// SupportedOsType: pulumi.String("Linux"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("blob"), +// }) +// if err != nil { +// return err +// } +// exampleBlob, err := storage.NewBlob(ctx, "exampleBlob", &storage.BlobArgs{ +// StorageAccountName: exampleAccount.Name, +// StorageContainerName: exampleContainer.Name, +// Type: pulumi.String("Block"), +// SourceContent: pulumi.String("[scripts file content]"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewGalleryApplicationVersion(ctx, "exampleGalleryApplicationVersion", &compute.GalleryApplicationVersionArgs{ +// GalleryApplicationId: exampleGalleryApplication.ID(), +// Location: exampleGalleryApplication.Location, +// ManageAction: &compute.GalleryApplicationVersionManageActionArgs{ +// Install: pulumi.String("[install command]"), +// Remove: pulumi.String("[remove command]"), +// }, +// Source: &compute.GalleryApplicationVersionSourceArgs{ +// MediaLink: exampleBlob.ID(), +// }, +// TargetRegions: compute.GalleryApplicationVersionTargetRegionArray{ +// &compute.GalleryApplicationVersionTargetRegionArgs{ +// Name: exampleGalleryApplication.Location, +// RegionalReplicaCount: pulumi.Int(1), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Gallery Application Versions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/getAvailabilitySet.go b/sdk/go/azure/compute/getAvailabilitySet.go index 7903c1843f..502e733636 100644 --- a/sdk/go/azure/compute/getAvailabilitySet.go +++ b/sdk/go/azure/compute/getAvailabilitySet.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Availability Set. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupAvailabilitySet(ctx, &compute.LookupAvailabilitySetArgs{ +// Name: "tf-appsecuritygroup", +// ResourceGroupName: "my-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("availabilitySetId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupAvailabilitySet(ctx *pulumi.Context, args *LookupAvailabilitySetArgs, opts ...pulumi.InvokeOption) (*LookupAvailabilitySetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAvailabilitySetResult diff --git a/sdk/go/azure/compute/getBastionHost.go b/sdk/go/azure/compute/getBastionHost.go index fcbc9e5a13..146b2ca77e 100644 --- a/sdk/go/azure/compute/getBastionHost.go +++ b/sdk/go/azure/compute/getBastionHost.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Bastion Host. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupBastionHost(ctx, &compute.LookupBastionHostArgs{ +// Name: "existing-bastion", +// ResourceGroupName: "existing-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupBastionHost(ctx *pulumi.Context, args *LookupBastionHostArgs, opts ...pulumi.InvokeOption) (*LookupBastionHostResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBastionHostResult diff --git a/sdk/go/azure/compute/getConfidentialLedger.go b/sdk/go/azure/compute/getConfidentialLedger.go index c125bc9c0d..809c36abfb 100644 --- a/sdk/go/azure/compute/getConfidentialLedger.go +++ b/sdk/go/azure/compute/getConfidentialLedger.go @@ -13,6 +13,34 @@ import ( ) // Gets information about an existing Confidential Ledger. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := compute.GetConfidentialLedger(ctx, &compute.GetConfidentialLedgerArgs{ +// Name: "example-ledger", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("ledgerEndpoint", current.LedgerEndpoint) +// return nil +// }) +// } +// +// ``` func GetConfidentialLedger(ctx *pulumi.Context, args *GetConfidentialLedgerArgs, opts ...pulumi.InvokeOption) (*GetConfidentialLedgerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetConfidentialLedgerResult diff --git a/sdk/go/azure/compute/getDedicatedHost.go b/sdk/go/azure/compute/getDedicatedHost.go index c6f60f0acb..6c33967720 100644 --- a/sdk/go/azure/compute/getDedicatedHost.go +++ b/sdk/go/azure/compute/getDedicatedHost.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Dedicated Host. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupDedicatedHost(ctx, &compute.LookupDedicatedHostArgs{ +// Name: "example-host", +// DedicatedHostGroupName: "example-host-group", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("dedicatedHostId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDedicatedHost(ctx *pulumi.Context, args *LookupDedicatedHostArgs, opts ...pulumi.InvokeOption) (*LookupDedicatedHostResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDedicatedHostResult diff --git a/sdk/go/azure/compute/getDedicatedHostGroup.go b/sdk/go/azure/compute/getDedicatedHostGroup.go index f4a8797cb7..8fff60a5d4 100644 --- a/sdk/go/azure/compute/getDedicatedHostGroup.go +++ b/sdk/go/azure/compute/getDedicatedHostGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Dedicated Host Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupDedicatedHostGroup(ctx, &compute.LookupDedicatedHostGroupArgs{ +// Name: "example-dedicated-host-group", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDedicatedHostGroup(ctx *pulumi.Context, args *LookupDedicatedHostGroupArgs, opts ...pulumi.InvokeOption) (*LookupDedicatedHostGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDedicatedHostGroupResult diff --git a/sdk/go/azure/compute/getDiskAccess.go b/sdk/go/azure/compute/getDiskAccess.go index 56c90aa758..981341f4a3 100644 --- a/sdk/go/azure/compute/getDiskAccess.go +++ b/sdk/go/azure/compute/getDiskAccess.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Disk Access. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupDiskAccess(ctx, &compute.LookupDiskAccessArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDiskAccess(ctx *pulumi.Context, args *LookupDiskAccessArgs, opts ...pulumi.InvokeOption) (*LookupDiskAccessResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDiskAccessResult diff --git a/sdk/go/azure/compute/getDiskEncryptionSet.go b/sdk/go/azure/compute/getDiskEncryptionSet.go index 53bdfedcc0..db66882972 100644 --- a/sdk/go/azure/compute/getDiskEncryptionSet.go +++ b/sdk/go/azure/compute/getDiskEncryptionSet.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Disk Encryption Set. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// existing, err := compute.LookupDiskEncryptionSet(ctx, &compute.LookupDiskEncryptionSetArgs{ +// Name: "example-des", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", existing.Id) +// return nil +// }) +// } +// +// ``` func LookupDiskEncryptionSet(ctx *pulumi.Context, args *LookupDiskEncryptionSetArgs, opts ...pulumi.InvokeOption) (*LookupDiskEncryptionSetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDiskEncryptionSetResult diff --git a/sdk/go/azure/compute/getImage.go b/sdk/go/azure/compute/getImage.go index 18475f2f97..4e4e8b9ee0 100644 --- a/sdk/go/azure/compute/getImage.go +++ b/sdk/go/azure/compute/getImage.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Image. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// search, err := compute.LookupImage(ctx, &compute.LookupImageArgs{ +// Name: pulumi.StringRef("search-api"), +// ResourceGroupName: "packerimages", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("imageId", search.Id) +// return nil +// }) +// } +// +// ``` func LookupImage(ctx *pulumi.Context, args *LookupImageArgs, opts ...pulumi.InvokeOption) (*LookupImageResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupImageResult diff --git a/sdk/go/azure/compute/getImages.go b/sdk/go/azure/compute/getImages.go index bfe2dccc54..8b57194d58 100644 --- a/sdk/go/azure/compute/getImages.go +++ b/sdk/go/azure/compute/getImages.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to access information about existing Images within a Resource Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.GetImages(ctx, &compute.GetImagesArgs{ +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetImages(ctx *pulumi.Context, args *GetImagesArgs, opts ...pulumi.InvokeOption) (*GetImagesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetImagesResult diff --git a/sdk/go/azure/compute/getManagedDisk.go b/sdk/go/azure/compute/getManagedDisk.go index f37883e9e2..876c8ab96b 100644 --- a/sdk/go/azure/compute/getManagedDisk.go +++ b/sdk/go/azure/compute/getManagedDisk.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Managed Disk. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// existing, err := compute.LookupManagedDisk(ctx, &compute.LookupManagedDiskArgs{ +// Name: "example-datadisk", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", existing.Id) +// return nil +// }) +// } +// +// ``` func LookupManagedDisk(ctx *pulumi.Context, args *LookupManagedDiskArgs, opts ...pulumi.InvokeOption) (*LookupManagedDiskResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupManagedDiskResult diff --git a/sdk/go/azure/compute/getOrchestratedVirtualMachineScaleSet.go b/sdk/go/azure/compute/getOrchestratedVirtualMachineScaleSet.go index 39ec734873..56d1b480f5 100644 --- a/sdk/go/azure/compute/getOrchestratedVirtualMachineScaleSet.go +++ b/sdk/go/azure/compute/getOrchestratedVirtualMachineScaleSet.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Orchestrated Virtual Machine Scale Set. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupOrchestratedVirtualMachineScaleSet(ctx, &compute.LookupOrchestratedVirtualMachineScaleSetArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupOrchestratedVirtualMachineScaleSet(ctx *pulumi.Context, args *LookupOrchestratedVirtualMachineScaleSetArgs, opts ...pulumi.InvokeOption) (*LookupOrchestratedVirtualMachineScaleSetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupOrchestratedVirtualMachineScaleSetResult diff --git a/sdk/go/azure/compute/getPlatformImage.go b/sdk/go/azure/compute/getPlatformImage.go index 73a30016e0..9b86fb4616 100644 --- a/sdk/go/azure/compute/getPlatformImage.go +++ b/sdk/go/azure/compute/getPlatformImage.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about a Platform Image. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.GetPlatformImage(ctx, &compute.GetPlatformImageArgs{ +// Location: "West Europe", +// Publisher: "Canonical", +// Offer: "0001-com-ubuntu-server-focal", +// Sku: "20_04-lts", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetPlatformImage(ctx *pulumi.Context, args *GetPlatformImageArgs, opts ...pulumi.InvokeOption) (*GetPlatformImageResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPlatformImageResult diff --git a/sdk/go/azure/compute/getSharedImage.go b/sdk/go/azure/compute/getSharedImage.go index bacfacaa3e..ac05f19c37 100644 --- a/sdk/go/azure/compute/getSharedImage.go +++ b/sdk/go/azure/compute/getSharedImage.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Shared Image within a Shared Image Gallery. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.LookupSharedImage(ctx, &compute.LookupSharedImageArgs{ +// GalleryName: "my-image-gallery", +// Name: "my-image", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSharedImage(ctx *pulumi.Context, args *LookupSharedImageArgs, opts ...pulumi.InvokeOption) (*LookupSharedImageResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSharedImageResult diff --git a/sdk/go/azure/compute/getSharedImageGallery.go b/sdk/go/azure/compute/getSharedImageGallery.go index df00806414..429dc871eb 100644 --- a/sdk/go/azure/compute/getSharedImageGallery.go +++ b/sdk/go/azure/compute/getSharedImageGallery.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Shared Image Gallery. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.LookupSharedImageGallery(ctx, &compute.LookupSharedImageGalleryArgs{ +// Name: "my-image-gallery", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSharedImageGallery(ctx *pulumi.Context, args *LookupSharedImageGalleryArgs, opts ...pulumi.InvokeOption) (*LookupSharedImageGalleryResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSharedImageGalleryResult diff --git a/sdk/go/azure/compute/getSharedImageVersion.go b/sdk/go/azure/compute/getSharedImageVersion.go index 913819525a..f00381b69e 100644 --- a/sdk/go/azure/compute/getSharedImageVersion.go +++ b/sdk/go/azure/compute/getSharedImageVersion.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Version of a Shared Image within a Shared Image Gallery. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.LookupSharedImageVersion(ctx, &compute.LookupSharedImageVersionArgs{ +// GalleryName: "my-image-gallery", +// ImageName: "my-image", +// Name: "1.0.0", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSharedImageVersion(ctx *pulumi.Context, args *LookupSharedImageVersionArgs, opts ...pulumi.InvokeOption) (*LookupSharedImageVersionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSharedImageVersionResult diff --git a/sdk/go/azure/compute/getSharedImageVersions.go b/sdk/go/azure/compute/getSharedImageVersions.go index 5c6983804e..b8bc0c7fc9 100644 --- a/sdk/go/azure/compute/getSharedImageVersions.go +++ b/sdk/go/azure/compute/getSharedImageVersions.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about existing Versions of a Shared Image within a Shared Image Gallery. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.GetSharedImageVersions(ctx, &compute.GetSharedImageVersionsArgs{ +// GalleryName: "my-image-gallery", +// ImageName: "my-image", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetSharedImageVersions(ctx *pulumi.Context, args *GetSharedImageVersionsArgs, opts ...pulumi.InvokeOption) (*GetSharedImageVersionsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetSharedImageVersionsResult diff --git a/sdk/go/azure/compute/getSnapshot.go b/sdk/go/azure/compute/getSnapshot.go index dfabe5ff99..698592723c 100644 --- a/sdk/go/azure/compute/getSnapshot.go +++ b/sdk/go/azure/compute/getSnapshot.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Snapshot. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.LookupSnapshot(ctx, &compute.LookupSnapshotArgs{ +// Name: "my-snapshot", +// ResourceGroupName: "my-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSnapshot(ctx *pulumi.Context, args *LookupSnapshotArgs, opts ...pulumi.InvokeOption) (*LookupSnapshotResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSnapshotResult diff --git a/sdk/go/azure/compute/getSshPublicKey.go b/sdk/go/azure/compute/getSshPublicKey.go index 4ab11a8460..c9bb2a856b 100644 --- a/sdk/go/azure/compute/getSshPublicKey.go +++ b/sdk/go/azure/compute/getSshPublicKey.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing SSH Public Key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupSshPublicKey(ctx, &compute.LookupSshPublicKeyArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupSshPublicKey(ctx *pulumi.Context, args *LookupSshPublicKeyArgs, opts ...pulumi.InvokeOption) (*LookupSshPublicKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSshPublicKeyResult diff --git a/sdk/go/azure/compute/getVirtualMachine.go b/sdk/go/azure/compute/getVirtualMachine.go index abcf1dc623..598e6c900c 100644 --- a/sdk/go/azure/compute/getVirtualMachine.go +++ b/sdk/go/azure/compute/getVirtualMachine.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Virtual Machine. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.LookupVirtualMachine(ctx, &compute.LookupVirtualMachineArgs{ +// Name: "production", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("virtualMachineId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVirtualMachine(ctx *pulumi.Context, args *LookupVirtualMachineArgs, opts ...pulumi.InvokeOption) (*LookupVirtualMachineResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualMachineResult diff --git a/sdk/go/azure/compute/getVirtualMachineScaleSet.go b/sdk/go/azure/compute/getVirtualMachineScaleSet.go index 422d32a34f..39f1ef34b3 100644 --- a/sdk/go/azure/compute/getVirtualMachineScaleSet.go +++ b/sdk/go/azure/compute/getVirtualMachineScaleSet.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Virtual Machine Scale Set. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.GetVirtualMachineScaleSet(ctx, &compute.GetVirtualMachineScaleSetArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetVirtualMachineScaleSet(ctx *pulumi.Context, args *GetVirtualMachineScaleSetArgs, opts ...pulumi.InvokeOption) (*GetVirtualMachineScaleSetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetVirtualMachineScaleSetResult diff --git a/sdk/go/azure/compute/linuxVirtualMachine.go b/sdk/go/azure/compute/linuxVirtualMachine.go index 3e689d44e7..56cebca301 100644 --- a/sdk/go/azure/compute/linuxVirtualMachine.go +++ b/sdk/go/azure/compute/linuxVirtualMachine.go @@ -27,6 +27,108 @@ import ( // // > In this release there's a known issue where the `publicIpAddress` and `publicIpAddresses` fields may not be fully populated for Dynamic Public IP's. // +// ## Example Usage +// +// This example provisions a basic Linux Virtual Machine on an internal network. +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_F2"), +// AdminUsername: pulumi.String("adminuser"), +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// AdminSshKeys: compute.LinuxVirtualMachineAdminSshKeyArray{ +// &compute.LinuxVirtualMachineAdminSshKeyArgs{ +// Username: pulumi.String("adminuser"), +// PublicKey: readFileOrPanic("~/.ssh/id_rsa.pub"), +// }, +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/linuxVirtualMachineScaleSet.go b/sdk/go/azure/compute/linuxVirtualMachineScaleSet.go index 64feca5499..710b554ded 100644 --- a/sdk/go/azure/compute/linuxVirtualMachineScaleSet.go +++ b/sdk/go/azure/compute/linuxVirtualMachineScaleSet.go @@ -19,6 +19,96 @@ import ( // // > **NOTE:** This provider will automatically update & reimage the nodes in the Scale Set (if Required) during an Update - this behaviour can be configured using the `features` setting within the Provider block. // +// ## Example Usage +// +// This example provisions a basic Linux Virtual Machine Scale Set on an internal network. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// firstPublicKey := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard_F2"), +// Instances: pulumi.Int(1), +// AdminUsername: pulumi.String("adminuser"), +// AdminSshKeys: compute.LinuxVirtualMachineScaleSetAdminSshKeyArray{ +// &compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs{ +// Username: pulumi.String("adminuser"), +// PublicKey: pulumi.String(firstPublicKey), +// }, +// }, +// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{ +// StorageAccountType: pulumi.String("Standard_LRS"), +// Caching: pulumi.String("ReadWrite"), +// }, +// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("example"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// Primary: pulumi.Bool(true), +// SubnetId: internal.ID(), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Linux Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/managedDisk.go b/sdk/go/azure/compute/managedDisk.go index d889555b1b..af8d1862b0 100644 --- a/sdk/go/azure/compute/managedDisk.go +++ b/sdk/go/azure/compute/managedDisk.go @@ -16,6 +16,98 @@ import ( // Manages a managed disk. // // ## Example Usage +// ### With Create Empty +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewManagedDisk(ctx, "exampleManagedDisk", &compute.ManagedDiskArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccountType: pulumi.String("Standard_LRS"), +// CreateOption: pulumi.String("Empty"), +// DiskSizeGb: pulumi.Int(1), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Create Copy +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// source, err := compute.NewManagedDisk(ctx, "source", &compute.ManagedDiskArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// StorageAccountType: pulumi.String("Standard_LRS"), +// CreateOption: pulumi.String("Empty"), +// DiskSizeGb: pulumi.Int(1), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewManagedDisk(ctx, "copy", &compute.ManagedDiskArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// StorageAccountType: pulumi.String("Standard_LRS"), +// CreateOption: pulumi.String("Copy"), +// SourceResourceId: source.ID(), +// DiskSizeGb: pulumi.Int(1), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/compute/managedDiskSasToken.go b/sdk/go/azure/compute/managedDiskSasToken.go index c550f13ce9..051bbb8ff4 100644 --- a/sdk/go/azure/compute/managedDiskSasToken.go +++ b/sdk/go/azure/compute/managedDiskSasToken.go @@ -21,6 +21,51 @@ import ( // // With the help of this resource, data from the disk can be copied from managed disk to a storage blob or to some other system without the need of azcopy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testResourceGroup, err := core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// testManagedDisk, err := compute.NewManagedDisk(ctx, "testManagedDisk", &compute.ManagedDiskArgs{ +// Location: testResourceGroup.Location, +// ResourceGroupName: testResourceGroup.Name, +// StorageAccountType: pulumi.String("Standard_LRS"), +// CreateOption: pulumi.String("Empty"), +// DiskSizeGb: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewManagedDiskSasToken(ctx, "testManagedDiskSasToken", &compute.ManagedDiskSasTokenArgs{ +// ManagedDiskId: testManagedDisk.ID(), +// DurationInSeconds: pulumi.Int(300), +// AccessLevel: pulumi.String("Read"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Disk SAS Token can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/orchestratedVirtualMachineScaleSet.go b/sdk/go/azure/compute/orchestratedVirtualMachineScaleSet.go index a4cb4c9253..f3dc8d89f4 100644 --- a/sdk/go/azure/compute/orchestratedVirtualMachineScaleSet.go +++ b/sdk/go/azure/compute/orchestratedVirtualMachineScaleSet.go @@ -21,6 +21,44 @@ import ( // // > **NOTE:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewOrchestratedVirtualMachineScaleSet(ctx, "exampleOrchestratedVirtualMachineScaleSet", &compute.OrchestratedVirtualMachineScaleSetArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PlatformFaultDomainCount: pulumi.Int(1), +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An Orchestrated Virtual Machine Scale Set can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/packetCapture.go b/sdk/go/azure/compute/packetCapture.go index b55bbe07e0..6543aea35a 100644 --- a/sdk/go/azure/compute/packetCapture.go +++ b/sdk/go/azure/compute/packetCapture.go @@ -15,6 +15,140 @@ import ( // Configures Network Packet Capturing against a Virtual Machine using a Network Watcher. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkWatcher, err := network.NewNetworkWatcher(ctx, "exampleNetworkWatcher", &network.NetworkWatcherArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualMachine, err := compute.NewVirtualMachine(ctx, "exampleVirtualMachine", &compute.VirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// VmSize: pulumi.String("Standard_F2"), +// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{ +// Name: pulumi.String("osdisk"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Standard_LRS"), +// }, +// OsProfile: &compute.VirtualMachineOsProfileArgs{ +// ComputerName: pulumi.String("pctest-vm"), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// }, +// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(false), +// }, +// }) +// if err != nil { +// return err +// } +// exampleExtension, err := compute.NewExtension(ctx, "exampleExtension", &compute.ExtensionArgs{ +// VirtualMachineId: exampleVirtualMachine.ID(), +// Publisher: pulumi.String("Microsoft.Azure.NetworkWatcher"), +// Type: pulumi.String("NetworkWatcherAgentLinux"), +// TypeHandlerVersion: pulumi.String("1.4"), +// AutoUpgradeMinorVersion: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewPacketCapture(ctx, "examplePacketCapture", &compute.PacketCaptureArgs{ +// NetworkWatcherId: exampleNetworkWatcher.ID(), +// VirtualMachineId: exampleVirtualMachine.ID(), +// StorageLocation: &compute.PacketCaptureStorageLocationArgs{ +// StorageAccountId: exampleAccount.ID(), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleExtension, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `compute.Extension` resource. +// // ## Import // // Virtual Machine Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/pulumiTypes.go b/sdk/go/azure/compute/pulumiTypes.go index 0f9dfc4ab1..ae9331a02d 100644 --- a/sdk/go/azure/compute/pulumiTypes.go +++ b/sdk/go/azure/compute/pulumiTypes.go @@ -15054,6 +15054,48 @@ func (o ScaleSetExtensionArrayOutput) Index(i pulumi.IntInput) ScaleSetExtension type ScaleSetIdentity struct { // Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // example, err := compute.NewScaleSet(ctx, "example", &compute.ScaleSetArgs{ + // ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name), + // Location: pulumi.Any(azurerm_resource_group.Example.Location), + // Sku: &compute.ScaleSetSkuArgs{ + // Name: pulumi.Any(_var.Vm_sku), + // Tier: pulumi.String("Standard"), + // Capacity: pulumi.Any(_var.Instance_count), + // }, + // Identity: &compute.ScaleSetIdentityArgs{ + // Type: pulumi.String("SystemAssigned"), + // }, + // Extensions: compute.ScaleSetExtensionArray{ + // &compute.ScaleSetExtensionArgs{ + // Name: pulumi.String("MSILinuxExtension"), + // Publisher: pulumi.String("Microsoft.ManagedIdentity"), + // Type: pulumi.String("ManagedIdentityExtensionForLinux"), + // TypeHandlerVersion: pulumi.String("1.0"), + // Settings: pulumi.String("{\"port\": 50342}"), + // }, + // }, + // }) + // if err != nil { + // return err + // } + // ctx.Export("principalId", example.Identity.ApplyT(func(identity compute.ScaleSetIdentity) (*string, error) { + // return &identity.PrincipalId, nil + // }).(pulumi.StringPtrOutput)) + // return nil + // }) + // } + // ``` IdentityIds []string `pulumi:"identityIds"` PrincipalId *string `pulumi:"principalId"` // Specifies the identity type to be assigned to the scale set. Allowable values are `SystemAssigned` and `UserAssigned`. For the `SystemAssigned` identity the scale set's Service Principal ID (SPN) can be retrieved after the scale set has been created. See [documentation](https://docs.microsoft.com/azure/active-directory/managed-service-identity/overview) for more information. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. @@ -15073,6 +15115,48 @@ type ScaleSetIdentityInput interface { type ScaleSetIdentityArgs struct { // Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // example, err := compute.NewScaleSet(ctx, "example", &compute.ScaleSetArgs{ + // ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name), + // Location: pulumi.Any(azurerm_resource_group.Example.Location), + // Sku: &compute.ScaleSetSkuArgs{ + // Name: pulumi.Any(_var.Vm_sku), + // Tier: pulumi.String("Standard"), + // Capacity: pulumi.Any(_var.Instance_count), + // }, + // Identity: &compute.ScaleSetIdentityArgs{ + // Type: pulumi.String("SystemAssigned"), + // }, + // Extensions: compute.ScaleSetExtensionArray{ + // &compute.ScaleSetExtensionArgs{ + // Name: pulumi.String("MSILinuxExtension"), + // Publisher: pulumi.String("Microsoft.ManagedIdentity"), + // Type: pulumi.String("ManagedIdentityExtensionForLinux"), + // TypeHandlerVersion: pulumi.String("1.0"), + // Settings: pulumi.String("{\"port\": 50342}"), + // }, + // }, + // }) + // if err != nil { + // return err + // } + // ctx.Export("principalId", example.Identity.ApplyT(func(identity compute.ScaleSetIdentity) (*string, error) { + // return &identity.PrincipalId, nil + // }).(pulumi.StringPtrOutput)) + // return nil + // }) + // } + // ``` IdentityIds pulumi.StringArrayInput `pulumi:"identityIds"` PrincipalId pulumi.StringPtrInput `pulumi:"principalId"` // Specifies the identity type to be assigned to the scale set. Allowable values are `SystemAssigned` and `UserAssigned`. For the `SystemAssigned` identity the scale set's Service Principal ID (SPN) can be retrieved after the scale set has been created. See [documentation](https://docs.microsoft.com/azure/active-directory/managed-service-identity/overview) for more information. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. @@ -15175,6 +15259,51 @@ func (o ScaleSetIdentityOutput) ToOutput(ctx context.Context) pulumix.Output[Sca } // Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.NewScaleSet(ctx, "example", &compute.ScaleSetArgs{ +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name), +// Location: pulumi.Any(azurerm_resource_group.Example.Location), +// Sku: &compute.ScaleSetSkuArgs{ +// Name: pulumi.Any(_var.Vm_sku), +// Tier: pulumi.String("Standard"), +// Capacity: pulumi.Any(_var.Instance_count), +// }, +// Identity: &compute.ScaleSetIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Extensions: compute.ScaleSetExtensionArray{ +// &compute.ScaleSetExtensionArgs{ +// Name: pulumi.String("MSILinuxExtension"), +// Publisher: pulumi.String("Microsoft.ManagedIdentity"), +// Type: pulumi.String("ManagedIdentityExtensionForLinux"), +// TypeHandlerVersion: pulumi.String("1.0"), +// Settings: pulumi.String("{\"port\": 50342}"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// ctx.Export("principalId", example.Identity.ApplyT(func(identity compute.ScaleSetIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput)) +// return nil +// }) +// } +// +// ``` func (o ScaleSetIdentityOutput) IdentityIds() pulumi.StringArrayOutput { return o.ApplyT(func(v ScaleSetIdentity) []string { return v.IdentityIds }).(pulumi.StringArrayOutput) } @@ -15219,6 +15348,51 @@ func (o ScaleSetIdentityPtrOutput) Elem() ScaleSetIdentityOutput { } // Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := compute.NewScaleSet(ctx, "example", &compute.ScaleSetArgs{ +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name), +// Location: pulumi.Any(azurerm_resource_group.Example.Location), +// Sku: &compute.ScaleSetSkuArgs{ +// Name: pulumi.Any(_var.Vm_sku), +// Tier: pulumi.String("Standard"), +// Capacity: pulumi.Any(_var.Instance_count), +// }, +// Identity: &compute.ScaleSetIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Extensions: compute.ScaleSetExtensionArray{ +// &compute.ScaleSetExtensionArgs{ +// Name: pulumi.String("MSILinuxExtension"), +// Publisher: pulumi.String("Microsoft.ManagedIdentity"), +// Type: pulumi.String("ManagedIdentityExtensionForLinux"), +// TypeHandlerVersion: pulumi.String("1.0"), +// Settings: pulumi.String("{\"port\": 50342}"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// ctx.Export("principalId", example.Identity.ApplyT(func(identity compute.ScaleSetIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput)) +// return nil +// }) +// } +// +// ``` func (o ScaleSetIdentityPtrOutput) IdentityIds() pulumi.StringArrayOutput { return o.ApplyT(func(v *ScaleSetIdentity) []string { if v == nil { diff --git a/sdk/go/azure/compute/scaleSet.go b/sdk/go/azure/compute/scaleSet.go index 82deac0916..bf991f43aa 100644 --- a/sdk/go/azure/compute/scaleSet.go +++ b/sdk/go/azure/compute/scaleSet.go @@ -16,6 +16,358 @@ import ( // Manages a virtual machine scale set. // // ## Example Usage +// ### With Managed Disks (Recommended) +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// DomainNameLabel: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// bpepool, err := lb.NewBackendAddressPool(ctx, "bpepool", &lb.BackendAddressPoolArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// }) +// if err != nil { +// return err +// } +// lbnatpool, err := lb.NewNatPool(ctx, "lbnatpool", &lb.NatPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// LoadbalancerId: exampleLoadBalancer.ID(), +// Protocol: pulumi.String("Tcp"), +// FrontendPortStart: pulumi.Int(50000), +// FrontendPortEnd: pulumi.Int(50119), +// BackendPort: pulumi.Int(22), +// FrontendIpConfigurationName: pulumi.String("PublicIPAddress"), +// }) +// if err != nil { +// return err +// } +// exampleProbe, err := lb.NewProbe(ctx, "exampleProbe", &lb.ProbeArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// Protocol: pulumi.String("Http"), +// RequestPath: pulumi.String("/health"), +// Port: pulumi.Int(8080), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewScaleSet(ctx, "exampleScaleSet", &compute.ScaleSetArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AutomaticOsUpgrade: pulumi.Bool(true), +// UpgradePolicyMode: pulumi.String("Rolling"), +// RollingUpgradePolicy: &compute.ScaleSetRollingUpgradePolicyArgs{ +// MaxBatchInstancePercent: pulumi.Int(20), +// MaxUnhealthyInstancePercent: pulumi.Int(20), +// MaxUnhealthyUpgradedInstancePercent: pulumi.Int(5), +// PauseTimeBetweenBatches: pulumi.String("PT0S"), +// }, +// HealthProbeId: exampleProbe.ID(), +// Sku: &compute.ScaleSetSkuArgs{ +// Name: pulumi.String("Standard_F2"), +// Tier: pulumi.String("Standard"), +// Capacity: pulumi.Int(2), +// }, +// StorageProfileImageReference: &compute.ScaleSetStorageProfileImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// StorageProfileOsDisk: &compute.ScaleSetStorageProfileOsDiskArgs{ +// Name: pulumi.String(""), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Standard_LRS"), +// }, +// StorageProfileDataDisks: compute.ScaleSetStorageProfileDataDiskArray{ +// &compute.ScaleSetStorageProfileDataDiskArgs{ +// Lun: pulumi.Int(0), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("Empty"), +// DiskSizeGb: pulumi.Int(10), +// }, +// }, +// OsProfile: &compute.ScaleSetOsProfileArgs{ +// ComputerNamePrefix: pulumi.String("testvm"), +// AdminUsername: pulumi.String("myadmin"), +// }, +// OsProfileLinuxConfig: &compute.ScaleSetOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(true), +// SshKeys: compute.ScaleSetOsProfileLinuxConfigSshKeyArray{ +// &compute.ScaleSetOsProfileLinuxConfigSshKeyArgs{ +// Path: pulumi.String("/home/myadmin/.ssh/authorized_keys"), +// KeyData: readFileOrPanic("~/.ssh/demo_key.pub"), +// }, +// }, +// }, +// NetworkProfiles: compute.ScaleSetNetworkProfileArray{ +// &compute.ScaleSetNetworkProfileArgs{ +// Name: pulumi.String("mynetworkprofile"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.ScaleSetNetworkProfileIpConfigurationArray{ +// &compute.ScaleSetNetworkProfileIpConfigurationArgs{ +// Name: pulumi.String("TestIPConfiguration"), +// Primary: pulumi.Bool(true), +// SubnetId: exampleSubnet.ID(), +// LoadBalancerBackendAddressPoolIds: pulumi.StringArray{ +// bpepool.ID(), +// }, +// LoadBalancerInboundNatRulesIds: pulumi.StringArray{ +// lbnatpool.ID(), +// }, +// }, +// }, +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Unmanaged Disks +// +// ```go +// package main +// +// import ( +// +// "fmt" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewScaleSet(ctx, "exampleScaleSet", &compute.ScaleSetArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// UpgradePolicyMode: pulumi.String("Manual"), +// Sku: &compute.ScaleSetSkuArgs{ +// Name: pulumi.String("Standard_F2"), +// Tier: pulumi.String("Standard"), +// Capacity: pulumi.Int(2), +// }, +// OsProfile: &compute.ScaleSetOsProfileArgs{ +// ComputerNamePrefix: pulumi.String("testvm"), +// AdminUsername: pulumi.String("myadmin"), +// }, +// OsProfileLinuxConfig: &compute.ScaleSetOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(true), +// SshKeys: compute.ScaleSetOsProfileLinuxConfigSshKeyArray{ +// &compute.ScaleSetOsProfileLinuxConfigSshKeyArgs{ +// Path: pulumi.String("/home/myadmin/.ssh/authorized_keys"), +// KeyData: readFileOrPanic("~/.ssh/demo_key.pub"), +// }, +// }, +// }, +// NetworkProfiles: compute.ScaleSetNetworkProfileArray{ +// &compute.ScaleSetNetworkProfileArgs{ +// Name: pulumi.String("TestNetworkProfile"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.ScaleSetNetworkProfileIpConfigurationArray{ +// &compute.ScaleSetNetworkProfileIpConfigurationArgs{ +// Name: pulumi.String("TestIPConfiguration"), +// Primary: pulumi.Bool(true), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// }, +// }, +// StorageProfileOsDisk: &compute.ScaleSetStorageProfileOsDiskArgs{ +// Name: pulumi.String("osDiskProfile"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// VhdContainers: pulumi.StringArray{ +// pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) { +// primaryBlobEndpoint := _args[0].(string) +// name := _args[1].(string) +// return fmt.Sprintf("%v%v", primaryBlobEndpoint, name), nil +// }).(pulumi.StringOutput), +// }, +// }, +// StorageProfileImageReference: &compute.ScaleSetStorageProfileImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ## Example of storageProfileImageReference with id +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleImage, err := compute.NewImage(ctx, "exampleImage", nil) +// if err != nil { +// return err +// } +// _, err = compute.NewScaleSet(ctx, "exampleScaleSet", &compute.ScaleSetArgs{ +// StorageProfileImageReference: &compute.ScaleSetStorageProfileImageReferenceArgs{ +// Id: exampleImage.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/compute/scaleSetPacketCapture.go b/sdk/go/azure/compute/scaleSetPacketCapture.go index 22669768d2..45e937e304 100644 --- a/sdk/go/azure/compute/scaleSetPacketCapture.go +++ b/sdk/go/azure/compute/scaleSetPacketCapture.go @@ -15,6 +15,131 @@ import ( // Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkWatcher, err := network.NewNetworkWatcher(ctx, "exampleNetworkWatcher", &network.NetworkWatcherArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard_F2"), +// Instances: pulumi.Int(4), +// AdminUsername: pulumi.String("adminuser"), +// AdminPassword: pulumi.String("P@ssword1234!"), +// ComputerNamePrefix: pulumi.String("my-linux-computer-name-prefix"), +// UpgradeMode: pulumi.String("Automatic"), +// DisablePasswordAuthentication: pulumi.Bool(false), +// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{ +// StorageAccountType: pulumi.String("Standard_LRS"), +// Caching: pulumi.String("ReadWrite"), +// }, +// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("example"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// Primary: pulumi.Bool(true), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualMachineScaleSetExtension, err := compute.NewVirtualMachineScaleSetExtension(ctx, "exampleVirtualMachineScaleSetExtension", &compute.VirtualMachineScaleSetExtensionArgs{ +// VirtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.ID(), +// Publisher: pulumi.String("Microsoft.Azure.NetworkWatcher"), +// Type: pulumi.String("NetworkWatcherAgentLinux"), +// TypeHandlerVersion: pulumi.String("1.4"), +// AutoUpgradeMinorVersion: pulumi.Bool(true), +// AutomaticUpgradeEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewScaleSetPacketCapture(ctx, "exampleScaleSetPacketCapture", &compute.ScaleSetPacketCaptureArgs{ +// NetworkWatcherId: exampleNetworkWatcher.ID(), +// VirtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.ID(), +// StorageLocation: &compute.ScaleSetPacketCaptureStorageLocationArgs{ +// FilePath: pulumi.String("/var/captures/packet.cap"), +// }, +// MachineScope: &compute.ScaleSetPacketCaptureMachineScopeArgs{ +// IncludeInstanceIds: pulumi.StringArray{ +// pulumi.String("0"), +// }, +// ExcludeInstanceIds: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleVirtualMachineScaleSetExtension, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// > **NOTE:** This Resource requires that [the Network Watcher Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine Scale Set before capturing can be enabled which can be installed via the `compute.VirtualMachineScaleSetExtension` resource. +// // ## Import // // Virtual Machine Scale Set Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/sharedImage.go b/sdk/go/azure/compute/sharedImage.go index 0447740ca9..9374ccd667 100644 --- a/sdk/go/azure/compute/sharedImage.go +++ b/sdk/go/azure/compute/sharedImage.go @@ -15,6 +15,59 @@ import ( // Manages a Shared Image within a Shared Image Gallery. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "exampleSharedImageGallery", &compute.SharedImageGalleryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Description: pulumi.String("Shared images and things."), +// Tags: pulumi.StringMap{ +// "Hello": pulumi.String("There"), +// "World": pulumi.String("Example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewSharedImage(ctx, "exampleSharedImage", &compute.SharedImageArgs{ +// GalleryName: exampleSharedImageGallery.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OsType: pulumi.String("Linux"), +// Identifier: &compute.SharedImageIdentifierArgs{ +// Publisher: pulumi.String("PublisherName"), +// Offer: pulumi.String("OfferName"), +// Sku: pulumi.String("ExampleSku"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Shared Images can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/sharedImageGallery.go b/sdk/go/azure/compute/sharedImageGallery.go index 529bec59a9..c98d8be9e1 100644 --- a/sdk/go/azure/compute/sharedImageGallery.go +++ b/sdk/go/azure/compute/sharedImageGallery.go @@ -15,6 +15,45 @@ import ( // Manages a Shared Image Gallery. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewSharedImageGallery(ctx, "exampleSharedImageGallery", &compute.SharedImageGalleryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Description: pulumi.String("Shared images and things."), +// Tags: pulumi.StringMap{ +// "Hello": pulumi.String("There"), +// "World": pulumi.String("Example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Shared Image Galleries can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/sharedImageVersion.go b/sdk/go/azure/compute/sharedImageVersion.go index 5c3f02ae0f..ae6b488640 100644 --- a/sdk/go/azure/compute/sharedImageVersion.go +++ b/sdk/go/azure/compute/sharedImageVersion.go @@ -15,6 +15,58 @@ import ( // Manages a Version of a Shared Image within a Shared Image Gallery. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// existingImage, err := compute.LookupImage(ctx, &compute.LookupImageArgs{ +// Name: pulumi.StringRef("search-api"), +// ResourceGroupName: "packerimages", +// }, nil) +// if err != nil { +// return err +// } +// existingSharedImage, err := compute.LookupSharedImage(ctx, &compute.LookupSharedImageArgs{ +// Name: "existing-image", +// GalleryName: "existing_gallery", +// ResourceGroupName: "existing-resources", +// }, nil) +// if err != nil { +// return err +// } +// _, err = compute.NewSharedImageVersion(ctx, "example", &compute.SharedImageVersionArgs{ +// GalleryName: *pulumi.String(existingSharedImage.GalleryName), +// ImageName: *pulumi.String(existingSharedImage.Name), +// ResourceGroupName: *pulumi.String(existingSharedImage.ResourceGroupName), +// Location: *pulumi.String(existingSharedImage.Location), +// ManagedImageId: *pulumi.String(existingImage.Id), +// TargetRegions: compute.SharedImageVersionTargetRegionArray{ +// &compute.SharedImageVersionTargetRegionArgs{ +// Name: *pulumi.String(existingSharedImage.Location), +// RegionalReplicaCount: pulumi.Int(5), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Shared Image Versions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/snapshot.go b/sdk/go/azure/compute/snapshot.go index b0aa482fc3..5438ffcf01 100644 --- a/sdk/go/azure/compute/snapshot.go +++ b/sdk/go/azure/compute/snapshot.go @@ -15,6 +15,52 @@ import ( // Manages a Disk Snapshot. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "exampleManagedDisk", &compute.ManagedDiskArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccountType: pulumi.String("Standard_LRS"), +// CreateOption: pulumi.String("Empty"), +// DiskSizeGb: pulumi.Int(10), +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewSnapshot(ctx, "exampleSnapshot", &compute.SnapshotArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// CreateOption: pulumi.String("Copy"), +// SourceUri: exampleManagedDisk.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Snapshots can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/sshPublicKey.go b/sdk/go/azure/compute/sshPublicKey.go index f2c820a411..cad15a117c 100644 --- a/sdk/go/azure/compute/sshPublicKey.go +++ b/sdk/go/azure/compute/sshPublicKey.go @@ -15,6 +15,44 @@ import ( // Manages a SSH Public Key. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := compute.NewSshPublicKey(ctx, "example", &compute.SshPublicKeyArgs{ +// ResourceGroupName: pulumi.String("example"), +// Location: pulumi.String("West Europe"), +// PublicKey: readFileOrPanic("~/.ssh/id_rsa.pub"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SSH Public Keys can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/virtualMachine.go b/sdk/go/azure/compute/virtualMachine.go index f5cf84bcc3..c706a0d358 100644 --- a/sdk/go/azure/compute/virtualMachine.go +++ b/sdk/go/azure/compute/virtualMachine.go @@ -22,6 +22,109 @@ import ( // > **Note:** Data Disks can be attached either directly on the `compute.VirtualMachine` resource, or using the `compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur. // // ## Example Usage +// ### From An Azure Platform Image) +// +// This example provisions a Virtual Machine with Managed Disks. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// cfg := config.New(ctx, "") +// prefix := "tfvmex" +// if param := cfg.Get("prefix"); param != "" { +// prefix = param +// } +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// mainVirtualNetwork, err := network.NewVirtualNetwork(ctx, "mainVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: example.Location, +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: example.Name, +// VirtualNetworkName: mainVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// mainNetworkInterface, err := network.NewNetworkInterface(ctx, "mainNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: internal.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewVirtualMachine(ctx, "mainVirtualMachine", &compute.VirtualMachineArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// NetworkInterfaceIds: pulumi.StringArray{ +// mainNetworkInterface.ID(), +// }, +// VmSize: pulumi.String("Standard_DS1_v2"), +// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{ +// Name: pulumi.String("myosdisk1"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Standard_LRS"), +// }, +// OsProfile: &compute.VirtualMachineOsProfileArgs{ +// ComputerName: pulumi.String("hostname"), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// }, +// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(false), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/compute/virtualMachineScaleSetExtension.go b/sdk/go/azure/compute/virtualMachineScaleSetExtension.go index afa8b299b1..31f8a15912 100644 --- a/sdk/go/azure/compute/virtualMachineScaleSetExtension.go +++ b/sdk/go/azure/compute/virtualMachineScaleSetExtension.go @@ -17,6 +17,82 @@ import ( // // > **NOTE:** This resource is not intended to be used with the `compute.ScaleSet` resource - instead it's intended for this to be used with the `compute.LinuxVirtualMachineScaleSet` and `compute.WindowsVirtualMachineScaleSet` resources. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard_F2"), +// AdminUsername: pulumi.String("adminuser"), +// Instances: pulumi.Int(1), +// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("example"), +// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// }, +// }, +// }, +// }, +// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{ +// StorageAccountType: pulumi.String("Standard_LRS"), +// Caching: pulumi.String("ReadWrite"), +// }, +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "commandToExecute": "echo $HOSTNAME", +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = compute.NewVirtualMachineScaleSetExtension(ctx, "exampleVirtualMachineScaleSetExtension", &compute.VirtualMachineScaleSetExtensionArgs{ +// VirtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.ID(), +// Publisher: pulumi.String("Microsoft.Azure.Extensions"), +// Type: pulumi.String("CustomScript"), +// TypeHandlerVersion: pulumi.String("2.0"), +// Settings: pulumi.String(json0), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Machine Scale Set Extensions can be imported using the `resource id`, e.g. @@ -62,6 +138,20 @@ type VirtualMachineScaleSetExtension struct { // Specifies the version of the extension to use, available versions can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` TypeHandlerVersion pulumi.StringOutput `pulumi:"typeHandlerVersion"` // The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. // @@ -151,6 +241,20 @@ type virtualMachineScaleSetExtensionState struct { // Specifies the version of the extension to use, available versions can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` TypeHandlerVersion *string `pulumi:"typeHandlerVersion"` // The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. // @@ -192,6 +296,20 @@ type VirtualMachineScaleSetExtensionState struct { // Specifies the version of the extension to use, available versions can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` TypeHandlerVersion pulumi.StringPtrInput // The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. // @@ -237,6 +355,20 @@ type virtualMachineScaleSetExtensionArgs struct { // Specifies the version of the extension to use, available versions can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` TypeHandlerVersion string `pulumi:"typeHandlerVersion"` // The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. // @@ -279,6 +411,20 @@ type VirtualMachineScaleSetExtensionArgs struct { // Specifies the version of the extension to use, available versions can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` TypeHandlerVersion pulumi.StringInput // The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. // @@ -465,6 +611,23 @@ func (o VirtualMachineScaleSetExtensionOutput) Type() pulumi.StringOutput { // Specifies the version of the extension to use, available versions can be found using the Azure CLI. // // > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` func (o VirtualMachineScaleSetExtensionOutput) TypeHandlerVersion() pulumi.StringOutput { return o.ApplyT(func(v *VirtualMachineScaleSetExtension) pulumi.StringOutput { return v.TypeHandlerVersion }).(pulumi.StringOutput) } diff --git a/sdk/go/azure/compute/windowsVirtualMachine.go b/sdk/go/azure/compute/windowsVirtualMachine.go index e482058a98..cc7014bfe5 100644 --- a/sdk/go/azure/compute/windowsVirtualMachine.go +++ b/sdk/go/azure/compute/windowsVirtualMachine.go @@ -27,6 +27,93 @@ import ( // // > In this release there's a known issue where the `publicIpAddress` and `publicIpAddresses` fields may not be fully populated for Dynamic Public IP's. // +// ## Example Usage +// +// This example provisions a basic Windows Virtual Machine on an internal network. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewWindowsVirtualMachine(ctx, "exampleWindowsVirtualMachine", &compute.WindowsVirtualMachineArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_F2"), +// AdminUsername: pulumi.String("adminuser"), +// AdminPassword: pulumi.String("P@$$w0rd1234!"), +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// OsDisk: &compute.WindowsVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// SourceImageReference: &compute.WindowsVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("MicrosoftWindowsServer"), +// Offer: pulumi.String("WindowsServer"), +// Sku: pulumi.String("2016-Datacenter"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/compute/windowsVirtualMachineScaleSet.go b/sdk/go/azure/compute/windowsVirtualMachineScaleSet.go index 375b82e8f1..5675615491 100644 --- a/sdk/go/azure/compute/windowsVirtualMachineScaleSet.go +++ b/sdk/go/azure/compute/windowsVirtualMachineScaleSet.go @@ -23,6 +23,90 @@ import ( // // > **NOTE:** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `compute.ScaleSet` resource instead // +// ## Example Usage +// +// This example provisions a basic Windows Virtual Machine Scale Set on an internal network. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewWindowsVirtualMachineScaleSet(ctx, "exampleWindowsVirtualMachineScaleSet", &compute.WindowsVirtualMachineScaleSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard_F2"), +// Instances: pulumi.Int(1), +// AdminPassword: pulumi.String("P@55w0rd1234!"), +// AdminUsername: pulumi.String("adminuser"), +// SourceImageReference: &compute.WindowsVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("MicrosoftWindowsServer"), +// Offer: pulumi.String("WindowsServer"), +// Sku: pulumi.String("2016-Datacenter-Server-Core"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.WindowsVirtualMachineScaleSetOsDiskArgs{ +// StorageAccountType: pulumi.String("Standard_LRS"), +// Caching: pulumi.String("ReadWrite"), +// }, +// NetworkInterfaces: compute.WindowsVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.WindowsVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("example"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.WindowsVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.WindowsVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// Primary: pulumi.Bool(true), +// SubnetId: internal.ID(), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Windows Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/confidentialledger/ledger.go b/sdk/go/azure/confidentialledger/ledger.go index 088b6a129d..ed497d638a 100644 --- a/sdk/go/azure/confidentialledger/ledger.go +++ b/sdk/go/azure/confidentialledger/ledger.go @@ -15,6 +15,52 @@ import ( // Manages a Confidential Ledger. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/confidentialledger" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = confidentialledger.NewLedger(ctx, "ledger", &confidentialledger.LedgerArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// LedgerType: pulumi.String("Private"), +// AzureadBasedServicePrincipals: confidentialledger.LedgerAzureadBasedServicePrincipalArray{ +// &confidentialledger.LedgerAzureadBasedServicePrincipalArgs{ +// PrincipalId: *pulumi.String(current.ObjectId), +// TenantId: *pulumi.String(current.TenantId), +// LedgerRoleName: pulumi.String("Administrator"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Confidential Ledgers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/connections/apiConnection.go b/sdk/go/azure/connections/apiConnection.go index e959dd077a..9df5c30d93 100644 --- a/sdk/go/azure/connections/apiConnection.go +++ b/sdk/go/azure/connections/apiConnection.go @@ -15,6 +15,62 @@ import ( // Manages an API Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/connections" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleManagedApi := connections.GetManagedApiOutput(ctx, connections.GetManagedApiOutputArgs{ +// Name: pulumi.String("servicebus"), +// Location: exampleResourceGroup.Location, +// }, nil) +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = connections.NewApiConnection(ctx, "exampleApiConnection", &connections.ApiConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ManagedApiId: exampleManagedApi.ApplyT(func(exampleManagedApi connections.GetManagedApiResult) (*string, error) { +// return &exampleManagedApi.Id, nil +// }).(pulumi.StringPtrOutput), +// DisplayName: pulumi.String("Example 1"), +// ParameterValues: pulumi.StringMap{ +// "connectionString": exampleNamespace.DefaultPrimaryConnectionString, +// }, +// Tags: pulumi.StringMap{ +// "Hello": pulumi.String("World"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // API Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/connections/getManagedApi.go b/sdk/go/azure/connections/getManagedApi.go index 5b69193d93..561fc64074 100644 --- a/sdk/go/azure/connections/getManagedApi.go +++ b/sdk/go/azure/connections/getManagedApi.go @@ -13,6 +13,34 @@ import ( ) // Uses this data source to access information about an existing Managed API. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/connections" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := connections.GetManagedApi(ctx, &connections.GetManagedApiArgs{ +// Name: "servicebus", +// Location: "West Europe", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetManagedApi(ctx *pulumi.Context, args *GetManagedApiArgs, opts ...pulumi.InvokeOption) (*GetManagedApiResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetManagedApiResult diff --git a/sdk/go/azure/consumption/budgetManagementGroup.go b/sdk/go/azure/consumption/budgetManagementGroup.go index 6eac2ab564..769e6dbe2b 100644 --- a/sdk/go/azure/consumption/budgetManagementGroup.go +++ b/sdk/go/azure/consumption/budgetManagementGroup.go @@ -15,6 +15,92 @@ import ( // Manages a Consumption Budget for a Management Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/consumption" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.NewGroup(ctx, "exampleGroup", &management.GroupArgs{ +// DisplayName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("eastus"), +// }) +// if err != nil { +// return err +// } +// _, err = consumption.NewBudgetManagementGroup(ctx, "exampleBudgetManagementGroup", &consumption.BudgetManagementGroupArgs{ +// ManagementGroupId: exampleGroup.ID(), +// Amount: pulumi.Float64(1000), +// TimeGrain: pulumi.String("Monthly"), +// TimePeriod: &consumption.BudgetManagementGroupTimePeriodArgs{ +// StartDate: pulumi.String("2022-06-01T00:00:00Z"), +// EndDate: pulumi.String("2022-07-01T00:00:00Z"), +// }, +// Filter: &consumption.BudgetManagementGroupFilterArgs{ +// Dimensions: consumption.BudgetManagementGroupFilterDimensionArray{ +// &consumption.BudgetManagementGroupFilterDimensionArgs{ +// Name: pulumi.String("ResourceGroupName"), +// Values: pulumi.StringArray{ +// exampleResourceGroup.Name, +// }, +// }, +// }, +// Tags: consumption.BudgetManagementGroupFilterTagArray{ +// &consumption.BudgetManagementGroupFilterTagArgs{ +// Name: pulumi.String("foo"), +// Values: pulumi.StringArray{ +// pulumi.String("bar"), +// pulumi.String("baz"), +// }, +// }, +// }, +// }, +// Notifications: consumption.BudgetManagementGroupNotificationArray{ +// &consumption.BudgetManagementGroupNotificationArgs{ +// Enabled: pulumi.Bool(true), +// Threshold: pulumi.Int(90), +// Operator: pulumi.String("EqualTo"), +// ContactEmails: pulumi.StringArray{ +// pulumi.String("foo@example.com"), +// pulumi.String("bar@example.com"), +// }, +// }, +// &consumption.BudgetManagementGroupNotificationArgs{ +// Enabled: pulumi.Bool(false), +// Threshold: pulumi.Int(100), +// Operator: pulumi.String("GreaterThan"), +// ThresholdType: pulumi.String("Forecasted"), +// ContactEmails: pulumi.StringArray{ +// pulumi.String("foo@example.com"), +// pulumi.String("bar@example.com"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Management Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/consumption/budgetResourceGroup.go b/sdk/go/azure/consumption/budgetResourceGroup.go index bb46800c3f..3a9bd486a4 100644 --- a/sdk/go/azure/consumption/budgetResourceGroup.go +++ b/sdk/go/azure/consumption/budgetResourceGroup.go @@ -15,6 +15,99 @@ import ( // Manages a Resource Group Consumption Budget. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/consumption" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("eastus"), +// }) +// if err != nil { +// return err +// } +// exampleActionGroup, err := monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// _, err = consumption.NewBudgetResourceGroup(ctx, "exampleBudgetResourceGroup", &consumption.BudgetResourceGroupArgs{ +// ResourceGroupId: exampleResourceGroup.ID(), +// Amount: pulumi.Float64(1000), +// TimeGrain: pulumi.String("Monthly"), +// TimePeriod: &consumption.BudgetResourceGroupTimePeriodArgs{ +// StartDate: pulumi.String("2022-06-01T00:00:00Z"), +// EndDate: pulumi.String("2022-07-01T00:00:00Z"), +// }, +// Filter: &consumption.BudgetResourceGroupFilterArgs{ +// Dimensions: consumption.BudgetResourceGroupFilterDimensionArray{ +// &consumption.BudgetResourceGroupFilterDimensionArgs{ +// Name: pulumi.String("ResourceId"), +// Values: pulumi.StringArray{ +// exampleActionGroup.ID(), +// }, +// }, +// }, +// Tags: consumption.BudgetResourceGroupFilterTagArray{ +// &consumption.BudgetResourceGroupFilterTagArgs{ +// Name: pulumi.String("foo"), +// Values: pulumi.StringArray{ +// pulumi.String("bar"), +// pulumi.String("baz"), +// }, +// }, +// }, +// }, +// Notifications: consumption.BudgetResourceGroupNotificationArray{ +// &consumption.BudgetResourceGroupNotificationArgs{ +// Enabled: pulumi.Bool(true), +// Threshold: pulumi.Int(90), +// Operator: pulumi.String("EqualTo"), +// ThresholdType: pulumi.String("Forecasted"), +// ContactEmails: pulumi.StringArray{ +// pulumi.String("foo@example.com"), +// pulumi.String("bar@example.com"), +// }, +// ContactGroups: pulumi.StringArray{ +// exampleActionGroup.ID(), +// }, +// ContactRoles: pulumi.StringArray{ +// pulumi.String("Owner"), +// }, +// }, +// &consumption.BudgetResourceGroupNotificationArgs{ +// Enabled: pulumi.Bool(false), +// Threshold: pulumi.Int(100), +// Operator: pulumi.String("GreaterThan"), +// ContactEmails: pulumi.StringArray{ +// pulumi.String("foo@example.com"), +// pulumi.String("bar@example.com"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/consumption/budgetSubscription.go b/sdk/go/azure/consumption/budgetSubscription.go index 6fede8333a..2317354b03 100644 --- a/sdk/go/azure/consumption/budgetSubscription.go +++ b/sdk/go/azure/consumption/budgetSubscription.go @@ -15,6 +15,103 @@ import ( // Manages a Subscription Consumption Budget. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/consumption" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("eastus"), +// }) +// if err != nil { +// return err +// } +// exampleActionGroup, err := monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// _, err = consumption.NewBudgetSubscription(ctx, "exampleBudgetSubscription", &consumption.BudgetSubscriptionArgs{ +// SubscriptionId: *pulumi.String(current.Id), +// Amount: pulumi.Float64(1000), +// TimeGrain: pulumi.String("Monthly"), +// TimePeriod: &consumption.BudgetSubscriptionTimePeriodArgs{ +// StartDate: pulumi.String("2022-06-01T00:00:00Z"), +// EndDate: pulumi.String("2022-07-01T00:00:00Z"), +// }, +// Filter: &consumption.BudgetSubscriptionFilterArgs{ +// Dimensions: consumption.BudgetSubscriptionFilterDimensionArray{ +// &consumption.BudgetSubscriptionFilterDimensionArgs{ +// Name: pulumi.String("ResourceGroupName"), +// Values: pulumi.StringArray{ +// exampleResourceGroup.Name, +// }, +// }, +// }, +// Tags: consumption.BudgetSubscriptionFilterTagArray{ +// &consumption.BudgetSubscriptionFilterTagArgs{ +// Name: pulumi.String("foo"), +// Values: pulumi.StringArray{ +// pulumi.String("bar"), +// pulumi.String("baz"), +// }, +// }, +// }, +// }, +// Notifications: consumption.BudgetSubscriptionNotificationArray{ +// &consumption.BudgetSubscriptionNotificationArgs{ +// Enabled: pulumi.Bool(true), +// Threshold: pulumi.Int(90), +// Operator: pulumi.String("EqualTo"), +// ContactEmails: pulumi.StringArray{ +// pulumi.String("foo@example.com"), +// pulumi.String("bar@example.com"), +// }, +// ContactGroups: pulumi.StringArray{ +// exampleActionGroup.ID(), +// }, +// ContactRoles: pulumi.StringArray{ +// pulumi.String("Owner"), +// }, +// }, +// &consumption.BudgetSubscriptionNotificationArgs{ +// Enabled: pulumi.Bool(false), +// Threshold: pulumi.Int(100), +// Operator: pulumi.String("GreaterThan"), +// ThresholdType: pulumi.String("Forecasted"), +// ContactEmails: pulumi.StringArray{ +// pulumi.String("foo@example.com"), +// pulumi.String("bar@example.com"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subscription Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/consumption/getBudgetResourceGroup.go b/sdk/go/azure/consumption/getBudgetResourceGroup.go index ea76122d32..4280ed281a 100644 --- a/sdk/go/azure/consumption/getBudgetResourceGroup.go +++ b/sdk/go/azure/consumption/getBudgetResourceGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Consumption Budget for a specific resource group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/consumption" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := consumption.LookupBudgetResourceGroup(ctx, &consumption.LookupBudgetResourceGroupArgs{ +// Name: "existing", +// ResourceGroupId: azurerm_resource_group.Example.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupBudgetResourceGroup(ctx *pulumi.Context, args *LookupBudgetResourceGroupArgs, opts ...pulumi.InvokeOption) (*LookupBudgetResourceGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBudgetResourceGroupResult diff --git a/sdk/go/azure/consumption/getBudgetSubscription.go b/sdk/go/azure/consumption/getBudgetSubscription.go index 1ebcee85f5..d0b5da72d2 100644 --- a/sdk/go/azure/consumption/getBudgetSubscription.go +++ b/sdk/go/azure/consumption/getBudgetSubscription.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Consumption Budget for a specific subscription. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/consumption" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := consumption.LookupBudgetSubscription(ctx, &consumption.LookupBudgetSubscriptionArgs{ +// Name: "existing", +// SubscriptionId: "/subscriptions/00000000-0000-0000-0000-000000000000/", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", data.Azurerm_consumption_budget.Example.Id) +// return nil +// }) +// } +// +// ``` func LookupBudgetSubscription(ctx *pulumi.Context, args *LookupBudgetSubscriptionArgs, opts ...pulumi.InvokeOption) (*LookupBudgetSubscriptionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBudgetSubscriptionResult diff --git a/sdk/go/azure/containerapp/app.go b/sdk/go/azure/containerapp/app.go index 9ca11b31aa..16795c2bce 100644 --- a/sdk/go/azure/containerapp/app.go +++ b/sdk/go/azure/containerapp/app.go @@ -15,6 +15,69 @@ import ( // Manages a Container App. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// exampleEnvironment, err := containerapp.NewEnvironment(ctx, "exampleEnvironment", &containerapp.EnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = containerapp.NewApp(ctx, "exampleApp", &containerapp.AppArgs{ +// ContainerAppEnvironmentId: exampleEnvironment.ID(), +// ResourceGroupName: exampleResourceGroup.Name, +// RevisionMode: pulumi.String("Single"), +// Template: &containerapp.AppTemplateArgs{ +// Containers: containerapp.AppTemplateContainerArray{ +// &containerapp.AppTemplateContainerArgs{ +// Name: pulumi.String("examplecontainerapp"), +// Image: pulumi.String("mcr.microsoft.com/azuredocs/containerapps-helloworld:latest"), +// Cpu: pulumi.Float64(0.25), +// Memory: pulumi.String("0.5Gi"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Container App can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerapp/environment.go b/sdk/go/azure/containerapp/environment.go index 3fd6ac6ac5..29da4202d5 100644 --- a/sdk/go/azure/containerapp/environment.go +++ b/sdk/go/azure/containerapp/environment.go @@ -15,6 +15,51 @@ import ( // Manages a Container App Environment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// _, err = containerapp.NewEnvironment(ctx, "exampleEnvironment", &containerapp.EnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerapp/environmentDaprComponent.go b/sdk/go/azure/containerapp/environmentDaprComponent.go index 15eb1e3218..a54c5e422e 100644 --- a/sdk/go/azure/containerapp/environmentDaprComponent.go +++ b/sdk/go/azure/containerapp/environmentDaprComponent.go @@ -15,6 +15,59 @@ import ( // Manages a Dapr Component for a Container App Environment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// exampleEnvironment, err := containerapp.NewEnvironment(ctx, "exampleEnvironment", &containerapp.EnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = containerapp.NewEnvironmentDaprComponent(ctx, "exampleEnvironmentDaprComponent", &containerapp.EnvironmentDaprComponentArgs{ +// ContainerAppEnvironmentId: exampleEnvironment.ID(), +// ComponentType: pulumi.String("state.azure.blobstorage"), +// Version: pulumi.String("v1"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Dapr Component for a Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerapp/environmentStorage.go b/sdk/go/azure/containerapp/environmentStorage.go index 6f3a795462..1d627681bb 100644 --- a/sdk/go/azure/containerapp/environmentStorage.go +++ b/sdk/go/azure/containerapp/environmentStorage.go @@ -15,6 +15,78 @@ import ( // Manages a Container App Environment Storage. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// exampleEnvironment, err := containerapp.NewEnvironment(ctx, "exampleEnvironment", &containerapp.EnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleShare, err := storage.NewShare(ctx, "exampleShare", &storage.ShareArgs{ +// StorageAccountName: exampleAccount.Name, +// Quota: pulumi.Int(5), +// }) +// if err != nil { +// return err +// } +// _, err = containerapp.NewEnvironmentStorage(ctx, "exampleEnvironmentStorage", &containerapp.EnvironmentStorageArgs{ +// ContainerAppEnvironmentId: exampleEnvironment.ID(), +// AccountName: exampleAccount.Name, +// ShareName: exampleShare.Name, +// AccessKey: exampleAccount.PrimaryAccessKey, +// AccessMode: pulumi.String("ReadOnly"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Container App Environment Storage can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerapp/getApp.go b/sdk/go/azure/containerapp/getApp.go index 767d8c27a3..a3be7b627a 100644 --- a/sdk/go/azure/containerapp/getApp.go +++ b/sdk/go/azure/containerapp/getApp.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Container App. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := containerapp.LookupApp(ctx, &containerapp.LookupAppArgs{ +// Name: "example-app", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupApp(ctx *pulumi.Context, args *LookupAppArgs, opts ...pulumi.InvokeOption) (*LookupAppResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAppResult diff --git a/sdk/go/azure/containerapp/getEnvironment.go b/sdk/go/azure/containerapp/getEnvironment.go index 94f9e71e17..54198756d3 100644 --- a/sdk/go/azure/containerapp/getEnvironment.go +++ b/sdk/go/azure/containerapp/getEnvironment.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Container App Environment. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := containerapp.LookupEnvironment(ctx, &containerapp.LookupEnvironmentArgs{ +// Name: "example-environment", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupEnvironment(ctx *pulumi.Context, args *LookupEnvironmentArgs, opts ...pulumi.InvokeOption) (*LookupEnvironmentResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupEnvironmentResult diff --git a/sdk/go/azure/containerapp/getEnvironmentCertificate.go b/sdk/go/azure/containerapp/getEnvironmentCertificate.go index 22b02212d1..28453f2911 100644 --- a/sdk/go/azure/containerapp/getEnvironmentCertificate.go +++ b/sdk/go/azure/containerapp/getEnvironmentCertificate.go @@ -13,6 +13,40 @@ import ( ) // Use this data source to access information about an existing Container App Environment Certificate. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleEnvironment, err := containerapp.LookupEnvironment(ctx, &containerapp.LookupEnvironmentArgs{ +// Name: "example-environment", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// _, err = containerapp.LookupEnvironmentCertificate(ctx, &containerapp.LookupEnvironmentCertificateArgs{ +// Name: "mycertificate", +// ContainerAppEnvironmentId: exampleEnvironment.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupEnvironmentCertificate(ctx *pulumi.Context, args *LookupEnvironmentCertificateArgs, opts ...pulumi.InvokeOption) (*LookupEnvironmentCertificateResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupEnvironmentCertificateResult diff --git a/sdk/go/azure/containerservice/clusterTrustedAccessRoleBinding.go b/sdk/go/azure/containerservice/clusterTrustedAccessRoleBinding.go index 0328c7d020..cb1beb34b9 100644 --- a/sdk/go/azure/containerservice/clusterTrustedAccessRoleBinding.go +++ b/sdk/go/azure/containerservice/clusterTrustedAccessRoleBinding.go @@ -19,6 +19,114 @@ import ( // > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name TrustedAccessPreview` and then `az provider register -n Microsoft.ContainerService` // . // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("example-value"), +// }) +// if err != nil { +// return err +// } +// _, err = core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: pulumi.Any(data.Azurerm_client_config.Example.Tenant_id), +// SkuName: pulumi.String("example-value"), +// SoftDeleteRetentionDays: pulumi.Int("example-value"), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "exampleAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: pulumi.Any(data.Azurerm_client_config.Example.Tenant_id), +// ObjectId: pulumi.Any(data.Azurerm_client_config.Example.Object_id), +// KeyPermissions: pulumi.StringArray("example-value"), +// }) +// if err != nil { +// return err +// } +// exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefix: pulumi.String("acctestaksexample"), +// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{ +// Name: pulumi.String("example-value"), +// NodeCount: pulumi.Int("example-value"), +// VmSize: pulumi.String("example-value"), +// }, +// Identity: &containerservice.KubernetesClusterIdentityArgs{ +// Type: pulumi.String("example-value"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("example-value"), +// AccountReplicationType: pulumi.String("example-value"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// ApplicationInsightsId: exampleInsights.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("example-value"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewClusterTrustedAccessRoleBinding(ctx, "exampleClusterTrustedAccessRoleBinding", &containerservice.ClusterTrustedAccessRoleBindingArgs{ +// KubernetesClusterId: exampleKubernetesCluster.ID(), +// Roles: pulumi.StringArray("example-value"), +// SourceResourceId: exampleWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing Kubernetes Cluster Trusted Access Role Binding can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/connectedRegistry.go b/sdk/go/azure/containerservice/connectedRegistry.go index e9b19adaea..57cee5de25 100644 --- a/sdk/go/azure/containerservice/connectedRegistry.go +++ b/sdk/go/azure/containerservice/connectedRegistry.go @@ -15,6 +15,75 @@ import ( // Manages a Container Connected Registry. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRegistry, err := containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Premium"), +// DataEndpointEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleRegistryScopeMap, err := containerservice.NewRegistryScopeMap(ctx, "exampleRegistryScopeMap", &containerservice.RegistryScopeMapArgs{ +// ContainerRegistryName: exampleRegistry.Name, +// ResourceGroupName: exampleRegistry.ResourceGroupName, +// Actions: pulumi.StringArray{ +// pulumi.String("repositories/hello-world/content/delete"), +// pulumi.String("repositories/hello-world/content/read"), +// pulumi.String("repositories/hello-world/content/write"), +// pulumi.String("repositories/hello-world/metadata/read"), +// pulumi.String("repositories/hello-world/metadata/write"), +// pulumi.String("gateway/examplecr/config/read"), +// pulumi.String("gateway/examplecr/config/write"), +// pulumi.String("gateway/examplecr/message/read"), +// pulumi.String("gateway/examplecr/message/write"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleRegistryToken, err := containerservice.NewRegistryToken(ctx, "exampleRegistryToken", &containerservice.RegistryTokenArgs{ +// ContainerRegistryName: exampleRegistry.Name, +// ResourceGroupName: exampleRegistry.ResourceGroupName, +// ScopeMapId: exampleRegistryScopeMap.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewConnectedRegistry(ctx, "exampleConnectedRegistry", &containerservice.ConnectedRegistryArgs{ +// ContainerRegistryId: exampleRegistry.ID(), +// SyncTokenId: exampleRegistryToken.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Connected Registries can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/fluxConfiguration.go b/sdk/go/azure/containerservice/fluxConfiguration.go index c871ee16c4..fb21ba5902 100644 --- a/sdk/go/azure/containerservice/fluxConfiguration.go +++ b/sdk/go/azure/containerservice/fluxConfiguration.go @@ -15,6 +15,75 @@ import ( // Manages a Kubernetes Flux Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: pulumi.String("West Europe"), +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefix: pulumi.String("example-aks"), +// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{ +// Name: pulumi.String("default"), +// NodeCount: pulumi.Int(1), +// VmSize: pulumi.String("Standard_DS2_v2"), +// }, +// Identity: &containerservice.KubernetesClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKubernetesClusterExtension, err := containerservice.NewKubernetesClusterExtension(ctx, "exampleKubernetesClusterExtension", &containerservice.KubernetesClusterExtensionArgs{ +// ClusterId: pulumi.Any(azurerm_kubernetes_cluster.Test.Id), +// ExtensionType: pulumi.String("microsoft.flux"), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewFluxConfiguration(ctx, "exampleFluxConfiguration", &containerservice.FluxConfigurationArgs{ +// ClusterId: pulumi.Any(azurerm_kubernetes_cluster.Test.Id), +// Namespace: pulumi.String("flux"), +// GitRepository: &containerservice.FluxConfigurationGitRepositoryArgs{ +// Url: pulumi.String("https://github.com/Azure/arc-k8s-demo"), +// ReferenceType: pulumi.String("branch"), +// ReferenceValue: pulumi.String("main"), +// }, +// Kustomizations: containerservice.FluxConfigurationKustomizationArray{ +// &containerservice.FluxConfigurationKustomizationArgs{ +// Name: pulumi.String("kustomization-1"), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleKubernetesClusterExtension, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/go/azure/containerservice/getClusterNodePool.go b/sdk/go/azure/containerservice/getClusterNodePool.go index f22d94894c..95a8a2ccb0 100644 --- a/sdk/go/azure/containerservice/getClusterNodePool.go +++ b/sdk/go/azure/containerservice/getClusterNodePool.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Kubernetes Cluster Node Pool. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := containerservice.GetClusterNodePool(ctx, &containerservice.GetClusterNodePoolArgs{ +// Name: "existing", +// KubernetesClusterName: "existing-cluster", +// ResourceGroupName: "existing-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetClusterNodePool(ctx *pulumi.Context, args *GetClusterNodePoolArgs, opts ...pulumi.InvokeOption) (*GetClusterNodePoolResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetClusterNodePoolResult diff --git a/sdk/go/azure/containerservice/getGroup.go b/sdk/go/azure/containerservice/getGroup.go index 5dae12b64b..97c65c2d94 100644 --- a/sdk/go/azure/containerservice/getGroup.go +++ b/sdk/go/azure/containerservice/getGroup.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about an existing Container Group instance. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := containerservice.LookupGroup(ctx, &containerservice.LookupGroupArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// ctx.Export("ipAddress", example.IpAddress) +// ctx.Export("fqdn", example.Fqdn) +// return nil +// }) +// } +// +// ``` func LookupGroup(ctx *pulumi.Context, args *LookupGroupArgs, opts ...pulumi.InvokeOption) (*LookupGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupGroupResult diff --git a/sdk/go/azure/containerservice/getKubernetesCluster.go b/sdk/go/azure/containerservice/getKubernetesCluster.go index 869bce3a34..e89162c0d2 100644 --- a/sdk/go/azure/containerservice/getKubernetesCluster.go +++ b/sdk/go/azure/containerservice/getKubernetesCluster.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Managed Kubernetes Cluster (AKS). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := containerservice.LookupKubernetesCluster(ctx, &containerservice.LookupKubernetesClusterArgs{ +// Name: "myakscluster", +// ResourceGroupName: "my-example-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupKubernetesCluster(ctx *pulumi.Context, args *LookupKubernetesClusterArgs, opts ...pulumi.InvokeOption) (*LookupKubernetesClusterResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupKubernetesClusterResult diff --git a/sdk/go/azure/containerservice/getKubernetesNodePoolSnapshot.go b/sdk/go/azure/containerservice/getKubernetesNodePoolSnapshot.go index cbf18e2451..4ed87079e7 100644 --- a/sdk/go/azure/containerservice/getKubernetesNodePoolSnapshot.go +++ b/sdk/go/azure/containerservice/getKubernetesNodePoolSnapshot.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Kubernetes Node Pool Snapshot. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := containerservice.GetKubernetesNodePoolSnapshot(ctx, &containerservice.GetKubernetesNodePoolSnapshotArgs{ +// Name: "example", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetKubernetesNodePoolSnapshot(ctx *pulumi.Context, args *GetKubernetesNodePoolSnapshotArgs, opts ...pulumi.InvokeOption) (*GetKubernetesNodePoolSnapshotResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetKubernetesNodePoolSnapshotResult diff --git a/sdk/go/azure/containerservice/getKubernetesServiceVersions.go b/sdk/go/azure/containerservice/getKubernetesServiceVersions.go index 2fe1e252be..ee3604d324 100644 --- a/sdk/go/azure/containerservice/getKubernetesServiceVersions.go +++ b/sdk/go/azure/containerservice/getKubernetesServiceVersions.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to retrieve the version of Kubernetes supported by Azure Kubernetes Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := containerservice.GetKubernetesServiceVersions(ctx, &containerservice.GetKubernetesServiceVersionsArgs{ +// Location: "West Europe", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("versions", current.Versions) +// ctx.Export("latestVersion", current.LatestVersion) +// return nil +// }) +// } +// +// ``` func GetKubernetesServiceVersions(ctx *pulumi.Context, args *GetKubernetesServiceVersionsArgs, opts ...pulumi.InvokeOption) (*GetKubernetesServiceVersionsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetKubernetesServiceVersionsResult diff --git a/sdk/go/azure/containerservice/getRegistry.go b/sdk/go/azure/containerservice/getRegistry.go index f171faa3c9..0bd4b2374e 100644 --- a/sdk/go/azure/containerservice/getRegistry.go +++ b/sdk/go/azure/containerservice/getRegistry.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Container Registry. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := containerservice.LookupRegistry(ctx, &containerservice.LookupRegistryArgs{ +// Name: "testacr", +// ResourceGroupName: "test", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("loginServer", example.LoginServer) +// return nil +// }) +// } +// +// ``` func LookupRegistry(ctx *pulumi.Context, args *LookupRegistryArgs, opts ...pulumi.InvokeOption) (*LookupRegistryResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRegistryResult diff --git a/sdk/go/azure/containerservice/getRegistryScopeMap.go b/sdk/go/azure/containerservice/getRegistryScopeMap.go index d7fc703b60..87a0a299dc 100644 --- a/sdk/go/azure/containerservice/getRegistryScopeMap.go +++ b/sdk/go/azure/containerservice/getRegistryScopeMap.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Container Registry scope map. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := containerservice.LookupRegistryScopeMap(ctx, &containerservice.LookupRegistryScopeMapArgs{ +// Name: "example-scope-map", +// ResourceGroupName: "example-resource-group", +// ContainerRegistryName: "example-registry", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("actions", example.Actions) +// return nil +// }) +// } +// +// ``` func LookupRegistryScopeMap(ctx *pulumi.Context, args *LookupRegistryScopeMapArgs, opts ...pulumi.InvokeOption) (*LookupRegistryScopeMapResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRegistryScopeMapResult diff --git a/sdk/go/azure/containerservice/getRegistryToken.go b/sdk/go/azure/containerservice/getRegistryToken.go index 0b2f0d992a..11ce1dc6e4 100644 --- a/sdk/go/azure/containerservice/getRegistryToken.go +++ b/sdk/go/azure/containerservice/getRegistryToken.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Container Registry token. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := containerservice.LookupRegistryToken(ctx, &containerservice.LookupRegistryTokenArgs{ +// Name: "exampletoken", +// ResourceGroupName: "example-resource-group", +// ContainerRegistryName: "example-registry", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("scopeMapId", example.ScopeMapId) +// return nil +// }) +// } +// +// ``` func LookupRegistryToken(ctx *pulumi.Context, args *LookupRegistryTokenArgs, opts ...pulumi.InvokeOption) (*LookupRegistryTokenResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRegistryTokenResult diff --git a/sdk/go/azure/containerservice/group.go b/sdk/go/azure/containerservice/group.go index b81106cae4..ce359dd82a 100644 --- a/sdk/go/azure/containerservice/group.go +++ b/sdk/go/azure/containerservice/group.go @@ -17,6 +17,68 @@ import ( // // > **Note** `networkProfileId` is [deprecated](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet) by Azure. For users who want to continue to manage existing `containerservice.Group` that rely on `networkProfileId`, please stay on provider versions prior to v3.16.0. Otherwise, use `subnetIds` instead. // +// ## Example Usage +// +// This example provisions a Basic Container. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewGroup(ctx, "exampleGroup", &containerservice.GroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpAddressType: pulumi.String("Public"), +// DnsNameLabel: pulumi.String("aci-label"), +// OsType: pulumi.String("Linux"), +// Containers: containerservice.GroupContainerArray{ +// &containerservice.GroupContainerArgs{ +// Name: pulumi.String("hello-world"), +// Image: pulumi.String("mcr.microsoft.com/azuredocs/aci-helloworld:latest"), +// Cpu: pulumi.Float64(0.5), +// Memory: pulumi.Float64(1.5), +// Ports: containerservice.GroupContainerPortArray{ +// &containerservice.GroupContainerPortArgs{ +// Port: pulumi.Int(443), +// Protocol: pulumi.String("TCP"), +// }, +// }, +// }, +// &containerservice.GroupContainerArgs{ +// Name: pulumi.String("sidecar"), +// Image: pulumi.String("mcr.microsoft.com/azuredocs/aci-tutorial-sidecar"), +// Cpu: pulumi.Float64(0.5), +// Memory: pulumi.Float64(1.5), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("testing"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Group's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/kubernetesCluster.go b/sdk/go/azure/containerservice/kubernetesCluster.go index f5c8ac56e5..57edc30dca 100644 --- a/sdk/go/azure/containerservice/kubernetesCluster.go +++ b/sdk/go/azure/containerservice/kubernetesCluster.go @@ -15,6 +15,58 @@ import ( // Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service) // +// ## Example Usage +// +// This example provisions a basic Managed Kubernetes Cluster. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefix: pulumi.String("exampleaks1"), +// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{ +// Name: pulumi.String("default"), +// NodeCount: pulumi.Int(1), +// VmSize: pulumi.String("Standard_D2_v2"), +// }, +// Identity: &containerservice.KubernetesClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// ctx.Export("clientCertificate", exampleKubernetesCluster.KubeConfigs.ApplyT(func(kubeConfigs []containerservice.KubernetesClusterKubeConfig) (*string, error) { +// return &kubeConfigs[0].ClientCertificate, nil +// }).(pulumi.StringPtrOutput)) +// ctx.Export("kubeConfig", exampleKubernetesCluster.KubeConfigRaw) +// return nil +// }) +// } +// +// ``` +// // ## Import // // Managed Kubernetes Clusters can be imported using the `resource id`, e.g. @@ -160,6 +212,63 @@ type KubernetesCluster struct { // Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. // // > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ + // Location: pulumi.String("West Europe"), + // }) + // if err != nil { + // return err + // } + // exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // }) + // if err != nil { + // return err + // } + // exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // Location: exampleResourceGroup.Location, + // }) + // if err != nil { + // return err + // } + // exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ + // Scope: exampleZone.ID(), + // RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"), + // PrincipalId: exampleUserAssignedIdentity.PrincipalId, + // }) + // if err != nil { + // return err + // } + // _, err = containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ + // Location: exampleResourceGroup.Location, + // ResourceGroupName: exampleResourceGroup.Name, + // DnsPrefix: pulumi.String("aksexamplednsprefix1"), + // PrivateClusterEnabled: pulumi.Bool(true), + // PrivateDnsZoneId: exampleZone.ID(), + // }, pulumi.DependsOn([]pulumi.Resource{ + // exampleAssignment, + // })) + // if err != nil { + // return err + // } + // return nil + // }) + // } + // ``` PrivateClusterPublicFqdnEnabled pulumi.BoolPtrOutput `pulumi:"privateClusterPublicFqdnEnabled"` // Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. PrivateDnsZoneId pulumi.StringOutput `pulumi:"privateDnsZoneId"` @@ -383,6 +492,63 @@ type kubernetesClusterState struct { // Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. // // > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ + // Location: pulumi.String("West Europe"), + // }) + // if err != nil { + // return err + // } + // exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // }) + // if err != nil { + // return err + // } + // exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // Location: exampleResourceGroup.Location, + // }) + // if err != nil { + // return err + // } + // exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ + // Scope: exampleZone.ID(), + // RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"), + // PrincipalId: exampleUserAssignedIdentity.PrincipalId, + // }) + // if err != nil { + // return err + // } + // _, err = containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ + // Location: exampleResourceGroup.Location, + // ResourceGroupName: exampleResourceGroup.Name, + // DnsPrefix: pulumi.String("aksexamplednsprefix1"), + // PrivateClusterEnabled: pulumi.Bool(true), + // PrivateDnsZoneId: exampleZone.ID(), + // }, pulumi.DependsOn([]pulumi.Resource{ + // exampleAssignment, + // })) + // if err != nil { + // return err + // } + // return nil + // }) + // } + // ``` PrivateClusterPublicFqdnEnabled *bool `pulumi:"privateClusterPublicFqdnEnabled"` // Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. PrivateDnsZoneId *string `pulumi:"privateDnsZoneId"` @@ -564,6 +730,63 @@ type KubernetesClusterState struct { // Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. // // > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ + // Location: pulumi.String("West Europe"), + // }) + // if err != nil { + // return err + // } + // exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // }) + // if err != nil { + // return err + // } + // exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // Location: exampleResourceGroup.Location, + // }) + // if err != nil { + // return err + // } + // exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ + // Scope: exampleZone.ID(), + // RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"), + // PrincipalId: exampleUserAssignedIdentity.PrincipalId, + // }) + // if err != nil { + // return err + // } + // _, err = containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ + // Location: exampleResourceGroup.Location, + // ResourceGroupName: exampleResourceGroup.Name, + // DnsPrefix: pulumi.String("aksexamplednsprefix1"), + // PrivateClusterEnabled: pulumi.Bool(true), + // PrivateDnsZoneId: exampleZone.ID(), + // }, pulumi.DependsOn([]pulumi.Resource{ + // exampleAssignment, + // })) + // if err != nil { + // return err + // } + // return nil + // }) + // } + // ``` PrivateClusterPublicFqdnEnabled pulumi.BoolPtrInput // Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. PrivateDnsZoneId pulumi.StringPtrInput @@ -731,6 +954,63 @@ type kubernetesClusterArgs struct { // Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. // // > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ + // Location: pulumi.String("West Europe"), + // }) + // if err != nil { + // return err + // } + // exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // }) + // if err != nil { + // return err + // } + // exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // Location: exampleResourceGroup.Location, + // }) + // if err != nil { + // return err + // } + // exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ + // Scope: exampleZone.ID(), + // RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"), + // PrincipalId: exampleUserAssignedIdentity.PrincipalId, + // }) + // if err != nil { + // return err + // } + // _, err = containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ + // Location: exampleResourceGroup.Location, + // ResourceGroupName: exampleResourceGroup.Name, + // DnsPrefix: pulumi.String("aksexamplednsprefix1"), + // PrivateClusterEnabled: pulumi.Bool(true), + // PrivateDnsZoneId: exampleZone.ID(), + // }, pulumi.DependsOn([]pulumi.Resource{ + // exampleAssignment, + // })) + // if err != nil { + // return err + // } + // return nil + // }) + // } + // ``` PrivateClusterPublicFqdnEnabled *bool `pulumi:"privateClusterPublicFqdnEnabled"` // Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. PrivateDnsZoneId *string `pulumi:"privateDnsZoneId"` @@ -893,6 +1173,63 @@ type KubernetesClusterArgs struct { // Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. // // > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ + // Location: pulumi.String("West Europe"), + // }) + // if err != nil { + // return err + // } + // exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // }) + // if err != nil { + // return err + // } + // exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ + // ResourceGroupName: exampleResourceGroup.Name, + // Location: exampleResourceGroup.Location, + // }) + // if err != nil { + // return err + // } + // exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ + // Scope: exampleZone.ID(), + // RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"), + // PrincipalId: exampleUserAssignedIdentity.PrincipalId, + // }) + // if err != nil { + // return err + // } + // _, err = containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ + // Location: exampleResourceGroup.Location, + // ResourceGroupName: exampleResourceGroup.Name, + // DnsPrefix: pulumi.String("aksexamplednsprefix1"), + // PrivateClusterEnabled: pulumi.Bool(true), + // PrivateDnsZoneId: exampleZone.ID(), + // }, pulumi.DependsOn([]pulumi.Resource{ + // exampleAssignment, + // })) + // if err != nil { + // return err + // } + // return nil + // }) + // } + // ``` PrivateClusterPublicFqdnEnabled pulumi.BoolPtrInput // Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. PrivateDnsZoneId pulumi.StringPtrInput @@ -1348,6 +1685,66 @@ func (o KubernetesClusterOutput) PrivateClusterEnabled() pulumi.BoolPtrOutput { // Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. // // > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleZone.ID(), +// RoleDefinitionName: pulumi.String("Private DNS Zone Contributor"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefix: pulumi.String("aksexamplednsprefix1"), +// PrivateClusterEnabled: pulumi.Bool(true), +// PrivateDnsZoneId: exampleZone.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func (o KubernetesClusterOutput) PrivateClusterPublicFqdnEnabled() pulumi.BoolPtrOutput { return o.ApplyT(func(v *KubernetesCluster) pulumi.BoolPtrOutput { return v.PrivateClusterPublicFqdnEnabled }).(pulumi.BoolPtrOutput) } diff --git a/sdk/go/azure/containerservice/kubernetesClusterExtension.go b/sdk/go/azure/containerservice/kubernetesClusterExtension.go index eae4eba23f..cad2dfd29d 100644 --- a/sdk/go/azure/containerservice/kubernetesClusterExtension.go +++ b/sdk/go/azure/containerservice/kubernetesClusterExtension.go @@ -15,6 +15,56 @@ import ( // Manages a Kubernetes Cluster Extension. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: pulumi.String("West Europe"), +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefix: pulumi.String("example-aks"), +// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{ +// Name: pulumi.String("default"), +// NodeCount: pulumi.Int(1), +// VmSize: pulumi.String("Standard_DS2_v2"), +// }, +// Identity: &containerservice.KubernetesClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewKubernetesClusterExtension(ctx, "exampleKubernetesClusterExtension", &containerservice.KubernetesClusterExtensionArgs{ +// ClusterId: exampleKubernetesCluster.ID(), +// ExtensionType: pulumi.String("microsoft.flux"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/go/azure/containerservice/kubernetesClusterNodePool.go b/sdk/go/azure/containerservice/kubernetesClusterNodePool.go index 5db71fa7c2..13c43d356b 100644 --- a/sdk/go/azure/containerservice/kubernetesClusterNodePool.go +++ b/sdk/go/azure/containerservice/kubernetesClusterNodePool.go @@ -17,6 +17,63 @@ import ( // // > **NOTE:** Multiple Node Pools are only supported when the Kubernetes Cluster is using Virtual Machine Scale Sets. // +// ## Example Usage +// +// This example provisions a basic Kubernetes Node Pool. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefix: pulumi.String("exampleaks1"), +// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{ +// Name: pulumi.String("default"), +// NodeCount: pulumi.Int(1), +// VmSize: pulumi.String("Standard_D2_v2"), +// }, +// ServicePrincipal: &containerservice.KubernetesClusterServicePrincipalArgs{ +// ClientId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// ClientSecret: pulumi.String("00000000000000000000000000000000"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewKubernetesClusterNodePool(ctx, "exampleKubernetesClusterNodePool", &containerservice.KubernetesClusterNodePoolArgs{ +// KubernetesClusterId: exampleKubernetesCluster.ID(), +// VmSize: pulumi.String("Standard_DS2_v2"), +// NodeCount: pulumi.Int(1), +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kubernetes Cluster Node Pools can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/kubernetesFleetManager.go b/sdk/go/azure/containerservice/kubernetesFleetManager.go index ad337198d8..c3d3140caa 100644 --- a/sdk/go/azure/containerservice/kubernetesFleetManager.go +++ b/sdk/go/azure/containerservice/kubernetesFleetManager.go @@ -20,6 +20,39 @@ import ( // > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name FleetResourcePreview` and then `az provider register -n Microsoft.ContainerService` // . // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewKubernetesFleetManager(ctx, "exampleKubernetesFleetManager", &containerservice.KubernetesFleetManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // ## Blocks Reference // // ### `hubProfile` Block diff --git a/sdk/go/azure/containerservice/pulumiTypes.go b/sdk/go/azure/containerservice/pulumiTypes.go index 509ccfb80f..4bce4e7786 100644 --- a/sdk/go/azure/containerservice/pulumiTypes.go +++ b/sdk/go/azure/containerservice/pulumiTypes.go @@ -5677,6 +5677,37 @@ type KubernetesClusterAciConnectorLinux struct { // > **Note:** At this time ACI Connectors are not supported in Azure China. // // > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // _, err := network.NewSubnet(ctx, "virtual", &network.SubnetArgs{ + // Delegations: network.SubnetDelegationArray{ + // &network.SubnetDelegationArgs{ + // Name: pulumi.String("aciDelegation"), + // ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ + // Actions: pulumi.StringArray{ + // pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), + // }, + // Name: pulumi.String("Microsoft.ContainerInstance/containerGroups"), + // }, + // }, + // }, + // }) + // if err != nil { + // return err + // } + // return nil + // }) + // } + // ``` SubnetName string `pulumi:"subnetName"` } @@ -5699,6 +5730,37 @@ type KubernetesClusterAciConnectorLinuxArgs struct { // > **Note:** At this time ACI Connectors are not supported in Azure China. // // > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // _, err := network.NewSubnet(ctx, "virtual", &network.SubnetArgs{ + // Delegations: network.SubnetDelegationArray{ + // &network.SubnetDelegationArgs{ + // Name: pulumi.String("aciDelegation"), + // ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ + // Actions: pulumi.StringArray{ + // pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), + // }, + // Name: pulumi.String("Microsoft.ContainerInstance/containerGroups"), + // }, + // }, + // }, + // }) + // if err != nil { + // return err + // } + // return nil + // }) + // } + // ``` SubnetName pulumi.StringInput `pulumi:"subnetName"` } @@ -5809,6 +5871,40 @@ func (o KubernetesClusterAciConnectorLinuxOutput) ConnectorIdentities() Kubernet // > **Note:** At this time ACI Connectors are not supported in Azure China. // // > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := network.NewSubnet(ctx, "virtual", &network.SubnetArgs{ +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("aciDelegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), +// }, +// Name: pulumi.String("Microsoft.ContainerInstance/containerGroups"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func (o KubernetesClusterAciConnectorLinuxOutput) SubnetName() pulumi.StringOutput { return o.ApplyT(func(v KubernetesClusterAciConnectorLinux) string { return v.SubnetName }).(pulumi.StringOutput) } @@ -5858,6 +5954,40 @@ func (o KubernetesClusterAciConnectorLinuxPtrOutput) ConnectorIdentities() Kuber // > **Note:** At this time ACI Connectors are not supported in Azure China. // // > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := network.NewSubnet(ctx, "virtual", &network.SubnetArgs{ +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("aciDelegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), +// }, +// Name: pulumi.String("Microsoft.ContainerInstance/containerGroups"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func (o KubernetesClusterAciConnectorLinuxPtrOutput) SubnetName() pulumi.StringPtrOutput { return o.ApplyT(func(v *KubernetesClusterAciConnectorLinux) *string { if v == nil { diff --git a/sdk/go/azure/containerservice/registry.go b/sdk/go/azure/containerservice/registry.go index a7beee4415..8ead35d6f6 100644 --- a/sdk/go/azure/containerservice/registry.go +++ b/sdk/go/azure/containerservice/registry.go @@ -15,6 +15,180 @@ import ( // Manages an Azure Container Registry. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistry(ctx, "acr", &containerservice.RegistryArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// Sku: pulumi.String("Premium"), +// AdminEnabled: pulumi.Bool(false), +// Georeplications: containerservice.RegistryGeoreplicationArray{ +// &containerservice.RegistryGeoreplicationArgs{ +// Location: pulumi.String("East US"), +// ZoneRedundancyEnabled: pulumi.Bool(true), +// Tags: nil, +// }, +// &containerservice.RegistryGeoreplicationArgs{ +// Location: pulumi.String("North Europe"), +// ZoneRedundancyEnabled: pulumi.Bool(true), +// Tags: nil, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Encryption) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.LookupKey(ctx, &keyvault.LookupKeyArgs{ +// Name: "super-secret", +// KeyVaultId: data.Azurerm_key_vault.Existing.Id, +// }, nil) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistry(ctx, "acr", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Premium"), +// Identity: &containerservice.RegistryIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Encryption: &containerservice.RegistryEncryptionArgs{ +// Enabled: pulumi.Bool(true), +// KeyVaultKeyId: *pulumi.String(exampleKey.Id), +// IdentityClientId: exampleUserAssignedIdentity.ClientId, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Attaching A Container Registry To A Kubernetes Cluster) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRegistry, err := containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Premium"), +// }) +// if err != nil { +// return err +// } +// exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefix: pulumi.String("exampleaks1"), +// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{ +// Name: pulumi.String("default"), +// NodeCount: pulumi.Int(1), +// VmSize: pulumi.String("Standard_D2_v2"), +// }, +// Identity: &containerservice.KubernetesClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// PrincipalId: exampleKubernetesCluster.KubeletIdentity.ApplyT(func(kubeletIdentity containerservice.KubernetesClusterKubeletIdentity) (*string, error) { +// return &kubeletIdentity.ObjectId, nil +// }).(pulumi.StringPtrOutput), +// RoleDefinitionName: pulumi.String("AcrPull"), +// Scope: exampleRegistry.ID(), +// SkipServicePrincipalAadCheck: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/registryAgentPool.go b/sdk/go/azure/containerservice/registryAgentPool.go index cd88543a0a..9f1088d223 100644 --- a/sdk/go/azure/containerservice/registryAgentPool.go +++ b/sdk/go/azure/containerservice/registryAgentPool.go @@ -15,6 +15,49 @@ import ( // Manages an Azure Container Registry Agent Pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europ"), +// }) +// if err != nil { +// return err +// } +// exampleRegistry, err := containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Premium"), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistryAgentPool(ctx, "exampleRegistryAgentPool", &containerservice.RegistryAgentPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ContainerRegistryName: exampleRegistry.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Container Registry Agent Pool can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/registryScopeMap.go b/sdk/go/azure/containerservice/registryScopeMap.go index db5cdfe056..e82059b979 100644 --- a/sdk/go/azure/containerservice/registryScopeMap.go +++ b/sdk/go/azure/containerservice/registryScopeMap.go @@ -15,6 +15,59 @@ import ( // Manages an Azure Container Registry scope map. Scope Maps are a preview feature only available in Premium SKU Container registries. // +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRegistry, err := containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Premium"), +// AdminEnabled: pulumi.Bool(false), +// Georeplications: containerservice.RegistryGeoreplicationArray{ +// &containerservice.RegistryGeoreplicationArgs{ +// Location: pulumi.String("East US"), +// }, +// &containerservice.RegistryGeoreplicationArgs{ +// Location: pulumi.String("West Europe"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistryScopeMap(ctx, "exampleRegistryScopeMap", &containerservice.RegistryScopeMapArgs{ +// ContainerRegistryName: exampleRegistry.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Actions: pulumi.StringArray{ +// pulumi.String("repositories/repo1/content/read"), +// pulumi.String("repositories/repo1/content/write"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/registryTask.go b/sdk/go/azure/containerservice/registryTask.go index 585bf4b615..b73973625f 100644 --- a/sdk/go/azure/containerservice/registryTask.go +++ b/sdk/go/azure/containerservice/registryTask.go @@ -15,6 +15,58 @@ import ( // Manages a Container Registry Task. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRegistry, err := containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistryTask(ctx, "exampleRegistryTask", &containerservice.RegistryTaskArgs{ +// ContainerRegistryId: exampleRegistry.ID(), +// Platform: &containerservice.RegistryTaskPlatformArgs{ +// Os: pulumi.String("Linux"), +// }, +// DockerStep: &containerservice.RegistryTaskDockerStepArgs{ +// DockerfilePath: pulumi.String("Dockerfile"), +// ContextPath: pulumi.String("https://github.com//#:"), +// ContextAccessToken: pulumi.String(""), +// ImageNames: pulumi.StringArray{ +// pulumi.String("helloworld:{{.Run.ID}}"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Registry Tasks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/registryTaskScheduleRunNow.go b/sdk/go/azure/containerservice/registryTaskScheduleRunNow.go index 0ff8c487b8..63077a0d0f 100644 --- a/sdk/go/azure/containerservice/registryTaskScheduleRunNow.go +++ b/sdk/go/azure/containerservice/registryTaskScheduleRunNow.go @@ -14,6 +14,64 @@ import ( ) // Runs a Container Registry Task Schedule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRegistry, err := containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleRegistryTask, err := containerservice.NewRegistryTask(ctx, "exampleRegistryTask", &containerservice.RegistryTaskArgs{ +// ContainerRegistryId: exampleRegistry.ID(), +// Platform: &containerservice.RegistryTaskPlatformArgs{ +// Os: pulumi.String("Linux"), +// }, +// DockerStep: &containerservice.RegistryTaskDockerStepArgs{ +// DockerfilePath: pulumi.String("Dockerfile"), +// ContextPath: pulumi.String("https://github.com//acr-build-helloworld-node#main"), +// ContextAccessToken: pulumi.String(""), +// ImageNames: pulumi.StringArray{ +// pulumi.String("helloworld:{{.Run.ID}}"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistryTaskScheduleRunNow(ctx, "exampleRegistryTaskScheduleRunNow", &containerservice.RegistryTaskScheduleRunNowArgs{ +// ContainerRegistryTaskId: exampleRegistryTask.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type RegistryTaskScheduleRunNow struct { pulumi.CustomResourceState diff --git a/sdk/go/azure/containerservice/registryToken.go b/sdk/go/azure/containerservice/registryToken.go index b155f3c030..7dd00ff687 100644 --- a/sdk/go/azure/containerservice/registryToken.go +++ b/sdk/go/azure/containerservice/registryToken.go @@ -15,6 +15,67 @@ import ( // Manages an Azure Container Registry token. Tokens are a preview feature only available in Premium SKU Container registries. // +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRegistry, err := containerservice.NewRegistry(ctx, "exampleRegistry", &containerservice.RegistryArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Premium"), +// AdminEnabled: pulumi.Bool(false), +// Georeplications: containerservice.RegistryGeoreplicationArray{ +// &containerservice.RegistryGeoreplicationArgs{ +// Location: pulumi.String("East US"), +// }, +// &containerservice.RegistryGeoreplicationArgs{ +// Location: pulumi.String("West Europe"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleRegistryScopeMap, err := containerservice.NewRegistryScopeMap(ctx, "exampleRegistryScopeMap", &containerservice.RegistryScopeMapArgs{ +// ContainerRegistryName: exampleRegistry.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Actions: pulumi.StringArray{ +// pulumi.String("repositories/repo1/content/read"), +// pulumi.String("repositories/repo1/content/write"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistryToken(ctx, "exampleRegistryToken", &containerservice.RegistryTokenArgs{ +// ContainerRegistryName: exampleRegistry.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// ScopeMapId: exampleRegistryScopeMap.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/registryWebhook.go b/sdk/go/azure/containerservice/registryWebhook.go index ca2de49609..c5c057dbe9 100644 --- a/sdk/go/azure/containerservice/registryWebhook.go +++ b/sdk/go/azure/containerservice/registryWebhook.go @@ -15,6 +15,59 @@ import ( // Manages an Azure Container Registry Webhook. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// acr, err := containerservice.NewRegistry(ctx, "acr", &containerservice.RegistryArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// Sku: pulumi.String("Standard"), +// AdminEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistryWebhook(ctx, "webhook", &containerservice.RegistryWebhookArgs{ +// ResourceGroupName: example.Name, +// RegistryName: acr.Name, +// Location: example.Location, +// ServiceUri: pulumi.String("https://mywebhookreceiver.example/mytag"), +// Status: pulumi.String("enabled"), +// Scope: pulumi.String("mytag:*"), +// Actions: pulumi.StringArray{ +// pulumi.String("push"), +// }, +// CustomHeaders: pulumi.StringMap{ +// "Content-Type": pulumi.String("application/json"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/containerservice/registryWebook.go b/sdk/go/azure/containerservice/registryWebook.go index f3c50fae09..9632544501 100644 --- a/sdk/go/azure/containerservice/registryWebook.go +++ b/sdk/go/azure/containerservice/registryWebook.go @@ -15,6 +15,59 @@ import ( // Manages an Azure Container Registry Webhook. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// acr, err := containerservice.NewRegistry(ctx, "acr", &containerservice.RegistryArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// Sku: pulumi.String("Standard"), +// AdminEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = containerservice.NewRegistryWebhook(ctx, "webhook", &containerservice.RegistryWebhookArgs{ +// ResourceGroupName: example.Name, +// RegistryName: acr.Name, +// Location: example.Location, +// ServiceUri: pulumi.String("https://mywebhookreceiver.example/mytag"), +// Status: pulumi.String("enabled"), +// Scope: pulumi.String("mytag:*"), +// Actions: pulumi.StringArray{ +// pulumi.String("push"), +// }, +// CustomHeaders: pulumi.StringMap{ +// "Content-Type": pulumi.String("application/json"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/customProvider.go b/sdk/go/azure/core/customProvider.go index a3c7409fdc..fe546cfdae 100644 --- a/sdk/go/azure/core/customProvider.go +++ b/sdk/go/azure/core/customProvider.go @@ -15,6 +15,45 @@ import ( // Manages an Azure Custom Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = core.NewCustomProvider(ctx, "exampleCustomProvider", &core.CustomProviderArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ResourceTypes: core.CustomProviderResourceTypeArray{ +// &core.CustomProviderResourceTypeArgs{ +// Name: pulumi.String("dEf1"), +// Endpoint: pulumi.String("https://testendpoint.com/"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Custom Provider can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/getClientConfig.go b/sdk/go/azure/core/getClientConfig.go index 0f84979b18..b7f4093bf8 100644 --- a/sdk/go/azure/core/getClientConfig.go +++ b/sdk/go/azure/core/getClientConfig.go @@ -13,6 +13,31 @@ import ( ) // Use this data source to access the configuration of the AzureRM provider. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// ctx.Export("accountId", current.ClientId) +// return nil +// }) +// } +// +// ``` func GetClientConfig(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetClientConfigResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetClientConfigResult diff --git a/sdk/go/azure/core/getExtendedLocations.go b/sdk/go/azure/core/getExtendedLocations.go index 635ed6230c..30a67c8bbf 100644 --- a/sdk/go/azure/core/getExtendedLocations.go +++ b/sdk/go/azure/core/getExtendedLocations.go @@ -13,6 +13,32 @@ import ( ) // This data source return the available Extended Locations for a specific Azure Region. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.GetExtendedLocations(ctx, &core.GetExtendedLocationsArgs{ +// Location: "West Europe", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetExtendedLocations(ctx *pulumi.Context, args *GetExtendedLocationsArgs, opts ...pulumi.InvokeOption) (*GetExtendedLocationsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetExtendedLocationsResult diff --git a/sdk/go/azure/core/getResourceGroup.go b/sdk/go/azure/core/getResourceGroup.go index 1417eed53d..469eed3329 100644 --- a/sdk/go/azure/core/getResourceGroup.go +++ b/sdk/go/azure/core/getResourceGroup.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Resource Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{ +// Name: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupResourceGroup(ctx *pulumi.Context, args *LookupResourceGroupArgs, opts ...pulumi.InvokeOption) (*LookupResourceGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupResourceGroupResult diff --git a/sdk/go/azure/core/getSubscription.go b/sdk/go/azure/core/getSubscription.go index 48f2fa70c6..8ddc67cd67 100644 --- a/sdk/go/azure/core/getSubscription.go +++ b/sdk/go/azure/core/getSubscription.go @@ -13,6 +13,31 @@ import ( ) // Use this data source to access information about an existing Subscription. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// ctx.Export("currentSubscriptionDisplayName", current.DisplayName) +// return nil +// }) +// } +// +// ``` func LookupSubscription(ctx *pulumi.Context, args *LookupSubscriptionArgs, opts ...pulumi.InvokeOption) (*LookupSubscriptionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSubscriptionResult diff --git a/sdk/go/azure/core/getSubscriptions.go b/sdk/go/azure/core/getSubscriptions.go index a6843e0381..160d2f960a 100644 --- a/sdk/go/azure/core/getSubscriptions.go +++ b/sdk/go/azure/core/getSubscriptions.go @@ -13,6 +13,32 @@ import ( ) // Use this data source to access information about all the Subscriptions currently available. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// available, err := core.GetSubscriptions(ctx, nil, nil) +// if err != nil { +// return err +// } +// ctx.Export("availableSubscriptions", available.Subscriptions) +// ctx.Export("firstAvailableSubscriptionDisplayName", available.Subscriptions[0].DisplayName) +// return nil +// }) +// } +// +// ``` func GetSubscriptions(ctx *pulumi.Context, args *GetSubscriptionsArgs, opts ...pulumi.InvokeOption) (*GetSubscriptionsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetSubscriptionsResult diff --git a/sdk/go/azure/core/getTemplateSpecVersion.go b/sdk/go/azure/core/getTemplateSpecVersion.go index c770663639..2f53210c09 100644 --- a/sdk/go/azure/core/getTemplateSpecVersion.go +++ b/sdk/go/azure/core/getTemplateSpecVersion.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Template Spec Version. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.GetTemplateSpecVersion(ctx, &core.GetTemplateSpecVersionArgs{ +// Name: "exampleTemplateSpec", +// ResourceGroupName: "MyResourceGroup", +// Version: "v1.0.4", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetTemplateSpecVersion(ctx *pulumi.Context, args *GetTemplateSpecVersionArgs, opts ...pulumi.InvokeOption) (*GetTemplateSpecVersionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetTemplateSpecVersionResult diff --git a/sdk/go/azure/core/getUserAssignedIdentity.go b/sdk/go/azure/core/getUserAssignedIdentity.go index 595c529f35..b072fdc442 100644 --- a/sdk/go/azure/core/getUserAssignedIdentity.go +++ b/sdk/go/azure/core/getUserAssignedIdentity.go @@ -15,6 +15,35 @@ import ( // Use this data source to access information about an existing User Assigned Identity. // // ## Example Usage +// ### Reference An Existing) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := authorization.LookupUserAssignedIdentity(ctx, &authorization.LookupUserAssignedIdentityArgs{ +// Name: "name_of_user_assigned_identity", +// ResourceGroupName: "name_of_resource_group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("uaiClientId", example.ClientId) +// ctx.Export("uaiPrincipalId", example.PrincipalId) +// ctx.Export("uaiTenantId", example.TenantId) +// return nil +// }) +// } +// +// ``` // // Deprecated: azure.core.getUserAssignedIdentity has been deprecated in favor of azure.authorization.getUserAssignedIdentity func GetUserAssignedIdentity(ctx *pulumi.Context, args *GetUserAssignedIdentityArgs, opts ...pulumi.InvokeOption) (*GetUserAssignedIdentityResult, error) { diff --git a/sdk/go/azure/core/portalTenantConfiguration.go b/sdk/go/azure/core/portalTenantConfiguration.go index 734df0bf80..d629af66cf 100644 --- a/sdk/go/azure/core/portalTenantConfiguration.go +++ b/sdk/go/azure/core/portalTenantConfiguration.go @@ -23,6 +23,32 @@ import ( // // > **Note:** While assigning the role to the existing/new Service Principal at the Tenant Scope, the user assigning role must already have the `Owner` role assigned at the Tenant Scope. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewPortalTenantConfiguration(ctx, "example", &core.PortalTenantConfigurationArgs{ +// PrivateMarkdownStorageEnforced: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Portal Tenant Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceDeploymentScriptAzureCli.go b/sdk/go/azure/core/resourceDeploymentScriptAzureCli.go index 682d3494d1..e47afed8dc 100644 --- a/sdk/go/azure/core/resourceDeploymentScriptAzureCli.go +++ b/sdk/go/azure/core/resourceDeploymentScriptAzureCli.go @@ -15,6 +15,63 @@ import ( // Manages a Resource Deployment Script of Azure Cli. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourceDeploymentScriptAzureCli(ctx, "exampleResourceDeploymentScriptAzureCli", &core.ResourceDeploymentScriptAzureCliArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// Version: pulumi.String("2.40.0"), +// RetentionInterval: pulumi.String("P1D"), +// CommandLine: pulumi.String("'foo' 'bar'"), +// CleanupPreference: pulumi.String("OnSuccess"), +// ForceUpdateTag: pulumi.String("1"), +// Timeout: pulumi.String("PT30M"), +// ScriptContent: pulumi.String(" echo \"{\\\"name\\\":{\\\"displayName\\\":\\\"$1 $2\\\"}}\" > $AZ_SCRIPTS_OUTPUT_PATH\n"), +// Identity: &core.ResourceDeploymentScriptAzureCliIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceDeploymentScriptPowerShell.go b/sdk/go/azure/core/resourceDeploymentScriptPowerShell.go index a6702ba917..1d60922897 100644 --- a/sdk/go/azure/core/resourceDeploymentScriptPowerShell.go +++ b/sdk/go/azure/core/resourceDeploymentScriptPowerShell.go @@ -15,6 +15,70 @@ import ( // Manages a Resource Deployment Script of Azure PowerShell. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourceDeploymentScriptPowerShell(ctx, "exampleResourceDeploymentScriptPowerShell", &core.ResourceDeploymentScriptPowerShellArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// Version: pulumi.String("8.3"), +// RetentionInterval: pulumi.String("P1D"), +// CommandLine: pulumi.String("-name \"John Dole\""), +// CleanupPreference: pulumi.String("OnSuccess"), +// ForceUpdateTag: pulumi.String("1"), +// Timeout: pulumi.String("PT30M"), +// ScriptContent: pulumi.String(` param([string] $name) +// $output = 'Hello {0}.' -f $name +// Write-Output $output +// $DeploymentScriptOutputs = @{} +// $DeploymentScriptOutputs['text'] = $output +// +// `), +// +// Identity: &core.ResourceDeploymentScriptPowerShellIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceGroup.go b/sdk/go/azure/core/resourceGroup.go index 7dcd54136d..587be7ad72 100644 --- a/sdk/go/azure/core/resourceGroup.go +++ b/sdk/go/azure/core/resourceGroup.go @@ -12,6 +12,32 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceGroupCostManagementExport.go b/sdk/go/azure/core/resourceGroupCostManagementExport.go index abfea45776..3d48c6bf78 100644 --- a/sdk/go/azure/core/resourceGroupCostManagementExport.go +++ b/sdk/go/azure/core/resourceGroupCostManagementExport.go @@ -15,6 +15,65 @@ import ( // Manages a Cost Management Export for a Resource Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourceGroupCostManagementExport(ctx, "exampleResourceGroupCostManagementExport", &core.ResourceGroupCostManagementExportArgs{ +// ResourceGroupId: exampleResourceGroup.ID(), +// RecurrenceType: pulumi.String("Monthly"), +// RecurrencePeriodStartDate: pulumi.String("2020-08-18T00:00:00Z"), +// RecurrencePeriodEndDate: pulumi.String("2020-09-18T00:00:00Z"), +// ExportDataStorageLocation: &core.ResourceGroupCostManagementExportExportDataStorageLocationArgs{ +// ContainerId: exampleContainer.ResourceManagerId, +// RootFolderPath: pulumi.String("/root/updated"), +// }, +// ExportDataOptions: &core.ResourceGroupCostManagementExportExportDataOptionsArgs{ +// Type: pulumi.String("Usage"), +// TimeFrame: pulumi.String("WeekToDate"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cost Management Export for a Resource Group can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceGroupCostManagementView.go b/sdk/go/azure/core/resourceGroupCostManagementView.go index 62445f40cb..8de46510a6 100644 --- a/sdk/go/azure/core/resourceGroupCostManagementView.go +++ b/sdk/go/azure/core/resourceGroupCostManagementView.go @@ -15,6 +15,52 @@ import ( // Manages an Azure Cost Management View for a Resource Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourceGroupCostManagementView(ctx, "exampleResourceGroupCostManagementView", &core.ResourceGroupCostManagementViewArgs{ +// DisplayName: pulumi.String("Cost View per Month"), +// ChartType: pulumi.String("StackedColumn"), +// Accumulated: pulumi.Bool(false), +// ResourceGroupId: exampleResourceGroup.ID(), +// ReportType: pulumi.String("Usage"), +// Timeframe: pulumi.String("MonthToDate"), +// Dataset: &core.ResourceGroupCostManagementViewDatasetArgs{ +// Granularity: pulumi.String("Monthly"), +// Aggregations: core.ResourceGroupCostManagementViewDatasetAggregationArray{ +// &core.ResourceGroupCostManagementViewDatasetAggregationArgs{ +// Name: pulumi.String("totalCost"), +// ColumnName: pulumi.String("Cost"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cost Management View for a Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceGroupPolicyAssignment.go b/sdk/go/azure/core/resourceGroupPolicyAssignment.go index c423f48ea9..3a8ce91abd 100644 --- a/sdk/go/azure/core/resourceGroupPolicyAssignment.go +++ b/sdk/go/azure/core/resourceGroupPolicyAssignment.go @@ -15,6 +15,73 @@ import ( // Manages a Resource Group Policy Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleDefinition, err := policy.NewDefinition(ctx, "exampleDefinition", &policy.DefinitionArgs{ +// PolicyType: pulumi.String("Custom"), +// Mode: pulumi.String("All"), +// DisplayName: pulumi.String("my-policy-definition"), +// PolicyRule: pulumi.String(` { +// "if": { +// "not": { +// "field": "location", +// "equals": "westeurope" +// } +// }, +// "then": { +// "effect": "Deny" +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourceGroupPolicyAssignment(ctx, "exampleResourceGroupPolicyAssignment", &core.ResourceGroupPolicyAssignmentArgs{ +// ResourceGroupId: exampleResourceGroup.ID(), +// PolicyDefinitionId: exampleDefinition.ID(), +// Parameters: pulumi.String(` { +// "tagName": { +// "value": "Business Unit" +// }, +// "tagValue": { +// "value": "BU" +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceGroupPolicyExemption.go b/sdk/go/azure/core/resourceGroupPolicyExemption.go index 72732ad967..e758b3a38d 100644 --- a/sdk/go/azure/core/resourceGroupPolicyExemption.go +++ b/sdk/go/azure/core/resourceGroupPolicyExemption.go @@ -15,6 +15,71 @@ import ( // Manages a Resource Group Policy Exemption. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("westus"), +// }) +// if err != nil { +// return err +// } +// examplePolicyDefintion, err := policy.GetPolicyDefintion(ctx, &policy.GetPolicyDefintionArgs{ +// DisplayName: pulumi.StringRef("Allowed locations"), +// }, nil) +// if err != nil { +// return err +// } +// exampleResourceGroupPolicyAssignment, err := core.NewResourceGroupPolicyAssignment(ctx, "exampleResourceGroupPolicyAssignment", &core.ResourceGroupPolicyAssignmentArgs{ +// ResourceGroupId: exampleResourceGroup.ID(), +// PolicyDefinitionId: *pulumi.String(examplePolicyDefintion.Id), +// Parameters: exampleResourceGroup.Location.ApplyT(func(location string) (pulumi.String, error) { +// var _zero pulumi.String +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "listOfAllowedLocations": map[string]interface{}{ +// "value": []string{ +// location, +// }, +// }, +// }) +// if err != nil { +// return _zero, err +// } +// json0 := string(tmpJSON0) +// return pulumi.String(json0), nil +// }).(pulumi.StringOutput), +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourceGroupPolicyExemption(ctx, "exampleResourceGroupPolicyExemption", &core.ResourceGroupPolicyExemptionArgs{ +// ResourceGroupId: exampleResourceGroup.ID(), +// PolicyAssignmentId: exampleResourceGroupPolicyAssignment.ID(), +// ExemptionCategory: pulumi.String("Mitigated"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourcePolicyAssignment.go b/sdk/go/azure/core/resourcePolicyAssignment.go index c41dab62e1..85affac32f 100644 --- a/sdk/go/azure/core/resourcePolicyAssignment.go +++ b/sdk/go/azure/core/resourcePolicyAssignment.go @@ -15,6 +15,64 @@ import ( // Manages a Policy Assignment to a Resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleVirtualNetwork, err := network.LookupVirtualNetwork(ctx, &network.LookupVirtualNetworkArgs{ +// Name: "production", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// exampleDefinition, err := policy.NewDefinition(ctx, "exampleDefinition", &policy.DefinitionArgs{ +// PolicyType: pulumi.String("Custom"), +// Mode: pulumi.String("All"), +// DisplayName: pulumi.String("my-policy-definition"), +// PolicyRule: pulumi.String(` { +// "if": { +// "not": { +// "field": "location", +// "equals": "westeurope" +// } +// }, +// "then": { +// "effect": "Deny" +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourcePolicyAssignment(ctx, "exampleResourcePolicyAssignment", &core.ResourcePolicyAssignmentArgs{ +// ResourceId: *pulumi.String(exampleVirtualNetwork.Id), +// PolicyDefinitionId: exampleDefinition.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourcePolicyExemption.go b/sdk/go/azure/core/resourcePolicyExemption.go index 60734a7931..87ef2ec25e 100644 --- a/sdk/go/azure/core/resourcePolicyExemption.go +++ b/sdk/go/azure/core/resourcePolicyExemption.go @@ -15,6 +15,69 @@ import ( // Manages a Resource Policy Exemption. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("westus"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePolicySetDefinition, err := policy.LookupPolicySetDefinition(ctx, &policy.LookupPolicySetDefinitionArgs{ +// DisplayName: pulumi.StringRef("Audit machines with insecure password security settings"), +// }, nil) +// if err != nil { +// return err +// } +// exampleResourcePolicyAssignment, err := core.NewResourcePolicyAssignment(ctx, "exampleResourcePolicyAssignment", &core.ResourcePolicyAssignmentArgs{ +// ResourceId: exampleVirtualNetwork.ID(), +// PolicyDefinitionId: *pulumi.String(examplePolicySetDefinition.Id), +// Location: exampleResourceGroup.Location, +// Identity: &core.ResourcePolicyAssignmentIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourcePolicyExemption(ctx, "exampleResourcePolicyExemption", &core.ResourcePolicyExemptionArgs{ +// ResourceId: exampleResourcePolicyAssignment.ResourceId, +// PolicyAssignmentId: exampleResourcePolicyAssignment.ID(), +// ExemptionCategory: pulumi.String("Mitigated"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/resourceProviderRegistration.go b/sdk/go/azure/core/resourceProviderRegistration.go index 1f60d314f6..35f944b731 100644 --- a/sdk/go/azure/core/resourceProviderRegistration.go +++ b/sdk/go/azure/core/resourceProviderRegistration.go @@ -20,6 +20,60 @@ import ( // // > **Note:** Adding or Removing a Preview Feature will re-register the Resource Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewResourceProviderRegistration(ctx, "example", nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Registering A Preview Feature) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewResourceProviderRegistration(ctx, "example", &core.ResourceProviderRegistrationArgs{ +// Features: core.ResourceProviderRegistrationFeatureArray{ +// &core.ResourceProviderRegistrationFeatureArgs{ +// Name: pulumi.String("AKS-DataPlaneAutoApprove"), +// Registered: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Provider Registrations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/subscription.go b/sdk/go/azure/core/subscription.go index 7f4af4f0f8..8da5f993d1 100644 --- a/sdk/go/azure/core/subscription.go +++ b/sdk/go/azure/core/subscription.go @@ -14,6 +14,136 @@ import ( ) // ## Example Usage +// ### Creating A New Alias And Subscription For An Enrollment Account +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/billing" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleEnrollmentAccountScope, err := billing.GetEnrollmentAccountScope(ctx, &billing.GetEnrollmentAccountScopeArgs{ +// BillingAccountName: "1234567890", +// EnrollmentAccountName: "0123456", +// }, nil) +// if err != nil { +// return err +// } +// _, err = core.NewSubscription(ctx, "exampleSubscription", &core.SubscriptionArgs{ +// SubscriptionName: pulumi.String("My Example EA Subscription"), +// BillingScopeId: *pulumi.String(exampleEnrollmentAccountScope.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Creating A New Alias And Subscription For A Microsoft Customer Account +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/billing" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleMcaAccountScope, err := billing.GetMcaAccountScope(ctx, &billing.GetMcaAccountScopeArgs{ +// BillingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", +// BillingProfileName: "PE2Q-NOIT-BG7-TGB", +// InvoiceSectionName: "MTT4-OBS7-PJA-TGB", +// }, nil) +// if err != nil { +// return err +// } +// _, err = core.NewSubscription(ctx, "exampleSubscription", &core.SubscriptionArgs{ +// SubscriptionName: pulumi.String("My Example MCA Subscription"), +// BillingScopeId: *pulumi.String(exampleMcaAccountScope.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Creating A New Alias And Subscription For A Microsoft Partner Account +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/billing" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleMpaAccountScope, err := billing.GetMpaAccountScope(ctx, &billing.GetMpaAccountScopeArgs{ +// BillingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", +// CustomerName: "2281f543-7321-4cf9-1e23-edb4Oc31a31c", +// }, nil) +// if err != nil { +// return err +// } +// _, err = core.NewSubscription(ctx, "exampleSubscription", &core.SubscriptionArgs{ +// SubscriptionName: pulumi.String("My Example MPA Subscription"), +// BillingScopeId: *pulumi.String(exampleMpaAccountScope.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Adding An Alias To An Existing Subscription +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewSubscription(ctx, "example", &core.SubscriptionArgs{ +// Alias: pulumi.String("examplesub"), +// SubscriptionId: pulumi.String("12345678-12234-5678-9012-123456789012"), +// SubscriptionName: pulumi.String("My Example Subscription"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/core/subscriptionCostManagementExport.go b/sdk/go/azure/core/subscriptionCostManagementExport.go index 4e8e17c50d..636f26753f 100644 --- a/sdk/go/azure/core/subscriptionCostManagementExport.go +++ b/sdk/go/azure/core/subscriptionCostManagementExport.go @@ -15,6 +15,69 @@ import ( // Manages a Cost Management Export for a Subscription. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleSubscription, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = core.NewSubscriptionCostManagementExport(ctx, "exampleSubscriptionCostManagementExport", &core.SubscriptionCostManagementExportArgs{ +// SubscriptionId: *pulumi.String(exampleSubscription.Id), +// RecurrenceType: pulumi.String("Monthly"), +// RecurrencePeriodStartDate: pulumi.String("2020-08-18T00:00:00Z"), +// RecurrencePeriodEndDate: pulumi.String("2020-09-18T00:00:00Z"), +// ExportDataStorageLocation: &core.SubscriptionCostManagementExportExportDataStorageLocationArgs{ +// ContainerId: exampleContainer.ResourceManagerId, +// RootFolderPath: pulumi.String("/root/updated"), +// }, +// ExportDataOptions: &core.SubscriptionCostManagementExportExportDataOptionsArgs{ +// Type: pulumi.String("Usage"), +// TimeFrame: pulumi.String("WeekToDate"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subscription Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/subscriptionCostManagementView.go b/sdk/go/azure/core/subscriptionCostManagementView.go index ad179309e3..1d4cfe18ac 100644 --- a/sdk/go/azure/core/subscriptionCostManagementView.go +++ b/sdk/go/azure/core/subscriptionCostManagementView.go @@ -15,6 +15,46 @@ import ( // Manages an Azure Cost Management View for a Subscription. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewSubscriptionCostManagementView(ctx, "example", &core.SubscriptionCostManagementViewArgs{ +// Accumulated: pulumi.Bool(false), +// ChartType: pulumi.String("StackedColumn"), +// Dataset: &core.SubscriptionCostManagementViewDatasetArgs{ +// Aggregations: core.SubscriptionCostManagementViewDatasetAggregationArray{ +// &core.SubscriptionCostManagementViewDatasetAggregationArgs{ +// ColumnName: pulumi.String("Cost"), +// Name: pulumi.String("totalCost"), +// }, +// }, +// Granularity: pulumi.String("Monthly"), +// }, +// DisplayName: pulumi.String("Cost View per Month"), +// ReportType: pulumi.String("Usage"), +// SubscriptionId: pulumi.String("/subscription/00000000-0000-0000-0000-000000000000"), +// Timeframe: pulumi.String("MonthToDate"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cost Management View for a Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/subscriptionPolicyAssignment.go b/sdk/go/azure/core/subscriptionPolicyAssignment.go index 94b42a50ed..6713462361 100644 --- a/sdk/go/azure/core/subscriptionPolicyAssignment.go +++ b/sdk/go/azure/core/subscriptionPolicyAssignment.go @@ -15,6 +15,60 @@ import ( // Manages a Subscription Policy Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleDefinition, err := policy.NewDefinition(ctx, "exampleDefinition", &policy.DefinitionArgs{ +// PolicyType: pulumi.String("Custom"), +// Mode: pulumi.String("All"), +// DisplayName: pulumi.String("Allowed resource types"), +// PolicyRule: pulumi.String(` { +// "if": { +// "not": { +// "field": "location", +// "equals": "westeurope" +// } +// }, +// "then": { +// "effect": "Deny" +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// _, err = core.NewSubscriptionPolicyAssignment(ctx, "exampleSubscriptionPolicyAssignment", &core.SubscriptionPolicyAssignmentArgs{ +// PolicyDefinitionId: exampleDefinition.ID(), +// SubscriptionId: *pulumi.String(current.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subscription Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/subscriptionPolicyExemption.go b/sdk/go/azure/core/subscriptionPolicyExemption.go index c28c97c9f6..5fea2de28a 100644 --- a/sdk/go/azure/core/subscriptionPolicyExemption.go +++ b/sdk/go/azure/core/subscriptionPolicyExemption.go @@ -15,6 +15,56 @@ import ( // Manages a Subscription Policy Exemption. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleSubscription, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// examplePolicySetDefinition, err := policy.LookupPolicySetDefinition(ctx, &policy.LookupPolicySetDefinitionArgs{ +// DisplayName: pulumi.StringRef("Audit machines with insecure password security settings"), +// }, nil) +// if err != nil { +// return err +// } +// exampleSubscriptionPolicyAssignment, err := core.NewSubscriptionPolicyAssignment(ctx, "exampleSubscriptionPolicyAssignment", &core.SubscriptionPolicyAssignmentArgs{ +// SubscriptionId: *pulumi.String(exampleSubscription.Id), +// PolicyDefinitionId: *pulumi.String(examplePolicySetDefinition.Id), +// Location: pulumi.String("westus"), +// Identity: &core.SubscriptionPolicyAssignmentIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = core.NewSubscriptionPolicyExemption(ctx, "exampleSubscriptionPolicyExemption", &core.SubscriptionPolicyExemptionArgs{ +// SubscriptionId: *pulumi.String(exampleSubscription.Id), +// PolicyAssignmentId: exampleSubscriptionPolicyAssignment.ID(), +// ExemptionCategory: pulumi.String("Mitigated"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/subscriptionTemplateDeployment.go b/sdk/go/azure/core/subscriptionTemplateDeployment.go index dea04c6dff..bcca22e9dc 100644 --- a/sdk/go/azure/core/subscriptionTemplateDeployment.go +++ b/sdk/go/azure/core/subscriptionTemplateDeployment.go @@ -14,6 +14,50 @@ import ( // Manages a Subscription Template Deployment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewSubscriptionTemplateDeployment(ctx, "example", &core.SubscriptionTemplateDeploymentArgs{ +// Location: pulumi.String("West Europe"), +// TemplateContent: pulumi.String(` { +// "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", +// "contentVersion": "1.0.0.0", +// "parameters": {}, +// "variables": {}, +// "resources": [ +// { +// "type": "Microsoft.Resources/resourceGroups", +// "apiVersion": "2018-05-01", +// "location": "West Europe", +// "name": "some-resource-group", +// "properties": {} +// } +// ] +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subscription Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/core/templateDeployment.go b/sdk/go/azure/core/templateDeployment.go index a81a769208..71f64e01d4 100644 --- a/sdk/go/azure/core/templateDeployment.go +++ b/sdk/go/azure/core/templateDeployment.go @@ -19,6 +19,104 @@ import ( // This means that when deleting the `core.TemplateDeployment` resource, this provider will only remove the reference to the deployment, whilst leaving any resources created by that ARM Template Deployment. // One workaround for this is to use a unique Resource Group for each ARM Template Deployment, which means deleting the Resource Group would contain any resources created within it - however this isn't ideal. [More information](https://docs.microsoft.com/en-us/rest/api/resources/deployments#Deployments_Delete). // +// ## Example Usage +// +// > **Note:** This example uses Storage Accounts and Public IP's which are natively supported by this provider - we'd highly recommend using the Native Resources where possible instead rather than an ARM Template, for the reasons outlined above. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleTemplateDeployment, err := core.NewTemplateDeployment(ctx, "exampleTemplateDeployment", &core.TemplateDeploymentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// TemplateBody: pulumi.String(`{ +// "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", +// "contentVersion": "1.0.0.0", +// "parameters": { +// "storageAccountType": { +// "type": "string", +// "defaultValue": "Standard_LRS", +// "allowedValues": [ +// "Standard_LRS", +// "Standard_GRS", +// "Standard_ZRS" +// ], +// "metadata": { +// "description": "Storage Account type" +// } +// } +// }, +// "variables": { +// "location": "[resourceGroup().location]", +// "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'storage')]", +// "publicIPAddressName": "[concat('myPublicIp', uniquestring(resourceGroup().id))]", +// "publicIPAddressType": "Dynamic", +// "apiVersion": "2015-06-15", +// "dnsLabelPrefix": "example-acctest" +// }, +// "resources": [ +// { +// "type": "Microsoft.Storage/storageAccounts", +// "name": "[variables('storageAccountName')]", +// "apiVersion": "[variables('apiVersion')]", +// "location": "[variables('location')]", +// "properties": { +// "accountType": "[parameters('storageAccountType')]" +// } +// }, +// { +// "type": "Microsoft.Network/publicIPAddresses", +// "apiVersion": "[variables('apiVersion')]", +// "name": "[variables('publicIPAddressName')]", +// "location": "[variables('location')]", +// "properties": { +// "publicIPAllocationMethod": "[variables('publicIPAddressType')]", +// "dnsSettings": { +// "domainNameLabel": "[variables('dnsLabelPrefix')]" +// } +// } +// } +// ], +// "outputs": { +// "storageAccountName": { +// "type": "string", +// "value": "[variables('storageAccountName')]" +// } +// } +// } +// +// `), +// +// Parameters: pulumi.StringMap{ +// "storageAccountType": pulumi.String("Standard_GRS"), +// }, +// DeploymentMode: pulumi.String("Incremental"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("storageAccountName", exampleTemplateDeployment.Outputs.ApplyT(func(outputs map[string]string) (string, error) { +// return outputs.StorageAccountName, nil +// }).(pulumi.StringOutput)) +// return nil +// }) +// } +// +// ``` // ## Note // // This provider does not know about the individual resources created by Azure using a deployment template and therefore cannot delete these resources during a destroy. Destroying a template deployment removes the associated deployment operations, but will not delete the Azure resources created by the deployment. In order to delete these resources, the containing resource group must also be destroyed. [More information](https://docs.microsoft.com/rest/api/resources/deployments#Deployments_Delete). diff --git a/sdk/go/azure/core/tenantTemplateDeployment.go b/sdk/go/azure/core/tenantTemplateDeployment.go index 0df820d995..c36903bbb8 100644 --- a/sdk/go/azure/core/tenantTemplateDeployment.go +++ b/sdk/go/azure/core/tenantTemplateDeployment.go @@ -12,6 +12,41 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleTemplateSpecVersion, err := core.GetTemplateSpecVersion(ctx, &core.GetTemplateSpecVersionArgs{ +// Name: "myTemplateForTenant", +// ResourceGroupName: "myResourceGroup", +// Version: "v0.1", +// }, nil) +// if err != nil { +// return err +// } +// _, err = core.NewTenantTemplateDeployment(ctx, "exampleTenantTemplateDeployment", &core.TenantTemplateDeploymentArgs{ +// Location: pulumi.String("West Europe"), +// TemplateSpecVersionId: *pulumi.String(exampleTemplateSpecVersion.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Tenant Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/account.go b/sdk/go/azure/cosmosdb/account.go index e22aad637b..a4977b2151 100644 --- a/sdk/go/azure/cosmosdb/account.go +++ b/sdk/go/azure/cosmosdb/account.go @@ -15,6 +15,80 @@ import ( // Manages a CosmosDB (formally DocumentDB) Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{ +// Location: pulumi.String("westus"), +// }) +// if err != nil { +// return err +// } +// _, err = random.NewRandomInteger(ctx, "ri", &random.RandomIntegerArgs{ +// Min: pulumi.Int(10000), +// Max: pulumi.Int(99999), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewAccount(ctx, "db", &cosmosdb.AccountArgs{ +// Location: pulumi.Any(azurerm_resource_group.Example.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name), +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("MongoDB"), +// EnableAutomaticFailover: pulumi.Bool(true), +// Capabilities: cosmosdb.AccountCapabilityArray{ +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableAggregationPipeline"), +// }, +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("mongoEnableDocLevelTTL"), +// }, +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("MongoDBv3.4"), +// }, +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableMongo"), +// }, +// }, +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("BoundedStaleness"), +// MaxIntervalInSeconds: pulumi.Int(300), +// MaxStalenessPrefix: pulumi.Int(100000), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: pulumi.String("eastus"), +// FailoverPriority: pulumi.Int(1), +// }, +// &cosmosdb.AccountGeoLocationArgs{ +// Location: pulumi.String("westus"), +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CosmosDB Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/cassandraCluster.go b/sdk/go/azure/cosmosdb/cassandraCluster.go index bed6382faa..51052c5570 100644 --- a/sdk/go/azure/cosmosdb/cassandraCluster.go +++ b/sdk/go/azure/cosmosdb/cassandraCluster.go @@ -17,6 +17,98 @@ import ( // // > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: // +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("Azure Cosmos DB"), +// }, nil) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleVirtualNetwork.ID(), +// RoleDefinitionName: pulumi.String("Network Contributor"), +// PrincipalId: *pulumi.String(exampleServicePrincipal.ObjectId), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewCassandraCluster(ctx, "exampleCassandraCluster", &cosmosdb.CassandraClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DelegatedManagementSubnetId: exampleSubnet.ID(), +// DefaultAdminPassword: pulumi.String("Password1234"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cassandra Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/cassandraDatacenter.go b/sdk/go/azure/cosmosdb/cassandraDatacenter.go index ee4f5340e7..0e8c9c81d4 100644 --- a/sdk/go/azure/cosmosdb/cassandraDatacenter.go +++ b/sdk/go/azure/cosmosdb/cassandraDatacenter.go @@ -17,6 +17,110 @@ import ( // // > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: // +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("Azure Cosmos DB"), +// }, nil) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleVirtualNetwork.ID(), +// RoleDefinitionName: pulumi.String("Network Contributor"), +// PrincipalId: *pulumi.String(exampleServicePrincipal.ObjectId), +// }) +// if err != nil { +// return err +// } +// exampleCassandraCluster, err := cosmosdb.NewCassandraCluster(ctx, "exampleCassandraCluster", &cosmosdb.CassandraClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DelegatedManagementSubnetId: exampleSubnet.ID(), +// DefaultAdminPassword: pulumi.String("Password1234"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewCassandraDatacenter(ctx, "exampleCassandraDatacenter", &cosmosdb.CassandraDatacenterArgs{ +// Location: exampleCassandraCluster.Location, +// CassandraClusterId: exampleCassandraCluster.ID(), +// DelegatedManagementSubnetId: exampleSubnet.ID(), +// NodeCount: pulumi.Int(3), +// DiskCount: pulumi.Int(4), +// SkuName: pulumi.String("Standard_DS14_v2"), +// AvailabilityZonesEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cassandra Datacenters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/cassandraKeyspace.go b/sdk/go/azure/cosmosdb/cassandraKeyspace.go index 23bd813824..8a9972d8ee 100644 --- a/sdk/go/azure/cosmosdb/cassandraKeyspace.go +++ b/sdk/go/azure/cosmosdb/cassandraKeyspace.go @@ -15,6 +15,63 @@ import ( // Manages a Cassandra KeySpace within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OfferType: pulumi.String("Standard"), +// Capabilities: cosmosdb.AccountCapabilityArray{ +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableCassandra"), +// }, +// }, +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewCassandraKeyspace(ctx, "exampleCassandraKeyspace", &cosmosdb.CassandraKeyspaceArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos Cassandra KeySpace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/cassandraTable.go b/sdk/go/azure/cosmosdb/cassandraTable.go index 5886752b9f..05acd20c69 100644 --- a/sdk/go/azure/cosmosdb/cassandraTable.go +++ b/sdk/go/azure/cosmosdb/cassandraTable.go @@ -15,6 +15,86 @@ import ( // Manages a Cassandra Table within a Cosmos DB Cassandra Keyspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OfferType: pulumi.String("Standard"), +// Capabilities: cosmosdb.AccountCapabilityArray{ +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableCassandra"), +// }, +// }, +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleCassandraKeyspace, err := cosmosdb.NewCassandraKeyspace(ctx, "exampleCassandraKeyspace", &cosmosdb.CassandraKeyspaceArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewCassandraTable(ctx, "exampleCassandraTable", &cosmosdb.CassandraTableArgs{ +// CassandraKeyspaceId: exampleCassandraKeyspace.ID(), +// Schema: &cosmosdb.CassandraTableSchemaArgs{ +// Columns: cosmosdb.CassandraTableSchemaColumnArray{ +// &cosmosdb.CassandraTableSchemaColumnArgs{ +// Name: pulumi.String("test1"), +// Type: pulumi.String("ascii"), +// }, +// &cosmosdb.CassandraTableSchemaColumnArgs{ +// Name: pulumi.String("test2"), +// Type: pulumi.String("int"), +// }, +// }, +// PartitionKeys: cosmosdb.CassandraTableSchemaPartitionKeyArray{ +// &cosmosdb.CassandraTableSchemaPartitionKeyArgs{ +// Name: pulumi.String("test1"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos Cassandra Table can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/getAccount.go b/sdk/go/azure/cosmosdb/getAccount.go index 21c8afe893..7670d748c7 100644 --- a/sdk/go/azure/cosmosdb/getAccount.go +++ b/sdk/go/azure/cosmosdb/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("cosmosdbAccountEndpoint", example.Endpoint) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/cosmosdb/getMongoDatabase.go b/sdk/go/azure/cosmosdb/getMongoDatabase.go index e9e7348a9b..1d3d6ed353 100644 --- a/sdk/go/azure/cosmosdb/getMongoDatabase.go +++ b/sdk/go/azure/cosmosdb/getMongoDatabase.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Cosmos DB Mongo Database. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := cosmosdb.LookupMongoDatabase(ctx, &cosmosdb.LookupMongoDatabaseArgs{ +// Name: "test-cosmosdb-mongo-db", +// ResourceGroupName: "test-cosmosdb-account-rg", +// AccountName: "test-cosmosdb-account", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupMongoDatabase(ctx *pulumi.Context, args *LookupMongoDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupMongoDatabaseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupMongoDatabaseResult diff --git a/sdk/go/azure/cosmosdb/getRestorableDatabaseAccounts.go b/sdk/go/azure/cosmosdb/getRestorableDatabaseAccounts.go index 0fd261ff60..e1f6d81f89 100644 --- a/sdk/go/azure/cosmosdb/getRestorableDatabaseAccounts.go +++ b/sdk/go/azure/cosmosdb/getRestorableDatabaseAccounts.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about Cosmos DB Restorable Database Accounts. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := cosmosdb.GetRestorableDatabaseAccounts(ctx, &cosmosdb.GetRestorableDatabaseAccountsArgs{ +// Name: "example-ca", +// Location: "West Europe", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetRestorableDatabaseAccounts(ctx *pulumi.Context, args *GetRestorableDatabaseAccountsArgs, opts ...pulumi.InvokeOption) (*GetRestorableDatabaseAccountsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetRestorableDatabaseAccountsResult diff --git a/sdk/go/azure/cosmosdb/getSqlDatabase.go b/sdk/go/azure/cosmosdb/getSqlDatabase.go index 58cf83881a..1a7db82416 100644 --- a/sdk/go/azure/cosmosdb/getSqlDatabase.go +++ b/sdk/go/azure/cosmosdb/getSqlDatabase.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing CosmosDB SQL Database. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cosmosdb.LookupSqlDatabase(ctx, &cosmosdb.LookupSqlDatabaseArgs{ +// AccountName: "tfex-cosmosdb-sql-database-account-name", +// Name: "tfex-cosmosdb-sql-database", +// ResourceGroupName: "tfex-cosmosdb-sql-database-rg", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSqlDatabase(ctx *pulumi.Context, args *LookupSqlDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupSqlDatabaseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSqlDatabaseResult diff --git a/sdk/go/azure/cosmosdb/getSqlRoleDefinition.go b/sdk/go/azure/cosmosdb/getSqlRoleDefinition.go index 6149fda166..1ef443dfc8 100644 --- a/sdk/go/azure/cosmosdb/getSqlRoleDefinition.go +++ b/sdk/go/azure/cosmosdb/getSqlRoleDefinition.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Cosmos DB SQL Role Definition. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := cosmosdb.LookupSqlRoleDefinition(ctx, &cosmosdb.LookupSqlRoleDefinitionArgs{ +// AccountName: "tfex-cosmosdb-sql-role-definition-account-name", +// ResourceGroupName: "tfex-cosmosdb-sql-role-definition-rg", +// RoleDefinitionId: "00000000-0000-0000-0000-000000000000", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSqlRoleDefinition(ctx *pulumi.Context, args *LookupSqlRoleDefinitionArgs, opts ...pulumi.InvokeOption) (*LookupSqlRoleDefinitionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSqlRoleDefinitionResult diff --git a/sdk/go/azure/cosmosdb/gremlinDatabase.go b/sdk/go/azure/cosmosdb/gremlinDatabase.go index f3b3446ea0..b5ec4f1df3 100644 --- a/sdk/go/azure/cosmosdb/gremlinDatabase.go +++ b/sdk/go/azure/cosmosdb/gremlinDatabase.go @@ -15,6 +15,41 @@ import ( // Manages a Gremlin Database within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewGremlinDatabase(ctx, "exampleGremlinDatabase", &cosmosdb.GremlinDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CosmosDB Gremlin Databases can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/gremlinGraph.go b/sdk/go/azure/cosmosdb/gremlinGraph.go index eee4e03f8f..3df725263e 100644 --- a/sdk/go/azure/cosmosdb/gremlinGraph.go +++ b/sdk/go/azure/cosmosdb/gremlinGraph.go @@ -15,6 +15,74 @@ import ( // Manages a Gremlin Graph within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleGremlinDatabase, err := cosmosdb.NewGremlinDatabase(ctx, "exampleGremlinDatabase", &cosmosdb.GremlinDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewGremlinGraph(ctx, "exampleGremlinGraph", &cosmosdb.GremlinGraphArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// DatabaseName: exampleGremlinDatabase.Name, +// PartitionKeyPath: pulumi.String("/Example"), +// Throughput: pulumi.Int(400), +// IndexPolicy: &cosmosdb.GremlinGraphIndexPolicyArgs{ +// Automatic: pulumi.Bool(true), +// IndexingMode: pulumi.String("consistent"), +// IncludedPaths: pulumi.StringArray{ +// pulumi.String("/*"), +// }, +// ExcludedPaths: pulumi.StringArray{ +// pulumi.String("/\"_etag\"/?"), +// }, +// }, +// ConflictResolutionPolicy: &cosmosdb.GremlinGraphConflictResolutionPolicyArgs{ +// Mode: pulumi.String("LastWriterWins"), +// ConflictResolutionPath: pulumi.String("/_ts"), +// }, +// UniqueKeys: cosmosdb.GremlinGraphUniqueKeyArray{ +// &cosmosdb.GremlinGraphUniqueKeyArgs{ +// Paths: pulumi.StringArray{ +// pulumi.String("/definition/id1"), +// pulumi.String("/definition/id2"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// > **NOTE:** The CosmosDB Account needs to have the `EnableGremlin` capability enabled to use this resource - which can be done by adding this to the `capabilities` list within the `cosmosdb.Account` resource. +// // ## Import // // Cosmos Gremlin Graphs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/mongoCollection.go b/sdk/go/azure/cosmosdb/mongoCollection.go index 0f40c05c6b..d46b6654c0 100644 --- a/sdk/go/azure/cosmosdb/mongoCollection.go +++ b/sdk/go/azure/cosmosdb/mongoCollection.go @@ -15,6 +15,59 @@ import ( // Manages a Mongo Collection within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleMongoDatabase, err := cosmosdb.NewMongoDatabase(ctx, "exampleMongoDatabase", &cosmosdb.MongoDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewMongoCollection(ctx, "exampleMongoCollection", &cosmosdb.MongoCollectionArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// DatabaseName: exampleMongoDatabase.Name, +// DefaultTtlSeconds: pulumi.Int(777), +// ShardKey: pulumi.String("uniqueKey"), +// Throughput: pulumi.Int(400), +// Indices: cosmosdb.MongoCollectionIndexArray{ +// &cosmosdb.MongoCollectionIndexArgs{ +// Keys: pulumi.StringArray{ +// pulumi.String("_id"), +// }, +// Unique: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CosmosDB Mongo Collection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/mongoDatabase.go b/sdk/go/azure/cosmosdb/mongoDatabase.go index b880f9b8ed..68158b5a93 100644 --- a/sdk/go/azure/cosmosdb/mongoDatabase.go +++ b/sdk/go/azure/cosmosdb/mongoDatabase.go @@ -15,6 +15,41 @@ import ( // Manages a Mongo Database within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewMongoDatabase(ctx, "exampleMongoDatabase", &cosmosdb.MongoDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos Mongo Database can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/mongoRoleDefinition.go b/sdk/go/azure/cosmosdb/mongoRoleDefinition.go index 82e0792a2c..93d6716b6d 100644 --- a/sdk/go/azure/cosmosdb/mongoRoleDefinition.go +++ b/sdk/go/azure/cosmosdb/mongoRoleDefinition.go @@ -15,6 +15,73 @@ import ( // Manages a Cosmos DB Mongo Role Definition. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("MongoDB"), +// Capabilities: cosmosdb.AccountCapabilityArray{ +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableMongo"), +// }, +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableMongoRoleBasedAccessControl"), +// }, +// }, +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleMongoDatabase, err := cosmosdb.NewMongoDatabase(ctx, "exampleMongoDatabase", &cosmosdb.MongoDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewMongoRoleDefinition(ctx, "exampleMongoRoleDefinition", &cosmosdb.MongoRoleDefinitionArgs{ +// CosmosMongoDatabaseId: exampleMongoDatabase.ID(), +// RoleName: pulumi.String("example-roledefinition"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos DB Mongo Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/mongoUserDefinition.go b/sdk/go/azure/cosmosdb/mongoUserDefinition.go index 87f44d076d..8f12bab02f 100644 --- a/sdk/go/azure/cosmosdb/mongoUserDefinition.go +++ b/sdk/go/azure/cosmosdb/mongoUserDefinition.go @@ -15,6 +15,74 @@ import ( // Manages a Cosmos DB Mongo User Definition. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("MongoDB"), +// Capabilities: cosmosdb.AccountCapabilityArray{ +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableMongo"), +// }, +// &cosmosdb.AccountCapabilityArgs{ +// Name: pulumi.String("EnableMongoRoleBasedAccessControl"), +// }, +// }, +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleMongoDatabase, err := cosmosdb.NewMongoDatabase(ctx, "exampleMongoDatabase", &cosmosdb.MongoDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewMongoUserDefinition(ctx, "exampleMongoUserDefinition", &cosmosdb.MongoUserDefinitionArgs{ +// CosmosMongoDatabaseId: exampleMongoDatabase.ID(), +// Username: pulumi.String("myUserName"), +// Password: pulumi.String("myPassword"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos DB Mongo User Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/notebookWorkspace.go b/sdk/go/azure/cosmosdb/notebookWorkspace.go index 835701550a..8b9c28373e 100644 --- a/sdk/go/azure/cosmosdb/notebookWorkspace.go +++ b/sdk/go/azure/cosmosdb/notebookWorkspace.go @@ -21,6 +21,58 @@ import ( // // > **NOTE:** However, CosmosDb Notebook feature no longer uses the permanent notebook workspace being referred to the public surface in the RP (have since moved to temporary notebooks workspaces which are short-lived <1 hour). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("BoundedStaleness"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewNotebookWorkspace(ctx, "exampleNotebookWorkspace", &cosmosdb.NotebookWorkspaceArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // =SQL Notebook Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/postgresqlCluster.go b/sdk/go/azure/cosmosdb/postgresqlCluster.go index c34d527484..f4a83aeeef 100644 --- a/sdk/go/azure/cosmosdb/postgresqlCluster.go +++ b/sdk/go/azure/cosmosdb/postgresqlCluster.go @@ -15,6 +15,44 @@ import ( // Manages an Azure Cosmos DB for PostgreSQL Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewPostgresqlCluster(ctx, "examplePostgresqlCluster", &cosmosdb.PostgresqlClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// CoordinatorStorageQuotaInMb: pulumi.Int(131072), +// CoordinatorVcoreCount: pulumi.Int(2), +// NodeCount: pulumi.Int(0), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/postgresqlCoordinatorConfiguration.go b/sdk/go/azure/cosmosdb/postgresqlCoordinatorConfiguration.go index c0f4778f1b..4a34ca0713 100644 --- a/sdk/go/azure/cosmosdb/postgresqlCoordinatorConfiguration.go +++ b/sdk/go/azure/cosmosdb/postgresqlCoordinatorConfiguration.go @@ -15,6 +15,53 @@ import ( // Sets a Coordinator Configuration value on Azure Cosmos DB for PostgreSQL Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewResourceGroup(ctx, "test", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "examplePostgresqlCluster", &cosmosdb.PostgresqlClusterArgs{ +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name), +// Location: pulumi.Any(azurerm_resource_group.Example.Location), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// CoordinatorStorageQuotaInMb: pulumi.Int(131072), +// CoordinatorVcoreCount: pulumi.Int(2), +// NodeCount: pulumi.Int(2), +// NodeStorageQuotaInMb: pulumi.Int(131072), +// NodeVcores: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewPostgresqlCoordinatorConfiguration(ctx, "examplePostgresqlCoordinatorConfiguration", &cosmosdb.PostgresqlCoordinatorConfigurationArgs{ +// ClusterId: examplePostgresqlCluster.ID(), +// Value: pulumi.String("on"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Coordinator Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/postgresqlFirewallRule.go b/sdk/go/azure/cosmosdb/postgresqlFirewallRule.go index 875f294a86..1b1bacbe47 100644 --- a/sdk/go/azure/cosmosdb/postgresqlFirewallRule.go +++ b/sdk/go/azure/cosmosdb/postgresqlFirewallRule.go @@ -15,6 +15,52 @@ import ( // Manages an Azure Cosmos DB for PostgreSQL Firewall Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "examplePostgresqlCluster", &cosmosdb.PostgresqlClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// CoordinatorStorageQuotaInMb: pulumi.Int(131072), +// CoordinatorVcoreCount: pulumi.Int(2), +// NodeCount: pulumi.Int(0), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewPostgresqlFirewallRule(ctx, "examplePostgresqlFirewallRule", &cosmosdb.PostgresqlFirewallRuleArgs{ +// ClusterId: examplePostgresqlCluster.ID(), +// StartIpAddress: pulumi.String("10.0.17.62"), +// EndIpAddress: pulumi.String("10.0.17.64"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Cosmos DB for PostgreSQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/postgresqlNodeConfiguration.go b/sdk/go/azure/cosmosdb/postgresqlNodeConfiguration.go index 678ec6c06d..ae1d637459 100644 --- a/sdk/go/azure/cosmosdb/postgresqlNodeConfiguration.go +++ b/sdk/go/azure/cosmosdb/postgresqlNodeConfiguration.go @@ -15,6 +15,53 @@ import ( // Sets a Node Configuration value on Azure Cosmos DB for PostgreSQL Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "examplePostgresqlCluster", &cosmosdb.PostgresqlClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// CoordinatorStorageQuotaInMb: pulumi.Int(131072), +// CoordinatorVcoreCount: pulumi.Int(2), +// NodeCount: pulumi.Int(2), +// NodeStorageQuotaInMb: pulumi.Int(131072), +// NodeVcores: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewPostgresqlNodeConfiguration(ctx, "examplePostgresqlNodeConfiguration", &cosmosdb.PostgresqlNodeConfigurationArgs{ +// ClusterId: examplePostgresqlCluster.ID(), +// Value: pulumi.String("on"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Node Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/postgresqlRole.go b/sdk/go/azure/cosmosdb/postgresqlRole.go index bb13c1aded..179a5afdd4 100644 --- a/sdk/go/azure/cosmosdb/postgresqlRole.go +++ b/sdk/go/azure/cosmosdb/postgresqlRole.go @@ -15,6 +15,51 @@ import ( // Manages an Azure Cosmos DB for PostgreSQL Role. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePostgresqlCluster, err := cosmosdb.NewPostgresqlCluster(ctx, "examplePostgresqlCluster", &cosmosdb.PostgresqlClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// CoordinatorStorageQuotaInMb: pulumi.Int(131072), +// CoordinatorVcoreCount: pulumi.Int(2), +// NodeCount: pulumi.Int(0), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewPostgresqlRole(ctx, "examplePostgresqlRole", &cosmosdb.PostgresqlRoleArgs{ +// ClusterId: examplePostgresqlCluster.ID(), +// Password: pulumi.String("H@Sh1CoR3!"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Cosmos DB for PostgreSQL Roles can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlContainer.go b/sdk/go/azure/cosmosdb/sqlContainer.go index 847922b9c9..4e55bda318 100644 --- a/sdk/go/azure/cosmosdb/sqlContainer.go +++ b/sdk/go/azure/cosmosdb/sqlContainer.go @@ -15,6 +15,75 @@ import ( // Manages a SQL Container within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/definition/id"), +// PartitionKeyVersion: pulumi.Int(1), +// Throughput: pulumi.Int(400), +// IndexingPolicy: &cosmosdb.SqlContainerIndexingPolicyArgs{ +// IndexingMode: pulumi.String("consistent"), +// IncludedPaths: cosmosdb.SqlContainerIndexingPolicyIncludedPathArray{ +// &cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs{ +// Path: pulumi.String("/*"), +// }, +// &cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs{ +// Path: pulumi.String("/included/?"), +// }, +// }, +// ExcludedPaths: cosmosdb.SqlContainerIndexingPolicyExcludedPathArray{ +// &cosmosdb.SqlContainerIndexingPolicyExcludedPathArgs{ +// Path: pulumi.String("/excluded/?"), +// }, +// }, +// }, +// UniqueKeys: cosmosdb.SqlContainerUniqueKeyArray{ +// &cosmosdb.SqlContainerUniqueKeyArgs{ +// Paths: pulumi.StringArray{ +// pulumi.String("/definition/idlong"), +// pulumi.String("/definition/idshort"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos SQL Containers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlDatabase.go b/sdk/go/azure/cosmosdb/sqlDatabase.go index 995b9afa5f..78a093f44e 100644 --- a/sdk/go/azure/cosmosdb/sqlDatabase.go +++ b/sdk/go/azure/cosmosdb/sqlDatabase.go @@ -15,6 +15,41 @@ import ( // Manages a SQL Database within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlDedicatedGateway.go b/sdk/go/azure/cosmosdb/sqlDedicatedGateway.go index 1ba864d75f..8dfe5cf3bf 100644 --- a/sdk/go/azure/cosmosdb/sqlDedicatedGateway.go +++ b/sdk/go/azure/cosmosdb/sqlDedicatedGateway.go @@ -15,6 +15,59 @@ import ( // Manages a SQL Dedicated Gateway within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("BoundedStaleness"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlDedicatedGateway(ctx, "exampleSqlDedicatedGateway", &cosmosdb.SqlDedicatedGatewayArgs{ +// CosmosdbAccountId: exampleAccount.ID(), +// InstanceCount: pulumi.Int(1), +// InstanceSize: pulumi.String("Cosmos.D4s"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CosmosDB SQL Dedicated Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlFunction.go b/sdk/go/azure/cosmosdb/sqlFunction.go index 246d92bf58..0f64d47847 100644 --- a/sdk/go/azure/cosmosdb/sqlFunction.go +++ b/sdk/go/azure/cosmosdb/sqlFunction.go @@ -15,6 +15,57 @@ import ( // Manages an SQL User Defined Function. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/id"), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlFunction(ctx, "exampleSqlFunction", &cosmosdb.SqlFunctionArgs{ +// ContainerId: exampleSqlContainer.ID(), +// Body: pulumi.String("function trigger(){}"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL User Defined Functions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlRoleAssignment.go b/sdk/go/azure/cosmosdb/sqlRoleAssignment.go index 950294d26f..5b25c8e1b5 100644 --- a/sdk/go/azure/cosmosdb/sqlRoleAssignment.go +++ b/sdk/go/azure/cosmosdb/sqlRoleAssignment.go @@ -15,6 +15,83 @@ import ( // Manages a Cosmos DB SQL Role Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlRoleDefinition, err := cosmosdb.NewSqlRoleDefinition(ctx, "exampleSqlRoleDefinition", &cosmosdb.SqlRoleDefinitionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// Type: pulumi.String("CustomRole"), +// AssignableScopes: pulumi.StringArray{ +// exampleAccount.ID(), +// }, +// Permissions: cosmosdb.SqlRoleDefinitionPermissionArray{ +// &cosmosdb.SqlRoleDefinitionPermissionArgs{ +// DataActions: pulumi.StringArray{ +// pulumi.String("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlRoleAssignment(ctx, "exampleSqlRoleAssignment", &cosmosdb.SqlRoleAssignmentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// RoleDefinitionId: exampleSqlRoleDefinition.ID(), +// PrincipalId: *pulumi.String(current.ObjectId), +// Scope: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos DB SQL Role Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlRoleDefinition.go b/sdk/go/azure/cosmosdb/sqlRoleDefinition.go index 26690c4765..a586d5512d 100644 --- a/sdk/go/azure/cosmosdb/sqlRoleDefinition.go +++ b/sdk/go/azure/cosmosdb/sqlRoleDefinition.go @@ -15,6 +15,77 @@ import ( // Manages a Cosmos DB SQL Role Definition. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlRoleDefinition(ctx, "exampleSqlRoleDefinition", &cosmosdb.SqlRoleDefinitionArgs{ +// RoleDefinitionId: pulumi.String("84cf3a8b-4122-4448-bce2-fa423cfe0a15"), +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// AssignableScopes: pulumi.StringArray{ +// exampleAccount.ID().ApplyT(func(id string) (string, error) { +// return fmt.Sprintf("%v/dbs/sales", id), nil +// }).(pulumi.StringOutput), +// }, +// Permissions: cosmosdb.SqlRoleDefinitionPermissionArray{ +// &cosmosdb.SqlRoleDefinitionPermissionArgs{ +// DataActions: pulumi.StringArray{ +// pulumi.String("Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cosmos DB SQL Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlStoredProcedure.go b/sdk/go/azure/cosmosdb/sqlStoredProcedure.go index c9c29b8493..d4635fa3df 100644 --- a/sdk/go/azure/cosmosdb/sqlStoredProcedure.go +++ b/sdk/go/azure/cosmosdb/sqlStoredProcedure.go @@ -15,6 +15,60 @@ import ( // Manages a SQL Stored Procedure within a Cosmos DB Account SQL Database. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/id"), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlStoredProcedure(ctx, "exampleSqlStoredProcedure", &cosmosdb.SqlStoredProcedureArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// DatabaseName: exampleSqlDatabase.Name, +// ContainerName: exampleSqlContainer.Name, +// Body: pulumi.String(" function () { var context = getContext(); var response = context.getResponse(); response.setBody('Hello, World'); }\n"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CosmosDB SQL Stored Procedures can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/sqlTrigger.go b/sdk/go/azure/cosmosdb/sqlTrigger.go index 20c23c84a7..6cf2ad7c3c 100644 --- a/sdk/go/azure/cosmosdb/sqlTrigger.go +++ b/sdk/go/azure/cosmosdb/sqlTrigger.go @@ -15,6 +15,59 @@ import ( // Manages an SQL Trigger. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/id"), +// }) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewSqlTrigger(ctx, "exampleSqlTrigger", &cosmosdb.SqlTriggerArgs{ +// ContainerId: exampleSqlContainer.ID(), +// Body: pulumi.String("function trigger(){}"), +// Operation: pulumi.String("Delete"), +// Type: pulumi.String("Post"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/cosmosdb/table.go b/sdk/go/azure/cosmosdb/table.go index 69e849e8fe..8263b1f8f9 100644 --- a/sdk/go/azure/cosmosdb/table.go +++ b/sdk/go/azure/cosmosdb/table.go @@ -15,6 +15,41 @@ import ( // Manages a Table within a Cosmos DB Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = cosmosdb.NewTable(ctx, "exampleTable", &cosmosdb.TableArgs{ +// ResourceGroupName: *pulumi.String(exampleAccount.ResourceGroupName), +// AccountName: *pulumi.String(exampleAccount.Name), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CosmosDB Tables can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/costmanagement/anomalyAlert.go b/sdk/go/azure/costmanagement/anomalyAlert.go index 585377fa7e..a3a2a34338 100644 --- a/sdk/go/azure/costmanagement/anomalyAlert.go +++ b/sdk/go/azure/costmanagement/anomalyAlert.go @@ -15,6 +15,36 @@ import ( // Manages a Cost Anomaly Alert. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/costmanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := costmanagement.NewAnomalyAlert(ctx, "example", &costmanagement.AnomalyAlertArgs{ +// DisplayName: pulumi.String("Alert DisplayName"), +// EmailAddresses: pulumi.StringArray{ +// pulumi.String("example@test.net"), +// }, +// EmailSubject: pulumi.String("My Test Anomaly Alert"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Cost Anomaly Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/costmanagement/scheduledAction.go b/sdk/go/azure/costmanagement/scheduledAction.go index b7fee37e4e..1107af306d 100644 --- a/sdk/go/azure/costmanagement/scheduledAction.go +++ b/sdk/go/azure/costmanagement/scheduledAction.go @@ -15,6 +15,42 @@ import ( // Manages an Azure Cost Management Scheduled Action. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/costmanagement" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := costmanagement.NewScheduledAction(ctx, "example", &costmanagement.ScheduledActionArgs{ +// DisplayName: pulumi.String("Report Last 6 Months"), +// EmailAddressSender: pulumi.String("platformteam@test.com"), +// EmailAddresses: pulumi.StringArray{ +// pulumi.String("example@example.com"), +// }, +// EmailSubject: pulumi.String("Cost Management Report"), +// EndDate: pulumi.String("2023-02-02T00:00:00Z"), +// Frequency: pulumi.String("Daily"), +// Message: pulumi.String("Hi all, take a look at last 6 months spending!"), +// StartDate: pulumi.String("2023-01-02T00:00:00Z"), +// ViewId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Cost Management Scheduled Actions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dashboard/azurerm_portal_dashboard.go b/sdk/go/azure/dashboard/azurerm_portal_dashboard.go index 83e8bcaba2..1e8335febd 100644 --- a/sdk/go/azure/dashboard/azurerm_portal_dashboard.go +++ b/sdk/go/azure/dashboard/azurerm_portal_dashboard.go @@ -14,6 +14,34 @@ import ( // Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `portal.Dashboard` resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/portal" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := portal.LookupDashboard(ctx, &portal.LookupDashboardArgs{ +// Name: pulumi.StringRef("existing-dashboard"), +// ResourceGroupName: "dashboard-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", data.Azurerm_dashboard.Example.Id) +// return nil +// }) +// } +// +// ``` +// // Deprecated: azure.dashboard.azurerm_portal_dashboard has been deprecated in favor of azure.portal.getDashboard func Azurerm_portal_dashboard(ctx *pulumi.Context, args *Azurerm_portal_dashboardArgs, opts ...pulumi.InvokeOption) (*Azurerm_portal_dashboardResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) diff --git a/sdk/go/azure/dashboard/dashboard.go b/sdk/go/azure/dashboard/dashboard.go index 7cf4e8f4b8..e4d6d95f11 100644 --- a/sdk/go/azure/dashboard/dashboard.go +++ b/sdk/go/azure/dashboard/dashboard.go @@ -17,6 +17,173 @@ import ( // // !> **Note:** The `portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `portal.PortalDashboard` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/portal" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// cfg := config.New(ctx, "") +// mdContent := "# Hello all :)" +// if param := cfg.Get("mdContent"); param != "" { +// mdContent = param +// } +// videoLink := "https://www.youtube.com/watch?v=......" +// if param := cfg.Get("videoLink"); param != "" { +// videoLink = param +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = portal.NewDashboard(ctx, "my-board", &portal.DashboardArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// Tags: pulumi.StringMap{ +// "source": pulumi.String("managed"), +// }, +// DashboardProperties: pulumi.String(fmt.Sprintf(`{ +// "lenses": { +// "0": { +// "order": 0, +// "parts": { +// "0": { +// "position": { +// "x": 0, +// "y": 0, +// "rowSpan": 2, +// "colSpan": 3 +// }, +// "metadata": { +// "inputs": [], +// "type": "Extension/HubsExtension/PartType/MarkdownPart", +// "settings": { +// "content": { +// "settings": { +// "content": "%v", +// "subtitle": "", +// "title": "" +// } +// } +// } +// } +// }, +// "1": { +// "position": { +// "x": 5, +// "y": 0, +// "rowSpan": 4, +// "colSpan": 6 +// }, +// "metadata": { +// "inputs": [], +// "type": "Extension/HubsExtension/PartType/VideoPart", +// "settings": { +// "content": { +// "settings": { +// "title": "Important Information", +// "subtitle": "", +// "src": "%v", +// "autoplay": true +// } +// } +// } +// } +// }, +// "2": { +// "position": { +// "x": 0, +// "y": 4, +// "rowSpan": 4, +// "colSpan": 6 +// }, +// "metadata": { +// "inputs": [ +// { +// "name": "ComponentId", +// "value": "/subscriptions/%v/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" +// } +// ], +// "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", +// "settings": {}, +// "asset": { +// "idInputName": "ComponentId", +// "type": "ApplicationInsights" +// } +// } +// } +// } +// } +// }, +// "metadata": { +// "model": { +// "timeRange": { +// "value": { +// "relative": { +// "duration": 24, +// "timeUnit": 1 +// } +// }, +// "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" +// }, +// "filterLocale": { +// "value": "en-us" +// }, +// "filters": { +// "value": { +// "MsPortalFx_TimeRange": { +// "model": { +// "format": "utc", +// "granularity": "auto", +// "relative": "24h" +// }, +// "displayCache": { +// "name": "UTC Time", +// "value": "Past 24 hours" +// }, +// "filteredPartIds": [ +// "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" +// ] +// } +// } +// } +// } +// } +// } +// +// `, mdContent, videoLink, current.SubscriptionId)), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// It is recommended to follow the steps outlined +// [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. +// // ## Import // // Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dashboard/grafana.go b/sdk/go/azure/dashboard/grafana.go index fb20a89d00..d9757b72d6 100644 --- a/sdk/go/azure/dashboard/grafana.go +++ b/sdk/go/azure/dashboard/grafana.go @@ -15,6 +15,49 @@ import ( // Manages a Dashboard Grafana. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dashboard" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = dashboard.NewGrafana(ctx, "exampleGrafana", &dashboard.GrafanaArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// ApiKeyEnabled: pulumi.Bool(true), +// DeterministicOutboundIpEnabled: pulumi.Bool(true), +// PublicNetworkAccessEnabled: pulumi.Bool(false), +// Identity: &dashboard.GrafanaIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dashboard Grafana can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/databasemigration/getProject.go b/sdk/go/azure/databasemigration/getProject.go index a91cb00ced..f72cad5d81 100644 --- a/sdk/go/azure/databasemigration/getProject.go +++ b/sdk/go/azure/databasemigration/getProject.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Database Migration Project. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := databasemigration.LookupProject(ctx, &databasemigration.LookupProjectArgs{ +// Name: "example-dbms-project", +// ResourceGroupName: "example-rg", +// ServiceName: "example-dbms", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("name", example.Name) +// return nil +// }) +// } +// +// ``` func LookupProject(ctx *pulumi.Context, args *LookupProjectArgs, opts ...pulumi.InvokeOption) (*LookupProjectResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupProjectResult diff --git a/sdk/go/azure/databasemigration/getService.go b/sdk/go/azure/databasemigration/getService.go index e3e6855797..6201a8d505 100644 --- a/sdk/go/azure/databasemigration/getService.go +++ b/sdk/go/azure/databasemigration/getService.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Database Migration Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := databasemigration.LookupService(ctx, &databasemigration.LookupServiceArgs{ +// Name: "example-dms", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("azurermDmsId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/databasemigration/project.go b/sdk/go/azure/databasemigration/project.go index acbd9bd3dc..6d67ff8e45 100644 --- a/sdk/go/azure/databasemigration/project.go +++ b/sdk/go/azure/databasemigration/project.go @@ -17,6 +17,73 @@ import ( // // > **NOTE:** Destroying a Database Migration Project will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleService, err := databasemigration.NewService(ctx, "exampleService", &databasemigration.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SubnetId: exampleSubnet.ID(), +// SkuName: pulumi.String("Standard_1vCores"), +// }) +// if err != nil { +// return err +// } +// _, err = databasemigration.NewProject(ctx, "exampleProject", &databasemigration.ProjectArgs{ +// ServiceName: exampleService.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SourcePlatform: pulumi.String("SQL"), +// TargetPlatform: pulumi.String("SQLDB"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Database Migration Projects can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/databasemigration/service.go b/sdk/go/azure/databasemigration/service.go index 98bcc626f2..d6f6fabe06 100644 --- a/sdk/go/azure/databasemigration/service.go +++ b/sdk/go/azure/databasemigration/service.go @@ -17,6 +17,63 @@ import ( // // > **NOTE:** Destroying a Database Migration Service will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provide. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = databasemigration.NewService(ctx, "exampleService", &databasemigration.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SubnetId: exampleSubnet.ID(), +// SkuName: pulumi.String("Standard_1vCores"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Database Migration Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/databoxedge/device.go b/sdk/go/azure/databoxedge/device.go index 31b84e47e2..89770dff7b 100644 --- a/sdk/go/azure/databoxedge/device.go +++ b/sdk/go/azure/databoxedge/device.go @@ -15,6 +15,41 @@ import ( // Manages a Databox Edge Device. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databoxedge" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = databoxedge.NewDevice(ctx, "exampleDevice", &databoxedge.DeviceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("EdgeP_Base-Standard"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Databox Edge Devices can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/databoxedge/getDevice.go b/sdk/go/azure/databoxedge/getDevice.go index 12d5806cc2..f9301e92a3 100644 --- a/sdk/go/azure/databoxedge/getDevice.go +++ b/sdk/go/azure/databoxedge/getDevice.go @@ -13,6 +13,33 @@ import ( ) // Get information about a Databox Edge Device. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databoxedge" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := databoxedge.LookupDevice(ctx, &databoxedge.LookupDeviceArgs{ +// Name: "example-device", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupDevice(ctx *pulumi.Context, args *LookupDeviceArgs, opts ...pulumi.InvokeOption) (*LookupDeviceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDeviceResult diff --git a/sdk/go/azure/databoxedge/order.go b/sdk/go/azure/databoxedge/order.go index ee357745c7..b0d1fb51cc 100644 --- a/sdk/go/azure/databoxedge/order.go +++ b/sdk/go/azure/databoxedge/order.go @@ -17,6 +17,65 @@ import ( // // !> Creation of Databox Edge Order is not supported by the Azure API - as such the `databoxedge.Order` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databoxedge" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleDevice, err := databoxedge.NewDevice(ctx, "exampleDevice", &databoxedge.DeviceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("EdgeP_Base-Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = databoxedge.NewOrder(ctx, "exampleOrder", &databoxedge.OrderArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// DeviceName: exampleDevice.Name, +// Contact: &databoxedge.OrderContactArgs{ +// Name: pulumi.String("TerraForm Test"), +// Emails: pulumi.StringArray{ +// pulumi.String("creator4983@FlynnsArcade.com"), +// }, +// CompanyName: pulumi.String("Flynn's Arcade"), +// PhoneNumber: pulumi.String("(800) 555-1234"), +// }, +// ShipmentAddress: &databoxedge.OrderShipmentAddressArgs{ +// Addresses: pulumi.StringArray{ +// pulumi.String("One Microsoft Way"), +// }, +// City: pulumi.String("Redmond"), +// PostalCode: pulumi.String("98052"), +// State: pulumi.String("WA"), +// Country: pulumi.String("United States"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Databox Edge Orders can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/databricks/accessConnector.go b/sdk/go/azure/databricks/accessConnector.go index 2762a6dd25..928306c7ef 100644 --- a/sdk/go/azure/databricks/accessConnector.go +++ b/sdk/go/azure/databricks/accessConnector.go @@ -15,6 +15,46 @@ import ( // Manages a Databricks Access Connector // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databricks" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = databricks.NewAccessConnector(ctx, "exampleAccessConnector", &databricks.AccessConnectorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Identity: &databricks.AccessConnectorIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Databricks Access Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/databricks/getWorkspace.go b/sdk/go/azure/databricks/getWorkspace.go index 8a3f6fa77a..3d5223c1e4 100644 --- a/sdk/go/azure/databricks/getWorkspace.go +++ b/sdk/go/azure/databricks/getWorkspace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Databricks workspace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databricks" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := databricks.LookupWorkspace(ctx, &databricks.LookupWorkspaceArgs{ +// Name: "example-workspace", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("databricksWorkspaceId", example.WorkspaceId) +// return nil +// }) +// } +// +// ``` func LookupWorkspace(ctx *pulumi.Context, args *LookupWorkspaceArgs, opts ...pulumi.InvokeOption) (*LookupWorkspaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupWorkspaceResult diff --git a/sdk/go/azure/databricks/getWorkspacePrivateEndpointConnection.go b/sdk/go/azure/databricks/getWorkspacePrivateEndpointConnection.go index b54d6d848e..687bcc8bba 100644 --- a/sdk/go/azure/databricks/getWorkspacePrivateEndpointConnection.go +++ b/sdk/go/azure/databricks/getWorkspacePrivateEndpointConnection.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information on an existing Databricks Workspace private endpoint connection state. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databricks" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := databricks.GetWorkspacePrivateEndpointConnection(ctx, &databricks.GetWorkspacePrivateEndpointConnectionArgs{ +// WorkspaceId: azurerm_databricks_workspace.Example.Id, +// PrivateEndpointId: azurerm_private_endpoint.Example.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("databricksWorkspacePrivateEndpointConnectionStatus", example.Connections[0].Status) +// return nil +// }) +// } +// +// ``` func GetWorkspacePrivateEndpointConnection(ctx *pulumi.Context, args *GetWorkspacePrivateEndpointConnectionArgs, opts ...pulumi.InvokeOption) (*GetWorkspacePrivateEndpointConnectionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetWorkspacePrivateEndpointConnectionResult diff --git a/sdk/go/azure/databricks/virtualNetworkPeering.go b/sdk/go/azure/databricks/virtualNetworkPeering.go index fd08177809..47ea415339 100644 --- a/sdk/go/azure/databricks/virtualNetworkPeering.go +++ b/sdk/go/azure/databricks/virtualNetworkPeering.go @@ -15,6 +15,71 @@ import ( // Manages a Databricks Virtual Network Peering // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databricks" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// remoteVirtualNetwork, err := network.NewVirtualNetwork(ctx, "remoteVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := databricks.NewWorkspace(ctx, "exampleWorkspace", &databricks.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetworkPeering, err := databricks.NewVirtualNetworkPeering(ctx, "exampleVirtualNetworkPeering", &databricks.VirtualNetworkPeeringArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceId: exampleWorkspace.ID(), +// RemoteAddressSpacePrefixes: remoteVirtualNetwork.AddressSpaces, +// RemoteVirtualNetworkId: remoteVirtualNetwork.ID(), +// AllowVirtualNetworkAccess: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkPeering(ctx, "remoteVirtualNetworkPeering", &network.VirtualNetworkPeeringArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: remoteVirtualNetwork.Name, +// RemoteVirtualNetworkId: exampleVirtualNetworkPeering.VirtualNetworkId, +// AllowVirtualNetworkAccess: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Databrick Virtual Network Peerings can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datadog/monitor.go b/sdk/go/azure/datadog/monitor.go index 4a99aecb89..f2066e1a75 100644 --- a/sdk/go/azure/datadog/monitor.go +++ b/sdk/go/azure/datadog/monitor.go @@ -16,10 +16,94 @@ import ( // Manages a datadog Monitor. // // ## Example Usage +// ### Monitor creation with linking to Datadog organization +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datadog" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US 2"), +// }) +// if err != nil { +// return err +// } +// _, err = datadog.NewMonitor(ctx, "exampleMonitor", &datadog.MonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatadogOrganization: &datadog.MonitorDatadogOrganizationArgs{ +// ApiKey: pulumi.String("XXXX"), +// ApplicationKey: pulumi.String("XXXX"), +// }, +// User: &datadog.MonitorUserArgs{ +// Name: pulumi.String("Example"), +// Email: pulumi.String("abc@xyz.com"), +// }, +// SkuName: pulumi.String("Linked"), +// Identity: &datadog.MonitorIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // ## Role Assignment // // To enable metrics flow, perform role assignment on the identity created above. `Monitoring reader(43d0d8ad-25c7-4714-9337-8ba259a9fe05)` role is required . // +// ### Role assignment on the monitor created +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// monitoringReader, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// Name: pulumi.StringRef("Monitoring Reader"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionId: *pulumi.String(monitoringReader.RoleDefinitionId), +// PrincipalId: pulumi.Any(azurerm_datadog_monitor.Example.Identity[0].Principal_id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Datadog Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datadog/monitorSsoConfiguration.go b/sdk/go/azure/datadog/monitorSsoConfiguration.go index d4c9442fc0..185d16950c 100644 --- a/sdk/go/azure/datadog/monitorSsoConfiguration.go +++ b/sdk/go/azure/datadog/monitorSsoConfiguration.go @@ -16,6 +16,58 @@ import ( // Manages SingleSignOn on the datadog Monitor. // // ## Example Usage +// ### Enabling SSO on monitor +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datadog" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US 2"), +// }) +// if err != nil { +// return err +// } +// exampleMonitor, err := datadog.NewMonitor(ctx, "exampleMonitor", &datadog.MonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatadogOrganization: &datadog.MonitorDatadogOrganizationArgs{ +// ApiKey: pulumi.String("XXXX"), +// ApplicationKey: pulumi.String("XXXX"), +// }, +// User: &datadog.MonitorUserArgs{ +// Name: pulumi.String("Example"), +// Email: pulumi.String("abc@xyz.com"), +// }, +// SkuName: pulumi.String("Linked"), +// Identity: &datadog.MonitorIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = datadog.NewMonitorSsoConfiguration(ctx, "exampleMonitorSsoConfiguration", &datadog.MonitorSsoConfigurationArgs{ +// DatadogMonitorId: exampleMonitor.ID(), +// SingleSignOnEnabled: pulumi.String("Enable"), +// EnterpriseApplicationId: pulumi.String("XXXX"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/datadog/monitorTagRule.go b/sdk/go/azure/datadog/monitorTagRule.go index b4f2789d86..d7ae781e8c 100644 --- a/sdk/go/azure/datadog/monitorTagRule.go +++ b/sdk/go/azure/datadog/monitorTagRule.go @@ -16,6 +16,72 @@ import ( // Manages TagRules on the datadog Monitor. // // ## Example Usage +// ### Adding TagRules on monitor +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datadog" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US 2"), +// }) +// if err != nil { +// return err +// } +// exampleMonitor, err := datadog.NewMonitor(ctx, "exampleMonitor", &datadog.MonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatadogOrganization: &datadog.MonitorDatadogOrganizationArgs{ +// ApiKey: pulumi.String("XXXX"), +// ApplicationKey: pulumi.String("XXXX"), +// }, +// User: &datadog.MonitorUserArgs{ +// Name: pulumi.String("Example"), +// Email: pulumi.String("abc@xyz.com"), +// }, +// SkuName: pulumi.String("Linked"), +// Identity: &datadog.MonitorIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = datadog.NewMonitorTagRule(ctx, "exampleMonitorTagRule", &datadog.MonitorTagRuleArgs{ +// DatadogMonitorId: exampleMonitor.ID(), +// Logs: datadog.MonitorTagRuleLogArray{ +// &datadog.MonitorTagRuleLogArgs{ +// SubscriptionLogEnabled: pulumi.Bool(true), +// }, +// }, +// Metrics: datadog.MonitorTagRuleMetricArray{ +// &datadog.MonitorTagRuleMetricArgs{ +// Filters: datadog.MonitorTagRuleMetricFilterArray{ +// &datadog.MonitorTagRuleMetricFilterArgs{ +// Name: pulumi.String("Test"), +// Value: pulumi.String("Logs"), +// Action: pulumi.String("Include"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/datafactory/customDataset.go b/sdk/go/azure/datafactory/customDataset.go index fbdcfdd7ef..a72c46ac54 100644 --- a/sdk/go/azure/datafactory/customDataset.go +++ b/sdk/go/azure/datafactory/customDataset.go @@ -15,6 +15,137 @@ import ( // Manages a Dataset inside an Azure Data Factory. This is a generic resource that supports all different Dataset Types. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datafactory.FactoryIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleLinkedCustomService, err := datafactory.NewLinkedCustomService(ctx, "exampleLinkedCustomService", &datafactory.LinkedCustomServiceArgs{ +// DataFactoryId: exampleFactory.ID(), +// Type: pulumi.String("AzureBlobStorage"), +// TypePropertiesJson: exampleAccount.PrimaryConnectionString.ApplyT(func(primaryConnectionString string) (string, error) { +// return fmt.Sprintf("{\n \"connectionString\":\"%v\"\n}\n", primaryConnectionString), nil +// }).(pulumi.StringOutput), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewCustomDataset(ctx, "exampleCustomDataset", &datafactory.CustomDatasetArgs{ +// DataFactoryId: exampleFactory.ID(), +// Type: pulumi.String("Json"), +// LinkedService: &datafactory.CustomDatasetLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// Parameters: pulumi.StringMap{ +// "key1": pulumi.String("value1"), +// }, +// }, +// TypePropertiesJson: exampleContainer.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf(`{ +// "location": { +// "container":"%v", +// "fileName":"foo.txt", +// "folderPath": "foo/bar/", +// "type":"AzureBlobStorageLocation" +// }, +// "encodingName":"UTF-8" +// } +// +// `, name), nil +// +// }).(pulumi.StringOutput), +// Description: pulumi.String("test description"), +// Annotations: pulumi.StringArray{ +// pulumi.String("test1"), +// pulumi.String("test2"), +// pulumi.String("test3"), +// }, +// Folder: pulumi.String("testFolder"), +// Parameters: pulumi.StringMap{ +// "foo": pulumi.String("test1"), +// "Bar": pulumi.String("Test2"), +// }, +// AdditionalProperties: pulumi.StringMap{ +// "foo": pulumi.String("test1"), +// "bar": pulumi.String("test2"), +// }, +// SchemaJson: pulumi.String(`{ +// "type": "object", +// "properties": { +// "name": { +// "type": "object", +// "properties": { +// "firstName": { +// "type": "string" +// }, +// "lastName": { +// "type": "string" +// } +// } +// }, +// "age": { +// "type": "integer" +// } +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/dataFlow.go b/sdk/go/azure/datafactory/dataFlow.go index 743a396c29..194b4fdf18 100644 --- a/sdk/go/azure/datafactory/dataFlow.go +++ b/sdk/go/azure/datafactory/dataFlow.go @@ -15,6 +15,214 @@ import ( // Manages a Data Flow inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedCustomService, err := datafactory.NewLinkedCustomService(ctx, "exampleLinkedCustomService", &datafactory.LinkedCustomServiceArgs{ +// DataFactoryId: exampleFactory.ID(), +// Type: pulumi.String("AzureBlobStorage"), +// TypePropertiesJson: exampleAccount.PrimaryConnectionString.ApplyT(func(primaryConnectionString string) (string, error) { +// return fmt.Sprintf("{\n \"connectionString\": \"%v\"\n}\n", primaryConnectionString), nil +// }).(pulumi.StringOutput), +// }) +// if err != nil { +// return err +// } +// example1DatasetJson, err := datafactory.NewDatasetJson(ctx, "example1DatasetJson", &datafactory.DatasetJsonArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedCustomService.Name, +// AzureBlobStorageLocation: &datafactory.DatasetJsonAzureBlobStorageLocationArgs{ +// Container: pulumi.String("container"), +// Path: pulumi.String("foo/bar/"), +// Filename: pulumi.String("foo.txt"), +// }, +// Encoding: pulumi.String("UTF-8"), +// }) +// if err != nil { +// return err +// } +// example2DatasetJson, err := datafactory.NewDatasetJson(ctx, "example2DatasetJson", &datafactory.DatasetJsonArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedCustomService.Name, +// AzureBlobStorageLocation: &datafactory.DatasetJsonAzureBlobStorageLocationArgs{ +// Container: pulumi.String("container"), +// Path: pulumi.String("foo/bar/"), +// Filename: pulumi.String("bar.txt"), +// }, +// Encoding: pulumi.String("UTF-8"), +// }) +// if err != nil { +// return err +// } +// example1FlowletDataFlow, err := datafactory.NewFlowletDataFlow(ctx, "example1FlowletDataFlow", &datafactory.FlowletDataFlowArgs{ +// DataFactoryId: exampleFactory.ID(), +// Sources: datafactory.FlowletDataFlowSourceArray{ +// &datafactory.FlowletDataFlowSourceArgs{ +// Name: pulumi.String("source1"), +// LinkedService: &datafactory.FlowletDataFlowSourceLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Sinks: datafactory.FlowletDataFlowSinkArray{ +// &datafactory.FlowletDataFlowSinkArgs{ +// Name: pulumi.String("sink1"), +// LinkedService: &datafactory.FlowletDataFlowSinkLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Script: pulumi.String(`source( +// allowSchemaDrift: true, +// validateSchema: false, +// limit: 100, +// ignoreNoFilesFound: false, +// documentForm: 'documentPerLine') ~> source1 +// +// source1 sink( +// +// allowSchemaDrift: true, +// validateSchema: false, +// skipDuplicateMapInputs: true, +// skipDuplicateMapOutputs: true) ~> sink1 +// +// `), +// +// }) +// if err != nil { +// return err +// } +// example2FlowletDataFlow, err := datafactory.NewFlowletDataFlow(ctx, "example2FlowletDataFlow", &datafactory.FlowletDataFlowArgs{ +// DataFactoryId: exampleFactory.ID(), +// Sources: datafactory.FlowletDataFlowSourceArray{ +// &datafactory.FlowletDataFlowSourceArgs{ +// Name: pulumi.String("source1"), +// LinkedService: &datafactory.FlowletDataFlowSourceLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Sinks: datafactory.FlowletDataFlowSinkArray{ +// &datafactory.FlowletDataFlowSinkArgs{ +// Name: pulumi.String("sink1"), +// LinkedService: &datafactory.FlowletDataFlowSinkLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Script: pulumi.String(`source( +// allowSchemaDrift: true, +// validateSchema: false, +// limit: 100, +// ignoreNoFilesFound: false, +// documentForm: 'documentPerLine') ~> source1 +// +// source1 sink( +// +// allowSchemaDrift: true, +// validateSchema: false, +// skipDuplicateMapInputs: true, +// skipDuplicateMapOutputs: true) ~> sink1 +// +// `), +// +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDataFlow(ctx, "exampleDataFlow", &datafactory.DataFlowArgs{ +// DataFactoryId: exampleFactory.ID(), +// Sources: datafactory.DataFlowSourceArray{ +// &datafactory.DataFlowSourceArgs{ +// Name: pulumi.String("source1"), +// Flowlet: &datafactory.DataFlowSourceFlowletArgs{ +// Name: example1FlowletDataFlow.Name, +// Parameters: pulumi.StringMap{ +// "Key1": pulumi.String("value1"), +// }, +// }, +// Dataset: &datafactory.DataFlowSourceDatasetArgs{ +// Name: example1DatasetJson.Name, +// }, +// }, +// }, +// Sinks: datafactory.DataFlowSinkArray{ +// &datafactory.DataFlowSinkArgs{ +// Name: pulumi.String("sink1"), +// Flowlet: &datafactory.DataFlowSinkFlowletArgs{ +// Name: example2FlowletDataFlow.Name, +// Parameters: pulumi.StringMap{ +// "Key1": pulumi.String("value1"), +// }, +// }, +// Dataset: &datafactory.DataFlowSinkDatasetArgs{ +// Name: example2DatasetJson.Name, +// }, +// }, +// }, +// Script: pulumi.String(`source( +// allowSchemaDrift: true, +// validateSchema: false, +// limit: 100, +// ignoreNoFilesFound: false, +// documentForm: 'documentPerLine') ~> source1 +// +// source1 sink( +// +// allowSchemaDrift: true, +// validateSchema: false, +// skipDuplicateMapInputs: true, +// skipDuplicateMapOutputs: true) ~> sink1 +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetAzureBlob.go b/sdk/go/azure/datafactory/datasetAzureBlob.go index dd2bdccdb8..20fd16fb54 100644 --- a/sdk/go/azure/datafactory/datasetAzureBlob.go +++ b/sdk/go/azure/datafactory/datasetAzureBlob.go @@ -15,6 +15,63 @@ import ( // Manages an Azure Blob Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount := storage.LookupAccountOutput(ctx, storage.GetAccountOutputArgs{ +// Name: pulumi.String("storageaccountname"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceAzureBlobStorage, err := datafactory.NewLinkedServiceAzureBlobStorage(ctx, "exampleLinkedServiceAzureBlobStorage", &datafactory.LinkedServiceAzureBlobStorageArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: exampleAccount.ApplyT(func(exampleAccount storage.GetAccountResult) (*string, error) { +// return &exampleAccount.PrimaryConnectionString, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetAzureBlob(ctx, "exampleDatasetAzureBlob", &datafactory.DatasetAzureBlobArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceAzureBlobStorage.Name, +// Path: pulumi.String("foo"), +// Filename: pulumi.String("bar.png"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetAzureSqlTable.go b/sdk/go/azure/datafactory/datasetAzureSqlTable.go index b598d6f3be..6af56147bb 100644 --- a/sdk/go/azure/datafactory/datasetAzureSqlTable.go +++ b/sdk/go/azure/datafactory/datasetAzureSqlTable.go @@ -15,6 +15,54 @@ import ( // Manages an Azure SQL Table Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceAzureSqlDatabase, err := datafactory.NewLinkedServiceAzureSqlDatabase(ctx, "exampleLinkedServiceAzureSqlDatabase", &datafactory.LinkedServiceAzureSqlDatabaseArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Integrated Security=False;Data Source=test;Initial Catalog=test;Initial Catalog=test;User ID=test;Password=test"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetAzureSqlTable(ctx, "exampleDatasetAzureSqlTable", &datafactory.DatasetAzureSqlTableArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceId: exampleLinkedServiceAzureSqlDatabase.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Azure SQL Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetBinary.go b/sdk/go/azure/datafactory/datasetBinary.go index 749d1bf1d2..70ccc9a4b7 100644 --- a/sdk/go/azure/datafactory/datasetBinary.go +++ b/sdk/go/azure/datafactory/datasetBinary.go @@ -15,6 +15,62 @@ import ( // Manages a Data Factory Binary Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceSftp, err := datafactory.NewLinkedServiceSftp(ctx, "exampleLinkedServiceSftp", &datafactory.LinkedServiceSftpArgs{ +// DataFactoryId: exampleFactory.ID(), +// AuthenticationType: pulumi.String("Basic"), +// Host: pulumi.String("http://www.bing.com"), +// Port: pulumi.Int(22), +// Username: pulumi.String("foo"), +// Password: pulumi.String("bar"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetBinary(ctx, "exampleDatasetBinary", &datafactory.DatasetBinaryArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceSftp.Name, +// SftpServerLocation: &datafactory.DatasetBinarySftpServerLocationArgs{ +// Path: pulumi.String("/test/"), +// Filename: pulumi.String("**"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Binary Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetCosmosDBApi.go b/sdk/go/azure/datafactory/datasetCosmosDBApi.go index 430fca1a92..d9d732cdce 100644 --- a/sdk/go/azure/datafactory/datasetCosmosDBApi.go +++ b/sdk/go/azure/datafactory/datasetCosmosDBApi.go @@ -15,6 +15,64 @@ import ( // Manages an Azure Cosmos DB SQL API Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceCosmosDb, err := datafactory.NewLinkedServiceCosmosDb(ctx, "exampleLinkedServiceCosmosDb", &datafactory.LinkedServiceCosmosDbArgs{ +// DataFactoryId: exampleFactory.ID(), +// AccountEndpoint: *pulumi.String(exampleAccount.Endpoint), +// Database: pulumi.String("foo"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetCosmosDBApi(ctx, "exampleDatasetCosmosDBApi", &datafactory.DatasetCosmosDBApiArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceCosmosDb.Name, +// CollectionName: pulumi.String("bar"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetDelimitedText.go b/sdk/go/azure/datafactory/datasetDelimitedText.go index 94a87675d0..503487e1f5 100644 --- a/sdk/go/azure/datafactory/datasetDelimitedText.go +++ b/sdk/go/azure/datafactory/datasetDelimitedText.go @@ -15,6 +15,67 @@ import ( // Manages an Azure Delimited Text Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceWeb, err := datafactory.NewLinkedServiceWeb(ctx, "exampleLinkedServiceWeb", &datafactory.LinkedServiceWebArgs{ +// DataFactoryId: exampleFactory.ID(), +// AuthenticationType: pulumi.String("Anonymous"), +// Url: pulumi.String("https://www.bing.com"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetDelimitedText(ctx, "exampleDatasetDelimitedText", &datafactory.DatasetDelimitedTextArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceWeb.Name, +// HttpServerLocation: &datafactory.DatasetDelimitedTextHttpServerLocationArgs{ +// RelativeUrl: pulumi.String("http://www.bing.com"), +// Path: pulumi.String("foo/bar/"), +// Filename: pulumi.String("fizz.txt"), +// }, +// ColumnDelimiter: pulumi.String(","), +// RowDelimiter: pulumi.String("NEW"), +// Encoding: pulumi.String("UTF-8"), +// QuoteCharacter: pulumi.String("x"), +// EscapeCharacter: pulumi.String("f"), +// FirstRowAsHeader: pulumi.Bool(true), +// NullValue: pulumi.String("NULL"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetHttp.go b/sdk/go/azure/datafactory/datasetHttp.go index 6dbeba300b..b0748f3f15 100644 --- a/sdk/go/azure/datafactory/datasetHttp.go +++ b/sdk/go/azure/datafactory/datasetHttp.go @@ -15,6 +15,58 @@ import ( // Manages an Azure HTTP Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceWeb, err := datafactory.NewLinkedServiceWeb(ctx, "exampleLinkedServiceWeb", &datafactory.LinkedServiceWebArgs{ +// DataFactoryId: exampleFactory.ID(), +// AuthenticationType: pulumi.String("Anonymous"), +// Url: pulumi.String("https://www.bing.com"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetHttp(ctx, "exampleDatasetHttp", &datafactory.DatasetHttpArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceWeb.Name, +// RelativeUrl: pulumi.String("http://www.bing.com"), +// RequestBody: pulumi.String("foo=bar"), +// RequestMethod: pulumi.String("POST"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetJson.go b/sdk/go/azure/datafactory/datasetJson.go index d1aebe22e2..d94d1b4d06 100644 --- a/sdk/go/azure/datafactory/datasetJson.go +++ b/sdk/go/azure/datafactory/datasetJson.go @@ -15,6 +15,61 @@ import ( // Manages an Azure JSON Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceWeb, err := datafactory.NewLinkedServiceWeb(ctx, "exampleLinkedServiceWeb", &datafactory.LinkedServiceWebArgs{ +// DataFactoryId: exampleFactory.ID(), +// AuthenticationType: pulumi.String("Anonymous"), +// Url: pulumi.String("https://www.bing.com"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetJson(ctx, "exampleDatasetJson", &datafactory.DatasetJsonArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceWeb.Name, +// HttpServerLocation: &datafactory.DatasetJsonHttpServerLocationArgs{ +// RelativeUrl: pulumi.String("/fizz/buzz/"), +// Path: pulumi.String("foo/bar/"), +// Filename: pulumi.String("foo.txt"), +// }, +// Encoding: pulumi.String("UTF-8"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetMysql.go b/sdk/go/azure/datafactory/datasetMysql.go index 327708dfbf..439f76d8f3 100644 --- a/sdk/go/azure/datafactory/datasetMysql.go +++ b/sdk/go/azure/datafactory/datasetMysql.go @@ -15,6 +15,54 @@ import ( // Manages a MySQL Dataset inside a Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceMysql, err := datafactory.NewLinkedServiceMysql(ctx, "exampleLinkedServiceMysql", &datafactory.LinkedServiceMysqlArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetMysql(ctx, "exampleDatasetMysql", &datafactory.DatasetMysqlArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceMysql.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory MySQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetParquet.go b/sdk/go/azure/datafactory/datasetParquet.go index 7ebaeedbfb..6e207786fc 100644 --- a/sdk/go/azure/datafactory/datasetParquet.go +++ b/sdk/go/azure/datafactory/datasetParquet.go @@ -15,6 +15,60 @@ import ( // Manages an Azure Parquet Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceWeb, err := datafactory.NewLinkedServiceWeb(ctx, "exampleLinkedServiceWeb", &datafactory.LinkedServiceWebArgs{ +// DataFactoryId: exampleFactory.ID(), +// AuthenticationType: pulumi.String("Anonymous"), +// Url: pulumi.String("https://www.bing.com"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetParquet(ctx, "exampleDatasetParquet", &datafactory.DatasetParquetArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceWeb.Name, +// HttpServerLocation: &datafactory.DatasetParquetHttpServerLocationArgs{ +// RelativeUrl: pulumi.String("http://www.bing.com"), +// Path: pulumi.String("foo/bar/"), +// Filename: pulumi.String("fizz.txt"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetPostgresql.go b/sdk/go/azure/datafactory/datasetPostgresql.go index e8d755e2e7..32c28734e6 100644 --- a/sdk/go/azure/datafactory/datasetPostgresql.go +++ b/sdk/go/azure/datafactory/datasetPostgresql.go @@ -15,6 +15,54 @@ import ( // Manages a PostgreSQL Dataset inside a Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServicePostgresql, err := datafactory.NewLinkedServicePostgresql(ctx, "exampleLinkedServicePostgresql", &datafactory.LinkedServicePostgresqlArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetPostgresql(ctx, "exampleDatasetPostgresql", &datafactory.DatasetPostgresqlArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServicePostgresql.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory PostgreSQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/datasetSnowflake.go b/sdk/go/azure/datafactory/datasetSnowflake.go index dd0ef2a924..e51c970b9f 100644 --- a/sdk/go/azure/datafactory/datasetSnowflake.go +++ b/sdk/go/azure/datafactory/datasetSnowflake.go @@ -15,6 +15,56 @@ import ( // Manages a Snowflake Dataset inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceSnowflake, err := datafactory.NewLinkedServiceSnowflake(ctx, "exampleLinkedServiceSnowflake", &datafactory.LinkedServiceSnowflakeArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetSnowflake(ctx, "exampleDatasetSnowflake", &datafactory.DatasetSnowflakeArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceSnowflake.Name, +// SchemaName: pulumi.String("foo_schema"), +// TableName: pulumi.String("foo_table"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Snowflake Datasets can be imported using the `resource id`, diff --git a/sdk/go/azure/datafactory/datasetSqlServerTable.go b/sdk/go/azure/datafactory/datasetSqlServerTable.go index 16c4c503b6..994adf0db8 100644 --- a/sdk/go/azure/datafactory/datasetSqlServerTable.go +++ b/sdk/go/azure/datafactory/datasetSqlServerTable.go @@ -15,6 +15,54 @@ import ( // Manages a SQL Server Table Dataset inside a Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceSqlServer, err := datafactory.NewLinkedServiceSqlServer(ctx, "exampleLinkedServiceSqlServer", &datafactory.LinkedServiceSqlServerArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetSqlServerTable(ctx, "exampleDatasetSqlServerTable", &datafactory.DatasetSqlServerTableArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedServiceSqlServer.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory SQL Server Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/factory.go b/sdk/go/azure/datafactory/factory.go index 9e6fe45093..9f973386a6 100644 --- a/sdk/go/azure/datafactory/factory.go +++ b/sdk/go/azure/datafactory/factory.go @@ -15,6 +15,40 @@ import ( // Manages an Azure Data Factory (Version 2). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/flowletDataFlow.go b/sdk/go/azure/datafactory/flowletDataFlow.go index a354da85f7..42089f81d2 100644 --- a/sdk/go/azure/datafactory/flowletDataFlow.go +++ b/sdk/go/azure/datafactory/flowletDataFlow.go @@ -15,6 +15,208 @@ import ( // Manages a Flowlet Data Flow inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedCustomService, err := datafactory.NewLinkedCustomService(ctx, "exampleLinkedCustomService", &datafactory.LinkedCustomServiceArgs{ +// DataFactoryId: exampleFactory.ID(), +// Type: pulumi.String("AzureBlobStorage"), +// TypePropertiesJson: exampleAccount.PrimaryConnectionString.ApplyT(func(primaryConnectionString string) (string, error) { +// return fmt.Sprintf("{\n \"connectionString\": \"%v\"\n}\n", primaryConnectionString), nil +// }).(pulumi.StringOutput), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetJson(ctx, "example1DatasetJson", &datafactory.DatasetJsonArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedCustomService.Name, +// AzureBlobStorageLocation: &datafactory.DatasetJsonAzureBlobStorageLocationArgs{ +// Container: pulumi.String("container"), +// Path: pulumi.String("foo/bar/"), +// Filename: pulumi.String("foo.txt"), +// }, +// Encoding: pulumi.String("UTF-8"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewDatasetJson(ctx, "example2DatasetJson", &datafactory.DatasetJsonArgs{ +// DataFactoryId: exampleFactory.ID(), +// LinkedServiceName: exampleLinkedCustomService.Name, +// AzureBlobStorageLocation: &datafactory.DatasetJsonAzureBlobStorageLocationArgs{ +// Container: pulumi.String("container"), +// Path: pulumi.String("foo/bar/"), +// Filename: pulumi.String("bar.txt"), +// }, +// Encoding: pulumi.String("UTF-8"), +// }) +// if err != nil { +// return err +// } +// example1FlowletDataFlow, err := datafactory.NewFlowletDataFlow(ctx, "example1FlowletDataFlow", &datafactory.FlowletDataFlowArgs{ +// DataFactoryId: exampleFactory.ID(), +// Sources: datafactory.FlowletDataFlowSourceArray{ +// &datafactory.FlowletDataFlowSourceArgs{ +// Name: pulumi.String("source1"), +// LinkedService: &datafactory.FlowletDataFlowSourceLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Sinks: datafactory.FlowletDataFlowSinkArray{ +// &datafactory.FlowletDataFlowSinkArgs{ +// Name: pulumi.String("sink1"), +// LinkedService: &datafactory.FlowletDataFlowSinkLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Script: pulumi.String(`source( +// allowSchemaDrift: true, +// validateSchema: false, +// limit: 100, +// ignoreNoFilesFound: false, +// documentForm: 'documentPerLine') ~> source1 +// +// source1 sink( +// +// allowSchemaDrift: true, +// validateSchema: false, +// skipDuplicateMapInputs: true, +// skipDuplicateMapOutputs: true) ~> sink1 +// +// `), +// +// }) +// if err != nil { +// return err +// } +// example2FlowletDataFlow, err := datafactory.NewFlowletDataFlow(ctx, "example2FlowletDataFlow", &datafactory.FlowletDataFlowArgs{ +// DataFactoryId: exampleFactory.ID(), +// Sources: datafactory.FlowletDataFlowSourceArray{ +// &datafactory.FlowletDataFlowSourceArgs{ +// Name: pulumi.String("source1"), +// LinkedService: &datafactory.FlowletDataFlowSourceLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Sinks: datafactory.FlowletDataFlowSinkArray{ +// &datafactory.FlowletDataFlowSinkArgs{ +// Name: pulumi.String("sink1"), +// LinkedService: &datafactory.FlowletDataFlowSinkLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Script: pulumi.String(`source( +// allowSchemaDrift: true, +// validateSchema: false, +// limit: 100, +// ignoreNoFilesFound: false, +// documentForm: 'documentPerLine') ~> source1 +// +// source1 sink( +// +// allowSchemaDrift: true, +// validateSchema: false, +// skipDuplicateMapInputs: true, +// skipDuplicateMapOutputs: true) ~> sink1 +// +// `), +// +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewFlowletDataFlow(ctx, "exampleFlowletDataFlow", &datafactory.FlowletDataFlowArgs{ +// DataFactoryId: exampleFactory.ID(), +// Sources: datafactory.FlowletDataFlowSourceArray{ +// &datafactory.FlowletDataFlowSourceArgs{ +// Name: pulumi.String("source1"), +// Flowlet: &datafactory.FlowletDataFlowSourceFlowletArgs{ +// Name: example1FlowletDataFlow.Name, +// }, +// LinkedService: &datafactory.FlowletDataFlowSourceLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Sinks: datafactory.FlowletDataFlowSinkArray{ +// &datafactory.FlowletDataFlowSinkArgs{ +// Name: pulumi.String("sink1"), +// Flowlet: &datafactory.FlowletDataFlowSinkFlowletArgs{ +// Name: example2FlowletDataFlow.Name, +// }, +// LinkedService: &datafactory.FlowletDataFlowSinkLinkedServiceArgs{ +// Name: exampleLinkedCustomService.Name, +// }, +// }, +// }, +// Script: pulumi.String(`source( +// allowSchemaDrift: true, +// validateSchema: false, +// limit: 100, +// ignoreNoFilesFound: false, +// documentForm: 'documentPerLine') ~> source1 +// +// source1 sink( +// +// allowSchemaDrift: true, +// validateSchema: false, +// skipDuplicateMapInputs: true, +// skipDuplicateMapOutputs: true) ~> sink1 +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Flowlet Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/getFactory.go b/sdk/go/azure/datafactory/getFactory.go index 78e2c9e27f..a73bcd343d 100644 --- a/sdk/go/azure/datafactory/getFactory.go +++ b/sdk/go/azure/datafactory/getFactory.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Azure Data Factory (Version 2). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := datafactory.LookupFactory(ctx, &datafactory.LookupFactoryArgs{ +// Name: "existing-adf", +// ResourceGroupName: "existing-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupFactory(ctx *pulumi.Context, args *LookupFactoryArgs, opts ...pulumi.InvokeOption) (*LookupFactoryResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFactoryResult diff --git a/sdk/go/azure/datafactory/integrationRuntimeManaged.go b/sdk/go/azure/datafactory/integrationRuntimeManaged.go index b8ae0f3f12..71c7f7acff 100644 --- a/sdk/go/azure/datafactory/integrationRuntimeManaged.go +++ b/sdk/go/azure/datafactory/integrationRuntimeManaged.go @@ -17,6 +17,48 @@ import ( // // > **NOTE:** The `datafactory.IntegrationRuntimeManaged` resource has been superseded by the `datafactory.IntegrationRuntimeSsis` resource. We recommend using the `datafactory.IntegrationRuntimeSsis` resource for new deployments. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewIntegrationRuntimeManaged(ctx, "exampleIntegrationRuntimeManaged", &datafactory.IntegrationRuntimeManagedArgs{ +// DataFactoryId: exampleFactory.ID(), +// Location: exampleResourceGroup.Location, +// NodeSize: pulumi.String("Standard_D8_v3"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Integration Managed Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/integrationRuntimeRule.go b/sdk/go/azure/datafactory/integrationRuntimeRule.go index 2a283a1af3..f10b79fca4 100644 --- a/sdk/go/azure/datafactory/integrationRuntimeRule.go +++ b/sdk/go/azure/datafactory/integrationRuntimeRule.go @@ -15,6 +15,47 @@ import ( // Manages a Data Factory Azure Integration Runtime. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewIntegrationRuntimeRule(ctx, "exampleIntegrationRuntimeRule", &datafactory.IntegrationRuntimeRuleArgs{ +// DataFactoryId: exampleFactory.ID(), +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/integrationRuntimeSelfHosted.go b/sdk/go/azure/datafactory/integrationRuntimeSelfHosted.go index 593ba67bb3..5de028f8b3 100644 --- a/sdk/go/azure/datafactory/integrationRuntimeSelfHosted.go +++ b/sdk/go/azure/datafactory/integrationRuntimeSelfHosted.go @@ -15,6 +15,46 @@ import ( // Manages a Data Factory Self-hosted Integration Runtime. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewIntegrationRuntimeSelfHosted(ctx, "exampleIntegrationRuntimeSelfHosted", &datafactory.IntegrationRuntimeSelfHostedArgs{ +// DataFactoryId: exampleFactory.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factories can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/integrationRuntimeSsis.go b/sdk/go/azure/datafactory/integrationRuntimeSsis.go index 40073fd93e..41d6ae0f14 100644 --- a/sdk/go/azure/datafactory/integrationRuntimeSsis.go +++ b/sdk/go/azure/datafactory/integrationRuntimeSsis.go @@ -15,6 +15,48 @@ import ( // Manages a Data Factory Azure-SSIS Integration Runtime. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewIntegrationRuntimeSsis(ctx, "exampleIntegrationRuntimeSsis", &datafactory.IntegrationRuntimeSsisArgs{ +// DataFactoryId: exampleFactory.ID(), +// Location: exampleResourceGroup.Location, +// NodeSize: pulumi.String("Standard_D8_v3"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Azure-SSIS Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedCustomService.go b/sdk/go/azure/datafactory/linkedCustomService.go index c1083fc3b0..8926ac8ec2 100644 --- a/sdk/go/azure/datafactory/linkedCustomService.go +++ b/sdk/go/azure/datafactory/linkedCustomService.go @@ -15,6 +15,76 @@ import ( // Manages a Linked Service (connection) between a resource and Azure Data Factory. This is a generic resource that supports all different Linked Service Types. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datafactory.FactoryIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedCustomService(ctx, "exampleLinkedCustomService", &datafactory.LinkedCustomServiceArgs{ +// DataFactoryId: exampleFactory.ID(), +// Type: pulumi.String("AzureBlobStorage"), +// Description: pulumi.String("test description"), +// TypePropertiesJson: exampleAccount.PrimaryConnectionString.ApplyT(func(primaryConnectionString string) (string, error) { +// return fmt.Sprintf("{\n \"connectionString\":\"%v\"\n}\n", primaryConnectionString), nil +// }).(pulumi.StringOutput), +// Parameters: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// "Env": pulumi.String("Test"), +// }, +// Annotations: pulumi.StringArray{ +// pulumi.String("test1"), +// pulumi.String("test2"), +// pulumi.String("test3"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceAzureBlobStorage.go b/sdk/go/azure/datafactory/linkedServiceAzureBlobStorage.go index 43961e0d41..a37878d73f 100644 --- a/sdk/go/azure/datafactory/linkedServiceAzureBlobStorage.go +++ b/sdk/go/azure/datafactory/linkedServiceAzureBlobStorage.go @@ -15,6 +15,132 @@ import ( // Manages a Linked Service (connection) between an Azure Blob Storage Account and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount := storage.LookupAccountOutput(ctx, storage.GetAccountOutputArgs{ +// Name: pulumi.String("storageaccountname"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureBlobStorage(ctx, "exampleLinkedServiceAzureBlobStorage", &datafactory.LinkedServiceAzureBlobStorageArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: exampleAccount.ApplyT(func(exampleAccount storage.GetAccountResult) (*string, error) { +// return &exampleAccount.PrimaryConnectionString, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With SAS URI And SAS Token +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// testFactory, err := datafactory.NewFactory(ctx, "testFactory", &datafactory.FactoryArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// testKeyVault, err := keyvault.NewKeyVault(ctx, "testKeyVault", &keyvault.KeyVaultArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// testLinkedServiceKeyVault, err := datafactory.NewLinkedServiceKeyVault(ctx, "testLinkedServiceKeyVault", &datafactory.LinkedServiceKeyVaultArgs{ +// DataFactoryId: testFactory.ID(), +// KeyVaultId: testKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureBlobStorage(ctx, "testLinkedServiceAzureBlobStorage", &datafactory.LinkedServiceAzureBlobStorageArgs{ +// DataFactoryId: testFactory.ID(), +// SasUri: pulumi.String("https://example.blob.core.windows.net"), +// KeyVaultSasToken: &datafactory.LinkedServiceAzureBlobStorageKeyVaultSasTokenArgs{ +// LinkedServiceName: testLinkedServiceKeyVault.Name, +// SecretName: pulumi.String("secret"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureBlobStorage(ctx, "testDatafactory/linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage", &datafactory.LinkedServiceAzureBlobStorageArgs{ +// DataFactoryId: testFactory.ID(), +// ServiceEndpoint: pulumi.String("https://example.blob.core.windows.net"), +// ServicePrincipalId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// ServicePrincipalLinkedKeyVaultKey: &datafactory.LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKeyArgs{ +// LinkedServiceName: testLinkedServiceKeyVault.Name, +// SecretName: pulumi.String("secret"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceAzureDatabricks.go b/sdk/go/azure/datafactory/linkedServiceAzureDatabricks.go index eb922cca36..e07e92e851 100644 --- a/sdk/go/azure/datafactory/linkedServiceAzureDatabricks.go +++ b/sdk/go/azure/datafactory/linkedServiceAzureDatabricks.go @@ -16,6 +16,144 @@ import ( // Manages a Linked Service (connection) between Azure Databricks and Azure Data Factory. // // ## Example Usage +// ### With Managed Identity & New Cluster +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databricks" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datafactory.FactoryIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := databricks.NewWorkspace(ctx, "exampleWorkspace", &databricks.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureDatabricks(ctx, "msiLinked", &datafactory.LinkedServiceAzureDatabricksArgs{ +// DataFactoryId: exampleFactory.ID(), +// Description: pulumi.String("ADB Linked Service via MSI"), +// AdbDomain: exampleWorkspace.WorkspaceUrl.ApplyT(func(workspaceUrl string) (string, error) { +// return fmt.Sprintf("https://%v", workspaceUrl), nil +// }).(pulumi.StringOutput), +// MsiWorkSpaceResourceId: exampleWorkspace.ID(), +// NewClusterConfig: &datafactory.LinkedServiceAzureDatabricksNewClusterConfigArgs{ +// NodeType: pulumi.String("Standard_NC12"), +// ClusterVersion: pulumi.String("5.5.x-gpu-scala2.11"), +// MinNumberOfWorkers: pulumi.Int(1), +// MaxNumberOfWorkers: pulumi.Int(5), +// DriverNodeType: pulumi.String("Standard_NC12"), +// LogDestination: pulumi.String("dbfs:/logs"), +// CustomTags: pulumi.StringMap{ +// "custom_tag1": pulumi.String("sct_value_1"), +// "custom_tag2": pulumi.String("sct_value_2"), +// }, +// SparkConfig: pulumi.StringMap{ +// "config1": pulumi.String("value1"), +// "config2": pulumi.String("value2"), +// }, +// SparkEnvironmentVariables: pulumi.StringMap{ +// "envVar1": pulumi.String("value1"), +// "envVar2": pulumi.String("value2"), +// }, +// InitScripts: pulumi.StringArray{ +// pulumi.String("init.sh"), +// pulumi.String("init2.sh"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Access Token & Existing Cluster +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databricks" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := databricks.NewWorkspace(ctx, "exampleWorkspace", &databricks.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureDatabricks(ctx, "atLinked", &datafactory.LinkedServiceAzureDatabricksArgs{ +// DataFactoryId: exampleFactory.ID(), +// Description: pulumi.String("ADB Linked Service via Access Token"), +// ExistingClusterId: pulumi.String("0308-201146-sly615"), +// AccessToken: pulumi.String("SomeDatabricksAccessToken"), +// AdbDomain: exampleWorkspace.WorkspaceUrl.ApplyT(func(workspaceUrl string) (string, error) { +// return fmt.Sprintf("https://%v", workspaceUrl), nil +// }).(pulumi.StringOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/datafactory/linkedServiceAzureFileStorage.go b/sdk/go/azure/datafactory/linkedServiceAzureFileStorage.go index 79a079a723..26fbbca391 100644 --- a/sdk/go/azure/datafactory/linkedServiceAzureFileStorage.go +++ b/sdk/go/azure/datafactory/linkedServiceAzureFileStorage.go @@ -15,6 +15,54 @@ import ( // Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount := storage.LookupAccountOutput(ctx, storage.GetAccountOutputArgs{ +// Name: pulumi.String("storageaccountname"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureFileStorage(ctx, "exampleLinkedServiceAzureFileStorage", &datafactory.LinkedServiceAzureFileStorageArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: exampleAccount.ApplyT(func(exampleAccount storage.GetAccountResult) (*string, error) { +// return &exampleAccount.PrimaryConnectionString, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceAzureFunction.go b/sdk/go/azure/datafactory/linkedServiceAzureFunction.go index 8722e970fd..c1e7ad57ae 100644 --- a/sdk/go/azure/datafactory/linkedServiceAzureFunction.go +++ b/sdk/go/azure/datafactory/linkedServiceAzureFunction.go @@ -15,6 +15,57 @@ import ( // Manages a Linked Service (connection) between an Azure Function and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFunctionApp := appservice.LookupFunctionAppOutput(ctx, appservice.GetFunctionAppOutputArgs{ +// Name: pulumi.String("test-azure-functions"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureFunction(ctx, "exampleLinkedServiceAzureFunction", &datafactory.LinkedServiceAzureFunctionArgs{ +// DataFactoryId: exampleFactory.ID(), +// Url: exampleFunctionApp.ApplyT(func(exampleFunctionApp appservice.GetFunctionAppResult) (string, error) { +// return fmt.Sprintf("https://%v", exampleFunctionApp.DefaultHostname), nil +// }).(pulumi.StringOutput), +// Key: pulumi.String("foo"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceAzureSqlDatabase.go b/sdk/go/azure/datafactory/linkedServiceAzureSqlDatabase.go index 2da316b858..a84aba2497 100644 --- a/sdk/go/azure/datafactory/linkedServiceAzureSqlDatabase.go +++ b/sdk/go/azure/datafactory/linkedServiceAzureSqlDatabase.go @@ -15,6 +15,47 @@ import ( // Manages a Linked Service (connection) between Azure SQL Database and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureSqlDatabase(ctx, "exampleLinkedServiceAzureSqlDatabase", &datafactory.LinkedServiceAzureSqlDatabaseArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("data source=serverhostname;initial catalog=master;user id=testUser;Password=test;integrated security=False;encrypt=True;connection timeout=30"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Azure SQL Database Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceAzureTableStorage.go b/sdk/go/azure/datafactory/linkedServiceAzureTableStorage.go index a9df46aeaa..88af93aa7a 100644 --- a/sdk/go/azure/datafactory/linkedServiceAzureTableStorage.go +++ b/sdk/go/azure/datafactory/linkedServiceAzureTableStorage.go @@ -15,6 +15,54 @@ import ( // Manages a Linked Service (connection) between an Azure Table Storage and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount := storage.LookupAccountOutput(ctx, storage.GetAccountOutputArgs{ +// Name: pulumi.String("storageaccountname"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceAzureTableStorage(ctx, "exampleLinkedServiceAzureTableStorage", &datafactory.LinkedServiceAzureTableStorageArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: exampleAccount.ApplyT(func(exampleAccount storage.GetAccountResult) (*string, error) { +// return &exampleAccount.PrimaryConnectionString, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceCosmosDb.go b/sdk/go/azure/datafactory/linkedServiceCosmosDb.go index 99b7a30143..4e03c18743 100644 --- a/sdk/go/azure/datafactory/linkedServiceCosmosDb.go +++ b/sdk/go/azure/datafactory/linkedServiceCosmosDb.go @@ -15,6 +15,57 @@ import ( // Manages a Linked Service (connection) between a CosmosDB and Azure Data Factory using SQL API. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.LookupAccount(ctx, &cosmosdb.LookupAccountArgs{ +// Name: "tfex-cosmosdb-account", +// ResourceGroupName: "tfex-cosmosdb-account-rg", +// }, nil) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceCosmosDb(ctx, "exampleLinkedServiceCosmosDb", &datafactory.LinkedServiceCosmosDbArgs{ +// DataFactoryId: exampleFactory.ID(), +// AccountEndpoint: *pulumi.String(exampleAccount.Endpoint), +// AccountKey: *pulumi.String(exampleAccount.PrimaryKey), +// Database: pulumi.String("foo"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceCosmosDbMongoApi.go b/sdk/go/azure/datafactory/linkedServiceCosmosDbMongoApi.go index 5085feec71..6e66256c87 100644 --- a/sdk/go/azure/datafactory/linkedServiceCosmosDbMongoApi.go +++ b/sdk/go/azure/datafactory/linkedServiceCosmosDbMongoApi.go @@ -17,6 +17,48 @@ import ( // // > **Note:** All arguments including the client secret will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceCosmosDbMongoApi(ctx, "exampleLinkedServiceCosmosDbMongoApi", &datafactory.LinkedServiceCosmosDbMongoApiArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("mongodb://testinstance:testkey@testinstance.documents.azure.com:10255/?ssl=true"), +// Database: pulumi.String("foo"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceDataLakeStorageGen2.go b/sdk/go/azure/datafactory/linkedServiceDataLakeStorageGen2.go index 97d3b3bb58..6631e82dde 100644 --- a/sdk/go/azure/datafactory/linkedServiceDataLakeStorageGen2.go +++ b/sdk/go/azure/datafactory/linkedServiceDataLakeStorageGen2.go @@ -15,6 +15,54 @@ import ( // Manages a Linked Service (connection) between Data Lake Storage Gen2 and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceDataLakeStorageGen2(ctx, "exampleLinkedServiceDataLakeStorageGen2", &datafactory.LinkedServiceDataLakeStorageGen2Args{ +// DataFactoryId: exampleFactory.ID(), +// ServicePrincipalId: *pulumi.String(current.ClientId), +// ServicePrincipalKey: pulumi.String("exampleKey"), +// Tenant: pulumi.String("11111111-1111-1111-1111-111111111111"), +// Url: pulumi.String("https://datalakestoragegen2"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Data Lake Storage Gen2 Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceKeyVault.go b/sdk/go/azure/datafactory/linkedServiceKeyVault.go index ee9a222c45..3dfa4e0952 100644 --- a/sdk/go/azure/datafactory/linkedServiceKeyVault.go +++ b/sdk/go/azure/datafactory/linkedServiceKeyVault.go @@ -15,6 +15,61 @@ import ( // Manages a Linked Service (connection) between Key Vault and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceKeyVault(ctx, "exampleLinkedServiceKeyVault", &datafactory.LinkedServiceKeyVaultArgs{ +// DataFactoryId: exampleFactory.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Key Vault Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceKusto.go b/sdk/go/azure/datafactory/linkedServiceKusto.go index a5455f2e38..1ab9ae3cc4 100644 --- a/sdk/go/azure/datafactory/linkedServiceKusto.go +++ b/sdk/go/azure/datafactory/linkedServiceKusto.go @@ -15,6 +15,88 @@ import ( // Manages a Linked Service (connection) between a Kusto Cluster and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datafactory.FactoryIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceKusto(ctx, "exampleLinkedServiceKusto", &datafactory.LinkedServiceKustoArgs{ +// DataFactoryId: exampleFactory.ID(), +// KustoEndpoint: exampleCluster.Uri, +// KustoDatabaseName: exampleDatabase.Name, +// UseManagedIdentity: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewDatabasePrincipalAssignment(ctx, "exampleDatabasePrincipalAssignment", &kusto.DatabasePrincipalAssignmentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ClusterName: exampleCluster.Name, +// DatabaseName: exampleDatabase.Name, +// TenantId: exampleFactory.Identity.ApplyT(func(identity datafactory.FactoryIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// PrincipalId: exampleFactory.Identity.ApplyT(func(identity datafactory.FactoryIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// PrincipalType: pulumi.String("App"), +// Role: pulumi.String("Viewer"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceMysql.go b/sdk/go/azure/datafactory/linkedServiceMysql.go index 5af05a2b88..2d004d9b91 100644 --- a/sdk/go/azure/datafactory/linkedServiceMysql.go +++ b/sdk/go/azure/datafactory/linkedServiceMysql.go @@ -15,6 +15,47 @@ import ( // Manages a Linked Service (connection) between MySQL and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceMysql(ctx, "exampleLinkedServiceMysql", &datafactory.LinkedServiceMysqlArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory MySQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceOdata.go b/sdk/go/azure/datafactory/linkedServiceOdata.go index 21ceb32b59..35492e0455 100644 --- a/sdk/go/azure/datafactory/linkedServiceOdata.go +++ b/sdk/go/azure/datafactory/linkedServiceOdata.go @@ -17,6 +17,58 @@ import ( // // > **Note:** All arguments including the connectionString will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceOdata(ctx, "anonymous", &datafactory.LinkedServiceOdataArgs{ +// DataFactoryId: exampleFactory.ID(), +// Url: pulumi.String("https://services.odata.org/v4/TripPinServiceRW/People"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceOdata(ctx, "basicAuth", &datafactory.LinkedServiceOdataArgs{ +// DataFactoryId: exampleFactory.ID(), +// Url: pulumi.String("https://services.odata.org/v4/TripPinServiceRW/People"), +// BasicAuthentication: &datafactory.LinkedServiceOdataBasicAuthenticationArgs{ +// Username: pulumi.String("emma"), +// Password: pulumi.String("Ch4ngeM3!"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory OData Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceOdbc.go b/sdk/go/azure/datafactory/linkedServiceOdbc.go index 3d19892da1..a7c7770880 100644 --- a/sdk/go/azure/datafactory/linkedServiceOdbc.go +++ b/sdk/go/azure/datafactory/linkedServiceOdbc.go @@ -17,6 +17,58 @@ import ( // // > **Note:** All arguments including the connectionString will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceOdbc(ctx, "anonymous", &datafactory.LinkedServiceOdbcArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceOdbc(ctx, "basicAuth", &datafactory.LinkedServiceOdbcArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;"), +// BasicAuthentication: &datafactory.LinkedServiceOdbcBasicAuthenticationArgs{ +// Username: pulumi.String("onrylmz"), +// Password: pulumi.String("Ch4ngeM3!"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory ODBC Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServicePostgresql.go b/sdk/go/azure/datafactory/linkedServicePostgresql.go index c138b21dae..5b5b1e1430 100644 --- a/sdk/go/azure/datafactory/linkedServicePostgresql.go +++ b/sdk/go/azure/datafactory/linkedServicePostgresql.go @@ -15,6 +15,47 @@ import ( // Manages a Linked Service (connection) between PostgreSQL and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServicePostgresql(ctx, "exampleLinkedServicePostgresql", &datafactory.LinkedServicePostgresqlArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory PostgreSQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceSftp.go b/sdk/go/azure/datafactory/linkedServiceSftp.go index 47ab801dcc..48ab6f284c 100644 --- a/sdk/go/azure/datafactory/linkedServiceSftp.go +++ b/sdk/go/azure/datafactory/linkedServiceSftp.go @@ -15,6 +15,51 @@ import ( // Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceSftp(ctx, "exampleLinkedServiceSftp", &datafactory.LinkedServiceSftpArgs{ +// DataFactoryId: exampleFactory.ID(), +// AuthenticationType: pulumi.String("Basic"), +// Host: pulumi.String("http://www.bing.com"), +// Port: pulumi.Int(22), +// Username: pulumi.String("foo"), +// Password: pulumi.String("bar"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceSnowflake.go b/sdk/go/azure/datafactory/linkedServiceSnowflake.go index 7d0d42b977..0c96f511cf 100644 --- a/sdk/go/azure/datafactory/linkedServiceSnowflake.go +++ b/sdk/go/azure/datafactory/linkedServiceSnowflake.go @@ -15,6 +15,112 @@ import ( // Manages a Linked Service (connection) between Snowflake and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceSnowflake(ctx, "exampleLinkedServiceSnowflake", &datafactory.LinkedServiceSnowflakeArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Password In Key Vault +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceKeyVault, err := datafactory.NewLinkedServiceKeyVault(ctx, "exampleLinkedServiceKeyVault", &datafactory.LinkedServiceKeyVaultArgs{ +// DataFactoryId: exampleFactory.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceSnowflake(ctx, "exampleLinkedServiceSnowflake", &datafactory.LinkedServiceSnowflakeArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh"), +// KeyVaultPassword: &datafactory.LinkedServiceSnowflakeKeyVaultPasswordArgs{ +// LinkedServiceName: exampleLinkedServiceKeyVault.Name, +// SecretName: pulumi.String("secret"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Snowflake Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceSqlServer.go b/sdk/go/azure/datafactory/linkedServiceSqlServer.go index 8a2b5c43c5..7c81385999 100644 --- a/sdk/go/azure/datafactory/linkedServiceSqlServer.go +++ b/sdk/go/azure/datafactory/linkedServiceSqlServer.go @@ -15,6 +15,112 @@ import ( // Manages a Linked Service (connection) between a SQL Server and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceSqlServer(ctx, "exampleLinkedServiceSqlServer", &datafactory.LinkedServiceSqlServerArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Password In Key Vault +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceKeyVault, err := datafactory.NewLinkedServiceKeyVault(ctx, "exampleLinkedServiceKeyVault", &datafactory.LinkedServiceKeyVaultArgs{ +// DataFactoryId: exampleFactory.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceSqlServer(ctx, "exampleLinkedServiceSqlServer", &datafactory.LinkedServiceSqlServerArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;"), +// KeyVaultPassword: &datafactory.LinkedServiceSqlServerKeyVaultPasswordArgs{ +// LinkedServiceName: exampleLinkedServiceKeyVault.Name, +// SecretName: pulumi.String("secret"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory SQL Server Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceSynapse.go b/sdk/go/azure/datafactory/linkedServiceSynapse.go index 578c2b9d18..dbee7ecf3d 100644 --- a/sdk/go/azure/datafactory/linkedServiceSynapse.go +++ b/sdk/go/azure/datafactory/linkedServiceSynapse.go @@ -15,6 +15,112 @@ import ( // Manages a Linked Service (connection) between Synapse and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceSynapse(ctx, "exampleLinkedServiceSynapse", &datafactory.LinkedServiceSynapseArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Password In Key Vault +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleLinkedServiceKeyVault, err := datafactory.NewLinkedServiceKeyVault(ctx, "exampleLinkedServiceKeyVault", &datafactory.LinkedServiceKeyVaultArgs{ +// DataFactoryId: exampleFactory.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceSynapse(ctx, "exampleLinkedServiceSynapse", &datafactory.LinkedServiceSynapseArgs{ +// DataFactoryId: exampleFactory.ID(), +// ConnectionString: pulumi.String("Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;"), +// KeyVaultPassword: &datafactory.LinkedServiceSynapseKeyVaultPasswordArgs{ +// LinkedServiceName: exampleLinkedServiceKeyVault.Name, +// SecretName: pulumi.String("secret"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Synapse Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/linkedServiceWeb.go b/sdk/go/azure/datafactory/linkedServiceWeb.go index 73d857c0bf..19c143c27c 100644 --- a/sdk/go/azure/datafactory/linkedServiceWeb.go +++ b/sdk/go/azure/datafactory/linkedServiceWeb.go @@ -15,6 +15,48 @@ import ( // Manages a Linked Service (connection) between a Web Server and Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewLinkedServiceWeb(ctx, "exampleLinkedServiceWeb", &datafactory.LinkedServiceWebArgs{ +// DataFactoryId: exampleFactory.ID(), +// AuthenticationType: pulumi.String("Anonymous"), +// Url: pulumi.String("http://www.bing.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/managedPrivateEndpoint.go b/sdk/go/azure/datafactory/managedPrivateEndpoint.go index 5b9085d95d..7f8efd9a1a 100644 --- a/sdk/go/azure/datafactory/managedPrivateEndpoint.go +++ b/sdk/go/azure/datafactory/managedPrivateEndpoint.go @@ -15,6 +15,60 @@ import ( // Manages a Data Factory Managed Private Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ManagedVirtualNetworkEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewManagedPrivateEndpoint(ctx, "exampleManagedPrivateEndpoint", &datafactory.ManagedPrivateEndpointArgs{ +// DataFactoryId: exampleFactory.ID(), +// TargetResourceId: exampleAccount.ID(), +// SubresourceName: pulumi.String("blob"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/pipeline.go b/sdk/go/azure/datafactory/pipeline.go index 60c5b94fe5..b67aa961ad 100644 --- a/sdk/go/azure/datafactory/pipeline.go +++ b/sdk/go/azure/datafactory/pipeline.go @@ -15,6 +15,89 @@ import ( // Manages a Pipeline inside a Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewPipeline(ctx, "examplePipeline", &datafactory.PipelineArgs{ +// DataFactoryId: exampleFactory.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Activities +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := datafactory.NewPipeline(ctx, "test", &datafactory.PipelineArgs{ +// DataFactoryId: pulumi.Any(azurerm_data_factory.Test.Id), +// Variables: pulumi.StringMap{ +// "bob": pulumi.String("item1"), +// }, +// ActivitiesJson: pulumi.String(`[ +// { +// "name": "Append variable1", +// "type": "AppendVariable", +// "dependsOn": [], +// "userProperties": [], +// "typeProperties": { +// "variableName": "bob", +// "value": "something" +// } +// } +// +// ] +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Pipeline's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/triggerBlobEvent.go b/sdk/go/azure/datafactory/triggerBlobEvent.go index 1e66c33374..b1ca64cd11 100644 --- a/sdk/go/azure/datafactory/triggerBlobEvent.go +++ b/sdk/go/azure/datafactory/triggerBlobEvent.go @@ -15,6 +15,88 @@ import ( // Manages a Blob Event Trigger inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePipeline, err := datafactory.NewPipeline(ctx, "examplePipeline", &datafactory.PipelineArgs{ +// DataFactoryId: exampleFactory.ID(), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewTriggerBlobEvent(ctx, "exampleTriggerBlobEvent", &datafactory.TriggerBlobEventArgs{ +// DataFactoryId: exampleFactory.ID(), +// StorageAccountId: exampleAccount.ID(), +// Events: pulumi.StringArray{ +// pulumi.String("Microsoft.Storage.BlobCreated"), +// pulumi.String("Microsoft.Storage.BlobDeleted"), +// }, +// BlobPathEndsWith: pulumi.String(".txt"), +// IgnoreEmptyBlobs: pulumi.Bool(true), +// Activated: pulumi.Bool(true), +// Annotations: pulumi.StringArray{ +// pulumi.String("test1"), +// pulumi.String("test2"), +// pulumi.String("test3"), +// }, +// Description: pulumi.String("example description"), +// Pipelines: datafactory.TriggerBlobEventPipelineArray{ +// &datafactory.TriggerBlobEventPipelineArgs{ +// Name: examplePipeline.Name, +// Parameters: pulumi.StringMap{ +// "Env": pulumi.String("Prod"), +// }, +// }, +// }, +// AdditionalProperties: pulumi.StringMap{ +// "foo": pulumi.String("foo1"), +// "bar": pulumi.String("bar2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Blob Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/triggerCustomEvent.go b/sdk/go/azure/datafactory/triggerCustomEvent.go index ca8cd53df5..8d6d8dfc75 100644 --- a/sdk/go/azure/datafactory/triggerCustomEvent.go +++ b/sdk/go/azure/datafactory/triggerCustomEvent.go @@ -15,6 +15,85 @@ import ( // Manages a Custom Event Trigger inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePipeline, err := datafactory.NewPipeline(ctx, "examplePipeline", &datafactory.PipelineArgs{ +// DataFactoryId: exampleFactory.ID(), +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := eventgrid.NewTopic(ctx, "exampleTopic", &eventgrid.TopicArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewTriggerCustomEvent(ctx, "exampleTriggerCustomEvent", &datafactory.TriggerCustomEventArgs{ +// DataFactoryId: exampleFactory.ID(), +// EventgridTopicId: exampleTopic.ID(), +// Events: pulumi.StringArray{ +// pulumi.String("event1"), +// pulumi.String("event2"), +// }, +// SubjectBeginsWith: pulumi.String("abc"), +// SubjectEndsWith: pulumi.String("xyz"), +// Annotations: pulumi.StringArray{ +// pulumi.String("example1"), +// pulumi.String("example2"), +// pulumi.String("example3"), +// }, +// Description: pulumi.String("example description"), +// Pipelines: datafactory.TriggerCustomEventPipelineArray{ +// &datafactory.TriggerCustomEventPipelineArgs{ +// Name: examplePipeline.Name, +// Parameters: pulumi.StringMap{ +// "Env": pulumi.String("Prod"), +// }, +// }, +// }, +// AdditionalProperties: pulumi.StringMap{ +// "foo": pulumi.String("foo1"), +// "bar": pulumi.String("bar2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Custom Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/triggerSchedule.go b/sdk/go/azure/datafactory/triggerSchedule.go index ff65d82a49..0c1e470c2b 100644 --- a/sdk/go/azure/datafactory/triggerSchedule.go +++ b/sdk/go/azure/datafactory/triggerSchedule.go @@ -15,6 +15,55 @@ import ( // Manages a Trigger Schedule inside a Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePipeline, err := datafactory.NewPipeline(ctx, "examplePipeline", &datafactory.PipelineArgs{ +// DataFactoryId: exampleFactory.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewTriggerSchedule(ctx, "exampleTriggerSchedule", &datafactory.TriggerScheduleArgs{ +// DataFactoryId: exampleFactory.ID(), +// PipelineName: examplePipeline.Name, +// Interval: pulumi.Int(5), +// Frequency: pulumi.String("Day"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Schedule Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datafactory/triggerTumblingWindow.go b/sdk/go/azure/datafactory/triggerTumblingWindow.go index fe2e092bd1..a35b8c103c 100644 --- a/sdk/go/azure/datafactory/triggerTumblingWindow.go +++ b/sdk/go/azure/datafactory/triggerTumblingWindow.go @@ -15,6 +15,83 @@ import ( // Manages a Tumbling Window Trigger inside an Azure Data Factory. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFactory, err := datafactory.NewFactory(ctx, "exampleFactory", &datafactory.FactoryArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePipeline, err := datafactory.NewPipeline(ctx, "examplePipeline", &datafactory.PipelineArgs{ +// DataFactoryId: exampleFactory.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = datafactory.NewTriggerTumblingWindow(ctx, "exampleTriggerTumblingWindow", &datafactory.TriggerTumblingWindowArgs{ +// DataFactoryId: exampleFactory.ID(), +// StartTime: pulumi.String("2022-09-21T00:00:00Z"), +// EndTime: pulumi.String("2022-09-21T08:00:00Z"), +// Frequency: pulumi.String("Minute"), +// Interval: pulumi.Int(15), +// Delay: pulumi.String("16:00:00"), +// Annotations: pulumi.StringArray{ +// pulumi.String("example1"), +// pulumi.String("example2"), +// pulumi.String("example3"), +// }, +// Description: pulumi.String("example description"), +// Retry: &datafactory.TriggerTumblingWindowRetryArgs{ +// Count: pulumi.Int(1), +// Interval: pulumi.Int(30), +// }, +// Pipeline: &datafactory.TriggerTumblingWindowPipelineArgs{ +// Name: examplePipeline.Name, +// Parameters: pulumi.StringMap{ +// "Env": pulumi.String("Prod"), +// }, +// }, +// TriggerDependencies: datafactory.TriggerTumblingWindowTriggerDependencyArray{ +// &datafactory.TriggerTumblingWindowTriggerDependencyArgs{ +// Size: pulumi.String("24:00:00"), +// Offset: pulumi.String("-24:00:00"), +// }, +// }, +// AdditionalProperties: pulumi.StringMap{ +// "foo": pulumi.String("value1"), +// "bar": pulumi.String("value2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Factory Tumbling Window Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/backupInstanceBlogStorage.go b/sdk/go/azure/dataprotection/backupInstanceBlogStorage.go index fc7da94f13..f6a2f21d97 100644 --- a/sdk/go/azure/dataprotection/backupInstanceBlogStorage.go +++ b/sdk/go/azure/dataprotection/backupInstanceBlogStorage.go @@ -15,6 +15,84 @@ import ( // Manages a Backup Instance Blob Storage. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "exampleBackupVault", &dataprotection.BackupVaultArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatastoreType: pulumi.String("VaultStore"), +// Redundancy: pulumi.String("LocallyRedundant"), +// Identity: &dataprotection.BackupVaultIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Storage Account Backup Contributor"), +// PrincipalId: exampleBackupVault.Identity.ApplyT(func(identity dataprotection.BackupVaultIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// exampleBackupPolicyBlobStorage, err := dataprotection.NewBackupPolicyBlobStorage(ctx, "exampleBackupPolicyBlobStorage", &dataprotection.BackupPolicyBlobStorageArgs{ +// VaultId: exampleBackupVault.ID(), +// RetentionDuration: pulumi.String("P30D"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewBackupInstanceBlogStorage(ctx, "exampleBackupInstanceBlogStorage", &dataprotection.BackupInstanceBlogStorageArgs{ +// VaultId: exampleBackupVault.ID(), +// Location: exampleResourceGroup.Location, +// StorageAccountId: exampleAccount.ID(), +// BackupPolicyId: exampleBackupPolicyBlobStorage.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Instance Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/backupInstanceDisk.go b/sdk/go/azure/dataprotection/backupInstanceDisk.go index 0b4977c56b..eeed47bfe8 100644 --- a/sdk/go/azure/dataprotection/backupInstanceDisk.go +++ b/sdk/go/azure/dataprotection/backupInstanceDisk.go @@ -15,6 +15,97 @@ import ( // Manages a Backup Instance to back up Disk. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleManagedDisk, err := compute.NewManagedDisk(ctx, "exampleManagedDisk", &compute.ManagedDiskArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccountType: pulumi.String("Standard_LRS"), +// CreateOption: pulumi.String("Empty"), +// DiskSizeGb: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "exampleBackupVault", &dataprotection.BackupVaultArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatastoreType: pulumi.String("VaultStore"), +// Redundancy: pulumi.String("LocallyRedundant"), +// Identity: &dataprotection.BackupVaultIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example1", &authorization.AssignmentArgs{ +// Scope: exampleResourceGroup.ID(), +// RoleDefinitionName: pulumi.String("Disk Snapshot Contributor"), +// PrincipalId: exampleBackupVault.Identity.ApplyT(func(identity dataprotection.BackupVaultIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example2", &authorization.AssignmentArgs{ +// Scope: exampleManagedDisk.ID(), +// RoleDefinitionName: pulumi.String("Disk Backup Reader"), +// PrincipalId: exampleBackupVault.Identity.ApplyT(func(identity dataprotection.BackupVaultIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// exampleBackupPolicyDisk, err := dataprotection.NewBackupPolicyDisk(ctx, "exampleBackupPolicyDisk", &dataprotection.BackupPolicyDiskArgs{ +// VaultId: exampleBackupVault.ID(), +// BackupRepeatingTimeIntervals: pulumi.StringArray{ +// pulumi.String("R/2021-05-19T06:33:16+00:00/PT4H"), +// }, +// DefaultRetentionDuration: pulumi.String("P7D"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewBackupInstanceDisk(ctx, "exampleBackupInstanceDisk", &dataprotection.BackupInstanceDiskArgs{ +// Location: exampleBackupVault.Location, +// VaultId: exampleBackupVault.ID(), +// DiskId: exampleManagedDisk.ID(), +// SnapshotResourceGroupName: exampleResourceGroup.Name, +// BackupPolicyId: exampleBackupPolicyDisk.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Instance Disks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/backupInstancePostgresql.go b/sdk/go/azure/dataprotection/backupInstancePostgresql.go index ca2043c2b1..d65781a951 100644 --- a/sdk/go/azure/dataprotection/backupInstancePostgresql.go +++ b/sdk/go/azure/dataprotection/backupInstancePostgresql.go @@ -17,6 +17,177 @@ import ( // // > **Note:** Before using this resource, there are some prerequisite permissions for configure backup and restore. See more details from . // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(false), +// AutoGrowEnabled: pulumi.Bool(true), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Version: pulumi.String("9.5"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFirewallRule(ctx, "exampleFirewallRule", &postgresql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("0.0.0.0"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := postgresql.NewDatabase(ctx, "exampleDatabase", &postgresql.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Charset: pulumi.String("UTF8"), +// Collation: pulumi.String("English_United States.1252"), +// }) +// if err != nil { +// return err +// } +// exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "exampleBackupVault", &dataprotection.BackupVaultArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatastoreType: pulumi.String("VaultStore"), +// Redundancy: pulumi.String("LocallyRedundant"), +// Identity: &dataprotection.BackupVaultIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: exampleBackupVault.Identity.ApplyT(func(identity dataprotection.BackupVaultIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleBackupVault.Identity.ApplyT(func(identity dataprotection.BackupVaultIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSecret, err := keyvault.NewSecret(ctx, "exampleSecret", &keyvault.SecretArgs{ +// Value: pulumi.All(exampleServer.Name, exampleDatabase.Name, exampleServer.Name).ApplyT(func(_args []interface{}) (string, error) { +// exampleServerName := _args[0].(string) +// exampleDatabaseName := _args[1].(string) +// exampleServerName1 := _args[2].(string) +// return fmt.Sprintf("Server=%v.postgres.database.azure.com;Database=%v;Port=5432;User Id=psqladmin@%v;Password=H@Sh1CoR3!;Ssl Mode=Require;", exampleServerName, exampleDatabaseName, exampleServerName1), nil +// }).(pulumi.StringOutput), +// KeyVaultId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// exampleBackupPolicyPostgresql, err := dataprotection.NewBackupPolicyPostgresql(ctx, "exampleBackupPolicyPostgresql", &dataprotection.BackupPolicyPostgresqlArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VaultName: exampleBackupVault.Name, +// BackupRepeatingTimeIntervals: pulumi.StringArray{ +// pulumi.String("R/2021-05-23T02:30:00+00:00/P1W"), +// }, +// DefaultRetentionDuration: pulumi.String("P4M"), +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleServer.ID(), +// RoleDefinitionName: pulumi.String("Reader"), +// PrincipalId: exampleBackupVault.Identity.ApplyT(func(identity dataprotection.BackupVaultIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewBackupInstancePostgresql(ctx, "exampleBackupInstancePostgresql", &dataprotection.BackupInstancePostgresqlArgs{ +// Location: exampleResourceGroup.Location, +// VaultId: exampleBackupVault.ID(), +// DatabaseId: exampleDatabase.ID(), +// BackupPolicyId: exampleBackupPolicyPostgresql.ID(), +// DatabaseCredentialKeyVaultSecretId: exampleSecret.VersionlessId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Instance PostgreSQL can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/backupPolicyBlobStorage.go b/sdk/go/azure/dataprotection/backupPolicyBlobStorage.go index bb43026780..73642bf8b4 100644 --- a/sdk/go/azure/dataprotection/backupPolicyBlobStorage.go +++ b/sdk/go/azure/dataprotection/backupPolicyBlobStorage.go @@ -15,6 +15,49 @@ import ( // Manages a Backup Policy Blob Storage. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "exampleBackupVault", &dataprotection.BackupVaultArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatastoreType: pulumi.String("VaultStore"), +// Redundancy: pulumi.String("LocallyRedundant"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewBackupPolicyBlobStorage(ctx, "exampleBackupPolicyBlobStorage", &dataprotection.BackupPolicyBlobStorageArgs{ +// VaultId: exampleBackupVault.ID(), +// RetentionDuration: pulumi.String("P30D"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Policy Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/backupPolicyDisk.go b/sdk/go/azure/dataprotection/backupPolicyDisk.go index 435df2b3cb..e70b8e8cb3 100644 --- a/sdk/go/azure/dataprotection/backupPolicyDisk.go +++ b/sdk/go/azure/dataprotection/backupPolicyDisk.go @@ -15,6 +15,70 @@ import ( // Manages a Backup Policy Disk. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "exampleBackupVault", &dataprotection.BackupVaultArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatastoreType: pulumi.String("VaultStore"), +// Redundancy: pulumi.String("LocallyRedundant"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewBackupPolicyDisk(ctx, "exampleBackupPolicyDisk", &dataprotection.BackupPolicyDiskArgs{ +// VaultId: exampleBackupVault.ID(), +// BackupRepeatingTimeIntervals: pulumi.StringArray{ +// pulumi.String("R/2021-05-19T06:33:16+00:00/PT4H"), +// }, +// DefaultRetentionDuration: pulumi.String("P7D"), +// RetentionRules: dataprotection.BackupPolicyDiskRetentionRuleArray{ +// &dataprotection.BackupPolicyDiskRetentionRuleArgs{ +// Name: pulumi.String("Daily"), +// Duration: pulumi.String("P7D"), +// Priority: pulumi.Int(25), +// Criteria: &dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs{ +// AbsoluteCriteria: pulumi.String("FirstOfDay"), +// }, +// }, +// &dataprotection.BackupPolicyDiskRetentionRuleArgs{ +// Name: pulumi.String("Weekly"), +// Duration: pulumi.String("P7D"), +// Priority: pulumi.Int(20), +// Criteria: &dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs{ +// AbsoluteCriteria: pulumi.String("FirstOfWeek"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Policy Disks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/backupPolicyPostgresql.go b/sdk/go/azure/dataprotection/backupPolicyPostgresql.go index bcfab3e6a6..00547327ed 100644 --- a/sdk/go/azure/dataprotection/backupPolicyPostgresql.go +++ b/sdk/go/azure/dataprotection/backupPolicyPostgresql.go @@ -15,6 +15,93 @@ import ( // Manages a Backup Policy to back up PostgreSQL. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "exampleBackupVault", &dataprotection.BackupVaultArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatastoreType: pulumi.String("VaultStore"), +// Redundancy: pulumi.String("LocallyRedundant"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewBackupPolicyPostgresql(ctx, "exampleBackupPolicyPostgresql", &dataprotection.BackupPolicyPostgresqlArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VaultName: exampleBackupVault.Name, +// BackupRepeatingTimeIntervals: pulumi.StringArray{ +// pulumi.String("R/2021-05-23T02:30:00+00:00/P1W"), +// }, +// DefaultRetentionDuration: pulumi.String("P4M"), +// RetentionRules: dataprotection.BackupPolicyPostgresqlRetentionRuleArray{ +// &dataprotection.BackupPolicyPostgresqlRetentionRuleArgs{ +// Name: pulumi.String("weekly"), +// Duration: pulumi.String("P6M"), +// Priority: pulumi.Int(20), +// Criteria: &dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs{ +// AbsoluteCriteria: pulumi.String("FirstOfWeek"), +// }, +// }, +// &dataprotection.BackupPolicyPostgresqlRetentionRuleArgs{ +// Name: pulumi.String("thursday"), +// Duration: pulumi.String("P1W"), +// Priority: pulumi.Int(25), +// Criteria: &dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs{ +// DaysOfWeeks: pulumi.StringArray{ +// pulumi.String("Thursday"), +// }, +// ScheduledBackupTimes: pulumi.StringArray{ +// pulumi.String("2021-05-23T02:30:00Z"), +// }, +// }, +// }, +// &dataprotection.BackupPolicyPostgresqlRetentionRuleArgs{ +// Name: pulumi.String("monthly"), +// Duration: pulumi.String("P1D"), +// Priority: pulumi.Int(15), +// Criteria: &dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs{ +// WeeksOfMonths: pulumi.StringArray{ +// pulumi.String("First"), +// pulumi.String("Last"), +// }, +// DaysOfWeeks: pulumi.StringArray{ +// pulumi.String("Tuesday"), +// }, +// ScheduledBackupTimes: pulumi.StringArray{ +// pulumi.String("2021-05-23T02:30:00Z"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Policy PostgreSQL's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/backupVault.go b/sdk/go/azure/dataprotection/backupVault.go index e8bbf2e464..c5b4340b31 100644 --- a/sdk/go/azure/dataprotection/backupVault.go +++ b/sdk/go/azure/dataprotection/backupVault.go @@ -15,6 +15,42 @@ import ( // Manages a Backup Vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewBackupVault(ctx, "exampleBackupVault", &dataprotection.BackupVaultArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DatastoreType: pulumi.String("VaultStore"), +// Redundancy: pulumi.String("LocallyRedundant"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backup Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dataprotection/getBackupVault.go b/sdk/go/azure/dataprotection/getBackupVault.go index 2ef8128cf1..d0a3dd1e81 100644 --- a/sdk/go/azure/dataprotection/getBackupVault.go +++ b/sdk/go/azure/dataprotection/getBackupVault.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Backup Vault. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dataprotection.LookupBackupVault(ctx, &dataprotection.LookupBackupVaultArgs{ +// Name: "existing-backup-vault", +// ResourceGroupName: "existing-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("azurermDataProtectionBackupVaultId", data.Azurerm_vpn_gateway.Example.Id) +// ctx.Export("azurermDataProtectionBackupVaultPrincipalId", example.Identities[0].PrincipalId) +// return nil +// }) +// } +// +// ``` func LookupBackupVault(ctx *pulumi.Context, args *LookupBackupVaultArgs, opts ...pulumi.InvokeOption) (*LookupBackupVaultResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBackupVaultResult diff --git a/sdk/go/azure/dataprotection/resourceGuard.go b/sdk/go/azure/dataprotection/resourceGuard.go index 382c1038df..6f48a5a043 100644 --- a/sdk/go/azure/dataprotection/resourceGuard.go +++ b/sdk/go/azure/dataprotection/resourceGuard.go @@ -15,6 +15,40 @@ import ( // Manages a Resource Guard. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewResourceGuard(ctx, "exampleResourceGuard", &dataprotection.ResourceGuardArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datashare/account.go b/sdk/go/azure/datashare/account.go index 4dd4583fcc..da7d59d570 100644 --- a/sdk/go/azure/datashare/account.go +++ b/sdk/go/azure/datashare/account.go @@ -15,6 +15,46 @@ import ( // Manages a Data Share Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = datashare.NewAccount(ctx, "exampleAccount", &datashare.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datashare.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Share Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datashare/datasetBlobStorage.go b/sdk/go/azure/datashare/datasetBlobStorage.go index fc19667160..3769b51145 100644 --- a/sdk/go/azure/datashare/datasetBlobStorage.go +++ b/sdk/go/azure/datashare/datasetBlobStorage.go @@ -15,6 +15,97 @@ import ( // Manages a Data Share Blob Storage Dataset. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := datashare.NewAccount(ctx, "exampleAccount", &datashare.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datashare.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleShare, err := datashare.NewShare(ctx, "exampleShare", &datashare.ShareArgs{ +// AccountId: exampleAccount.ID(), +// Kind: pulumi.String("CopyBased"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleStorage/accountAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("RAGRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleStorage / accountAccount.Name, +// ContainerAccessType: pulumi.String("container"), +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal := azuread.LookupServicePrincipalOutput(ctx, azuread.GetServicePrincipalOutputArgs{ +// DisplayName: exampleAccount.Name, +// }, nil) +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleStorage / accountAccount.Id, +// RoleDefinitionName: pulumi.String("Storage Blob Data Reader"), +// PrincipalId: exampleServicePrincipal.ApplyT(func(exampleServicePrincipal azuread.GetServicePrincipalResult) (*string, error) { +// return &exampleServicePrincipal.ObjectId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = datashare.NewDatasetBlobStorage(ctx, "exampleDatasetBlobStorage", &datashare.DatasetBlobStorageArgs{ +// DataShareId: exampleShare.ID(), +// ContainerName: exampleContainer.Name, +// StorageAccount: &datashare.DatasetBlobStorageStorageAccountArgs{ +// Name: exampleStorage / accountAccount.Name, +// ResourceGroupName: exampleStorage / accountAccount.ResourceGroupName, +// SubscriptionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// FilePath: pulumi.String("myfile.txt"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Share Blob Storage Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datashare/datasetDataLakeGen2.go b/sdk/go/azure/datashare/datasetDataLakeGen2.go index 022883f526..3ca54ecbe2 100644 --- a/sdk/go/azure/datashare/datasetDataLakeGen2.go +++ b/sdk/go/azure/datashare/datasetDataLakeGen2.go @@ -15,6 +15,93 @@ import ( // Manages a Data Share Data Lake Gen2 Dataset. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := datashare.NewAccount(ctx, "exampleAccount", &datashare.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datashare.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleShare, err := datashare.NewShare(ctx, "exampleShare", &datashare.ShareArgs{ +// AccountId: exampleAccount.ID(), +// Kind: pulumi.String("CopyBased"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleStorage/accountAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleStorage / accountAccount.Id, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal := azuread.LookupServicePrincipalOutput(ctx, azuread.GetServicePrincipalOutputArgs{ +// DisplayName: exampleAccount.Name, +// }, nil) +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleStorage / accountAccount.Id, +// RoleDefinitionName: pulumi.String("Storage Blob Data Reader"), +// PrincipalId: exampleServicePrincipal.ApplyT(func(exampleServicePrincipal azuread.GetServicePrincipalResult) (*string, error) { +// return &exampleServicePrincipal.ObjectId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = datashare.NewDatasetDataLakeGen2(ctx, "exampleDatasetDataLakeGen2", &datashare.DatasetDataLakeGen2Args{ +// ShareId: exampleShare.ID(), +// StorageAccountId: exampleStorage / accountAccount.Id, +// FileSystemName: exampleDataLakeGen2Filesystem.Name, +// FilePath: pulumi.String("myfile.txt"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Share Data Lake Gen2 Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datashare/datasetKustoCluster.go b/sdk/go/azure/datashare/datasetKustoCluster.go index 309917d21e..5a59a47528 100644 --- a/sdk/go/azure/datashare/datasetKustoCluster.go +++ b/sdk/go/azure/datashare/datasetKustoCluster.go @@ -15,6 +15,82 @@ import ( // Manages a Data Share Kusto Cluster Dataset. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := datashare.NewAccount(ctx, "exampleAccount", &datashare.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datashare.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleShare, err := datashare.NewShare(ctx, "exampleShare", &datashare.ShareArgs{ +// AccountId: exampleAccount.ID(), +// Kind: pulumi.String("InPlace"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleCluster.ID(), +// RoleDefinitionName: pulumi.String("Contributor"), +// PrincipalId: exampleAccount.Identity.ApplyT(func(identity datashare.AccountIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = datashare.NewDatasetKustoCluster(ctx, "exampleDatasetKustoCluster", &datashare.DatasetKustoClusterArgs{ +// ShareId: exampleShare.ID(), +// KustoClusterId: exampleCluster.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Share Kusto Cluster Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datashare/datasetKustoDatabase.go b/sdk/go/azure/datashare/datasetKustoDatabase.go index 96dd4245c8..c84fc03394 100644 --- a/sdk/go/azure/datashare/datasetKustoDatabase.go +++ b/sdk/go/azure/datashare/datasetKustoDatabase.go @@ -15,6 +15,90 @@ import ( // Manages a Data Share Kusto Database Dataset. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := datashare.NewAccount(ctx, "exampleAccount", &datashare.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datashare.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleShare, err := datashare.NewShare(ctx, "exampleShare", &datashare.ShareArgs{ +// AccountId: exampleAccount.ID(), +// Kind: pulumi.String("InPlace"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// }) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleCluster.ID(), +// RoleDefinitionName: pulumi.String("Contributor"), +// PrincipalId: exampleAccount.Identity.ApplyT(func(identity datashare.AccountIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = datashare.NewDatasetKustoDatabase(ctx, "exampleDatasetKustoDatabase", &datashare.DatasetKustoDatabaseArgs{ +// ShareId: exampleShare.ID(), +// KustoDatabaseId: exampleDatabase.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Share Kusto Database Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/datashare/getAccount.go b/sdk/go/azure/datashare/getAccount.go index 1cf9fa5f5b..83d4b6d357 100644 --- a/sdk/go/azure/datashare/getAccount.go +++ b/sdk/go/azure/datashare/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Data Share Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := datashare.LookupAccount(ctx, &datashare.LookupAccountArgs{ +// Name: "example-account", +// ResourceGroupName: "example-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/datashare/getDatasetBlobStorage.go b/sdk/go/azure/datashare/getDatasetBlobStorage.go index 4b96339e9e..e44f9498da 100644 --- a/sdk/go/azure/datashare/getDatasetBlobStorage.go +++ b/sdk/go/azure/datashare/getDatasetBlobStorage.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Data Share Blob Storage Dataset. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := datashare.LookupDatasetBlobStorage(ctx, &datashare.LookupDatasetBlobStorageArgs{ +// Name: "example-dsbsds", +// DataShareId: "example-share-id", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDatasetBlobStorage(ctx *pulumi.Context, args *LookupDatasetBlobStorageArgs, opts ...pulumi.InvokeOption) (*LookupDatasetBlobStorageResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDatasetBlobStorageResult diff --git a/sdk/go/azure/datashare/getDatasetDataLakeGen2.go b/sdk/go/azure/datashare/getDatasetDataLakeGen2.go index a9ae4a7638..ca0cd05a57 100644 --- a/sdk/go/azure/datashare/getDatasetDataLakeGen2.go +++ b/sdk/go/azure/datashare/getDatasetDataLakeGen2.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Data Share Data Lake Gen2 Dataset. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := datashare.LookupDatasetDataLakeGen2(ctx, &datashare.LookupDatasetDataLakeGen2Args{ +// Name: "example-dsdlg2ds", +// ShareId: "example-share-id", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDatasetDataLakeGen2(ctx *pulumi.Context, args *LookupDatasetDataLakeGen2Args, opts ...pulumi.InvokeOption) (*LookupDatasetDataLakeGen2Result, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDatasetDataLakeGen2Result diff --git a/sdk/go/azure/datashare/getDatasetKustoCluster.go b/sdk/go/azure/datashare/getDatasetKustoCluster.go index 1fcf8c20ca..7a6685d18e 100644 --- a/sdk/go/azure/datashare/getDatasetKustoCluster.go +++ b/sdk/go/azure/datashare/getDatasetKustoCluster.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Data Share Kusto Cluster Dataset. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := datashare.LookupDatasetKustoCluster(ctx, &datashare.LookupDatasetKustoClusterArgs{ +// Name: "example-dskc", +// ShareId: "example-share-id", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDatasetKustoCluster(ctx *pulumi.Context, args *LookupDatasetKustoClusterArgs, opts ...pulumi.InvokeOption) (*LookupDatasetKustoClusterResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDatasetKustoClusterResult diff --git a/sdk/go/azure/datashare/getDatasetKustoDatabase.go b/sdk/go/azure/datashare/getDatasetKustoDatabase.go index 0447013141..e3db703deb 100644 --- a/sdk/go/azure/datashare/getDatasetKustoDatabase.go +++ b/sdk/go/azure/datashare/getDatasetKustoDatabase.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Data Share Kusto Database Dataset. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := datashare.LookupDatasetKustoDatabase(ctx, &datashare.LookupDatasetKustoDatabaseArgs{ +// Name: "example-dskdds", +// ShareId: "example-share-id", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDatasetKustoDatabase(ctx *pulumi.Context, args *LookupDatasetKustoDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupDatasetKustoDatabaseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDatasetKustoDatabaseResult diff --git a/sdk/go/azure/datashare/getShare.go b/sdk/go/azure/datashare/getShare.go index 4347092b22..f82fa8fdcc 100644 --- a/sdk/go/azure/datashare/getShare.go +++ b/sdk/go/azure/datashare/getShare.go @@ -13,6 +13,41 @@ import ( ) // Use this data source to access information about an existing Data Share. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := datashare.LookupAccount(ctx, &datashare.LookupAccountArgs{ +// Name: "example-account", +// ResourceGroupName: "example-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// exampleShare, err := datashare.LookupShare(ctx, &datashare.LookupShareArgs{ +// Name: "existing", +// AccountId: exampleAccount.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", exampleShare.Id) +// return nil +// }) +// } +// +// ``` func LookupShare(ctx *pulumi.Context, args *LookupShareArgs, opts ...pulumi.InvokeOption) (*LookupShareResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupShareResult diff --git a/sdk/go/azure/datashare/share.go b/sdk/go/azure/datashare/share.go index de090579d8..c4c3c7b2c0 100644 --- a/sdk/go/azure/datashare/share.go +++ b/sdk/go/azure/datashare/share.go @@ -15,6 +15,60 @@ import ( // Manages a Data Share. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := datashare.NewAccount(ctx, "exampleAccount", &datashare.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Identity: &datashare.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = datashare.NewShare(ctx, "exampleShare", &datashare.ShareArgs{ +// AccountId: exampleAccount.ID(), +// Kind: pulumi.String("CopyBased"), +// Description: pulumi.String("example desc"), +// Terms: pulumi.String("example terms"), +// SnapshotSchedule: &datashare.ShareSnapshotScheduleArgs{ +// Name: pulumi.String("example-ss"), +// Recurrence: pulumi.String("Day"), +// StartTime: pulumi.String("2020-04-17T04:47:52.9614956Z"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Shares can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/desktopvirtualization/application.go b/sdk/go/azure/desktopvirtualization/application.go index 0943bf16eb..de80b31282 100644 --- a/sdk/go/azure/desktopvirtualization/application.go +++ b/sdk/go/azure/desktopvirtualization/application.go @@ -15,6 +15,77 @@ import ( // Manages a Virtual Desktop Application. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// pooledbreadthfirst, err := desktopvirtualization.NewHostPool(ctx, "pooledbreadthfirst", &desktopvirtualization.HostPoolArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("Pooled"), +// LoadBalancerType: pulumi.String("BreadthFirst"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewHostPool(ctx, "personalautomatic", &desktopvirtualization.HostPoolArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("Personal"), +// PersonalDesktopAssignmentType: pulumi.String("Automatic"), +// LoadBalancerType: pulumi.String("BreadthFirst"), +// }) +// if err != nil { +// return err +// } +// remoteapp, err := desktopvirtualization.NewApplicationGroup(ctx, "remoteapp", &desktopvirtualization.ApplicationGroupArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("RemoteApp"), +// HostPoolId: pooledbreadthfirst.ID(), +// FriendlyName: pulumi.String("TestAppGroup"), +// Description: pulumi.String("Acceptance Test: An application group"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewApplication(ctx, "chrome", &desktopvirtualization.ApplicationArgs{ +// ApplicationGroupId: remoteapp.ID(), +// FriendlyName: pulumi.String("Google Chrome"), +// Description: pulumi.String("Chromium based web browser"), +// Path: pulumi.String("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"), +// CommandLineArgumentPolicy: pulumi.String("DoNotAllow"), +// CommandLineArguments: pulumi.String("--incognito"), +// ShowInPortal: pulumi.Bool(false), +// IconPath: pulumi.String("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"), +// IconIndex: pulumi.Int(0), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Desktop Application can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/desktopvirtualization/applicationGroup.go b/sdk/go/azure/desktopvirtualization/applicationGroup.go index cb7e32bb05..4f59ee1216 100644 --- a/sdk/go/azure/desktopvirtualization/applicationGroup.go +++ b/sdk/go/azure/desktopvirtualization/applicationGroup.go @@ -15,6 +15,74 @@ import ( // Manages a Virtual Desktop Application Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// pooledbreadthfirst, err := desktopvirtualization.NewHostPool(ctx, "pooledbreadthfirst", &desktopvirtualization.HostPoolArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("Pooled"), +// LoadBalancerType: pulumi.String("BreadthFirst"), +// }) +// if err != nil { +// return err +// } +// personalautomatic, err := desktopvirtualization.NewHostPool(ctx, "personalautomatic", &desktopvirtualization.HostPoolArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("Personal"), +// PersonalDesktopAssignmentType: pulumi.String("Automatic"), +// LoadBalancerType: pulumi.String("BreadthFirst"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewApplicationGroup(ctx, "remoteapp", &desktopvirtualization.ApplicationGroupArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("RemoteApp"), +// HostPoolId: pooledbreadthfirst.ID(), +// FriendlyName: pulumi.String("TestAppGroup"), +// Description: pulumi.String("Acceptance Test: An application group"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewApplicationGroup(ctx, "desktopapp", &desktopvirtualization.ApplicationGroupArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("Desktop"), +// HostPoolId: personalautomatic.ID(), +// FriendlyName: pulumi.String("TestAppGroup"), +// Description: pulumi.String("Acceptance Test: An application group"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/desktopvirtualization/getHostPool.go b/sdk/go/azure/desktopvirtualization/getHostPool.go index fde3d78a8f..ad9af41e49 100644 --- a/sdk/go/azure/desktopvirtualization/getHostPool.go +++ b/sdk/go/azure/desktopvirtualization/getHostPool.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Virtual Desktop Host Pool. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := desktopvirtualization.LookupHostPool(ctx, &desktopvirtualization.LookupHostPoolArgs{ +// Name: "example-pool", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupHostPool(ctx *pulumi.Context, args *LookupHostPoolArgs, opts ...pulumi.InvokeOption) (*LookupHostPoolResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupHostPoolResult diff --git a/sdk/go/azure/desktopvirtualization/getHostPoolRegistrationInfo.go b/sdk/go/azure/desktopvirtualization/getHostPoolRegistrationInfo.go index bb9444e939..bbbdff4086 100644 --- a/sdk/go/azure/desktopvirtualization/getHostPoolRegistrationInfo.go +++ b/sdk/go/azure/desktopvirtualization/getHostPoolRegistrationInfo.go @@ -15,6 +15,50 @@ import ( // Manages the Registration Info for a Virtual Desktop Host Pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("westeurope"), +// }) +// if err != nil { +// return err +// } +// exampleHostPool, err := desktopvirtualization.NewHostPool(ctx, "exampleHostPool", &desktopvirtualization.HostPoolArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Type: pulumi.String("Pooled"), +// ValidateEnvironment: pulumi.Bool(true), +// LoadBalancerType: pulumi.String("BreadthFirst"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewgetHostPoolRegistrationInfo(ctx, "examplegetHostPoolRegistrationInfo", &desktopvirtualization.getHostPoolRegistrationInfoArgs{ +// HostpoolId: exampleHostPool.ID(), +// ExpirationDate: pulumi.String("2022-01-01T23:40:52Z"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // AVD Registration Infos can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/desktopvirtualization/hostPool.go b/sdk/go/azure/desktopvirtualization/hostPool.go index 49f86e2e7f..bcce7b39bf 100644 --- a/sdk/go/azure/desktopvirtualization/hostPool.go +++ b/sdk/go/azure/desktopvirtualization/hostPool.go @@ -15,6 +15,57 @@ import ( // Manages a Virtual Desktop Host Pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewHostPool(ctx, "exampleHostPool", &desktopvirtualization.HostPoolArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FriendlyName: pulumi.String("pooleddepthfirst"), +// ValidateEnvironment: pulumi.Bool(true), +// StartVmOnConnect: pulumi.Bool(true), +// CustomRdpProperties: pulumi.String("audiocapturemode:i:1;audiomode:i:0;"), +// Description: pulumi.String("Acceptance Test: A pooled host pool - pooleddepthfirst"), +// Type: pulumi.String("Pooled"), +// MaximumSessionsAllowed: pulumi.Int(50), +// LoadBalancerType: pulumi.String("DepthFirst"), +// ScheduledAgentUpdates: &desktopvirtualization.HostPoolScheduledAgentUpdatesArgs{ +// Enabled: pulumi.Bool(true), +// Schedules: desktopvirtualization.HostPoolScheduledAgentUpdatesScheduleArray{ +// &desktopvirtualization.HostPoolScheduledAgentUpdatesScheduleArgs{ +// DayOfWeek: pulumi.String("Saturday"), +// HourOfDay: pulumi.Int(2), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Desktop Host Pools can be imported using the `resource id`, e.g. text diff --git a/sdk/go/azure/desktopvirtualization/scalingPlan.go b/sdk/go/azure/desktopvirtualization/scalingPlan.go index 2bd4f06216..9f0c913224 100644 --- a/sdk/go/azure/desktopvirtualization/scalingPlan.go +++ b/sdk/go/azure/desktopvirtualization/scalingPlan.go @@ -21,6 +21,141 @@ import ( // // > **Note** Scaling Plans require specific permissions to be granted to the Windows Virtual Desktop application before a 'host_pool' can be configured. [Required Permissions for Scaling Plans](https://docs.microsoft.com/azure/virtual-desktop/autoscale-scaling-plan#create-a-custom-rbac-role). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleRandomUuid, err := random.NewRandomUuid(ctx, "exampleRandomUuid", nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.NewRoleDefinition(ctx, "exampleRoleDefinition", &authorization.RoleDefinitionArgs{ +// Scope: exampleResourceGroup.ID(), +// Description: pulumi.String("AVD AutoScale Role"), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Insights/eventtypes/values/read"), +// pulumi.String("Microsoft.Compute/virtualMachines/deallocate/action"), +// pulumi.String("Microsoft.Compute/virtualMachines/restart/action"), +// pulumi.String("Microsoft.Compute/virtualMachines/powerOff/action"), +// pulumi.String("Microsoft.Compute/virtualMachines/start/action"), +// pulumi.String("Microsoft.Compute/virtualMachines/read"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/read"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/write"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/sessionhosts/read"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/sessionhosts/write"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action"), +// pulumi.String("Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// exampleResourceGroup.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("Windows Virtual Desktop"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Name: exampleRandomUuid.Result, +// Scope: exampleResourceGroup.ID(), +// RoleDefinitionId: exampleRoleDefinition.RoleDefinitionResourceId, +// PrincipalId: *pulumi.String(exampleServicePrincipal.Id), +// SkipServicePrincipalAadCheck: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleHostPool, err := desktopvirtualization.NewHostPool(ctx, "exampleHostPool", &desktopvirtualization.HostPoolArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Type: pulumi.String("Pooled"), +// ValidateEnvironment: pulumi.Bool(true), +// LoadBalancerType: pulumi.String("BreadthFirst"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewScalingPlan(ctx, "exampleScalingPlan", &desktopvirtualization.ScalingPlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FriendlyName: pulumi.String("Scaling Plan Example"), +// Description: pulumi.String("Example Scaling Plan"), +// TimeZone: pulumi.String("GMT Standard Time"), +// Schedules: desktopvirtualization.ScalingPlanScheduleArray{ +// &desktopvirtualization.ScalingPlanScheduleArgs{ +// Name: pulumi.String("Weekdays"), +// DaysOfWeeks: pulumi.StringArray{ +// pulumi.String("Monday"), +// pulumi.String("Tuesday"), +// pulumi.String("Wednesday"), +// pulumi.String("Thursday"), +// pulumi.String("Friday"), +// }, +// RampUpStartTime: pulumi.String("05:00"), +// RampUpLoadBalancingAlgorithm: pulumi.String("BreadthFirst"), +// RampUpMinimumHostsPercent: pulumi.Int(20), +// RampUpCapacityThresholdPercent: pulumi.Int(10), +// PeakStartTime: pulumi.String("09:00"), +// PeakLoadBalancingAlgorithm: pulumi.String("BreadthFirst"), +// RampDownStartTime: pulumi.String("19:00"), +// RampDownLoadBalancingAlgorithm: pulumi.String("DepthFirst"), +// RampDownMinimumHostsPercent: pulumi.Int(10), +// RampDownForceLogoffUsers: pulumi.Bool(false), +// RampDownWaitTimeMinutes: pulumi.Int(45), +// RampDownNotificationMessage: pulumi.String("Please log off in the next 45 minutes..."), +// RampDownCapacityThresholdPercent: pulumi.Int(5), +// RampDownStopHostsWhen: pulumi.String("ZeroSessions"), +// OffPeakStartTime: pulumi.String("22:00"), +// OffPeakLoadBalancingAlgorithm: pulumi.String("DepthFirst"), +// }, +// }, +// HostPools: desktopvirtualization.ScalingPlanHostPoolArray{ +// &desktopvirtualization.ScalingPlanHostPoolArgs{ +// HostpoolId: exampleHostPool.ID(), +// ScalingPlanEnabled: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Desktop Scaling Plans can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/desktopvirtualization/workspace.go b/sdk/go/azure/desktopvirtualization/workspace.go index ca21b3d89a..7ff23f78ec 100644 --- a/sdk/go/azure/desktopvirtualization/workspace.go +++ b/sdk/go/azure/desktopvirtualization/workspace.go @@ -15,6 +15,42 @@ import ( // Manages a Virtual Desktop Workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewWorkspace(ctx, "workspace", &desktopvirtualization.WorkspaceArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// FriendlyName: pulumi.String("FriendlyName"), +// Description: pulumi.String("A description of my workspace"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Desktop Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/desktopvirtualization/workspaceApplicationGroupAssociation.go b/sdk/go/azure/desktopvirtualization/workspaceApplicationGroupAssociation.go index 902488cff4..a1c65160c9 100644 --- a/sdk/go/azure/desktopvirtualization/workspaceApplicationGroupAssociation.go +++ b/sdk/go/azure/desktopvirtualization/workspaceApplicationGroupAssociation.go @@ -15,6 +15,65 @@ import ( // Manages a Virtual Desktop Workspace Application Group Association. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/desktopvirtualization" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// pooledbreadthfirst, err := desktopvirtualization.NewHostPool(ctx, "pooledbreadthfirst", &desktopvirtualization.HostPoolArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("Pooled"), +// LoadBalancerType: pulumi.String("BreadthFirst"), +// }) +// if err != nil { +// return err +// } +// remoteapp, err := desktopvirtualization.NewApplicationGroup(ctx, "remoteapp", &desktopvirtualization.ApplicationGroupArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Type: pulumi.String("RemoteApp"), +// HostPoolId: pooledbreadthfirst.ID(), +// }) +// if err != nil { +// return err +// } +// workspace, err := desktopvirtualization.NewWorkspace(ctx, "workspace", &desktopvirtualization.WorkspaceArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// _, err = desktopvirtualization.NewWorkspaceApplicationGroupAssociation(ctx, "workspaceremoteapp", &desktopvirtualization.WorkspaceApplicationGroupAssociationArgs{ +// WorkspaceId: workspace.ID(), +// ApplicationGroupId: remoteapp.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between Virtual Desktop Workspaces and Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/devcenter/devCenter.go b/sdk/go/azure/devcenter/devCenter.go index 8a94242325..197bb17665 100644 --- a/sdk/go/azure/devcenter/devCenter.go +++ b/sdk/go/azure/devcenter/devCenter.go @@ -17,6 +17,47 @@ import ( // // Manages a Dev Center. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devcenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = devcenter.NewDevCenter(ctx, "exampleDevCenter", &devcenter.DevCenterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // ## Blocks Reference // // ### `identity` Block diff --git a/sdk/go/azure/devcenter/project.go b/sdk/go/azure/devcenter/project.go index 987a7d120f..96767d388f 100644 --- a/sdk/go/azure/devcenter/project.go +++ b/sdk/go/azure/devcenter/project.go @@ -17,6 +17,51 @@ import ( // // Manages a Dev Center Project. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devcenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleDevCenter, err := devcenter.NewDevCenter(ctx, "exampleDevCenter", &devcenter.DevCenterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Identity: &devcenter.DevCenterIdentityArgs{ +// Type: pulumi.String("example-value"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = devcenter.NewProject(ctx, "exampleProject", &devcenter.ProjectArgs{ +// DevCenterId: exampleDevCenter.ID(), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing Dev Center Project can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/go/azure/devtest/getLab.go b/sdk/go/azure/devtest/getLab.go index abf6964935..d95f772fe1 100644 --- a/sdk/go/azure/devtest/getLab.go +++ b/sdk/go/azure/devtest/getLab.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Dev Test Lab. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := devtest.LookupLab(ctx, &devtest.LookupLabArgs{ +// Name: "example-lab", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("uniqueIdentifier", example.UniqueIdentifier) +// return nil +// }) +// } +// +// ``` func LookupLab(ctx *pulumi.Context, args *LookupLabArgs, opts ...pulumi.InvokeOption) (*LookupLabResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupLabResult diff --git a/sdk/go/azure/devtest/getVirtualNetwork.go b/sdk/go/azure/devtest/getVirtualNetwork.go index ae6385d86d..17d4963fc8 100644 --- a/sdk/go/azure/devtest/getVirtualNetwork.go +++ b/sdk/go/azure/devtest/getVirtualNetwork.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Dev Test Lab Virtual Network. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := devtest.LookupVirtualNetwork(ctx, &devtest.LookupVirtualNetworkArgs{ +// Name: "example-network", +// LabName: "examplelab", +// ResourceGroupName: "example-resource", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("labSubnetName", example.AllowedSubnets[0].LabSubnetName) +// return nil +// }) +// } +// +// ``` func LookupVirtualNetwork(ctx *pulumi.Context, args *LookupVirtualNetworkArgs, opts ...pulumi.InvokeOption) (*LookupVirtualNetworkResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualNetworkResult diff --git a/sdk/go/azure/devtest/globalVMShutdownSchedule.go b/sdk/go/azure/devtest/globalVMShutdownSchedule.go index 178465ebc3..df88f61ebb 100644 --- a/sdk/go/azure/devtest/globalVMShutdownSchedule.go +++ b/sdk/go/azure/devtest/globalVMShutdownSchedule.go @@ -17,6 +17,109 @@ import ( // this resource applies only to standard VMs, not DevTest Lab VMs. To manage automated shutdown schedules for DevTest Lab VMs, reference the // `devtest.Schedule` resource // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// Size: pulumi.String("Standard_B2s"), +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Name: pulumi.String("myosdisk-example"), +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// DisablePasswordAuthentication: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = devtest.NewGlobalVMShutdownSchedule(ctx, "exampleGlobalVMShutdownSchedule", &devtest.GlobalVMShutdownScheduleArgs{ +// VirtualMachineId: exampleLinuxVirtualMachine.ID(), +// Location: exampleResourceGroup.Location, +// Enabled: pulumi.Bool(true), +// DailyRecurrenceTime: pulumi.String("1100"), +// Timezone: pulumi.String("Pacific Standard Time"), +// NotificationSettings: &devtest.GlobalVMShutdownScheduleNotificationSettingsArgs{ +// Enabled: pulumi.Bool(true), +// TimeInMinutes: pulumi.Int(60), +// WebhookUrl: pulumi.String("https://sample-webhook-url.example.com"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing Dev Test Global Shutdown Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/devtest/lab.go b/sdk/go/azure/devtest/lab.go index e0d99cc92e..97023b06a6 100644 --- a/sdk/go/azure/devtest/lab.go +++ b/sdk/go/azure/devtest/lab.go @@ -15,6 +15,43 @@ import ( // Manages a Dev Test Lab. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "Sydney": pulumi.String("Australia"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dev Test Labs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/devtest/linuxVirtualMachine.go b/sdk/go/azure/devtest/linuxVirtualMachine.go index e0a00d07df..a7c25e6f3b 100644 --- a/sdk/go/azure/devtest/linuxVirtualMachine.go +++ b/sdk/go/azure/devtest/linuxVirtualMachine.go @@ -15,6 +15,87 @@ import ( // Manages a Linux Virtual Machine within a Dev Test Lab. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLab, err := devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "Sydney": pulumi.String("Australia"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := devtest.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &devtest.VirtualNetworkArgs{ +// LabName: exampleLab.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Subnet: &devtest.VirtualNetworkSubnetArgs{ +// UsePublicIpAddress: pulumi.String("Allow"), +// UseInVirtualMachineCreation: pulumi.String("Allow"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = devtest.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &devtest.LinuxVirtualMachineArgs{ +// LabName: exampleLab.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_DS2"), +// Username: pulumi.String("exampleuser99"), +// SshKey: readFileOrPanic("~/.ssh/id_rsa.pub"), +// LabVirtualNetworkId: exampleVirtualNetwork.ID(), +// LabSubnetName: exampleVirtualNetwork.Subnet.ApplyT(func(subnet devtest.VirtualNetworkSubnet) (*string, error) { +// return &subnet.Name, nil +// }).(pulumi.StringPtrOutput), +// StorageType: pulumi.String("Premium"), +// Notes: pulumi.String("Some notes about this Virtual Machine."), +// GalleryImageReference: &devtest.LinuxVirtualMachineGalleryImageReferenceArgs{ +// Offer: pulumi.String("UbuntuServer"), +// Publisher: pulumi.String("Canonical"), +// Sku: pulumi.String("18.04-LTS"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dev Test Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/devtest/policy.go b/sdk/go/azure/devtest/policy.go index 751c43fc2c..54212764ea 100644 --- a/sdk/go/azure/devtest/policy.go +++ b/sdk/go/azure/devtest/policy.go @@ -15,6 +15,57 @@ import ( // Manages a Policy within a Dev Test Policy Set. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLab, err := devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "Sydney": pulumi.String("Australia"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = devtest.NewPolicy(ctx, "examplePolicy", &devtest.PolicyArgs{ +// PolicySetName: pulumi.String("default"), +// LabName: exampleLab.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// FactData: pulumi.String(""), +// Threshold: pulumi.String("999"), +// EvaluatorType: pulumi.String("MaxValuePolicy"), +// Tags: pulumi.StringMap{ +// "Acceptance": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dev Test Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/devtest/schedule.go b/sdk/go/azure/devtest/schedule.go index 96c550f872..f5f450718a 100644 --- a/sdk/go/azure/devtest/schedule.go +++ b/sdk/go/azure/devtest/schedule.go @@ -15,6 +15,61 @@ import ( // Manages automated startup and shutdown schedules for Azure Dev Test Lab. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLab, err := devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = devtest.NewSchedule(ctx, "exampleSchedule", &devtest.ScheduleArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LabName: exampleLab.Name, +// WeeklyRecurrence: &devtest.ScheduleWeeklyRecurrenceArgs{ +// Time: pulumi.String("1100"), +// WeekDays: pulumi.StringArray{ +// pulumi.String("Monday"), +// pulumi.String("Tuesday"), +// }, +// }, +// TimeZoneId: pulumi.String("Pacific Standard Time"), +// TaskType: pulumi.String("LabVmsStartupTask"), +// NotificationSettings: nil, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // DevTest Schedule's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/devtest/virtualNetwork.go b/sdk/go/azure/devtest/virtualNetwork.go index d5a6db2eba..177251df37 100644 --- a/sdk/go/azure/devtest/virtualNetwork.go +++ b/sdk/go/azure/devtest/virtualNetwork.go @@ -15,6 +15,54 @@ import ( // Manages a Virtual Network within a DevTest Lab. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLab, err := devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "Sydney": pulumi.String("Australia"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = devtest.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &devtest.VirtualNetworkArgs{ +// LabName: exampleLab.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Subnet: &devtest.VirtualNetworkSubnetArgs{ +// UsePublicIpAddress: pulumi.String("Allow"), +// UseInVirtualMachineCreation: pulumi.String("Allow"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // DevTest Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/devtest/windowsVirtualMachine.go b/sdk/go/azure/devtest/windowsVirtualMachine.go index 8b5e918bdf..4d60d7f2b9 100644 --- a/sdk/go/azure/devtest/windowsVirtualMachine.go +++ b/sdk/go/azure/devtest/windowsVirtualMachine.go @@ -15,6 +15,77 @@ import ( // Manages a Windows Virtual Machine within a Dev Test Lab. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLab, err := devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "Sydney": pulumi.String("Australia"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := devtest.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &devtest.VirtualNetworkArgs{ +// LabName: exampleLab.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Subnet: &devtest.VirtualNetworkSubnetArgs{ +// UsePublicIpAddress: pulumi.String("Allow"), +// UseInVirtualMachineCreation: pulumi.String("Allow"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = devtest.NewWindowsVirtualMachine(ctx, "exampleWindowsVirtualMachine", &devtest.WindowsVirtualMachineArgs{ +// LabName: exampleLab.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_DS2"), +// Username: pulumi.String("exampleuser99"), +// Password: pulumi.String("Pa$w0rd1234!"), +// LabVirtualNetworkId: exampleVirtualNetwork.ID(), +// LabSubnetName: exampleVirtualNetwork.Subnet.ApplyT(func(subnet devtest.VirtualNetworkSubnet) (*string, error) { +// return &subnet.Name, nil +// }).(pulumi.StringPtrOutput), +// StorageType: pulumi.String("Premium"), +// Notes: pulumi.String("Some notes about this Virtual Machine."), +// GalleryImageReference: &devtest.WindowsVirtualMachineGalleryImageReferenceArgs{ +// Offer: pulumi.String("WindowsServer"), +// Publisher: pulumi.String("MicrosoftWindowsServer"), +// Sku: pulumi.String("2019-Datacenter"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // DevTest Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/digitaltwins/endpointEventGrid.go b/sdk/go/azure/digitaltwins/endpointEventGrid.go index 37b64a247a..ae5753d4e3 100644 --- a/sdk/go/azure/digitaltwins/endpointEventGrid.go +++ b/sdk/go/azure/digitaltwins/endpointEventGrid.go @@ -15,6 +15,57 @@ import ( // Manages a Digital Twins Event Grid Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/digitaltwins" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInstance, err := digitaltwins.NewInstance(ctx, "exampleInstance", &digitaltwins.InstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := eventgrid.NewTopic(ctx, "exampleTopic", &eventgrid.TopicArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = digitaltwins.NewEndpointEventGrid(ctx, "exampleEndpointEventGrid", &digitaltwins.EndpointEventGridArgs{ +// DigitalTwinsId: exampleInstance.ID(), +// EventgridTopicEndpoint: exampleTopic.Endpoint, +// EventgridTopicPrimaryAccessKey: exampleTopic.PrimaryAccessKey, +// EventgridTopicSecondaryAccessKey: exampleTopic.SecondaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Digital Twins Eventgrid Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/digitaltwins/endpointEventHub.go b/sdk/go/azure/digitaltwins/endpointEventHub.go index 571e533847..c8b0a0f1d7 100644 --- a/sdk/go/azure/digitaltwins/endpointEventHub.go +++ b/sdk/go/azure/digitaltwins/endpointEventHub.go @@ -15,6 +15,77 @@ import ( // Manages a Digital Twins Event Hub Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/digitaltwins" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInstance, err := digitaltwins.NewInstance(ctx, "exampleInstance", &digitaltwins.InstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleAuthorizationRule, err := eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Listen: pulumi.Bool(false), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = digitaltwins.NewEndpointEventHub(ctx, "exampleEndpointEventHub", &digitaltwins.EndpointEventHubArgs{ +// DigitalTwinsId: exampleInstance.ID(), +// EventhubPrimaryConnectionString: exampleAuthorizationRule.PrimaryConnectionString, +// EventhubSecondaryConnectionString: exampleAuthorizationRule.SecondaryConnectionString, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Digital Twins Eventhub Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/digitaltwins/endpointServicebus.go b/sdk/go/azure/digitaltwins/endpointServicebus.go index f1bd85c95c..4a9859875f 100644 --- a/sdk/go/azure/digitaltwins/endpointServicebus.go +++ b/sdk/go/azure/digitaltwins/endpointServicebus.go @@ -15,6 +15,72 @@ import ( // Manages a Digital Twins Service Bus Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/digitaltwins" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInstance, err := digitaltwins.NewInstance(ctx, "exampleInstance", &digitaltwins.InstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// }) +// if err != nil { +// return err +// } +// exampleTopicAuthorizationRule, err := servicebus.NewTopicAuthorizationRule(ctx, "exampleTopicAuthorizationRule", &servicebus.TopicAuthorizationRuleArgs{ +// TopicId: exampleTopic.ID(), +// Listen: pulumi.Bool(false), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = digitaltwins.NewEndpointServicebus(ctx, "exampleEndpointServicebus", &digitaltwins.EndpointServicebusArgs{ +// DigitalTwinsId: exampleInstance.ID(), +// ServicebusPrimaryConnectionString: exampleTopicAuthorizationRule.PrimaryConnectionString, +// ServicebusSecondaryConnectionString: exampleTopicAuthorizationRule.SecondaryConnectionString, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Digital Twins Service Bus Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/digitaltwins/getInstance.go b/sdk/go/azure/digitaltwins/getInstance.go index 53910ef600..d92d58613a 100644 --- a/sdk/go/azure/digitaltwins/getInstance.go +++ b/sdk/go/azure/digitaltwins/getInstance.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Digital Twins instance. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/digitaltwins" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := digitaltwins.LookupInstance(ctx, &digitaltwins.LookupInstanceArgs{ +// Name: "existing-digital-twins", +// ResourceGroupName: "existing-resgroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupInstance(ctx *pulumi.Context, args *LookupInstanceArgs, opts ...pulumi.InvokeOption) (*LookupInstanceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupInstanceResult diff --git a/sdk/go/azure/digitaltwins/instance.go b/sdk/go/azure/digitaltwins/instance.go index 968b300ecb..35460ed103 100644 --- a/sdk/go/azure/digitaltwins/instance.go +++ b/sdk/go/azure/digitaltwins/instance.go @@ -15,6 +15,43 @@ import ( // Manages a Digital Twins instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/digitaltwins" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = digitaltwins.NewInstance(ctx, "exampleInstance", &digitaltwins.InstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Digital Twins instances can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/digitaltwins/timeSeriesDatabaseConnection.go b/sdk/go/azure/digitaltwins/timeSeriesDatabaseConnection.go index f432c3822e..ce9e7b6245 100644 --- a/sdk/go/azure/digitaltwins/timeSeriesDatabaseConnection.go +++ b/sdk/go/azure/digitaltwins/timeSeriesDatabaseConnection.go @@ -15,6 +15,148 @@ import ( // Manages a Digital Twins Time Series Database Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/digitaltwins" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInstance, err := digitaltwins.NewInstance(ctx, "exampleInstance", &digitaltwins.InstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Identity: &digitaltwins.InstanceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(7), +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// }) +// if err != nil { +// return err +// } +// databaseContributor, err := authorization.NewAssignment(ctx, "databaseContributor", &authorization.AssignmentArgs{ +// Scope: exampleDatabase.ID(), +// PrincipalId: exampleInstance.Identity.ApplyT(func(identity digitaltwins.InstanceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// RoleDefinitionName: pulumi.String("Contributor"), +// }) +// if err != nil { +// return err +// } +// eventhubDataOwner, err := authorization.NewAssignment(ctx, "eventhubDataOwner", &authorization.AssignmentArgs{ +// Scope: exampleEventHub.ID(), +// PrincipalId: exampleInstance.Identity.ApplyT(func(identity digitaltwins.InstanceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// RoleDefinitionName: pulumi.String("Azure Event Hubs Data Owner"), +// }) +// if err != nil { +// return err +// } +// exampleDatabasePrincipalAssignment, err := kusto.NewDatabasePrincipalAssignment(ctx, "exampleDatabasePrincipalAssignment", &kusto.DatabasePrincipalAssignmentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ClusterName: exampleCluster.Name, +// DatabaseName: exampleDatabase.Name, +// TenantId: exampleInstance.Identity.ApplyT(func(identity digitaltwins.InstanceIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// PrincipalId: exampleInstance.Identity.ApplyT(func(identity digitaltwins.InstanceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// PrincipalType: pulumi.String("App"), +// Role: pulumi.String("Admin"), +// }) +// if err != nil { +// return err +// } +// _, err = digitaltwins.NewTimeSeriesDatabaseConnection(ctx, "exampleTimeSeriesDatabaseConnection", &digitaltwins.TimeSeriesDatabaseConnectionArgs{ +// DigitalTwinsId: exampleInstance.ID(), +// EventhubName: exampleEventHub.Name, +// EventhubNamespaceId: exampleEventHubNamespace.ID(), +// EventhubNamespaceEndpointUri: exampleEventHubNamespace.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("sb://%v.servicebus.windows.net", name), nil +// }).(pulumi.StringOutput), +// EventhubConsumerGroupName: exampleConsumerGroup.Name, +// KustoClusterId: exampleCluster.ID(), +// KustoClusterUri: exampleCluster.Uri, +// KustoDatabaseName: exampleDatabase.Name, +// KustoTableName: pulumi.String("exampleTable"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// databaseContributor, +// eventhubDataOwner, +// exampleDatabasePrincipalAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Digital Twins Time Series Database Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/aaaaRecord.go b/sdk/go/azure/dns/aaaaRecord.go index c3a19e85b3..cf7c813496 100644 --- a/sdk/go/azure/dns/aaaaRecord.go +++ b/sdk/go/azure/dns/aaaaRecord.go @@ -13,6 +13,101 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewAaaaRecord(ctx, "exampleAaaaRecord", &dns.AaaaRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: pulumi.StringArray{ +// pulumi.String("2001:db8::1:0:0:1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Alias Record) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// IpVersion: pulumi.String("IPv6"), +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewAaaaRecord(ctx, "exampleAaaaRecord", &dns.AaaaRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// TargetResourceId: examplePublicIp.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // AAAA records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/arecord.go b/sdk/go/azure/dns/arecord.go index a17e87dc3c..c68072b371 100644 --- a/sdk/go/azure/dns/arecord.go +++ b/sdk/go/azure/dns/arecord.go @@ -13,6 +13,101 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewARecord(ctx, "exampleARecord", &dns.ARecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: pulumi.StringArray{ +// pulumi.String("10.0.180.17"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Alias Record) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// IpVersion: pulumi.String("IPv4"), +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewARecord(ctx, "exampleARecord", &dns.ARecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// TargetResourceId: examplePublicIp.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/caaRecord.go b/sdk/go/azure/dns/caaRecord.go index de8c5d65ae..d15a2684bf 100644 --- a/sdk/go/azure/dns/caaRecord.go +++ b/sdk/go/azure/dns/caaRecord.go @@ -13,6 +13,72 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewCaaRecord(ctx, "exampleCaaRecord", &dns.CaaRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: dns.CaaRecordRecordArray{ +// &dns.CaaRecordRecordArgs{ +// Flags: pulumi.Int(0), +// Tag: pulumi.String("issue"), +// Value: pulumi.String("example.com"), +// }, +// &dns.CaaRecordRecordArgs{ +// Flags: pulumi.Int(0), +// Tag: pulumi.String("issue"), +// Value: pulumi.String("example.net"), +// }, +// &dns.CaaRecordRecordArgs{ +// Flags: pulumi.Int(0), +// Tag: pulumi.String("issuewild"), +// Value: pulumi.String(";"), +// }, +// &dns.CaaRecordRecordArgs{ +// Flags: pulumi.Int(0), +// Tag: pulumi.String("iodef"), +// Value: pulumi.String("mailto:user@nonexisting.tld"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CAA records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/cnameRecord.go b/sdk/go/azure/dns/cnameRecord.go index 76680aba39..83842e8feb 100644 --- a/sdk/go/azure/dns/cnameRecord.go +++ b/sdk/go/azure/dns/cnameRecord.go @@ -13,6 +13,98 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewCNameRecord(ctx, "exampleCNameRecord", &dns.CNameRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Record: pulumi.String("contoso.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Alias Record) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// target, err := dns.NewCNameRecord(ctx, "target", &dns.CNameRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Record: pulumi.String("contoso.com"), +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewCNameRecord(ctx, "exampleCNameRecord", &dns.CNameRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// TargetResourceId: target.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // CNAME records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/getAAAARecord.go b/sdk/go/azure/dns/getAAAARecord.go index 36f5ff7a3a..f40a2dfdf2 100644 --- a/sdk/go/azure/dns/getAAAARecord.go +++ b/sdk/go/azure/dns/getAAAARecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewAaaaRecord(ctx, "example", &dns.AaaaRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsAaaaRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func GetAAAARecord(ctx *pulumi.Context, args *GetAAAARecordArgs, opts ...pulumi.InvokeOption) (*GetAAAARecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAAAARecordResult diff --git a/sdk/go/azure/dns/getARecord.go b/sdk/go/azure/dns/getARecord.go index 32083f1119..9e538a3231 100644 --- a/sdk/go/azure/dns/getARecord.go +++ b/sdk/go/azure/dns/getARecord.go @@ -12,6 +12,34 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.LookupARecord(ctx, &dns.LookupARecordArgs{ +// Name: "test", +// ZoneName: "test-zone", +// ResourceGroupName: "test-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("dnsARecordId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupARecord(ctx *pulumi.Context, args *LookupARecordArgs, opts ...pulumi.InvokeOption) (*LookupARecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupARecordResult diff --git a/sdk/go/azure/dns/getCAARecord.go b/sdk/go/azure/dns/getCAARecord.go index 52fd249368..265bfa898b 100644 --- a/sdk/go/azure/dns/getCAARecord.go +++ b/sdk/go/azure/dns/getCAARecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewCaaRecord(ctx, "example", &dns.CaaRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsCaaRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func GetCAARecord(ctx *pulumi.Context, args *GetCAARecordArgs, opts ...pulumi.InvokeOption) (*GetCAARecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCAARecordResult diff --git a/sdk/go/azure/dns/getCnameRecord.go b/sdk/go/azure/dns/getCnameRecord.go index 94f37df43c..4f72ad9f0e 100644 --- a/sdk/go/azure/dns/getCnameRecord.go +++ b/sdk/go/azure/dns/getCnameRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewCNameRecord(ctx, "example", &dns.CNameRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsCnameRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func GetCnameRecord(ctx *pulumi.Context, args *GetCnameRecordArgs, opts ...pulumi.InvokeOption) (*GetCnameRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCnameRecordResult diff --git a/sdk/go/azure/dns/getMxRecord.go b/sdk/go/azure/dns/getMxRecord.go index 012d68b16b..18b4d21f85 100644 --- a/sdk/go/azure/dns/getMxRecord.go +++ b/sdk/go/azure/dns/getMxRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewMxRecord(ctx, "example", &dns.MxRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsMxRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupMxRecord(ctx *pulumi.Context, args *LookupMxRecordArgs, opts ...pulumi.InvokeOption) (*LookupMxRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupMxRecordResult diff --git a/sdk/go/azure/dns/getNsRecord.go b/sdk/go/azure/dns/getNsRecord.go index bf5f8a2831..6e5b7ee5a2 100644 --- a/sdk/go/azure/dns/getNsRecord.go +++ b/sdk/go/azure/dns/getNsRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewNsRecord(ctx, "example", &dns.NsRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsNsRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupNsRecord(ctx *pulumi.Context, args *LookupNsRecordArgs, opts ...pulumi.InvokeOption) (*LookupNsRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNsRecordResult diff --git a/sdk/go/azure/dns/getPtrRecord.go b/sdk/go/azure/dns/getPtrRecord.go index 765e4fadda..a67641051b 100644 --- a/sdk/go/azure/dns/getPtrRecord.go +++ b/sdk/go/azure/dns/getPtrRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewPtrRecord(ctx, "example", &dns.PtrRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsPtrRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupPtrRecord(ctx *pulumi.Context, args *LookupPtrRecordArgs, opts ...pulumi.InvokeOption) (*LookupPtrRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPtrRecordResult diff --git a/sdk/go/azure/dns/getSrvRecord.go b/sdk/go/azure/dns/getSrvRecord.go index cc0a2e9964..3af5ba12e6 100644 --- a/sdk/go/azure/dns/getSrvRecord.go +++ b/sdk/go/azure/dns/getSrvRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewSrvRecord(ctx, "example", &dns.SrvRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsSrvRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupSrvRecord(ctx *pulumi.Context, args *LookupSrvRecordArgs, opts ...pulumi.InvokeOption) (*LookupSrvRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSrvRecordResult diff --git a/sdk/go/azure/dns/getTxtRecord.go b/sdk/go/azure/dns/getTxtRecord.go index ba41fe07cc..d56e9f679f 100644 --- a/sdk/go/azure/dns/getTxtRecord.go +++ b/sdk/go/azure/dns/getTxtRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.NewTxtRecord(ctx, "example", &dns.TxtRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("dnsTxtRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupTxtRecord(ctx *pulumi.Context, args *LookupTxtRecordArgs, opts ...pulumi.InvokeOption) (*LookupTxtRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTxtRecordResult diff --git a/sdk/go/azure/dns/getZone.go b/sdk/go/azure/dns/getZone.go index 988599ae26..948f0ae114 100644 --- a/sdk/go/azure/dns/getZone.go +++ b/sdk/go/azure/dns/getZone.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing DNS Zone. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := dns.LookupZone(ctx, &dns.LookupZoneArgs{ +// Name: "search-eventhubns", +// ResourceGroupName: pulumi.StringRef("search-service"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("dnsZoneId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupZone(ctx *pulumi.Context, args *LookupZoneArgs, opts ...pulumi.InvokeOption) (*LookupZoneResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupZoneResult diff --git a/sdk/go/azure/dns/mxRecord.go b/sdk/go/azure/dns/mxRecord.go index 1f2b398c48..c305d4129c 100644 --- a/sdk/go/azure/dns/mxRecord.go +++ b/sdk/go/azure/dns/mxRecord.go @@ -13,6 +13,60 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewMxRecord(ctx, "exampleMxRecord", &dns.MxRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: dns.MxRecordRecordArray{ +// &dns.MxRecordRecordArgs{ +// Preference: pulumi.String("10"), +// Exchange: pulumi.String("mail1.contoso.com"), +// }, +// &dns.MxRecordRecordArgs{ +// Preference: pulumi.String("20"), +// Exchange: pulumi.String("mail2.contoso.com"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MX records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/nsRecord.go b/sdk/go/azure/dns/nsRecord.go index 06be24107d..6e3be6fb6c 100644 --- a/sdk/go/azure/dns/nsRecord.go +++ b/sdk/go/azure/dns/nsRecord.go @@ -13,6 +13,54 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewNsRecord(ctx, "exampleNsRecord", &dns.NsRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: pulumi.StringArray{ +// pulumi.String("ns1.contoso.com."), +// pulumi.String("ns2.contoso.com."), +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // NS records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/ptrRecord.go b/sdk/go/azure/dns/ptrRecord.go index ee2afa37d3..49a25575a8 100644 --- a/sdk/go/azure/dns/ptrRecord.go +++ b/sdk/go/azure/dns/ptrRecord.go @@ -13,6 +13,50 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewPtrRecord(ctx, "examplePtrRecord", &dns.PtrRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: pulumi.StringArray{ +// pulumi.String("yourdomain.com"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PTR records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/srvRecord.go b/sdk/go/azure/dns/srvRecord.go index 329f3fc977..007d387d12 100644 --- a/sdk/go/azure/dns/srvRecord.go +++ b/sdk/go/azure/dns/srvRecord.go @@ -13,6 +13,58 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewSrvRecord(ctx, "exampleSrvRecord", &dns.SrvRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: dns.SrvRecordRecordArray{ +// &dns.SrvRecordRecordArgs{ +// Priority: pulumi.Int(1), +// Weight: pulumi.Int(5), +// Port: pulumi.Int(8080), +// Target: pulumi.String("target1.contoso.com"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SRV records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/txtRecord.go b/sdk/go/azure/dns/txtRecord.go index 6c73972242..5981e14776 100644 --- a/sdk/go/azure/dns/txtRecord.go +++ b/sdk/go/azure/dns/txtRecord.go @@ -13,6 +13,58 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := dns.NewZone(ctx, "exampleZone", &dns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewTxtRecord(ctx, "exampleTxtRecord", &dns.TxtRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: dns.TxtRecordRecordArray{ +// &dns.TxtRecordRecordArgs{ +// Value: pulumi.String("google-site-authenticator"), +// }, +// &dns.TxtRecordRecordArgs{ +// Value: pulumi.String("more site information here"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // TXT records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/dns/zone.go b/sdk/go/azure/dns/zone.go index ec5220f741..f27af2ec6e 100644 --- a/sdk/go/azure/dns/zone.go +++ b/sdk/go/azure/dns/zone.go @@ -15,6 +15,39 @@ import ( // Enables you to manage DNS zones within Azure DNS. These zones are hosted on Azure's name servers to which you can delegate the zone from the parent domain. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = dns.NewZone(ctx, "example-public", &dns.ZoneArgs{ +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/domainservices/getService.go b/sdk/go/azure/domainservices/getService.go index 4880fb317a..b5b2cf276c 100644 --- a/sdk/go/azure/domainservices/getService.go +++ b/sdk/go/azure/domainservices/getService.go @@ -15,6 +15,33 @@ import ( // Gets information about an Active Directory Domain Service. // // > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/domainservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := domainservices.LookupService(ctx, &domainservices.LookupServiceArgs{ +// Name: "example-aadds", +// ResourceGroupName: "example-aadds-rg", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/domainservices/replicaSet.go b/sdk/go/azure/domainservices/replicaSet.go index 1d2048c1b5..abd49ee2ff 100644 --- a/sdk/go/azure/domainservices/replicaSet.go +++ b/sdk/go/azure/domainservices/replicaSet.go @@ -15,6 +15,311 @@ import ( // Manages a Replica Set for an Active Directory Domain Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/domainservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primaryResourceGroup, err := core.NewResourceGroup(ctx, "primaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// primaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "primaryVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.1.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// primarySubnet, err := network.NewSubnet(ctx, "primarySubnet", &network.SubnetArgs{ +// ResourceGroupName: primaryResourceGroup.Name, +// VirtualNetworkName: primaryVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// primaryNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "primaryNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// SecurityRules: network.NetworkSecurityGroupSecurityRuleArray{ +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowSyncWithAzureAD"), +// Priority: pulumi.Int(101), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("443"), +// SourceAddressPrefix: pulumi.String("AzureActiveDirectoryDomainServices"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowRD"), +// Priority: pulumi.Int(201), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("3389"), +// SourceAddressPrefix: pulumi.String("CorpNetSaw"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowPSRemoting"), +// Priority: pulumi.Int(301), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("5986"), +// SourceAddressPrefix: pulumi.String("AzureActiveDirectoryDomainServices"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowLDAPS"), +// Priority: pulumi.Int(401), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("636"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// primarySubnetNetworkSecurityGroupAssociation, err := network.NewSubnetNetworkSecurityGroupAssociation(ctx, "primarySubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: primarySubnet.ID(), +// NetworkSecurityGroupId: primaryNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// dcAdmins, err := azuread.NewGroup(ctx, "dcAdmins", &azuread.GroupArgs{ +// DisplayName: pulumi.String("aad-dc-administrators"), +// SecurityEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// adminUser, err := azuread.NewUser(ctx, "adminUser", &azuread.UserArgs{ +// UserPrincipalName: pulumi.String("dc-admin@hashicorp-example.net"), +// DisplayName: pulumi.String("DC Administrator"), +// Password: pulumi.String("Pa55w0Rd!!1"), +// }) +// if err != nil { +// return err +// } +// _, err = azuread.NewGroupMember(ctx, "adminGroupMember", &azuread.GroupMemberArgs{ +// GroupObjectId: dcAdmins.ObjectId, +// MemberObjectId: adminUser.ObjectId, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.NewServicePrincipal(ctx, "exampleServicePrincipal", &azuread.ServicePrincipalArgs{ +// ApplicationId: pulumi.String("2565bd9d-da50-47d4-8b85-4c97f669dc36"), +// }) +// if err != nil { +// return err +// } +// aadds, err := core.NewResourceGroup(ctx, "aadds", &core.ResourceGroupArgs{ +// Location: pulumi.String("westeurope"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := domainservices.NewService(ctx, "exampleService", &domainservices.ServiceArgs{ +// Location: aadds.Location, +// ResourceGroupName: aadds.Name, +// DomainName: pulumi.String("widgetslogin.net"), +// Sku: pulumi.String("Enterprise"), +// FilteredSyncEnabled: pulumi.Bool(false), +// InitialReplicaSet: &domainservices.ServiceInitialReplicaSetArgs{ +// Location: primaryVirtualNetwork.Location, +// SubnetId: primarySubnet.ID(), +// }, +// Notifications: &domainservices.ServiceNotificationsArgs{ +// AdditionalRecipients: pulumi.StringArray{ +// pulumi.String("notifyA@example.net"), +// pulumi.String("notifyB@example.org"), +// }, +// NotifyDcAdmins: pulumi.Bool(true), +// NotifyGlobalAdmins: pulumi.Bool(true), +// }, +// Security: &domainservices.ServiceSecurityArgs{ +// SyncKerberosPasswords: pulumi.Bool(true), +// SyncNtlmPasswords: pulumi.Bool(true), +// SyncOnPremPasswords: pulumi.Bool(true), +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("prod"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleServicePrincipal, +// primarySubnetNetworkSecurityGroupAssociation, +// })) +// if err != nil { +// return err +// } +// replicaResourceGroup, err := core.NewResourceGroup(ctx, "replicaResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("North Europe"), +// }) +// if err != nil { +// return err +// } +// replicaVirtualNetwork, err := network.NewVirtualNetwork(ctx, "replicaVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: replicaResourceGroup.Location, +// ResourceGroupName: replicaResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.20.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// aaddsReplicaSubnet, err := network.NewSubnet(ctx, "aaddsReplicaSubnet", &network.SubnetArgs{ +// ResourceGroupName: replicaResourceGroup.Name, +// VirtualNetworkName: replicaVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.20.0.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// aaddsReplicaNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "aaddsReplicaNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: replicaResourceGroup.Location, +// ResourceGroupName: replicaResourceGroup.Name, +// SecurityRules: network.NetworkSecurityGroupSecurityRuleArray{ +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowSyncWithAzureAD"), +// Priority: pulumi.Int(101), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("443"), +// SourceAddressPrefix: pulumi.String("AzureActiveDirectoryDomainServices"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowRD"), +// Priority: pulumi.Int(201), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("3389"), +// SourceAddressPrefix: pulumi.String("CorpNetSaw"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowPSRemoting"), +// Priority: pulumi.Int(301), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("5986"), +// SourceAddressPrefix: pulumi.String("AzureActiveDirectoryDomainServices"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowLDAPS"), +// Priority: pulumi.Int(401), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("636"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// replicaSubnetNetworkSecurityGroupAssociation, err := network.NewSubnetNetworkSecurityGroupAssociation(ctx, "replicaSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: aaddsReplicaSubnet.ID(), +// NetworkSecurityGroupId: aaddsReplicaNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// primaryReplica, err := network.NewVirtualNetworkPeering(ctx, "primaryReplica", &network.VirtualNetworkPeeringArgs{ +// ResourceGroupName: primaryVirtualNetwork.ResourceGroupName, +// VirtualNetworkName: primaryVirtualNetwork.Name, +// RemoteVirtualNetworkId: replicaVirtualNetwork.ID(), +// AllowForwardedTraffic: pulumi.Bool(true), +// AllowGatewayTransit: pulumi.Bool(false), +// AllowVirtualNetworkAccess: pulumi.Bool(true), +// UseRemoteGateways: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// replicaPrimary, err := network.NewVirtualNetworkPeering(ctx, "replicaPrimary", &network.VirtualNetworkPeeringArgs{ +// ResourceGroupName: replicaVirtualNetwork.ResourceGroupName, +// VirtualNetworkName: replicaVirtualNetwork.Name, +// RemoteVirtualNetworkId: primaryVirtualNetwork.ID(), +// AllowForwardedTraffic: pulumi.Bool(true), +// AllowGatewayTransit: pulumi.Bool(false), +// AllowVirtualNetworkAccess: pulumi.Bool(true), +// UseRemoteGateways: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkDnsServers(ctx, "replicaVirtualNetworkDnsServers", &network.VirtualNetworkDnsServersArgs{ +// VirtualNetworkId: replicaVirtualNetwork.ID(), +// DnsServers: exampleService.InitialReplicaSet.ApplyT(func(initialReplicaSet domainservices.ServiceInitialReplicaSet) (interface{}, error) { +// return initialReplicaSet.DomainControllerIpAddresses, nil +// }).(pulumi.Interface{}Output), +// }) +// if err != nil { +// return err +// } +// _, err = domainservices.NewReplicaSet(ctx, "replicaReplicaSet", &domainservices.ReplicaSetArgs{ +// DomainServiceId: exampleService.ID(), +// Location: replicaResourceGroup.Location, +// SubnetId: aaddsReplicaSubnet.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// replicaSubnetNetworkSecurityGroupAssociation, +// primaryReplica, +// replicaPrimary, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// ``` +// // ## Import // // Domain Service Replica Sets can be imported using the resource ID of the parent Domain Service and the Replica Set ID, e.g. diff --git a/sdk/go/azure/domainservices/service.go b/sdk/go/azure/domainservices/service.go index 43311136a6..9da7724e9e 100644 --- a/sdk/go/azure/domainservices/service.go +++ b/sdk/go/azure/domainservices/service.go @@ -13,6 +13,181 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/domainservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// deployResourceGroup, err := core.NewResourceGroup(ctx, "deployResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// deployVirtualNetwork, err := network.NewVirtualNetwork(ctx, "deployVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: deployResourceGroup.Location, +// ResourceGroupName: deployResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.1.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// deploySubnet, err := network.NewSubnet(ctx, "deploySubnet", &network.SubnetArgs{ +// ResourceGroupName: deployResourceGroup.Name, +// VirtualNetworkName: deployVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// deployNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "deployNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: deployResourceGroup.Location, +// ResourceGroupName: deployResourceGroup.Name, +// SecurityRules: network.NetworkSecurityGroupSecurityRuleArray{ +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowSyncWithAzureAD"), +// Priority: pulumi.Int(101), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("443"), +// SourceAddressPrefix: pulumi.String("AzureActiveDirectoryDomainServices"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowRD"), +// Priority: pulumi.Int(201), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("3389"), +// SourceAddressPrefix: pulumi.String("CorpNetSaw"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowPSRemoting"), +// Priority: pulumi.Int(301), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("5986"), +// SourceAddressPrefix: pulumi.String("AzureActiveDirectoryDomainServices"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("AllowLDAPS"), +// Priority: pulumi.Int(401), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("636"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// deploySubnetNetworkSecurityGroupAssociation, err := network.NewSubnetNetworkSecurityGroupAssociation(ctx, "deploySubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: deploySubnet.ID(), +// NetworkSecurityGroupId: deployNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// dcAdmins, err := azuread.NewGroup(ctx, "dcAdmins", &azuread.GroupArgs{ +// DisplayName: pulumi.String("AAD DC Administrators"), +// SecurityEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// adminUser, err := azuread.NewUser(ctx, "adminUser", &azuread.UserArgs{ +// UserPrincipalName: pulumi.String("dc-admin@hashicorp-example.com"), +// DisplayName: pulumi.String("DC Administrator"), +// Password: pulumi.String("Pa55w0Rd!!1"), +// }) +// if err != nil { +// return err +// } +// _, err = azuread.NewGroupMember(ctx, "adminGroupMember", &azuread.GroupMemberArgs{ +// GroupObjectId: dcAdmins.ObjectId, +// MemberObjectId: adminUser.ObjectId, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.NewServicePrincipal(ctx, "exampleServicePrincipal", &azuread.ServicePrincipalArgs{ +// ApplicationId: pulumi.String("2565bd9d-da50-47d4-8b85-4c97f669dc36"), +// }) +// if err != nil { +// return err +// } +// aadds, err := core.NewResourceGroup(ctx, "aadds", &core.ResourceGroupArgs{ +// Location: pulumi.String("westeurope"), +// }) +// if err != nil { +// return err +// } +// _, err = domainservices.NewService(ctx, "exampleService", &domainservices.ServiceArgs{ +// Location: aadds.Location, +// ResourceGroupName: aadds.Name, +// DomainName: pulumi.String("widgetslogin.net"), +// Sku: pulumi.String("Enterprise"), +// FilteredSyncEnabled: pulumi.Bool(false), +// InitialReplicaSet: &domainservices.ServiceInitialReplicaSetArgs{ +// SubnetId: deploySubnet.ID(), +// }, +// Notifications: &domainservices.ServiceNotificationsArgs{ +// AdditionalRecipients: pulumi.StringArray{ +// pulumi.String("notifyA@example.net"), +// pulumi.String("notifyB@example.org"), +// }, +// NotifyDcAdmins: pulumi.Bool(true), +// NotifyGlobalAdmins: pulumi.Bool(true), +// }, +// Security: &domainservices.ServiceSecurityArgs{ +// SyncKerberosPasswords: pulumi.Bool(true), +// SyncNtlmPasswords: pulumi.Bool(true), +// SyncOnPremPasswords: pulumi.Bool(true), +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("prod"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleServicePrincipal, +// deploySubnetNetworkSecurityGroupAssociation, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Domain Services can be imported using the resource ID, together with the Replica Set ID that you wish to designate as the initial replica set, e.g. diff --git a/sdk/go/azure/domainservices/serviceTrust.go b/sdk/go/azure/domainservices/serviceTrust.go index 8f0c01c4cc..c3f0548e0b 100644 --- a/sdk/go/azure/domainservices/serviceTrust.go +++ b/sdk/go/azure/domainservices/serviceTrust.go @@ -15,6 +15,45 @@ import ( // Manages a Active Directory Domain Service Trust. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/domainservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleService, err := domainservices.LookupService(ctx, &domainservices.LookupServiceArgs{ +// Name: "example-ds", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = domainservices.NewServiceTrust(ctx, "exampleServiceTrust", &domainservices.ServiceTrustArgs{ +// DomainServiceId: *pulumi.String(exampleService.Id), +// TrustedDomainFqdn: pulumi.String("example.com"), +// TrustedDomainDnsIps: pulumi.StringArray{ +// pulumi.String("10.1.0.3"), +// pulumi.String("10.1.0.4"), +// }, +// Password: pulumi.String("Password123"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Active Directory Domain Service Trusts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/elasticcloud/elasticsearch.go b/sdk/go/azure/elasticcloud/elasticsearch.go index 21e4ebb9c1..3f841cda11 100644 --- a/sdk/go/azure/elasticcloud/elasticsearch.go +++ b/sdk/go/azure/elasticcloud/elasticsearch.go @@ -15,6 +15,42 @@ import ( // Manages an Elasticsearch in Elastic Cloud. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/elasticcloud" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testResourceGroup, err := core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = elasticcloud.NewElasticsearch(ctx, "testElasticsearch", &elasticcloud.ElasticsearchArgs{ +// ResourceGroupName: testResourceGroup.Name, +// Location: testResourceGroup.Location, +// SkuName: pulumi.String("ess-monthly-consumption_Monthly"), +// ElasticCloudEmailAddress: pulumi.String("user@example.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Elasticsearch's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/elasticcloud/getElasticsearch.go b/sdk/go/azure/elasticcloud/getElasticsearch.go index dd54f1434e..8a9b8119f8 100644 --- a/sdk/go/azure/elasticcloud/getElasticsearch.go +++ b/sdk/go/azure/elasticcloud/getElasticsearch.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Elasticsearch resource. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/elasticcloud" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := elasticcloud.LookupElasticsearch(ctx, &elasticcloud.LookupElasticsearchArgs{ +// Name: "my-elastic-search", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("elasticsearchEndpoint", example.ElasticsearchServiceUrl) +// ctx.Export("kibanaEndpoint", example.KibanaServiceUrl) +// return nil +// }) +// } +// +// ``` func LookupElasticsearch(ctx *pulumi.Context, args *LookupElasticsearchArgs, opts ...pulumi.InvokeOption) (*LookupElasticsearchResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupElasticsearchResult diff --git a/sdk/go/azure/eventgrid/domain.go b/sdk/go/azure/eventgrid/domain.go index f1ff1c1f6f..733c7968f6 100644 --- a/sdk/go/azure/eventgrid/domain.go +++ b/sdk/go/azure/eventgrid/domain.go @@ -15,6 +15,43 @@ import ( // Manages an EventGrid Domain // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewDomain(ctx, "exampleDomain", &eventgrid.DomainArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventgrid/domainTopic.go b/sdk/go/azure/eventgrid/domainTopic.go index 1427c65161..b345cafaec 100644 --- a/sdk/go/azure/eventgrid/domainTopic.go +++ b/sdk/go/azure/eventgrid/domainTopic.go @@ -15,6 +15,50 @@ import ( // Manages an EventGrid Domain Topic // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleDomain, err := eventgrid.NewDomain(ctx, "exampleDomain", &eventgrid.DomainArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewDomainTopic(ctx, "exampleDomainTopic", &eventgrid.DomainTopicArgs{ +// DomainName: exampleDomain.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid Domain Topics can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventgrid/eventSubscription.go b/sdk/go/azure/eventgrid/eventSubscription.go index fa56f44ed8..602ad4c306 100644 --- a/sdk/go/azure/eventgrid/eventSubscription.go +++ b/sdk/go/azure/eventgrid/eventSubscription.go @@ -15,6 +15,62 @@ import ( // Manages an EventGrid Event Subscription // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleQueue, err := storage.NewQueue(ctx, "exampleQueue", &storage.QueueArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewEventSubscription(ctx, "exampleEventSubscription", &eventgrid.EventSubscriptionArgs{ +// Scope: exampleResourceGroup.ID(), +// StorageQueueEndpoint: &eventgrid.EventSubscriptionStorageQueueEndpointArgs{ +// StorageAccountId: exampleAccount.ID(), +// QueueName: exampleQueue.Name, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventgrid/getDomain.go b/sdk/go/azure/eventgrid/getDomain.go index bfb427d4de..80e6cf846f 100644 --- a/sdk/go/azure/eventgrid/getDomain.go +++ b/sdk/go/azure/eventgrid/getDomain.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing EventGrid Domain +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := eventgrid.LookupDomain(ctx, &eventgrid.LookupDomainArgs{ +// Name: "my-eventgrid-domain", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("eventgridDomainMappingTopic", example.InputMappingFields[0].Topic) +// return nil +// }) +// } +// +// ``` func LookupDomain(ctx *pulumi.Context, args *LookupDomainArgs, opts ...pulumi.InvokeOption) (*LookupDomainResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDomainResult diff --git a/sdk/go/azure/eventgrid/getDomainTopic.go b/sdk/go/azure/eventgrid/getDomainTopic.go index 59ac42b2c9..190321ba7b 100644 --- a/sdk/go/azure/eventgrid/getDomainTopic.go +++ b/sdk/go/azure/eventgrid/getDomainTopic.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing EventGrid Domain Topic +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := eventgrid.LookupDomainTopic(ctx, &eventgrid.LookupDomainTopicArgs{ +// Name: "my-eventgrid-domain-topic", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupDomainTopic(ctx *pulumi.Context, args *LookupDomainTopicArgs, opts ...pulumi.InvokeOption) (*LookupDomainTopicResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDomainTopicResult diff --git a/sdk/go/azure/eventgrid/getSystemTopic.go b/sdk/go/azure/eventgrid/getSystemTopic.go index 161b977e92..ae5f9a2e1b 100644 --- a/sdk/go/azure/eventgrid/getSystemTopic.go +++ b/sdk/go/azure/eventgrid/getSystemTopic.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing EventGrid System Topic +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := eventgrid.LookupSystemTopic(ctx, &eventgrid.LookupSystemTopicArgs{ +// Name: "eventgrid-system-topic", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSystemTopic(ctx *pulumi.Context, args *LookupSystemTopicArgs, opts ...pulumi.InvokeOption) (*LookupSystemTopicResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSystemTopicResult diff --git a/sdk/go/azure/eventgrid/getTopic.go b/sdk/go/azure/eventgrid/getTopic.go index 13752430b0..3730c1c5bd 100644 --- a/sdk/go/azure/eventgrid/getTopic.go +++ b/sdk/go/azure/eventgrid/getTopic.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing EventGrid Topic +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := eventgrid.LookupTopic(ctx, &eventgrid.LookupTopicArgs{ +// Name: "my-eventgrid-topic", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupTopic(ctx *pulumi.Context, args *LookupTopicArgs, opts ...pulumi.InvokeOption) (*LookupTopicResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTopicResult diff --git a/sdk/go/azure/eventgrid/systemTopic.go b/sdk/go/azure/eventgrid/systemTopic.go index d0ae0fe57c..e4759a4ddf 100644 --- a/sdk/go/azure/eventgrid/systemTopic.go +++ b/sdk/go/azure/eventgrid/systemTopic.go @@ -15,6 +15,55 @@ import ( // Manages an Event Grid System Topic. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewSystemTopic(ctx, "exampleSystemTopic", &eventgrid.SystemTopicArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SourceArmResourceId: exampleAccount.ID(), +// TopicType: pulumi.String("Microsoft.Storage.StorageAccounts"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Event Grid System Topic can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventgrid/systemTopicEventSubscription.go b/sdk/go/azure/eventgrid/systemTopicEventSubscription.go index 7558a38e54..3dec76c6a1 100644 --- a/sdk/go/azure/eventgrid/systemTopicEventSubscription.go +++ b/sdk/go/azure/eventgrid/systemTopicEventSubscription.go @@ -15,6 +15,72 @@ import ( // Manages an EventGrid System Topic Event Subscription. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleQueue, err := storage.NewQueue(ctx, "exampleQueue", &storage.QueueArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleSystemTopic, err := eventgrid.NewSystemTopic(ctx, "exampleSystemTopic", &eventgrid.SystemTopicArgs{ +// Location: pulumi.String("Global"), +// ResourceGroupName: exampleResourceGroup.Name, +// SourceArmResourceId: exampleResourceGroup.ID(), +// TopicType: pulumi.String("Microsoft.Resources.ResourceGroups"), +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewSystemTopicEventSubscription(ctx, "exampleSystemTopicEventSubscription", &eventgrid.SystemTopicEventSubscriptionArgs{ +// SystemTopic: exampleSystemTopic.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageQueueEndpoint: &eventgrid.SystemTopicEventSubscriptionStorageQueueEndpointArgs{ +// StorageAccountId: exampleAccount.ID(), +// QueueName: exampleQueue.Name, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid System Topic Event Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventgrid/topic.go b/sdk/go/azure/eventgrid/topic.go index fff36b9460..846d7b5704 100644 --- a/sdk/go/azure/eventgrid/topic.go +++ b/sdk/go/azure/eventgrid/topic.go @@ -17,6 +17,43 @@ import ( // // > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewTopic(ctx, "exampleTopic", &eventgrid.TopicArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/authorizationRule.go b/sdk/go/azure/eventhub/authorizationRule.go index 56a2417f80..0ffbe3d766 100644 --- a/sdk/go/azure/eventhub/authorizationRule.go +++ b/sdk/go/azure/eventhub/authorizationRule.go @@ -15,6 +15,65 @@ import ( // Manages a Event Hubs authorization Rule within an Event Hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// Capacity: pulumi.Int(2), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(false), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/cluster.go b/sdk/go/azure/eventhub/cluster.go index 18e081ffb7..20914ac3ec 100644 --- a/sdk/go/azure/eventhub/cluster.go +++ b/sdk/go/azure/eventhub/cluster.go @@ -15,6 +15,41 @@ import ( // Manages an EventHub Cluster // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewCluster(ctx, "test", &eventhub.ClusterArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// SkuName: pulumi.String("Dedicated_1"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHub Cluster's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/consumerGroup.go b/sdk/go/azure/eventhub/consumerGroup.go index 58ec0720b1..95e708c77d 100644 --- a/sdk/go/azure/eventhub/consumerGroup.go +++ b/sdk/go/azure/eventhub/consumerGroup.go @@ -15,6 +15,63 @@ import ( // Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// Capacity: pulumi.Int(2), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// UserMetadata: pulumi.String("some-meta-data"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/domain.go b/sdk/go/azure/eventhub/domain.go index 55a6308135..1538c50228 100644 --- a/sdk/go/azure/eventhub/domain.go +++ b/sdk/go/azure/eventhub/domain.go @@ -15,6 +15,43 @@ import ( // Manages an EventGrid Domain // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewDomain(ctx, "exampleDomain", &eventgrid.DomainArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventGridTopic.go b/sdk/go/azure/eventhub/eventGridTopic.go index a3b821bc35..561b8ae980 100644 --- a/sdk/go/azure/eventhub/eventGridTopic.go +++ b/sdk/go/azure/eventhub/eventGridTopic.go @@ -17,6 +17,43 @@ import ( // // > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewTopic(ctx, "exampleTopic", &eventgrid.TopicArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventHub.go b/sdk/go/azure/eventhub/eventHub.go index f0d1efe3b0..77c51430e0 100644 --- a/sdk/go/azure/eventhub/eventHub.go +++ b/sdk/go/azure/eventhub/eventHub.go @@ -15,6 +15,54 @@ import ( // Manages a Event Hubs as a nested resource within a Event Hubs namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(1), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventHubAuthorizationRule.go b/sdk/go/azure/eventhub/eventHubAuthorizationRule.go index fad1252719..0ad8b02db6 100644 --- a/sdk/go/azure/eventhub/eventHubAuthorizationRule.go +++ b/sdk/go/azure/eventhub/eventHubAuthorizationRule.go @@ -15,6 +15,65 @@ import ( // Manages a Event Hubs authorization Rule within an Event Hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// Capacity: pulumi.Int(2), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(false), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventHubConsumerGroup.go b/sdk/go/azure/eventhub/eventHubConsumerGroup.go index c4c534ca60..6456cd140a 100644 --- a/sdk/go/azure/eventhub/eventHubConsumerGroup.go +++ b/sdk/go/azure/eventhub/eventHubConsumerGroup.go @@ -15,6 +15,63 @@ import ( // Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// Capacity: pulumi.Int(2), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// UserMetadata: pulumi.String("some-meta-data"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventHubNamespace.go b/sdk/go/azure/eventhub/eventHubNamespace.go index 1f6b44bd91..dfff1cd4e2 100644 --- a/sdk/go/azure/eventhub/eventHubNamespace.go +++ b/sdk/go/azure/eventhub/eventHubNamespace.go @@ -15,6 +15,45 @@ import ( // Manages an EventHub Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(2), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventHubNamespaceAuthorizationRule.go b/sdk/go/azure/eventhub/eventHubNamespaceAuthorizationRule.go index 84547fbfc2..dbebd47292 100644 --- a/sdk/go/azure/eventhub/eventHubNamespaceAuthorizationRule.go +++ b/sdk/go/azure/eventhub/eventHubNamespaceAuthorizationRule.go @@ -15,6 +15,55 @@ import ( // Manages an Authorization Rule for an Event Hub Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// Capacity: pulumi.Int(2), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewEventHubNamespaceAuthorizationRule(ctx, "exampleEventHubNamespaceAuthorizationRule", &eventhub.EventHubNamespaceAuthorizationRuleArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(false), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHub Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventSubscription.go b/sdk/go/azure/eventhub/eventSubscription.go index b585623d4a..5cb3c8abcd 100644 --- a/sdk/go/azure/eventhub/eventSubscription.go +++ b/sdk/go/azure/eventhub/eventSubscription.go @@ -15,6 +15,62 @@ import ( // Manages an EventGrid Event Subscription // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleQueue, err := storage.NewQueue(ctx, "exampleQueue", &storage.QueueArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = eventgrid.NewEventSubscription(ctx, "exampleEventSubscription", &eventgrid.EventSubscriptionArgs{ +// Scope: exampleResourceGroup.ID(), +// StorageQueueEndpoint: &eventgrid.EventSubscriptionStorageQueueEndpointArgs{ +// StorageAccountId: exampleAccount.ID(), +// QueueName: exampleQueue.Name, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/eventhubNamespaceDisasterRecoveryConfig.go b/sdk/go/azure/eventhub/eventhubNamespaceDisasterRecoveryConfig.go index 06dd588f8c..3b2a4d0d1e 100644 --- a/sdk/go/azure/eventhub/eventhubNamespaceDisasterRecoveryConfig.go +++ b/sdk/go/azure/eventhub/eventhubNamespaceDisasterRecoveryConfig.go @@ -15,6 +15,57 @@ import ( // Manages an Disaster Recovery Config for an Event Hub Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// primary, err := eventhub.NewEventHubNamespace(ctx, "primary", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// secondary, err := eventhub.NewEventHubNamespace(ctx, "secondary", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewEventhubNamespaceDisasterRecoveryConfig(ctx, "exampleEventhubNamespaceDisasterRecoveryConfig", &eventhub.EventhubNamespaceDisasterRecoveryConfigArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// NamespaceName: primary.Name, +// PartnerNamespaceId: secondary.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/getAuthorizationRule.go b/sdk/go/azure/eventhub/getAuthorizationRule.go index f6325ecd79..c22bd7ba31 100644 --- a/sdk/go/azure/eventhub/getAuthorizationRule.go +++ b/sdk/go/azure/eventhub/getAuthorizationRule.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := eventhub.LookupAuthorizationRule(ctx, &eventhub.LookupAuthorizationRuleArgs{ +// Name: "test", +// NamespaceName: azurerm_eventhub_namespace.Test.Name, +// EventhubName: azurerm_eventhub.Test.Name, +// ResourceGroupName: azurerm_resource_group.Test.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupAuthorizationRule(ctx *pulumi.Context, args *LookupAuthorizationRuleArgs, opts ...pulumi.InvokeOption) (*LookupAuthorizationRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAuthorizationRuleResult diff --git a/sdk/go/azure/eventhub/getCluster.go b/sdk/go/azure/eventhub/getCluster.go index 2517f32562..8f961e47af 100644 --- a/sdk/go/azure/eventhub/getCluster.go +++ b/sdk/go/azure/eventhub/getCluster.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing EventHub. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := eventhub.LookupCluster(ctx, &eventhub.LookupClusterArgs{ +// Name: "search-eventhub", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("eventhubId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupCluster(ctx *pulumi.Context, args *LookupClusterArgs, opts ...pulumi.InvokeOption) (*LookupClusterResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupClusterResult diff --git a/sdk/go/azure/eventhub/getConsumeGroup.go b/sdk/go/azure/eventhub/getConsumeGroup.go index f47369d85f..17dc6b5821 100644 --- a/sdk/go/azure/eventhub/getConsumeGroup.go +++ b/sdk/go/azure/eventhub/getConsumeGroup.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Event Hubs Consumer Group within an Event Hub. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := eventhub.GetConsumeGroup(ctx, &eventhub.GetConsumeGroupArgs{ +// Name: azurerm_eventhub_consumer_group.Test.Name, +// NamespaceName: azurerm_eventhub_namespace.Test.Name, +// EventhubName: azurerm_eventhub.Test.Name, +// ResourceGroupName: azurerm_resource_group.Test.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetConsumeGroup(ctx *pulumi.Context, args *GetConsumeGroupArgs, opts ...pulumi.InvokeOption) (*GetConsumeGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetConsumeGroupResult diff --git a/sdk/go/azure/eventhub/getEventHub.go b/sdk/go/azure/eventhub/getEventHub.go index 3d2acb2fce..b1011784ba 100644 --- a/sdk/go/azure/eventhub/getEventHub.go +++ b/sdk/go/azure/eventhub/getEventHub.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing EventHub. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := eventhub.LookupEventHub(ctx, &eventhub.LookupEventHubArgs{ +// Name: "search-eventhub", +// ResourceGroupName: "search-service", +// NamespaceName: "search-eventhubns", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("eventhubId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupEventHub(ctx *pulumi.Context, args *LookupEventHubArgs, opts ...pulumi.InvokeOption) (*LookupEventHubResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupEventHubResult diff --git a/sdk/go/azure/eventhub/getEventhubNamespace.go b/sdk/go/azure/eventhub/getEventhubNamespace.go index b8998d2f54..d8e8e39cc6 100644 --- a/sdk/go/azure/eventhub/getEventhubNamespace.go +++ b/sdk/go/azure/eventhub/getEventhubNamespace.go @@ -14,6 +14,34 @@ import ( // Use this data source to access information about an existing EventHub Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := eventhub.LookupNamespace(ctx, &eventhub.LookupNamespaceArgs{ +// Name: "search-eventhubns", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("eventhubNamespaceId", example.Id) +// return nil +// }) +// } +// +// ``` +// // Deprecated: azure.eventhub.getEventhubNamespace has been deprecated in favor of azure.eventhub.getNamespace func GetEventhubNamespace(ctx *pulumi.Context, args *GetEventhubNamespaceArgs, opts ...pulumi.InvokeOption) (*GetEventhubNamespaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) diff --git a/sdk/go/azure/eventhub/getNamespace.go b/sdk/go/azure/eventhub/getNamespace.go index fac8859218..65fbe0678c 100644 --- a/sdk/go/azure/eventhub/getNamespace.go +++ b/sdk/go/azure/eventhub/getNamespace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing EventHub Namespace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := eventhub.LookupNamespace(ctx, &eventhub.LookupNamespaceArgs{ +// Name: "search-eventhubns", +// ResourceGroupName: "search-service", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("eventhubNamespaceId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupNamespace(ctx *pulumi.Context, args *LookupNamespaceArgs, opts ...pulumi.InvokeOption) (*LookupNamespaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNamespaceResult diff --git a/sdk/go/azure/eventhub/getNamespaceAuthorizationRule.go b/sdk/go/azure/eventhub/getNamespaceAuthorizationRule.go index 36719468b8..3de57a31c0 100644 --- a/sdk/go/azure/eventhub/getNamespaceAuthorizationRule.go +++ b/sdk/go/azure/eventhub/getNamespaceAuthorizationRule.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an Authorization Rule for an Event Hub Namespace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := eventhub.LookupNamespaceAuthorizationRule(ctx, &eventhub.LookupNamespaceAuthorizationRuleArgs{ +// Name: "navi", +// ResourceGroupName: "example-resources", +// NamespaceName: "example-ns", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("eventhubAuthorizationRuleId", data.Azurem_eventhub_namespace_authorization_rule.Example.Id) +// return nil +// }) +// } +// +// ``` func LookupNamespaceAuthorizationRule(ctx *pulumi.Context, args *LookupNamespaceAuthorizationRuleArgs, opts ...pulumi.InvokeOption) (*LookupNamespaceAuthorizationRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNamespaceAuthorizationRuleResult diff --git a/sdk/go/azure/eventhub/getServiceBusNamespace.go b/sdk/go/azure/eventhub/getServiceBusNamespace.go index 7b1e75d70c..4586d8ce3d 100644 --- a/sdk/go/azure/eventhub/getServiceBusNamespace.go +++ b/sdk/go/azure/eventhub/getServiceBusNamespace.go @@ -14,6 +14,34 @@ import ( // Use this data source to access information about an existing ServiceBus Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := servicebus.LookupNamespace(ctx, &servicebus.LookupNamespaceArgs{ +// Name: "examplenamespace", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("location", example.Location) +// return nil +// }) +// } +// +// ``` +// // Deprecated: azure.eventhub.getServiceBusNamespace has been deprecated in favor of azure.servicebus.getNamespace func GetServiceBusNamespace(ctx *pulumi.Context, args *GetServiceBusNamespaceArgs, opts ...pulumi.InvokeOption) (*GetServiceBusNamespaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) diff --git a/sdk/go/azure/eventhub/namespace.go b/sdk/go/azure/eventhub/namespace.go index a9cc429c6b..530754afd0 100644 --- a/sdk/go/azure/eventhub/namespace.go +++ b/sdk/go/azure/eventhub/namespace.go @@ -15,6 +15,44 @@ import ( // Manages a ServiceBus Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/namespaceAuthorizationRule.go b/sdk/go/azure/eventhub/namespaceAuthorizationRule.go index 0af585668c..519b814c85 100644 --- a/sdk/go/azure/eventhub/namespaceAuthorizationRule.go +++ b/sdk/go/azure/eventhub/namespaceAuthorizationRule.go @@ -15,6 +15,53 @@ import ( // Manages a ServiceBus Namespace authorization Rule within a ServiceBus. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewNamespaceAuthorizationRule(ctx, "exampleNamespaceAuthorizationRule", &servicebus.NamespaceAuthorizationRuleArgs{ +// NamespaceId: exampleNamespace.ID(), +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/namespaceCustomerManagedKey.go b/sdk/go/azure/eventhub/namespaceCustomerManagedKey.go index 14fc3d25d9..ee34a186b9 100644 --- a/sdk/go/azure/eventhub/namespaceCustomerManagedKey.go +++ b/sdk/go/azure/eventhub/namespaceCustomerManagedKey.go @@ -17,6 +17,130 @@ import ( // // !> **Note:** In 2.x versions of the Azure Provider during deletion this resource will **delete and recreate the parent EventHub Namespace which may involve data loss** as it's not possible to remove the Customer Managed Key from the EventHub Namespace once it's been added. Version 3.0 of the Azure Provider will change this so that the Delete operation is a noop, requiring the parent EventHub Namespace is deleted/recreated to remove the Customer Managed Key. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := eventhub.NewCluster(ctx, "exampleCluster", &eventhub.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("Dedicated_1"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// DedicatedClusterId: exampleCluster.ID(), +// Identity: &eventhub.EventHubNamespaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccessPolicy, err := keyvault.NewAccessPolicy(ctx, "exampleAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: exampleEventHubNamespace.Identity.ApplyT(func(identity eventhub.EventHubNamespaceIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleEventHubNamespace.Identity.ApplyT(func(identity eventhub.EventHubNamespaceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// }, +// }) +// if err != nil { +// return err +// } +// example2, err := keyvault.NewAccessPolicy(ctx, "example2", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAccessPolicy, +// example2, +// })) +// if err != nil { +// return err +// } +// _, err = eventhub.NewNamespaceCustomerManagedKey(ctx, "exampleNamespaceCustomerManagedKey", &eventhub.NamespaceCustomerManagedKeyArgs{ +// EventhubNamespaceId: exampleEventHubNamespace.ID(), +// KeyVaultKeyIds: pulumi.StringArray{ +// exampleKey.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Customer Managed Keys for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/namespaceSchemaGroup.go b/sdk/go/azure/eventhub/namespaceSchemaGroup.go index e6eb541031..6562e06075 100644 --- a/sdk/go/azure/eventhub/namespaceSchemaGroup.go +++ b/sdk/go/azure/eventhub/namespaceSchemaGroup.go @@ -13,6 +13,49 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// testEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "testEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = eventhub.NewNamespaceSchemaGroup(ctx, "testNamespaceSchemaGroup", &eventhub.NamespaceSchemaGroupArgs{ +// NamespaceId: testEventHubNamespace.ID(), +// SchemaCompatibility: pulumi.String("Forward"), +// SchemaType: pulumi.String("Avro"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Schema Group for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/queue.go b/sdk/go/azure/eventhub/queue.go index f3957c58ec..0fa6f3e97d 100644 --- a/sdk/go/azure/eventhub/queue.go +++ b/sdk/go/azure/eventhub/queue.go @@ -15,6 +15,51 @@ import ( // Manages a ServiceBus Queue. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewQueue(ctx, "exampleQueue", &servicebus.QueueArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/queueAuthorizationRule.go b/sdk/go/azure/eventhub/queueAuthorizationRule.go index 4bb3e1f048..9d07b178d3 100644 --- a/sdk/go/azure/eventhub/queueAuthorizationRule.go +++ b/sdk/go/azure/eventhub/queueAuthorizationRule.go @@ -15,6 +15,60 @@ import ( // Manages an Authorization Rule for a ServiceBus Queue. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleQueue, err := servicebus.NewQueue(ctx, "exampleQueue", &servicebus.QueueArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewQueueAuthorizationRule(ctx, "exampleQueueAuthorizationRule", &servicebus.QueueAuthorizationRuleArgs{ +// QueueId: exampleQueue.ID(), +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/subscription.go b/sdk/go/azure/eventhub/subscription.go index da312a11b5..ec7e0866b4 100644 --- a/sdk/go/azure/eventhub/subscription.go +++ b/sdk/go/azure/eventhub/subscription.go @@ -15,6 +15,58 @@ import ( // Manages a ServiceBus Subscription. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewSubscription(ctx, "exampleSubscription", &servicebus.SubscriptionArgs{ +// TopicId: exampleTopic.ID(), +// MaxDeliveryCount: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/subscriptionRule.go b/sdk/go/azure/eventhub/subscriptionRule.go index 5aff86d4e5..7bd2076a48 100644 --- a/sdk/go/azure/eventhub/subscriptionRule.go +++ b/sdk/go/azure/eventhub/subscriptionRule.go @@ -16,6 +16,130 @@ import ( // Manages a ServiceBus Subscription Rule. // // ## Example Usage +// ### SQL Filter) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleSubscription, err := servicebus.NewSubscription(ctx, "exampleSubscription", &servicebus.SubscriptionArgs{ +// TopicId: exampleTopic.ID(), +// MaxDeliveryCount: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewSubscriptionRule(ctx, "exampleSubscriptionRule", &servicebus.SubscriptionRuleArgs{ +// SubscriptionId: exampleSubscription.ID(), +// FilterType: pulumi.String("SqlFilter"), +// SqlFilter: pulumi.String("colour = 'red'"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Correlation Filter) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleSubscription, err := servicebus.NewSubscription(ctx, "exampleSubscription", &servicebus.SubscriptionArgs{ +// TopicId: exampleTopic.ID(), +// MaxDeliveryCount: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewSubscriptionRule(ctx, "exampleSubscriptionRule", &servicebus.SubscriptionRuleArgs{ +// SubscriptionId: exampleSubscription.ID(), +// FilterType: pulumi.String("CorrelationFilter"), +// CorrelationFilter: &servicebus.SubscriptionRuleCorrelationFilterArgs{ +// CorrelationId: pulumi.String("high"), +// Label: pulumi.String("red"), +// Properties: pulumi.StringMap{ +// "customProperty": pulumi.String("value"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/eventhub/topic.go b/sdk/go/azure/eventhub/topic.go index 4cfa360bb6..9b29882cd0 100644 --- a/sdk/go/azure/eventhub/topic.go +++ b/sdk/go/azure/eventhub/topic.go @@ -17,6 +17,51 @@ import ( // // **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/eventhub/topicAuthorizationRule.go b/sdk/go/azure/eventhub/topicAuthorizationRule.go index 58d5ae5872..2dae38bd77 100644 --- a/sdk/go/azure/eventhub/topicAuthorizationRule.go +++ b/sdk/go/azure/eventhub/topicAuthorizationRule.go @@ -15,6 +15,59 @@ import ( // Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewTopicAuthorizationRule(ctx, "exampleTopicAuthorizationRule", &servicebus.TopicAuthorizationRuleArgs{ +// TopicId: exampleTopic.ID(), +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(false), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/fluidrelay/server.go b/sdk/go/azure/fluidrelay/server.go index e27004afbc..ac1b6fde96 100644 --- a/sdk/go/azure/fluidrelay/server.go +++ b/sdk/go/azure/fluidrelay/server.go @@ -15,6 +15,40 @@ import ( // Manages a Fluid Relay Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/fluidrelay" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = fluidrelay.NewServer(ctx, "exampleServer", &fluidrelay.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Fluid Relay Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/frontdoor/firewallPolicy.go b/sdk/go/azure/frontdoor/firewallPolicy.go index dcf88008a1..7be853f321 100644 --- a/sdk/go/azure/frontdoor/firewallPolicy.go +++ b/sdk/go/azure/frontdoor/firewallPolicy.go @@ -13,6 +13,150 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/frontdoor" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = frontdoor.NewFirewallPolicy(ctx, "exampleFirewallPolicy", &frontdoor.FirewallPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Enabled: pulumi.Bool(true), +// Mode: pulumi.String("Prevention"), +// RedirectUrl: pulumi.String("https://www.contoso.com"), +// CustomBlockResponseStatusCode: pulumi.Int(403), +// CustomBlockResponseBody: pulumi.String("PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg=="), +// CustomRules: frontdoor.FirewallPolicyCustomRuleArray{ +// &frontdoor.FirewallPolicyCustomRuleArgs{ +// Name: pulumi.String("Rule1"), +// Enabled: pulumi.Bool(true), +// Priority: pulumi.Int(1), +// RateLimitDurationInMinutes: pulumi.Int(1), +// RateLimitThreshold: pulumi.Int(10), +// Type: pulumi.String("MatchRule"), +// Action: pulumi.String("Block"), +// MatchConditions: frontdoor.FirewallPolicyCustomRuleMatchConditionArray{ +// &frontdoor.FirewallPolicyCustomRuleMatchConditionArgs{ +// MatchVariable: pulumi.String("RemoteAddr"), +// Operator: pulumi.String("IPMatch"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// pulumi.String("10.0.0.0/24"), +// }, +// }, +// }, +// }, +// &frontdoor.FirewallPolicyCustomRuleArgs{ +// Name: pulumi.String("Rule2"), +// Enabled: pulumi.Bool(true), +// Priority: pulumi.Int(2), +// RateLimitDurationInMinutes: pulumi.Int(1), +// RateLimitThreshold: pulumi.Int(10), +// Type: pulumi.String("MatchRule"), +// Action: pulumi.String("Block"), +// MatchConditions: frontdoor.FirewallPolicyCustomRuleMatchConditionArray{ +// &frontdoor.FirewallPolicyCustomRuleMatchConditionArgs{ +// MatchVariable: pulumi.String("RemoteAddr"), +// Operator: pulumi.String("IPMatch"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }, +// &frontdoor.FirewallPolicyCustomRuleMatchConditionArgs{ +// MatchVariable: pulumi.String("RequestHeader"), +// Selector: pulumi.String("UserAgent"), +// Operator: pulumi.String("Contains"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("windows"), +// }, +// Transforms: pulumi.StringArray{ +// pulumi.String("Lowercase"), +// pulumi.String("Trim"), +// }, +// }, +// }, +// }, +// }, +// ManagedRules: frontdoor.FirewallPolicyManagedRuleArray{ +// &frontdoor.FirewallPolicyManagedRuleArgs{ +// Type: pulumi.String("DefaultRuleSet"), +// Version: pulumi.String("1.0"), +// Exclusions: frontdoor.FirewallPolicyManagedRuleExclusionArray{ +// &frontdoor.FirewallPolicyManagedRuleExclusionArgs{ +// MatchVariable: pulumi.String("QueryStringArgNames"), +// Operator: pulumi.String("Equals"), +// Selector: pulumi.String("not_suspicious"), +// }, +// }, +// Overrides: frontdoor.FirewallPolicyManagedRuleOverrideArray{ +// &frontdoor.FirewallPolicyManagedRuleOverrideArgs{ +// RuleGroupName: pulumi.String("PHP"), +// Rules: frontdoor.FirewallPolicyManagedRuleOverrideRuleArray{ +// &frontdoor.FirewallPolicyManagedRuleOverrideRuleArgs{ +// RuleId: pulumi.String("933100"), +// Enabled: pulumi.Bool(false), +// Action: pulumi.String("Block"), +// }, +// }, +// }, +// &frontdoor.FirewallPolicyManagedRuleOverrideArgs{ +// RuleGroupName: pulumi.String("SQLI"), +// Exclusions: frontdoor.FirewallPolicyManagedRuleOverrideExclusionArray{ +// &frontdoor.FirewallPolicyManagedRuleOverrideExclusionArgs{ +// MatchVariable: pulumi.String("QueryStringArgNames"), +// Operator: pulumi.String("Equals"), +// Selector: pulumi.String("really_not_suspicious"), +// }, +// }, +// Rules: frontdoor.FirewallPolicyManagedRuleOverrideRuleArray{ +// &frontdoor.FirewallPolicyManagedRuleOverrideRuleArgs{ +// RuleId: pulumi.String("942200"), +// Action: pulumi.String("Block"), +// Exclusions: frontdoor.FirewallPolicyManagedRuleOverrideRuleExclusionArray{ +// &frontdoor.FirewallPolicyManagedRuleOverrideRuleExclusionArgs{ +// MatchVariable: pulumi.String("QueryStringArgNames"), +// Operator: pulumi.String("Equals"), +// Selector: pulumi.String("innocent"), +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// &frontdoor.FirewallPolicyManagedRuleArgs{ +// Type: pulumi.String("Microsoft_BotManagerRuleSet"), +// Version: pulumi.String("1.0"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // FrontDoor Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/frontdoor/frontdoor.go b/sdk/go/azure/frontdoor/frontdoor.go index bdf52e2255..bd875c9f97 100644 --- a/sdk/go/azure/frontdoor/frontdoor.go +++ b/sdk/go/azure/frontdoor/frontdoor.go @@ -25,6 +25,89 @@ import ( // * Use Front Door to improve application performance with SSL offload and routing requests to the fastest available application backend. // * Use Front Door for application layer security and DDoS protection for your application. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/frontdoor" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = frontdoor.NewFrontdoor(ctx, "exampleFrontdoor", &frontdoor.FrontdoorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RoutingRules: frontdoor.FrontdoorRoutingRuleArray{ +// &frontdoor.FrontdoorRoutingRuleArgs{ +// Name: pulumi.String("exampleRoutingRule1"), +// AcceptedProtocols: pulumi.StringArray{ +// pulumi.String("Http"), +// pulumi.String("Https"), +// }, +// PatternsToMatches: pulumi.StringArray{ +// pulumi.String("/*"), +// }, +// FrontendEndpoints: pulumi.StringArray{ +// pulumi.String("exampleFrontendEndpoint1"), +// }, +// ForwardingConfiguration: &frontdoor.FrontdoorRoutingRuleForwardingConfigurationArgs{ +// ForwardingProtocol: pulumi.String("MatchRequest"), +// BackendPoolName: pulumi.String("exampleBackendBing"), +// }, +// }, +// }, +// BackendPoolLoadBalancings: frontdoor.FrontdoorBackendPoolLoadBalancingArray{ +// &frontdoor.FrontdoorBackendPoolLoadBalancingArgs{ +// Name: pulumi.String("exampleLoadBalancingSettings1"), +// }, +// }, +// BackendPoolHealthProbes: frontdoor.FrontdoorBackendPoolHealthProbeArray{ +// &frontdoor.FrontdoorBackendPoolHealthProbeArgs{ +// Name: pulumi.String("exampleHealthProbeSetting1"), +// }, +// }, +// BackendPools: frontdoor.FrontdoorBackendPoolArray{ +// &frontdoor.FrontdoorBackendPoolArgs{ +// Name: pulumi.String("exampleBackendBing"), +// Backends: frontdoor.FrontdoorBackendPoolBackendArray{ +// &frontdoor.FrontdoorBackendPoolBackendArgs{ +// HostHeader: pulumi.String("www.bing.com"), +// Address: pulumi.String("www.bing.com"), +// HttpPort: pulumi.Int(80), +// HttpsPort: pulumi.Int(443), +// }, +// }, +// LoadBalancingName: pulumi.String("exampleLoadBalancingSettings1"), +// HealthProbeName: pulumi.String("exampleHealthProbeSetting1"), +// }, +// }, +// FrontendEndpoints: frontdoor.FrontdoorFrontendEndpointArray{ +// &frontdoor.FrontdoorFrontendEndpointArgs{ +// Name: pulumi.String("exampleFrontendEndpoint1"), +// HostName: pulumi.String("example-FrontDoor.azurefd.net"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Front Doors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/frontdoor/rulesEngine.go b/sdk/go/azure/frontdoor/rulesEngine.go index a7786dfc1e..5aff0d1659 100644 --- a/sdk/go/azure/frontdoor/rulesEngine.go +++ b/sdk/go/azure/frontdoor/rulesEngine.go @@ -17,6 +17,135 @@ import ( // // Manages an Azure Front Door (classic) Rules Engine configuration and rules. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/frontdoor" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFrontdoor, err := frontdoor.NewFrontdoor(ctx, "exampleFrontdoor", &frontdoor.FrontdoorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// BackendPools: frontdoor.FrontdoorBackendPoolArray{ +// &frontdoor.FrontdoorBackendPoolArgs{ +// Name: pulumi.String("exampleBackendBing"), +// LoadBalancingName: pulumi.String("exampleLoadBalancingSettings1"), +// HealthProbeName: pulumi.String("exampleHealthProbeSetting1"), +// Backends: frontdoor.FrontdoorBackendPoolBackendArray{ +// &frontdoor.FrontdoorBackendPoolBackendArgs{ +// HostHeader: pulumi.String("www.bing.com"), +// Address: pulumi.String("www.bing.com"), +// HttpPort: pulumi.Int(80), +// HttpsPort: pulumi.Int(443), +// }, +// }, +// }, +// }, +// BackendPoolHealthProbes: frontdoor.FrontdoorBackendPoolHealthProbeArray{ +// &frontdoor.FrontdoorBackendPoolHealthProbeArgs{ +// Name: pulumi.String("exampleHealthProbeSetting1"), +// }, +// }, +// BackendPoolLoadBalancings: frontdoor.FrontdoorBackendPoolLoadBalancingArray{ +// &frontdoor.FrontdoorBackendPoolLoadBalancingArgs{ +// Name: pulumi.String("exampleLoadBalancingSettings1"), +// }, +// }, +// FrontendEndpoints: frontdoor.FrontdoorFrontendEndpointArray{ +// &frontdoor.FrontdoorFrontendEndpointArgs{ +// Name: pulumi.String("exampleFrontendEndpoint1"), +// HostName: pulumi.String("example-FrontDoor.azurefd.net"), +// }, +// }, +// RoutingRules: frontdoor.FrontdoorRoutingRuleArray{ +// &frontdoor.FrontdoorRoutingRuleArgs{ +// Name: pulumi.String("exampleRoutingRule1"), +// AcceptedProtocols: pulumi.StringArray{ +// pulumi.String("Http"), +// pulumi.String("Https"), +// }, +// PatternsToMatches: pulumi.StringArray{ +// pulumi.String("/*"), +// }, +// FrontendEndpoints: pulumi.StringArray{ +// pulumi.String("exampleFrontendEndpoint1"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = frontdoor.NewRulesEngine(ctx, "exampleRulesEngine", &frontdoor.RulesEngineArgs{ +// FrontdoorName: exampleFrontdoor.Name, +// ResourceGroupName: exampleFrontdoor.ResourceGroupName, +// Rules: frontdoor.RulesEngineRuleArray{ +// &frontdoor.RulesEngineRuleArgs{ +// Name: pulumi.String("debuggingoutput"), +// Priority: pulumi.Int(1), +// Action: &frontdoor.RulesEngineRuleActionArgs{ +// ResponseHeaders: frontdoor.RulesEngineRuleActionResponseHeaderArray{ +// &frontdoor.RulesEngineRuleActionResponseHeaderArgs{ +// HeaderActionType: pulumi.String("Append"), +// HeaderName: pulumi.String("X-TEST-HEADER"), +// Value: pulumi.String("Append Header Rule"), +// }, +// }, +// }, +// }, +// &frontdoor.RulesEngineRuleArgs{ +// Name: pulumi.String("overwriteorigin"), +// Priority: pulumi.Int(2), +// MatchConditions: frontdoor.RulesEngineRuleMatchConditionArray{ +// &frontdoor.RulesEngineRuleMatchConditionArgs{ +// Variable: pulumi.String("RequestMethod"), +// Operator: pulumi.String("Equal"), +// Values: pulumi.StringArray{ +// pulumi.String("GET"), +// pulumi.String("POST"), +// }, +// }, +// }, +// Action: &frontdoor.RulesEngineRuleActionArgs{ +// ResponseHeaders: frontdoor.RulesEngineRuleActionResponseHeaderArray{ +// &frontdoor.RulesEngineRuleActionResponseHeaderArgs{ +// HeaderActionType: pulumi.String("Overwrite"), +// HeaderName: pulumi.String("Access-Control-Allow-Origin"), +// Value: pulumi.String("*"), +// }, +// &frontdoor.RulesEngineRuleActionResponseHeaderArgs{ +// HeaderActionType: pulumi.String("Overwrite"), +// HeaderName: pulumi.String("Access-Control-Allow-Credentials"), +// Value: pulumi.String("true"), +// }, +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Front Door Rules Engine's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/graph/account.go b/sdk/go/azure/graph/account.go index 0977de2ad6..b4bb1edda3 100644 --- a/sdk/go/azure/graph/account.go +++ b/sdk/go/azure/graph/account.go @@ -17,6 +17,50 @@ import ( // // !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `graph.ServicesAccount` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/graph" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleApplication, err := azuread.NewApplication(ctx, "exampleApplication", &azuread.ApplicationArgs{ +// DisplayName: pulumi.String("example-app"), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = graph.NewAccount(ctx, "exampleAccount", &graph.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationId: exampleApplication.ApplicationId, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/go/azure/graph/servicesAccount.go b/sdk/go/azure/graph/servicesAccount.go index 0209d1bf46..5ae376369c 100644 --- a/sdk/go/azure/graph/servicesAccount.go +++ b/sdk/go/azure/graph/servicesAccount.go @@ -15,6 +15,50 @@ import ( // Manages a Microsoft Graph Services Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/graph" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleApplication, err := azuread.NewApplication(ctx, "exampleApplication", &azuread.ApplicationArgs{ +// DisplayName: pulumi.String("example-app"), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = graph.NewServicesAccount(ctx, "exampleServicesAccount", &graph.ServicesAccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationId: exampleApplication.ApplicationId, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/go/azure/hdinsight/getCluster.go b/sdk/go/azure/hdinsight/getCluster.go index 39349001e8..0ef48a654a 100644 --- a/sdk/go/azure/hdinsight/getCluster.go +++ b/sdk/go/azure/hdinsight/getCluster.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing HDInsight Cluster. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hdinsight" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := hdinsight.GetCluster(ctx, &hdinsight.GetClusterArgs{ +// Name: "example", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("httpsEndpoint", example.HttpsEndpoint) +// return nil +// }) +// } +// +// ``` func GetCluster(ctx *pulumi.Context, args *GetClusterArgs, opts ...pulumi.InvokeOption) (*GetClusterResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetClusterResult diff --git a/sdk/go/azure/hdinsight/hadoopCluster.go b/sdk/go/azure/hdinsight/hadoopCluster.go index 3a7d0eb2bf..ccbc5ff716 100644 --- a/sdk/go/azure/hdinsight/hadoopCluster.go +++ b/sdk/go/azure/hdinsight/hadoopCluster.go @@ -15,6 +15,91 @@ import ( // Manages a HDInsight Hadoop Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hdinsight" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = hdinsight.NewHadoopCluster(ctx, "exampleHadoopCluster", &hdinsight.HadoopClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterVersion: pulumi.String("3.6"), +// Tier: pulumi.String("Standard"), +// ComponentVersion: &hdinsight.HadoopClusterComponentVersionArgs{ +// Hadoop: pulumi.String("2.7"), +// }, +// Gateway: &hdinsight.HadoopClusterGatewayArgs{ +// Username: pulumi.String("acctestusrgw"), +// Password: pulumi.String("PAssword123!"), +// }, +// StorageAccounts: hdinsight.HadoopClusterStorageAccountArray{ +// &hdinsight.HadoopClusterStorageAccountArgs{ +// StorageContainerId: exampleContainer.ID(), +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// IsDefault: pulumi.Bool(true), +// }, +// }, +// Roles: &hdinsight.HadoopClusterRolesArgs{ +// HeadNode: &hdinsight.HadoopClusterRolesHeadNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// WorkerNode: &hdinsight.HadoopClusterRolesWorkerNodeArgs{ +// VmSize: pulumi.String("Standard_D4_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// TargetInstanceCount: pulumi.Int(3), +// }, +// ZookeeperNode: &hdinsight.HadoopClusterRolesZookeeperNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // HDInsight Hadoop Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hdinsight/hbaseCluster.go b/sdk/go/azure/hdinsight/hbaseCluster.go index f3f30857cf..27e1790b94 100644 --- a/sdk/go/azure/hdinsight/hbaseCluster.go +++ b/sdk/go/azure/hdinsight/hbaseCluster.go @@ -15,6 +15,91 @@ import ( // Manages a HDInsight HBase Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hdinsight" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = hdinsight.NewHBaseCluster(ctx, "exampleHBaseCluster", &hdinsight.HBaseClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterVersion: pulumi.String("3.6"), +// Tier: pulumi.String("Standard"), +// ComponentVersion: &hdinsight.HBaseClusterComponentVersionArgs{ +// Hbase: pulumi.String("1.1"), +// }, +// Gateway: &hdinsight.HBaseClusterGatewayArgs{ +// Username: pulumi.String("acctestusrgw"), +// Password: pulumi.String("Password123!"), +// }, +// StorageAccounts: hdinsight.HBaseClusterStorageAccountArray{ +// &hdinsight.HBaseClusterStorageAccountArgs{ +// StorageContainerId: exampleContainer.ID(), +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// IsDefault: pulumi.Bool(true), +// }, +// }, +// Roles: &hdinsight.HBaseClusterRolesArgs{ +// HeadNode: &hdinsight.HBaseClusterRolesHeadNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// WorkerNode: &hdinsight.HBaseClusterRolesWorkerNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// TargetInstanceCount: pulumi.Int(3), +// }, +// ZookeeperNode: &hdinsight.HBaseClusterRolesZookeeperNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // HDInsight HBase Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hdinsight/interactiveQueryCluster.go b/sdk/go/azure/hdinsight/interactiveQueryCluster.go index a7270057ec..96958c9897 100644 --- a/sdk/go/azure/hdinsight/interactiveQueryCluster.go +++ b/sdk/go/azure/hdinsight/interactiveQueryCluster.go @@ -15,6 +15,91 @@ import ( // Manages a HDInsight Interactive Query Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hdinsight" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = hdinsight.NewInteractiveQueryCluster(ctx, "exampleInteractiveQueryCluster", &hdinsight.InteractiveQueryClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterVersion: pulumi.String("3.6"), +// Tier: pulumi.String("Standard"), +// ComponentVersion: &hdinsight.InteractiveQueryClusterComponentVersionArgs{ +// InteractiveHive: pulumi.String("2.1"), +// }, +// Gateway: &hdinsight.InteractiveQueryClusterGatewayArgs{ +// Username: pulumi.String("acctestusrgw"), +// Password: pulumi.String("Password!"), +// }, +// StorageAccounts: hdinsight.InteractiveQueryClusterStorageAccountArray{ +// &hdinsight.InteractiveQueryClusterStorageAccountArgs{ +// StorageContainerId: exampleContainer.ID(), +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// IsDefault: pulumi.Bool(true), +// }, +// }, +// Roles: &hdinsight.InteractiveQueryClusterRolesArgs{ +// HeadNode: &hdinsight.InteractiveQueryClusterRolesHeadNodeArgs{ +// VmSize: pulumi.String("Standard_D13_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// WorkerNode: &hdinsight.InteractiveQueryClusterRolesWorkerNodeArgs{ +// VmSize: pulumi.String("Standard_D14_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// TargetInstanceCount: pulumi.Int(3), +// }, +// ZookeeperNode: &hdinsight.InteractiveQueryClusterRolesZookeeperNodeArgs{ +// VmSize: pulumi.String("Standard_A4_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // HDInsight Interactive Query Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hdinsight/kafkaCluster.go b/sdk/go/azure/hdinsight/kafkaCluster.go index b150bd4a89..2697c79f70 100644 --- a/sdk/go/azure/hdinsight/kafkaCluster.go +++ b/sdk/go/azure/hdinsight/kafkaCluster.go @@ -15,6 +15,92 @@ import ( // Manages a HDInsight Kafka Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hdinsight" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = hdinsight.NewKafkaCluster(ctx, "exampleKafkaCluster", &hdinsight.KafkaClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterVersion: pulumi.String("4.0"), +// Tier: pulumi.String("Standard"), +// ComponentVersion: &hdinsight.KafkaClusterComponentVersionArgs{ +// Kafka: pulumi.String("2.1"), +// }, +// Gateway: &hdinsight.KafkaClusterGatewayArgs{ +// Username: pulumi.String("acctestusrgw"), +// Password: pulumi.String("Password123!"), +// }, +// StorageAccounts: hdinsight.KafkaClusterStorageAccountArray{ +// &hdinsight.KafkaClusterStorageAccountArgs{ +// StorageContainerId: exampleContainer.ID(), +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// IsDefault: pulumi.Bool(true), +// }, +// }, +// Roles: &hdinsight.KafkaClusterRolesArgs{ +// HeadNode: &hdinsight.KafkaClusterRolesHeadNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// WorkerNode: &hdinsight.KafkaClusterRolesWorkerNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// NumberOfDisksPerNode: pulumi.Int(3), +// TargetInstanceCount: pulumi.Int(3), +// }, +// ZookeeperNode: &hdinsight.KafkaClusterRolesZookeeperNodeArgs{ +// VmSize: pulumi.String("Standard_D3_V2"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // HDInsight Kafka Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hdinsight/sparkCluster.go b/sdk/go/azure/hdinsight/sparkCluster.go index 0243585291..1b5c26f0e5 100644 --- a/sdk/go/azure/hdinsight/sparkCluster.go +++ b/sdk/go/azure/hdinsight/sparkCluster.go @@ -15,6 +15,91 @@ import ( // Manages a HDInsight Spark Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hdinsight" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = hdinsight.NewSparkCluster(ctx, "exampleSparkCluster", &hdinsight.SparkClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterVersion: pulumi.String("3.6"), +// Tier: pulumi.String("Standard"), +// ComponentVersion: &hdinsight.SparkClusterComponentVersionArgs{ +// Spark: pulumi.String("2.3"), +// }, +// Gateway: &hdinsight.SparkClusterGatewayArgs{ +// Username: pulumi.String("acctestusrgw"), +// Password: pulumi.String("Password123!"), +// }, +// StorageAccounts: hdinsight.SparkClusterStorageAccountArray{ +// &hdinsight.SparkClusterStorageAccountArgs{ +// StorageContainerId: exampleContainer.ID(), +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// IsDefault: pulumi.Bool(true), +// }, +// }, +// Roles: &hdinsight.SparkClusterRolesArgs{ +// HeadNode: &hdinsight.SparkClusterRolesHeadNodeArgs{ +// VmSize: pulumi.String("Standard_A3"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// WorkerNode: &hdinsight.SparkClusterRolesWorkerNodeArgs{ +// VmSize: pulumi.String("Standard_A3"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// TargetInstanceCount: pulumi.Int(3), +// }, +// ZookeeperNode: &hdinsight.SparkClusterRolesZookeeperNodeArgs{ +// VmSize: pulumi.String("Medium"), +// Username: pulumi.String("acctestusrvm"), +// Password: pulumi.String("AccTestvdSC4daf986!"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // HDInsight Spark Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/healthcare/dicomService.go b/sdk/go/azure/healthcare/dicomService.go index 2f3fa726dd..6a0b2d4fcd 100644 --- a/sdk/go/azure/healthcare/dicomService.go +++ b/sdk/go/azure/healthcare/dicomService.go @@ -15,6 +15,46 @@ import ( // Manages a Healthcare DICOM Service // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testWorkspace, err := healthcare.NewWorkspace(ctx, "testWorkspace", &healthcare.WorkspaceArgs{ +// ResourceGroupName: pulumi.String("tfex-resource_group"), +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// _, err = healthcare.NewDicomService(ctx, "testDicomService", &healthcare.DicomServiceArgs{ +// WorkspaceId: testWorkspace.ID(), +// Location: pulumi.String("east us"), +// Identity: &healthcare.DicomServiceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("None"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Healthcare DICOM Service can be imported using the resource`id`, e.g. diff --git a/sdk/go/azure/healthcare/fhirService.go b/sdk/go/azure/healthcare/fhirService.go index 746a7177a7..c2b15e7efb 100644 --- a/sdk/go/azure/healthcare/fhirService.go +++ b/sdk/go/azure/healthcare/fhirService.go @@ -15,6 +15,83 @@ import ( // Manages a Healthcare FHIR (Fast Healthcare Interoperability Resources) Service // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleWorkspace, err := healthcare.NewWorkspace(ctx, "exampleWorkspace", &healthcare.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = healthcare.NewFhirService(ctx, "exampleFhirService", &healthcare.FhirServiceArgs{ +// Location: pulumi.String("east us"), +// ResourceGroupName: pulumi.String("tfex-resource_group"), +// WorkspaceId: exampleWorkspace.ID(), +// Kind: pulumi.String("fhir-R4"), +// Authentication: &healthcare.FhirServiceAuthenticationArgs{ +// Authority: pulumi.String("https://login.microsoftonline.com/tenantId"), +// Audience: pulumi.String("https://tfexfhir.fhir.azurehealthcareapis.com"), +// }, +// AccessPolicyObjectIds: pulumi.StringArray{ +// *pulumi.String(current.ObjectId), +// }, +// Identity: &healthcare.FhirServiceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// ContainerRegistryLoginServerUrls: pulumi.StringArray{ +// pulumi.String("tfex-container_registry_login_server"), +// }, +// Cors: &healthcare.FhirServiceCorsArgs{ +// AllowedOrigins: pulumi.StringArray{ +// pulumi.String("https://tfex.com:123"), +// pulumi.String("https://tfex1.com:3389"), +// }, +// AllowedHeaders: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// AllowedMethods: pulumi.StringArray{ +// pulumi.String("GET"), +// pulumi.String("DELETE"), +// pulumi.String("PUT"), +// }, +// MaxAgeInSeconds: pulumi.Int(3600), +// CredentialsAllowed: pulumi.Bool(true), +// }, +// ConfigurationExportStorageAccountName: pulumi.String("storage_account_name"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Healthcare FHIR Service can be imported using the resource`id`, e.g. diff --git a/sdk/go/azure/healthcare/getDicomService.go b/sdk/go/azure/healthcare/getDicomService.go index b54ed79f71..cae6584b3b 100644 --- a/sdk/go/azure/healthcare/getDicomService.go +++ b/sdk/go/azure/healthcare/getDicomService.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Healthcare DICOM Service +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := healthcare.LookupDicomService(ctx, &healthcare.LookupDicomServiceArgs{ +// Name: "example-healthcare_dicom_service", +// WorkspaceId: data.Azurerm_healthcare_workspace.Example.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("azurermHealthcareDicomService", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDicomService(ctx *pulumi.Context, args *LookupDicomServiceArgs, opts ...pulumi.InvokeOption) (*LookupDicomServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDicomServiceResult diff --git a/sdk/go/azure/healthcare/getMedtechService.go b/sdk/go/azure/healthcare/getMedtechService.go index d454cf02fb..cc5d998989 100644 --- a/sdk/go/azure/healthcare/getMedtechService.go +++ b/sdk/go/azure/healthcare/getMedtechService.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Healthcare Med Tech Service +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := healthcare.LookupMedtechService(ctx, &healthcare.LookupMedtechServiceArgs{ +// Name: "tfexmedtech", +// WorkspaceId: "tfexwks", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("azurermHealthcareMedtechServiceId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupMedtechService(ctx *pulumi.Context, args *LookupMedtechServiceArgs, opts ...pulumi.InvokeOption) (*LookupMedtechServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupMedtechServiceResult diff --git a/sdk/go/azure/healthcare/getService.go b/sdk/go/azure/healthcare/getService.go index 589d1eed96..a0f8c934d0 100644 --- a/sdk/go/azure/healthcare/getService.go +++ b/sdk/go/azure/healthcare/getService.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Healthcare Service +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := healthcare.LookupService(ctx, &healthcare.LookupServiceArgs{ +// Name: "example-healthcare_service", +// ResourceGroupName: "example-resources", +// Location: "westus2", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("healthcareServiceId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/healthcare/getWorkspace.go b/sdk/go/azure/healthcare/getWorkspace.go index 3a58835455..f48cd2e197 100644 --- a/sdk/go/azure/healthcare/getWorkspace.go +++ b/sdk/go/azure/healthcare/getWorkspace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Healthcare Workspace +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := healthcare.LookupWorkspace(ctx, &healthcare.LookupWorkspaceArgs{ +// Name: "example-healthcare_service", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("healthcareWorkspaceId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupWorkspace(ctx *pulumi.Context, args *LookupWorkspaceArgs, opts ...pulumi.InvokeOption) (*LookupWorkspaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupWorkspaceResult diff --git a/sdk/go/azure/healthcare/medtechService.go b/sdk/go/azure/healthcare/medtechService.go index 1ddde31e8c..4ad856ad47 100644 --- a/sdk/go/azure/healthcare/medtechService.go +++ b/sdk/go/azure/healthcare/medtechService.go @@ -15,6 +15,81 @@ import ( // Manages a Healthcare Med Tech Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := healthcare.NewWorkspace(ctx, "exampleWorkspace", &healthcare.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "templateType": "CollectionContent", +// "template": []map[string]interface{}{ +// map[string]interface{}{ +// "templateType": "JsonPathContent", +// "template": map[string]interface{}{ +// "typeName": "heartrate", +// "typeMatchExpression": "$..[?(@heartrate)]", +// "deviceIdExpression": "$.deviceid", +// "timestampExpression": "$.measurementdatetime", +// "values": []map[string]interface{}{ +// map[string]interface{}{ +// "required": "true", +// "valueExpression": "$.heartrate", +// "valueName": "hr", +// }, +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = healthcare.NewMedtechService(ctx, "exampleMedtechService", &healthcare.MedtechServiceArgs{ +// WorkspaceId: exampleWorkspace.ID(), +// Location: pulumi.String("east us"), +// Identity: &healthcare.MedtechServiceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// EventhubNamespaceName: pulumi.String("example-eventhub-namespace"), +// EventhubName: pulumi.String("example-eventhub"), +// EventhubConsumerGroupName: pulumi.String("$Default"), +// DeviceMappingJson: pulumi.String(json0), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Healthcare Med Tech Service can be imported using the resource`id`, e.g. diff --git a/sdk/go/azure/healthcare/medtechServiceFhirDestination.go b/sdk/go/azure/healthcare/medtechServiceFhirDestination.go index 2e6a1a01df..c401b35195 100644 --- a/sdk/go/azure/healthcare/medtechServiceFhirDestination.go +++ b/sdk/go/azure/healthcare/medtechServiceFhirDestination.go @@ -15,6 +15,141 @@ import ( // Manages a Healthcare Med Tech Service Fhir Destination. // +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleWorkspace, err := healthcare.NewWorkspace(ctx, "exampleWorkspace", &healthcare.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(1), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleFhirService, err := healthcare.NewFhirService(ctx, "exampleFhirService", &healthcare.FhirServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceId: exampleWorkspace.ID(), +// Kind: pulumi.String("fhir-R4"), +// Authentication: &healthcare.FhirServiceAuthenticationArgs{ +// Authority: pulumi.String("https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), +// Audience: pulumi.String("https://examplefhir.fhir.azurehealthcareapis.com"), +// }, +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "templateType": "CollectionContent", +// "template": []interface{}{}, +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// exampleMedtechService, err := healthcare.NewMedtechService(ctx, "exampleMedtechService", &healthcare.MedtechServiceArgs{ +// WorkspaceId: exampleWorkspace.ID(), +// Location: exampleResourceGroup.Location, +// EventhubNamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// EventhubConsumerGroupName: exampleConsumerGroup.Name, +// DeviceMappingJson: pulumi.String(json0), +// }) +// if err != nil { +// return err +// } +// tmpJSON1, err := json.Marshal(map[string]interface{}{ +// "templateType": "CollectionFhirTemplate", +// "template": []map[string]interface{}{ +// map[string]interface{}{ +// "templateType": "CodeValueFhir", +// "template": map[string]interface{}{ +// "codes": []map[string]interface{}{ +// map[string]interface{}{ +// "code": "8867-4", +// "system": "http://loinc.org", +// "display": "Heart rate", +// }, +// }, +// "periodInterval": 60, +// "typeName": "heartrate", +// "value": map[string]interface{}{ +// "defaultPeriod": 5000, +// "unit": "count/min", +// "valueName": "hr", +// "valueType": "SampledData", +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// json1 := string(tmpJSON1) +// _, err = healthcare.NewMedtechServiceFhirDestination(ctx, "exampleMedtechServiceFhirDestination", &healthcare.MedtechServiceFhirDestinationArgs{ +// Location: pulumi.String("east us"), +// MedtechServiceId: exampleMedtechService.ID(), +// DestinationFhirServiceId: exampleFhirService.ID(), +// DestinationIdentityResolutionType: pulumi.String("Create"), +// DestinationFhirMappingJson: pulumi.String(json1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Healthcare Med Tech Service Fhir Destination can be imported using the resource`id`, e.g. diff --git a/sdk/go/azure/healthcare/service.go b/sdk/go/azure/healthcare/service.go index 25af62fe87..52c727d8d8 100644 --- a/sdk/go/azure/healthcare/service.go +++ b/sdk/go/azure/healthcare/service.go @@ -15,6 +15,66 @@ import ( // Manages a Healthcare Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = healthcare.NewService(ctx, "example", &healthcare.ServiceArgs{ +// ResourceGroupName: pulumi.String("sample-resource-group"), +// Location: pulumi.String("westus2"), +// Kind: pulumi.String("fhir-R4"), +// CosmosdbThroughput: pulumi.Int(2000), +// AccessPolicyObjectIds: *pulumi.String(current.ObjectId), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("testenv"), +// "purpose": pulumi.String("AcceptanceTests"), +// }, +// AuthenticationConfiguration: &healthcare.ServiceAuthenticationConfigurationArgs{ +// Authority: pulumi.String("https://login.microsoftonline.com/$%7Bdata.azurerm_client_config.current.tenant_id%7D"), +// Audience: pulumi.String("https://azurehealthcareapis.com/"), +// SmartProxyEnabled: pulumi.Bool(true), +// }, +// CorsConfiguration: &healthcare.ServiceCorsConfigurationArgs{ +// AllowedOrigins: pulumi.StringArray{ +// pulumi.String("http://www.example.com"), +// pulumi.String("http://www.example2.com"), +// }, +// AllowedHeaders: pulumi.StringArray{ +// pulumi.String("x-tempo-*"), +// pulumi.String("x-tempo2-*"), +// }, +// AllowedMethods: pulumi.StringArray{ +// pulumi.String("GET"), +// pulumi.String("PUT"), +// }, +// MaxAgeInSeconds: pulumi.Int(500), +// AllowCredentials: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Healthcare Service can be imported using the resource`id`, e.g. diff --git a/sdk/go/azure/healthcare/workspace.go b/sdk/go/azure/healthcare/workspace.go index 8b5d75cebb..323a773712 100644 --- a/sdk/go/azure/healthcare/workspace.go +++ b/sdk/go/azure/healthcare/workspace.go @@ -15,6 +15,33 @@ import ( // Manages a Healthcare workspace // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/healthcare" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := healthcare.NewWorkspace(ctx, "test", &healthcare.WorkspaceArgs{ +// Location: pulumi.String("east us"), +// ResourceGroupName: pulumi.String("tfex-resource_group"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Healthcare Workspaces can be imported using the resource`id`, e.g. diff --git a/sdk/go/azure/hpc/cache.go b/sdk/go/azure/hpc/cache.go index 401aafa0ab..b95d82661b 100644 --- a/sdk/go/azure/hpc/cache.go +++ b/sdk/go/azure/hpc/cache.go @@ -17,6 +17,64 @@ import ( // // > **Note:** By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hpc" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = hpc.NewCache(ctx, "exampleCache", &hpc.CacheArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CacheSizeInGb: pulumi.Int(3072), +// SubnetId: exampleSubnet.ID(), +// SkuName: pulumi.String("Standard_2G"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // HPC Caches can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hpc/cacheAccessPolicy.go b/sdk/go/azure/hpc/cacheAccessPolicy.go index d34eaa7474..d711a7d0d6 100644 --- a/sdk/go/azure/hpc/cacheAccessPolicy.go +++ b/sdk/go/azure/hpc/cacheAccessPolicy.go @@ -15,6 +15,76 @@ import ( // Manages a HPC Cache Access Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hpc" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleCache, err := hpc.NewCache(ctx, "exampleCache", &hpc.CacheArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CacheSizeInGb: pulumi.Int(3072), +// SubnetId: exampleSubnet.ID(), +// SkuName: pulumi.String("Standard_2G"), +// }) +// if err != nil { +// return err +// } +// _, err = hpc.NewCacheAccessPolicy(ctx, "exampleCacheAccessPolicy", &hpc.CacheAccessPolicyArgs{ +// HpcCacheId: exampleCache.ID(), +// AccessRules: hpc.CacheAccessPolicyAccessRuleArray{ +// &hpc.CacheAccessPolicyAccessRuleArgs{ +// Scope: pulumi.String("default"), +// Access: pulumi.String("rw"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // HPC Cache Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hpc/cacheBlobTarget.go b/sdk/go/azure/hpc/cacheBlobTarget.go index cb608a44e7..1077231800 100644 --- a/sdk/go/azure/hpc/cacheBlobTarget.go +++ b/sdk/go/azure/hpc/cacheBlobTarget.go @@ -17,6 +17,113 @@ import ( // // > **NOTE:**: By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hpc" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleCache, err := hpc.NewCache(ctx, "exampleCache", &hpc.CacheArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CacheSizeInGb: pulumi.Int(3072), +// SubnetId: exampleSubnet.ID(), +// SkuName: pulumi.String("Standard_2G"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("HPC Cache Resource Provider"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleStorageAccountContrib", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Storage Account Contributor"), +// PrincipalId: *pulumi.String(exampleServicePrincipal.ObjectId), +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleStorageBlobDataContrib", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"), +// PrincipalId: *pulumi.String(exampleServicePrincipal.ObjectId), +// }) +// if err != nil { +// return err +// } +// _, err = hpc.NewCacheBlobTarget(ctx, "exampleCacheBlobTarget", &hpc.CacheBlobTargetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// CacheName: exampleCache.Name, +// StorageContainerId: exampleContainer.ResourceManagerId, +// NamespacePath: pulumi.String("/blob_storage"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Blob Targets within an HPC Cache can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hsm/module.go b/sdk/go/azure/hsm/module.go index 9d10146958..3267502878 100644 --- a/sdk/go/azure/hsm/module.go +++ b/sdk/go/azure/hsm/module.go @@ -19,6 +19,137 @@ import ( // // > **Note:** If the quota is not enough in some region, please submit the quota request to service team. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hsm" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.2.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.2.0.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// example2, err := network.NewSubnet(ctx, "example2", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.2.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("first"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.HardwareSecurityModules/dedicatedHSMs"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/networkinterfaces/*"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// example3, err := network.NewSubnet(ctx, "example3", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.2.255.0/26"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetworkGateway, err := network.NewVirtualNetworkGateway(ctx, "exampleVirtualNetworkGateway", &network.VirtualNetworkGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Type: pulumi.String("ExpressRoute"), +// VpnType: pulumi.String("PolicyBased"), +// Sku: pulumi.String("Standard"), +// IpConfigurations: network.VirtualNetworkGatewayIpConfigurationArray{ +// &network.VirtualNetworkGatewayIpConfigurationArgs{ +// PublicIpAddressId: examplePublicIp.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// SubnetId: example3.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = hsm.NewModule(ctx, "exampleModule", &hsm.ModuleArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("payShield10K_LMK1_CPS60"), +// ManagementNetworkProfile: &hsm.ModuleManagementNetworkProfileArgs{ +// NetworkInterfacePrivateIpAddresses: pulumi.StringArray{ +// pulumi.String("10.2.1.7"), +// }, +// SubnetId: example2.ID(), +// }, +// NetworkProfile: &hsm.ModuleNetworkProfileArgs{ +// NetworkInterfacePrivateIpAddresses: pulumi.StringArray{ +// pulumi.String("10.2.1.8"), +// }, +// SubnetId: example2.ID(), +// }, +// StampId: pulumi.String("stamp2"), +// Tags: pulumi.StringMap{ +// "env": pulumi.String("Test"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleVirtualNetworkGateway, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dedicated Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/hybrid/getComputeMachine.go b/sdk/go/azure/hybrid/getComputeMachine.go index 1e8478b4a0..2c155d4939 100644 --- a/sdk/go/azure/hybrid/getComputeMachine.go +++ b/sdk/go/azure/hybrid/getComputeMachine.go @@ -17,6 +17,34 @@ import ( // ## Disclaimers // // > **Note:** The Data Source `hybrid.getComputeMachine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `arcmachine.get` Data Source. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hybrid" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := hybrid.GetComputeMachine(ctx, &hybrid.GetComputeMachineArgs{ +// Name: "existing-hcmachine", +// ResourceGroupName: "existing-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetComputeMachine(ctx *pulumi.Context, args *GetComputeMachineArgs, opts ...pulumi.InvokeOption) (*GetComputeMachineResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetComputeMachineResult diff --git a/sdk/go/azure/iot/certificate.go b/sdk/go/azure/iot/certificate.go index e61e6c25f8..2ef8e13e62 100644 --- a/sdk/go/azure/iot/certificate.go +++ b/sdk/go/azure/iot/certificate.go @@ -15,6 +15,64 @@ import ( // Manages an IotHub Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("B1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewCertificate(ctx, "exampleCertificate", &iot.CertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubName: exampleIoTHub.Name, +// IsVerified: pulumi.Bool(true), +// CertificateContent: filebase64OrPanic("example.cer"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/consumerGroup.go b/sdk/go/azure/iot/consumerGroup.go index f83ee26cd8..08cc0a219e 100644 --- a/sdk/go/azure/iot/consumerGroup.go +++ b/sdk/go/azure/iot/consumerGroup.go @@ -15,6 +15,55 @@ import ( // Manages a Consumer Group within an IotHub // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// Tags: pulumi.StringMap{ +// "purpose": pulumi.String("testing"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewConsumerGroup(ctx, "exampleConsumerGroup", &iot.ConsumerGroupArgs{ +// IothubName: exampleIoTHub.Name, +// EventhubEndpointName: pulumi.String("events"), +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/dpsSharedAccessPolicy.go b/sdk/go/azure/iot/dpsSharedAccessPolicy.go index 57e823f1ec..07e7321979 100644 --- a/sdk/go/azure/iot/dpsSharedAccessPolicy.go +++ b/sdk/go/azure/iot/dpsSharedAccessPolicy.go @@ -15,6 +15,53 @@ import ( // Manages an IotHub Device Provisioning Service Shared Access Policy // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIotHubDps, err := iot.NewIotHubDps(ctx, "exampleIotHubDps", &iot.IotHubDpsArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IotHubDpsSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewDpsSharedAccessPolicy(ctx, "exampleDpsSharedAccessPolicy", &iot.DpsSharedAccessPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubDpsName: exampleIotHubDps.Name, +// EnrollmentWrite: pulumi.Bool(true), +// EnrollmentRead: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub Device Provisioning Service Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/endpointCosmosdbAccount.go b/sdk/go/azure/iot/endpointCosmosdbAccount.go index fc9389f7e5..6bd895575f 100644 --- a/sdk/go/azure/iot/endpointCosmosdbAccount.go +++ b/sdk/go/azure/iot/endpointCosmosdbAccount.go @@ -17,6 +17,94 @@ import ( // // > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("B1"), +// Capacity: pulumi.Int(1), +// }, +// Tags: pulumi.StringMap{ +// "purpose": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Strong"), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/definition/id"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewEndpointCosmosdbAccount(ctx, "exampleEndpointCosmosdbAccount", &iot.EndpointCosmosdbAccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubId: exampleIoTHub.ID(), +// ContainerName: exampleSqlContainer.Name, +// DatabaseName: exampleSqlDatabase.Name, +// EndpointUri: exampleAccount.Endpoint, +// PrimaryKey: exampleAccount.PrimaryKey, +// SecondaryKey: exampleAccount.SecondaryKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub Cosmos DB Account Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/endpointEventhub.go b/sdk/go/azure/iot/endpointEventhub.go index a5b1179860..d6548cf6dc 100644 --- a/sdk/go/azure/iot/endpointEventhub.go +++ b/sdk/go/azure/iot/endpointEventhub.go @@ -17,6 +17,84 @@ import ( // // > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleAuthorizationRule, err := eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Listen: pulumi.Bool(false), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("B1"), +// Capacity: pulumi.Int(1), +// }, +// Tags: pulumi.StringMap{ +// "purpose": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewEndpointEventhub(ctx, "exampleEndpointEventhub", &iot.EndpointEventhubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubId: exampleIoTHub.ID(), +// ConnectionString: exampleAuthorizationRule.PrimaryConnectionString, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub EventHub Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/endpointServicebusQueue.go b/sdk/go/azure/iot/endpointServicebusQueue.go index 2d8219811c..6c495a248e 100644 --- a/sdk/go/azure/iot/endpointServicebusQueue.go +++ b/sdk/go/azure/iot/endpointServicebusQueue.go @@ -17,6 +17,80 @@ import ( // // > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleQueue, err := servicebus.NewQueue(ctx, "exampleQueue", &servicebus.QueueArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleQueueAuthorizationRule, err := servicebus.NewQueueAuthorizationRule(ctx, "exampleQueueAuthorizationRule", &servicebus.QueueAuthorizationRuleArgs{ +// QueueId: exampleQueue.ID(), +// Listen: pulumi.Bool(false), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("B1"), +// Capacity: pulumi.Int(1), +// }, +// Tags: pulumi.StringMap{ +// "purpose": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewEndpointServicebusQueue(ctx, "exampleEndpointServicebusQueue", &iot.EndpointServicebusQueueArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubId: exampleIoTHub.ID(), +// ConnectionString: exampleQueueAuthorizationRule.PrimaryConnectionString, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub ServiceBus Queue Endpoint can be imported using the `resource id`, e.g. g diff --git a/sdk/go/azure/iot/endpointServicebusTopic.go b/sdk/go/azure/iot/endpointServicebusTopic.go index 197f78dba6..f8527f4628 100644 --- a/sdk/go/azure/iot/endpointServicebusTopic.go +++ b/sdk/go/azure/iot/endpointServicebusTopic.go @@ -17,6 +17,79 @@ import ( // // > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// }) +// if err != nil { +// return err +// } +// exampleTopicAuthorizationRule, err := servicebus.NewTopicAuthorizationRule(ctx, "exampleTopicAuthorizationRule", &servicebus.TopicAuthorizationRuleArgs{ +// TopicId: exampleTopic.ID(), +// Listen: pulumi.Bool(false), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("B1"), +// Capacity: pulumi.Int(1), +// }, +// Tags: pulumi.StringMap{ +// "purpose": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewEndpointServicebusTopic(ctx, "exampleEndpointServicebusTopic", &iot.EndpointServicebusTopicArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubId: exampleIoTHub.ID(), +// ConnectionString: exampleTopicAuthorizationRule.PrimaryConnectionString, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub ServiceBus Topic Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/endpointStorageContainer.go b/sdk/go/azure/iot/endpointStorageContainer.go index bb594e7f94..51fa4ad3d9 100644 --- a/sdk/go/azure/iot/endpointStorageContainer.go +++ b/sdk/go/azure/iot/endpointStorageContainer.go @@ -17,6 +17,74 @@ import ( // // > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewEndpointStorageContainer(ctx, "exampleEndpointStorageContainer", &iot.EndpointStorageContainerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubId: exampleIoTHub.ID(), +// ContainerName: pulumi.String("acctestcont"), +// ConnectionString: exampleAccount.PrimaryBlobConnectionString, +// FileNameFormat: pulumi.String("{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"), +// BatchFrequencyInSeconds: pulumi.Int(60), +// MaxChunkSizeInBytes: pulumi.Int(10485760), +// Encoding: pulumi.String("JSON"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub Storage Container Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/fileUpload.go b/sdk/go/azure/iot/fileUpload.go index 0c3e35caaa..d44ff5fc57 100644 --- a/sdk/go/azure/iot/fileUpload.go +++ b/sdk/go/azure/iot/fileUpload.go @@ -17,6 +17,69 @@ import ( // // > **NOTE:** File upload can be defined either directly on the `iot.IoTHub` resource, or using the `iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewFileUpload(ctx, "exampleFileUpload", &iot.FileUploadArgs{ +// IothubId: exampleIoTHub.ID(), +// ConnectionString: exampleAccount.PrimaryBlobConnectionString, +// ContainerName: exampleContainer.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoT Hub File Uploads can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/getDps.go b/sdk/go/azure/iot/getDps.go index 9cf902ff68..bafc25dde9 100644 --- a/sdk/go/azure/iot/getDps.go +++ b/sdk/go/azure/iot/getDps.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing IotHub Device Provisioning Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := iot.GetDps(ctx, &iot.GetDpsArgs{ +// Name: "iot_hub_dps_test", +// ResourceGroupName: "iothub_dps_rg", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetDps(ctx *pulumi.Context, args *GetDpsArgs, opts ...pulumi.InvokeOption) (*GetDpsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetDpsResult diff --git a/sdk/go/azure/iot/getDpsSharedAccessPolicy.go b/sdk/go/azure/iot/getDpsSharedAccessPolicy.go index 4a7d104abd..4873c114da 100644 --- a/sdk/go/azure/iot/getDpsSharedAccessPolicy.go +++ b/sdk/go/azure/iot/getDpsSharedAccessPolicy.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := iot.LookupDpsSharedAccessPolicy(ctx, &iot.LookupDpsSharedAccessPolicyArgs{ +// Name: "example", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// IothubDpsName: azurerm_iothub_dps.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupDpsSharedAccessPolicy(ctx *pulumi.Context, args *LookupDpsSharedAccessPolicyArgs, opts ...pulumi.InvokeOption) (*LookupDpsSharedAccessPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDpsSharedAccessPolicyResult diff --git a/sdk/go/azure/iot/getIotHub.go b/sdk/go/azure/iot/getIotHub.go index 59307451d4..110bcef368 100644 --- a/sdk/go/azure/iot/getIotHub.go +++ b/sdk/go/azure/iot/getIotHub.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing IoTHub. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := iot.GetIotHub(ctx, &iot.GetIotHubArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetIotHub(ctx *pulumi.Context, args *GetIotHubArgs, opts ...pulumi.InvokeOption) (*GetIotHubResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetIotHubResult diff --git a/sdk/go/azure/iot/getSharedAccessPolicy.go b/sdk/go/azure/iot/getSharedAccessPolicy.go index 95c68eaa0f..d589279d03 100644 --- a/sdk/go/azure/iot/getSharedAccessPolicy.go +++ b/sdk/go/azure/iot/getSharedAccessPolicy.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing IotHub Shared Access Policy +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := iot.LookupSharedAccessPolicy(ctx, &iot.LookupSharedAccessPolicyArgs{ +// Name: "example", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// IothubName: azurerm_iothub.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupSharedAccessPolicy(ctx *pulumi.Context, args *LookupSharedAccessPolicyArgs, opts ...pulumi.InvokeOption) (*LookupSharedAccessPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSharedAccessPolicyResult diff --git a/sdk/go/azure/iot/ioTHub.go b/sdk/go/azure/iot/ioTHub.go index 6640c25b8c..1b37a0068f 100644 --- a/sdk/go/azure/iot/ioTHub.go +++ b/sdk/go/azure/iot/ioTHub.go @@ -25,6 +25,150 @@ import ( // // > **NOTE:** File upload can be defined either directly on the `iot.IoTHub` resource, or using the `iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// NamespaceName: exampleEventHubNamespace.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleAuthorizationRule, err := eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// Send: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LocalAuthenticationEnabled: pulumi.Bool(false), +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// Endpoints: iot.IoTHubEndpointArray{ +// &iot.IoTHubEndpointArgs{ +// Type: pulumi.String("AzureIotHub.StorageContainer"), +// ConnectionString: exampleAccount.PrimaryBlobConnectionString, +// Name: pulumi.String("export"), +// BatchFrequencyInSeconds: pulumi.Int(60), +// MaxChunkSizeInBytes: pulumi.Int(10485760), +// ContainerName: exampleContainer.Name, +// Encoding: pulumi.String("Avro"), +// FileNameFormat: pulumi.String("{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}"), +// }, +// &iot.IoTHubEndpointArgs{ +// Type: pulumi.String("AzureIotHub.EventHub"), +// ConnectionString: exampleAuthorizationRule.PrimaryConnectionString, +// Name: pulumi.String("export2"), +// }, +// }, +// Routes: iot.IoTHubRouteArray{ +// &iot.IoTHubRouteArgs{ +// Name: pulumi.String("export"), +// Source: pulumi.String("DeviceMessages"), +// Condition: pulumi.String("true"), +// EndpointNames: pulumi.StringArray{ +// pulumi.String("export"), +// }, +// Enabled: pulumi.Bool(true), +// }, +// &iot.IoTHubRouteArgs{ +// Name: pulumi.String("export2"), +// Source: pulumi.String("DeviceMessages"), +// Condition: pulumi.String("true"), +// EndpointNames: pulumi.StringArray{ +// pulumi.String("export2"), +// }, +// Enabled: pulumi.Bool(true), +// }, +// }, +// Enrichments: iot.IoTHubEnrichmentArray{ +// &iot.IoTHubEnrichmentArgs{ +// Key: pulumi.String("tenant"), +// Value: pulumi.String("$twin.tags.Tenant"), +// EndpointNames: pulumi.StringArray{ +// pulumi.String("export"), +// pulumi.String("export2"), +// }, +// }, +// }, +// CloudToDevice: &iot.IoTHubCloudToDeviceArgs{ +// MaxDeliveryCount: pulumi.Int(30), +// DefaultTtl: pulumi.String("PT1H"), +// Feedbacks: iot.IoTHubCloudToDeviceFeedbackArray{ +// &iot.IoTHubCloudToDeviceFeedbackArgs{ +// TimeToLive: pulumi.String("PT1H10M"), +// MaxDeliveryCount: pulumi.Int(15), +// LockDuration: pulumi.String("PT30S"), +// }, +// }, +// }, +// Tags: pulumi.StringMap{ +// "purpose": pulumi.String("testing"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHubs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/iotHubCertificate.go b/sdk/go/azure/iot/iotHubCertificate.go index 09fca8ae53..c83adb1d98 100644 --- a/sdk/go/azure/iot/iotHubCertificate.go +++ b/sdk/go/azure/iot/iotHubCertificate.go @@ -15,6 +15,63 @@ import ( // Manages an IotHub Device Provisioning Service Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIotHubDps, err := iot.NewIotHubDps(ctx, "exampleIotHubDps", &iot.IotHubDpsArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IotHubDpsSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewIotHubCertificate(ctx, "exampleIotHubCertificate", &iot.IotHubCertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IotDpsName: exampleIotHubDps.Name, +// CertificateContent: filebase64OrPanic("example.cer"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub Device Provisioning Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/iotHubDeviceUpdateAccount.go b/sdk/go/azure/iot/iotHubDeviceUpdateAccount.go index ab216897f1..4a36b3a306 100644 --- a/sdk/go/azure/iot/iotHubDeviceUpdateAccount.go +++ b/sdk/go/azure/iot/iotHubDeviceUpdateAccount.go @@ -15,6 +15,46 @@ import ( // Manages an IoT Hub Device Update Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewIotHubDeviceUpdateAccount(ctx, "exampleIotHubDeviceUpdateAccount", &iot.IotHubDeviceUpdateAccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Identity: &iot.IotHubDeviceUpdateAccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoT Hub Device Update Account can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/iotHubDeviceUpdateInstance.go b/sdk/go/azure/iot/iotHubDeviceUpdateInstance.go index 8913f53e4c..a56b6ddbca 100644 --- a/sdk/go/azure/iot/iotHubDeviceUpdateInstance.go +++ b/sdk/go/azure/iot/iotHubDeviceUpdateInstance.go @@ -15,6 +15,76 @@ import ( // Manages an IoT Hub Device Update Instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleIotHubDeviceUpdateAccount, err := iot.NewIotHubDeviceUpdateAccount(ctx, "exampleIotHubDeviceUpdateAccount", &iot.IotHubDeviceUpdateAccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewIotHubDeviceUpdateInstance(ctx, "exampleIotHubDeviceUpdateInstance", &iot.IotHubDeviceUpdateInstanceArgs{ +// DeviceUpdateAccountId: exampleIotHubDeviceUpdateAccount.ID(), +// IothubId: exampleIoTHub.ID(), +// DiagnosticEnabled: pulumi.Bool(true), +// DiagnosticStorageAccount: &iot.IotHubDeviceUpdateInstanceDiagnosticStorageAccountArgs{ +// ConnectionString: exampleAccount.PrimaryConnectionString, +// Id: exampleAccount.ID(), +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoT Hub Device Update Instance can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/iotHubDps.go b/sdk/go/azure/iot/iotHubDps.go index 32038453ed..b7239083aa 100644 --- a/sdk/go/azure/iot/iotHubDps.go +++ b/sdk/go/azure/iot/iotHubDps.go @@ -15,6 +15,45 @@ import ( // Manages an IotHub Device Provisioning Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewIotHubDps(ctx, "exampleIotHubDps", &iot.IotHubDpsArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllocationPolicy: pulumi.String("Hashed"), +// Sku: &iot.IotHubDpsSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoT Device Provisioning Service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/securityDeviceGroup.go b/sdk/go/azure/iot/securityDeviceGroup.go index b0c8fb60a6..493363b787 100644 --- a/sdk/go/azure/iot/securityDeviceGroup.go +++ b/sdk/go/azure/iot/securityDeviceGroup.go @@ -15,6 +15,76 @@ import ( // Manages a Iot Security Device Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSecuritySolution, err := iot.NewSecuritySolution(ctx, "exampleSecuritySolution", &iot.SecuritySolutionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DisplayName: pulumi.String("Iot Security Solution"), +// IothubIds: pulumi.StringArray{ +// exampleIoTHub.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewSecurityDeviceGroup(ctx, "exampleSecurityDeviceGroup", &iot.SecurityDeviceGroupArgs{ +// IothubId: exampleIoTHub.ID(), +// AllowRule: &iot.SecurityDeviceGroupAllowRuleArgs{ +// ConnectionToIpsNotAlloweds: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// }, +// RangeRules: iot.SecurityDeviceGroupRangeRuleArray{ +// &iot.SecurityDeviceGroupRangeRuleArgs{ +// Type: pulumi.String("ActiveConnectionsNotInAllowedRange"), +// Min: pulumi.Int(0), +// Max: pulumi.Int(30), +// Duration: pulumi.String("PT5M"), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleSecuritySolution, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Iot Security Device Group can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/securitySolution.go b/sdk/go/azure/iot/securitySolution.go index d828d1cd92..79a46a0310 100644 --- a/sdk/go/azure/iot/securitySolution.go +++ b/sdk/go/azure/iot/securitySolution.go @@ -15,6 +15,55 @@ import ( // Manages an iot security solution. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewSecuritySolution(ctx, "exampleSecuritySolution", &iot.SecuritySolutionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DisplayName: pulumi.String("Iot Security Solution"), +// IothubIds: pulumi.StringArray{ +// exampleIoTHub.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Iot Security Solution can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/sharedAccessPolicy.go b/sdk/go/azure/iot/sharedAccessPolicy.go index d3c1f11796..a7c8b82629 100644 --- a/sdk/go/azure/iot/sharedAccessPolicy.go +++ b/sdk/go/azure/iot/sharedAccessPolicy.go @@ -15,6 +15,53 @@ import ( // Manages an IotHub Shared Access Policy // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewSharedAccessPolicy(ctx, "exampleSharedAccessPolicy", &iot.SharedAccessPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubName: exampleIoTHub.Name, +// RegistryRead: pulumi.Bool(true), +// RegistryWrite: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoTHub Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/timeSeriesInsightsAccessPolicy.go b/sdk/go/azure/iot/timeSeriesInsightsAccessPolicy.go index b4ad409443..7beb029893 100644 --- a/sdk/go/azure/iot/timeSeriesInsightsAccessPolicy.go +++ b/sdk/go/azure/iot/timeSeriesInsightsAccessPolicy.go @@ -15,6 +15,52 @@ import ( // Manages an Azure IoT Time Series Insights Access Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleTimeSeriesInsightsStandardEnvironment, err := iot.NewTimeSeriesInsightsStandardEnvironment(ctx, "exampleTimeSeriesInsightsStandardEnvironment", &iot.TimeSeriesInsightsStandardEnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("S1_1"), +// DataRetentionTime: pulumi.String("P30D"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewTimeSeriesInsightsAccessPolicy(ctx, "exampleTimeSeriesInsightsAccessPolicy", &iot.TimeSeriesInsightsAccessPolicyArgs{ +// TimeSeriesInsightsEnvironmentId: exampleTimeSeriesInsightsStandardEnvironment.Name, +// PrincipalObjectId: pulumi.String("aGUID"), +// Roles: pulumi.StringArray{ +// pulumi.String("Reader"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure IoT Time Series Insights Access Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/timeSeriesInsightsEventSourceEventhub.go b/sdk/go/azure/iot/timeSeriesInsightsEventSourceEventhub.go index a46688c69e..de55cd670a 100644 --- a/sdk/go/azure/iot/timeSeriesInsightsEventSourceEventhub.go +++ b/sdk/go/azure/iot/timeSeriesInsightsEventSourceEventhub.go @@ -15,6 +15,108 @@ import ( // Manages an Azure IoT Time Series Insights EventHub Event Source. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(7), +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleAuthorizationRule, err := eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(false), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleTimeSeriesInsightsGen2Environment, err := iot.NewTimeSeriesInsightsGen2Environment(ctx, "exampleTimeSeriesInsightsGen2Environment", &iot.TimeSeriesInsightsGen2EnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("L1"), +// IdProperties: pulumi.StringArray{ +// pulumi.String("id"), +// }, +// Storage: &iot.TimeSeriesInsightsGen2EnvironmentStorageArgs{ +// Name: exampleAccount.Name, +// Key: exampleAccount.PrimaryAccessKey, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewTimeSeriesInsightsEventSourceEventhub(ctx, "exampleTimeSeriesInsightsEventSourceEventhub", &iot.TimeSeriesInsightsEventSourceEventhubArgs{ +// Location: exampleResourceGroup.Location, +// EnvironmentId: exampleTimeSeriesInsightsGen2Environment.ID(), +// EventhubName: exampleEventHub.Name, +// NamespaceName: exampleEventHubNamespace.Name, +// SharedAccessKey: exampleAuthorizationRule.PrimaryKey, +// SharedAccessKeyName: exampleAuthorizationRule.Name, +// ConsumerGroupName: exampleConsumerGroup.Name, +// EventSourceResourceId: exampleEventHub.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure IoT Time Series Insights EventHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/timeSeriesInsightsEventSourceIothub.go b/sdk/go/azure/iot/timeSeriesInsightsEventSourceIothub.go index 56b92eb899..cc3f878716 100644 --- a/sdk/go/azure/iot/timeSeriesInsightsEventSourceIothub.go +++ b/sdk/go/azure/iot/timeSeriesInsightsEventSourceIothub.go @@ -15,6 +15,93 @@ import ( // Manages an Azure IoT Time Series Insights IoTHub Event Source. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("B1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := iot.NewConsumerGroup(ctx, "exampleConsumerGroup", &iot.ConsumerGroupArgs{ +// IothubName: exampleIoTHub.Name, +// EventhubEndpointName: pulumi.String("events"), +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// storage, err := storage.NewAccount(ctx, "storage", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleTimeSeriesInsightsGen2Environment, err := iot.NewTimeSeriesInsightsGen2Environment(ctx, "exampleTimeSeriesInsightsGen2Environment", &iot.TimeSeriesInsightsGen2EnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("L1"), +// IdProperties: pulumi.StringArray{ +// pulumi.String("id"), +// }, +// Storage: &iot.TimeSeriesInsightsGen2EnvironmentStorageArgs{ +// Name: storage.Name, +// Key: storage.PrimaryAccessKey, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewTimeSeriesInsightsEventSourceIothub(ctx, "exampleTimeSeriesInsightsEventSourceIothub", &iot.TimeSeriesInsightsEventSourceIothubArgs{ +// Location: exampleResourceGroup.Location, +// EnvironmentId: exampleTimeSeriesInsightsGen2Environment.ID(), +// IothubName: exampleIoTHub.Name, +// SharedAccessKey: exampleIoTHub.SharedAccessPolicies.ApplyT(func(sharedAccessPolicies []iot.IoTHubSharedAccessPolicy) (*string, error) { +// return &sharedAccessPolicies[0].PrimaryKey, nil +// }).(pulumi.StringPtrOutput), +// SharedAccessKeyName: exampleIoTHub.SharedAccessPolicies.ApplyT(func(sharedAccessPolicies []iot.IoTHubSharedAccessPolicy) (*string, error) { +// return &sharedAccessPolicies[0].KeyName, nil +// }).(pulumi.StringPtrOutput), +// ConsumerGroupName: exampleConsumerGroup.Name, +// EventSourceResourceId: exampleIoTHub.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure IoT Time Series Insights IoTHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/timeSeriesInsightsGen2Environment.go b/sdk/go/azure/iot/timeSeriesInsightsGen2Environment.go index 21f15050e0..1397f5df87 100644 --- a/sdk/go/azure/iot/timeSeriesInsightsGen2Environment.go +++ b/sdk/go/azure/iot/timeSeriesInsightsGen2Environment.go @@ -15,6 +15,59 @@ import ( // Manages an Azure IoT Time Series Insights Gen2 Environment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// storage, err := storage.NewAccount(ctx, "storage", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewTimeSeriesInsightsGen2Environment(ctx, "exampleTimeSeriesInsightsGen2Environment", &iot.TimeSeriesInsightsGen2EnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("L1"), +// WarmStoreDataRetentionTime: pulumi.String("P30D"), +// IdProperties: pulumi.StringArray{ +// pulumi.String("id"), +// }, +// Storage: &iot.TimeSeriesInsightsGen2EnvironmentStorageArgs{ +// Name: storage.Name, +// Key: storage.PrimaryAccessKey, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure IoT Time Series Insights Gen2 Environment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/timeSeriesInsightsReferenceDataSet.go b/sdk/go/azure/iot/timeSeriesInsightsReferenceDataSet.go index 3d28e2781e..bd9cdbbc8a 100644 --- a/sdk/go/azure/iot/timeSeriesInsightsReferenceDataSet.go +++ b/sdk/go/azure/iot/timeSeriesInsightsReferenceDataSet.go @@ -15,6 +15,55 @@ import ( // Manages an Azure IoT Time Series Insights Reference Data Set. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleTimeSeriesInsightsStandardEnvironment, err := iot.NewTimeSeriesInsightsStandardEnvironment(ctx, "exampleTimeSeriesInsightsStandardEnvironment", &iot.TimeSeriesInsightsStandardEnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("S1_1"), +// DataRetentionTime: pulumi.String("P30D"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewTimeSeriesInsightsReferenceDataSet(ctx, "exampleTimeSeriesInsightsReferenceDataSet", &iot.TimeSeriesInsightsReferenceDataSetArgs{ +// TimeSeriesInsightsEnvironmentId: exampleTimeSeriesInsightsStandardEnvironment.ID(), +// Location: exampleResourceGroup.Location, +// KeyProperties: iot.TimeSeriesInsightsReferenceDataSetKeyPropertyArray{ +// &iot.TimeSeriesInsightsReferenceDataSetKeyPropertyArgs{ +// Name: pulumi.String("keyProperty1"), +// Type: pulumi.String("String"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure IoT Time Series Insights Reference Data Set can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iot/timeSeriesInsightsStandardEnvironment.go b/sdk/go/azure/iot/timeSeriesInsightsStandardEnvironment.go index 10b6f3f33b..0269669ef9 100644 --- a/sdk/go/azure/iot/timeSeriesInsightsStandardEnvironment.go +++ b/sdk/go/azure/iot/timeSeriesInsightsStandardEnvironment.go @@ -15,6 +15,42 @@ import ( // Manages an Azure IoT Time Series Insights Standard Environment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = iot.NewTimeSeriesInsightsStandardEnvironment(ctx, "exampleTimeSeriesInsightsStandardEnvironment", &iot.TimeSeriesInsightsStandardEnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("S1_1"), +// DataRetentionTime: pulumi.String("P30D"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure IoT Time Series Insights Standard Environment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iotcentral/application.go b/sdk/go/azure/iotcentral/application.go index ce4e1fe7bc..67baa7e0d3 100644 --- a/sdk/go/azure/iotcentral/application.go +++ b/sdk/go/azure/iotcentral/application.go @@ -15,6 +15,47 @@ import ( // Manages an IoT Central Application // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iotcentral" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = iotcentral.NewApplication(ctx, "exampleApplication", &iotcentral.ApplicationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubDomain: pulumi.String("example-iotcentral-app-subdomain"), +// DisplayName: pulumi.String("example-iotcentral-app-display-name"), +// Sku: pulumi.String("ST1"), +// Template: pulumi.String("iotc-default@1.0.0"), +// Tags: pulumi.StringMap{ +// "Foo": pulumi.String("Bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The IoT Central Application can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/iotcentral/applicationNetworkRuleSet.go b/sdk/go/azure/iotcentral/applicationNetworkRuleSet.go index f033b4b183..705e1effe1 100644 --- a/sdk/go/azure/iotcentral/applicationNetworkRuleSet.go +++ b/sdk/go/azure/iotcentral/applicationNetworkRuleSet.go @@ -15,6 +15,62 @@ import ( // Manages an IoT Central Application Network Rule Set. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iotcentral" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleApplication, err := iotcentral.NewApplication(ctx, "exampleApplication", &iotcentral.ApplicationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubDomain: pulumi.String("example-iotcentral-app-subdomain"), +// DisplayName: pulumi.String("example-iotcentral-app-display-name"), +// Sku: pulumi.String("ST1"), +// Tags: pulumi.StringMap{ +// "Foo": pulumi.String("Bar"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = iotcentral.NewApplicationNetworkRuleSet(ctx, "exampleApplicationNetworkRuleSet", &iotcentral.ApplicationNetworkRuleSetArgs{ +// IotcentralApplicationId: exampleApplication.ID(), +// IpRules: iotcentral.ApplicationNetworkRuleSetIpRuleArray{ +// &iotcentral.ApplicationNetworkRuleSetIpRuleArgs{ +// Name: pulumi.String("rule1"), +// IpMask: pulumi.String("10.0.1.0/24"), +// }, +// &iotcentral.ApplicationNetworkRuleSetIpRuleArgs{ +// Name: pulumi.String("rule2"), +// IpMask: pulumi.String("10.1.1.0/24"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IoT Central Application Network Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/keyvault/accessPolicy.go b/sdk/go/azure/keyvault/accessPolicy.go index 84dcda8777..c0f91b9c3a 100644 --- a/sdk/go/azure/keyvault/accessPolicy.go +++ b/sdk/go/azure/keyvault/accessPolicy.go @@ -19,6 +19,81 @@ import ( // // > **NOTE:** Azure permits a maximum of 1024 Access Policies per Key Vault - [more information can be found in this document](https://docs.microsoft.com/azure/key-vault/key-vault-secure-your-key-vault#data-plane-access-control). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "exampleAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("example-app"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-principal", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(exampleServicePrincipal.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Key Vault Access Policies can be imported using the Resource ID of the Key Vault, plus some additional metadata. If both an `object_id` and `application_id` are specified, then the Access Policy can be imported using the following code diff --git a/sdk/go/azure/keyvault/certifiate.go b/sdk/go/azure/keyvault/certifiate.go index cd7505a735..e2a11e6a10 100644 --- a/sdk/go/azure/keyvault/certifiate.go +++ b/sdk/go/azure/keyvault/certifiate.go @@ -21,6 +21,256 @@ import ( // ======= // > > > > > > > 8d78c87098 (Update-documentation) // ## Example Usage +// ### Importing A PFX) +// +// > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("DeleteIssuers"), +// pulumi.String("Get"), +// pulumi.String("GetIssuers"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("ListIssuers"), +// pulumi.String("ManageContacts"), +// pulumi.String("ManageIssuers"), +// pulumi.String("SetIssuers"), +// pulumi.String("Update"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Create"), +// pulumi.String("Decrypt"), +// pulumi.String("Delete"), +// pulumi.String("Encrypt"), +// pulumi.String("Get"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Sign"), +// pulumi.String("UnwrapKey"), +// pulumi.String("Update"), +// pulumi.String("Verify"), +// pulumi.String("WrapKey"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Set"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Certificate: &keyvault.CertificateCertificateArgs{ +// Contents: filebase64OrPanic("certificate-to-import.pfx"), +// Password: pulumi.String(""), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Generating a new certificate +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("DeleteIssuers"), +// pulumi.String("Get"), +// pulumi.String("GetIssuers"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("ListIssuers"), +// pulumi.String("ManageContacts"), +// pulumi.String("ManageIssuers"), +// pulumi.String("Purge"), +// pulumi.String("SetIssuers"), +// pulumi.String("Update"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Create"), +// pulumi.String("Decrypt"), +// pulumi.String("Delete"), +// pulumi.String("Encrypt"), +// pulumi.String("Get"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Sign"), +// pulumi.String("UnwrapKey"), +// pulumi.String("Update"), +// pulumi.String("Verify"), +// pulumi.String("WrapKey"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Set"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// CertificatePolicy: &keyvault.CertificateCertificatePolicyArgs{ +// IssuerParameters: &keyvault.CertificateCertificatePolicyIssuerParametersArgs{ +// Name: pulumi.String("Self"), +// }, +// KeyProperties: &keyvault.CertificateCertificatePolicyKeyPropertiesArgs{ +// Exportable: pulumi.Bool(true), +// KeySize: pulumi.Int(2048), +// KeyType: pulumi.String("RSA"), +// ReuseKey: pulumi.Bool(true), +// }, +// LifetimeActions: keyvault.CertificateCertificatePolicyLifetimeActionArray{ +// &keyvault.CertificateCertificatePolicyLifetimeActionArgs{ +// Action: &keyvault.CertificateCertificatePolicyLifetimeActionActionArgs{ +// ActionType: pulumi.String("AutoRenew"), +// }, +// Trigger: &keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs{ +// DaysBeforeExpiry: pulumi.Int(30), +// }, +// }, +// }, +// SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{ +// ContentType: pulumi.String("application/x-pkcs12"), +// }, +// X509CertificateProperties: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs{ +// ExtendedKeyUsages: pulumi.StringArray{ +// pulumi.String("1.3.6.1.5.5.7.3.1"), +// }, +// KeyUsages: pulumi.StringArray{ +// pulumi.String("cRLSign"), +// pulumi.String("dataEncipherment"), +// pulumi.String("digitalSignature"), +// pulumi.String("keyAgreement"), +// pulumi.String("keyCertSign"), +// pulumi.String("keyEncipherment"), +// }, +// SubjectAlternativeNames: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs{ +// DnsNames: pulumi.StringArray{ +// pulumi.String("internal.contoso.com"), +// pulumi.String("domain.hello.world"), +// }, +// }, +// Subject: pulumi.String("CN=hello-world"), +// ValidityInMonths: pulumi.Int(12), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/keyvault/certificate.go b/sdk/go/azure/keyvault/certificate.go index 3287ff885f..bdd2b4d43b 100644 --- a/sdk/go/azure/keyvault/certificate.go +++ b/sdk/go/azure/keyvault/certificate.go @@ -21,6 +21,256 @@ import ( // ======= // > > > > > > > 8d78c87098 (Update-documentation) // ## Example Usage +// ### Importing A PFX) +// +// > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("DeleteIssuers"), +// pulumi.String("Get"), +// pulumi.String("GetIssuers"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("ListIssuers"), +// pulumi.String("ManageContacts"), +// pulumi.String("ManageIssuers"), +// pulumi.String("SetIssuers"), +// pulumi.String("Update"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Create"), +// pulumi.String("Decrypt"), +// pulumi.String("Delete"), +// pulumi.String("Encrypt"), +// pulumi.String("Get"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Sign"), +// pulumi.String("UnwrapKey"), +// pulumi.String("Update"), +// pulumi.String("Verify"), +// pulumi.String("WrapKey"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Set"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Certificate: &keyvault.CertificateCertificateArgs{ +// Contents: filebase64OrPanic("certificate-to-import.pfx"), +// Password: pulumi.String(""), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Generating a new certificate +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("DeleteIssuers"), +// pulumi.String("Get"), +// pulumi.String("GetIssuers"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("ListIssuers"), +// pulumi.String("ManageContacts"), +// pulumi.String("ManageIssuers"), +// pulumi.String("Purge"), +// pulumi.String("SetIssuers"), +// pulumi.String("Update"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Create"), +// pulumi.String("Decrypt"), +// pulumi.String("Delete"), +// pulumi.String("Encrypt"), +// pulumi.String("Get"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Sign"), +// pulumi.String("UnwrapKey"), +// pulumi.String("Update"), +// pulumi.String("Verify"), +// pulumi.String("WrapKey"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Backup"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Restore"), +// pulumi.String("Set"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// CertificatePolicy: &keyvault.CertificateCertificatePolicyArgs{ +// IssuerParameters: &keyvault.CertificateCertificatePolicyIssuerParametersArgs{ +// Name: pulumi.String("Self"), +// }, +// KeyProperties: &keyvault.CertificateCertificatePolicyKeyPropertiesArgs{ +// Exportable: pulumi.Bool(true), +// KeySize: pulumi.Int(2048), +// KeyType: pulumi.String("RSA"), +// ReuseKey: pulumi.Bool(true), +// }, +// LifetimeActions: keyvault.CertificateCertificatePolicyLifetimeActionArray{ +// &keyvault.CertificateCertificatePolicyLifetimeActionArgs{ +// Action: &keyvault.CertificateCertificatePolicyLifetimeActionActionArgs{ +// ActionType: pulumi.String("AutoRenew"), +// }, +// Trigger: &keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs{ +// DaysBeforeExpiry: pulumi.Int(30), +// }, +// }, +// }, +// SecretProperties: &keyvault.CertificateCertificatePolicySecretPropertiesArgs{ +// ContentType: pulumi.String("application/x-pkcs12"), +// }, +// X509CertificateProperties: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs{ +// ExtendedKeyUsages: pulumi.StringArray{ +// pulumi.String("1.3.6.1.5.5.7.3.1"), +// }, +// KeyUsages: pulumi.StringArray{ +// pulumi.String("cRLSign"), +// pulumi.String("dataEncipherment"), +// pulumi.String("digitalSignature"), +// pulumi.String("keyAgreement"), +// pulumi.String("keyCertSign"), +// pulumi.String("keyEncipherment"), +// }, +// SubjectAlternativeNames: &keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs{ +// DnsNames: pulumi.StringArray{ +// pulumi.String("internal.contoso.com"), +// pulumi.String("domain.hello.world"), +// }, +// }, +// Subject: pulumi.String("CN=hello-world"), +// ValidityInMonths: pulumi.Int(12), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/keyvault/certificateContacts.go b/sdk/go/azure/keyvault/certificateContacts.go index b7bf0eef1c..20540c6d76 100644 --- a/sdk/go/azure/keyvault/certificateContacts.go +++ b/sdk/go/azure/keyvault/certificateContacts.go @@ -19,6 +19,81 @@ import ( // // > **Note:** It's possible to define Key Vault Certificate Contacts both within the `keyvault.KeyVault` resource via the `contact` block and by using the `keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// }) +// if err != nil { +// return err +// } +// exampleAccessPolicy, err := keyvault.NewAccessPolicy(ctx, "exampleAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("ManageContacts"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewCertificateContacts(ctx, "exampleCertificateContacts", &keyvault.CertificateContactsArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Contacts: keyvault.CertificateContactsContactArray{ +// &keyvault.CertificateContactsContactArgs{ +// Email: pulumi.String("example@example.com"), +// Name: pulumi.String("example"), +// Phone: pulumi.String("01234567890"), +// }, +// &keyvault.CertificateContactsContactArgs{ +// Email: pulumi.String("example2@example.com"), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAccessPolicy, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Key Vault Certificate Contacts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/keyvault/certificateIssuer.go b/sdk/go/azure/keyvault/certificateIssuer.go index 524253fdc5..09504249ac 100644 --- a/sdk/go/azure/keyvault/certificateIssuer.go +++ b/sdk/go/azure/keyvault/certificateIssuer.go @@ -15,6 +15,56 @@ import ( // Manages a Key Vault Certificate Issuer. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("standard"), +// TenantId: *pulumi.String(current.TenantId), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewCertificateIssuer(ctx, "exampleCertificateIssuer", &keyvault.CertificateIssuerArgs{ +// OrgId: pulumi.String("ExampleOrgName"), +// KeyVaultId: exampleKeyVault.ID(), +// ProviderName: pulumi.String("DigiCert"), +// AccountId: pulumi.String("0000"), +// Password: pulumi.String("example-password"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Key Vault Certificate Issuers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/keyvault/getAccessPolicy.go b/sdk/go/azure/keyvault/getAccessPolicy.go index 7b8d333333..8d332dd26e 100644 --- a/sdk/go/azure/keyvault/getAccessPolicy.go +++ b/sdk/go/azure/keyvault/getAccessPolicy.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about the permissions from the Management Key Vault Templates. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// contributor, err := keyvault.LookupAccessPolicy(ctx, &keyvault.LookupAccessPolicyArgs{ +// Name: "Key Management", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("accessPolicyKeyPermissions", contributor.KeyPermissions) +// return nil +// }) +// } +// +// ``` func LookupAccessPolicy(ctx *pulumi.Context, args *LookupAccessPolicyArgs, opts ...pulumi.InvokeOption) (*LookupAccessPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccessPolicyResult diff --git a/sdk/go/azure/keyvault/getCertificate.go b/sdk/go/azure/keyvault/getCertificate.go index 7f3126b0c8..310126bcfe 100644 --- a/sdk/go/azure/keyvault/getCertificate.go +++ b/sdk/go/azure/keyvault/getCertificate.go @@ -13,6 +13,41 @@ import ( ) // Use this data source to access information about an existing Key Vault Certificate. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleKeyVault, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{ +// Name: "examplekv", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.LookupCertificate(ctx, &keyvault.LookupCertificateArgs{ +// Name: "secret-sauce", +// KeyVaultId: exampleKeyVault.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("certificateThumbprint", exampleCertificate.Thumbprint) +// return nil +// }) +// } +// +// ``` func LookupCertificate(ctx *pulumi.Context, args *LookupCertificateArgs, opts ...pulumi.InvokeOption) (*LookupCertificateResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupCertificateResult diff --git a/sdk/go/azure/keyvault/getCertificateData.go b/sdk/go/azure/keyvault/getCertificateData.go index dc00ea927b..c1275c2fcf 100644 --- a/sdk/go/azure/keyvault/getCertificateData.go +++ b/sdk/go/azure/keyvault/getCertificateData.go @@ -15,6 +15,41 @@ import ( // Use this data source to access data stored in an existing Key Vault Certificate. // // > **Note:** This data source uses the `GetSecret` function of the Azure API, to get the key of the certificate. Therefore you need secret/get permission +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleKeyVault, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{ +// Name: "examplekv", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// exampleCertificateData, err := keyvault.GetCertificateData(ctx, &keyvault.GetCertificateDataArgs{ +// Name: "secret-sauce", +// KeyVaultId: exampleKeyVault.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("examplePem", exampleCertificateData.Pem) +// return nil +// }) +// } +// +// ``` func GetCertificateData(ctx *pulumi.Context, args *GetCertificateDataArgs, opts ...pulumi.InvokeOption) (*GetCertificateDataResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetCertificateDataResult diff --git a/sdk/go/azure/keyvault/getCertificateIssuer.go b/sdk/go/azure/keyvault/getCertificateIssuer.go index 3ec179ae78..b1e60c9e12 100644 --- a/sdk/go/azure/keyvault/getCertificateIssuer.go +++ b/sdk/go/azure/keyvault/getCertificateIssuer.go @@ -13,6 +13,41 @@ import ( ) // Use this data source to access information about an existing Key Vault Certificate Issuer. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleKeyVault, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{ +// Name: "mykeyvault", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// exampleCertificateIssuer, err := keyvault.LookupCertificateIssuer(ctx, &keyvault.LookupCertificateIssuerArgs{ +// Name: "existing", +// KeyVaultId: exampleKeyVault.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", exampleCertificateIssuer.Id) +// return nil +// }) +// } +// +// ``` func LookupCertificateIssuer(ctx *pulumi.Context, args *LookupCertificateIssuerArgs, opts ...pulumi.InvokeOption) (*LookupCertificateIssuerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupCertificateIssuerResult diff --git a/sdk/go/azure/keyvault/getKey.go b/sdk/go/azure/keyvault/getKey.go index bfb8842ef6..b9658fd9a2 100644 --- a/sdk/go/azure/keyvault/getKey.go +++ b/sdk/go/azure/keyvault/getKey.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Key Vault Key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := keyvault.LookupKey(ctx, &keyvault.LookupKeyArgs{ +// Name: "secret-sauce", +// KeyVaultId: data.Azurerm_key_vault.Existing.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("keyType", example.KeyType) +// return nil +// }) +// } +// +// ``` func LookupKey(ctx *pulumi.Context, args *LookupKeyArgs, opts ...pulumi.InvokeOption) (*LookupKeyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupKeyResult diff --git a/sdk/go/azure/keyvault/getKeyVault.go b/sdk/go/azure/keyvault/getKeyVault.go index 0b2116c447..d87c9a7a99 100644 --- a/sdk/go/azure/keyvault/getKeyVault.go +++ b/sdk/go/azure/keyvault/getKeyVault.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Key Vault. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{ +// Name: "mykeyvault", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("vaultUri", example.VaultUri) +// return nil +// }) +// } +// +// ``` func LookupKeyVault(ctx *pulumi.Context, args *LookupKeyVaultArgs, opts ...pulumi.InvokeOption) (*LookupKeyVaultResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupKeyVaultResult diff --git a/sdk/go/azure/keyvault/getManagedHardwareSecurityModule.go b/sdk/go/azure/keyvault/getManagedHardwareSecurityModule.go index 0c82a40e4a..56142b6edf 100644 --- a/sdk/go/azure/keyvault/getManagedHardwareSecurityModule.go +++ b/sdk/go/azure/keyvault/getManagedHardwareSecurityModule.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Key Vault Managed Hardware Security Module. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := keyvault.LookupManagedHardwareSecurityModule(ctx, &keyvault.LookupManagedHardwareSecurityModuleArgs{ +// Name: "mykeyvaultHsm", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("hsmUri", example.HsmUri) +// return nil +// }) +// } +// +// ``` func LookupManagedHardwareSecurityModule(ctx *pulumi.Context, args *LookupManagedHardwareSecurityModuleArgs, opts ...pulumi.InvokeOption) (*LookupManagedHardwareSecurityModuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupManagedHardwareSecurityModuleResult diff --git a/sdk/go/azure/keyvault/getSecret.go b/sdk/go/azure/keyvault/getSecret.go index 73fb70c900..e9b32250bd 100644 --- a/sdk/go/azure/keyvault/getSecret.go +++ b/sdk/go/azure/keyvault/getSecret.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Key Vault Secret. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := keyvault.LookupSecret(ctx, &keyvault.LookupSecretArgs{ +// Name: "secret-sauce", +// KeyVaultId: data.Azurerm_key_vault.Existing.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("secretValue", example.Value) +// return nil +// }) +// } +// +// ``` func LookupSecret(ctx *pulumi.Context, args *LookupSecretArgs, opts ...pulumi.InvokeOption) (*LookupSecretResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSecretResult diff --git a/sdk/go/azure/keyvault/key.go b/sdk/go/azure/keyvault/key.go index 066b4724f5..b2e09674f6 100644 --- a/sdk/go/azure/keyvault/key.go +++ b/sdk/go/azure/keyvault/key.go @@ -20,6 +20,88 @@ import ( // > **Note:** To use this resource, your client should have RBAC roles with permissions like `Key Vault Crypto Officer` or `Key Vault Administrator` or an assigned Key Vault Access Policy with permissions `Create`,`Delete`,`Get`,`Purge`,`Recover`,`Update` and `GetRotationPolicy` for keys without Rotation Policy. Include `SetRotationPolicy` for keys with Rotation Policy. // // > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Key resource on destroy, rather than the default soft-delete. See `purgeSoftDeletedKeysOnDestroy` for more information. +// ### Additional Examples +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Get"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// pulumi.String("Update"), +// pulumi.String("GetRotationPolicy"), +// pulumi.String("SetRotationPolicy"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewKey(ctx, "generated", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// RotationPolicy: &keyvault.KeyRotationPolicyArgs{ +// Automatic: &keyvault.KeyRotationPolicyAutomaticArgs{ +// TimeBeforeExpiry: pulumi.String("P30D"), +// }, +// ExpireAfter: pulumi.String("P90D"), +// NotifyBeforeExpiry: pulumi.String("P29D"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/keyvault/keyVault.go b/sdk/go/azure/keyvault/keyVault.go index 2d661c5a89..a89f12698d 100644 --- a/sdk/go/azure/keyvault/keyVault.go +++ b/sdk/go/azure/keyvault/keyVault.go @@ -21,6 +21,64 @@ import ( // // > **Note:** It's possible to define Key Vault Certificate Contacts both within the `keyvault.KeyVault` resource via the `contact` block and by using the `keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// EnabledForDiskEncryption: pulumi.Bool(true), +// TenantId: *pulumi.String(current.TenantId), +// SoftDeleteRetentionDays: pulumi.Int(7), +// PurgeProtectionEnabled: pulumi.Bool(false), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// StoragePermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Key Vault's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/keyvault/managedHardwareSecurityModule.go b/sdk/go/azure/keyvault/managedHardwareSecurityModule.go index 922aefed2b..bd32c58e67 100644 --- a/sdk/go/azure/keyvault/managedHardwareSecurityModule.go +++ b/sdk/go/azure/keyvault/managedHardwareSecurityModule.go @@ -17,6 +17,54 @@ import ( // // > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Managed Hardware Security Module resource on destroy, rather than the default soft-delete. See `purgeSoftDeletedHardwareSecurityModulesOnDestroy` for more information. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewManagedHardwareSecurityModule(ctx, "exampleManagedHardwareSecurityModule", &keyvault.ManagedHardwareSecurityModuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("Standard_B1"), +// PurgeProtectionEnabled: pulumi.Bool(false), +// SoftDeleteRetentionDays: pulumi.Int(90), +// TenantId: *pulumi.String(current.TenantId), +// AdminObjectIds: pulumi.StringArray{ +// *pulumi.String(current.ObjectId), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Key Vault Managed Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/keyvault/managedStorageAccount.go b/sdk/go/azure/keyvault/managedStorageAccount.go index 6caec0f86f..9f0122cf95 100644 --- a/sdk/go/azure/keyvault/managedStorageAccount.go +++ b/sdk/go/azure/keyvault/managedStorageAccount.go @@ -15,6 +15,183 @@ import ( // Manages a Key Vault Managed Storage Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Delete"), +// }, +// StoragePermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Set"), +// pulumi.String("SetSAS"), +// pulumi.String("GetSAS"), +// pulumi.String("DeleteSAS"), +// pulumi.String("Update"), +// pulumi.String("RegenerateKey"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewManagedStorageAccount(ctx, "exampleManagedStorageAccount", &keyvault.ManagedStorageAccountArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountKey: pulumi.String("key1"), +// RegenerateKeyAutomatically: pulumi.Bool(false), +// RegenerationPeriod: pulumi.String("P1D"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Automatically Regenerate Storage Account Access Key) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// test, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// ApplicationId: pulumi.StringRef("cfa8b339-82a2-471a-a3c9-0fc0be7a4093"), +// }, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Delete"), +// }, +// StoragePermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Set"), +// pulumi.String("SetSAS"), +// pulumi.String("GetSAS"), +// pulumi.String("DeleteSAS"), +// pulumi.String("Update"), +// pulumi.String("RegenerateKey"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Storage Account Key Operator Service Role"), +// PrincipalId: *pulumi.String(test.Id), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewManagedStorageAccount(ctx, "exampleManagedStorageAccount", &keyvault.ManagedStorageAccountArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountKey: pulumi.String("key1"), +// RegenerateKeyAutomatically: pulumi.Bool(true), +// RegenerationPeriod: pulumi.String("P1D"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Key Vault Managed Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/keyvault/managedStorageAccountSasTokenDefinition.go b/sdk/go/azure/keyvault/managedStorageAccountSasTokenDefinition.go index 03f70cbb8d..80c1b6e1f3 100644 --- a/sdk/go/azure/keyvault/managedStorageAccountSasTokenDefinition.go +++ b/sdk/go/azure/keyvault/managedStorageAccountSasTokenDefinition.go @@ -15,6 +15,126 @@ import ( // Manages a Key Vault Managed Storage Account SAS Definition. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleAccountSAS := storage.GetAccountSASOutput(ctx, storage.GetAccountSASOutputArgs{ +// ConnectionString: exampleAccount.PrimaryConnectionString, +// HttpsOnly: pulumi.Bool(true), +// ResourceTypes: &storage.GetAccountSASResourceTypesArgs{ +// Service: pulumi.Bool(true), +// Container: pulumi.Bool(false), +// Object: pulumi.Bool(false), +// }, +// Services: &storage.GetAccountSASServicesArgs{ +// Blob: pulumi.Bool(true), +// Queue: pulumi.Bool(false), +// Table: pulumi.Bool(false), +// File: pulumi.Bool(false), +// }, +// Start: pulumi.String("2021-04-30T00:00:00Z"), +// Expiry: pulumi.String("2023-04-30T00:00:00Z"), +// Permissions: &storage.GetAccountSASPermissionsArgs{ +// Read: pulumi.Bool(true), +// Write: pulumi.Bool(true), +// Delete: pulumi.Bool(false), +// List: pulumi.Bool(false), +// Add: pulumi.Bool(true), +// Create: pulumi.Bool(true), +// Update: pulumi.Bool(false), +// Process: pulumi.Bool(false), +// Tag: pulumi.Bool(false), +// Filter: pulumi.Bool(false), +// }, +// }, nil) +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(exampleClientConfig.TenantId), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(exampleClientConfig.TenantId), +// ObjectId: *pulumi.String(exampleClientConfig.ObjectId), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Delete"), +// }, +// StoragePermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Set"), +// pulumi.String("SetSAS"), +// pulumi.String("GetSAS"), +// pulumi.String("DeleteSAS"), +// pulumi.String("Update"), +// pulumi.String("RegenerateKey"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedStorageAccount, err := keyvault.NewManagedStorageAccount(ctx, "exampleManagedStorageAccount", &keyvault.ManagedStorageAccountArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountKey: pulumi.String("key1"), +// RegenerateKeyAutomatically: pulumi.Bool(false), +// RegenerationPeriod: pulumi.String("P1D"), +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewManagedStorageAccountSasTokenDefinition(ctx, "exampleManagedStorageAccountSasTokenDefinition", &keyvault.ManagedStorageAccountSasTokenDefinitionArgs{ +// ValidityPeriod: pulumi.String("P1D"), +// ManagedStorageAccountId: exampleManagedStorageAccount.ID(), +// SasTemplateUri: exampleAccountSAS.ApplyT(func(exampleAccountSAS storage.GetAccountSASResult) (*string, error) { +// return &exampleAccountSAS.Sas, nil +// }).(pulumi.StringPtrOutput), +// SasType: pulumi.String("account"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Key Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/keyvault/pulumiTypes.go b/sdk/go/azure/keyvault/pulumiTypes.go index 88ede3f4d5..11cd1acbc0 100644 --- a/sdk/go/azure/keyvault/pulumiTypes.go +++ b/sdk/go/azure/keyvault/pulumiTypes.go @@ -22,6 +22,19 @@ type CertifiateCertificate struct { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` // // The PEM content should look something like: Password *string `pulumi:"password"` @@ -46,6 +59,19 @@ type CertifiateCertificateArgs struct { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` // // The PEM content should look something like: Password pulumi.StringPtrInput `pulumi:"password"` @@ -156,6 +182,22 @@ func (o CertifiateCertificateOutput) Contents() pulumi.StringOutput { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` // // The PEM content should look something like: func (o CertifiateCertificateOutput) Password() pulumi.StringPtrOutput { @@ -207,6 +249,22 @@ func (o CertifiateCertificatePtrOutput) Contents() pulumi.StringPtrOutput { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` // // The PEM content should look something like: func (o CertifiateCertificatePtrOutput) Password() pulumi.StringPtrOutput { @@ -1911,6 +1969,19 @@ type CertificateCertificate struct { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` // // The PEM content should look something like: Password *string `pulumi:"password"` @@ -1935,6 +2006,19 @@ type CertificateCertificateArgs struct { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` // // The PEM content should look something like: Password pulumi.StringPtrInput `pulumi:"password"` @@ -2045,6 +2129,22 @@ func (o CertificateCertificateOutput) Contents() pulumi.StringOutput { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` // // The PEM content should look something like: func (o CertificateCertificateOutput) Password() pulumi.StringPtrOutput { @@ -2096,6 +2196,22 @@ func (o CertificateCertificatePtrOutput) Contents() pulumi.StringPtrOutput { // > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. // // To convert a private key to pkcs8 format with openssl use: +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` // // The PEM content should look something like: func (o CertificateCertificatePtrOutput) Password() pulumi.StringPtrOutput { diff --git a/sdk/go/azure/keyvault/secret.go b/sdk/go/azure/keyvault/secret.go index 922464d9cc..5c7b5f892f 100644 --- a/sdk/go/azure/keyvault/secret.go +++ b/sdk/go/azure/keyvault/secret.go @@ -23,6 +23,70 @@ import ( // // ======= // > > > > > > > 8d78c87098 (Update-documentation) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("Recover"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewSecret(ctx, "exampleSecret", &keyvault.SecretArgs{ +// Value: pulumi.String("szechuan"), +// KeyVaultId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/kusto/attachedDatabaseConfiguration.go b/sdk/go/azure/kusto/attachedDatabaseConfiguration.go index ca5fd9526f..367dc08730 100644 --- a/sdk/go/azure/kusto/attachedDatabaseConfiguration.go +++ b/sdk/go/azure/kusto/attachedDatabaseConfiguration.go @@ -15,6 +15,101 @@ import ( // Manages a Kusto (also known as Azure Data Explorer) Attached Database Configuration // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// followerCluster, err := kusto.NewCluster(ctx, "followerCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// followedCluster, err := kusto.NewCluster(ctx, "followedCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewDatabase(ctx, "followedDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: followerCluster.Name, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: followerCluster.Name, +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewAttachedDatabaseConfiguration(ctx, "exampleAttachedDatabaseConfiguration", &kusto.AttachedDatabaseConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: followerCluster.Name, +// ClusterResourceId: followedCluster.ID(), +// DatabaseName: exampleDatabase.Name, +// Sharing: &kusto.AttachedDatabaseConfigurationSharingArgs{ +// ExternalTablesToExcludes: pulumi.StringArray{ +// pulumi.String("ExternalTable2"), +// }, +// ExternalTablesToIncludes: pulumi.StringArray{ +// pulumi.String("ExternalTable1"), +// }, +// MaterializedViewsToExcludes: pulumi.StringArray{ +// pulumi.String("MaterializedViewTable2"), +// }, +// MaterializedViewsToIncludes: pulumi.StringArray{ +// pulumi.String("MaterializedViewTable1"), +// }, +// TablesToExcludes: pulumi.StringArray{ +// pulumi.String("Table2"), +// }, +// TablesToIncludes: pulumi.StringArray{ +// pulumi.String("Table1"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto Attached Database Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/cluster.go b/sdk/go/azure/kusto/cluster.go index b5f4465694..eda694b2a8 100644 --- a/sdk/go/azure/kusto/cluster.go +++ b/sdk/go/azure/kusto/cluster.go @@ -15,6 +15,47 @@ import ( // Manages a Kusto (also known as Azure Data Explorer) Cluster // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/clusterCustomerManagedKey.go b/sdk/go/azure/kusto/clusterCustomerManagedKey.go index 81a7618841..c177c60290 100644 --- a/sdk/go/azure/kusto/clusterCustomerManagedKey.go +++ b/sdk/go/azure/kusto/clusterCustomerManagedKey.go @@ -15,6 +15,121 @@ import ( // Manages a Customer Managed Key for a Kusto Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// Identity: &kusto.ClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// cluster, err := keyvault.NewAccessPolicy(ctx, "cluster", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: exampleCluster.Identity.ApplyT(func(identity kusto.ClusterIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// }, +// }) +// if err != nil { +// return err +// } +// client, err := keyvault.NewAccessPolicy(ctx, "client", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Recover"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// client, +// cluster, +// })) +// if err != nil { +// return err +// } +// _, err = kusto.NewClusterCustomerManagedKey(ctx, "exampleClusterCustomerManagedKey", &kusto.ClusterCustomerManagedKeyArgs{ +// ClusterId: exampleCluster.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// KeyName: exampleKey.Name, +// KeyVersion: exampleKey.Version, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Customer Managed Keys for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/clusterManagedPrivateEndpoint.go b/sdk/go/azure/kusto/clusterManagedPrivateEndpoint.go index 079fa89b27..50ef07730a 100644 --- a/sdk/go/azure/kusto/clusterManagedPrivateEndpoint.go +++ b/sdk/go/azure/kusto/clusterManagedPrivateEndpoint.go @@ -15,6 +15,69 @@ import ( // Manages a Managed Private Endpoint for a Kusto Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewClusterManagedPrivateEndpoint(ctx, "exampleClusterManagedPrivateEndpoint", &kusto.ClusterManagedPrivateEndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ClusterName: exampleCluster.Name, +// PrivateLinkResourceId: exampleAccount.ID(), +// PrivateLinkResourceRegion: exampleAccount.Location, +// GroupId: pulumi.String("blob"), +// RequestMessage: pulumi.String("Please Approve"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Managed Private Endpoint for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/clusterPrincipalAssignment.go b/sdk/go/azure/kusto/clusterPrincipalAssignment.go index f4f2d4d4e1..71475b3e47 100644 --- a/sdk/go/azure/kusto/clusterPrincipalAssignment.go +++ b/sdk/go/azure/kusto/clusterPrincipalAssignment.go @@ -15,6 +15,59 @@ import ( // Manages a Kusto Cluster Principal Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewClusterPrincipalAssignment(ctx, "exampleClusterPrincipalAssignment", &kusto.ClusterPrincipalAssignmentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ClusterName: exampleCluster.Name, +// TenantId: *pulumi.String(current.TenantId), +// PrincipalId: *pulumi.String(current.ClientId), +// PrincipalType: pulumi.String("App"), +// Role: pulumi.String("AllDatabasesAdmin"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Explorer Cluster Principal Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/cosmosdbDataConnection.go b/sdk/go/azure/kusto/cosmosdbDataConnection.go index d883e253fa..adf30fe09c 100644 --- a/sdk/go/azure/kusto/cosmosdbDataConnection.go +++ b/sdk/go/azure/kusto/cosmosdbDataConnection.go @@ -15,6 +15,163 @@ import ( // Manages a Kusto / Cosmos Database Data Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// builtin, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// RoleDefinitionId: pulumi.StringRef("fbdf93bf-df7d-467e-a4d2-9458aa1360c8"), +// }, nil) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// Identity: &kusto.ClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: exampleResourceGroup.ID(), +// RoleDefinitionName: *pulumi.String(builtin.Name), +// PrincipalId: exampleCluster.Identity.ApplyT(func(identity kusto.ClusterIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("Session"), +// MaxIntervalInSeconds: pulumi.Int(5), +// MaxStalenessPrefix: pulumi.Int(100), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("/part"), +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// exampleSqlRoleDefinition := cosmosdb.LookupSqlRoleDefinitionOutput(ctx, cosmosdb.GetSqlRoleDefinitionOutputArgs{ +// RoleDefinitionId: pulumi.String("00000000-0000-0000-0000-000000000001"), +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// }, nil) +// _, err = cosmosdb.NewSqlRoleAssignment(ctx, "exampleSqlRoleAssignment", &cosmosdb.SqlRoleAssignmentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// RoleDefinitionId: exampleSqlRoleDefinition.ApplyT(func(exampleSqlRoleDefinition cosmosdb.GetSqlRoleDefinitionResult) (*string, error) { +// return &exampleSqlRoleDefinition.Id, nil +// }).(pulumi.StringPtrOutput), +// PrincipalId: exampleCluster.Identity.ApplyT(func(identity kusto.ClusterIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// Scope: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewScript(ctx, "exampleScript", &kusto.ScriptArgs{ +// DatabaseId: exampleDatabase.ID(), +// ScriptContent: pulumi.String(`.create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime) +// +// .create table TestTable ingestion json mapping "TestMapping" +// '[' +// ' {"column":"Id","path":"$.id"},' +// ' {"column":"Name","path":"$.name"},' +// ' {"column":"_ts","path":"$._ts"},' +// ' {"column":"_timestamp","path":"$._ts", "transform":"DateTimeFromUnixSeconds"}' +// ']' +// .alter table TestTable policy ingestionbatching "{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}" +// `), +// +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewCosmosdbDataConnection(ctx, "exampleCosmosdbDataConnection", &kusto.CosmosdbDataConnectionArgs{ +// Location: exampleResourceGroup.Location, +// CosmosdbContainerId: exampleSqlContainer.ID(), +// KustoDatabaseId: exampleDatabase.ID(), +// ManagedIdentityId: exampleCluster.ID(), +// TableName: pulumi.String("TestTable"), +// MappingRuleName: pulumi.String("TestMapping"), +// RetrievalStartDate: pulumi.String("2023-06-26T12:00:00.6554616Z"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto / Cosmos Database Data Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/database.go b/sdk/go/azure/kusto/database.go index b5af21a07c..b22922cc2d 100644 --- a/sdk/go/azure/kusto/database.go +++ b/sdk/go/azure/kusto/database.go @@ -15,6 +15,54 @@ import ( // Manages a Kusto (also known as Azure Data Explorer) Database // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// cluster, err := kusto.NewCluster(ctx, "cluster", &kusto.ClusterArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewDatabase(ctx, "database", &kusto.DatabaseArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// ClusterName: cluster.Name, +// HotCachePeriod: pulumi.String("P7D"), +// SoftDeletePeriod: pulumi.String("P31D"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/databasePrincipalAssignment.go b/sdk/go/azure/kusto/databasePrincipalAssignment.go index 6274768426..8511554ee2 100644 --- a/sdk/go/azure/kusto/databasePrincipalAssignment.go +++ b/sdk/go/azure/kusto/databasePrincipalAssignment.go @@ -15,6 +15,70 @@ import ( // Manages a Kusto (also known as Azure Data Explorer) Database Principal Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// HotCachePeriod: pulumi.String("P7D"), +// SoftDeletePeriod: pulumi.String("P31D"), +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewDatabasePrincipalAssignment(ctx, "exampleDatabasePrincipalAssignment", &kusto.DatabasePrincipalAssignmentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ClusterName: exampleCluster.Name, +// DatabaseName: exampleDatabase.Name, +// TenantId: *pulumi.String(current.TenantId), +// PrincipalId: *pulumi.String(current.ClientId), +// PrincipalType: pulumi.String("App"), +// Role: pulumi.String("Viewer"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto Database Principal Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/eventGridDataConnection.go b/sdk/go/azure/kusto/eventGridDataConnection.go index 7a031a9cf9..e52177f90e 100644 --- a/sdk/go/azure/kusto/eventGridDataConnection.go +++ b/sdk/go/azure/kusto/eventGridDataConnection.go @@ -15,6 +15,124 @@ import ( // Manages a Kusto (also known as Azure Data Explorer) Event Grid Data Connection // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventgrid" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// HotCachePeriod: pulumi.String("P7D"), +// SoftDeletePeriod: pulumi.String("P31D"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(1), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleEventSubscription, err := eventgrid.NewEventSubscription(ctx, "exampleEventSubscription", &eventgrid.EventSubscriptionArgs{ +// Scope: exampleAccount.ID(), +// EventhubEndpointId: exampleEventHub.ID(), +// EventDeliverySchema: pulumi.String("EventGridSchema"), +// IncludedEventTypes: pulumi.StringArray{ +// pulumi.String("Microsoft.Storage.BlobCreated"), +// pulumi.String("Microsoft.Storage.BlobRenamed"), +// }, +// RetryPolicy: &eventgrid.EventSubscriptionRetryPolicyArgs{ +// EventTimeToLive: pulumi.Int(144), +// MaxDeliveryAttempts: pulumi.Int(10), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewEventGridDataConnection(ctx, "exampleEventGridDataConnection", &kusto.EventGridDataConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// DatabaseName: exampleDatabase.Name, +// StorageAccountId: exampleAccount.ID(), +// EventhubId: exampleEventHub.ID(), +// EventhubConsumerGroupName: exampleConsumerGroup.Name, +// TableName: pulumi.String("my-table"), +// MappingRuleName: pulumi.String("my-table-mapping"), +// DataFormat: pulumi.String("JSON"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleEventSubscription, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto Event Grid Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/eventhubDataConnection.go b/sdk/go/azure/kusto/eventhubDataConnection.go index 67b7fd6a5a..2a9c242c62 100644 --- a/sdk/go/azure/kusto/eventhubDataConnection.go +++ b/sdk/go/azure/kusto/eventhubDataConnection.go @@ -15,6 +15,94 @@ import ( // Manages a Kusto (also known as Azure Data Explorer) EventHub Data Connection // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// cluster, err := kusto.NewCluster(ctx, "cluster", &kusto.ClusterArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// database, err := kusto.NewDatabase(ctx, "database", &kusto.DatabaseArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// ClusterName: cluster.Name, +// HotCachePeriod: pulumi.String("P7D"), +// SoftDeletePeriod: pulumi.String("P31D"), +// }) +// if err != nil { +// return err +// } +// eventhubNs, err := eventhub.NewEventHubNamespace(ctx, "eventhubNs", &eventhub.EventHubNamespaceArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// eventhub, err := eventhub.NewEventHub(ctx, "eventhub", &eventhub.EventHubArgs{ +// NamespaceName: eventhubNs.Name, +// ResourceGroupName: example.Name, +// PartitionCount: pulumi.Int(1), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// consumerGroup, err := eventhub.NewConsumerGroup(ctx, "consumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: eventhubNs.Name, +// EventhubName: eventhub.Name, +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewEventhubDataConnection(ctx, "eventhubConnection", &kusto.EventhubDataConnectionArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// ClusterName: cluster.Name, +// DatabaseName: database.Name, +// EventhubId: eventhub.ID(), +// ConsumerGroup: consumerGroup.Name, +// TableName: pulumi.String("my-table"), +// MappingRuleName: pulumi.String("my-table-mapping"), +// DataFormat: pulumi.String("JSON"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto EventHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/getCluster.go b/sdk/go/azure/kusto/getCluster.go index 06d2c04691..6b5251678e 100644 --- a/sdk/go/azure/kusto/getCluster.go +++ b/sdk/go/azure/kusto/getCluster.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Kusto (also known as Azure Data Explorer) Cluster +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := kusto.LookupCluster(ctx, &kusto.LookupClusterArgs{ +// Name: "kustocluster", +// ResourceGroupName: "test_resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupCluster(ctx *pulumi.Context, args *LookupClusterArgs, opts ...pulumi.InvokeOption) (*LookupClusterResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupClusterResult diff --git a/sdk/go/azure/kusto/getDatabase.go b/sdk/go/azure/kusto/getDatabase.go index 22993d1211..06b6549ec7 100644 --- a/sdk/go/azure/kusto/getDatabase.go +++ b/sdk/go/azure/kusto/getDatabase.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Kusto Database +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := kusto.LookupDatabase(ctx, &kusto.LookupDatabaseArgs{ +// ClusterName: "test_cluster", +// Name: "my-kusto-database", +// ResourceGroupName: "test_resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupDatabase(ctx *pulumi.Context, args *LookupDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupDatabaseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDatabaseResult diff --git a/sdk/go/azure/kusto/iotHubDataConnection.go b/sdk/go/azure/kusto/iotHubDataConnection.go index 5650f7ae68..98986a642f 100644 --- a/sdk/go/azure/kusto/iotHubDataConnection.go +++ b/sdk/go/azure/kusto/iotHubDataConnection.go @@ -15,6 +15,102 @@ import ( // Manages a Kusto (also known as Azure Data Explorer) IotHub Data Connection // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Standard_D13_v2"), +// Capacity: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// HotCachePeriod: pulumi.String("P7D"), +// SoftDeletePeriod: pulumi.String("P31D"), +// }) +// if err != nil { +// return err +// } +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("B1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSharedAccessPolicy, err := iot.NewSharedAccessPolicy(ctx, "exampleSharedAccessPolicy", &iot.SharedAccessPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubName: exampleIoTHub.Name, +// RegistryRead: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := iot.NewConsumerGroup(ctx, "exampleConsumerGroup", &iot.ConsumerGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IothubName: exampleIoTHub.Name, +// EventhubEndpointName: pulumi.String("events"), +// }) +// if err != nil { +// return err +// } +// _, err = kusto.NewIotHubDataConnection(ctx, "exampleIotHubDataConnection", &kusto.IotHubDataConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// DatabaseName: exampleDatabase.Name, +// IothubId: exampleIoTHub.ID(), +// ConsumerGroup: exampleConsumerGroup.Name, +// SharedAccessPolicyName: exampleSharedAccessPolicy.Name, +// EventSystemProperties: pulumi.StringArray{ +// pulumi.String("message-id"), +// pulumi.String("sequence-number"), +// pulumi.String("to"), +// }, +// TableName: pulumi.String("my-table"), +// MappingRuleName: pulumi.String("my-table-mapping"), +// DataFormat: pulumi.String("JSON"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto IotHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/kusto/script.go b/sdk/go/azure/kusto/script.go index 0297769169..7036fa19ed 100644 --- a/sdk/go/azure/kusto/script.go +++ b/sdk/go/azure/kusto/script.go @@ -15,6 +15,105 @@ import ( // Manages a Kusto Script. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := kusto.NewCluster(ctx, "exampleCluster", &kusto.ClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &kusto.ClusterSkuArgs{ +// Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := kusto.NewDatabase(ctx, "exampleDatabase", &kusto.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClusterName: exampleCluster.Name, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleBlob, err := storage.NewBlob(ctx, "exampleBlob", &storage.BlobArgs{ +// StorageAccountName: exampleAccount.Name, +// StorageContainerName: exampleContainer.Name, +// Type: pulumi.String("Block"), +// SourceContent: pulumi.String(".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)"), +// }) +// if err != nil { +// return err +// } +// exampleAccountBlobContainerSAS := storage.GetAccountBlobContainerSASOutput(ctx, storage.GetAccountBlobContainerSASOutputArgs{ +// ConnectionString: exampleAccount.PrimaryConnectionString, +// ContainerName: exampleContainer.Name, +// HttpsOnly: pulumi.Bool(true), +// Start: pulumi.String("2017-03-21"), +// Expiry: pulumi.String("2022-03-21"), +// Permissions: &storage.GetAccountBlobContainerSASPermissionsArgs{ +// Read: pulumi.Bool(true), +// Add: pulumi.Bool(false), +// Create: pulumi.Bool(false), +// Write: pulumi.Bool(true), +// Delete: pulumi.Bool(false), +// List: pulumi.Bool(true), +// }, +// }, nil) +// _, err = kusto.NewScript(ctx, "exampleScript", &kusto.ScriptArgs{ +// DatabaseId: exampleDatabase.ID(), +// Url: exampleBlob.ID(), +// SasToken: exampleAccountBlobContainerSAS.ApplyT(func(exampleAccountBlobContainerSAS storage.GetAccountBlobContainerSASResult) (*string, error) { +// return &exampleAccountBlobContainerSAS.Sas, nil +// }).(pulumi.StringPtrOutput), +// ContinueOnErrorsEnabled: pulumi.Bool(true), +// ForceAnUpdateWhenValueChanged: pulumi.String("first"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Kusto Scripts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lab/lab.go b/sdk/go/azure/lab/lab.go index f8890f9362..c10004c7b5 100644 --- a/sdk/go/azure/lab/lab.go +++ b/sdk/go/azure/lab/lab.go @@ -15,6 +15,60 @@ import ( // Manages a Lab Service Lab. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lab" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = lab.NewLab(ctx, "exampleLab", &lab.LabArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Title: pulumi.String("Test Title"), +// Security: &lab.LabSecurityArgs{ +// OpenAccessEnabled: pulumi.Bool(false), +// }, +// VirtualMachine: &lab.LabVirtualMachineArgs{ +// AdminUser: &lab.LabVirtualMachineAdminUserArgs{ +// Username: pulumi.String("testadmin"), +// Password: pulumi.String("Password1234!"), +// }, +// ImageReference: &lab.LabVirtualMachineImageReferenceArgs{ +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Publisher: pulumi.String("canonical"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// Sku: &lab.LabVirtualMachineSkuArgs{ +// Name: pulumi.String("Classic_Fsv2_2_4GB_128_S_SSD"), +// Capacity: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Lab Service Labs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lab/schedule.go b/sdk/go/azure/lab/schedule.go index 809b3e234f..d466a98511 100644 --- a/sdk/go/azure/lab/schedule.go +++ b/sdk/go/azure/lab/schedule.go @@ -15,6 +15,68 @@ import ( // Manages a Lab Service Schedule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lab" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLab, err := lab.NewLab(ctx, "exampleLab", &lab.LabArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Title: pulumi.String("Test Title"), +// Security: &lab.LabSecurityArgs{ +// OpenAccessEnabled: pulumi.Bool(false), +// }, +// VirtualMachine: &lab.LabVirtualMachineArgs{ +// AdminUser: &lab.LabVirtualMachineAdminUserArgs{ +// Username: pulumi.String("testadmin"), +// Password: pulumi.String("Password1234!"), +// }, +// ImageReference: &lab.LabVirtualMachineImageReferenceArgs{ +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Publisher: pulumi.String("canonical"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// Sku: &lab.LabVirtualMachineSkuArgs{ +// Name: pulumi.String("Classic_Fsv2_2_4GB_128_S_SSD"), +// Capacity: pulumi.Int(1), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = lab.NewSchedule(ctx, "exampleSchedule", &lab.ScheduleArgs{ +// LabId: exampleLab.ID(), +// StopTime: pulumi.String("2022-11-28T00:00:00Z"), +// TimeZone: pulumi.String("America/Los_Angeles"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Lab Service Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lab/servicePlan.go b/sdk/go/azure/lab/servicePlan.go index a507422511..e81639d1b4 100644 --- a/sdk/go/azure/lab/servicePlan.go +++ b/sdk/go/azure/lab/servicePlan.go @@ -17,6 +17,43 @@ import ( // // > **Note:** Before using this resource, it's required to submit the request of registering the provider with Azure CLI `az provider register --namespace Microsoft.LabServices`. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lab" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = lab.NewServicePlan(ctx, "exampleServicePlan", &lab.ServicePlanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllowedRegions: pulumi.StringArray{ +// exampleResourceGroup.Location, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Lab Service Plans can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lab/user.go b/sdk/go/azure/lab/user.go index babdd91011..9ab31284c2 100644 --- a/sdk/go/azure/lab/user.go +++ b/sdk/go/azure/lab/user.go @@ -15,6 +15,67 @@ import ( // Manages a Lab Service User. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lab" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLab, err := lab.NewLab(ctx, "exampleLab", &lab.LabArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Title: pulumi.String("Test Title"), +// Security: &lab.LabSecurityArgs{ +// OpenAccessEnabled: pulumi.Bool(false), +// }, +// VirtualMachine: &lab.LabVirtualMachineArgs{ +// AdminUser: &lab.LabVirtualMachineAdminUserArgs{ +// Username: pulumi.String("testadmin"), +// Password: pulumi.String("Password1234!"), +// }, +// ImageReference: &lab.LabVirtualMachineImageReferenceArgs{ +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Publisher: pulumi.String("canonical"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// Sku: &lab.LabVirtualMachineSkuArgs{ +// Name: pulumi.String("Classic_Fsv2_2_4GB_128_S_SSD"), +// Capacity: pulumi.Int(1), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = lab.NewUser(ctx, "exampleUser", &lab.UserArgs{ +// LabId: exampleLab.ID(), +// Email: pulumi.String("terraform-acctest@hashicorp.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Lab Service Users can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lb/backendAddressPool.go b/sdk/go/azure/lb/backendAddressPool.go index 9a05e6ddaf..ff63b192d1 100644 --- a/sdk/go/azure/lb/backendAddressPool.go +++ b/sdk/go/azure/lb/backendAddressPool.go @@ -17,6 +17,61 @@ import ( // // > **NOTE:** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewBackendAddressPool(ctx, "exampleBackendAddressPool", &lb.BackendAddressPoolArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lb/backendAddressPoolAddress.go b/sdk/go/azure/lb/backendAddressPoolAddress.go index f8bc3a4436..9f5bab9a80 100644 --- a/sdk/go/azure/lb/backendAddressPoolAddress.go +++ b/sdk/go/azure/lb/backendAddressPoolAddress.go @@ -17,6 +17,77 @@ import ( // // > **Note:** Backend Addresses can only be added to a `Standard` SKU Load Balancer. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleVirtualNetwork, err := network.LookupVirtualNetwork(ctx, &network.LookupVirtualNetworkArgs{ +// Name: "example-network", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleLB, err := lb.GetLB(ctx, &lb.GetLBArgs{ +// Name: "example-lb", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleBackendAddressPool, err := lb.LookupBackendAddressPool(ctx, &lb.LookupBackendAddressPoolArgs{ +// Name: "first", +// LoadbalancerId: exampleLB.Id, +// }, nil) +// if err != nil { +// return err +// } +// _, err = lb.NewBackendAddressPoolAddress(ctx, "exampleBackendAddressPoolAddress", &lb.BackendAddressPoolAddressArgs{ +// BackendAddressPoolId: *pulumi.String(exampleBackendAddressPool.Id), +// VirtualNetworkId: *pulumi.String(exampleVirtualNetwork.Id), +// IpAddress: pulumi.String("10.0.0.1"), +// }) +// if err != nil { +// return err +// } +// backend_pool_cr, err := lb.LookupBackendAddressPool(ctx, &lb.LookupBackendAddressPoolArgs{ +// Name: "globalLBBackendPool", +// LoadbalancerId: exampleLB.Id, +// }, nil) +// if err != nil { +// return err +// } +// _, err = lb.NewBackendAddressPoolAddress(ctx, "example-1", &lb.BackendAddressPoolAddressArgs{ +// BackendAddressPoolId: *pulumi.String(backend_pool_cr.Id), +// BackendAddressIpConfigurationId: pulumi.Any(azurerm_lb.BackendLbR1.Frontend_ip_configuration[0].Id), +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewBackendAddressPoolAddress(ctx, "example-2", &lb.BackendAddressPoolAddressArgs{ +// BackendAddressPoolId: *pulumi.String(backend_pool_cr.Id), +// BackendAddressIpConfigurationId: pulumi.Any(azurerm_lb.BackendLbR2.Frontend_ip_configuration[0].Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Backend Address Pool Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lb/getBackendAddressPool.go b/sdk/go/azure/lb/getBackendAddressPool.go index 79ca0227bb..65827d2221 100644 --- a/sdk/go/azure/lb/getBackendAddressPool.go +++ b/sdk/go/azure/lb/getBackendAddressPool.go @@ -13,6 +13,46 @@ import ( ) // Use this data source to access information about an existing Load Balancer's Backend Address Pool. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleLB, err := lb.GetLB(ctx, &lb.GetLBArgs{ +// Name: "example-lb", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleBackendAddressPool, err := lb.LookupBackendAddressPool(ctx, &lb.LookupBackendAddressPoolArgs{ +// Name: "first", +// LoadbalancerId: exampleLB.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("backendAddressPoolId", exampleBackendAddressPool.Id) +// var splat0 []interface{} +// for _, val0 := range data.Azurerm_lb_backend_address_pool.Beap.Backend_ip_configurations { +// splat0 = append(splat0, val0.Id) +// } +// ctx.Export("backendIpConfigurationIds", splat0) +// return nil +// }) +// } +// +// ``` func LookupBackendAddressPool(ctx *pulumi.Context, args *LookupBackendAddressPoolArgs, opts ...pulumi.InvokeOption) (*LookupBackendAddressPoolResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBackendAddressPoolResult diff --git a/sdk/go/azure/lb/getLB.go b/sdk/go/azure/lb/getLB.go index ba43dd9db9..7c8780df82 100644 --- a/sdk/go/azure/lb/getLB.go +++ b/sdk/go/azure/lb/getLB.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Load Balancer +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := lb.GetLB(ctx, &lb.GetLBArgs{ +// Name: "example-lb", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("loadbalancerId", example.Id) +// return nil +// }) +// } +// +// ``` func GetLB(ctx *pulumi.Context, args *GetLBArgs, opts ...pulumi.InvokeOption) (*GetLBResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetLBResult diff --git a/sdk/go/azure/lb/getLBOutboundRule.go b/sdk/go/azure/lb/getLBOutboundRule.go index c228e8fe30..3fc12aa464 100644 --- a/sdk/go/azure/lb/getLBOutboundRule.go +++ b/sdk/go/azure/lb/getLBOutboundRule.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Load Balancer Outbound Rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := lb.GetLBOutboundRule(ctx, &lb.GetLBOutboundRuleArgs{ +// Name: "existing_lb_outbound_rule", +// LoadbalancerId: "existing_load_balancer_id", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetLBOutboundRule(ctx *pulumi.Context, args *GetLBOutboundRuleArgs, opts ...pulumi.InvokeOption) (*GetLBOutboundRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetLBOutboundRuleResult diff --git a/sdk/go/azure/lb/loadBalancer.go b/sdk/go/azure/lb/loadBalancer.go index c614f077ae..5128c995bd 100644 --- a/sdk/go/azure/lb/loadBalancer.go +++ b/sdk/go/azure/lb/loadBalancer.go @@ -15,6 +15,55 @@ import ( // Manages a Load Balancer Resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Load Balancers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lb/natPool.go b/sdk/go/azure/lb/natPool.go index d25511e3de..8e5712f526 100644 --- a/sdk/go/azure/lb/natPool.go +++ b/sdk/go/azure/lb/natPool.go @@ -19,6 +19,67 @@ import ( // // > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewNatPool(ctx, "exampleNatPool", &lb.NatPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// LoadbalancerId: exampleLoadBalancer.ID(), +// Protocol: pulumi.String("Tcp"), +// FrontendPortStart: pulumi.Int(80), +// FrontendPortEnd: pulumi.Int(81), +// BackendPort: pulumi.Int(8080), +// FrontendIpConfigurationName: pulumi.String("PublicIPAddress"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Load Balancer NAT Pools can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lb/outboundRule.go b/sdk/go/azure/lb/outboundRule.go index 1855e3594c..e435fa174a 100644 --- a/sdk/go/azure/lb/outboundRule.go +++ b/sdk/go/azure/lb/outboundRule.go @@ -17,6 +17,74 @@ import ( // // > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration and a Backend Address Pool Attached. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleBackendAddressPool, err := lb.NewBackendAddressPool(ctx, "exampleBackendAddressPool", &lb.BackendAddressPoolArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewOutboundRule(ctx, "exampleOutboundRule", &lb.OutboundRuleArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// Protocol: pulumi.String("Tcp"), +// BackendAddressPoolId: exampleBackendAddressPool.ID(), +// FrontendIpConfigurations: lb.OutboundRuleFrontendIpConfigurationArray{ +// &lb.OutboundRuleFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Load Balancer Outbound Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lb/probe.go b/sdk/go/azure/lb/probe.go index a034b98a30..0d23d51375 100644 --- a/sdk/go/azure/lb/probe.go +++ b/sdk/go/azure/lb/probe.go @@ -17,6 +17,62 @@ import ( // // > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewProbe(ctx, "exampleProbe", &lb.ProbeArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// Port: pulumi.Int(22), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Load Balancer Probes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lb/rule.go b/sdk/go/azure/lb/rule.go index 9695934586..498d264d99 100644 --- a/sdk/go/azure/lb/rule.go +++ b/sdk/go/azure/lb/rule.go @@ -17,6 +17,65 @@ import ( // // > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: pulumi.String("West US"), +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: pulumi.String("West US"), +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("PublicIPAddress"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewRule(ctx, "exampleRule", &lb.RuleArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// Protocol: pulumi.String("Tcp"), +// FrontendPort: pulumi.Int(3389), +// BackendPort: pulumi.Int(3389), +// FrontendIpConfigurationName: pulumi.String("PublicIPAddress"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Load Balancer Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lighthouse/assignment.go b/sdk/go/azure/lighthouse/assignment.go index f101a79e38..9c05b09101 100644 --- a/sdk/go/azure/lighthouse/assignment.go +++ b/sdk/go/azure/lighthouse/assignment.go @@ -15,6 +15,38 @@ import ( // Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Assignment to a subscription, or to a resource group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lighthouse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = lighthouse.NewAssignment(ctx, "example", &lighthouse.AssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// LighthouseDefinitionId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Lighthouse Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/lighthouse/definition.go b/sdk/go/azure/lighthouse/definition.go index 183db67193..fb9b79e009 100644 --- a/sdk/go/azure/lighthouse/definition.go +++ b/sdk/go/azure/lighthouse/definition.go @@ -15,6 +15,48 @@ import ( // Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Definition. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lighthouse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// contributor, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// RoleDefinitionId: pulumi.StringRef("b24988ac-6180-42a0-ab88-20f7382dd24c"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = lighthouse.NewDefinition(ctx, "example", &lighthouse.DefinitionArgs{ +// Description: pulumi.String("This is a lighthouse definition created IaC"), +// ManagingTenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000"), +// Authorizations: lighthouse.DefinitionAuthorizationArray{ +// &lighthouse.DefinitionAuthorizationArgs{ +// PrincipalId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// RoleDefinitionId: *pulumi.String(contributor.RoleDefinitionId), +// PrincipalDisplayName: pulumi.String("Tier 1 Support"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Lighthouse Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loadtest/loadTest.go b/sdk/go/azure/loadtest/loadTest.go index 60f152c050..4d818ac3cd 100644 --- a/sdk/go/azure/loadtest/loadTest.go +++ b/sdk/go/azure/loadtest/loadTest.go @@ -17,6 +17,47 @@ import ( // // Manages a Load Test Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loadtest" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = loadtest.NewLoadTest(ctx, "exampleLoadTest", &loadtest.LoadTestArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // ## Blocks Reference // // ### `identity` Block diff --git a/sdk/go/azure/loganalytics/cluster.go b/sdk/go/azure/loganalytics/cluster.go index 588c56418d..cba18bac7e 100644 --- a/sdk/go/azure/loganalytics/cluster.go +++ b/sdk/go/azure/loganalytics/cluster.go @@ -17,6 +17,43 @@ import ( // // Manages a Log Analytics Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewCluster(ctx, "exampleCluster", &loganalytics.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Identity: &loganalytics.ClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/clusterCustomerManagedKey.go b/sdk/go/azure/loganalytics/clusterCustomerManagedKey.go index b4943092d1..446cf308cb 100644 --- a/sdk/go/azure/loganalytics/clusterCustomerManagedKey.go +++ b/sdk/go/azure/loganalytics/clusterCustomerManagedKey.go @@ -15,6 +15,110 @@ import ( // Manages a Log Analytics Cluster Customer Managed Key. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleCluster, err := loganalytics.NewCluster(ctx, "exampleCluster", &loganalytics.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Identity: &loganalytics.ClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("GetRotationPolicy"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: exampleCluster.Identity.ApplyT(func(identity loganalytics.ClusterIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleCluster.Identity.ApplyT(func(identity loganalytics.ClusterIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Unwrapkey"), +// pulumi.String("Wrapkey"), +// }, +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewClusterCustomerManagedKey(ctx, "exampleClusterCustomerManagedKey", &loganalytics.ClusterCustomerManagedKeyArgs{ +// LogAnalyticsClusterId: exampleCluster.ID(), +// KeyVaultKeyId: exampleKey.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Cluster Customer Managed Keys can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/dataExportRule.go b/sdk/go/azure/loganalytics/dataExportRule.go index ddac0509da..270fb82e02 100644 --- a/sdk/go/azure/loganalytics/dataExportRule.go +++ b/sdk/go/azure/loganalytics/dataExportRule.go @@ -15,6 +15,65 @@ import ( // Manages a Log Analytics Data Export Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewDataExportRule(ctx, "exampleDataExportRule", &loganalytics.DataExportRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// DestinationResourceId: exampleAccount.ID(), +// TableNames: pulumi.StringArray{ +// pulumi.String("Heartbeat"), +// }, +// Enabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Data Export Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/dataSourceWindowsEvent.go b/sdk/go/azure/loganalytics/dataSourceWindowsEvent.go index 8ad690f1f2..b44a2cac61 100644 --- a/sdk/go/azure/loganalytics/dataSourceWindowsEvent.go +++ b/sdk/go/azure/loganalytics/dataSourceWindowsEvent.go @@ -15,6 +15,53 @@ import ( // Manages a Log Analytics Windows Event DataSource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewDataSourceWindowsEvent(ctx, "exampleDataSourceWindowsEvent", &loganalytics.DataSourceWindowsEventArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// EventLogName: pulumi.String("Application"), +// EventTypes: pulumi.StringArray{ +// pulumi.String("Error"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Windows Event DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/dataSourceWindowsPerformanceCounter.go b/sdk/go/azure/loganalytics/dataSourceWindowsPerformanceCounter.go index 7daa3856e3..aac939b5fb 100644 --- a/sdk/go/azure/loganalytics/dataSourceWindowsPerformanceCounter.go +++ b/sdk/go/azure/loganalytics/dataSourceWindowsPerformanceCounter.go @@ -15,6 +15,53 @@ import ( // Manages a Log Analytics (formally Operational Insights) Windows Performance Counter DataSource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewDataSourceWindowsPerformanceCounter(ctx, "exampleDataSourceWindowsPerformanceCounter", &loganalytics.DataSourceWindowsPerformanceCounterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// ObjectName: pulumi.String("CPU"), +// InstanceName: pulumi.String("*"), +// CounterName: pulumi.String("CPU"), +// IntervalSeconds: pulumi.Int(10), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Windows Performance Counter DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/linkedService.go b/sdk/go/azure/loganalytics/linkedService.go index 9f6b154256..e72a8e4386 100644 --- a/sdk/go/azure/loganalytics/linkedService.go +++ b/sdk/go/azure/loganalytics/linkedService.go @@ -15,6 +15,63 @@ import ( // Manages a Log Analytics Linked Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := automation.NewAccount(ctx, "exampleAccount", &automation.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("development"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewLinkedService(ctx, "exampleLinkedService", &loganalytics.LinkedServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// ReadAccessId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/linkedStorageAccount.go b/sdk/go/azure/loganalytics/linkedStorageAccount.go index 9499270dfe..05719bcb3a 100644 --- a/sdk/go/azure/loganalytics/linkedStorageAccount.go +++ b/sdk/go/azure/loganalytics/linkedStorageAccount.go @@ -15,6 +15,63 @@ import ( // Manages a Log Analytics Linked Storage Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewLinkedStorageAccount(ctx, "exampleLinkedStorageAccount", &loganalytics.LinkedStorageAccountArgs{ +// DataSourceType: pulumi.String("CustomLogs"), +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// StorageAccountIds: pulumi.StringArray{ +// exampleAccount.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Linked Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/queryPack.go b/sdk/go/azure/loganalytics/queryPack.go index e69d254def..f6caa91e9e 100644 --- a/sdk/go/azure/loganalytics/queryPack.go +++ b/sdk/go/azure/loganalytics/queryPack.go @@ -15,6 +15,40 @@ import ( // Manages a Log Analytics Query Pack. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewQueryPack(ctx, "exampleQueryPack", &loganalytics.QueryPackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Query Packs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/savedSearch.go b/sdk/go/azure/loganalytics/savedSearch.go index a952a4235a..78969d52e6 100644 --- a/sdk/go/azure/loganalytics/savedSearch.go +++ b/sdk/go/azure/loganalytics/savedSearch.go @@ -15,6 +15,52 @@ import ( // Manages a Log Analytics (formally Operational Insights) Saved Search. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewSavedSearch(ctx, "exampleSavedSearch", &loganalytics.SavedSearchArgs{ +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// Category: pulumi.String("exampleCategory"), +// DisplayName: pulumi.String("exampleDisplayName"), +// Query: pulumi.String("exampleQuery"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Saved Searches can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/loganalytics/storageInsights.go b/sdk/go/azure/loganalytics/storageInsights.go index b517a59ec2..f2a975fc69 100644 --- a/sdk/go/azure/loganalytics/storageInsights.go +++ b/sdk/go/azure/loganalytics/storageInsights.go @@ -15,6 +15,62 @@ import ( // Manages a Log Analytics Storage Insights resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = loganalytics.NewStorageInsights(ctx, "exampleStorageInsights", &loganalytics.StorageInsightsArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// StorageAccountId: exampleAccount.ID(), +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Storage Insight Configs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/actionCustom.go b/sdk/go/azure/logicapps/actionCustom.go index 966f54dac1..7b408f872b 100644 --- a/sdk/go/azure/logicapps/actionCustom.go +++ b/sdk/go/azure/logicapps/actionCustom.go @@ -15,6 +15,63 @@ import ( // Manages a Custom Action within a Logic App Workflow // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleWorkflow, err := logicapps.NewWorkflow(ctx, "exampleWorkflow", &logicapps.WorkflowArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewActionCustom(ctx, "exampleActionCustom", &logicapps.ActionCustomArgs{ +// LogicAppId: exampleWorkflow.ID(), +// Body: pulumi.String(`{ +// "description": "A variable to configure the auto expiration age in days. Configured in negative number. Default is -30 (30 days old).", +// "inputs": { +// "variables": [ +// { +// "name": "ExpirationAgeInDays", +// "type": "Integer", +// "value": -30 +// } +// ] +// }, +// "runAfter": {}, +// "type": "InitializeVariable" +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Custom Actions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/actionHttp.go b/sdk/go/azure/logicapps/actionHttp.go index 241f7018cc..72b15ed0b0 100644 --- a/sdk/go/azure/logicapps/actionHttp.go +++ b/sdk/go/azure/logicapps/actionHttp.go @@ -15,6 +15,48 @@ import ( // Manages an HTTP Action within a Logic App Workflow // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleWorkflow, err := logicapps.NewWorkflow(ctx, "exampleWorkflow", &logicapps.WorkflowArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewActionHttp(ctx, "exampleActionHttp", &logicapps.ActionHttpArgs{ +// LogicAppId: exampleWorkflow.ID(), +// Method: pulumi.String("GET"), +// Uri: pulumi.String("http://example.com/some-webhook"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App HTTP Actions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/getIntegrationAccount.go b/sdk/go/azure/logicapps/getIntegrationAccount.go index 963cddad55..2ee0d7fa93 100644 --- a/sdk/go/azure/logicapps/getIntegrationAccount.go +++ b/sdk/go/azure/logicapps/getIntegrationAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Logic App Integration Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := logicapps.LookupIntegrationAccount(ctx, &logicapps.LookupIntegrationAccountArgs{ +// Name: "example-account", +// ResourceGroupName: "example-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupIntegrationAccount(ctx *pulumi.Context, args *LookupIntegrationAccountArgs, opts ...pulumi.InvokeOption) (*LookupIntegrationAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupIntegrationAccountResult diff --git a/sdk/go/azure/logicapps/getStandard.go b/sdk/go/azure/logicapps/getStandard.go index 08f6231d68..45a67bd082 100644 --- a/sdk/go/azure/logicapps/getStandard.go +++ b/sdk/go/azure/logicapps/getStandard.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Logic App Standard instance. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := logicapps.LookupStandard(ctx, &logicapps.LookupStandardArgs{ +// Name: "logicappstd", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupStandard(ctx *pulumi.Context, args *LookupStandardArgs, opts ...pulumi.InvokeOption) (*LookupStandardResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupStandardResult diff --git a/sdk/go/azure/logicapps/getWorkflow.go b/sdk/go/azure/logicapps/getWorkflow.go index cad63c90a7..eae8779396 100644 --- a/sdk/go/azure/logicapps/getWorkflow.go +++ b/sdk/go/azure/logicapps/getWorkflow.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Logic App Workflow. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := logicapps.LookupWorkflow(ctx, &logicapps.LookupWorkflowArgs{ +// Name: "workflow1", +// ResourceGroupName: "my-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("accessEndpoint", example.AccessEndpoint) +// return nil +// }) +// } +// +// ``` func LookupWorkflow(ctx *pulumi.Context, args *LookupWorkflowArgs, opts ...pulumi.InvokeOption) (*LookupWorkflowResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupWorkflowResult diff --git a/sdk/go/azure/logicapps/integrationAccount.go b/sdk/go/azure/logicapps/integrationAccount.go index ee6e1abb63..f517740117 100644 --- a/sdk/go/azure/logicapps/integrationAccount.go +++ b/sdk/go/azure/logicapps/integrationAccount.go @@ -15,6 +15,44 @@ import ( // Manages a Logic App Integration Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountAgreement.go b/sdk/go/azure/logicapps/integrationAccountAgreement.go index 7011d599c1..b2bf3e4bbe 100644 --- a/sdk/go/azure/logicapps/integrationAccountAgreement.go +++ b/sdk/go/azure/logicapps/integrationAccountAgreement.go @@ -15,6 +15,96 @@ import ( // Manages a Logic App Integration Account Agreement. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// testIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "testIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// host, err := logicapps.NewIntegrationAccountPartner(ctx, "host", &logicapps.IntegrationAccountPartnerArgs{ +// ResourceGroupName: example.Name, +// IntegrationAccountName: testIntegrationAccount.Name, +// BusinessIdentities: logicapps.IntegrationAccountPartnerBusinessIdentityArray{ +// &logicapps.IntegrationAccountPartnerBusinessIdentityArgs{ +// Qualifier: pulumi.String("AS2Identity"), +// Value: pulumi.String("FabrikamNY"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// guest, err := logicapps.NewIntegrationAccountPartner(ctx, "guest", &logicapps.IntegrationAccountPartnerArgs{ +// ResourceGroupName: example.Name, +// IntegrationAccountName: testIntegrationAccount.Name, +// BusinessIdentities: logicapps.IntegrationAccountPartnerBusinessIdentityArray{ +// &logicapps.IntegrationAccountPartnerBusinessIdentityArgs{ +// Qualifier: pulumi.String("AS2Identity"), +// Value: pulumi.String("FabrikamDC"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountAgreement(ctx, "testIntegrationAccountAgreement", &logicapps.IntegrationAccountAgreementArgs{ +// ResourceGroupName: example.Name, +// IntegrationAccountName: testIntegrationAccount.Name, +// AgreementType: pulumi.String("AS2"), +// HostPartnerName: host.Name, +// GuestPartnerName: guest.Name, +// Content: readFileOrPanic("testdata/integration_account_agreement_content_as2.json"), +// HostIdentity: &logicapps.IntegrationAccountAgreementHostIdentityArgs{ +// Qualifier: pulumi.String("AS2Identity"), +// Value: pulumi.String("FabrikamNY"), +// }, +// GuestIdentity: &logicapps.IntegrationAccountAgreementGuestIdentityArgs{ +// Qualifier: pulumi.String("AS2Identity"), +// Value: pulumi.String("FabrikamDC"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Agreements can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountAssembly.go b/sdk/go/azure/logicapps/integrationAccountAssembly.go index ba5def0bf7..edbfcc5913 100644 --- a/sdk/go/azure/logicapps/integrationAccountAssembly.go +++ b/sdk/go/azure/logicapps/integrationAccountAssembly.go @@ -15,6 +15,61 @@ import ( // Manages a Logic App Integration Account Assembly. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountAssembly(ctx, "exampleIntegrationAccountAssembly", &logicapps.IntegrationAccountAssemblyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IntegrationAccountName: exampleIntegrationAccount.Name, +// AssemblyName: pulumi.String("TestAssembly"), +// Content: filebase64OrPanic("testdata/log4net.dll"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Assemblies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountBatchConfiguration.go b/sdk/go/azure/logicapps/integrationAccountBatchConfiguration.go index 033c82f684..e604e6736e 100644 --- a/sdk/go/azure/logicapps/integrationAccountBatchConfiguration.go +++ b/sdk/go/azure/logicapps/integrationAccountBatchConfiguration.go @@ -15,6 +15,52 @@ import ( // Manages a Logic App Integration Account Batch Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountBatchConfiguration(ctx, "exampleIntegrationAccountBatchConfiguration", &logicapps.IntegrationAccountBatchConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IntegrationAccountName: exampleIntegrationAccount.Name, +// BatchGroupName: pulumi.String("TestBatchGroup"), +// ReleaseCriteria: &logicapps.IntegrationAccountBatchConfigurationReleaseCriteriaArgs{ +// MessageCount: pulumi.Int(80), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Batch Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountCertificate.go b/sdk/go/azure/logicapps/integrationAccountCertificate.go index 9f284da019..476c18bf5a 100644 --- a/sdk/go/azure/logicapps/integrationAccountCertificate.go +++ b/sdk/go/azure/logicapps/integrationAccountCertificate.go @@ -15,6 +15,49 @@ import ( // Manages a Logic App Integration Account Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountCertificate(ctx, "exampleIntegrationAccountCertificate", &logicapps.IntegrationAccountCertificateArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IntegrationAccountName: exampleIntegrationAccount.Name, +// PublicCertificate: pulumi.String("MIIDbzCCAlegAwIBAgIJAIzjRD36sIbbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAl0ZXJyYWZvcm0xFTATBgNVBAMMDHRlcnJhZm9ybS5pbzAgFw0xNzA0MjEyMDA1MjdaGA8yMTE3MDMyODIwMDUyN1owTTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAoMCXRlcnJhZm9ybTEVMBMGA1UEAwwMdGVycmFmb3JtLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3L9L5szT4+FLykTFNyyPjy/k3BQTYAfRQzP2dhnsuUKm3cdPC0NyZ+wEXIUGhoDO2YG6EYChOl8fsDqDOjloSUGKqYw++nlpHIuUgJx8IxxG2XkALCjFU7EmF+w7kn76d0ezpEIYxnLP+KG2DVornoEt1aLhv1MLmpgEZZPhDbMSLhSYWeTVRMayXLwqtfgnDumQSB+8d/1JuJqrSI4pD12JozVThzb6hsjfb6RMX4epPmrGn0PbTPEEA6awmsxBCXB0s13nNQt/O0hLM2agwvAyozilQV+s616Ckgk6DJoUkqZhDy7vPYMIRSr98fBws6zkrV6tTLjmD8xAvobePQIDAQABo1AwTjAdBgNVHQ4EFgQUXIqO421zMMmbcRRX9wctZFCQuPIwHwYDVR0jBBgwFoAUXIqO421zMMmbcRRX9wctZFCQuPIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAr82NeT3BYJOKLlUL6Om5LjUF66ewcJjG9ltdvyQwVneMcq7t5UAPxgChzqNRVk4da8PzkXpjBJyWezHupdJNX3XqeUk2kSxqQ6/gmhqvfI3y7djrwoO6jvMEY26WqtkTNORWDP3THJJVimC3zV+KMU5UBVrEzhOVhHSU709lBP75o0BBn3xGsPqSq9k8IotIFfyAc6a+XP3+ZMpvh7wqAUml7vWa5wlcXExCx39h1balfDSLGNC4swWPCp9AMnQR0p+vMay9hNP1Eh+9QYUai14d5KS3cFV+KxE1cJR5HD/iLltnnOEbpMsB0eVOZWkFvE7Y5lW0oVSAfin5TwTJMQ=="), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountMap.go b/sdk/go/azure/logicapps/integrationAccountMap.go index 2fc7ee82d5..78b56a7863 100644 --- a/sdk/go/azure/logicapps/integrationAccountMap.go +++ b/sdk/go/azure/logicapps/integrationAccountMap.go @@ -15,6 +15,60 @@ import ( // Manages a Logic App Integration Account Map. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountMap(ctx, "exampleIntegrationAccountMap", &logicapps.IntegrationAccountMapArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IntegrationAccountName: exampleIntegrationAccount.Name, +// MapType: pulumi.String("Xslt"), +// Content: readFileOrPanic("testdata/integration_account_map_content.xsd"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Maps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountPartner.go b/sdk/go/azure/logicapps/integrationAccountPartner.go index d2f3d72216..ac9ac6fde3 100644 --- a/sdk/go/azure/logicapps/integrationAccountPartner.go +++ b/sdk/go/azure/logicapps/integrationAccountPartner.go @@ -15,6 +15,54 @@ import ( // Manages a Logic App Integration Account Partner. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountPartner(ctx, "exampleIntegrationAccountPartner", &logicapps.IntegrationAccountPartnerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IntegrationAccountName: exampleIntegrationAccount.Name, +// BusinessIdentities: logicapps.IntegrationAccountPartnerBusinessIdentityArray{ +// &logicapps.IntegrationAccountPartnerBusinessIdentityArgs{ +// Qualifier: pulumi.String("ZZ"), +// Value: pulumi.String("AA"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Partners can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountSchema.go b/sdk/go/azure/logicapps/integrationAccountSchema.go index 8e16e7acae..6bf90181b0 100644 --- a/sdk/go/azure/logicapps/integrationAccountSchema.go +++ b/sdk/go/azure/logicapps/integrationAccountSchema.go @@ -15,6 +15,59 @@ import ( // Manages a Logic App Integration Account Schema. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountSchema(ctx, "exampleIntegrationAccountSchema", &logicapps.IntegrationAccountSchemaArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IntegrationAccountName: exampleIntegrationAccount.Name, +// Content: readFileOrPanic("testdata/integration_account_schema_content.xsd"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Schemas can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/integrationAccountSession.go b/sdk/go/azure/logicapps/integrationAccountSession.go index 397ff10c1a..5b6ba5926b 100644 --- a/sdk/go/azure/logicapps/integrationAccountSession.go +++ b/sdk/go/azure/logicapps/integrationAccountSession.go @@ -15,6 +15,49 @@ import ( // Manages a Logic App Integration Account Session. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationAccount, err := logicapps.NewIntegrationAccount(ctx, "exampleIntegrationAccount", &logicapps.IntegrationAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewIntegrationAccountSession(ctx, "exampleIntegrationAccountSession", &logicapps.IntegrationAccountSessionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// IntegrationAccountName: exampleIntegrationAccount.Name, +// Content: pulumi.String(" {\n \"controlNumber\": \"1234\"\n }\n"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Integration Account Sessions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/interationServiceEnvironment.go b/sdk/go/azure/logicapps/interationServiceEnvironment.go index 658f9c0412..608f531f0e 100644 --- a/sdk/go/azure/logicapps/interationServiceEnvironment.go +++ b/sdk/go/azure/logicapps/interationServiceEnvironment.go @@ -17,6 +17,110 @@ import ( // // !> **NOTE:** The `logicapps.InterationServiceEnvironment` resource is deprecated and will be removed in v4.0 of the Azure Provider. The underlying Azure Service is being retired on 2024-08-31 and new instances cannot be provisioned by default after 2022-11-01. More information on the retirement and how to migrate to Logic Apps Standard [can be found here](https://aka.ms/isedeprecation). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/22"), +// }, +// }) +// if err != nil { +// return err +// } +// isesubnet1, err := network.NewSubnet(ctx, "isesubnet1", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/27"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("integrationServiceEnvironments"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Logic/integrationServiceEnvironments"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// isesubnet2, err := network.NewSubnet(ctx, "isesubnet2", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.32/27"), +// }, +// }) +// if err != nil { +// return err +// } +// isesubnet3, err := network.NewSubnet(ctx, "isesubnet3", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.64/27"), +// }, +// }) +// if err != nil { +// return err +// } +// isesubnet4, err := network.NewSubnet(ctx, "isesubnet4", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.96/27"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewInterationServiceEnvironment(ctx, "exampleInterationServiceEnvironment", &logicapps.InterationServiceEnvironmentArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Developer_0"), +// AccessEndpointType: pulumi.String("Internal"), +// VirtualNetworkSubnetIds: pulumi.StringArray{ +// isesubnet1.ID(), +// isesubnet2.ID(), +// isesubnet3.ID(), +// isesubnet4.ID(), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("development"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Integration Service Environments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/standard.go b/sdk/go/azure/logicapps/standard.go index af330c08e1..ace3f3a2f3 100644 --- a/sdk/go/azure/logicapps/standard.go +++ b/sdk/go/azure/logicapps/standard.go @@ -16,6 +16,139 @@ import ( // Manages a Logic App (Standard / Single Tenant) // // ## Example Usage +// ### With App Service Plan) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("elastic"), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("WorkflowStandard"), +// Size: pulumi.String("WS1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewStandard(ctx, "exampleStandard", &logicapps.StandardArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// AppSettings: pulumi.StringMap{ +// "FUNCTIONS_WORKER_RUNTIME": pulumi.String("node"), +// "WEBSITE_NODE_DEFAULT_VERSION": pulumi.String("~18"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### For Container Mode) +// +// > **Note:** You must set `appservice.Plan` `kind` to `Linux` and `reserved` to `true` when used with `linuxFxVersion` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("Linux"), +// Reserved: pulumi.Bool(true), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("WorkflowStandard"), +// Size: pulumi.String("WS1"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewStandard(ctx, "exampleStandard", &logicapps.StandardArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// SiteConfig: &logicapps.StandardSiteConfigArgs{ +// LinuxFxVersion: pulumi.String("DOCKER|mcr.microsoft.com/azure-functions/dotnet:3.0-appservice"), +// }, +// AppSettings: pulumi.StringMap{ +// "DOCKER_REGISTRY_SERVER_URL": pulumi.String("https://.azurecr.io"), +// "DOCKER_REGISTRY_SERVER_USERNAME": pulumi.String("username"), +// "DOCKER_REGISTRY_SERVER_PASSWORD": pulumi.String("password"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/logicapps/triggerCustom.go b/sdk/go/azure/logicapps/triggerCustom.go index b41772f075..266c89a28c 100644 --- a/sdk/go/azure/logicapps/triggerCustom.go +++ b/sdk/go/azure/logicapps/triggerCustom.go @@ -15,6 +15,56 @@ import ( // Manages a Custom Trigger within a Logic App Workflow // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleWorkflow, err := logicapps.NewWorkflow(ctx, "exampleWorkflow", &logicapps.WorkflowArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewTriggerCustom(ctx, "exampleTriggerCustom", &logicapps.TriggerCustomArgs{ +// LogicAppId: exampleWorkflow.ID(), +// Body: pulumi.String(`{ +// "recurrence": { +// "frequency": "Day", +// "interval": 1 +// }, +// "type": "Recurrence" +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Custom Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/triggerHttpRequest.go b/sdk/go/azure/logicapps/triggerHttpRequest.go index a93b92c625..1217ed88c8 100644 --- a/sdk/go/azure/logicapps/triggerHttpRequest.go +++ b/sdk/go/azure/logicapps/triggerHttpRequest.go @@ -15,6 +15,57 @@ import ( // Manages a HTTP Request Trigger within a Logic App Workflow // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleWorkflow, err := logicapps.NewWorkflow(ctx, "exampleWorkflow", &logicapps.WorkflowArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewTriggerHttpRequest(ctx, "exampleTriggerHttpRequest", &logicapps.TriggerHttpRequestArgs{ +// LogicAppId: exampleWorkflow.ID(), +// Schema: pulumi.String(`{ +// "type": "object", +// "properties": { +// "hello": { +// "type": "string" +// } +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App HTTP Request Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/triggerRecurrence.go b/sdk/go/azure/logicapps/triggerRecurrence.go index b381277ef4..1fe1a3a1ac 100644 --- a/sdk/go/azure/logicapps/triggerRecurrence.go +++ b/sdk/go/azure/logicapps/triggerRecurrence.go @@ -15,6 +15,48 @@ import ( // Manages a Recurrence Trigger within a Logic App Workflow // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleWorkflow, err := logicapps.NewWorkflow(ctx, "exampleWorkflow", &logicapps.WorkflowArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewTriggerRecurrence(ctx, "exampleTriggerRecurrence", &logicapps.TriggerRecurrenceArgs{ +// LogicAppId: exampleWorkflow.ID(), +// Frequency: pulumi.String("Day"), +// Interval: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Recurrence Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/logicapps/workflow.go b/sdk/go/azure/logicapps/workflow.go index d985e4eeca..9e5d807464 100644 --- a/sdk/go/azure/logicapps/workflow.go +++ b/sdk/go/azure/logicapps/workflow.go @@ -15,6 +15,40 @@ import ( // Manages a Logic App Workflow. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = logicapps.NewWorkflow(ctx, "exampleWorkflow", &logicapps.WorkflowArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logic App Workflows can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/machinelearning/computeCluster.go b/sdk/go/azure/machinelearning/computeCluster.go index 0bc1fc2483..6241732e0a 100644 --- a/sdk/go/azure/machinelearning/computeCluster.go +++ b/sdk/go/azure/machinelearning/computeCluster.go @@ -16,6 +16,122 @@ import ( // Manages a Machine Learning Compute Cluster. // **NOTE:** At this point in time the resource cannot be updated (not supported by the backend Azure Go SDK). Therefore it can only be created and deleted, not updated. At the moment, there is also no possibility to specify ssh User Account Credentials to ssh into the compute cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// Tags: pulumi.StringMap{ +// "stage": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.1.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.1.0.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewComputeCluster(ctx, "test", &machinelearning.ComputeClusterArgs{ +// Location: exampleResourceGroup.Location, +// VmPriority: pulumi.String("LowPriority"), +// VmSize: pulumi.String("Standard_DS2_v2"), +// MachineLearningWorkspaceId: exampleWorkspace.ID(), +// SubnetResourceId: exampleSubnet.ID(), +// ScaleSettings: &machinelearning.ComputeClusterScaleSettingsArgs{ +// MinNodeCount: pulumi.Int(0), +// MaxNodeCount: pulumi.Int(1), +// ScaleDownNodesAfterIdleDuration: pulumi.String("PT30S"), +// }, +// Identity: &machinelearning.ComputeClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Machine Learning Compute Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/machinelearning/computeInstance.go b/sdk/go/azure/machinelearning/computeInstance.go index 8c06ecc3c4..bf7d03aab5 100644 --- a/sdk/go/azure/machinelearning/computeInstance.go +++ b/sdk/go/azure/machinelearning/computeInstance.go @@ -15,6 +15,127 @@ import ( // Manages a Machine Learning Compute Instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// Tags: pulumi.StringMap{ +// "stage": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.1.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.1.0.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// cfg := config.New(ctx, "") +// sshKey := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" +// if param := cfg.Get("sshKey"); param != "" { +// sshKey = param +// } +// _, err = machinelearning.NewComputeInstance(ctx, "exampleComputeInstance", &machinelearning.ComputeInstanceArgs{ +// Location: exampleResourceGroup.Location, +// MachineLearningWorkspaceId: exampleWorkspace.ID(), +// VirtualMachineSize: pulumi.String("STANDARD_DS2_V2"), +// AuthorizationType: pulumi.String("personal"), +// Ssh: &machinelearning.ComputeInstanceSshArgs{ +// PublicKey: pulumi.String(sshKey), +// }, +// SubnetResourceId: exampleSubnet.ID(), +// Description: pulumi.String("foo"), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Machine Learning Compute Instances can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/machinelearning/datastoreBlobstorage.go b/sdk/go/azure/machinelearning/datastoreBlobstorage.go index aad1c6f795..5a7b5417b5 100644 --- a/sdk/go/azure/machinelearning/datastoreBlobstorage.go +++ b/sdk/go/azure/machinelearning/datastoreBlobstorage.go @@ -16,6 +16,93 @@ import ( // Manages a Machine Learning Blob Storage DataStore. // // ## Example Usage +// ### With Azure Blob +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewDatastoreBlobstorage(ctx, "exampleDatastoreBlobstorage", &machinelearning.DatastoreBlobstorageArgs{ +// WorkspaceId: exampleWorkspace.ID(), +// StorageContainerId: exampleContainer.ResourceManagerId, +// AccountKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/machinelearning/datastoreDatalakeGen2.go b/sdk/go/azure/machinelearning/datastoreDatalakeGen2.go index 9f41bc1104..b52b7aa44a 100644 --- a/sdk/go/azure/machinelearning/datastoreDatalakeGen2.go +++ b/sdk/go/azure/machinelearning/datastoreDatalakeGen2.go @@ -15,6 +15,93 @@ import ( // Manages a Machine Learning Data Lake Gen2 DataStore. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewDatastoreDatalakeGen2(ctx, "exampleDatastoreDatalakeGen2", &machinelearning.DatastoreDatalakeGen2Args{ +// WorkspaceId: exampleWorkspace.ID(), +// StorageContainerId: exampleContainer.ResourceManagerId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Machine Learning DataStores can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/machinelearning/getWorkspace.go b/sdk/go/azure/machinelearning/getWorkspace.go index 2d4ceadee0..ddae5a6d23 100644 --- a/sdk/go/azure/machinelearning/getWorkspace.go +++ b/sdk/go/azure/machinelearning/getWorkspace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Machine Learning Workspace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := machinelearning.LookupWorkspace(ctx, &machinelearning.LookupWorkspaceArgs{ +// Name: "example-workspace", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", azurerm_machine_learning_workspace.Existing.Id) +// return nil +// }) +// } +// +// ``` func LookupWorkspace(ctx *pulumi.Context, args *LookupWorkspaceArgs, opts ...pulumi.InvokeOption) (*LookupWorkspaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupWorkspaceResult diff --git a/sdk/go/azure/machinelearning/inferenceCluster.go b/sdk/go/azure/machinelearning/inferenceCluster.go index f8a9f36252..8387164c3b 100644 --- a/sdk/go/azure/machinelearning/inferenceCluster.go +++ b/sdk/go/azure/machinelearning/inferenceCluster.go @@ -17,6 +17,135 @@ import ( // // > **NOTE:** The Machine Learning Inference Cluster resource is used to attach an existing AKS cluster to the Machine Learning Workspace, it doesn't create the AKS cluster itself. Therefore it can only be created and deleted, not updated. Any change to the configuration will recreate the resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// Tags: pulumi.StringMap{ +// "stage": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.1.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.1.0.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKubernetesCluster, err := containerservice.NewKubernetesCluster(ctx, "exampleKubernetesCluster", &containerservice.KubernetesClusterArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DnsPrefixPrivateCluster: pulumi.String("prefix"), +// DefaultNodePool: &containerservice.KubernetesClusterDefaultNodePoolArgs{ +// Name: pulumi.String("default"), +// NodeCount: pulumi.Int(3), +// VmSize: pulumi.String("Standard_D3_v2"), +// VnetSubnetId: exampleSubnet.ID(), +// }, +// Identity: &containerservice.KubernetesClusterIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewInferenceCluster(ctx, "exampleInferenceCluster", &machinelearning.InferenceClusterArgs{ +// Location: exampleResourceGroup.Location, +// ClusterPurpose: pulumi.String("FastProd"), +// KubernetesClusterId: exampleKubernetesCluster.ID(), +// Description: pulumi.String("This is an example cluster used with Terraform"), +// MachineLearningWorkspaceId: exampleWorkspace.ID(), +// Tags: pulumi.StringMap{ +// "stage": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Machine Learning Inference Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/machinelearning/synapseSpark.go b/sdk/go/azure/machinelearning/synapseSpark.go index eea72232ec..391588be6b 100644 --- a/sdk/go/azure/machinelearning/synapseSpark.go +++ b/sdk/go/azure/machinelearning/synapseSpark.go @@ -15,6 +15,123 @@ import ( // Manages the linked service to link an Azure Machine learning workspace to an Azure Synapse workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// Tags: pulumi.StringMap{ +// "stage": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspace(ctx, "exampleSynapse/workspaceWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSparkPool, err := synapse.NewSparkPool(ctx, "exampleSparkPool", &synapse.SparkPoolArgs{ +// SynapseWorkspaceId: exampleSynapse / workspaceWorkspace.Id, +// NodeSizeFamily: pulumi.String("MemoryOptimized"), +// NodeSize: pulumi.String("Small"), +// NodeCount: pulumi.Int(3), +// }) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewSynapseSpark(ctx, "exampleSynapseSpark", &machinelearning.SynapseSparkArgs{ +// MachineLearningWorkspaceId: exampleWorkspace.ID(), +// Location: exampleResourceGroup.Location, +// SynapseSparkPoolId: exampleSparkPool.ID(), +// Identity: &machinelearning.SynapseSparkIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Machine Learning Synapse Sparks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/machinelearning/workspace.go b/sdk/go/azure/machinelearning/workspace.go index 043d48e035..23408877a1 100644 --- a/sdk/go/azure/machinelearning/workspace.go +++ b/sdk/go/azure/machinelearning/workspace.go @@ -13,6 +13,405 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Data Encryption +// +// > **NOTE:** The Key Vault must enable purge protection. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccessPolicy, err := keyvault.NewAccessPolicy(ctx, "exampleAccessPolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleKeyVault, +// exampleAccessPolicy, +// })) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Encryption: &machinelearning.WorkspaceEncryptionArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyId: exampleKey.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With User Assigned Identity And Data Encryption +// +// > **NOTE:** The Key Vault must enable purge protection. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/machinelearning" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-identity", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: exampleUserAssignedIdentity.PrincipalId, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("WrapKey"), +// pulumi.String("UnwrapKey"), +// pulumi.String("Get"), +// pulumi.String("Recover"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Set"), +// pulumi.String("Delete"), +// pulumi.String("Recover"), +// pulumi.String("Backup"), +// pulumi.String("Restore"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-sp", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("Recover"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// test, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// DisplayName: pulumi.StringRef("Azure Cosmos DB"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = keyvault.NewAccessPolicy(ctx, "example-cosmosdb", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(test.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// test, +// current, +// })) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleKeyVault, +// example_sp, +// })) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example-role1", &authorization.AssignmentArgs{ +// Scope: exampleKeyVault.ID(), +// RoleDefinitionName: pulumi.String("Contributor"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example-role2", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example-role3", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Contributor"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "example-role4", &authorization.AssignmentArgs{ +// Scope: exampleInsights.ID(), +// RoleDefinitionName: pulumi.String("Contributor"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// _, err = machinelearning.NewWorkspace(ctx, "exampleWorkspace", &machinelearning.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationInsightsId: exampleInsights.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// HighBusinessImpact: pulumi.Bool(true), +// PrimaryUserAssignedIdentity: exampleUserAssignedIdentity.ID(), +// Identity: &machinelearning.WorkspaceIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Encryption: &machinelearning.WorkspaceEncryptionArgs{ +// UserAssignedIdentityId: exampleUserAssignedIdentity.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// KeyId: exampleKey.ID(), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// example_role1, +// example_role2, +// example_role3, +// example_role4, +// example_cosmosdb, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Machine Learning Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/maintenance/assignmentDedicatedHost.go b/sdk/go/azure/maintenance/assignmentDedicatedHost.go index c3883b8b7b..0bee34ea81 100644 --- a/sdk/go/azure/maintenance/assignmentDedicatedHost.go +++ b/sdk/go/azure/maintenance/assignmentDedicatedHost.go @@ -15,6 +15,67 @@ import ( // Manages a maintenance assignment to Dedicated Host. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleDedicatedHostGroup, err := compute.NewDedicatedHostGroup(ctx, "exampleDedicatedHostGroup", &compute.DedicatedHostGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PlatformFaultDomainCount: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// exampleDedicatedHost, err := compute.NewDedicatedHost(ctx, "exampleDedicatedHost", &compute.DedicatedHostArgs{ +// Location: exampleResourceGroup.Location, +// DedicatedHostGroupId: exampleDedicatedHostGroup.ID(), +// SkuName: pulumi.String("DSv3-Type1"), +// PlatformFaultDomain: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleConfiguration, err := maintenance.NewConfiguration(ctx, "exampleConfiguration", &maintenance.ConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Scope: pulumi.String("Host"), +// }) +// if err != nil { +// return err +// } +// _, err = maintenance.NewAssignmentDedicatedHost(ctx, "exampleAssignmentDedicatedHost", &maintenance.AssignmentDedicatedHostArgs{ +// Location: exampleResourceGroup.Location, +// MaintenanceConfigurationId: exampleConfiguration.ID(), +// DedicatedHostId: exampleDedicatedHost.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/maintenance/assignmentVirtualMachine.go b/sdk/go/azure/maintenance/assignmentVirtualMachine.go index 6d675f6540..527959d6b9 100644 --- a/sdk/go/azure/maintenance/assignmentVirtualMachine.go +++ b/sdk/go/azure/maintenance/assignmentVirtualMachine.go @@ -15,6 +15,123 @@ import ( // Manages a maintenance assignment to virtual machine. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_F2"), +// AdminUsername: pulumi.String("adminuser"), +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// AdminSshKeys: compute.LinuxVirtualMachineAdminSshKeyArray{ +// &compute.LinuxVirtualMachineAdminSshKeyArgs{ +// Username: pulumi.String("adminuser"), +// PublicKey: readFileOrPanic("~/.ssh/id_rsa.pub"), +// }, +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleConfiguration, err := maintenance.NewConfiguration(ctx, "exampleConfiguration", &maintenance.ConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Scope: pulumi.String("All"), +// }) +// if err != nil { +// return err +// } +// _, err = maintenance.NewAssignmentVirtualMachine(ctx, "exampleAssignmentVirtualMachine", &maintenance.AssignmentVirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// MaintenanceConfigurationId: exampleConfiguration.ID(), +// VirtualMachineId: exampleLinuxVirtualMachine.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/maintenance/assignmentVirtualMachineScaleSet.go b/sdk/go/azure/maintenance/assignmentVirtualMachineScaleSet.go index 6f73cda55a..9b0bf75d0a 100644 --- a/sdk/go/azure/maintenance/assignmentVirtualMachineScaleSet.go +++ b/sdk/go/azure/maintenance/assignmentVirtualMachineScaleSet.go @@ -15,6 +15,207 @@ import ( // Manages a maintenance assignment to a virtual machine scale set. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleBackendAddressPool, err := lb.NewBackendAddressPool(ctx, "exampleBackendAddressPool", &lb.BackendAddressPoolArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// }) +// if err != nil { +// return err +// } +// exampleProbe, err := lb.NewProbe(ctx, "exampleProbe", &lb.ProbeArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// Port: pulumi.Int(22), +// Protocol: pulumi.String("Tcp"), +// }) +// if err != nil { +// return err +// } +// _, err = lb.NewRule(ctx, "exampleRule", &lb.RuleArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// ProbeId: exampleProbe.ID(), +// FrontendIpConfigurationName: pulumi.String("internal"), +// Protocol: pulumi.String("Tcp"), +// FrontendPort: pulumi.Int(22), +// BackendPort: pulumi.Int(22), +// }) +// if err != nil { +// return err +// } +// exampleConfiguration, err := maintenance.NewConfiguration(ctx, "exampleConfiguration", &maintenance.ConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Scope: pulumi.String("OSImage"), +// Visibility: pulumi.String("Custom"), +// Window: &maintenance.ConfigurationWindowArgs{ +// StartDateTime: pulumi.String("2021-12-31 00:00"), +// ExpirationDateTime: pulumi.String("9999-12-31 00:00"), +// Duration: pulumi.String("06:00"), +// TimeZone: pulumi.String("Pacific Standard Time"), +// RecurEvery: pulumi.String("1Days"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_F2"), +// AdminUsername: pulumi.String("adminuser"), +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard_F2"), +// Instances: pulumi.Int(1), +// AdminUsername: pulumi.String("adminuser"), +// AdminPassword: pulumi.String("P@ssword1234!"), +// UpgradeMode: pulumi.String("Automatic"), +// HealthProbeId: exampleProbe.ID(), +// DisablePasswordAuthentication: pulumi.Bool(false), +// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{ +// StorageAccountType: pulumi.String("Standard_LRS"), +// Caching: pulumi.String("ReadWrite"), +// }, +// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("example"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// Primary: pulumi.Bool(true), +// SubnetId: exampleSubnet.ID(), +// LoadBalancerBackendAddressPoolIds: pulumi.StringArray{ +// exampleBackendAddressPool.ID(), +// }, +// }, +// }, +// }, +// }, +// AutomaticOsUpgradePolicy: &compute.LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyArgs{ +// DisableAutomaticRollback: pulumi.Bool(true), +// EnableAutomaticOsUpgrade: pulumi.Bool(true), +// }, +// RollingUpgradePolicy: &compute.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs{ +// MaxBatchInstancePercent: pulumi.Int(20), +// MaxUnhealthyInstancePercent: pulumi.Int(20), +// MaxUnhealthyUpgradedInstancePercent: pulumi.Int(20), +// PauseTimeBetweenBatches: pulumi.String("PT0S"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// pulumi.Resource("azurerm_lb_rule.example"), +// })) +// if err != nil { +// return err +// } +// _, err = maintenance.NewAssignmentVirtualMachineScaleSet(ctx, "exampleAssignmentVirtualMachineScaleSet", &maintenance.AssignmentVirtualMachineScaleSetArgs{ +// Location: exampleResourceGroup.Location, +// MaintenanceConfigurationId: exampleConfiguration.ID(), +// VirtualMachineScaleSetId: exampleLinuxVirtualMachine.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/maintenance/configuration.go b/sdk/go/azure/maintenance/configuration.go index dbd55b6c67..ac812bc1e7 100644 --- a/sdk/go/azure/maintenance/configuration.go +++ b/sdk/go/azure/maintenance/configuration.go @@ -15,6 +15,44 @@ import ( // Manages a maintenance configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = maintenance.NewConfiguration(ctx, "exampleConfiguration", &maintenance.ConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Scope: pulumi.String("SQLDB"), +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("prod"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Maintenance Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/maintenance/getConfiguration.go b/sdk/go/azure/maintenance/getConfiguration.go index a9692fc8b6..9f60c66986 100644 --- a/sdk/go/azure/maintenance/getConfiguration.go +++ b/sdk/go/azure/maintenance/getConfiguration.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Maintenance Configuration. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := maintenance.LookupConfiguration(ctx, &maintenance.LookupConfigurationArgs{ +// Name: "example-mc", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", azurerm_maintenance_configuration.Existing.Id) +// return nil +// }) +// } +// +// ``` func LookupConfiguration(ctx *pulumi.Context, args *LookupConfigurationArgs, opts ...pulumi.InvokeOption) (*LookupConfigurationResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupConfigurationResult diff --git a/sdk/go/azure/maintenance/getPublicConfigurations.go b/sdk/go/azure/maintenance/getPublicConfigurations.go index 0bc9b57c74..943e0d314f 100644 --- a/sdk/go/azure/maintenance/getPublicConfigurations.go +++ b/sdk/go/azure/maintenance/getPublicConfigurations.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about existing Public Maintenance Configurations. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// existing, err := maintenance.GetPublicConfigurations(ctx, &maintenance.GetPublicConfigurationsArgs{ +// Location: pulumi.StringRef("West Europe"), +// Scope: pulumi.StringRef("SQLManagedInstance"), +// RecurEvery: pulumi.StringRef("Monday-Thursday"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("name", existing.Configs[0].Name) +// return nil +// }) +// } +// +// ``` func GetPublicConfigurations(ctx *pulumi.Context, args *GetPublicConfigurationsArgs, opts ...pulumi.InvokeOption) (*GetPublicConfigurationsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPublicConfigurationsResult diff --git a/sdk/go/azure/managedapplication/application.go b/sdk/go/azure/managedapplication/application.go index 536d65d4ea..4402812a8e 100644 --- a/sdk/go/azure/managedapplication/application.go +++ b/sdk/go/azure/managedapplication/application.go @@ -15,6 +15,92 @@ import ( // Manages a Managed Application. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/managedapplication" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// builtin, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// Name: pulumi.StringRef("Contributor"), +// }, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleDefinition, err := managedapplication.NewDefinition(ctx, "exampleDefinition", &managedapplication.DefinitionArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LockLevel: pulumi.String("ReadOnly"), +// PackageFileUri: pulumi.String("https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip"), +// DisplayName: pulumi.String("TestManagedAppDefinition"), +// Description: pulumi.String("Test Managed App Definition"), +// Authorizations: managedapplication.DefinitionAuthorizationArray{ +// &managedapplication.DefinitionAuthorizationArgs{ +// ServicePrincipalId: *pulumi.String(current.ObjectId), +// RoleDefinitionId: "TODO: call split"[len("TODO: call split")-1], +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = managedapplication.NewApplication(ctx, "exampleApplication", &managedapplication.ApplicationArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.String("ServiceCatalog"), +// ManagedResourceGroupName: pulumi.String("infrastructureGroup"), +// ApplicationDefinitionId: exampleDefinition.ID(), +// ParameterValues: exampleResourceGroup.Location.ApplyT(func(location string) (pulumi.String, error) { +// var _zero pulumi.String +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "location": map[string]interface{}{ +// "value": location, +// }, +// "storageAccountNamePrefix": map[string]interface{}{ +// "value": "storeNamePrefix", +// }, +// "storageAccountType": map[string]interface{}{ +// "value": "Standard_LRS", +// }, +// }) +// if err != nil { +// return _zero, err +// } +// json0 := string(tmpJSON0) +// return pulumi.String(json0), nil +// }).(pulumi.StringOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Managed Application can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/managedapplication/definition.go b/sdk/go/azure/managedapplication/definition.go index 87b7f375d0..270ebb22de 100644 --- a/sdk/go/azure/managedapplication/definition.go +++ b/sdk/go/azure/managedapplication/definition.go @@ -15,6 +15,54 @@ import ( // Manages a Managed Application Definition. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/managedapplication" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = managedapplication.NewDefinition(ctx, "exampleDefinition", &managedapplication.DefinitionArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// LockLevel: pulumi.String("ReadOnly"), +// PackageFileUri: pulumi.String("https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip"), +// DisplayName: pulumi.String("TestManagedApplicationDefinition"), +// Description: pulumi.String("Test Managed Application Definition"), +// Authorizations: managedapplication.DefinitionAuthorizationArray{ +// &managedapplication.DefinitionAuthorizationArgs{ +// ServicePrincipalId: *pulumi.String(current.ObjectId), +// RoleDefinitionId: pulumi.String("a094b430-dad3-424d-ae58-13f72fd72591"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Managed Application Definition can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/managedapplication/getDefinition.go b/sdk/go/azure/managedapplication/getDefinition.go index 8d1f9ec0f5..a9162a1836 100644 --- a/sdk/go/azure/managedapplication/getDefinition.go +++ b/sdk/go/azure/managedapplication/getDefinition.go @@ -13,6 +13,34 @@ import ( ) // Uses this data source to access information about an existing Managed Application Definition. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/managedapplication" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := managedapplication.LookupDefinition(ctx, &managedapplication.LookupDefinitionArgs{ +// Name: "examplemanagedappdef", +// ResourceGroupName: "exampleresources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDefinition(ctx *pulumi.Context, args *LookupDefinitionArgs, opts ...pulumi.InvokeOption) (*LookupDefinitionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDefinitionResult diff --git a/sdk/go/azure/management/getGroup.go b/sdk/go/azure/management/getGroup.go index c908ec269b..10c2cfe31c 100644 --- a/sdk/go/azure/management/getGroup.go +++ b/sdk/go/azure/management/getGroup.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Management Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("displayName", example.DisplayName) +// return nil +// }) +// } +// +// ``` func LookupGroup(ctx *pulumi.Context, args *LookupGroupArgs, opts ...pulumi.InvokeOption) (*LookupGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupGroupResult diff --git a/sdk/go/azure/management/group.go b/sdk/go/azure/management/group.go index e230e92dd1..3bdcead155 100644 --- a/sdk/go/azure/management/group.go +++ b/sdk/go/azure/management/group.go @@ -16,6 +16,50 @@ import ( // // !> **Note:** Configuring `subscriptionIds` is not supported when using the `management.GroupSubscriptionAssociation` resource, results will be unpredictable. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleParent, err := management.NewGroup(ctx, "exampleParent", &management.GroupArgs{ +// DisplayName: pulumi.String("ParentGroup"), +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.SubscriptionId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = management.NewGroup(ctx, "exampleChild", &management.GroupArgs{ +// DisplayName: pulumi.String("ChildGroup"), +// ParentManagementGroupId: exampleParent.ID(), +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.SubscriptionId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/go/azure/management/groupPolicyAssignment.go b/sdk/go/azure/management/groupPolicyAssignment.go index 733df36f30..97af998053 100644 --- a/sdk/go/azure/management/groupPolicyAssignment.go +++ b/sdk/go/azure/management/groupPolicyAssignment.go @@ -15,6 +15,63 @@ import ( // Manages a Policy Assignment to a Management Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.NewGroup(ctx, "exampleGroup", &management.GroupArgs{ +// DisplayName: pulumi.String("Some Management Group"), +// }) +// if err != nil { +// return err +// } +// exampleDefinition, err := policy.NewDefinition(ctx, "exampleDefinition", &policy.DefinitionArgs{ +// PolicyType: pulumi.String("Custom"), +// Mode: pulumi.String("All"), +// DisplayName: pulumi.String("my-policy-definition"), +// ManagementGroupId: exampleGroup.ID(), +// PolicyRule: pulumi.String(` { +// "if": { +// "not": { +// "field": "location", +// "equals": "westeurope" +// } +// }, +// "then": { +// "effect": "Deny" +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// _, err = management.NewGroupPolicyAssignment(ctx, "exampleGroupPolicyAssignment", &management.GroupPolicyAssignmentArgs{ +// PolicyDefinitionId: exampleDefinition.ID(), +// ManagementGroupId: exampleGroup.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Management Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/management/groupPolicyExemption.go b/sdk/go/azure/management/groupPolicyExemption.go index 93fabfaeef..cb6913728f 100644 --- a/sdk/go/azure/management/groupPolicyExemption.go +++ b/sdk/go/azure/management/groupPolicyExemption.go @@ -15,6 +15,58 @@ import ( // Manages a Management Group Policy Exemption. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.NewGroup(ctx, "exampleGroup", &management.GroupArgs{ +// DisplayName: pulumi.String("Example MgmtGroup"), +// }) +// if err != nil { +// return err +// } +// examplePolicySetDefinition, err := policy.LookupPolicySetDefinition(ctx, &policy.LookupPolicySetDefinitionArgs{ +// DisplayName: pulumi.StringRef("Audit machines with insecure password security settings"), +// }, nil) +// if err != nil { +// return err +// } +// exampleGroupPolicyAssignment, err := management.NewGroupPolicyAssignment(ctx, "exampleGroupPolicyAssignment", &management.GroupPolicyAssignmentArgs{ +// ManagementGroupId: exampleGroup.ID(), +// PolicyDefinitionId: *pulumi.String(examplePolicySetDefinition.Id), +// Location: pulumi.String("westus"), +// Identity: &management.GroupPolicyAssignmentIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = management.NewGroupPolicyExemption(ctx, "exampleGroupPolicyExemption", &management.GroupPolicyExemptionArgs{ +// ManagementGroupId: exampleGroup.ID(), +// PolicyAssignmentId: exampleGroupPolicyAssignment.ID(), +// ExemptionCategory: pulumi.String("Mitigated"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/management/groupSubscriptionAssociation.go b/sdk/go/azure/management/groupSubscriptionAssociation.go index 12466f182e..1deef94a8e 100644 --- a/sdk/go/azure/management/groupSubscriptionAssociation.go +++ b/sdk/go/azure/management/groupSubscriptionAssociation.go @@ -17,6 +17,46 @@ import ( // // !> **Note:** When using this resource, configuring `subscriptionIds` on the `management.Group` resource is not supported. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("exampleManagementGroup"), +// }, nil) +// if err != nil { +// return err +// } +// exampleSubscription, err := core.LookupSubscription(ctx, &core.LookupSubscriptionArgs{ +// SubscriptionId: pulumi.StringRef("12345678-1234-1234-1234-123456789012"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = management.NewGroupSubscriptionAssociation(ctx, "exampleGroupSubscriptionAssociation", &management.GroupSubscriptionAssociationArgs{ +// ManagementGroupId: *pulumi.String(exampleGroup.Id), +// SubscriptionId: *pulumi.String(exampleSubscription.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Managements can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/management/groupTemplateDeployment.go b/sdk/go/azure/management/groupTemplateDeployment.go index 60bac88be9..e3d011114e 100644 --- a/sdk/go/azure/management/groupTemplateDeployment.go +++ b/sdk/go/azure/management/groupTemplateDeployment.go @@ -19,6 +19,168 @@ import ( // // > **Note:** Deployments to a Management Group are always Incrementally applied. Existing resources that are not part of the template will not be removed. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = management.NewGroupTemplateDeployment(ctx, "exampleGroupTemplateDeployment", &management.GroupTemplateDeploymentArgs{ +// Location: pulumi.String("West Europe"), +// ManagementGroupId: *pulumi.String(exampleGroup.Id), +// TemplateContent: pulumi.String(`{ +// "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", +// "contentVersion": "1.0.0.0", +// "parameters": { +// "policyAssignmentName": { +// "type": "string", +// "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]", +// "metadata": { +// "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides." +// } +// }, +// "policyDefinitionID": { +// "type": "string", +// "metadata": { +// "description": "Specifies the ID of the policy definition or policy set definition being assigned." +// } +// } +// }, +// "resources": [ +// { +// "type": "Microsoft.Authorization/policyAssignments", +// "name": "[parameters('policyAssignmentName')]", +// "apiVersion": "2019-09-01", +// "properties": { +// "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]", +// "policyDefinitionId": "[parameters('policyDefinitionID')]" +// } +// } +// ] +// } +// +// `), +// +// ParametersContent: pulumi.String(`{ +// "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", +// "contentVersion": "1.0.0.0", +// "parameters": { +// "policyDefinitionID": { +// "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a" +// } +// } +// } +// +// `), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = management.NewGroupTemplateDeployment(ctx, "exampleGroupTemplateDeployment", &management.GroupTemplateDeploymentArgs{ +// Location: pulumi.String("West Europe"), +// ManagementGroupId: *pulumi.String(exampleGroup.Id), +// TemplateContent: readFileOrPanic("templates/example-deploy-template.json"), +// ParametersContent: readFileOrPanic("templates/example-deploy-params.json"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// exampleTemplateSpecVersion, err := core.GetTemplateSpecVersion(ctx, &core.GetTemplateSpecVersionArgs{ +// Name: "exampleTemplateForManagementGroup", +// ResourceGroupName: "exampleResourceGroup", +// Version: "v1.0.9", +// }, nil) +// if err != nil { +// return err +// } +// _, err = management.NewGroupTemplateDeployment(ctx, "exampleGroupTemplateDeployment", &management.GroupTemplateDeploymentArgs{ +// Location: pulumi.String("West Europe"), +// ManagementGroupId: *pulumi.String(exampleGroup.Id), +// TemplateSpecVersionId: *pulumi.String(exampleTemplateSpecVersion.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Management Group Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/management/lock.go b/sdk/go/azure/management/lock.go index 052a9a6603..853c9634e7 100644 --- a/sdk/go/azure/management/lock.go +++ b/sdk/go/azure/management/lock.go @@ -16,6 +16,116 @@ import ( // Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. // // ## Example Usage +// ### Subscription Level Lock) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = management.NewLock(ctx, "subscription-level", &management.LockArgs{ +// Scope: *pulumi.String(current.Id), +// LockLevel: pulumi.String("CanNotDelete"), +// Notes: pulumi.String("Items can't be deleted in this subscription!"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Resource Group Level Lock) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = management.NewLock(ctx, "resource-group-level", &management.LockArgs{ +// Scope: example.ID(), +// LockLevel: pulumi.String("ReadOnly"), +// Notes: pulumi.String("This Resource Group is Read-Only"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Resource Level Lock) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// IdleTimeoutInMinutes: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// _, err = management.NewLock(ctx, "public-ip", &management.LockArgs{ +// Scope: examplePublicIp.ID(), +// LockLevel: pulumi.String("CanNotDelete"), +// Notes: pulumi.String("Locked because it's needed by a third-party"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/management/privateLink.go b/sdk/go/azure/management/privateLink.go index 6c242ebcae..4c47d11acf 100644 --- a/sdk/go/azure/management/privateLink.go +++ b/sdk/go/azure/management/privateLink.go @@ -15,6 +15,40 @@ import ( // Manages a Resource Management Private Link to restrict access for managing resources in the tenant. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = management.NewPrivateLink(ctx, "examplePrivateLink", &management.PrivateLinkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing Resource Management Private Link can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/go/azure/managementgroups/getManagementGroup.go b/sdk/go/azure/managementgroups/getManagementGroup.go index 4ad2fb14a7..64a25ab6c2 100644 --- a/sdk/go/azure/managementgroups/getManagementGroup.go +++ b/sdk/go/azure/managementgroups/getManagementGroup.go @@ -14,6 +14,33 @@ import ( // Use this data source to access information about an existing Management Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("displayName", example.DisplayName) +// return nil +// }) +// } +// +// ``` +// // Deprecated: azure.managementgroups.getManagementGroup has been deprecated in favor of azure.management.getGroup func LookupManagementGroup(ctx *pulumi.Context, args *LookupManagementGroupArgs, opts ...pulumi.InvokeOption) (*LookupManagementGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) diff --git a/sdk/go/azure/managementgroups/managementGroup.go b/sdk/go/azure/managementgroups/managementGroup.go index 201febc135..2fcf452377 100644 --- a/sdk/go/azure/managementgroups/managementGroup.go +++ b/sdk/go/azure/managementgroups/managementGroup.go @@ -16,6 +16,50 @@ import ( // // !> **Note:** Configuring `subscriptionIds` is not supported when using the `management.GroupSubscriptionAssociation` resource, results will be unpredictable. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleParent, err := management.NewGroup(ctx, "exampleParent", &management.GroupArgs{ +// DisplayName: pulumi.String("ParentGroup"), +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.SubscriptionId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = management.NewGroup(ctx, "exampleChild", &management.GroupArgs{ +// DisplayName: pulumi.String("ChildGroup"), +// ParentManagementGroupId: exampleParent.ID(), +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.SubscriptionId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/go/azure/managementresource/manangementLock.go b/sdk/go/azure/managementresource/manangementLock.go index 111aae7b73..c70548710d 100644 --- a/sdk/go/azure/managementresource/manangementLock.go +++ b/sdk/go/azure/managementresource/manangementLock.go @@ -16,6 +16,116 @@ import ( // Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. // // ## Example Usage +// ### Subscription Level Lock) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = management.NewLock(ctx, "subscription-level", &management.LockArgs{ +// Scope: *pulumi.String(current.Id), +// LockLevel: pulumi.String("CanNotDelete"), +// Notes: pulumi.String("Items can't be deleted in this subscription!"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Resource Group Level Lock) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = management.NewLock(ctx, "resource-group-level", &management.LockArgs{ +// Scope: example.ID(), +// LockLevel: pulumi.String("ReadOnly"), +// Notes: pulumi.String("This Resource Group is Read-Only"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Resource Level Lock) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// IdleTimeoutInMinutes: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// _, err = management.NewLock(ctx, "public-ip", &management.LockArgs{ +// Scope: examplePublicIp.ID(), +// LockLevel: pulumi.String("CanNotDelete"), +// Notes: pulumi.String("Locked because it's needed by a third-party"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/maps/account.go b/sdk/go/azure/maps/account.go index b79887e8fc..b6076f5faa 100644 --- a/sdk/go/azure/maps/account.go +++ b/sdk/go/azure/maps/account.go @@ -15,6 +15,44 @@ import ( // Manages an Azure Maps Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = maps.NewAccount(ctx, "exampleAccount", &maps.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("S1"), +// LocalAuthenticationEnabled: pulumi.Bool(true), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Maps Account can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/maps/creator.go b/sdk/go/azure/maps/creator.go index ad0450c5c8..7c0416637f 100644 --- a/sdk/go/azure/maps/creator.go +++ b/sdk/go/azure/maps/creator.go @@ -15,6 +15,54 @@ import ( // Manages an Azure Maps Creator. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := maps.NewAccount(ctx, "exampleAccount", &maps.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("G2"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = maps.NewCreator(ctx, "exampleCreator", &maps.CreatorArgs{ +// MapsAccountId: exampleAccount.ID(), +// Location: exampleResourceGroup.Location, +// StorageUnits: pulumi.Int(1), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Test"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An Azure Maps Creators can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/maps/getAccount.go b/sdk/go/azure/maps/getAccount.go index 3e336183a9..3ba52597fc 100644 --- a/sdk/go/azure/maps/getAccount.go +++ b/sdk/go/azure/maps/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Azure Maps Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maps" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := maps.LookupAccount(ctx, &maps.LookupAccountArgs{ +// Name: "production", +// ResourceGroupName: "maps", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("mapsAccountId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/mariadb/configuration.go b/sdk/go/azure/mariadb/configuration.go index 6072f832e8..038794b17d 100644 --- a/sdk/go/azure/mariadb/configuration.go +++ b/sdk/go/azure/mariadb/configuration.go @@ -15,6 +15,54 @@ import ( // Sets a MariaDB Configuration value on a MariaDB Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mariadb.NewServer(ctx, "exampleServer", &mariadb.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("B_Gen5_2"), +// SslEnforcementEnabled: pulumi.Bool(true), +// AdministratorLogin: pulumi.String("mariadbadmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Version: pulumi.String("10.2"), +// }) +// if err != nil { +// return err +// } +// _, err = mariadb.NewConfiguration(ctx, "exampleConfiguration", &mariadb.ConfigurationArgs{ +// Name: pulumi.String("interactive_timeout"), +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Value: pulumi.String("600"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MariaDB Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mariadb/database.go b/sdk/go/azure/mariadb/database.go index 44c12c16ee..431ee220aa 100644 --- a/sdk/go/azure/mariadb/database.go +++ b/sdk/go/azure/mariadb/database.go @@ -15,6 +15,57 @@ import ( // Manages a MariaDB Database within a MariaDB Server // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mariadb.NewServer(ctx, "exampleServer", &mariadb.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(51200), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(false), +// AdministratorLogin: pulumi.String("acctestun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Version: pulumi.String("10.2"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = mariadb.NewDatabase(ctx, "exampleDatabase", &mariadb.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Charset: pulumi.String("utf8mb4"), +// Collation: pulumi.String("utf8mb4_unicode_520_ci"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MariaDB Database's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mariadb/firewallRule.go b/sdk/go/azure/mariadb/firewallRule.go index f06f5b0809..e877c1981b 100644 --- a/sdk/go/azure/mariadb/firewallRule.go +++ b/sdk/go/azure/mariadb/firewallRule.go @@ -16,6 +16,62 @@ import ( // Manages a Firewall Rule for a MariaDB Server // // ## Example Usage +// ### Single IP Address) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mariadb.NewFirewallRule(ctx, "example", &mariadb.FirewallRuleArgs{ +// EndIpAddress: pulumi.String("40.112.8.12"), +// ResourceGroupName: pulumi.String("test-rg"), +// ServerName: pulumi.String("test-server"), +// StartIpAddress: pulumi.String("40.112.8.12"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### IP Range) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mariadb.NewFirewallRule(ctx, "example", &mariadb.FirewallRuleArgs{ +// EndIpAddress: pulumi.String("40.112.255.255"), +// ResourceGroupName: pulumi.String("test-rg"), +// ServerName: pulumi.String("test-server"), +// StartIpAddress: pulumi.String("40.112.0.0"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/mariadb/getMariaDbServer.go b/sdk/go/azure/mariadb/getMariaDbServer.go index e996a2eb22..280da2f260 100644 --- a/sdk/go/azure/mariadb/getMariaDbServer.go +++ b/sdk/go/azure/mariadb/getMariaDbServer.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing MariaDB Server. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mariadb.GetMariaDbServer(ctx, &mariadb.GetMariaDbServerArgs{ +// Name: "mariadb-server", +// ResourceGroupName: azurerm_mariadb_server.Example.Resource_group_name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("mariadbServerId", data.Azurerm_mariadb_server.Example.Id) +// return nil +// }) +// } +// +// ``` func GetMariaDbServer(ctx *pulumi.Context, args *GetMariaDbServerArgs, opts ...pulumi.InvokeOption) (*GetMariaDbServerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetMariaDbServerResult diff --git a/sdk/go/azure/mariadb/server.go b/sdk/go/azure/mariadb/server.go index 5ca76a1fec..ae2912a38a 100644 --- a/sdk/go/azure/mariadb/server.go +++ b/sdk/go/azure/mariadb/server.go @@ -15,6 +15,51 @@ import ( // Manages a MariaDB Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = mariadb.NewServer(ctx, "exampleServer", &mariadb.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mariadbadmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// Version: pulumi.String("10.2"), +// AutoGrowEnabled: pulumi.Bool(true), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(false), +// PublicNetworkAccessEnabled: pulumi.Bool(false), +// SslEnforcementEnabled: pulumi.Bool(true), +// SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MariaDB Server's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mariadb/virtualNetworkRule.go b/sdk/go/azure/mariadb/virtualNetworkRule.go index fe7fbe9211..9be1081713 100644 --- a/sdk/go/azure/mariadb/virtualNetworkRule.go +++ b/sdk/go/azure/mariadb/virtualNetworkRule.go @@ -17,6 +17,77 @@ import ( // // > **NOTE:** MariaDB Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mariadb/concepts-data-access-security-vnet) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mariadb.NewServer(ctx, "exampleServer", &mariadb.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mariadbadminun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Version: pulumi.String("10.2"), +// SslEnforcementEnabled: pulumi.Bool(true), +// SkuName: pulumi.String("GP_Gen5_2"), +// }) +// if err != nil { +// return err +// } +// _, err = mariadb.NewVirtualNetworkRule(ctx, "exampleVirtualNetworkRule", &mariadb.VirtualNetworkRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// SubnetId: internal.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MariaDB Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/marketplace/agreement.go b/sdk/go/azure/marketplace/agreement.go index 9ba5f7a0ea..135a91eb6d 100644 --- a/sdk/go/azure/marketplace/agreement.go +++ b/sdk/go/azure/marketplace/agreement.go @@ -15,6 +15,34 @@ import ( // Allows accepting the Legal Terms for a Marketplace Image. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/marketplace" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := marketplace.NewAgreement(ctx, "barracuda", &marketplace.AgreementArgs{ +// Offer: pulumi.String("waf"), +// Plan: pulumi.String("hourly"), +// Publisher: pulumi.String("barracudanetworks"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Marketplace Agreement can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/marketplace/getAgreement.go b/sdk/go/azure/marketplace/getAgreement.go index 34ecac56b9..8a3bc24a49 100644 --- a/sdk/go/azure/marketplace/getAgreement.go +++ b/sdk/go/azure/marketplace/getAgreement.go @@ -13,6 +13,35 @@ import ( ) // Uses this data source to access information about an existing Marketplace Agreement. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/marketplace" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := marketplace.LookupAgreement(ctx, &marketplace.LookupAgreementArgs{ +// Publisher: "barracudanetworks", +// Offer: "waf", +// Plan: "hourly", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("azurermMarketplaceAgreementId", data.Azurerm_marketplace_agreement.Id) +// return nil +// }) +// } +// +// ``` func LookupAgreement(ctx *pulumi.Context, args *LookupAgreementArgs, opts ...pulumi.InvokeOption) (*LookupAgreementResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAgreementResult diff --git a/sdk/go/azure/media/accountFilter.go b/sdk/go/azure/media/accountFilter.go index e33b089221..b0ace8432f 100644 --- a/sdk/go/azure/media/accountFilter.go +++ b/sdk/go/azure/media/accountFilter.go @@ -15,6 +15,107 @@ import ( // Manages a Media Services Account Filter. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// _, err = media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewAccountFilter(ctx, "exampleAccountFilter", &media.AccountFilterArgs{ +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// MediaServicesAccountName: pulumi.Any(azurerm_media_services_account.Test.Name), +// FirstQualityBitrate: pulumi.Int(128000), +// PresentationTimeRange: &media.AccountFilterPresentationTimeRangeArgs{ +// StartInUnits: pulumi.Int(0), +// EndInUnits: pulumi.Int(15), +// PresentationWindowInUnits: pulumi.Int(90), +// LiveBackoffInUnits: pulumi.Int(0), +// UnitTimescaleInMilliseconds: pulumi.Int(1000), +// ForceEnd: pulumi.Bool(false), +// }, +// TrackSelections: media.AccountFilterTrackSelectionArray{ +// &media.AccountFilterTrackSelectionArgs{ +// Conditions: media.AccountFilterTrackSelectionConditionArray{ +// &media.AccountFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Type"), +// Operation: pulumi.String("Equal"), +// Value: pulumi.String("Audio"), +// }, +// &media.AccountFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Language"), +// Operation: pulumi.String("NotEqual"), +// Value: pulumi.String("en"), +// }, +// &media.AccountFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("FourCC"), +// Operation: pulumi.String("NotEqual"), +// Value: pulumi.String("EC-3"), +// }, +// }, +// }, +// &media.AccountFilterTrackSelectionArgs{ +// Conditions: media.AccountFilterTrackSelectionConditionArray{ +// &media.AccountFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Type"), +// Operation: pulumi.String("Equal"), +// Value: pulumi.String("Video"), +// }, +// &media.AccountFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Bitrate"), +// Operation: pulumi.String("Equal"), +// Value: pulumi.String("3000000-5000000"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Account Filters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/asset.go b/sdk/go/azure/media/asset.go index 350186f672..f3cef68db7 100644 --- a/sdk/go/azure/media/asset.go +++ b/sdk/go/azure/media/asset.go @@ -15,6 +15,64 @@ import ( // Manages a Media Asset. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewAsset(ctx, "exampleAsset", &media.AssetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("Asset description"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Media Assets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/assetFilter.go b/sdk/go/azure/media/assetFilter.go index 5bd6cd5af4..9814a330ae 100644 --- a/sdk/go/azure/media/assetFilter.go +++ b/sdk/go/azure/media/assetFilter.go @@ -15,6 +15,114 @@ import ( // Manages an Azure Media Asset Filter. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleAsset, err := media.NewAsset(ctx, "exampleAsset", &media.AssetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("Asset description"), +// }) +// if err != nil { +// return err +// } +// _, err = media.NewAssetFilter(ctx, "exampleAssetFilter", &media.AssetFilterArgs{ +// AssetId: exampleAsset.ID(), +// FirstQualityBitrate: pulumi.Int(128000), +// PresentationTimeRange: &media.AssetFilterPresentationTimeRangeArgs{ +// StartInUnits: pulumi.Int(0), +// EndInUnits: pulumi.Int(15), +// PresentationWindowInUnits: pulumi.Int(90), +// LiveBackoffInUnits: pulumi.Int(0), +// UnitTimescaleInMiliseconds: pulumi.Int(1000), +// ForceEnd: pulumi.Bool(false), +// }, +// TrackSelections: media.AssetFilterTrackSelectionArray{ +// &media.AssetFilterTrackSelectionArgs{ +// Conditions: media.AssetFilterTrackSelectionConditionArray{ +// &media.AssetFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Type"), +// Operation: pulumi.String("Equal"), +// Value: pulumi.String("Audio"), +// }, +// &media.AssetFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Language"), +// Operation: pulumi.String("NotEqual"), +// Value: pulumi.String("en"), +// }, +// &media.AssetFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("FourCC"), +// Operation: pulumi.String("NotEqual"), +// Value: pulumi.String("EC-3"), +// }, +// }, +// }, +// &media.AssetFilterTrackSelectionArgs{ +// Conditions: media.AssetFilterTrackSelectionConditionArray{ +// &media.AssetFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Type"), +// Operation: pulumi.String("Equal"), +// Value: pulumi.String("Video"), +// }, +// &media.AssetFilterTrackSelectionConditionArgs{ +// Property: pulumi.String("Bitrate"), +// Operation: pulumi.String("Equal"), +// Value: pulumi.String("3000000-5000000"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Asset Filters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/contentKeyPolicy.go b/sdk/go/azure/media/contentKeyPolicy.go index 5df21447f5..0f6111ba66 100644 --- a/sdk/go/azure/media/contentKeyPolicy.go +++ b/sdk/go/azure/media/contentKeyPolicy.go @@ -15,6 +15,153 @@ import ( // Manages a Content Key Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "allowed_track_types": "SD_HD", +// "content_key_specs": []map[string]interface{}{ +// map[string]interface{}{ +// "track_type": "SD", +// "security_level": 1, +// "required_output_protection": map[string]interface{}{ +// "hdcp": "HDCP_V2", +// }, +// }, +// }, +// "policy_overrides": map[string]interface{}{ +// "can_play": true, +// "can_persist": true, +// "can_renew": false, +// }, +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = media.NewContentKeyPolicy(ctx, "exampleContentKeyPolicy", &media.ContentKeyPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// PolicyOptions: media.ContentKeyPolicyPolicyOptionArray{ +// &media.ContentKeyPolicyPolicyOptionArgs{ +// Name: pulumi.String("fairPlay"), +// FairplayConfiguration: &media.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs{ +// Ask: pulumi.String("bb566284cc124a21c435a92cd3c108c4"), +// Pfx: pulumi.String("MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A="), +// PfxPassword: pulumi.String("password"), +// RentalDurationSeconds: pulumi.Int(2249), +// RentalAndLeaseKeyType: pulumi.String("PersistentUnlimited"), +// }, +// OpenRestrictionEnabled: pulumi.Bool(true), +// }, +// &media.ContentKeyPolicyPolicyOptionArgs{ +// Name: pulumi.String("playReady"), +// PlayreadyConfigurationLicenses: media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicenseArray{ +// &media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicenseArgs{ +// AllowTestDevices: pulumi.Bool(true), +// BeginDate: pulumi.String("2017-10-16T18:22:53Z"), +// SecurityLevel: pulumi.String("SL150"), +// PlayRight: &media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightArgs{ +// ScmsRestriction: pulumi.Int(2), +// DigitalVideoOnlyContentRestriction: pulumi.Bool(false), +// ImageConstraintForAnalogComponentVideoRestriction: pulumi.Bool(false), +// ImageConstraintForAnalogComputerMonitorRestriction: pulumi.Bool(false), +// AllowPassingVideoContentToUnknownOutput: pulumi.String("NotAllowed"), +// UncompressedDigitalVideoOpl: pulumi.Int(100), +// UncompressedDigitalAudioOpl: pulumi.Int(100), +// AnalogVideoOpl: pulumi.Int(150), +// CompressedDigitalAudioOpl: pulumi.Int(250), +// CompressedDigitalVideoOpl: pulumi.Int(400), +// ExplicitAnalogTelevisionOutputRestriction: &media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightExplicitAnalogTelevisionOutputRestrictionArgs{ +// BestEffortEnforced: pulumi.Bool(true), +// ControlBits: pulumi.Int(3), +// }, +// }, +// LicenseType: pulumi.String("Persistent"), +// ContentType: pulumi.String("UltraVioletDownload"), +// ContentKeyLocationFromHeaderEnabled: pulumi.Bool(true), +// }, +// }, +// OpenRestrictionEnabled: pulumi.Bool(true), +// }, +// &media.ContentKeyPolicyPolicyOptionArgs{ +// Name: pulumi.String("clearKey"), +// ClearKeyConfigurationEnabled: pulumi.Bool(true), +// TokenRestriction: &media.ContentKeyPolicyPolicyOptionTokenRestrictionArgs{ +// Issuer: pulumi.String("urn:issuer"), +// Audience: pulumi.String("urn:audience"), +// TokenType: pulumi.String("Swt"), +// PrimarySymmetricTokenKey: pulumi.String("AAAAAAAAAAAAAAAAAAAAAA=="), +// AlternateKeys: media.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArray{ +// &media.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs{ +// RsaTokenKeyExponent: pulumi.String("AQAB"), +// RsaTokenKeyModulus: pulumi.String("AQAD"), +// }, +// &media.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs{ +// SymmetricTokenKey: pulumi.String("BBAAAAAAAAAAAAAAAAAAAA=="), +// }, +// }, +// }, +// }, +// &media.ContentKeyPolicyPolicyOptionArgs{ +// Name: pulumi.String("widevine"), +// WidevineConfigurationTemplate: pulumi.String(json0), +// OpenRestrictionEnabled: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Content Key Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/job.go b/sdk/go/azure/media/job.go index b8b88b893a..dc37359c1c 100644 --- a/sdk/go/azure/media/job.go +++ b/sdk/go/azure/media/job.go @@ -15,6 +15,107 @@ import ( // Manages a Media Job. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleTransform, err := media.NewTransform(ctx, "exampleTransform", &media.TransformArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("My transform description"), +// Outputs: media.TransformOutputTypeArray{ +// &media.TransformOutputTypeArgs{ +// RelativePriority: pulumi.String("Normal"), +// OnErrorAction: pulumi.String("ContinueJob"), +// BuiltinPreset: &media.TransformOutputBuiltinPresetArgs{ +// PresetName: pulumi.String("AACGoodQualityAudio"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// input, err := media.NewAsset(ctx, "input", &media.AssetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("Input Asset description"), +// }) +// if err != nil { +// return err +// } +// output, err := media.NewAsset(ctx, "output", &media.AssetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("Output Asset description"), +// }) +// if err != nil { +// return err +// } +// _, err = media.NewJob(ctx, "exampleJob", &media.JobArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// TransformName: exampleTransform.Name, +// Description: pulumi.String("My Job description"), +// Priority: pulumi.String("Normal"), +// InputAsset: &media.JobInputAssetArgs{ +// Name: input.Name, +// }, +// OutputAssets: media.JobOutputAssetArray{ +// &media.JobOutputAssetArgs{ +// Name: output.Name, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Media Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/liveEvent.go b/sdk/go/azure/media/liveEvent.go index 79a5e35b2d..a7b7fddd7d 100644 --- a/sdk/go/azure/media/liveEvent.go +++ b/sdk/go/azure/media/liveEvent.go @@ -15,6 +15,98 @@ import ( // Manages a Live Event. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewLiveEvent(ctx, "exampleLiveEvent", &media.LiveEventArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("My Event Description"), +// Input: &media.LiveEventInputTypeArgs{ +// StreamingProtocol: pulumi.String("RTMP"), +// IpAccessControlAllows: media.LiveEventInputIpAccessControlAllowArray{ +// &media.LiveEventInputIpAccessControlAllowArgs{ +// Name: pulumi.String("AllowAll"), +// Address: pulumi.String("0.0.0.0"), +// SubnetPrefixLength: pulumi.Int(0), +// }, +// }, +// }, +// Encoding: &media.LiveEventEncodingArgs{ +// Type: pulumi.String("Standard"), +// PresetName: pulumi.String("Default720p"), +// StretchMode: pulumi.String("AutoFit"), +// KeyFrameInterval: pulumi.String("PT2S"), +// }, +// Preview: &media.LiveEventPreviewArgs{ +// IpAccessControlAllows: media.LiveEventPreviewIpAccessControlAllowArray{ +// &media.LiveEventPreviewIpAccessControlAllowArgs{ +// Name: pulumi.String("AllowAll"), +// Address: pulumi.String("0.0.0.0"), +// SubnetPrefixLength: pulumi.Int(0), +// }, +// }, +// }, +// StreamOptions: pulumi.StringArray{ +// pulumi.String("LowLatency"), +// }, +// UseStaticHostname: pulumi.Bool(true), +// HostnamePrefix: pulumi.String("special-event"), +// TranscriptionLanguages: pulumi.StringArray{ +// pulumi.String("en-US"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Live Events can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/liveEventOutput.go b/sdk/go/azure/media/liveEventOutput.go index bad4a74896..d8cfdb2c86 100644 --- a/sdk/go/azure/media/liveEventOutput.go +++ b/sdk/go/azure/media/liveEventOutput.go @@ -15,6 +15,96 @@ import ( // Manages a Azure Media Live Event Output. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleAsset, err := media.NewAsset(ctx, "exampleAsset", &media.AssetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleLiveEvent, err := media.NewLiveEvent(ctx, "exampleLiveEvent", &media.LiveEventArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("My Event Description"), +// Input: &media.LiveEventInputTypeArgs{ +// StreamingProtocol: pulumi.String("RTMP"), +// KeyFrameIntervalDuration: pulumi.String("PT6S"), +// IpAccessControlAllows: media.LiveEventInputIpAccessControlAllowArray{ +// &media.LiveEventInputIpAccessControlAllowArgs{ +// Name: pulumi.String("AllowAll"), +// Address: pulumi.String("0.0.0.0"), +// SubnetPrefixLength: pulumi.Int(0), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewLiveEventOutput(ctx, "exampleLiveEventOutput", &media.LiveEventOutputArgs{ +// LiveEventId: exampleLiveEvent.ID(), +// ArchiveWindowDuration: pulumi.String("PT5M"), +// AssetName: exampleAsset.Name, +// Description: pulumi.String("Test live output 1"), +// ManifestName: pulumi.String("testmanifest"), +// OutputSnapTimeInSeconds: pulumi.Int(0), +// HlsFragmentsPerTsSegment: pulumi.Int(5), +// RewindWindowDuration: pulumi.String("PT5M"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Live Outputs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/serviceAccount.go b/sdk/go/azure/media/serviceAccount.go index 94c36fc692..d26f8d2f01 100644 --- a/sdk/go/azure/media/serviceAccount.go +++ b/sdk/go/azure/media/serviceAccount.go @@ -15,6 +15,56 @@ import ( // Manages a Media Services Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// _, err = media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/streamingEndpoint.go b/sdk/go/azure/media/streamingEndpoint.go index 0b9629534b..a5f7722bda 100644 --- a/sdk/go/azure/media/streamingEndpoint.go +++ b/sdk/go/azure/media/streamingEndpoint.go @@ -15,6 +15,147 @@ import ( // Manages a Streaming Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewStreamingEndpoint(ctx, "exampleStreamingEndpoint", &media.StreamingEndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MediaServicesAccountName: exampleServiceAccount.Name, +// ScaleUnits: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Access Control +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewStreamingEndpoint(ctx, "exampleStreamingEndpoint", &media.StreamingEndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MediaServicesAccountName: exampleServiceAccount.Name, +// ScaleUnits: pulumi.Int(2), +// AccessControl: &media.StreamingEndpointAccessControlArgs{ +// IpAllows: media.StreamingEndpointAccessControlIpAllowArray{ +// &media.StreamingEndpointAccessControlIpAllowArgs{ +// Name: pulumi.String("AllowedIP"), +// Address: pulumi.String("192.168.1.1"), +// }, +// &media.StreamingEndpointAccessControlIpAllowArgs{ +// Name: pulumi.String("AnotherIp"), +// Address: pulumi.String("192.168.1.2"), +// }, +// }, +// AkamaiSignatureHeaderAuthenticationKeys: media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArray{ +// &media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs{ +// Identifier: pulumi.String("id1"), +// Expiration: pulumi.String("2030-12-31T16:00:00Z"), +// Base64Key: pulumi.String("dGVzdGlkMQ=="), +// }, +// &media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs{ +// Identifier: pulumi.String("id2"), +// Expiration: pulumi.String("2032-01-28T16:00:00Z"), +// Base64Key: pulumi.String("dGVzdGlkMQ=="), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Streaming Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/streamingLocator.go b/sdk/go/azure/media/streamingLocator.go index 3234ddf59c..006be19d98 100644 --- a/sdk/go/azure/media/streamingLocator.go +++ b/sdk/go/azure/media/streamingLocator.go @@ -15,6 +15,83 @@ import ( // Manages a Media Streaming Locator. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccountFilter, err := media.NewAccountFilter(ctx, "exampleAccountFilter", &media.AccountFilterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleAsset, err := media.NewAsset(ctx, "exampleAsset", &media.AssetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("Asset description"), +// }) +// if err != nil { +// return err +// } +// _, err = media.NewStreamingLocator(ctx, "exampleStreamingLocator", &media.StreamingLocatorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// AssetName: exampleAsset.Name, +// StreamingPolicyName: pulumi.String("Predefined_ClearStreamingOnly"), +// FilterNames: pulumi.StringArray{ +// exampleAccountFilter.Name, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Streaming Locators can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/streamingPolicy.go b/sdk/go/azure/media/streamingPolicy.go index 8c4a757e59..f19606c917 100644 --- a/sdk/go/azure/media/streamingPolicy.go +++ b/sdk/go/azure/media/streamingPolicy.go @@ -15,6 +15,123 @@ import ( // Manages a Streaming Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleContentKeyPolicy, err := media.NewContentKeyPolicy(ctx, "exampleContentKeyPolicy", &media.ContentKeyPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// PolicyOptions: media.ContentKeyPolicyPolicyOptionArray{ +// &media.ContentKeyPolicyPolicyOptionArgs{ +// Name: pulumi.String("fairPlay"), +// FairplayConfiguration: &media.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs{ +// Ask: pulumi.String("bb566284cc124a21c435a92cd3c108c4"), +// Pfx: pulumi.String("MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A="), +// PfxPassword: pulumi.String("password"), +// RentalDurationSeconds: pulumi.Int(2249), +// RentalAndLeaseKeyType: pulumi.String("PersistentUnlimited"), +// }, +// OpenRestrictionEnabled: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewStreamingPolicy(ctx, "exampleStreamingPolicy", &media.StreamingPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// CommonEncryptionCenc: &media.StreamingPolicyCommonEncryptionCencArgs{ +// ClearTracks: media.StreamingPolicyCommonEncryptionCencClearTrackArray{ +// &media.StreamingPolicyCommonEncryptionCencClearTrackArgs{ +// Conditions: media.StreamingPolicyCommonEncryptionCencClearTrackConditionArray{ +// &media.StreamingPolicyCommonEncryptionCencClearTrackConditionArgs{ +// Property: pulumi.String("FourCC"), +// Operation: pulumi.String("Equal"), +// Value: pulumi.String("hev2"), +// }, +// }, +// }, +// }, +// EnabledProtocols: &media.StreamingPolicyCommonEncryptionCencEnabledProtocolsArgs{ +// Download: pulumi.Bool(false), +// Dash: pulumi.Bool(true), +// Hls: pulumi.Bool(false), +// SmoothStreaming: pulumi.Bool(false), +// }, +// DefaultContentKey: &media.StreamingPolicyCommonEncryptionCencDefaultContentKeyArgs{ +// Label: pulumi.String("aesDefaultKey"), +// PolicyName: exampleContentKeyPolicy.Name, +// }, +// DrmPlayready: &media.StreamingPolicyCommonEncryptionCencDrmPlayreadyArgs{ +// CustomLicenseAcquisitionUrlTemplate: pulumi.String("https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}"), +// CustomAttributes: pulumi.String("PlayReady CustomAttributes"), +// }, +// DrmWidevineCustomLicenseAcquisitionUrlTemplate: pulumi.String("https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId}"), +// }, +// CommonEncryptionCbcs: &media.StreamingPolicyCommonEncryptionCbcsArgs{ +// EnabledProtocols: &media.StreamingPolicyCommonEncryptionCbcsEnabledProtocolsArgs{ +// Download: pulumi.Bool(false), +// Dash: pulumi.Bool(true), +// Hls: pulumi.Bool(false), +// SmoothStreaming: pulumi.Bool(false), +// }, +// DrmFairplay: &media.StreamingPolicyCommonEncryptionCbcsDrmFairplayArgs{ +// CustomLicenseAcquisitionUrlTemplate: pulumi.String("https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}"), +// AllowPersistentLicense: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Streaming Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/media/transform.go b/sdk/go/azure/media/transform.go index 6977e123a8..51dc8c8572 100644 --- a/sdk/go/azure/media/transform.go +++ b/sdk/go/azure/media/transform.go @@ -15,6 +15,409 @@ import ( // Manages a Transform. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewTransform(ctx, "exampleTransform", &media.TransformArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("My transform description"), +// Outputs: media.TransformOutputTypeArray{ +// &media.TransformOutputTypeArgs{ +// RelativePriority: pulumi.String("Normal"), +// OnErrorAction: pulumi.String("ContinueJob"), +// BuiltinPreset: &media.TransformOutputBuiltinPresetArgs{ +// PresetName: pulumi.String("AACGoodQualityAudio"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Multiple Outputs +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleServiceAccount, err := media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = media.NewTransform(ctx, "exampleTransform", &media.TransformArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// MediaServicesAccountName: exampleServiceAccount.Name, +// Description: pulumi.String("My transform description"), +// Outputs: media.TransformOutputTypeArray{ +// &media.TransformOutputTypeArgs{ +// RelativePriority: pulumi.String("Normal"), +// OnErrorAction: pulumi.String("ContinueJob"), +// BuiltinPreset: &media.TransformOutputBuiltinPresetArgs{ +// PresetName: pulumi.String("AACGoodQualityAudio"), +// PresetConfiguration: &media.TransformOutputBuiltinPresetPresetConfigurationArgs{ +// Complexity: pulumi.String("Balanced"), +// InterleaveOutput: pulumi.String("NonInterleavedOutput"), +// KeyFrameIntervalInSeconds: pulumi.Float64(123122.5), +// MaxBitrateBps: pulumi.Int(300000), +// MaxHeight: pulumi.Int(480), +// MaxLayers: pulumi.Int(14), +// MinBitrateBps: pulumi.Int(200000), +// MinHeight: pulumi.Int(360), +// }, +// }, +// }, +// &media.TransformOutputTypeArgs{ +// RelativePriority: pulumi.String("Low"), +// OnErrorAction: pulumi.String("ContinueJob"), +// AudioAnalyzerPreset: &media.TransformOutputAudioAnalyzerPresetArgs{ +// AudioLanguage: pulumi.String("en-US"), +// AudioAnalysisMode: pulumi.String("Basic"), +// ExperimentalOptions: pulumi.StringMap{ +// "env": pulumi.String("test"), +// }, +// }, +// }, +// &media.TransformOutputTypeArgs{ +// RelativePriority: pulumi.String("Low"), +// OnErrorAction: pulumi.String("StopProcessingJob"), +// FaceDetectorPreset: &media.TransformOutputFaceDetectorPresetArgs{ +// AnalysisResolution: pulumi.String("StandardDefinition"), +// BlurType: pulumi.String("Med"), +// FaceRedactorMode: pulumi.String("Combined"), +// ExperimentalOptions: pulumi.StringMap{ +// "env": pulumi.String("test"), +// }, +// }, +// }, +// &media.TransformOutputTypeArgs{ +// RelativePriority: pulumi.String("Normal"), +// OnErrorAction: pulumi.String("StopProcessingJob"), +// VideoAnalyzerPreset: &media.TransformOutputVideoAnalyzerPresetArgs{ +// AudioLanguage: pulumi.String("en-US"), +// AudioAnalysisMode: pulumi.String("Basic"), +// InsightsType: pulumi.String("AllInsights"), +// ExperimentalOptions: pulumi.StringMap{ +// "env": pulumi.String("test"), +// }, +// }, +// }, +// &media.TransformOutputTypeArgs{ +// RelativePriority: pulumi.String("Low"), +// OnErrorAction: pulumi.String("ContinueJob"), +// CustomPreset: &media.TransformOutputCustomPresetArgs{ +// Codecs: media.TransformOutputCustomPresetCodecArray{ +// &media.TransformOutputCustomPresetCodecArgs{ +// AacAudio: &media.TransformOutputCustomPresetCodecAacAudioArgs{ +// Bitrate: pulumi.Int(128000), +// Channels: pulumi.Int(2), +// SamplingRate: pulumi.Int(48000), +// Profile: pulumi.String("AacLc"), +// }, +// }, +// &media.TransformOutputCustomPresetCodecArgs{ +// CopyAudio: &media.TransformOutputCustomPresetCodecCopyAudioArgs{ +// Label: pulumi.String("test"), +// }, +// }, +// &media.TransformOutputCustomPresetCodecArgs{ +// CopyVideo: &media.TransformOutputCustomPresetCodecCopyVideoArgs{ +// Label: pulumi.String("test"), +// }, +// }, +// &media.TransformOutputCustomPresetCodecArgs{ +// H264Video: &media.TransformOutputCustomPresetCodecH264VideoArgs{ +// KeyFrameInterval: pulumi.String("PT1S"), +// StretchMode: pulumi.String("AutoSize"), +// SyncMode: pulumi.String("Auto"), +// SceneChangeDetectionEnabled: pulumi.Bool(false), +// RateControlMode: pulumi.String("ABR"), +// Complexity: pulumi.String("Quality"), +// Layers: media.TransformOutputCustomPresetCodecH264VideoLayerArray{ +// &media.TransformOutputCustomPresetCodecH264VideoLayerArgs{ +// Width: pulumi.String("64"), +// Height: pulumi.String("64"), +// Bitrate: pulumi.Int(1045000), +// MaxBitrate: pulumi.Int(1045000), +// BFrames: pulumi.Int(3), +// Slices: pulumi.Int(0), +// AdaptiveBFrameEnabled: pulumi.Bool(true), +// Profile: pulumi.String("Auto"), +// Level: pulumi.String("auto"), +// BufferWindow: pulumi.String("PT5S"), +// ReferenceFrames: pulumi.Int(4), +// Crf: pulumi.Float64(23), +// EntropyMode: pulumi.String("Cabac"), +// }, +// &media.TransformOutputCustomPresetCodecH264VideoLayerArgs{ +// Width: pulumi.String("64"), +// Height: pulumi.String("64"), +// Bitrate: pulumi.Int(1000), +// MaxBitrate: pulumi.Int(1000), +// BFrames: pulumi.Int(3), +// FrameRate: pulumi.String("32"), +// Slices: pulumi.Int(1), +// AdaptiveBFrameEnabled: pulumi.Bool(true), +// Profile: pulumi.String("High444"), +// Level: pulumi.String("auto"), +// BufferWindow: pulumi.String("PT5S"), +// ReferenceFrames: pulumi.Int(4), +// Crf: pulumi.Float64(23), +// EntropyMode: pulumi.String("Cavlc"), +// }, +// }, +// }, +// }, +// &media.TransformOutputCustomPresetCodecArgs{ +// H265Video: &media.TransformOutputCustomPresetCodecH265VideoArgs{ +// KeyFrameInterval: pulumi.String("PT2S"), +// StretchMode: pulumi.String("AutoSize"), +// SyncMode: pulumi.String("Auto"), +// SceneChangeDetectionEnabled: pulumi.Bool(false), +// Complexity: pulumi.String("Speed"), +// Layers: media.TransformOutputCustomPresetCodecH265VideoLayerArray{ +// &media.TransformOutputCustomPresetCodecH265VideoLayerArgs{ +// Width: pulumi.String("64"), +// Height: pulumi.String("64"), +// Bitrate: pulumi.Int(1045000), +// MaxBitrate: pulumi.Int(1045000), +// BFrames: pulumi.Int(3), +// Slices: pulumi.Int(5), +// AdaptiveBFrameEnabled: pulumi.Bool(true), +// Profile: pulumi.String("Auto"), +// Label: pulumi.String("test"), +// Level: pulumi.String("auto"), +// BufferWindow: pulumi.String("PT5S"), +// FrameRate: pulumi.String("32"), +// ReferenceFrames: pulumi.Int(4), +// Crf: pulumi.Float64(23), +// }, +// }, +// }, +// }, +// &media.TransformOutputCustomPresetCodecArgs{ +// JpgImage: &media.TransformOutputCustomPresetCodecJpgImageArgs{ +// StretchMode: pulumi.String("AutoSize"), +// SyncMode: pulumi.String("Auto"), +// Start: pulumi.String("10"), +// Range: pulumi.String("100%%"), +// SpriteColumn: pulumi.Int(1), +// Step: pulumi.String("10"), +// Layers: media.TransformOutputCustomPresetCodecJpgImageLayerArray{ +// &media.TransformOutputCustomPresetCodecJpgImageLayerArgs{ +// Quality: pulumi.Int(70), +// Height: pulumi.String("180"), +// Label: pulumi.String("test"), +// Width: pulumi.String("120"), +// }, +// }, +// }, +// }, +// &media.TransformOutputCustomPresetCodecArgs{ +// PngImage: &media.TransformOutputCustomPresetCodecPngImageArgs{ +// StretchMode: pulumi.String("AutoSize"), +// SyncMode: pulumi.String("Auto"), +// Start: pulumi.String("{Best}"), +// Range: pulumi.String("80"), +// Step: pulumi.String("10"), +// Layers: media.TransformOutputCustomPresetCodecPngImageLayerArray{ +// &media.TransformOutputCustomPresetCodecPngImageLayerArgs{ +// Height: pulumi.String("180"), +// Label: pulumi.String("test"), +// Width: pulumi.String("120"), +// }, +// }, +// }, +// }, +// }, +// Formats: media.TransformOutputCustomPresetFormatArray{ +// &media.TransformOutputCustomPresetFormatArgs{ +// Jpg: &media.TransformOutputCustomPresetFormatJpgArgs{ +// FilenamePattern: pulumi.String("test{Basename}"), +// }, +// }, +// &media.TransformOutputCustomPresetFormatArgs{ +// Mp4: &media.TransformOutputCustomPresetFormatMp4Args{ +// FilenamePattern: pulumi.String("test{Bitrate}"), +// OutputFiles: media.TransformOutputCustomPresetFormatMp4OutputFileArray{ +// &media.TransformOutputCustomPresetFormatMp4OutputFileArgs{ +// Labels: pulumi.StringArray{ +// pulumi.String("test"), +// pulumi.String("ppe"), +// }, +// }, +// }, +// }, +// }, +// &media.TransformOutputCustomPresetFormatArgs{ +// Png: &media.TransformOutputCustomPresetFormatPngArgs{ +// FilenamePattern: pulumi.String("test{Basename}"), +// }, +// }, +// &media.TransformOutputCustomPresetFormatArgs{ +// TransportStream: &media.TransformOutputCustomPresetFormatTransportStreamArgs{ +// FilenamePattern: pulumi.String("test{Bitrate}"), +// OutputFiles: media.TransformOutputCustomPresetFormatTransportStreamOutputFileArray{ +// &media.TransformOutputCustomPresetFormatTransportStreamOutputFileArgs{ +// Labels: pulumi.StringArray{ +// pulumi.String("prod"), +// }, +// }, +// }, +// }, +// }, +// }, +// Filter: &media.TransformOutputCustomPresetFilterArgs{ +// CropRectangle: &media.TransformOutputCustomPresetFilterCropRectangleArgs{ +// Height: pulumi.String("240"), +// Left: pulumi.String("30"), +// Top: pulumi.String("360"), +// Width: pulumi.String("70"), +// }, +// Deinterlace: &media.TransformOutputCustomPresetFilterDeinterlaceArgs{ +// Parity: pulumi.String("TopFieldFirst"), +// Mode: pulumi.String("AutoPixelAdaptive"), +// }, +// FadeIn: &media.TransformOutputCustomPresetFilterFadeInArgs{ +// Duration: pulumi.String("PT5S"), +// FadeColor: pulumi.String("0xFF0000"), +// Start: pulumi.String("10"), +// }, +// FadeOut: &media.TransformOutputCustomPresetFilterFadeOutArgs{ +// Duration: pulumi.String("90%%"), +// FadeColor: pulumi.String("#FF0C7B"), +// Start: pulumi.String("10%%"), +// }, +// Rotation: pulumi.String("Auto"), +// Overlays: media.TransformOutputCustomPresetFilterOverlayArray{ +// &media.TransformOutputCustomPresetFilterOverlayArgs{ +// Audio: &media.TransformOutputCustomPresetFilterOverlayAudioArgs{ +// InputLabel: pulumi.String("label.jpg"), +// Start: pulumi.String("PT5S"), +// End: pulumi.String("PT30S"), +// FadeInDuration: pulumi.String("PT1S"), +// FadeOutDuration: pulumi.String("PT2S"), +// AudioGainLevel: pulumi.Float64(1), +// }, +// }, +// &media.TransformOutputCustomPresetFilterOverlayArgs{ +// Video: &media.TransformOutputCustomPresetFilterOverlayVideoArgs{ +// InputLabel: pulumi.String("label.jpg"), +// Start: pulumi.String("PT5S"), +// End: pulumi.String("PT30S"), +// FadeInDuration: pulumi.String("PT1S"), +// FadeOutDuration: pulumi.String("PT2S"), +// AudioGainLevel: pulumi.Float64(1), +// Opacity: pulumi.Float64(1), +// Position: &media.TransformOutputCustomPresetFilterOverlayVideoPositionArgs{ +// Height: pulumi.String("180"), +// Left: pulumi.String("20"), +// Top: pulumi.String("240"), +// Width: pulumi.String("140"), +// }, +// CropRectangle: &media.TransformOutputCustomPresetFilterOverlayVideoCropRectangleArgs{ +// Height: pulumi.String("240"), +// Left: pulumi.String("30"), +// Top: pulumi.String("360"), +// Width: pulumi.String("70"), +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Transforms can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mediaservices/account.go b/sdk/go/azure/mediaservices/account.go index b006884826..8962ebed42 100644 --- a/sdk/go/azure/mediaservices/account.go +++ b/sdk/go/azure/mediaservices/account.go @@ -15,6 +15,56 @@ import ( // Manages a Media Services Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/media" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// _, err = media.NewServiceAccount(ctx, "exampleServiceAccount", &media.ServiceAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccounts: media.ServiceAccountStorageAccountArray{ +// &media.ServiceAccountStorageAccountArgs{ +// Id: exampleAccount.ID(), +// IsPrimary: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mixedreality/getSpatialAnchorsAccount.go b/sdk/go/azure/mixedreality/getSpatialAnchorsAccount.go index 1f76f07e2e..6a596ffc5b 100644 --- a/sdk/go/azure/mixedreality/getSpatialAnchorsAccount.go +++ b/sdk/go/azure/mixedreality/getSpatialAnchorsAccount.go @@ -13,6 +13,34 @@ import ( ) // Get information about an Azure Spatial Anchors Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mixedreality" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mixedreality.LookupSpatialAnchorsAccount(ctx, &mixedreality.LookupSpatialAnchorsAccountArgs{ +// Name: "example", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("accountDomain", data.Azurerm_spatial_anchors_account.Account_domain) +// return nil +// }) +// } +// +// ``` func LookupSpatialAnchorsAccount(ctx *pulumi.Context, args *LookupSpatialAnchorsAccountArgs, opts ...pulumi.InvokeOption) (*LookupSpatialAnchorsAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSpatialAnchorsAccountResult diff --git a/sdk/go/azure/mixedreality/spatialAnchorsAccount.go b/sdk/go/azure/mixedreality/spatialAnchorsAccount.go index f53f54ca0d..d85dd42d4b 100644 --- a/sdk/go/azure/mixedreality/spatialAnchorsAccount.go +++ b/sdk/go/azure/mixedreality/spatialAnchorsAccount.go @@ -15,6 +15,40 @@ import ( // Manages an Azure Spatial Anchors Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mixedreality" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = mixedreality.NewSpatialAnchorsAccount(ctx, "exampleSpatialAnchorsAccount", &mixedreality.SpatialAnchorsAccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spatial Anchors Account can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/getNetwork.go b/sdk/go/azure/mobile/getNetwork.go index 9a1b9f428d..c3b823199f 100644 --- a/sdk/go/azure/mobile/getNetwork.go +++ b/sdk/go/azure/mobile/getNetwork.go @@ -13,6 +13,33 @@ import ( ) // Get information about an Azure Mobile Network. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mobile.LookupNetwork(ctx, &mobile.LookupNetworkArgs{ +// Name: "example-mn", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetwork(ctx *pulumi.Context, args *LookupNetworkArgs, opts ...pulumi.InvokeOption) (*LookupNetworkResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkResult diff --git a/sdk/go/azure/mobile/getNetworkAttachedDataNetwork.go b/sdk/go/azure/mobile/getNetworkAttachedDataNetwork.go index 41142e5c93..41d98bca5c 100644 --- a/sdk/go/azure/mobile/getNetworkAttachedDataNetwork.go +++ b/sdk/go/azure/mobile/getNetworkAttachedDataNetwork.go @@ -13,6 +13,40 @@ import ( ) // Use this data source to access information about an existing Mobile Network Attached Data Network. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleNetworkPacketCoreControlPlane, err := mobile.LookupNetworkPacketCoreControlPlane(ctx, &mobile.LookupNetworkPacketCoreControlPlaneArgs{ +// Name: "example-mnpccp", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.LookupNetworkAttachedDataNetwork(ctx, &mobile.LookupNetworkAttachedDataNetworkArgs{ +// MobileNetworkDataNetworkName: exampleNetworkPacketCoreControlPlane.Name, +// MobileNetworkPacketCoreDataPlaneId: exampleNetworkPacketCoreControlPlane.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkAttachedDataNetwork(ctx *pulumi.Context, args *LookupNetworkAttachedDataNetworkArgs, opts ...pulumi.InvokeOption) (*LookupNetworkAttachedDataNetworkResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkAttachedDataNetworkResult diff --git a/sdk/go/azure/mobile/getNetworkDataNetwork.go b/sdk/go/azure/mobile/getNetworkDataNetwork.go index c39e9fb2ee..ec51f09744 100644 --- a/sdk/go/azure/mobile/getNetworkDataNetwork.go +++ b/sdk/go/azure/mobile/getNetworkDataNetwork.go @@ -13,6 +13,40 @@ import ( ) // Get information about a Mobile Network Data Network. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleNetwork, err := mobile.LookupNetwork(ctx, &mobile.LookupNetworkArgs{ +// Name: "example-mn", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.LookupNetworkDataNetwork(ctx, &mobile.LookupNetworkDataNetworkArgs{ +// Name: "example-mndn", +// MobileNetworkId: exampleNetwork.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkDataNetwork(ctx *pulumi.Context, args *LookupNetworkDataNetworkArgs, opts ...pulumi.InvokeOption) (*LookupNetworkDataNetworkResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkDataNetworkResult diff --git a/sdk/go/azure/mobile/getNetworkPacketCoreControlPlane.go b/sdk/go/azure/mobile/getNetworkPacketCoreControlPlane.go index 035017f64a..7c64ab76c4 100644 --- a/sdk/go/azure/mobile/getNetworkPacketCoreControlPlane.go +++ b/sdk/go/azure/mobile/getNetworkPacketCoreControlPlane.go @@ -13,6 +13,33 @@ import ( ) // Get information about a Mobile Network Packet Core Control Plane. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mobile.LookupNetworkPacketCoreControlPlane(ctx, &mobile.LookupNetworkPacketCoreControlPlaneArgs{ +// Name: "example-mnpccp", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkPacketCoreControlPlane(ctx *pulumi.Context, args *LookupNetworkPacketCoreControlPlaneArgs, opts ...pulumi.InvokeOption) (*LookupNetworkPacketCoreControlPlaneResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkPacketCoreControlPlaneResult diff --git a/sdk/go/azure/mobile/getNetworkPacketCoreDataPlane.go b/sdk/go/azure/mobile/getNetworkPacketCoreDataPlane.go index 57f6d5a5aa..c60e340ab0 100644 --- a/sdk/go/azure/mobile/getNetworkPacketCoreDataPlane.go +++ b/sdk/go/azure/mobile/getNetworkPacketCoreDataPlane.go @@ -13,6 +13,40 @@ import ( ) // Get information a Mobile Network Packet Core Data Plane. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleNetworkPacketCoreControlPlane, err := mobile.LookupNetworkPacketCoreControlPlane(ctx, &mobile.LookupNetworkPacketCoreControlPlaneArgs{ +// Name: "example-mnpccp", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.LookupNetworkPacketCoreDataPlane(ctx, &mobile.LookupNetworkPacketCoreDataPlaneArgs{ +// Name: "example-mnpcdp", +// MobileNetworkPacketCoreControlPlaneId: exampleNetworkPacketCoreControlPlane.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkPacketCoreDataPlane(ctx *pulumi.Context, args *LookupNetworkPacketCoreDataPlaneArgs, opts ...pulumi.InvokeOption) (*LookupNetworkPacketCoreDataPlaneResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkPacketCoreDataPlaneResult diff --git a/sdk/go/azure/mobile/getNetworkService.go b/sdk/go/azure/mobile/getNetworkService.go index 337b45ff39..58187488d7 100644 --- a/sdk/go/azure/mobile/getNetworkService.go +++ b/sdk/go/azure/mobile/getNetworkService.go @@ -13,6 +13,39 @@ import ( ) // Get information about a Mobile Network Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleNetwork, err := mobile.LookupNetwork(ctx, &mobile.LookupNetworkArgs{ +// Name: "example-mn", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkService(ctx, "exampleNetworkService", &mobile.NetworkServiceArgs{ +// MobileNetworkId: *pulumi.String(exampleNetwork.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkService(ctx *pulumi.Context, args *LookupNetworkServiceArgs, opts ...pulumi.InvokeOption) (*LookupNetworkServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkServiceResult diff --git a/sdk/go/azure/mobile/getNetworkSimGroup.go b/sdk/go/azure/mobile/getNetworkSimGroup.go index 83cae28bf0..f402e61f52 100644 --- a/sdk/go/azure/mobile/getNetworkSimGroup.go +++ b/sdk/go/azure/mobile/getNetworkSimGroup.go @@ -13,6 +13,40 @@ import ( ) // Get information about a Mobile Network Sim Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleNetwork, err := mobile.LookupNetwork(ctx, &mobile.LookupNetworkArgs{ +// Name: "example-mn", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.LookupNetworkSimGroup(ctx, &mobile.LookupNetworkSimGroupArgs{ +// Name: "example-mnsg", +// MobileNetworkId: exampleNetwork.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkSimGroup(ctx *pulumi.Context, args *LookupNetworkSimGroupArgs, opts ...pulumi.InvokeOption) (*LookupNetworkSimGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkSimGroupResult diff --git a/sdk/go/azure/mobile/getNetworkSimPolicy.go b/sdk/go/azure/mobile/getNetworkSimPolicy.go index ec6ead3caf..621de37566 100644 --- a/sdk/go/azure/mobile/getNetworkSimPolicy.go +++ b/sdk/go/azure/mobile/getNetworkSimPolicy.go @@ -13,6 +13,40 @@ import ( ) // Get information about a Mobile Network Sim Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleNetwork, err := mobile.LookupNetwork(ctx, &mobile.LookupNetworkArgs{ +// Name: "example-mn", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.LookupNetworkSimPolicy(ctx, &mobile.LookupNetworkSimPolicyArgs{ +// Name: "example-mnsp", +// MobileNetworkId: exampleNetwork.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkSimPolicy(ctx *pulumi.Context, args *LookupNetworkSimPolicyArgs, opts ...pulumi.InvokeOption) (*LookupNetworkSimPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkSimPolicyResult diff --git a/sdk/go/azure/mobile/getNetworkSite.go b/sdk/go/azure/mobile/getNetworkSite.go index 746d728d69..3ae73471fc 100644 --- a/sdk/go/azure/mobile/getNetworkSite.go +++ b/sdk/go/azure/mobile/getNetworkSite.go @@ -13,6 +13,40 @@ import ( ) // Get information about a Mobile Network Site. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleNetwork, err := mobile.LookupNetwork(ctx, &mobile.LookupNetworkArgs{ +// Name: "example-mn", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.LookupNetworkSite(ctx, &mobile.LookupNetworkSiteArgs{ +// Name: "example-mns", +// MobileNetworkId: exampleNetwork.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkSite(ctx *pulumi.Context, args *LookupNetworkSiteArgs, opts ...pulumi.InvokeOption) (*LookupNetworkSiteResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkSiteResult diff --git a/sdk/go/azure/mobile/getNetworkSlice.go b/sdk/go/azure/mobile/getNetworkSlice.go index 498ae89fba..c7cd1968b8 100644 --- a/sdk/go/azure/mobile/getNetworkSlice.go +++ b/sdk/go/azure/mobile/getNetworkSlice.go @@ -13,6 +13,40 @@ import ( ) // Get information about a Mobile Network Slice. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mobile.LookupNetwork(ctx, &mobile.LookupNetworkArgs{ +// Name: "example-mn", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.LookupNetworkSlice(ctx, &mobile.LookupNetworkSliceArgs{ +// Name: "example-mns", +// MobileNetworkId: data.Azurerm_mobile_network.Test.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupNetworkSlice(ctx *pulumi.Context, args *LookupNetworkSliceArgs, opts ...pulumi.InvokeOption) (*LookupNetworkSliceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkSliceResult diff --git a/sdk/go/azure/mobile/network.go b/sdk/go/azure/mobile/network.go index a81e27bce8..906baa2d7a 100644 --- a/sdk/go/azure/mobile/network.go +++ b/sdk/go/azure/mobile/network.go @@ -15,6 +15,45 @@ import ( // Manages a Mobile Network. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkDataNetwork.go b/sdk/go/azure/mobile/networkDataNetwork.go index d68108b1de..5ea98e390b 100644 --- a/sdk/go/azure/mobile/networkDataNetwork.go +++ b/sdk/go/azure/mobile/networkDataNetwork.go @@ -15,6 +15,53 @@ import ( // Manages a Mobile Network Data Network. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East Us"), +// }) +// if err != nil { +// return err +// } +// exampleNetwork, err := mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkDataNetwork(ctx, "exampleNetworkDataNetwork", &mobile.NetworkDataNetworkArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// Description: pulumi.String("example description"), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Data Network can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkPacketCoreControlPlane.go b/sdk/go/azure/mobile/networkPacketCoreControlPlane.go index f2a6264b0f..dcb3a83e45 100644 --- a/sdk/go/azure/mobile/networkPacketCoreControlPlane.go +++ b/sdk/go/azure/mobile/networkPacketCoreControlPlane.go @@ -15,6 +15,93 @@ import ( // Manages a Mobile Network Packet Core Control Plane. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databoxedge" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSite, err := mobile.NewNetworkSite(ctx, "exampleNetworkSite", &mobile.NetworkSiteArgs{ +// MobileNetworkId: pulumi.Any(azurerm_mobile_network.Test.Id), +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleDevice, err := databoxedge.NewDevice(ctx, "exampleDevice", &databoxedge.DeviceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("EdgeP_Base-Standard"), +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "key": "value", +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = mobile.NewNetworkPacketCoreControlPlane(ctx, "exampleNetworkPacketCoreControlPlane", &mobile.NetworkPacketCoreControlPlaneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("G0"), +// ControlPlaneAccessName: pulumi.String("default-interface"), +// ControlPlaneAccessIpv4Address: pulumi.String("192.168.1.199"), +// ControlPlaneAccessIpv4Gateway: pulumi.String("192.168.1.1"), +// ControlPlaneAccessIpv4Subnet: pulumi.String("192.168.1.0/25"), +// SiteIds: pulumi.StringArray{ +// exampleNetworkSite.ID(), +// }, +// LocalDiagnosticsAccess: &mobile.NetworkPacketCoreControlPlaneLocalDiagnosticsAccessArgs{ +// AuthenticationType: pulumi.String("AAD"), +// }, +// Platform: &mobile.NetworkPacketCoreControlPlanePlatformArgs{ +// Type: pulumi.String("AKS-HCI"), +// EdgeDeviceId: exampleDevice.ID(), +// }, +// InteroperabilitySettingsJson: pulumi.String(json0), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Packet Core Control Plane can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkService.go b/sdk/go/azure/mobile/networkService.go index 5b1f302de2..76c0132b21 100644 --- a/sdk/go/azure/mobile/networkService.go +++ b/sdk/go/azure/mobile/networkService.go @@ -15,6 +15,97 @@ import ( // Manages a Mobile Network Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleNetwork, err := mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkService(ctx, "exampleNetworkService", &mobile.NetworkServiceArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// ServicePrecedence: pulumi.Int(0), +// PccRules: mobile.NetworkServicePccRuleArray{ +// &mobile.NetworkServicePccRuleArgs{ +// Name: pulumi.String("default-rule"), +// Precedence: pulumi.Int(1), +// TrafficControlEnabled: pulumi.Bool(true), +// QosPolicy: &mobile.NetworkServicePccRuleQosPolicyArgs{ +// AllocationAndRetentionPriorityLevel: pulumi.Int(9), +// QosIndicator: pulumi.Int(9), +// PreemptionCapability: pulumi.String("NotPreempt"), +// PreemptionVulnerability: pulumi.String("Preemptable"), +// GuaranteedBitRate: &mobile.NetworkServicePccRuleQosPolicyGuaranteedBitRateArgs{ +// Downlink: pulumi.String("100 Mbps"), +// Uplink: pulumi.String("10 Mbps"), +// }, +// MaximumBitRate: &mobile.NetworkServicePccRuleQosPolicyMaximumBitRateArgs{ +// Downlink: pulumi.String("1 Gbps"), +// Uplink: pulumi.String("100 Mbps"), +// }, +// }, +// ServiceDataFlowTemplates: mobile.NetworkServicePccRuleServiceDataFlowTemplateArray{ +// &mobile.NetworkServicePccRuleServiceDataFlowTemplateArgs{ +// Direction: pulumi.String("Uplink"), +// Name: pulumi.String("IP-to-server"), +// Ports: pulumi.StringArray{}, +// Protocols: pulumi.StringArray{ +// pulumi.String("ip"), +// }, +// RemoteIpLists: pulumi.StringArray{ +// pulumi.String("10.3.4.0/24"), +// }, +// }, +// }, +// }, +// }, +// ServiceQosPolicy: &mobile.NetworkServiceServiceQosPolicyArgs{ +// AllocationAndRetentionPriorityLevel: pulumi.Int(9), +// QosIndicator: pulumi.Int(9), +// PreemptionCapability: pulumi.String("NotPreempt"), +// PreemptionVulnerability: pulumi.String("Preemptable"), +// MaximumBitRate: &mobile.NetworkServiceServiceQosPolicyMaximumBitRateArgs{ +// Downlink: pulumi.String("1 Gbps"), +// Uplink: pulumi.String("100 Mbps"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkSim.go b/sdk/go/azure/mobile/networkSim.go index 7c62aa5a75..340123f8ce 100644 --- a/sdk/go/azure/mobile/networkSim.go +++ b/sdk/go/azure/mobile/networkSim.go @@ -15,6 +15,97 @@ import ( // Manages a Mobile Network Sim. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetwork, err := mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSimGroup, err := mobile.NewNetworkSimGroup(ctx, "exampleNetworkSimGroup", &mobile.NetworkSimGroupArgs{ +// Location: exampleResourceGroup.Location, +// MobileNetworkId: exampleNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkSlice(ctx, "exampleNetworkSlice", &mobile.NetworkSliceArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// SingleNetworkSliceSelectionAssistanceInformation: &mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs{ +// SliceServiceType: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkAttachedDataNetwork(ctx, "exampleNetworkAttachedDataNetwork", &mobile.NetworkAttachedDataNetworkArgs{ +// MobileNetworkDataNetworkName: pulumi.Any(azurerm_mobile_network_data_network.Example.Name), +// MobileNetworkPacketCoreDataPlaneId: pulumi.Any(azurerm_mobile_network_packet_core_data_plane.Example.Id), +// Location: exampleResourceGroup.Location, +// DnsAddresses: pulumi.StringArray{ +// pulumi.String("1.1.1.1"), +// }, +// UserEquipmentAddressPoolPrefixes: pulumi.StringArray{ +// pulumi.String("2.4.0.0/24"), +// }, +// UserEquipmentStaticAddressPoolPrefixes: pulumi.StringArray{ +// pulumi.String("2.4.1.0/24"), +// }, +// UserPlaneAccessName: pulumi.String("test"), +// UserPlaneAccessIpv4Address: pulumi.String("10.204.141.4"), +// UserPlaneAccessIpv4Gateway: pulumi.String("10.204.141.1"), +// UserPlaneAccessIpv4Subnet: pulumi.String("10.204.141.0/24"), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkSim(ctx, "exampleNetworkSim", &mobile.NetworkSimArgs{ +// MobileNetworkSimGroupId: exampleNetworkSimGroup.ID(), +// AuthenticationKey: pulumi.String("00000000000000000000000000000000"), +// IntegratedCircuitCardIdentifier: pulumi.String("8900000000000000000"), +// InternationalMobileSubscriberIdentity: pulumi.String("000000000000000"), +// OperatorKeyCode: pulumi.String("00000000000000000000000000000000"), +// StaticIpConfigurations: mobile.NetworkSimStaticIpConfigurationArray{ +// &mobile.NetworkSimStaticIpConfigurationArgs{ +// AttachedDataNetworkId: pulumi.Any(data.Azurerm_mobile_network_attached_data_network.Test.Id), +// SliceId: pulumi.Any(azurerm_mobile_network_slice.Test.Id), +// StaticIpv4Address: pulumi.String("2.4.0.1"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Sim can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkSimGroup.go b/sdk/go/azure/mobile/networkSimGroup.go index f266ef99d2..c84cf9a251 100644 --- a/sdk/go/azure/mobile/networkSimGroup.go +++ b/sdk/go/azure/mobile/networkSimGroup.go @@ -15,6 +15,82 @@ import ( // Manages a Mobile Network Sim Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetwork, err := mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.LookupUserAssignedIdentity(ctx, &authorization.LookupUserAssignedIdentityArgs{ +// Name: "name_of_user_assigned_identity", +// ResourceGroupName: "name_of_resource_group", +// }, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{ +// Name: "example-kv", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.LookupKey(ctx, &keyvault.LookupKeyArgs{ +// Name: "example-key", +// KeyVaultId: exampleKeyVault.Id, +// }, nil) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkSimGroup(ctx, "exampleNetworkSimGroup", &mobile.NetworkSimGroupArgs{ +// Location: exampleResourceGroup.Location, +// MobileNetworkId: exampleNetwork.ID(), +// EncryptionKeyUrl: *pulumi.String(exampleKey.Id), +// Identity: &mobile.NetworkSimGroupIdentityArgs{ +// Type: pulumi.String("SystemAssigned, UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// *pulumi.String(exampleUserAssignedIdentity.Id), +// }, +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Sim Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkSimPolicy.go b/sdk/go/azure/mobile/networkSimPolicy.go index 11fc8f66c6..dd59d22f2c 100644 --- a/sdk/go/azure/mobile/networkSimPolicy.go +++ b/sdk/go/azure/mobile/networkSimPolicy.go @@ -15,6 +15,126 @@ import ( // Manages a Mobile Network Sim Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetwork, err := mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkDataNetwork, err := mobile.NewNetworkDataNetwork(ctx, "exampleNetworkDataNetwork", &mobile.NetworkDataNetworkArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleNetworkService, err := mobile.NewNetworkService(ctx, "exampleNetworkService", &mobile.NetworkServiceArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// ServicePrecedence: pulumi.Int(0), +// PccRules: mobile.NetworkServicePccRuleArray{ +// &mobile.NetworkServicePccRuleArgs{ +// Name: pulumi.String("default-rule"), +// Precedence: pulumi.Int(1), +// TrafficControlEnabled: pulumi.Bool(true), +// ServiceDataFlowTemplates: mobile.NetworkServicePccRuleServiceDataFlowTemplateArray{ +// &mobile.NetworkServicePccRuleServiceDataFlowTemplateArgs{ +// Direction: pulumi.String("Uplink"), +// Name: pulumi.String("IP-to-server"), +// Ports: pulumi.StringArray{}, +// Protocols: pulumi.StringArray{ +// pulumi.String("ip"), +// }, +// RemoteIpLists: pulumi.StringArray{ +// pulumi.String("10.3.4.0/24"), +// }, +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkSlice, err := mobile.NewNetworkSlice(ctx, "exampleNetworkSlice", &mobile.NetworkSliceArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// SingleNetworkSliceSelectionAssistanceInformation: &mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs{ +// SliceServiceType: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkSimPolicy(ctx, "exampleNetworkSimPolicy", &mobile.NetworkSimPolicyArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// RegistrationTimerInSeconds: pulumi.Int(3240), +// DefaultSliceId: exampleNetworkSlice.ID(), +// Slices: mobile.NetworkSimPolicySliceArray{ +// &mobile.NetworkSimPolicySliceArgs{ +// DefaultDataNetworkId: exampleNetworkDataNetwork.ID(), +// SliceId: exampleNetworkSlice.ID(), +// DataNetworks: mobile.NetworkSimPolicySliceDataNetworkArray{ +// &mobile.NetworkSimPolicySliceDataNetworkArgs{ +// DataNetworkId: exampleNetworkDataNetwork.ID(), +// AllocationAndRetentionPriorityLevel: pulumi.Int(9), +// DefaultSessionType: pulumi.String("IPv4"), +// QosIndicator: pulumi.Int(9), +// PreemptionCapability: pulumi.String("NotPreempt"), +// PreemptionVulnerability: pulumi.String("Preemptable"), +// AllowedServicesIds: pulumi.StringArray{ +// exampleNetworkService.ID(), +// }, +// SessionAggregateMaximumBitRate: &mobile.NetworkSimPolicySliceDataNetworkSessionAggregateMaximumBitRateArgs{ +// Downlink: pulumi.String("1 Gbps"), +// Uplink: pulumi.String("500 Mbps"), +// }, +// }, +// }, +// }, +// }, +// UserEquipmentAggregateMaximumBitRate: &mobile.NetworkSimPolicyUserEquipmentAggregateMaximumBitRateArgs{ +// Downlink: pulumi.String("1 Gbps"), +// Uplink: pulumi.String("500 Mbps"), +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Sim Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkSite.go b/sdk/go/azure/mobile/networkSite.go index a8253eb686..36181ef741 100644 --- a/sdk/go/azure/mobile/networkSite.go +++ b/sdk/go/azure/mobile/networkSite.go @@ -15,6 +15,61 @@ import ( // Manages a Mobile Network Site. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databoxedge" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = databoxedge.NewDevice(ctx, "exampleDevice", &databoxedge.DeviceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("EdgeP_Base-Standard"), +// }) +// if err != nil { +// return err +// } +// exampleNetwork, err := mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkSite(ctx, "exampleNetworkSite", &mobile.NetworkSiteArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Site can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mobile/networkSlice.go b/sdk/go/azure/mobile/networkSlice.go index 450309d552..336b496e1a 100644 --- a/sdk/go/azure/mobile/networkSlice.go +++ b/sdk/go/azure/mobile/networkSlice.go @@ -15,6 +15,56 @@ import ( // Manages a Mobile Network Slice. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mobile" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetwork, err := mobile.NewNetwork(ctx, "exampleNetwork", &mobile.NetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// MobileCountryCode: pulumi.String("001"), +// MobileNetworkCode: pulumi.String("01"), +// }) +// if err != nil { +// return err +// } +// _, err = mobile.NewNetworkSlice(ctx, "exampleNetworkSlice", &mobile.NetworkSliceArgs{ +// MobileNetworkId: exampleNetwork.ID(), +// Location: exampleResourceGroup.Location, +// Description: pulumi.String("an example slice"), +// SingleNetworkSliceSelectionAssistanceInformation: &mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs{ +// SliceServiceType: pulumi.Int(1), +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Mobile Network Slice can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/aadDiagnosticSetting.go b/sdk/go/azure/monitoring/aadDiagnosticSetting.go index 08bde0c695..590346298b 100644 --- a/sdk/go/azure/monitoring/aadDiagnosticSetting.go +++ b/sdk/go/azure/monitoring/aadDiagnosticSetting.go @@ -16,6 +16,80 @@ import ( // // !> **Authentication** The API for this resource does not support service principal authentication. This resource can only be used with Azure CLI authentication. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountKind: pulumi.String("StorageV2"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewAadDiagnosticSetting(ctx, "exampleAadDiagnosticSetting", &monitoring.AadDiagnosticSettingArgs{ +// StorageAccountId: exampleAccount.ID(), +// EnabledLogs: monitoring.AadDiagnosticSettingEnabledLogArray{ +// &monitoring.AadDiagnosticSettingEnabledLogArgs{ +// Category: pulumi.String("SignInLogs"), +// RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{ +// Enabled: pulumi.Bool(true), +// Days: pulumi.Int(1), +// }, +// }, +// &monitoring.AadDiagnosticSettingEnabledLogArgs{ +// Category: pulumi.String("AuditLogs"), +// RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{ +// Enabled: pulumi.Bool(true), +// Days: pulumi.Int(1), +// }, +// }, +// &monitoring.AadDiagnosticSettingEnabledLogArgs{ +// Category: pulumi.String("NonInteractiveUserSignInLogs"), +// RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{ +// Enabled: pulumi.Bool(true), +// Days: pulumi.Int(1), +// }, +// }, +// &monitoring.AadDiagnosticSettingEnabledLogArgs{ +// Category: pulumi.String("ServicePrincipalSignInLogs"), +// RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{ +// Enabled: pulumi.Bool(true), +// Days: pulumi.Int(1), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Monitor Azure Active Directory Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/actionGroup.go b/sdk/go/azure/monitoring/actionGroup.go index ff705eeb9c..e2255159b0 100644 --- a/sdk/go/azure/monitoring/actionGroup.go +++ b/sdk/go/azure/monitoring/actionGroup.go @@ -15,6 +15,147 @@ import ( // Manages an Action Group within Azure Monitor. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("p0action"), +// ArmRoleReceivers: monitoring.ActionGroupArmRoleReceiverArray{ +// &monitoring.ActionGroupArmRoleReceiverArgs{ +// Name: pulumi.String("armroleaction"), +// RoleId: pulumi.String("de139f84-1756-47ae-9be6-808fbbe84772"), +// UseCommonAlertSchema: pulumi.Bool(true), +// }, +// }, +// AutomationRunbookReceivers: monitoring.ActionGroupAutomationRunbookReceiverArray{ +// &monitoring.ActionGroupAutomationRunbookReceiverArgs{ +// Name: pulumi.String("action_name_1"), +// AutomationAccountId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001"), +// RunbookName: pulumi.String("my runbook"), +// WebhookResourceId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001/webHooks/webhook_alert"), +// IsGlobalRunbook: pulumi.Bool(true), +// ServiceUri: pulumi.String("https://s13events.azure-automation.net/webhooks?token=randomtoken"), +// UseCommonAlertSchema: pulumi.Bool(true), +// }, +// }, +// AzureAppPushReceivers: monitoring.ActionGroupAzureAppPushReceiverArray{ +// &monitoring.ActionGroupAzureAppPushReceiverArgs{ +// Name: pulumi.String("pushtoadmin"), +// EmailAddress: pulumi.String("admin@contoso.com"), +// }, +// }, +// AzureFunctionReceivers: monitoring.ActionGroupAzureFunctionReceiverArray{ +// &monitoring.ActionGroupAzureFunctionReceiverArgs{ +// Name: pulumi.String("funcaction"), +// FunctionAppResourceId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-funcapp/providers/Microsoft.Web/sites/funcapp"), +// FunctionName: pulumi.String("myfunc"), +// HttpTriggerUrl: pulumi.String("https://example.com/trigger"), +// UseCommonAlertSchema: pulumi.Bool(true), +// }, +// }, +// EmailReceivers: monitoring.ActionGroupEmailReceiverArray{ +// &monitoring.ActionGroupEmailReceiverArgs{ +// Name: pulumi.String("sendtoadmin"), +// EmailAddress: pulumi.String("admin@contoso.com"), +// }, +// &monitoring.ActionGroupEmailReceiverArgs{ +// Name: pulumi.String("sendtodevops"), +// EmailAddress: pulumi.String("devops@contoso.com"), +// UseCommonAlertSchema: pulumi.Bool(true), +// }, +// }, +// EventHubReceivers: monitoring.ActionGroupEventHubReceiverArray{ +// &monitoring.ActionGroupEventHubReceiverArgs{ +// Name: pulumi.String("sendtoeventhub"), +// EventHubNamespace: pulumi.String("eventhubnamespace"), +// EventHubName: pulumi.String("eventhub1"), +// SubscriptionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// UseCommonAlertSchema: pulumi.Bool(false), +// }, +// }, +// ItsmReceivers: monitoring.ActionGroupItsmReceiverArray{ +// &monitoring.ActionGroupItsmReceiverArgs{ +// Name: pulumi.String("createorupdateticket"), +// WorkspaceId: exampleAnalyticsWorkspace.WorkspaceId.ApplyT(func(workspaceId string) (string, error) { +// return fmt.Sprintf("%v|%v", current.SubscriptionId, workspaceId), nil +// }).(pulumi.StringOutput), +// ConnectionId: pulumi.String("53de6956-42b4-41ba-be3c-b154cdf17b13"), +// TicketConfiguration: pulumi.String("{\"PayloadRevision\":0,\"WorkItemType\":\"Incident\",\"UseTemplate\":false,\"WorkItemData\":\"{}\",\"CreateOneWIPerCI\":false}"), +// Region: pulumi.String("southcentralus"), +// }, +// }, +// LogicAppReceivers: monitoring.ActionGroupLogicAppReceiverArray{ +// &monitoring.ActionGroupLogicAppReceiverArgs{ +// Name: pulumi.String("logicappaction"), +// ResourceId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-logicapp/providers/Microsoft.Logic/workflows/logicapp"), +// CallbackUrl: pulumi.String("https://logicapptriggerurl/..."), +// UseCommonAlertSchema: pulumi.Bool(true), +// }, +// }, +// SmsReceivers: monitoring.ActionGroupSmsReceiverArray{ +// &monitoring.ActionGroupSmsReceiverArgs{ +// Name: pulumi.String("oncallmsg"), +// CountryCode: pulumi.String("1"), +// PhoneNumber: pulumi.String("1231231234"), +// }, +// }, +// VoiceReceivers: monitoring.ActionGroupVoiceReceiverArray{ +// &monitoring.ActionGroupVoiceReceiverArgs{ +// Name: pulumi.String("remotesupport"), +// CountryCode: pulumi.String("86"), +// PhoneNumber: pulumi.String("13888888888"), +// }, +// }, +// WebhookReceivers: monitoring.ActionGroupWebhookReceiverArray{ +// &monitoring.ActionGroupWebhookReceiverArgs{ +// Name: pulumi.String("callmyapiaswell"), +// ServiceUri: pulumi.String("http://example.com/alert"), +// UseCommonAlertSchema: pulumi.Bool(true), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Action Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/actionRuleActionGroup.go b/sdk/go/azure/monitoring/actionRuleActionGroup.go index 1dbca7e5bb..53c7bb40f5 100644 --- a/sdk/go/azure/monitoring/actionRuleActionGroup.go +++ b/sdk/go/azure/monitoring/actionRuleActionGroup.go @@ -17,6 +17,56 @@ import ( // // !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `monitoring.AlertProcessingRuleActionGroup` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleActionGroup, err := monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewActionRuleActionGroup(ctx, "exampleActionRuleActionGroup", &monitoring.ActionRuleActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ActionGroupId: exampleActionGroup.ID(), +// Scope: &monitoring.ActionRuleActionGroupScopeArgs{ +// Type: pulumi.String("ResourceGroup"), +// ResourceIds: pulumi.StringArray{ +// exampleResourceGroup.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/actionRuleSuppression.go b/sdk/go/azure/monitoring/actionRuleSuppression.go index cfefc03d1e..63fd5ba40f 100644 --- a/sdk/go/azure/monitoring/actionRuleSuppression.go +++ b/sdk/go/azure/monitoring/actionRuleSuppression.go @@ -17,6 +17,61 @@ import ( // // !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `monitoring.AlertProcessingRuleSuppression` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewActionRuleSuppression(ctx, "exampleActionRuleSuppression", &monitoring.ActionRuleSuppressionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &monitoring.ActionRuleSuppressionScopeArgs{ +// Type: pulumi.String("ResourceGroup"), +// ResourceIds: pulumi.StringArray{ +// exampleResourceGroup.ID(), +// }, +// }, +// Suppression: &monitoring.ActionRuleSuppressionSuppressionArgs{ +// RecurrenceType: pulumi.String("Weekly"), +// Schedule: &monitoring.ActionRuleSuppressionSuppressionScheduleArgs{ +// StartDateUtc: pulumi.String("2019-01-01T01:02:03Z"), +// EndDateUtc: pulumi.String("2019-01-03T15:02:07Z"), +// RecurrenceWeeklies: pulumi.StringArray{ +// pulumi.String("Sunday"), +// pulumi.String("Monday"), +// pulumi.String("Friday"), +// pulumi.String("Saturday"), +// }, +// }, +// }, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/activityLogAlert.go b/sdk/go/azure/monitoring/activityLogAlert.go index ab3b2b1bc2..52e57143ea 100644 --- a/sdk/go/azure/monitoring/activityLogAlert.go +++ b/sdk/go/azure/monitoring/activityLogAlert.go @@ -15,6 +15,79 @@ import ( // Manages an Activity Log Alert within Azure Monitor. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// mainActionGroup, err := monitoring.NewActionGroup(ctx, "mainActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: example.Name, +// ShortName: pulumi.String("p0action"), +// WebhookReceivers: monitoring.ActionGroupWebhookReceiverArray{ +// &monitoring.ActionGroupWebhookReceiverArgs{ +// Name: pulumi.String("callmyapi"), +// ServiceUri: pulumi.String("http://example.com/alert"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// toMonitor, err := storage.NewAccount(ctx, "toMonitor", &storage.AccountArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewActivityLogAlert(ctx, "mainActivityLogAlert", &monitoring.ActivityLogAlertArgs{ +// ResourceGroupName: example.Name, +// Scopes: pulumi.StringArray{ +// example.ID(), +// }, +// Description: pulumi.String("This alert will monitor a specific storage account updates."), +// Criteria: &monitoring.ActivityLogAlertCriteriaArgs{ +// ResourceId: toMonitor.ID(), +// OperationName: pulumi.String("Microsoft.Storage/storageAccounts/write"), +// Category: pulumi.String("Recommendation"), +// }, +// Actions: monitoring.ActivityLogAlertActionArray{ +// &monitoring.ActivityLogAlertActionArgs{ +// ActionGroupId: mainActionGroup.ID(), +// WebhookProperties: pulumi.StringMap{ +// "from": pulumi.String("source"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Activity log alerts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/alertProcessingRuleActionGroup.go b/sdk/go/azure/monitoring/alertProcessingRuleActionGroup.go index 0e5671d2a8..d8d5120112 100644 --- a/sdk/go/azure/monitoring/alertProcessingRuleActionGroup.go +++ b/sdk/go/azure/monitoring/alertProcessingRuleActionGroup.go @@ -15,6 +15,92 @@ import ( // Manages an Alert Processing Rule which apply action group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleActionGroup, err := monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("action"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewAlertProcessingRuleActionGroup(ctx, "exampleAlertProcessingRuleActionGroup", &monitoring.AlertProcessingRuleActionGroupArgs{ +// ResourceGroupName: pulumi.String("example"), +// Scopes: pulumi.StringArray{ +// exampleResourceGroup.ID(), +// }, +// AddActionGroupIds: pulumi.StringArray{ +// exampleActionGroup.ID(), +// }, +// Condition: &monitoring.AlertProcessingRuleActionGroupConditionArgs{ +// TargetResourceType: &monitoring.AlertProcessingRuleActionGroupConditionTargetResourceTypeArgs{ +// Operator: pulumi.String("Equals"), +// Values: pulumi.StringArray{ +// pulumi.String("Microsoft.Compute/VirtualMachines"), +// }, +// }, +// Severity: &monitoring.AlertProcessingRuleActionGroupConditionSeverityArgs{ +// Operator: pulumi.String("Equals"), +// Values: pulumi.StringArray{ +// pulumi.String("Sev0"), +// pulumi.String("Sev1"), +// pulumi.String("Sev2"), +// }, +// }, +// }, +// Schedule: &monitoring.AlertProcessingRuleActionGroupScheduleArgs{ +// EffectiveFrom: pulumi.String("2022-01-01T01:02:03"), +// EffectiveUntil: pulumi.String("2022-02-02T01:02:03"), +// TimeZone: pulumi.String("Pacific Standard Time"), +// Recurrence: &monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceArgs{ +// Dailies: monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceDailyArray{ +// &monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceDailyArgs{ +// StartTime: pulumi.String("17:00:00"), +// EndTime: pulumi.String("09:00:00"), +// }, +// }, +// Weeklies: monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceWeeklyArray{ +// &monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceWeeklyArgs{ +// DaysOfWeeks: pulumi.StringArray{ +// pulumi.String("Saturday"), +// pulumi.String("Sunday"), +// }, +// }, +// }, +// }, +// }, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/alertProcessingRuleSuppression.go b/sdk/go/azure/monitoring/alertProcessingRuleSuppression.go index be1e702092..ee9fa14970 100644 --- a/sdk/go/azure/monitoring/alertProcessingRuleSuppression.go +++ b/sdk/go/azure/monitoring/alertProcessingRuleSuppression.go @@ -15,6 +15,82 @@ import ( // Manages an Alert Processing Rule which suppress notifications. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewAlertProcessingRuleSuppression(ctx, "exampleAlertProcessingRuleSuppression", &monitoring.AlertProcessingRuleSuppressionArgs{ +// ResourceGroupName: pulumi.String("example"), +// Scopes: pulumi.StringArray{ +// exampleResourceGroup.ID(), +// }, +// Condition: &monitoring.AlertProcessingRuleSuppressionConditionArgs{ +// TargetResourceType: &monitoring.AlertProcessingRuleSuppressionConditionTargetResourceTypeArgs{ +// Operator: pulumi.String("Equals"), +// Values: pulumi.StringArray{ +// pulumi.String("Microsoft.Compute/VirtualMachines"), +// }, +// }, +// Severity: &monitoring.AlertProcessingRuleSuppressionConditionSeverityArgs{ +// Operator: pulumi.String("Equals"), +// Values: pulumi.StringArray{ +// pulumi.String("Sev0"), +// pulumi.String("Sev1"), +// pulumi.String("Sev2"), +// }, +// }, +// }, +// Schedule: &monitoring.AlertProcessingRuleSuppressionScheduleArgs{ +// EffectiveFrom: pulumi.String("2022-01-01T01:02:03"), +// EffectiveUntil: pulumi.String("2022-02-02T01:02:03"), +// TimeZone: pulumi.String("Pacific Standard Time"), +// Recurrence: &monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceArgs{ +// Dailies: monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceDailyArray{ +// &monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceDailyArgs{ +// StartTime: pulumi.String("17:00:00"), +// EndTime: pulumi.String("09:00:00"), +// }, +// }, +// Weeklies: monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceWeeklyArray{ +// &monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceWeeklyArgs{ +// DaysOfWeeks: pulumi.StringArray{ +// pulumi.String("Saturday"), +// pulumi.String("Sunday"), +// }, +// }, +// }, +// }, +// }, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/autoscaleSetting.go b/sdk/go/azure/monitoring/autoscaleSetting.go index def35ec167..26a381c4a0 100644 --- a/sdk/go/azure/monitoring/autoscaleSetting.go +++ b/sdk/go/azure/monitoring/autoscaleSetting.go @@ -15,6 +15,333 @@ import ( // Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// UpgradeMode: pulumi.String("Manual"), +// Sku: pulumi.String("Standard_F2"), +// Instances: pulumi.Int(2), +// AdminUsername: pulumi.String("myadmin"), +// AdminSshKeys: compute.LinuxVirtualMachineScaleSetAdminSshKeyArray{ +// &compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs{ +// Username: pulumi.String("myadmin"), +// PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com"), +// }, +// }, +// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("TestNetworkProfile"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("TestIPConfiguration"), +// Primary: pulumi.Bool(true), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// }, +// }, +// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("StandardSSD_LRS"), +// }, +// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewAutoscaleSetting(ctx, "exampleAutoscaleSetting", &monitoring.AutoscaleSettingArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// TargetResourceId: exampleLinuxVirtualMachineScaleSet.ID(), +// Profiles: monitoring.AutoscaleSettingProfileArray{ +// &monitoring.AutoscaleSettingProfileArgs{ +// Name: pulumi.String("defaultProfile"), +// Capacity: &monitoring.AutoscaleSettingProfileCapacityArgs{ +// Default: pulumi.Int(1), +// Minimum: pulumi.Int(1), +// Maximum: pulumi.Int(10), +// }, +// Rules: monitoring.AutoscaleSettingProfileRuleArray{ +// &monitoring.AutoscaleSettingProfileRuleArgs{ +// MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{ +// MetricName: pulumi.String("Percentage CPU"), +// MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(), +// TimeGrain: pulumi.String("PT1M"), +// Statistic: pulumi.String("Average"), +// TimeWindow: pulumi.String("PT5M"), +// TimeAggregation: pulumi.String("Average"), +// Operator: pulumi.String("GreaterThan"), +// Threshold: pulumi.Float64(75), +// MetricNamespace: pulumi.String("microsoft.compute/virtualmachinescalesets"), +// Dimensions: monitoring.AutoscaleSettingProfileRuleMetricTriggerDimensionArray{ +// &monitoring.AutoscaleSettingProfileRuleMetricTriggerDimensionArgs{ +// Name: pulumi.String("AppName"), +// Operator: pulumi.String("Equals"), +// Values: pulumi.StringArray{ +// pulumi.String("App1"), +// }, +// }, +// }, +// }, +// ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{ +// Direction: pulumi.String("Increase"), +// Type: pulumi.String("ChangeCount"), +// Value: pulumi.Int(1), +// Cooldown: pulumi.String("PT1M"), +// }, +// }, +// &monitoring.AutoscaleSettingProfileRuleArgs{ +// MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{ +// MetricName: pulumi.String("Percentage CPU"), +// MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(), +// TimeGrain: pulumi.String("PT1M"), +// Statistic: pulumi.String("Average"), +// TimeWindow: pulumi.String("PT5M"), +// TimeAggregation: pulumi.String("Average"), +// Operator: pulumi.String("LessThan"), +// Threshold: pulumi.Float64(25), +// }, +// ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{ +// Direction: pulumi.String("Decrease"), +// Type: pulumi.String("ChangeCount"), +// Value: pulumi.Int(1), +// Cooldown: pulumi.String("PT1M"), +// }, +// }, +// }, +// }, +// }, +// Predictive: &monitoring.AutoscaleSettingPredictiveArgs{ +// ScaleMode: pulumi.String("Enabled"), +// LookAheadTime: pulumi.String("PT5M"), +// }, +// Notification: &monitoring.AutoscaleSettingNotificationArgs{ +// Email: &monitoring.AutoscaleSettingNotificationEmailArgs{ +// SendToSubscriptionAdministrator: pulumi.Bool(true), +// SendToSubscriptionCoAdministrator: pulumi.Bool(true), +// CustomEmails: pulumi.StringArray{ +// pulumi.String("admin@contoso.com"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### For Fixed Dates) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// UpgradeMode: pulumi.String("Manual"), +// Sku: pulumi.String("Standard_F2"), +// Instances: pulumi.Int(2), +// AdminUsername: pulumi.String("myadmin"), +// AdminSshKeys: compute.LinuxVirtualMachineScaleSetAdminSshKeyArray{ +// &compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs{ +// Username: pulumi.String("myadmin"), +// PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com"), +// }, +// }, +// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("TestNetworkProfile"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("TestIPConfiguration"), +// Primary: pulumi.Bool(true), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// }, +// }, +// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("StandardSSD_LRS"), +// }, +// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewAutoscaleSetting(ctx, "exampleAutoscaleSetting", &monitoring.AutoscaleSettingArgs{ +// Enabled: pulumi.Bool(true), +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// TargetResourceId: exampleLinuxVirtualMachineScaleSet.ID(), +// Profiles: monitoring.AutoscaleSettingProfileArray{ +// &monitoring.AutoscaleSettingProfileArgs{ +// Name: pulumi.String("forJuly"), +// Capacity: &monitoring.AutoscaleSettingProfileCapacityArgs{ +// Default: pulumi.Int(1), +// Minimum: pulumi.Int(1), +// Maximum: pulumi.Int(10), +// }, +// Rules: monitoring.AutoscaleSettingProfileRuleArray{ +// &monitoring.AutoscaleSettingProfileRuleArgs{ +// MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{ +// MetricName: pulumi.String("Percentage CPU"), +// MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(), +// TimeGrain: pulumi.String("PT1M"), +// Statistic: pulumi.String("Average"), +// TimeWindow: pulumi.String("PT5M"), +// TimeAggregation: pulumi.String("Average"), +// Operator: pulumi.String("GreaterThan"), +// Threshold: pulumi.Float64(90), +// }, +// ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{ +// Direction: pulumi.String("Increase"), +// Type: pulumi.String("ChangeCount"), +// Value: pulumi.Int(2), +// Cooldown: pulumi.String("PT1M"), +// }, +// }, +// &monitoring.AutoscaleSettingProfileRuleArgs{ +// MetricTrigger: &monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs{ +// MetricName: pulumi.String("Percentage CPU"), +// MetricResourceId: exampleLinuxVirtualMachineScaleSet.ID(), +// TimeGrain: pulumi.String("PT1M"), +// Statistic: pulumi.String("Average"), +// TimeWindow: pulumi.String("PT5M"), +// TimeAggregation: pulumi.String("Average"), +// Operator: pulumi.String("LessThan"), +// Threshold: pulumi.Float64(10), +// }, +// ScaleAction: &monitoring.AutoscaleSettingProfileRuleScaleActionArgs{ +// Direction: pulumi.String("Decrease"), +// Type: pulumi.String("ChangeCount"), +// Value: pulumi.Int(2), +// Cooldown: pulumi.String("PT1M"), +// }, +// }, +// }, +// FixedDate: &monitoring.AutoscaleSettingProfileFixedDateArgs{ +// Timezone: pulumi.String("Pacific Standard Time"), +// Start: pulumi.String("2020-07-01T00:00:00Z"), +// End: pulumi.String("2020-07-31T23:59:59Z"), +// }, +// }, +// }, +// Notification: &monitoring.AutoscaleSettingNotificationArgs{ +// Email: &monitoring.AutoscaleSettingNotificationEmailArgs{ +// SendToSubscriptionAdministrator: pulumi.Bool(true), +// SendToSubscriptionCoAdministrator: pulumi.Bool(true), +// CustomEmails: pulumi.StringArray{ +// pulumi.String("admin@contoso.com"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // AutoScale Setting can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/dataCollectionEndpoint.go b/sdk/go/azure/monitoring/dataCollectionEndpoint.go index c3f780c945..1078dddd9c 100644 --- a/sdk/go/azure/monitoring/dataCollectionEndpoint.go +++ b/sdk/go/azure/monitoring/dataCollectionEndpoint.go @@ -15,6 +15,46 @@ import ( // Manages a Data Collection Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewDataCollectionEndpoint(ctx, "exampleDataCollectionEndpoint", &monitoring.DataCollectionEndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Kind: pulumi.String("Windows"), +// PublicNetworkAccessEnabled: pulumi.Bool(true), +// Description: pulumi.String("monitor_data_collection_endpoint example"), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Collection Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/dataCollectionRule.go b/sdk/go/azure/monitoring/dataCollectionRule.go index 032aef3cee..538ea91b1a 100644 --- a/sdk/go/azure/monitoring/dataCollectionRule.go +++ b/sdk/go/azure/monitoring/dataCollectionRule.go @@ -15,6 +15,288 @@ import ( // Manages a Data Collection Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsSolution, err := operationalinsights.NewAnalyticsSolution(ctx, "exampleAnalyticsSolution", &operationalinsights.AnalyticsSolutionArgs{ +// SolutionName: pulumi.String("WindowsEventForwarding"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// Plan: &operationalinsights.AnalyticsSolutionPlanArgs{ +// Publisher: pulumi.String("Microsoft"), +// Product: pulumi.String("OMSGallery/WindowsEventForwarding"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleDataCollectionEndpoint, err := monitoring.NewDataCollectionEndpoint(ctx, "exampleDataCollectionEndpoint", &monitoring.DataCollectionEndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(map[string]interface{}{ +// "a": 1, +// "b": "hello", +// }) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = monitoring.NewDataCollectionRule(ctx, "exampleDataCollectionRule", &monitoring.DataCollectionRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// DataCollectionEndpointId: exampleDataCollectionEndpoint.ID(), +// Destinations: &monitoring.DataCollectionRuleDestinationsArgs{ +// LogAnalytics: monitoring.DataCollectionRuleDestinationsLogAnalyticArray{ +// &monitoring.DataCollectionRuleDestinationsLogAnalyticArgs{ +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// Name: pulumi.String("example-destination-log"), +// }, +// }, +// EventHub: &monitoring.DataCollectionRuleDestinationsEventHubArgs{ +// EventHubId: exampleEventHub.ID(), +// Name: pulumi.String("example-destination-eventhub"), +// }, +// StorageBlobs: monitoring.DataCollectionRuleDestinationsStorageBlobArray{ +// &monitoring.DataCollectionRuleDestinationsStorageBlobArgs{ +// StorageAccountId: exampleAccount.ID(), +// ContainerName: exampleContainer.Name, +// Name: pulumi.String("example-destination-storage"), +// }, +// }, +// AzureMonitorMetrics: &monitoring.DataCollectionRuleDestinationsAzureMonitorMetricsArgs{ +// Name: pulumi.String("example-destination-metrics"), +// }, +// }, +// DataFlows: monitoring.DataCollectionRuleDataFlowArray{ +// &monitoring.DataCollectionRuleDataFlowArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-InsightsMetrics"), +// }, +// Destinations: pulumi.StringArray{ +// pulumi.String("example-destination-metrics"), +// }, +// }, +// &monitoring.DataCollectionRuleDataFlowArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-InsightsMetrics"), +// pulumi.String("Microsoft-Syslog"), +// pulumi.String("Microsoft-Perf"), +// }, +// Destinations: pulumi.StringArray{ +// pulumi.String("example-destination-log"), +// }, +// }, +// &monitoring.DataCollectionRuleDataFlowArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Custom-MyTableRawData"), +// }, +// Destinations: pulumi.StringArray{ +// pulumi.String("example-destination-log"), +// }, +// OutputStream: pulumi.String("Microsoft-Syslog"), +// TransformKql: pulumi.String("source | project TimeGenerated = Time, Computer, Message = AdditionalContext"), +// }, +// }, +// DataSources: &monitoring.DataCollectionRuleDataSourcesArgs{ +// Syslogs: monitoring.DataCollectionRuleDataSourcesSyslogArray{ +// &monitoring.DataCollectionRuleDataSourcesSyslogArgs{ +// FacilityNames: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// LogLevels: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// Name: pulumi.String("example-datasource-syslog"), +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-Syslog"), +// }, +// }, +// }, +// IisLogs: monitoring.DataCollectionRuleDataSourcesIisLogArray{ +// &monitoring.DataCollectionRuleDataSourcesIisLogArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-W3CIISLog"), +// }, +// Name: pulumi.String("example-datasource-iis"), +// LogDirectories: pulumi.StringArray{ +// pulumi.String("C:\\Logs\\W3SVC1"), +// }, +// }, +// }, +// LogFiles: monitoring.DataCollectionRuleDataSourcesLogFileArray{ +// &monitoring.DataCollectionRuleDataSourcesLogFileArgs{ +// Name: pulumi.String("example-datasource-logfile"), +// Format: pulumi.String("text"), +// Streams: pulumi.StringArray{ +// pulumi.String("Custom-MyTableRawData"), +// }, +// FilePatterns: pulumi.StringArray{ +// pulumi.String("C:\\JavaLogs\\*.log"), +// }, +// Settings: &monitoring.DataCollectionRuleDataSourcesLogFileSettingsArgs{ +// Text: &monitoring.DataCollectionRuleDataSourcesLogFileSettingsTextArgs{ +// RecordStartTimestampFormat: pulumi.String("ISO 8601"), +// }, +// }, +// }, +// }, +// PerformanceCounters: monitoring.DataCollectionRuleDataSourcesPerformanceCounterArray{ +// &monitoring.DataCollectionRuleDataSourcesPerformanceCounterArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-Perf"), +// pulumi.String("Microsoft-InsightsMetrics"), +// }, +// SamplingFrequencyInSeconds: pulumi.Int(60), +// CounterSpecifiers: pulumi.StringArray{ +// pulumi.String("Processor(*)\\% Processor Time"), +// }, +// Name: pulumi.String("example-datasource-perfcounter"), +// }, +// }, +// WindowsEventLogs: monitoring.DataCollectionRuleDataSourcesWindowsEventLogArray{ +// &monitoring.DataCollectionRuleDataSourcesWindowsEventLogArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-WindowsEvent"), +// }, +// XPathQueries: pulumi.StringArray{ +// pulumi.String("*![System/Level=1]"), +// }, +// Name: pulumi.String("example-datasource-wineventlog"), +// }, +// }, +// Extensions: monitoring.DataCollectionRuleDataSourcesExtensionArray{ +// &monitoring.DataCollectionRuleDataSourcesExtensionArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-WindowsEvent"), +// }, +// InputDataSources: pulumi.StringArray{ +// pulumi.String("example-datasource-wineventlog"), +// }, +// ExtensionName: pulumi.String("example-extension-name"), +// ExtensionJson: pulumi.String(json0), +// Name: pulumi.String("example-datasource-extension"), +// }, +// }, +// }, +// StreamDeclarations: monitoring.DataCollectionRuleStreamDeclarationArray{ +// &monitoring.DataCollectionRuleStreamDeclarationArgs{ +// StreamName: pulumi.String("Custom-MyTableRawData"), +// Columns: monitoring.DataCollectionRuleStreamDeclarationColumnArray{ +// &monitoring.DataCollectionRuleStreamDeclarationColumnArgs{ +// Name: pulumi.String("Time"), +// Type: pulumi.String("datetime"), +// }, +// &monitoring.DataCollectionRuleStreamDeclarationColumnArgs{ +// Name: pulumi.String("Computer"), +// Type: pulumi.String("string"), +// }, +// &monitoring.DataCollectionRuleStreamDeclarationColumnArgs{ +// Name: pulumi.String("AdditionalContext"), +// Type: pulumi.String("string"), +// }, +// }, +// }, +// }, +// Identity: &monitoring.DataCollectionRuleIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Description: pulumi.String("data collection rule example"), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAnalyticsSolution, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Collection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/dataCollectionRuleAssociation.go b/sdk/go/azure/monitoring/dataCollectionRuleAssociation.go index e58ae94de1..371a4a47af 100644 --- a/sdk/go/azure/monitoring/dataCollectionRuleAssociation.go +++ b/sdk/go/azure/monitoring/dataCollectionRuleAssociation.go @@ -15,6 +15,138 @@ import ( // Manages a Data Collection Rule Association. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_B1ls"), +// AdminUsername: pulumi.String("adminuser"), +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// AdminPassword: pulumi.String("example-Password@7890"), +// DisablePasswordAuthentication: pulumi.Bool(false), +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleDataCollectionRule, err := monitoring.NewDataCollectionRule(ctx, "exampleDataCollectionRule", &monitoring.DataCollectionRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Destinations: &monitoring.DataCollectionRuleDestinationsArgs{ +// AzureMonitorMetrics: &monitoring.DataCollectionRuleDestinationsAzureMonitorMetricsArgs{ +// Name: pulumi.String("example-destination-metrics"), +// }, +// }, +// DataFlows: monitoring.DataCollectionRuleDataFlowArray{ +// &monitoring.DataCollectionRuleDataFlowArgs{ +// Streams: pulumi.StringArray{ +// pulumi.String("Microsoft-InsightsMetrics"), +// }, +// Destinations: pulumi.StringArray{ +// pulumi.String("example-destination-metrics"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleDataCollectionEndpoint, err := monitoring.NewDataCollectionEndpoint(ctx, "exampleDataCollectionEndpoint", &monitoring.DataCollectionEndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewDataCollectionRuleAssociation(ctx, "example1", &monitoring.DataCollectionRuleAssociationArgs{ +// TargetResourceId: exampleLinuxVirtualMachine.ID(), +// DataCollectionRuleId: exampleDataCollectionRule.ID(), +// Description: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewDataCollectionRuleAssociation(ctx, "example2", &monitoring.DataCollectionRuleAssociationArgs{ +// TargetResourceId: exampleLinuxVirtualMachine.ID(), +// DataCollectionEndpointId: exampleDataCollectionEndpoint.ID(), +// Description: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Collection Rules Association can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/diagnosticSetting.go b/sdk/go/azure/monitoring/diagnosticSetting.go index a5fee153d1..dc9c3386c1 100644 --- a/sdk/go/azure/monitoring/diagnosticSetting.go +++ b/sdk/go/azure/monitoring/diagnosticSetting.go @@ -15,6 +15,82 @@ import ( // Manages a Diagnostic Setting for an existing Resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SoftDeleteRetentionDays: pulumi.Int(7), +// PurgeProtectionEnabled: pulumi.Bool(false), +// SkuName: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewDiagnosticSetting(ctx, "exampleDiagnosticSetting", &monitoring.DiagnosticSettingArgs{ +// TargetResourceId: exampleKeyVault.ID(), +// StorageAccountId: exampleAccount.ID(), +// EnabledLogs: monitoring.DiagnosticSettingEnabledLogArray{ +// &monitoring.DiagnosticSettingEnabledLogArgs{ +// Category: pulumi.String("AuditEvent"), +// RetentionPolicy: &monitoring.DiagnosticSettingEnabledLogRetentionPolicyArgs{ +// Enabled: pulumi.Bool(false), +// }, +// }, +// }, +// Metrics: monitoring.DiagnosticSettingMetricArray{ +// &monitoring.DiagnosticSettingMetricArgs{ +// Category: pulumi.String("AllMetrics"), +// RetentionPolicy: &monitoring.DiagnosticSettingMetricRetentionPolicyArgs{ +// Enabled: pulumi.Bool(false), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/getActionGroup.go b/sdk/go/azure/monitoring/getActionGroup.go index 0d32ec3259..548befa975 100644 --- a/sdk/go/azure/monitoring/getActionGroup.go +++ b/sdk/go/azure/monitoring/getActionGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access the properties of an Action Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := monitoring.LookupActionGroup(ctx, &monitoring.LookupActionGroupArgs{ +// ResourceGroupName: "example-rg", +// Name: "tfex-actiongroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("actionGroupId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupActionGroup(ctx *pulumi.Context, args *LookupActionGroupArgs, opts ...pulumi.InvokeOption) (*LookupActionGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupActionGroupResult diff --git a/sdk/go/azure/monitoring/getDataCollectionEndpoint.go b/sdk/go/azure/monitoring/getDataCollectionEndpoint.go index b4c6662943..68f2b3e88b 100644 --- a/sdk/go/azure/monitoring/getDataCollectionEndpoint.go +++ b/sdk/go/azure/monitoring/getDataCollectionEndpoint.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Data Collection Endpoint. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := monitoring.LookupDataCollectionEndpoint(ctx, &monitoring.LookupDataCollectionEndpointArgs{ +// Name: "example-mdce", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("endpointId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDataCollectionEndpoint(ctx *pulumi.Context, args *LookupDataCollectionEndpointArgs, opts ...pulumi.InvokeOption) (*LookupDataCollectionEndpointResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDataCollectionEndpointResult diff --git a/sdk/go/azure/monitoring/getDataCollectionRule.go b/sdk/go/azure/monitoring/getDataCollectionRule.go index 4b9f2b5297..625769c560 100644 --- a/sdk/go/azure/monitoring/getDataCollectionRule.go +++ b/sdk/go/azure/monitoring/getDataCollectionRule.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Data Collection Rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := monitoring.LookupDataCollectionRule(ctx, &monitoring.LookupDataCollectionRuleArgs{ +// Name: "example-rule", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("ruleId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDataCollectionRule(ctx *pulumi.Context, args *LookupDataCollectionRuleArgs, opts ...pulumi.InvokeOption) (*LookupDataCollectionRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDataCollectionRuleResult diff --git a/sdk/go/azure/monitoring/getDiagnosticCategories.go b/sdk/go/azure/monitoring/getDiagnosticCategories.go index 8a7af59dc9..2bffd7c2e0 100644 --- a/sdk/go/azure/monitoring/getDiagnosticCategories.go +++ b/sdk/go/azure/monitoring/getDiagnosticCategories.go @@ -13,6 +13,40 @@ import ( ) // Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleKeyVault, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{ +// Name: azurerm_key_vault.Example.Name, +// ResourceGroupName: azurerm_key_vault.Example.Resource_group_name, +// }, nil) +// if err != nil { +// return err +// } +// _, err = monitoring.GetDiagnosticCategories(ctx, &monitoring.GetDiagnosticCategoriesArgs{ +// ResourceId: exampleKeyVault.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetDiagnosticCategories(ctx *pulumi.Context, args *GetDiagnosticCategoriesArgs, opts ...pulumi.InvokeOption) (*GetDiagnosticCategoriesResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetDiagnosticCategoriesResult diff --git a/sdk/go/azure/monitoring/getLogProfile.go b/sdk/go/azure/monitoring/getLogProfile.go index c6aa308405..f691e3e4e0 100644 --- a/sdk/go/azure/monitoring/getLogProfile.go +++ b/sdk/go/azure/monitoring/getLogProfile.go @@ -15,6 +15,33 @@ import ( // Use this data source to access the properties of a Log Profile. // // !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := monitoring.LookupLogProfile(ctx, &monitoring.LookupLogProfileArgs{ +// Name: "test-logprofile", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("logProfileStorageAccountId", example.StorageAccountId) +// return nil +// }) +// } +// +// ``` func LookupLogProfile(ctx *pulumi.Context, args *LookupLogProfileArgs, opts ...pulumi.InvokeOption) (*LookupLogProfileResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupLogProfileResult diff --git a/sdk/go/azure/monitoring/getScheduledQueryRulesAlert.go b/sdk/go/azure/monitoring/getScheduledQueryRulesAlert.go index ca70554413..071678bfc3 100644 --- a/sdk/go/azure/monitoring/getScheduledQueryRulesAlert.go +++ b/sdk/go/azure/monitoring/getScheduledQueryRulesAlert.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access the properties of an AlertingAction scheduled query rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := monitoring.LookupScheduledQueryRulesAlert(ctx, &monitoring.LookupScheduledQueryRulesAlertArgs{ +// ResourceGroupName: "example-rg", +// Name: "tfex-queryrule", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("queryRuleId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupScheduledQueryRulesAlert(ctx *pulumi.Context, args *LookupScheduledQueryRulesAlertArgs, opts ...pulumi.InvokeOption) (*LookupScheduledQueryRulesAlertResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupScheduledQueryRulesAlertResult diff --git a/sdk/go/azure/monitoring/getScheduledQueryRulesLog.go b/sdk/go/azure/monitoring/getScheduledQueryRulesLog.go index b488da06c5..44a3cc2bb0 100644 --- a/sdk/go/azure/monitoring/getScheduledQueryRulesLog.go +++ b/sdk/go/azure/monitoring/getScheduledQueryRulesLog.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access the properties of a LogToMetricAction scheduled query rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := monitoring.LookupScheduledQueryRulesLog(ctx, &monitoring.LookupScheduledQueryRulesLogArgs{ +// ResourceGroupName: "example-rg", +// Name: "tfex-queryrule", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("queryRuleId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupScheduledQueryRulesLog(ctx *pulumi.Context, args *LookupScheduledQueryRulesLogArgs, opts ...pulumi.InvokeOption) (*LookupScheduledQueryRulesLogResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupScheduledQueryRulesLogResult diff --git a/sdk/go/azure/monitoring/logProfile.go b/sdk/go/azure/monitoring/logProfile.go index 8a97ec8860..0c2119d4dd 100644 --- a/sdk/go/azure/monitoring/logProfile.go +++ b/sdk/go/azure/monitoring/logProfile.go @@ -19,6 +19,77 @@ import ( // // !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewLogProfile(ctx, "exampleLogProfile", &monitoring.LogProfileArgs{ +// Categories: pulumi.StringArray{ +// pulumi.String("Action"), +// pulumi.String("Delete"), +// pulumi.String("Write"), +// }, +// Locations: pulumi.StringArray{ +// pulumi.String("westus"), +// pulumi.String("global"), +// }, +// ServicebusRuleId: exampleEventHubNamespace.ID().ApplyT(func(id string) (string, error) { +// return fmt.Sprintf("%v/authorizationrules/RootManageSharedAccessKey", id), nil +// }).(pulumi.StringOutput), +// StorageAccountId: exampleAccount.ID(), +// RetentionPolicy: &monitoring.LogProfileRetentionPolicyArgs{ +// Enabled: pulumi.Bool(true), +// Days: pulumi.Int(7), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Log Profile can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/logzMonitor.go b/sdk/go/azure/monitoring/logzMonitor.go index 56a4cc283d..80c7060468 100644 --- a/sdk/go/azure/monitoring/logzMonitor.go +++ b/sdk/go/azure/monitoring/logzMonitor.go @@ -15,6 +15,51 @@ import ( // Manages a logz Monitor. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewLogzMonitor(ctx, "exampleLogzMonitor", &monitoring.LogzMonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Plan: &monitoring.LogzMonitorPlanArgs{ +// BillingCycle: pulumi.String("MONTHLY"), +// EffectiveDate: pulumi.String("2022-06-06T00:00:00Z"), +// UsageType: pulumi.String("COMMITTED"), +// }, +// User: &monitoring.LogzMonitorUserArgs{ +// Email: pulumi.String("user@example.com"), +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// PhoneNumber: pulumi.String("+12313803556"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // logz Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/logzSubAccount.go b/sdk/go/azure/monitoring/logzSubAccount.go index e3cf6213f2..ae20ca4302 100644 --- a/sdk/go/azure/monitoring/logzSubAccount.go +++ b/sdk/go/azure/monitoring/logzSubAccount.go @@ -15,6 +15,71 @@ import ( // Manages a logz Sub Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLogzMonitor, err := monitoring.NewLogzMonitor(ctx, "exampleLogzMonitor", &monitoring.LogzMonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Plan: &monitoring.LogzMonitorPlanArgs{ +// BillingCycle: pulumi.String("MONTHLY"), +// EffectiveDate: pulumi.String("2022-06-06T00:00:00Z"), +// UsageType: pulumi.String("COMMITTED"), +// }, +// User: &monitoring.LogzMonitorUserArgs{ +// Email: pulumi.String("user@example.com"), +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// PhoneNumber: pulumi.String("+12313803556"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewLogzSubAccount(ctx, "exampleLogzSubAccount", &monitoring.LogzSubAccountArgs{ +// LogzMonitorId: exampleLogzMonitor.ID(), +// User: &monitoring.LogzSubAccountUserArgs{ +// Email: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.Email, nil +// }).(pulumi.StringPtrOutput), +// FirstName: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.FirstName, nil +// }).(pulumi.StringPtrOutput), +// LastName: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.LastName, nil +// }).(pulumi.StringPtrOutput), +// PhoneNumber: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.PhoneNumber, nil +// }).(pulumi.StringPtrOutput), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // logz SubAccounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/logzSubAccountTagRule.go b/sdk/go/azure/monitoring/logzSubAccountTagRule.go index 0fa41c97d3..275dc8ff33 100644 --- a/sdk/go/azure/monitoring/logzSubAccountTagRule.go +++ b/sdk/go/azure/monitoring/logzSubAccountTagRule.go @@ -15,6 +15,92 @@ import ( // Manages a Logz Sub Account Tag Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLogzMonitor, err := monitoring.NewLogzMonitor(ctx, "exampleLogzMonitor", &monitoring.LogzMonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Plan: &monitoring.LogzMonitorPlanArgs{ +// BillingCycle: pulumi.String("MONTHLY"), +// EffectiveDate: pulumi.String("2022-06-06T00:00:00Z"), +// UsageType: pulumi.String("COMMITTED"), +// }, +// User: &monitoring.LogzMonitorUserArgs{ +// Email: pulumi.String("user@example.com"), +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// PhoneNumber: pulumi.String("+12313803556"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleLogzSubAccount, err := monitoring.NewLogzSubAccount(ctx, "exampleLogzSubAccount", &monitoring.LogzSubAccountArgs{ +// LogzMonitorId: exampleLogzMonitor.ID(), +// User: &monitoring.LogzSubAccountUserArgs{ +// Email: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.Email, nil +// }).(pulumi.StringPtrOutput), +// FirstName: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.FirstName, nil +// }).(pulumi.StringPtrOutput), +// LastName: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.LastName, nil +// }).(pulumi.StringPtrOutput), +// PhoneNumber: exampleLogzMonitor.User.ApplyT(func(user monitoring.LogzMonitorUser) (*string, error) { +// return &user.PhoneNumber, nil +// }).(pulumi.StringPtrOutput), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewLogzSubAccountTagRule(ctx, "exampleLogzSubAccountTagRule", &monitoring.LogzSubAccountTagRuleArgs{ +// LogzSubAccountId: exampleLogzSubAccount.ID(), +// SendAadLogs: pulumi.Bool(true), +// SendActivityLogs: pulumi.Bool(true), +// SendSubscriptionLogs: pulumi.Bool(true), +// TagFilters: monitoring.LogzSubAccountTagRuleTagFilterArray{ +// &monitoring.LogzSubAccountTagRuleTagFilterArgs{ +// Name: pulumi.String("name1"), +// Action: pulumi.String("Include"), +// Value: pulumi.String("value1"), +// }, +// &monitoring.LogzSubAccountTagRuleTagFilterArgs{ +// Name: pulumi.String("name2"), +// Action: pulumi.String("Exclude"), +// Value: pulumi.String("value2"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Logz Sub Account Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/logzTagRule.go b/sdk/go/azure/monitoring/logzTagRule.go index d4186fb0dc..1423b39056 100644 --- a/sdk/go/azure/monitoring/logzTagRule.go +++ b/sdk/go/azure/monitoring/logzTagRule.go @@ -15,6 +15,72 @@ import ( // Manages a logz Tag Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLogzMonitor, err := monitoring.NewLogzMonitor(ctx, "exampleLogzMonitor", &monitoring.LogzMonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Plan: &monitoring.LogzMonitorPlanArgs{ +// BillingCycle: pulumi.String("MONTHLY"), +// EffectiveDate: pulumi.String("2022-06-06T00:00:00Z"), +// UsageType: pulumi.String("COMMITTED"), +// }, +// User: &monitoring.LogzMonitorUserArgs{ +// Email: pulumi.String("user@example.com"), +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// PhoneNumber: pulumi.String("+12313803556"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewLogzTagRule(ctx, "exampleLogzTagRule", &monitoring.LogzTagRuleArgs{ +// LogzMonitorId: exampleLogzMonitor.ID(), +// TagFilters: monitoring.LogzTagRuleTagFilterArray{ +// &monitoring.LogzTagRuleTagFilterArgs{ +// Name: pulumi.String("name1"), +// Action: pulumi.String("Include"), +// Value: pulumi.String("value1"), +// }, +// &monitoring.LogzTagRuleTagFilterArgs{ +// Name: pulumi.String("name2"), +// Action: pulumi.String("Exclude"), +// Value: pulumi.String("value2"), +// }, +// }, +// SendAadLogs: pulumi.Bool(true), +// SendActivityLogs: pulumi.Bool(true), +// SendSubscriptionLogs: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // logz Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/metricAlert.go b/sdk/go/azure/monitoring/metricAlert.go index a566f7bb7c..a408e90673 100644 --- a/sdk/go/azure/monitoring/metricAlert.go +++ b/sdk/go/azure/monitoring/metricAlert.go @@ -15,6 +15,89 @@ import ( // Manages a Metric Alert within Azure Monitor. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// toMonitor, err := storage.NewAccount(ctx, "toMonitor", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// main, err := monitoring.NewActionGroup(ctx, "main", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("exampleact"), +// WebhookReceivers: monitoring.ActionGroupWebhookReceiverArray{ +// &monitoring.ActionGroupWebhookReceiverArgs{ +// Name: pulumi.String("callmyapi"), +// ServiceUri: pulumi.String("http://example.com/alert"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewMetricAlert(ctx, "exampleMetricAlert", &monitoring.MetricAlertArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Scopes: pulumi.StringArray{ +// toMonitor.ID(), +// }, +// Description: pulumi.String("Action will be triggered when Transactions count is greater than 50."), +// Criterias: monitoring.MetricAlertCriteriaArray{ +// &monitoring.MetricAlertCriteriaArgs{ +// MetricNamespace: pulumi.String("Microsoft.Storage/storageAccounts"), +// MetricName: pulumi.String("Transactions"), +// Aggregation: pulumi.String("Total"), +// Operator: pulumi.String("GreaterThan"), +// Threshold: pulumi.Float64(50), +// Dimensions: monitoring.MetricAlertCriteriaDimensionArray{ +// &monitoring.MetricAlertCriteriaDimensionArgs{ +// Name: pulumi.String("ApiName"), +// Operator: pulumi.String("Include"), +// Values: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// }, +// }, +// }, +// }, +// Actions: monitoring.MetricAlertActionArray{ +// &monitoring.MetricAlertActionArgs{ +// ActionGroupId: main.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Metric Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/privateLinkScope.go b/sdk/go/azure/monitoring/privateLinkScope.go index fdd0f51b7a..f8248c744b 100644 --- a/sdk/go/azure/monitoring/privateLinkScope.go +++ b/sdk/go/azure/monitoring/privateLinkScope.go @@ -15,6 +15,39 @@ import ( // Manages an Azure Monitor Private Link Scope. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewPrivateLinkScope(ctx, "examplePrivateLinkScope", &monitoring.PrivateLinkScopeArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Monitor Private Link Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/privateLinkScopedService.go b/sdk/go/azure/monitoring/privateLinkScopedService.go index 3b4c3bc1d8..68bbb31dd8 100644 --- a/sdk/go/azure/monitoring/privateLinkScopedService.go +++ b/sdk/go/azure/monitoring/privateLinkScopedService.go @@ -15,6 +15,56 @@ import ( // Manages an Azure Monitor Private Link Scoped Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// examplePrivateLinkScope, err := monitoring.NewPrivateLinkScope(ctx, "examplePrivateLinkScope", &monitoring.PrivateLinkScopeArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewPrivateLinkScopedService(ctx, "examplePrivateLinkScopedService", &monitoring.PrivateLinkScopedServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ScopeName: examplePrivateLinkScope.Name, +// LinkedResourceId: exampleInsights.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Monitor Private Link Scoped Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/scheduledQueryRulesLog.go b/sdk/go/azure/monitoring/scheduledQueryRulesLog.go index f7b2146d27..c0a3ce8552 100644 --- a/sdk/go/azure/monitoring/scheduledQueryRulesLog.go +++ b/sdk/go/azure/monitoring/scheduledQueryRulesLog.go @@ -15,6 +15,107 @@ import ( // Manages a LogToMetricAction Scheduled Query Rules resource within Azure Monitor. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// exampleActionGroup, err := monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("exampleact"), +// WebhookReceivers: monitoring.ActionGroupWebhookReceiverArray{ +// &monitoring.ActionGroupWebhookReceiverArgs{ +// Name: pulumi.String("callmyapi"), +// ServiceUri: pulumi.String("http://example.com/alert"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewMetricAlert(ctx, "exampleMetricAlert", &monitoring.MetricAlertArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Scopes: pulumi.StringArray{ +// exampleAnalyticsWorkspace.ID(), +// }, +// Description: pulumi.String("Action will be triggered when Average_% Idle Time metric is less than 10."), +// Frequency: pulumi.String("PT1M"), +// WindowSize: pulumi.String("PT5M"), +// Criterias: monitoring.MetricAlertCriteriaArray{ +// &monitoring.MetricAlertCriteriaArgs{ +// MetricNamespace: pulumi.String("Microsoft.OperationalInsights/workspaces"), +// MetricName: pulumi.String("UsedCapacity"), +// Aggregation: pulumi.String("Average"), +// Operator: pulumi.String("LessThan"), +// Threshold: pulumi.Float64(10), +// }, +// }, +// Actions: monitoring.MetricAlertActionArray{ +// &monitoring.MetricAlertActionArgs{ +// ActionGroupId: exampleActionGroup.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewScheduledQueryRulesLog(ctx, "exampleScheduledQueryRulesLog", &monitoring.ScheduledQueryRulesLogArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Criteria: &monitoring.ScheduledQueryRulesLogCriteriaArgs{ +// MetricName: pulumi.String("Average_% Idle Time"), +// Dimensions: monitoring.ScheduledQueryRulesLogCriteriaDimensionArray{ +// &monitoring.ScheduledQueryRulesLogCriteriaDimensionArgs{ +// Name: pulumi.String("Computer"), +// Operator: pulumi.String("Include"), +// Values: pulumi.StringArray{ +// pulumi.String("targetVM"), +// }, +// }, +// }, +// }, +// DataSourceId: exampleAnalyticsWorkspace.ID(), +// Description: pulumi.String("Scheduled query rule LogToMetric example"), +// Enabled: pulumi.Bool(true), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Scheduled Query Rule Log can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/smartDetectorAlertRule.go b/sdk/go/azure/monitoring/smartDetectorAlertRule.go index 06bc57dfb2..bb01c26801 100644 --- a/sdk/go/azure/monitoring/smartDetectorAlertRule.go +++ b/sdk/go/azure/monitoring/smartDetectorAlertRule.go @@ -15,6 +15,66 @@ import ( // Manages an Monitor Smart Detector Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleInsights, err := appinsights.NewInsights(ctx, "exampleInsights", &appinsights.InsightsArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ApplicationType: pulumi.String("web"), +// }) +// if err != nil { +// return err +// } +// exampleActionGroup, err := monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ShortName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewSmartDetectorAlertRule(ctx, "exampleSmartDetectorAlertRule", &monitoring.SmartDetectorAlertRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Severity: pulumi.String("Sev0"), +// ScopeResourceIds: pulumi.StringArray{ +// exampleInsights.ID(), +// }, +// Frequency: pulumi.String("PT1M"), +// DetectorType: pulumi.String("FailureAnomaliesDetector"), +// ActionGroup: &monitoring.SmartDetectorAlertRuleActionGroupArgs{ +// Ids: pulumi.StringArray{ +// exampleActionGroup.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Monitor Smart Detector Alert Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/monitoring/workspace.go b/sdk/go/azure/monitoring/workspace.go index f06187bf27..00cfbc635c 100644 --- a/sdk/go/azure/monitoring/workspace.go +++ b/sdk/go/azure/monitoring/workspace.go @@ -15,6 +15,43 @@ import ( // Manages an Azure Monitor Workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = monitoring.NewWorkspace(ctx, "exampleWorkspace", &monitoring.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Monitor Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/msi/userAssignedIdentity.go b/sdk/go/azure/msi/userAssignedIdentity.go index e5abd9d8ef..6ab8255fe4 100644 --- a/sdk/go/azure/msi/userAssignedIdentity.go +++ b/sdk/go/azure/msi/userAssignedIdentity.go @@ -17,6 +17,40 @@ import ( // // Manages a User Assigned Identity. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/database.go b/sdk/go/azure/mssql/database.go index 3e83e1561f..cb63d26157 100644 --- a/sdk/go/azure/mssql/database.go +++ b/sdk/go/azure/mssql/database.go @@ -15,6 +15,68 @@ import ( // Manages a MS SQL Database. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewDatabase(ctx, "test", &mssql.DatabaseArgs{ +// ServerId: exampleServer.ID(), +// Collation: pulumi.String("SQL_Latin1_General_CP1_CI_AS"), +// LicenseType: pulumi.String("LicenseIncluded"), +// MaxSizeGb: pulumi.Int(4), +// ReadScale: pulumi.Bool(true), +// SkuName: pulumi.String("S0"), +// ZoneRedundant: pulumi.Bool(true), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/databaseExtendedAuditingPolicy.go b/sdk/go/azure/mssql/databaseExtendedAuditingPolicy.go index 82de7637f8..378005ef93 100644 --- a/sdk/go/azure/mssql/databaseExtendedAuditingPolicy.go +++ b/sdk/go/azure/mssql/databaseExtendedAuditingPolicy.go @@ -15,6 +15,69 @@ import ( // Manages a MS SQL Database Extended Auditing Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("AdminPassword123!"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := mssql.NewDatabase(ctx, "exampleDatabase", &mssql.DatabaseArgs{ +// ServerId: exampleServer.ID(), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewDatabaseExtendedAuditingPolicy(ctx, "exampleDatabaseExtendedAuditingPolicy", &mssql.DatabaseExtendedAuditingPolicyArgs{ +// DatabaseId: exampleDatabase.ID(), +// StorageEndpoint: exampleAccount.PrimaryBlobEndpoint, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// StorageAccountAccessKeyIsSecondary: pulumi.Bool(false), +// RetentionInDays: pulumi.Int(6), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MS SQL Database Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/databaseVulnerabilityAssessmentRuleBaseline.go b/sdk/go/azure/mssql/databaseVulnerabilityAssessmentRuleBaseline.go index ed04caabeb..1518ff22cd 100644 --- a/sdk/go/azure/mssql/databaseVulnerabilityAssessmentRuleBaseline.go +++ b/sdk/go/azure/mssql/databaseVulnerabilityAssessmentRuleBaseline.go @@ -17,6 +17,117 @@ import ( // // > **NOTE** Database Vulnerability Assessment is currently only available for MS SQL databases. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleServerSecurityAlertPolicy, err := mssql.NewServerSecurityAlertPolicy(ctx, "exampleServerSecurityAlertPolicy", &mssql.ServerSecurityAlertPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleSqlServer.Name, +// State: pulumi.String("Enabled"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := sql.NewDatabase(ctx, "exampleDatabase", &sql.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleSqlServer.Name, +// Location: exampleResourceGroup.Location, +// Edition: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleServerVulnerabilityAssessment, err := mssql.NewServerVulnerabilityAssessment(ctx, "exampleServerVulnerabilityAssessment", &mssql.ServerVulnerabilityAssessmentArgs{ +// ServerSecurityAlertPolicyId: exampleServerSecurityAlertPolicy.ID(), +// StorageContainerPath: pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) { +// primaryBlobEndpoint := _args[0].(string) +// name := _args[1].(string) +// return fmt.Sprintf("%v%v/", primaryBlobEndpoint, name), nil +// }).(pulumi.StringOutput), +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewDatabaseVulnerabilityAssessmentRuleBaseline(ctx, "exampleDatabaseVulnerabilityAssessmentRuleBaseline", &mssql.DatabaseVulnerabilityAssessmentRuleBaselineArgs{ +// ServerVulnerabilityAssessmentId: exampleServerVulnerabilityAssessment.ID(), +// DatabaseName: exampleDatabase.Name, +// RuleId: pulumi.String("VA2065"), +// BaselineName: pulumi.String("master"), +// BaselineResults: mssql.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArray{ +// &mssql.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs{ +// Results: pulumi.StringArray{ +// pulumi.String("allowedip1"), +// pulumi.String("123.123.123.123"), +// pulumi.String("123.123.123.123"), +// }, +// }, +// &mssql.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs{ +// Results: pulumi.StringArray{ +// pulumi.String("allowedip2"), +// pulumi.String("255.255.255.255"), +// pulumi.String("255.255.255.255"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Database Vulnerability Assessment Rule Baseline can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/elasticPool.go b/sdk/go/azure/mssql/elasticPool.go index 3bd56ef3c0..96c4d2e915 100644 --- a/sdk/go/azure/mssql/elasticPool.go +++ b/sdk/go/azure/mssql/elasticPool.go @@ -15,6 +15,63 @@ import ( // Allows you to manage an Azure SQL Elastic Pool via the `v3.0` API which allows for `vCore` and `DTU` based configurations. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewElasticPool(ctx, "exampleElasticPool", &mssql.ElasticPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServerName: exampleServer.Name, +// LicenseType: pulumi.String("LicenseIncluded"), +// MaxSizeGb: pulumi.Float64(756), +// Sku: &mssql.ElasticPoolSkuArgs{ +// Name: pulumi.String("BasicPool"), +// Tier: pulumi.String("Basic"), +// Family: pulumi.String("Gen4"), +// Capacity: pulumi.Int(4), +// }, +// PerDatabaseSettings: &mssql.ElasticPoolPerDatabaseSettingsArgs{ +// MinCapacity: pulumi.Float64(0.25), +// MaxCapacity: pulumi.Float64(4), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Elastic Pool can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/failoverGroup.go b/sdk/go/azure/mssql/failoverGroup.go index d82839bf45..a1cc03bbc7 100644 --- a/sdk/go/azure/mssql/failoverGroup.go +++ b/sdk/go/azure/mssql/failoverGroup.go @@ -15,6 +15,84 @@ import ( // Manages a Microsoft Azure SQL Failover Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// primary, err := mssql.NewServer(ctx, "primary", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsKat11"), +// }) +// if err != nil { +// return err +// } +// secondary, err := mssql.NewServer(ctx, "secondary", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsKat12"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := mssql.NewDatabase(ctx, "exampleDatabase", &mssql.DatabaseArgs{ +// ServerId: primary.ID(), +// SkuName: pulumi.String("S1"), +// Collation: pulumi.String("SQL_Latin1_General_CP1_CI_AS"), +// MaxSizeGb: pulumi.Int(200), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewFailoverGroup(ctx, "exampleFailoverGroup", &mssql.FailoverGroupArgs{ +// ServerId: primary.ID(), +// Databases: pulumi.StringArray{ +// exampleDatabase.ID(), +// }, +// PartnerServers: mssql.FailoverGroupPartnerServerArray{ +// &mssql.FailoverGroupPartnerServerArgs{ +// Id: secondary.ID(), +// }, +// }, +// ReadWriteEndpointFailoverPolicy: &mssql.FailoverGroupReadWriteEndpointFailoverPolicyArgs{ +// Mode: pulumi.String("Automatic"), +// GraceMinutes: pulumi.Int(80), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("prod"), +// "database": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/firewallRule.go b/sdk/go/azure/mssql/firewallRule.go index 12f4c10ce8..81c48a441a 100644 --- a/sdk/go/azure/mssql/firewallRule.go +++ b/sdk/go/azure/mssql/firewallRule.go @@ -15,6 +15,51 @@ import ( // Allows you to manage an Azure SQL Firewall Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewFirewallRule(ctx, "exampleFirewallRule", &mssql.FirewallRuleArgs{ +// ServerId: exampleServer.ID(), +// StartIpAddress: pulumi.String("10.0.17.62"), +// EndIpAddress: pulumi.String("10.0.17.62"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/getDatabase.go b/sdk/go/azure/mssql/getDatabase.go index a552b39b91..2656109a4e 100644 --- a/sdk/go/azure/mssql/getDatabase.go +++ b/sdk/go/azure/mssql/getDatabase.go @@ -13,6 +13,50 @@ import ( ) // Use this data source to access information about an existing SQL database. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase := mssql.LookupDatabaseOutput(ctx, mssql.GetDatabaseOutputArgs{ +// Name: pulumi.String("example-mssql-db"), +// ServerId: exampleServer.ID(), +// }, nil) +// ctx.Export("databaseId", exampleDatabase.ApplyT(func(exampleDatabase mssql.GetDatabaseResult) (*string, error) { +// return &exampleDatabase.Id, nil +// }).(pulumi.StringPtrOutput)) +// return nil +// }) +// } +// +// ``` func LookupDatabase(ctx *pulumi.Context, args *LookupDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupDatabaseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDatabaseResult diff --git a/sdk/go/azure/mssql/getElasticPool.go b/sdk/go/azure/mssql/getElasticPool.go index b474c50674..20fe289f07 100644 --- a/sdk/go/azure/mssql/getElasticPool.go +++ b/sdk/go/azure/mssql/getElasticPool.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing SQL elastic pool. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := mssql.LookupElasticPool(ctx, &mssql.LookupElasticPoolArgs{ +// Name: "mssqlelasticpoolname", +// ResourceGroupName: "example-resources", +// ServerName: "example-sql-server", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("elasticpoolId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupElasticPool(ctx *pulumi.Context, args *LookupElasticPoolArgs, opts ...pulumi.InvokeOption) (*LookupElasticPoolResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupElasticPoolResult diff --git a/sdk/go/azure/mssql/getManagedInstance.go b/sdk/go/azure/mssql/getManagedInstance.go index 57e75803d1..b88f700de4 100644 --- a/sdk/go/azure/mssql/getManagedInstance.go +++ b/sdk/go/azure/mssql/getManagedInstance.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Microsoft SQL Azure Managed Instance. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := mssql.LookupManagedInstance(ctx, &mssql.LookupManagedInstanceArgs{ +// Name: "managedsqlinstance", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupManagedInstance(ctx *pulumi.Context, args *LookupManagedInstanceArgs, opts ...pulumi.InvokeOption) (*LookupManagedInstanceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupManagedInstanceResult diff --git a/sdk/go/azure/mssql/getServer.go b/sdk/go/azure/mssql/getServer.go index f22f66f352..873f5c33a9 100644 --- a/sdk/go/azure/mssql/getServer.go +++ b/sdk/go/azure/mssql/getServer.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Microsoft SQL Server. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := mssql.LookupServer(ctx, &mssql.LookupServerArgs{ +// Name: "existingMsSqlServer", +// ResourceGroupName: "existingResGroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupServer(ctx *pulumi.Context, args *LookupServerArgs, opts ...pulumi.InvokeOption) (*LookupServerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServerResult diff --git a/sdk/go/azure/mssql/jobAgent.go b/sdk/go/azure/mssql/jobAgent.go index 427d434901..a7f89a326e 100644 --- a/sdk/go/azure/mssql/jobAgent.go +++ b/sdk/go/azure/mssql/jobAgent.go @@ -15,6 +15,58 @@ import ( // Manages an Elastic Job Agent. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("northeurope"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := mssql.NewDatabase(ctx, "exampleDatabase", &mssql.DatabaseArgs{ +// ServerId: exampleServer.ID(), +// Collation: pulumi.String("SQL_Latin1_General_CP1_CI_AS"), +// SkuName: pulumi.String("S1"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewJobAgent(ctx, "exampleJobAgent", &mssql.JobAgentArgs{ +// Location: exampleResourceGroup.Location, +// DatabaseId: exampleDatabase.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Elastic Job Agents can be imported using the `id`, e.g. diff --git a/sdk/go/azure/mssql/jobCredential.go b/sdk/go/azure/mssql/jobCredential.go index e929ad4414..a47fc1b7e6 100644 --- a/sdk/go/azure/mssql/jobCredential.go +++ b/sdk/go/azure/mssql/jobCredential.go @@ -15,6 +15,66 @@ import ( // Manages an Elastic Job Credential. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("northeurope"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := mssql.NewDatabase(ctx, "exampleDatabase", &mssql.DatabaseArgs{ +// ServerId: exampleServer.ID(), +// Collation: pulumi.String("SQL_Latin1_General_CP1_CI_AS"), +// SkuName: pulumi.String("S1"), +// }) +// if err != nil { +// return err +// } +// exampleJobAgent, err := mssql.NewJobAgent(ctx, "exampleJobAgent", &mssql.JobAgentArgs{ +// Location: exampleResourceGroup.Location, +// DatabaseId: exampleDatabase.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewJobCredential(ctx, "exampleJobCredential", &mssql.JobCredentialArgs{ +// JobAgentId: exampleJobAgent.ID(), +// Username: pulumi.String("my-username"), +// Password: pulumi.String("MyP4ssw0rd!!!"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Elastic Job Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/managedDatabase.go b/sdk/go/azure/mssql/managedDatabase.go index 5e9519adb6..de3d999949 100644 --- a/sdk/go/azure/mssql/managedDatabase.go +++ b/sdk/go/azure/mssql/managedDatabase.go @@ -15,6 +15,74 @@ import ( // Manages an Azure SQL Azure Managed Database for a SQL Managed Instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LicenseType: pulumi.String("BasePrice"), +// SkuName: pulumi.String("GP_Gen5"), +// StorageSizeInGb: pulumi.Int(32), +// SubnetId: exampleSubnet.ID(), +// Vcores: pulumi.Int(4), +// AdministratorLogin: pulumi.String("msadministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewManagedDatabase(ctx, "exampleManagedDatabase", &mssql.ManagedDatabaseArgs{ +// ManagedInstanceId: exampleManagedInstance.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/managedInstance.go b/sdk/go/azure/mssql/managedInstance.go index 0161d5ae9c..4782785489 100644 --- a/sdk/go/azure/mssql/managedInstance.go +++ b/sdk/go/azure/mssql/managedInstance.go @@ -17,6 +17,245 @@ import ( // // > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowManagementInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(106), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRanges: pulumi.StringArray{ +// pulumi.String("9000"), +// pulumi.String("9003"), +// pulumi.String("1438"), +// pulumi.String("1440"), +// pulumi.String("1452"), +// }, +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowMisubnetInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(200), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("10.0.0.0/24"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowHealthProbeInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(300), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("AzureLoadBalancer"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowTdsInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(1000), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("1433"), +// SourceAddressPrefix: pulumi.String("VirtualNetwork"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "denyAllInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(4096), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Deny"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowManagementOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(102), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRanges: pulumi.StringArray{ +// pulumi.String("80"), +// pulumi.String("443"), +// pulumi.String("12000"), +// }, +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowMisubnetOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(200), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("10.0.0.0/24"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "denyAllOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(4096), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Deny"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("managedinstancedelegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Sql/managedInstances"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnetNetworkSecurityGroupAssociation, err := network.NewSubnetNetworkSecurityGroupAssociation(ctx, "exampleSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// exampleRouteTable, err := network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DisableBgpRoutePropagation: pulumi.Bool(false), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleSubnet, +// })) +// if err != nil { +// return err +// } +// exampleSubnetRouteTableAssociation, err := network.NewSubnetRouteTableAssociation(ctx, "exampleSubnetRouteTableAssociation", &network.SubnetRouteTableAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// RouteTableId: exampleRouteTable.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LicenseType: pulumi.String("BasePrice"), +// SkuName: pulumi.String("GP_Gen5"), +// StorageSizeInGb: pulumi.Int(32), +// SubnetId: exampleSubnet.ID(), +// Vcores: pulumi.Int(4), +// AdministratorLogin: pulumi.String("mradministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleSubnetNetworkSecurityGroupAssociation, +// exampleSubnetRouteTableAssociation, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Microsoft SQL Managed Instances can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/managedInstanceActiveDirectoryAdministrator.go b/sdk/go/azure/mssql/managedInstanceActiveDirectoryAdministrator.go index 88cabb4b0a..dd292e84d8 100644 --- a/sdk/go/azure/mssql/managedInstanceActiveDirectoryAdministrator.go +++ b/sdk/go/azure/mssql/managedInstanceActiveDirectoryAdministrator.go @@ -15,6 +15,109 @@ import ( // Allows you to set a user, group or service principal as the AAD Administrator for an Azure SQL Managed Instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LicenseType: pulumi.String("BasePrice"), +// SkuName: pulumi.String("GP_Gen5"), +// StorageSizeInGb: pulumi.Int(32), +// SubnetId: exampleSubnet.ID(), +// Vcores: pulumi.Int(4), +// AdministratorLogin: pulumi.String("msadministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// Identity: &mssql.ManagedInstanceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// reader, err := azuread.NewDirectoryRole(ctx, "reader", &azuread.DirectoryRoleArgs{ +// DisplayName: pulumi.String("Directory Readers"), +// }) +// if err != nil { +// return err +// } +// _, err = azuread.NewDirectoryRoleMember(ctx, "exampleDirectoryRoleMember", &azuread.DirectoryRoleMemberArgs{ +// RoleObjectId: reader.ObjectId, +// MemberObjectId: exampleManagedInstance.Identity.ApplyT(func(identity mssql.ManagedInstanceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// admin, err := azuread.NewUser(ctx, "admin", &azuread.UserArgs{ +// UserPrincipalName: pulumi.String("ms.admin@hashicorp.com"), +// DisplayName: pulumi.String("Ms Admin"), +// MailNickname: pulumi.String("ms.admin"), +// Password: pulumi.String("SecretP@sswd99!"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewManagedInstanceActiveDirectoryAdministrator(ctx, "exampleManagedInstanceActiveDirectoryAdministrator", &mssql.ManagedInstanceActiveDirectoryAdministratorArgs{ +// ManagedInstanceId: exampleManagedInstance.ID(), +// LoginUsername: pulumi.String("msadmin"), +// ObjectId: admin.ObjectId, +// TenantId: *pulumi.String(current.TenantId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An Azure SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/managedInstanceSecurityAlertPolicy.go b/sdk/go/azure/mssql/managedInstanceSecurityAlertPolicy.go index 9000ba25b1..ccc430377f 100644 --- a/sdk/go/azure/mssql/managedInstanceSecurityAlertPolicy.go +++ b/sdk/go/azure/mssql/managedInstanceSecurityAlertPolicy.go @@ -15,6 +15,260 @@ import ( // Manages a Security Alert Policy for an MS SQL Managed Instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowManagementInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(106), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRanges: pulumi.StringArray{ +// pulumi.String("9000"), +// pulumi.String("9003"), +// pulumi.String("1438"), +// pulumi.String("1440"), +// pulumi.String("1452"), +// }, +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowMisubnetInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(200), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("10.0.0.0/24"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowHealthProbeInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(300), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("AzureLoadBalancer"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowTdsInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(1000), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("1433"), +// SourceAddressPrefix: pulumi.String("VirtualNetwork"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "denyAllInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(4096), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Deny"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowManagementOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(102), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRanges: pulumi.StringArray{ +// pulumi.String("80"), +// pulumi.String("443"), +// pulumi.String("12000"), +// }, +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowMisubnetOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(200), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("10.0.0.0/24"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "denyAllOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(4096), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Deny"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("managedinstancedelegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Sql/managedInstances"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnetNetworkSecurityGroupAssociation, err := network.NewSubnetNetworkSecurityGroupAssociation(ctx, "exampleSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// exampleRouteTable, err := network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DisableBgpRoutePropagation: pulumi.Bool(false), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleSubnet, +// })) +// if err != nil { +// return err +// } +// exampleSubnetRouteTableAssociation, err := network.NewSubnetRouteTableAssociation(ctx, "exampleSubnetRouteTableAssociation", &network.SubnetRouteTableAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// RouteTableId: exampleRouteTable.ID(), +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LicenseType: pulumi.String("BasePrice"), +// SkuName: pulumi.String("GP_Gen5"), +// StorageSizeInGb: pulumi.Int(32), +// SubnetId: exampleSubnet.ID(), +// Vcores: pulumi.Int(4), +// AdministratorLogin: pulumi.String("mradministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleSubnetNetworkSecurityGroupAssociation, +// exampleSubnetRouteTableAssociation, +// })) +// if err != nil { +// return err +// } +// _, err = mssql.NewManagedInstanceSecurityAlertPolicy(ctx, "exampleManagedInstanceSecurityAlertPolicy", &mssql.ManagedInstanceSecurityAlertPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ManagedInstanceName: exampleManagedInstance.Name, +// Enabled: pulumi.Bool(true), +// StorageEndpoint: pulumi.Any(azurerm_storage_account.Example.Primary_blob_endpoint), +// StorageAccountAccessKey: pulumi.Any(azurerm_storage_account.Example.Primary_access_key), +// DisabledAlerts: pulumi.StringArray{ +// pulumi.String("Sql_Injection"), +// pulumi.String("Data_Exfiltration"), +// }, +// RetentionDays: pulumi.Int(20), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MS SQL Managed Instance Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/managedInstanceTransparentDataEncryption.go b/sdk/go/azure/mssql/managedInstanceTransparentDataEncryption.go index f1355d5418..7898cf5213 100644 --- a/sdk/go/azure/mssql/managedInstanceTransparentDataEncryption.go +++ b/sdk/go/azure/mssql/managedInstanceTransparentDataEncryption.go @@ -20,6 +20,233 @@ import ( // > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. // // ## Example Usage +// ### With Service Managed Key +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("EastUs"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("managedinstancedelegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Sql/managedInstances"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LicenseType: pulumi.String("BasePrice"), +// SkuName: pulumi.String("GP_Gen5"), +// StorageSizeInGb: pulumi.Int(32), +// SubnetId: exampleSubnet.ID(), +// Vcores: pulumi.Int(4), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("NCC-1701-D"), +// Identity: &mssql.ManagedInstanceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewManagedInstanceTransparentDataEncryption(ctx, "exampleManagedInstanceTransparentDataEncryption", &mssql.ManagedInstanceTransparentDataEncryptionArgs{ +// ManagedInstanceId: exampleManagedInstance.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Customer Managed Key +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("EastUs"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("managedinstancedelegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Sql/managedInstances"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LicenseType: pulumi.String("BasePrice"), +// SkuName: pulumi.String("GP_Gen5"), +// StorageSizeInGb: pulumi.Int(32), +// SubnetId: exampleSubnet.ID(), +// Vcores: pulumi.Int(4), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("NCC-1701-D"), +// Identity: &mssql.ManagedInstanceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// EnabledForDiskEncryption: pulumi.Bool(true), +// TenantId: *pulumi.String(current.TenantId), +// SoftDeleteRetentionDays: pulumi.Int(7), +// PurgeProtectionEnabled: pulumi.Bool(false), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Update"), +// pulumi.String("Recover"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: exampleManagedInstance.Identity.ApplyT(func(identity mssql.ManagedInstanceIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleManagedInstance.Identity.ApplyT(func(identity mssql.ManagedInstanceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("WrapKey"), +// pulumi.String("UnwrapKey"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("unwrapKey"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleKeyVault, +// })) +// if err != nil { +// return err +// } +// _, err = mssql.NewManagedInstanceTransparentDataEncryption(ctx, "exampleManagedInstanceTransparentDataEncryption", &mssql.ManagedInstanceTransparentDataEncryptionArgs{ +// ManagedInstanceId: exampleManagedInstance.ID(), +// KeyVaultKeyId: exampleKey.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/mssql/managedInstanceVulnerabilityAssessment.go b/sdk/go/azure/mssql/managedInstanceVulnerabilityAssessment.go index de0e87a51a..4401cd6803 100644 --- a/sdk/go/azure/mssql/managedInstanceVulnerabilityAssessment.go +++ b/sdk/go/azure/mssql/managedInstanceVulnerabilityAssessment.go @@ -15,6 +15,120 @@ import ( // Manages the Vulnerability Assessment for an MS Managed Instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := mssql.NewManagedInstance(ctx, "exampleManagedInstance", &mssql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// LicenseType: pulumi.String("BasePrice"), +// SkuName: pulumi.String("GP_Gen5"), +// StorageSizeInGb: pulumi.Int(32), +// SubnetId: exampleSubnet.ID(), +// Vcores: pulumi.Int(4), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("NCC-1701-D"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleManagedInstanceSecurityAlertPolicy, err := mssql.NewManagedInstanceSecurityAlertPolicy(ctx, "exampleManagedInstanceSecurityAlertPolicy", &mssql.ManagedInstanceSecurityAlertPolicyArgs{ +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// ManagedInstanceName: pulumi.Any(azurerm_mssql_managed_instance.Test.Name), +// Enabled: pulumi.Bool(true), +// StorageEndpoint: pulumi.Any(azurerm_storage_account.Test.Primary_blob_endpoint), +// StorageAccountAccessKey: pulumi.Any(azurerm_storage_account.Test.Primary_access_key), +// RetentionDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewManagedInstanceVulnerabilityAssessment(ctx, "exampleManagedInstanceVulnerabilityAssessment", &mssql.ManagedInstanceVulnerabilityAssessmentArgs{ +// ManagedInstanceId: exampleManagedInstance.ID(), +// StorageContainerPath: pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) { +// primaryBlobEndpoint := _args[0].(string) +// name := _args[1].(string) +// return fmt.Sprintf("%v%v/", primaryBlobEndpoint, name), nil +// }).(pulumi.StringOutput), +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// RecurringScans: &mssql.ManagedInstanceVulnerabilityAssessmentRecurringScansArgs{ +// Enabled: pulumi.Bool(true), +// EmailSubscriptionAdmins: pulumi.Bool(true), +// Emails: pulumi.StringArray{ +// pulumi.String("email@example1.com"), +// pulumi.String("email@example2.com"), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleManagedInstanceSecurityAlertPolicy, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/outboundFirewallRule.go b/sdk/go/azure/mssql/outboundFirewallRule.go index c001a4e684..d379d034a1 100644 --- a/sdk/go/azure/mssql/outboundFirewallRule.go +++ b/sdk/go/azure/mssql/outboundFirewallRule.go @@ -15,6 +15,50 @@ import ( // Allows you to manage an Azure SQL Outbound Firewall Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// OutboundNetworkRestrictionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewOutboundFirewallRule(ctx, "exampleOutboundFirewallRule", &mssql.OutboundFirewallRuleArgs{ +// ServerId: exampleServer.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Outbound Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/server.go b/sdk/go/azure/mssql/server.go index 4eb9c00a62..403d8eff28 100644 --- a/sdk/go/azure/mssql/server.go +++ b/sdk/go/azure/mssql/server.go @@ -15,6 +15,164 @@ import ( // Manages a Microsoft SQL Azure Database Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsKat11"), +// MinimumTlsVersion: pulumi.String("1.2"), +// AzureadAdministrator: &mssql.ServerAzureadAdministratorArgs{ +// LoginUsername: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Transparent Data Encryption(TDE) With A Customer Managed Key(CMK) During Create +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// EnabledForDiskEncryption: pulumi.Bool(true), +// TenantId: exampleUserAssignedIdentity.TenantId, +// SoftDeleteRetentionDays: pulumi.Int(7), +// PurgeProtectionEnabled: pulumi.Bool(true), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Update"), +// pulumi.String("Recover"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: exampleUserAssignedIdentity.TenantId, +// ObjectId: exampleUserAssignedIdentity.PrincipalId, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("WrapKey"), +// pulumi.String("UnwrapKey"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("unwrapKey"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleKeyVault, +// })) +// if err != nil { +// return err +// } +// _, err = mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("Example-Administrator"), +// AdministratorLoginPassword: pulumi.String("Example_Password!"), +// MinimumTlsVersion: pulumi.String("1.2"), +// AzureadAdministrator: &mssql.ServerAzureadAdministratorArgs{ +// LoginUsername: exampleUserAssignedIdentity.Name, +// ObjectId: exampleUserAssignedIdentity.PrincipalId, +// }, +// Identity: &mssql.ServerIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// PrimaryUserAssignedIdentityId: exampleUserAssignedIdentity.ID(), +// TransparentDataEncryptionKeyVaultKeyId: exampleKey.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/serverDnsAlias.go b/sdk/go/azure/mssql/serverDnsAlias.go index 7e1def669d..10b0ac8167 100644 --- a/sdk/go/azure/mssql/serverDnsAlias.go +++ b/sdk/go/azure/mssql/serverDnsAlias.go @@ -15,6 +15,49 @@ import ( // Manages a MS SQL Server DNS Alias. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("AdminPassword123!"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerDnsAlias(ctx, "exampleServerDnsAlias", &mssql.ServerDnsAliasArgs{ +// MssqlServerId: exampleServer.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MSSQL Server DNS Aliass can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/serverExtendedAuditingPolicy.go b/sdk/go/azure/mssql/serverExtendedAuditingPolicy.go index 337eca2caf..ab468bf865 100644 --- a/sdk/go/azure/mssql/serverExtendedAuditingPolicy.go +++ b/sdk/go/azure/mssql/serverExtendedAuditingPolicy.go @@ -15,6 +15,206 @@ import ( // Manages a MS SQL Server Extended Auditing Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("AdminPassword123!"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerExtendedAuditingPolicy(ctx, "exampleServerExtendedAuditingPolicy", &mssql.ServerExtendedAuditingPolicyArgs{ +// ServerId: exampleServer.ID(), +// StorageEndpoint: exampleAccount.PrimaryBlobEndpoint, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// StorageAccountAccessKeyIsSecondary: pulumi.Bool(false), +// RetentionInDays: pulumi.Int(6), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Storage Account Behind VNet And Firewall +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// pulumi.String("Microsoft.Storage"), +// }, +// EnforcePrivateLinkEndpointNetworkPolicies: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("AdminPassword123!"), +// MinimumTlsVersion: pulumi.String("1.2"), +// Identity: &mssql.ServerIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"), +// PrincipalId: exampleServer.Identity.ApplyT(func(identity mssql.ServerIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewVirtualNetworkRule(ctx, "sqlvnetrule", &sql.VirtualNetworkRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewFirewallRule(ctx, "exampleFirewallRule", &sql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("0.0.0.0"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// AllowNestedItemsToBePublic: pulumi.Bool(false), +// NetworkRules: &storage.AccountNetworkRulesTypeArgs{ +// DefaultAction: pulumi.String("Deny"), +// IpRules: pulumi.StringArray{ +// pulumi.String("127.0.0.1"), +// }, +// VirtualNetworkSubnetIds: pulumi.StringArray{ +// exampleSubnet.ID(), +// }, +// Bypasses: pulumi.StringArray{ +// pulumi.String("AzureServices"), +// }, +// }, +// Identity: &storage.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerExtendedAuditingPolicy(ctx, "exampleServerExtendedAuditingPolicy", &mssql.ServerExtendedAuditingPolicyArgs{ +// StorageEndpoint: exampleAccount.PrimaryBlobEndpoint, +// ServerId: exampleServer.ID(), +// RetentionInDays: pulumi.Int(6), +// LogMonitoringEnabled: pulumi.Bool(false), +// StorageAccountSubscriptionId: pulumi.Any(azurerm_subscription.Primary.Subscription_id), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// exampleAccount, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MS SQL Server Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/serverMicrosoftSupportAuditingPolicy.go b/sdk/go/azure/mssql/serverMicrosoftSupportAuditingPolicy.go index 8b0305b4e9..b33d1a20a0 100644 --- a/sdk/go/azure/mssql/serverMicrosoftSupportAuditingPolicy.go +++ b/sdk/go/azure/mssql/serverMicrosoftSupportAuditingPolicy.go @@ -15,6 +15,202 @@ import ( // Manages a MS SQL Server Microsoft Support Auditing Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("AdminPassword123!"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerMicrosoftSupportAuditingPolicy(ctx, "exampleServerMicrosoftSupportAuditingPolicy", &mssql.ServerMicrosoftSupportAuditingPolicyArgs{ +// ServerId: exampleServer.ID(), +// BlobStorageEndpoint: exampleAccount.PrimaryBlobEndpoint, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Storage Account Behind VNet And Firewall +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// pulumi.String("Microsoft.Storage"), +// }, +// EnforcePrivateLinkEndpointNetworkPolicies: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("AdminPassword123!"), +// MinimumTlsVersion: pulumi.String("1.2"), +// Identity: &mssql.ServerIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAssignment, err := authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"), +// PrincipalId: exampleServer.Identity.ApplyT(func(identity mssql.ServerIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewVirtualNetworkRule(ctx, "sqlvnetrule", &sql.VirtualNetworkRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewFirewallRule(ctx, "exampleFirewallRule", &sql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("0.0.0.0"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// AllowNestedItemsToBePublic: pulumi.Bool(false), +// NetworkRules: &storage.AccountNetworkRulesTypeArgs{ +// DefaultAction: pulumi.String("Deny"), +// IpRules: pulumi.StringArray{ +// pulumi.String("127.0.0.1"), +// }, +// VirtualNetworkSubnetIds: pulumi.StringArray{ +// exampleSubnet.ID(), +// }, +// Bypasses: pulumi.StringArray{ +// pulumi.String("AzureServices"), +// }, +// }, +// Identity: &storage.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerMicrosoftSupportAuditingPolicy(ctx, "exampleServerMicrosoftSupportAuditingPolicy", &mssql.ServerMicrosoftSupportAuditingPolicyArgs{ +// BlobStorageEndpoint: exampleAccount.PrimaryBlobEndpoint, +// ServerId: exampleServer.ID(), +// LogMonitoringEnabled: pulumi.Bool(false), +// StorageAccountSubscriptionId: pulumi.Any(azurerm_subscription.Primary.Subscription_id), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleAssignment, +// exampleAccount, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MS SQL Server Microsoft Support Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/serverSecurityAlertPolicy.go b/sdk/go/azure/mssql/serverSecurityAlertPolicy.go index 0a14b25b60..aef4896f32 100644 --- a/sdk/go/azure/mssql/serverSecurityAlertPolicy.go +++ b/sdk/go/azure/mssql/serverSecurityAlertPolicy.go @@ -17,6 +17,69 @@ import ( // // > **NOTE** Security Alert Policy is currently only available for MS SQL databases. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerSecurityAlertPolicy(ctx, "exampleServerSecurityAlertPolicy", &mssql.ServerSecurityAlertPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleSqlServer.Name, +// State: pulumi.String("Enabled"), +// StorageEndpoint: exampleAccount.PrimaryBlobEndpoint, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// DisabledAlerts: pulumi.StringArray{ +// pulumi.String("Sql_Injection"), +// pulumi.String("Data_Exfiltration"), +// }, +// RetentionDays: pulumi.Int(20), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MS SQL Server Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/serverTransparentDataEncryption.go b/sdk/go/azure/mssql/serverTransparentDataEncryption.go index c15f8d8340..1adc8c91ef 100644 --- a/sdk/go/azure/mssql/serverTransparentDataEncryption.go +++ b/sdk/go/azure/mssql/serverTransparentDataEncryption.go @@ -22,6 +22,170 @@ import ( // > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. // // ## Example Usage +// ### With Service Managed Key +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("EastUs"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsKat11"), +// MinimumTlsVersion: pulumi.String("1.2"), +// AzureadAdministrator: &mssql.ServerAzureadAdministratorArgs{ +// LoginUsername: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerTransparentDataEncryption(ctx, "exampleServerTransparentDataEncryption", &mssql.ServerTransparentDataEncryptionArgs{ +// ServerId: exampleServer.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Customer Managed Key +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("EastUs"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("missadministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsKat11"), +// MinimumTlsVersion: pulumi.String("1.2"), +// AzureadAdministrator: &mssql.ServerAzureadAdministratorArgs{ +// LoginUsername: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("production"), +// }, +// Identity: &mssql.ServerIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// EnabledForDiskEncryption: pulumi.Bool(true), +// TenantId: *pulumi.String(current.TenantId), +// SoftDeleteRetentionDays: pulumi.Int(7), +// PurgeProtectionEnabled: pulumi.Bool(false), +// SkuName: pulumi.String("standard"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("Update"), +// pulumi.String("Recover"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: exampleServer.Identity.ApplyT(func(identity mssql.ServerIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleServer.Identity.ApplyT(func(identity mssql.ServerIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("WrapKey"), +// pulumi.String("UnwrapKey"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("unwrapKey"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleKeyVault, +// })) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerTransparentDataEncryption(ctx, "exampleServerTransparentDataEncryption", &mssql.ServerTransparentDataEncryptionArgs{ +// ServerId: exampleServer.ID(), +// KeyVaultKeyId: exampleKey.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/mssql/serverVulnerabilityAssessment.go b/sdk/go/azure/mssql/serverVulnerabilityAssessment.go index 8e8d1b73e6..fcf84b9a94 100644 --- a/sdk/go/azure/mssql/serverVulnerabilityAssessment.go +++ b/sdk/go/azure/mssql/serverVulnerabilityAssessment.go @@ -17,6 +17,91 @@ import ( // // > **NOTE** Vulnerability Assessment is currently only available for MS SQL databases. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleServerSecurityAlertPolicy, err := mssql.NewServerSecurityAlertPolicy(ctx, "exampleServerSecurityAlertPolicy", &mssql.ServerSecurityAlertPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleSqlServer.Name, +// State: pulumi.String("Enabled"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewServerVulnerabilityAssessment(ctx, "exampleServerVulnerabilityAssessment", &mssql.ServerVulnerabilityAssessmentArgs{ +// ServerSecurityAlertPolicyId: exampleServerSecurityAlertPolicy.ID(), +// StorageContainerPath: pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) { +// primaryBlobEndpoint := _args[0].(string) +// name := _args[1].(string) +// return fmt.Sprintf("%v%v/", primaryBlobEndpoint, name), nil +// }).(pulumi.StringOutput), +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// RecurringScans: &mssql.ServerVulnerabilityAssessmentRecurringScansArgs{ +// Enabled: pulumi.Bool(true), +// EmailSubscriptionAdmins: pulumi.Bool(true), +// Emails: pulumi.StringArray{ +// pulumi.String("email@example1.com"), +// pulumi.String("email@example2.com"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MS SQL Server Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/virtualMachine.go b/sdk/go/azure/mssql/virtualMachine.go index e545b2134e..c26269ebd4 100644 --- a/sdk/go/azure/mssql/virtualMachine.go +++ b/sdk/go/azure/mssql/virtualMachine.go @@ -15,6 +15,53 @@ import ( // Manages a Microsoft SQL Virtual Machine // +// ## Example Usage +// +// This example provisions a brief Managed Microsoft SQL Virtual Machine. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleVirtualMachine, err := compute.LookupVirtualMachine(ctx, &compute.LookupVirtualMachineArgs{ +// Name: "example-vm", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// _, err = mssql.NewVirtualMachine(ctx, "exampleMssql/virtualMachineVirtualMachine", &mssql.VirtualMachineArgs{ +// VirtualMachineId: *pulumi.String(exampleVirtualMachine.Id), +// SqlLicenseType: pulumi.String("PAYG"), +// RServicesEnabled: pulumi.Bool(true), +// SqlConnectivityPort: pulumi.Int(1433), +// SqlConnectivityType: pulumi.String("PRIVATE"), +// SqlConnectivityUpdatePassword: pulumi.String("Password1234!"), +// SqlConnectivityUpdateUsername: pulumi.String("sqllogin"), +// AutoPatching: &mssql.VirtualMachineAutoPatchingArgs{ +// DayOfWeek: pulumi.String("Sunday"), +// MaintenanceWindowDurationInMinutes: pulumi.Int(60), +// MaintenanceWindowStartingHour: pulumi.Int(2), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Microsoft SQL Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/virtualMachineGroup.go b/sdk/go/azure/mssql/virtualMachineGroup.go index 1b9c9288f3..0d13808f87 100644 --- a/sdk/go/azure/mssql/virtualMachineGroup.go +++ b/sdk/go/azure/mssql/virtualMachineGroup.go @@ -15,6 +15,46 @@ import ( // Manages a Microsoft SQL Virtual Machine Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewVirtualMachineGroup(ctx, "exampleVirtualMachineGroup", &mssql.VirtualMachineGroupArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SqlImageOffer: pulumi.String("SQL2017-WS2016"), +// SqlImageSku: pulumi.String("Developer"), +// WsfcDomainProfile: &mssql.VirtualMachineGroupWsfcDomainProfileArgs{ +// Fqdn: pulumi.String("testdomain.com"), +// ClusterSubnetType: pulumi.String("SingleSubnet"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Microsoft SQL Virtual Machine Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mssql/virtualNetworkRule.go b/sdk/go/azure/mssql/virtualNetworkRule.go index 1ecd8aa5d9..4e9a11b58d 100644 --- a/sdk/go/azure/mssql/virtualNetworkRule.go +++ b/sdk/go/azure/mssql/virtualNetworkRule.go @@ -15,6 +15,74 @@ import ( // Allows you to manage rules for allowing traffic between an Azure SQL server and a subnet of a virtual network. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = mssql.NewVirtualNetworkRule(ctx, "exampleVirtualNetworkRule", &mssql.VirtualNetworkRuleArgs{ +// ServerId: exampleServer.ID(), +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/activeDirectoryAdministrator.go b/sdk/go/azure/mysql/activeDirectoryAdministrator.go index b9bfa8428d..2fb18ed522 100644 --- a/sdk/go/azure/mysql/activeDirectoryAdministrator.go +++ b/sdk/go/azure/mysql/activeDirectoryAdministrator.go @@ -15,6 +15,60 @@ import ( // Allows you to set a user or group as the AD administrator for an MySQL server in Azure // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mysqladminun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SslEnforcementEnabled: pulumi.Bool(true), +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// Version: pulumi.String("5.7"), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewActiveDirectoryAdministrator(ctx, "exampleActiveDirectoryAdministrator", &mysql.ActiveDirectoryAdministratorArgs{ +// ServerName: exampleServer.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Login: pulumi.String("sqladmin"), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A MySQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/configuration.go b/sdk/go/azure/mysql/configuration.go index cebfe0fba5..79859e1981 100644 --- a/sdk/go/azure/mysql/configuration.go +++ b/sdk/go/azure/mysql/configuration.go @@ -19,6 +19,61 @@ import ( // // > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mysqladminun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// Version: pulumi.String("5.7"), +// AutoGrowEnabled: pulumi.Bool(true), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(true), +// InfrastructureEncryptionEnabled: pulumi.Bool(true), +// PublicNetworkAccessEnabled: pulumi.Bool(false), +// SslEnforcementEnabled: pulumi.Bool(true), +// SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewConfiguration(ctx, "exampleConfiguration", &mysql.ConfigurationArgs{ +// Name: pulumi.String("interactive_timeout"), +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Value: pulumi.String("600"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MySQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/database.go b/sdk/go/azure/mysql/database.go index 5541a67cea..c0eaa0feaa 100644 --- a/sdk/go/azure/mysql/database.go +++ b/sdk/go/azure/mysql/database.go @@ -15,6 +15,61 @@ import ( // Manages a MySQL Database within a MySQL Server // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mysqladminun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("GP_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// Version: pulumi.String("5.7"), +// AutoGrowEnabled: pulumi.Bool(true), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(true), +// InfrastructureEncryptionEnabled: pulumi.Bool(true), +// PublicNetworkAccessEnabled: pulumi.Bool(false), +// SslEnforcementEnabled: pulumi.Bool(true), +// SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewDatabase(ctx, "exampleDatabase", &mysql.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Charset: pulumi.String("utf8"), +// Collation: pulumi.String("utf8_unicode_ci"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/firewallRule.go b/sdk/go/azure/mysql/firewallRule.go index a846e6d3cb..2671d97726 100644 --- a/sdk/go/azure/mysql/firewallRule.go +++ b/sdk/go/azure/mysql/firewallRule.go @@ -16,6 +16,129 @@ import ( // Manages a Firewall Rule for a MySQL Server. // // ## Example Usage +// ### Single IP Address) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Version: pulumi.String("5.7"), +// SkuName: pulumi.String("GP_Gen5_2"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewFirewallRule(ctx, "exampleFirewallRule", &mysql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("40.112.8.12"), +// EndIpAddress: pulumi.String("40.112.8.12"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### IP Range) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", nil) +// if err != nil { +// return err +// } +// _, err = mysql.NewFirewallRule(ctx, "exampleFirewallRule", &mysql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("40.112.0.0"), +// EndIpAddress: pulumi.String("40.112.255.255"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Allow Access To Azure Services) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", nil) +// if err != nil { +// return err +// } +// _, err = mysql.NewFirewallRule(ctx, "exampleFirewallRule", &mysql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("0.0.0.0"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/mysql/flexibleDatabase.go b/sdk/go/azure/mysql/flexibleDatabase.go index 05f2acfe66..2c59144f45 100644 --- a/sdk/go/azure/mysql/flexibleDatabase.go +++ b/sdk/go/azure/mysql/flexibleDatabase.go @@ -15,6 +15,52 @@ import ( // Manages a MySQL Database within a MySQL Flexible Server // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := mysql.NewFlexibleServer(ctx, "exampleFlexibleServer", &mysql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLogin: pulumi.String("mysqladminun"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("B_Standard_B1s"), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewFlexibleDatabase(ctx, "exampleFlexibleDatabase", &mysql.FlexibleDatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleFlexibleServer.Name, +// Charset: pulumi.String("utf8"), +// Collation: pulumi.String("utf8_unicode_ci"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/flexibleServer.go b/sdk/go/azure/mysql/flexibleServer.go index abffe7ebe2..888f5c03b9 100644 --- a/sdk/go/azure/mysql/flexibleServer.go +++ b/sdk/go/azure/mysql/flexibleServer.go @@ -15,6 +15,98 @@ import ( // Manages a MySQL Flexible Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Storage"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("fs"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.DBforMySQL/flexibleServers"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleZoneVirtualNetworkLink, err := privatedns.NewZoneVirtualNetworkLink(ctx, "exampleZoneVirtualNetworkLink", &privatedns.ZoneVirtualNetworkLinkArgs{ +// PrivateDnsZoneName: exampleZone.Name, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewFlexibleServer(ctx, "exampleFlexibleServer", &mysql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// BackupRetentionDays: pulumi.Int(7), +// DelegatedSubnetId: exampleSubnet.ID(), +// PrivateDnsZoneId: exampleZone.ID(), +// SkuName: pulumi.String("GP_Standard_D2ds_v4"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleZoneVirtualNetworkLink, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MySQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/flexibleServerConfiguration.go b/sdk/go/azure/mysql/flexibleServerConfiguration.go index e56640aa7b..7c30cd3ba0 100644 --- a/sdk/go/azure/mysql/flexibleServerConfiguration.go +++ b/sdk/go/azure/mysql/flexibleServerConfiguration.go @@ -19,6 +19,51 @@ import ( // // > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := mysql.NewFlexibleServer(ctx, "exampleFlexibleServer", &mysql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLogin: pulumi.String("adminTerraform"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("GP_Standard_D2ds_v4"), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewFlexibleServerConfiguration(ctx, "exampleFlexibleServerConfiguration", &mysql.FlexibleServerConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleFlexibleServer.Name, +// Value: pulumi.String("600"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MySQL Flexible Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/flexibleServerFirewallRule.go b/sdk/go/azure/mysql/flexibleServerFirewallRule.go index b083853d77..abe5f1cea7 100644 --- a/sdk/go/azure/mysql/flexibleServerFirewallRule.go +++ b/sdk/go/azure/mysql/flexibleServerFirewallRule.go @@ -16,6 +16,132 @@ import ( // Manages a Firewall Rule for a MySQL Flexible Server. // // ## Example Usage +// ### Single IP Address) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := mysql.NewFlexibleServer(ctx, "exampleFlexibleServer", &mysql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewFlexibleServerFirewallRule(ctx, "exampleFlexibleServerFirewallRule", &mysql.FlexibleServerFirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleFlexibleServer.Name, +// StartIpAddress: pulumi.String("40.112.8.12"), +// EndIpAddress: pulumi.String("40.112.8.12"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### IP Range) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := mysql.NewFlexibleServer(ctx, "exampleFlexibleServer", &mysql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewFlexibleServerFirewallRule(ctx, "exampleFlexibleServerFirewallRule", &mysql.FlexibleServerFirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleFlexibleServer.Name, +// StartIpAddress: pulumi.String("40.112.0.0"), +// EndIpAddress: pulumi.String("40.112.255.255"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Allow Access To Azure Services) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := mysql.NewFlexibleServer(ctx, "exampleFlexibleServer", &mysql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewFlexibleServerFirewallRule(ctx, "exampleFlexibleServerFirewallRule", &mysql.FlexibleServerFirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleFlexibleServer.Name, +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("0.0.0.0"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/mysql/getFlexibleServer.go b/sdk/go/azure/mysql/getFlexibleServer.go index 34ffcce7f8..3ddd10e35e 100644 --- a/sdk/go/azure/mysql/getFlexibleServer.go +++ b/sdk/go/azure/mysql/getFlexibleServer.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing MySQL Flexible Server. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := mysql.LookupFlexibleServer(ctx, &mysql.LookupFlexibleServerArgs{ +// Name: "existingMySqlFlexibleServer", +// ResourceGroupName: "existingResGroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupFlexibleServer(ctx *pulumi.Context, args *LookupFlexibleServerArgs, opts ...pulumi.InvokeOption) (*LookupFlexibleServerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFlexibleServerResult diff --git a/sdk/go/azure/mysql/getServer.go b/sdk/go/azure/mysql/getServer.go index f6e3f23c7f..a41210ce45 100644 --- a/sdk/go/azure/mysql/getServer.go +++ b/sdk/go/azure/mysql/getServer.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing MySQL Server. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := mysql.LookupServer(ctx, &mysql.LookupServerArgs{ +// Name: "existingMySqlServer", +// ResourceGroupName: "existingResGroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupServer(ctx *pulumi.Context, args *LookupServerArgs, opts ...pulumi.InvokeOption) (*LookupServerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServerResult diff --git a/sdk/go/azure/mysql/server.go b/sdk/go/azure/mysql/server.go index 6157e9aef5..5c8b181244 100644 --- a/sdk/go/azure/mysql/server.go +++ b/sdk/go/azure/mysql/server.go @@ -15,6 +15,52 @@ import ( // Manages a MySQL Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mysqladminun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// Version: pulumi.String("5.7"), +// AutoGrowEnabled: pulumi.Bool(true), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(false), +// InfrastructureEncryptionEnabled: pulumi.Bool(false), +// PublicNetworkAccessEnabled: pulumi.Bool(true), +// SslEnforcementEnabled: pulumi.Bool(true), +// SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MySQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/mysql/serverKey.go b/sdk/go/azure/mysql/serverKey.go index 16029a7482..006e9b4b25 100644 --- a/sdk/go/azure/mysql/serverKey.go +++ b/sdk/go/azure/mysql/serverKey.go @@ -15,6 +15,136 @@ import ( // Manages a Customer Managed Key for a MySQL Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("GP_Gen5_2"), +// AdministratorLogin: pulumi.String("acctestun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SslEnforcementEnabled: pulumi.Bool(true), +// SslMinimalTlsVersionEnforced: pulumi.String("TLS1_1"), +// StorageMb: pulumi.Int(51200), +// Version: pulumi.String("5.7"), +// Identity: &mysql.ServerIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// server, err := keyvault.NewAccessPolicy(ctx, "server", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: exampleServer.Identity.ApplyT(func(identity mysql.ServerIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// client, err := keyvault.NewAccessPolicy(ctx, "client", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("List"), +// pulumi.String("Restore"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// pulumi.String("Purge"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("Verify"), +// pulumi.String("GetRotationPolicy"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// client, +// server, +// })) +// if err != nil { +// return err +// } +// _, err = mysql.NewServerKey(ctx, "exampleServerKey", &mysql.ServerKeyArgs{ +// ServerId: exampleServer.ID(), +// KeyVaultKeyId: exampleKey.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A MySQL Server Key can be imported using the `resource id` of the MySQL Server Key, e.g. diff --git a/sdk/go/azure/mysql/virtualNetworkRule.go b/sdk/go/azure/mysql/virtualNetworkRule.go index fb2379a2c7..b25dfbf550 100644 --- a/sdk/go/azure/mysql/virtualNetworkRule.go +++ b/sdk/go/azure/mysql/virtualNetworkRule.go @@ -17,6 +17,80 @@ import ( // // > **NOTE:** MySQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mysql/concepts-data-access-and-security-vnet) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServer, err := mysql.NewServer(ctx, "exampleServer", &mysql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("mysqladminun"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("GP_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// Version: pulumi.String("5.7"), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(false), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = mysql.NewVirtualNetworkRule(ctx, "exampleVirtualNetworkRule", &mysql.VirtualNetworkRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// SubnetId: internal.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // MySQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/netapp/account.go b/sdk/go/azure/netapp/account.go index 9c86e59345..f33ac01e76 100644 --- a/sdk/go/azure/netapp/account.go +++ b/sdk/go/azure/netapp/account.go @@ -17,6 +17,50 @@ import ( // // > **NOTE:** Azure allows only one active directory can be joined to a single subscription at a time for NetApp Account. // +// ## NetApp Account Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewAccount(ctx, "exampleAccount", &netapp.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ActiveDirectory: &netapp.AccountActiveDirectoryArgs{ +// Username: pulumi.String("aduser"), +// Password: pulumi.String("aduserpwd"), +// SmbServerName: pulumi.String("SMBSERVER"), +// DnsServers: pulumi.StringArray{ +// pulumi.String("1.2.3.4"), +// }, +// Domain: pulumi.String("westcentralus.com"), +// OrganizationalUnit: pulumi.String("OU=FirstLevel"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // NetApp Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/netapp/getAccount.go b/sdk/go/azure/netapp/getAccount.go index 4686ee4922..07fc0f688b 100644 --- a/sdk/go/azure/netapp/getAccount.go +++ b/sdk/go/azure/netapp/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Uses this data source to access information about an existing NetApp Account. +// +// ## NetApp Account Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := netapp.LookupAccount(ctx, &netapp.LookupAccountArgs{ +// ResourceGroupName: "acctestRG", +// Name: "acctestnetappaccount", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("netappAccountId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/netapp/getPool.go b/sdk/go/azure/netapp/getPool.go index 0fc1dd12be..6ccee2bc51 100644 --- a/sdk/go/azure/netapp/getPool.go +++ b/sdk/go/azure/netapp/getPool.go @@ -13,6 +13,35 @@ import ( ) // Uses this data source to access information about an existing NetApp Pool. +// +// ## NetApp Pool Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := netapp.LookupPool(ctx, &netapp.LookupPoolArgs{ +// ResourceGroupName: "acctestRG", +// AccountName: "acctestnetappaccount", +// Name: "acctestnetapppool", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("netappPoolId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupPool(ctx *pulumi.Context, args *LookupPoolArgs, opts ...pulumi.InvokeOption) (*LookupPoolResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPoolResult diff --git a/sdk/go/azure/netapp/getSnapshot.go b/sdk/go/azure/netapp/getSnapshot.go index 0f8df85bcf..ae1a74460a 100644 --- a/sdk/go/azure/netapp/getSnapshot.go +++ b/sdk/go/azure/netapp/getSnapshot.go @@ -13,6 +13,37 @@ import ( ) // Uses this data source to access information about an existing NetApp Snapshot. +// +// ## NetApp Snapshot Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := netapp.LookupSnapshot(ctx, &netapp.LookupSnapshotArgs{ +// ResourceGroupName: "acctestRG", +// Name: "acctestnetappsnapshot", +// AccountName: "acctestnetappaccount", +// PoolName: "acctestnetapppool", +// VolumeName: "acctestnetappvolume", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("netappSnapshotId", data.Azurerm_netapp_snapshot.Example.Id) +// return nil +// }) +// } +// +// ``` func LookupSnapshot(ctx *pulumi.Context, args *LookupSnapshotArgs, opts ...pulumi.InvokeOption) (*LookupSnapshotResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSnapshotResult diff --git a/sdk/go/azure/netapp/getSnapshotPolicy.go b/sdk/go/azure/netapp/getSnapshotPolicy.go index aa22e38e0d..8db4435201 100644 --- a/sdk/go/azure/netapp/getSnapshotPolicy.go +++ b/sdk/go/azure/netapp/getSnapshotPolicy.go @@ -13,6 +13,41 @@ import ( ) // Uses this data source to access information about an existing NetApp Snapshot Policy. +// +// ## NetApp Snapshot Policy Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := netapp.LookupSnapshotPolicy(ctx, &netapp.LookupSnapshotPolicyArgs{ +// ResourceGroupName: "acctestRG", +// AccountName: "acctestnetappaccount", +// Name: "example-snapshot-policy", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// ctx.Export("name", example.Name) +// ctx.Export("enabled", example.Enabled) +// ctx.Export("hourlySchedule", example.HourlySchedules) +// ctx.Export("dailySchedule", example.DailySchedules) +// ctx.Export("weeklySchedule", example.WeeklySchedules) +// ctx.Export("monthlySchedule", example.MonthlySchedules) +// return nil +// }) +// } +// +// ``` func LookupSnapshotPolicy(ctx *pulumi.Context, args *LookupSnapshotPolicyArgs, opts ...pulumi.InvokeOption) (*LookupSnapshotPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSnapshotPolicyResult diff --git a/sdk/go/azure/netapp/getVolume.go b/sdk/go/azure/netapp/getVolume.go index 4bb16d042e..f64058392d 100644 --- a/sdk/go/azure/netapp/getVolume.go +++ b/sdk/go/azure/netapp/getVolume.go @@ -13,6 +13,36 @@ import ( ) // Uses this data source to access information about an existing NetApp Volume. +// +// ## NetApp Volume Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := netapp.LookupVolume(ctx, &netapp.LookupVolumeArgs{ +// ResourceGroupName: "acctestRG", +// AccountName: "acctestnetappaccount", +// PoolName: "acctestnetapppool", +// Name: "example-volume", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("netappVolumeId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVolume(ctx *pulumi.Context, args *LookupVolumeArgs, opts ...pulumi.InvokeOption) (*LookupVolumeResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVolumeResult diff --git a/sdk/go/azure/netapp/getVolumeGroupSapHana.go b/sdk/go/azure/netapp/getVolumeGroupSapHana.go index 9a021dc746..e2526bc3d5 100644 --- a/sdk/go/azure/netapp/getVolumeGroupSapHana.go +++ b/sdk/go/azure/netapp/getVolumeGroupSapHana.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Application Volume Group for SAP HANA application. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := netapp.LookupVolumeGroupSapHana(ctx, &netapp.LookupVolumeGroupSapHanaArgs{ +// Name: "existing application volume group name", +// ResourceGroupName: "resource group name where the account and volume group belong to", +// AccountName: "existing account where the application volume group belong to", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVolumeGroupSapHana(ctx *pulumi.Context, args *LookupVolumeGroupSapHanaArgs, opts ...pulumi.InvokeOption) (*LookupVolumeGroupSapHanaResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVolumeGroupSapHanaResult diff --git a/sdk/go/azure/netapp/getVolumeQuotaRule.go b/sdk/go/azure/netapp/getVolumeQuotaRule.go index 35070204a0..975349035c 100644 --- a/sdk/go/azure/netapp/getVolumeQuotaRule.go +++ b/sdk/go/azure/netapp/getVolumeQuotaRule.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Volume Quota Rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := netapp.LookupVolumeQuotaRule(ctx, &netapp.LookupVolumeQuotaRuleArgs{ +// Name: "exampleQuotaRule", +// VolumeId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVolumeQuotaRule(ctx *pulumi.Context, args *LookupVolumeQuotaRuleArgs, opts ...pulumi.InvokeOption) (*LookupVolumeQuotaRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVolumeQuotaRuleResult diff --git a/sdk/go/azure/netapp/pool.go b/sdk/go/azure/netapp/pool.go index 9ba3bc9957..b2290db101 100644 --- a/sdk/go/azure/netapp/pool.go +++ b/sdk/go/azure/netapp/pool.go @@ -15,6 +15,50 @@ import ( // Manages a Pool within a NetApp Account. // +// ## NetApp Pool Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := netapp.NewAccount(ctx, "exampleAccount", &netapp.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewPool(ctx, "examplePool", &netapp.PoolArgs{ +// AccountName: exampleAccount.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceLevel: pulumi.String("Premium"), +// SizeInTb: pulumi.Int(4), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // NetApp Pool can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/netapp/snapshot.go b/sdk/go/azure/netapp/snapshot.go index 64e192ec2f..9e743373c4 100644 --- a/sdk/go/azure/netapp/snapshot.go +++ b/sdk/go/azure/netapp/snapshot.go @@ -15,6 +15,106 @@ import ( // Manages a NetApp Snapshot. // +// ## NetApp Snapshot Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("netapp"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Netapp/volumes"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/networkinterfaces/*"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := netapp.NewAccount(ctx, "exampleAccount", &netapp.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePool, err := netapp.NewPool(ctx, "examplePool", &netapp.PoolArgs{ +// AccountName: exampleAccount.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ServiceLevel: pulumi.String("Premium"), +// SizeInTb: pulumi.Int(4), +// }) +// if err != nil { +// return err +// } +// exampleVolume, err := netapp.NewVolume(ctx, "exampleVolume", &netapp.VolumeArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// PoolName: examplePool.Name, +// VolumePath: pulumi.String("my-unique-file-path"), +// ServiceLevel: pulumi.String("Premium"), +// SubnetId: exampleSubnet.ID(), +// StorageQuotaInGb: pulumi.Int(100), +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewSnapshot(ctx, "exampleSnapshot", &netapp.SnapshotArgs{ +// AccountName: exampleAccount.Name, +// PoolName: examplePool.Name, +// VolumeName: exampleVolume.Name, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // NetApp Snapshot can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/netapp/snapshotPolicy.go b/sdk/go/azure/netapp/snapshotPolicy.go index 22af21dbc0..a2530c2537 100644 --- a/sdk/go/azure/netapp/snapshotPolicy.go +++ b/sdk/go/azure/netapp/snapshotPolicy.go @@ -15,6 +15,78 @@ import ( // Manages a NetApp Snapshot Policy. // +// ## NetApp Snapshot Policy Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := netapp.NewAccount(ctx, "exampleAccount", &netapp.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewSnapshotPolicy(ctx, "exampleSnapshotPolicy", &netapp.SnapshotPolicyArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// Enabled: pulumi.Bool(true), +// HourlySchedule: &netapp.SnapshotPolicyHourlyScheduleArgs{ +// SnapshotsToKeep: pulumi.Int(4), +// Minute: pulumi.Int(15), +// }, +// DailySchedule: &netapp.SnapshotPolicyDailyScheduleArgs{ +// SnapshotsToKeep: pulumi.Int(2), +// Hour: pulumi.Int(20), +// Minute: pulumi.Int(15), +// }, +// WeeklySchedule: &netapp.SnapshotPolicyWeeklyScheduleArgs{ +// SnapshotsToKeep: pulumi.Int(1), +// DaysOfWeeks: pulumi.StringArray{ +// pulumi.String("Monday"), +// pulumi.String("Friday"), +// }, +// Hour: pulumi.Int(23), +// Minute: pulumi.Int(0), +// }, +// MonthlySchedule: &netapp.SnapshotPolicyMonthlyScheduleArgs{ +// SnapshotsToKeep: pulumi.Int(1), +// DaysOfMonths: pulumi.IntArray{ +// pulumi.Int(1), +// pulumi.Int(15), +// pulumi.Int(20), +// pulumi.Int(30), +// }, +// Hour: pulumi.Int(5), +// Minute: pulumi.Int(45), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // NetApp Snapshot Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/netapp/volumeQuotaRule.go b/sdk/go/azure/netapp/volumeQuotaRule.go index deac460cc6..a6970918bd 100644 --- a/sdk/go/azure/netapp/volumeQuotaRule.go +++ b/sdk/go/azure/netapp/volumeQuotaRule.go @@ -15,6 +15,141 @@ import ( // Manages a Volume Quota Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("netapp"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Netapp/volumes"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/networkinterfaces/*"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := netapp.NewAccount(ctx, "exampleAccount", &netapp.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// examplePool, err := netapp.NewPool(ctx, "examplePool", &netapp.PoolArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// ServiceLevel: pulumi.String("Premium"), +// SizeInTb: pulumi.Int(4), +// }) +// if err != nil { +// return err +// } +// exampleVolume, err := netapp.NewVolume(ctx, "exampleVolume", &netapp.VolumeArgs{ +// Location: exampleResourceGroup.Location, +// Zone: pulumi.String("1"), +// ResourceGroupName: exampleResourceGroup.Name, +// AccountName: exampleAccount.Name, +// PoolName: examplePool.Name, +// VolumePath: pulumi.String("my-unique-file-path"), +// ServiceLevel: pulumi.String("Premium"), +// SubnetId: exampleSubnet.ID(), +// NetworkFeatures: pulumi.String("Basic"), +// Protocols: pulumi.StringArray{ +// pulumi.String("NFSv4.1"), +// }, +// SecurityStyle: pulumi.String("unix"), +// StorageQuotaInGb: pulumi.Int(100), +// SnapshotDirectoryVisible: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewVolumeQuotaRule(ctx, "quota1", &netapp.VolumeQuotaRuleArgs{ +// Location: exampleResourceGroup.Location, +// VolumeId: exampleVolume.ID(), +// QuotaTarget: pulumi.String("3001"), +// QuotaSizeInKib: pulumi.Int(1024), +// QuotaType: pulumi.String("IndividualGroupQuota"), +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewVolumeQuotaRule(ctx, "quota2", &netapp.VolumeQuotaRuleArgs{ +// Location: exampleResourceGroup.Location, +// VolumeId: exampleVolume.ID(), +// QuotaTarget: pulumi.String("2001"), +// QuotaSizeInKib: pulumi.Int(1024), +// QuotaType: pulumi.String("IndividualUserQuota"), +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewVolumeQuotaRule(ctx, "quota3", &netapp.VolumeQuotaRuleArgs{ +// Location: exampleResourceGroup.Location, +// VolumeId: exampleVolume.ID(), +// QuotaSizeInKib: pulumi.Int(1024), +// QuotaType: pulumi.String("DefaultUserQuota"), +// }) +// if err != nil { +// return err +// } +// _, err = netapp.NewVolumeQuotaRule(ctx, "quota4", &netapp.VolumeQuotaRuleArgs{ +// Location: exampleResourceGroup.Location, +// VolumeId: exampleVolume.ID(), +// QuotaSizeInKib: pulumi.Int(1024), +// QuotaType: pulumi.String("DefaultGroupQuota"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Volume Quota Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/applicationGateway.go b/sdk/go/azure/network/applicationGateway.go index 4ab8c5290c..7c7abfa34f 100644 --- a/sdk/go/azure/network/applicationGateway.go +++ b/sdk/go/azure/network/applicationGateway.go @@ -15,6 +15,157 @@ import ( // Manages an Application Gateway. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.254.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// frontend, err := network.NewSubnet(ctx, "frontend", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.254.0.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnet(ctx, "backend", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.254.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllocationMethod: pulumi.String("Dynamic"), +// }) +// if err != nil { +// return err +// } +// backendAddressPoolName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v-beap", name), nil +// }).(pulumi.StringOutput) +// frontendPortName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v-feport", name), nil +// }).(pulumi.StringOutput) +// frontendIpConfigurationName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v-feip", name), nil +// }).(pulumi.StringOutput) +// httpSettingName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v-be-htst", name), nil +// }).(pulumi.StringOutput) +// listenerName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v-httplstn", name), nil +// }).(pulumi.StringOutput) +// requestRoutingRuleName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v-rqrt", name), nil +// }).(pulumi.StringOutput) +// _ = exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) { +// return fmt.Sprintf("%v-rdrcfg", name), nil +// }).(pulumi.StringOutput) +// _, err = network.NewApplicationGateway(ctx, "network", &network.ApplicationGatewayArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &network.ApplicationGatewaySkuArgs{ +// Name: pulumi.String("Standard_v2"), +// Tier: pulumi.String("Standard_v2"), +// Capacity: pulumi.Int(2), +// }, +// GatewayIpConfigurations: network.ApplicationGatewayGatewayIpConfigurationArray{ +// &network.ApplicationGatewayGatewayIpConfigurationArgs{ +// Name: pulumi.String("my-gateway-ip-configuration"), +// SubnetId: frontend.ID(), +// }, +// }, +// FrontendPorts: network.ApplicationGatewayFrontendPortArray{ +// &network.ApplicationGatewayFrontendPortArgs{ +// Name: pulumi.String(frontendPortName), +// Port: pulumi.Int(80), +// }, +// }, +// FrontendIpConfigurations: network.ApplicationGatewayFrontendIpConfigurationArray{ +// &network.ApplicationGatewayFrontendIpConfigurationArgs{ +// Name: pulumi.String(frontendIpConfigurationName), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// BackendAddressPools: network.ApplicationGatewayBackendAddressPoolArray{ +// &network.ApplicationGatewayBackendAddressPoolArgs{ +// Name: pulumi.String(backendAddressPoolName), +// }, +// }, +// BackendHttpSettings: network.ApplicationGatewayBackendHttpSettingArray{ +// &network.ApplicationGatewayBackendHttpSettingArgs{ +// Name: pulumi.String(httpSettingName), +// CookieBasedAffinity: pulumi.String("Disabled"), +// Path: pulumi.String("/path1/"), +// Port: pulumi.Int(80), +// Protocol: pulumi.String("Http"), +// RequestTimeout: pulumi.Int(60), +// }, +// }, +// HttpListeners: network.ApplicationGatewayHttpListenerArray{ +// &network.ApplicationGatewayHttpListenerArgs{ +// Name: pulumi.String(listenerName), +// FrontendIpConfigurationName: pulumi.String(frontendIpConfigurationName), +// FrontendPortName: pulumi.String(frontendPortName), +// Protocol: pulumi.String("Http"), +// }, +// }, +// RequestRoutingRules: network.ApplicationGatewayRequestRoutingRuleArray{ +// &network.ApplicationGatewayRequestRoutingRuleArgs{ +// Name: pulumi.String(requestRoutingRuleName), +// Priority: pulumi.Int(9), +// RuleType: pulumi.String("Basic"), +// HttpListenerName: pulumi.String(listenerName), +// BackendAddressPoolName: pulumi.String(backendAddressPoolName), +// BackendHttpSettingsName: pulumi.String(httpSettingName), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/applicationSecurityGroup.go b/sdk/go/azure/network/applicationSecurityGroup.go index 33443cb4a7..e215b38e7c 100644 --- a/sdk/go/azure/network/applicationSecurityGroup.go +++ b/sdk/go/azure/network/applicationSecurityGroup.go @@ -15,6 +15,43 @@ import ( // Manages an Application Security Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewApplicationSecurityGroup(ctx, "exampleApplicationSecurityGroup", &network.ApplicationSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "Hello": pulumi.String("World"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/bgpConnection.go b/sdk/go/azure/network/bgpConnection.go index 08817cb8cf..2d514e27e1 100644 --- a/sdk/go/azure/network/bgpConnection.go +++ b/sdk/go/azure/network/bgpConnection.go @@ -15,6 +15,90 @@ import ( // Manages a Bgp Connection for a Virtual Hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHubIp, err := network.NewVirtualHubIp(ctx, "exampleVirtualHubIp", &network.VirtualHubIpArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// PrivateIpAddress: pulumi.String("10.5.1.18"), +// PrivateIpAllocationMethod: pulumi.String("Static"), +// PublicIpAddressId: examplePublicIp.ID(), +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewBgpConnection(ctx, "exampleBgpConnection", &network.BgpConnectionArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// PeerAsn: pulumi.Int(65514), +// PeerIp: pulumi.String("169.254.21.5"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleVirtualHubIp, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Hub Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/ddosProtectionPlan.go b/sdk/go/azure/network/ddosProtectionPlan.go index 98087a6097..fb847e6c5b 100644 --- a/sdk/go/azure/network/ddosProtectionPlan.go +++ b/sdk/go/azure/network/ddosProtectionPlan.go @@ -19,6 +19,40 @@ import ( // // > **NOTE** The DDoS Protection Plan is a [high-cost service](https://azure.microsoft.com/en-us/pricing/details/ddos-protection/#pricing). Please keep this in mind while testing and learning. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewDdosProtectionPlan(ctx, "exampleDdosProtectionPlan", &network.DdosProtectionPlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure DDoS Protection Plan can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/expressRouteCircuit.go b/sdk/go/azure/network/expressRouteCircuit.go index b0dafdc503..9285e19cb7 100644 --- a/sdk/go/azure/network/expressRouteCircuit.go +++ b/sdk/go/azure/network/expressRouteCircuit.go @@ -15,6 +15,50 @@ import ( // Manages an ExpressRoute circuit. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRouteCircuit(ctx, "exampleExpressRouteCircuit", &network.ExpressRouteCircuitArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServiceProviderName: pulumi.String("Equinix"), +// PeeringLocation: pulumi.String("Silicon Valley"), +// BandwidthInMbps: pulumi.Int(50), +// Sku: &network.ExpressRouteCircuitSkuArgs{ +// Tier: pulumi.String("Standard"), +// Family: pulumi.String("MeteredData"), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ExpressRoute circuits can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/expressRouteCircuitAuthorization.go b/sdk/go/azure/network/expressRouteCircuitAuthorization.go index df2ff75839..5907f46a4d 100644 --- a/sdk/go/azure/network/expressRouteCircuitAuthorization.go +++ b/sdk/go/azure/network/expressRouteCircuitAuthorization.go @@ -15,6 +15,58 @@ import ( // Manages an ExpressRoute Circuit Authorization. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteCircuit, err := network.NewExpressRouteCircuit(ctx, "exampleExpressRouteCircuit", &network.ExpressRouteCircuitArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServiceProviderName: pulumi.String("Equinix"), +// PeeringLocation: pulumi.String("Silicon Valley"), +// BandwidthInMbps: pulumi.Int(50), +// Sku: &network.ExpressRouteCircuitSkuArgs{ +// Tier: pulumi.String("Standard"), +// Family: pulumi.String("MeteredData"), +// }, +// AllowClassicOperations: pulumi.Bool(false), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRouteCircuitAuthorization(ctx, "exampleExpressRouteCircuitAuthorization", &network.ExpressRouteCircuitAuthorizationArgs{ +// ExpressRouteCircuitName: exampleExpressRouteCircuit.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ExpressRoute Circuit Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/expressRouteCircuitConnection.go b/sdk/go/azure/network/expressRouteCircuitConnection.go index 315d76b40d..4925042a18 100644 --- a/sdk/go/azure/network/expressRouteCircuitConnection.go +++ b/sdk/go/azure/network/expressRouteCircuitConnection.go @@ -15,6 +15,114 @@ import ( // Manages an Express Route Circuit Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRoutePort, err := network.NewExpressRoutePort(ctx, "exampleExpressRoutePort", &network.ExpressRoutePortArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PeeringLocation: pulumi.String("Equinix-Seattle-SE2"), +// BandwidthInGbps: pulumi.Int(10), +// Encapsulation: pulumi.String("Dot1Q"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteCircuit, err := network.NewExpressRouteCircuit(ctx, "exampleExpressRouteCircuit", &network.ExpressRouteCircuitArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ExpressRoutePortId: exampleExpressRoutePort.ID(), +// BandwidthInGbps: pulumi.Float64(5), +// Sku: &network.ExpressRouteCircuitSkuArgs{ +// Tier: pulumi.String("Standard"), +// Family: pulumi.String("MeteredData"), +// }, +// }) +// if err != nil { +// return err +// } +// example2ExpressRoutePort, err := network.NewExpressRoutePort(ctx, "example2ExpressRoutePort", &network.ExpressRoutePortArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PeeringLocation: pulumi.String("Allied-Toronto-King-West"), +// BandwidthInGbps: pulumi.Int(10), +// Encapsulation: pulumi.String("Dot1Q"), +// }) +// if err != nil { +// return err +// } +// example2ExpressRouteCircuit, err := network.NewExpressRouteCircuit(ctx, "example2ExpressRouteCircuit", &network.ExpressRouteCircuitArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ExpressRoutePortId: example2ExpressRoutePort.ID(), +// BandwidthInGbps: pulumi.Float64(5), +// Sku: &network.ExpressRouteCircuitSkuArgs{ +// Tier: pulumi.String("Standard"), +// Family: pulumi.String("MeteredData"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteCircuitPeering, err := network.NewExpressRouteCircuitPeering(ctx, "exampleExpressRouteCircuitPeering", &network.ExpressRouteCircuitPeeringArgs{ +// PeeringType: pulumi.String("AzurePrivatePeering"), +// ExpressRouteCircuitName: exampleExpressRouteCircuit.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// SharedKey: pulumi.String("ItsASecret"), +// PeerAsn: pulumi.Int(100), +// PrimaryPeerAddressPrefix: pulumi.String("192.168.1.0/30"), +// SecondaryPeerAddressPrefix: pulumi.String("192.168.1.0/30"), +// VlanId: pulumi.Int(100), +// }) +// if err != nil { +// return err +// } +// example2ExpressRouteCircuitPeering, err := network.NewExpressRouteCircuitPeering(ctx, "example2ExpressRouteCircuitPeering", &network.ExpressRouteCircuitPeeringArgs{ +// PeeringType: pulumi.String("AzurePrivatePeering"), +// ExpressRouteCircuitName: example2ExpressRouteCircuit.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// SharedKey: pulumi.String("ItsASecret"), +// PeerAsn: pulumi.Int(100), +// PrimaryPeerAddressPrefix: pulumi.String("192.168.1.0/30"), +// SecondaryPeerAddressPrefix: pulumi.String("192.168.1.0/30"), +// VlanId: pulumi.Int(100), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRouteCircuitConnection(ctx, "exampleExpressRouteCircuitConnection", &network.ExpressRouteCircuitConnectionArgs{ +// PeeringId: exampleExpressRouteCircuitPeering.ID(), +// PeerPeeringId: example2ExpressRouteCircuitPeering.ID(), +// AddressPrefixIpv4: pulumi.String("192.169.9.0/29"), +// AuthorizationKey: pulumi.String("846a1918-b7a2-4917-b43c-8c4cdaee006a"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Express Route Circuit Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/expressRouteCircuitPeering.go b/sdk/go/azure/network/expressRouteCircuitPeering.go index a2d75de25c..5aaeb8f3f1 100644 --- a/sdk/go/azure/network/expressRouteCircuitPeering.go +++ b/sdk/go/azure/network/expressRouteCircuitPeering.go @@ -16,6 +16,140 @@ import ( // Manages an ExpressRoute Circuit Peering. // // ## Example Usage +// ### Creating A Microsoft Peering) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteCircuit, err := network.NewExpressRouteCircuit(ctx, "exampleExpressRouteCircuit", &network.ExpressRouteCircuitArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServiceProviderName: pulumi.String("Equinix"), +// PeeringLocation: pulumi.String("Silicon Valley"), +// BandwidthInMbps: pulumi.Int(50), +// Sku: &network.ExpressRouteCircuitSkuArgs{ +// Tier: pulumi.String("Standard"), +// Family: pulumi.String("MeteredData"), +// }, +// AllowClassicOperations: pulumi.Bool(false), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRouteCircuitPeering(ctx, "exampleExpressRouteCircuitPeering", &network.ExpressRouteCircuitPeeringArgs{ +// PeeringType: pulumi.String("MicrosoftPeering"), +// ExpressRouteCircuitName: exampleExpressRouteCircuit.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PeerAsn: pulumi.Int(100), +// PrimaryPeerAddressPrefix: pulumi.String("123.0.0.0/30"), +// SecondaryPeerAddressPrefix: pulumi.String("123.0.0.4/30"), +// Ipv4Enabled: pulumi.Bool(true), +// VlanId: pulumi.Int(300), +// MicrosoftPeeringConfig: &network.ExpressRouteCircuitPeeringMicrosoftPeeringConfigArgs{ +// AdvertisedPublicPrefixes: pulumi.StringArray{ +// pulumi.String("123.1.0.0/24"), +// }, +// }, +// Ipv6: &network.ExpressRouteCircuitPeeringIpv6Args{ +// PrimaryPeerAddressPrefix: pulumi.String("2002:db01::/126"), +// SecondaryPeerAddressPrefix: pulumi.String("2003:db01::/126"), +// Enabled: pulumi.Bool(true), +// MicrosoftPeering: &network.ExpressRouteCircuitPeeringIpv6MicrosoftPeeringArgs{ +// AdvertisedPublicPrefixes: pulumi.StringArray{ +// pulumi.String("2002:db01::/126"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Creating Azure Private Peering) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteCircuit, err := network.NewExpressRouteCircuit(ctx, "exampleExpressRouteCircuit", &network.ExpressRouteCircuitArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServiceProviderName: pulumi.String("Equinix"), +// PeeringLocation: pulumi.String("Silicon Valley"), +// BandwidthInMbps: pulumi.Int(50), +// Sku: &network.ExpressRouteCircuitSkuArgs{ +// Tier: pulumi.String("Standard"), +// Family: pulumi.String("MeteredData"), +// }, +// AllowClassicOperations: pulumi.Bool(false), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRouteCircuitPeering(ctx, "exampleExpressRouteCircuitPeering", &network.ExpressRouteCircuitPeeringArgs{ +// PeeringType: pulumi.String("AzurePrivatePeering"), +// ExpressRouteCircuitName: exampleExpressRouteCircuit.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PeerAsn: pulumi.Int(100), +// PrimaryPeerAddressPrefix: pulumi.String("123.0.0.0/30"), +// SecondaryPeerAddressPrefix: pulumi.String("123.0.0.4/30"), +// Ipv4Enabled: pulumi.Bool(true), +// VlanId: pulumi.Int(300), +// Ipv6: &network.ExpressRouteCircuitPeeringIpv6Args{ +// PrimaryPeerAddressPrefix: pulumi.String("2002:db01::/126"), +// SecondaryPeerAddressPrefix: pulumi.String("2003:db01::/126"), +// Enabled: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/network/expressRouteConnection.go b/sdk/go/azure/network/expressRouteConnection.go index fbfa5306f2..251eed302b 100644 --- a/sdk/go/azure/network/expressRouteConnection.go +++ b/sdk/go/azure/network/expressRouteConnection.go @@ -17,6 +17,101 @@ import ( // // > **NOTE:** The provider status of the Express Route Circuit must be set as provisioned while creating the Express Route Connection. See more details [here](https://docs.microsoft.com/azure/expressroute/expressroute-howto-circuit-portal-resource-manager#send-the-service-key-to-your-connectivity-provider-for-provisioning). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteGateway, err := network.NewExpressRouteGateway(ctx, "exampleExpressRouteGateway", &network.ExpressRouteGatewayArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualHubId: exampleVirtualHub.ID(), +// ScaleUnits: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleExpressRoutePort, err := network.NewExpressRoutePort(ctx, "exampleExpressRoutePort", &network.ExpressRoutePortArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PeeringLocation: pulumi.String("Equinix-Seattle-SE2"), +// BandwidthInGbps: pulumi.Int(10), +// Encapsulation: pulumi.String("Dot1Q"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteCircuit, err := network.NewExpressRouteCircuit(ctx, "exampleExpressRouteCircuit", &network.ExpressRouteCircuitArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ExpressRoutePortId: exampleExpressRoutePort.ID(), +// BandwidthInGbps: pulumi.Float64(5), +// Sku: &network.ExpressRouteCircuitSkuArgs{ +// Tier: pulumi.String("Standard"), +// Family: pulumi.String("MeteredData"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleExpressRouteCircuitPeering, err := network.NewExpressRouteCircuitPeering(ctx, "exampleExpressRouteCircuitPeering", &network.ExpressRouteCircuitPeeringArgs{ +// PeeringType: pulumi.String("AzurePrivatePeering"), +// ExpressRouteCircuitName: exampleExpressRouteCircuit.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// SharedKey: pulumi.String("ItsASecret"), +// PeerAsn: pulumi.Int(100), +// PrimaryPeerAddressPrefix: pulumi.String("192.168.1.0/30"), +// SecondaryPeerAddressPrefix: pulumi.String("192.168.2.0/30"), +// VlanId: pulumi.Int(100), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRouteConnection(ctx, "exampleExpressRouteConnection", &network.ExpressRouteConnectionArgs{ +// ExpressRouteGatewayId: exampleExpressRouteGateway.ID(), +// ExpressRouteCircuitPeeringId: exampleExpressRouteCircuitPeering.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Express Route Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/expressRouteGateway.go b/sdk/go/azure/network/expressRouteGateway.go index bd384a2854..05b706c479 100644 --- a/sdk/go/azure/network/expressRouteGateway.go +++ b/sdk/go/azure/network/expressRouteGateway.go @@ -15,6 +15,61 @@ import ( // Manages an ExpressRoute gateway. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRouteGateway(ctx, "exampleExpressRouteGateway", &network.ExpressRouteGatewayArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualHubId: exampleVirtualHub.ID(), +// ScaleUnits: pulumi.Int(1), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ExpressRoute Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/expressRoutePort.go b/sdk/go/azure/network/expressRoutePort.go index 9de3624468..c7a9b48136 100644 --- a/sdk/go/azure/network/expressRoutePort.go +++ b/sdk/go/azure/network/expressRoutePort.go @@ -15,6 +15,43 @@ import ( // Manages a Express Route Port. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRoutePort(ctx, "exampleExpressRoutePort", &network.ExpressRoutePortArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PeeringLocation: pulumi.String("Airtel-Chennai-CLS"), +// BandwidthInGbps: pulumi.Int(10), +// Encapsulation: pulumi.String("Dot1Q"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Express Route Ports can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/expressRoutePortAuthorization.go b/sdk/go/azure/network/expressRoutePortAuthorization.go index 8353a82452..f33512ece3 100644 --- a/sdk/go/azure/network/expressRoutePortAuthorization.go +++ b/sdk/go/azure/network/expressRoutePortAuthorization.go @@ -15,6 +15,50 @@ import ( // Manages an ExpressRoute Port Authorization. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleExpressRoutePort, err := network.NewExpressRoutePort(ctx, "exampleExpressRoutePort", &network.ExpressRoutePortArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PeeringLocation: pulumi.String("Airtel-Chennai-CLS"), +// BandwidthInGbps: pulumi.Int(10), +// Encapsulation: pulumi.String("Dot1Q"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewExpressRoutePortAuthorization(ctx, "exampleExpressRoutePortAuthorization", &network.ExpressRoutePortAuthorizationArgs{ +// ExpressRoutePortName: exampleExpressRoutePort.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ExpressRoute Port Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/firewall.go b/sdk/go/azure/network/firewall.go index d23511a8e4..bf866c79f5 100644 --- a/sdk/go/azure/network/firewall.go +++ b/sdk/go/azure/network/firewall.go @@ -15,6 +15,78 @@ import ( // Manages an Azure Firewall. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewFirewall(ctx, "exampleFirewall", &network.FirewallArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("AZFW_VNet"), +// SkuTier: pulumi.String("Standard"), +// IpConfigurations: network.FirewallIpConfigurationArray{ +// &network.FirewallIpConfigurationArgs{ +// Name: pulumi.String("configuration"), +// SubnetId: exampleSubnet.ID(), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Firewalls can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/firewallApplicationRuleCollection.go b/sdk/go/azure/network/firewallApplicationRuleCollection.go index 184acae95b..961dccc0d4 100644 --- a/sdk/go/azure/network/firewallApplicationRuleCollection.go +++ b/sdk/go/azure/network/firewallApplicationRuleCollection.go @@ -15,6 +15,104 @@ import ( // Manages an Application Rule Collection within an Azure Firewall. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleFirewall, err := network.NewFirewall(ctx, "exampleFirewall", &network.FirewallArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("AZFW_VNet"), +// SkuTier: pulumi.String("Standard"), +// IpConfigurations: network.FirewallIpConfigurationArray{ +// &network.FirewallIpConfigurationArgs{ +// Name: pulumi.String("configuration"), +// SubnetId: exampleSubnet.ID(), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewFirewallApplicationRuleCollection(ctx, "exampleFirewallApplicationRuleCollection", &network.FirewallApplicationRuleCollectionArgs{ +// AzureFirewallName: exampleFirewall.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Priority: pulumi.Int(100), +// Action: pulumi.String("Allow"), +// Rules: network.FirewallApplicationRuleCollectionRuleArray{ +// &network.FirewallApplicationRuleCollectionRuleArgs{ +// Name: pulumi.String("testrule"), +// SourceAddresses: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// TargetFqdns: pulumi.StringArray{ +// pulumi.String("*.google.com"), +// }, +// Protocols: network.FirewallApplicationRuleCollectionRuleProtocolArray{ +// &network.FirewallApplicationRuleCollectionRuleProtocolArgs{ +// Port: pulumi.Int(443), +// Type: pulumi.String("Https"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Firewall Application Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/firewallNatRuleCollection.go b/sdk/go/azure/network/firewallNatRuleCollection.go index 3df819de43..379ff168a5 100644 --- a/sdk/go/azure/network/firewallNatRuleCollection.go +++ b/sdk/go/azure/network/firewallNatRuleCollection.go @@ -15,6 +15,107 @@ import ( // Manages a NAT Rule Collection within an Azure Firewall. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleFirewall, err := network.NewFirewall(ctx, "exampleFirewall", &network.FirewallArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("AZFW_VNet"), +// SkuTier: pulumi.String("Standard"), +// IpConfigurations: network.FirewallIpConfigurationArray{ +// &network.FirewallIpConfigurationArgs{ +// Name: pulumi.String("configuration"), +// SubnetId: exampleSubnet.ID(), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewFirewallNatRuleCollection(ctx, "exampleFirewallNatRuleCollection", &network.FirewallNatRuleCollectionArgs{ +// AzureFirewallName: exampleFirewall.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Priority: pulumi.Int(100), +// Action: pulumi.String("Dnat"), +// Rules: network.FirewallNatRuleCollectionRuleArray{ +// &network.FirewallNatRuleCollectionRuleArgs{ +// Name: pulumi.String("testrule"), +// SourceAddresses: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// DestinationPorts: pulumi.StringArray{ +// pulumi.String("53"), +// }, +// DestinationAddresses: pulumi.StringArray{ +// examplePublicIp.IpAddress, +// }, +// TranslatedPort: pulumi.String("53"), +// TranslatedAddress: pulumi.String("8.8.8.8"), +// Protocols: pulumi.StringArray{ +// pulumi.String("TCP"), +// pulumi.String("UDP"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Firewall NAT Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/firewallNetworkRuleCollection.go b/sdk/go/azure/network/firewallNetworkRuleCollection.go index 4d37c741fe..56ec192cef 100644 --- a/sdk/go/azure/network/firewallNetworkRuleCollection.go +++ b/sdk/go/azure/network/firewallNetworkRuleCollection.go @@ -15,6 +15,106 @@ import ( // Manages a Network Rule Collection within an Azure Firewall. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleFirewall, err := network.NewFirewall(ctx, "exampleFirewall", &network.FirewallArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("AZFW_VNet"), +// SkuTier: pulumi.String("Standard"), +// IpConfigurations: network.FirewallIpConfigurationArray{ +// &network.FirewallIpConfigurationArgs{ +// Name: pulumi.String("configuration"), +// SubnetId: exampleSubnet.ID(), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewFirewallNetworkRuleCollection(ctx, "exampleFirewallNetworkRuleCollection", &network.FirewallNetworkRuleCollectionArgs{ +// AzureFirewallName: exampleFirewall.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Priority: pulumi.Int(100), +// Action: pulumi.String("Allow"), +// Rules: network.FirewallNetworkRuleCollectionRuleArray{ +// &network.FirewallNetworkRuleCollectionRuleArgs{ +// Name: pulumi.String("testrule"), +// SourceAddresses: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// DestinationPorts: pulumi.StringArray{ +// pulumi.String("53"), +// }, +// DestinationAddresses: pulumi.StringArray{ +// pulumi.String("8.8.8.8"), +// pulumi.String("8.8.4.4"), +// }, +// Protocols: pulumi.StringArray{ +// pulumi.String("TCP"), +// pulumi.String("UDP"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Firewall Network Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/firewallPolicy.go b/sdk/go/azure/network/firewallPolicy.go index 1bfbc4c059..45923f642e 100644 --- a/sdk/go/azure/network/firewallPolicy.go +++ b/sdk/go/azure/network/firewallPolicy.go @@ -15,6 +15,40 @@ import ( // Manages a Firewall Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewFirewallPolicy(ctx, "exampleFirewallPolicy", &network.FirewallPolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/getApplicationGateway.go b/sdk/go/azure/network/getApplicationGateway.go index 975ed9cb77..adf8d20777 100644 --- a/sdk/go/azure/network/getApplicationGateway.go +++ b/sdk/go/azure/network/getApplicationGateway.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Application Gateway. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupApplicationGateway(ctx, &network.LookupApplicationGatewayArgs{ +// Name: "existing-app-gateway", +// ResourceGroupName: "existing-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupApplicationGateway(ctx *pulumi.Context, args *LookupApplicationGatewayArgs, opts ...pulumi.InvokeOption) (*LookupApplicationGatewayResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupApplicationGatewayResult diff --git a/sdk/go/azure/network/getApplicationSecurityGroup.go b/sdk/go/azure/network/getApplicationSecurityGroup.go index 716d561cd4..bb970f3576 100644 --- a/sdk/go/azure/network/getApplicationSecurityGroup.go +++ b/sdk/go/azure/network/getApplicationSecurityGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Application Security Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupApplicationSecurityGroup(ctx, &network.LookupApplicationSecurityGroupArgs{ +// Name: "tf-appsecuritygroup", +// ResourceGroupName: "my-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("applicationSecurityGroupId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupApplicationSecurityGroup(ctx *pulumi.Context, args *LookupApplicationSecurityGroupArgs, opts ...pulumi.InvokeOption) (*LookupApplicationSecurityGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupApplicationSecurityGroupResult diff --git a/sdk/go/azure/network/getExpressRouteCircuit.go b/sdk/go/azure/network/getExpressRouteCircuit.go index 38965b1efa..1114765dc7 100644 --- a/sdk/go/azure/network/getExpressRouteCircuit.go +++ b/sdk/go/azure/network/getExpressRouteCircuit.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing ExpressRoute circuit. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupExpressRouteCircuit(ctx, &network.LookupExpressRouteCircuitArgs{ +// ResourceGroupName: azurerm_resource_group.Example.Name, +// Name: azurerm_express_route_circuit.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("expressRouteCircuitId", example.Id) +// ctx.Export("serviceKey", example.ServiceKey) +// return nil +// }) +// } +// +// ``` func LookupExpressRouteCircuit(ctx *pulumi.Context, args *LookupExpressRouteCircuitArgs, opts ...pulumi.InvokeOption) (*LookupExpressRouteCircuitResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupExpressRouteCircuitResult diff --git a/sdk/go/azure/network/getFirewall.go b/sdk/go/azure/network/getFirewall.go index 0675e0b05d..be51ac6999 100644 --- a/sdk/go/azure/network/getFirewall.go +++ b/sdk/go/azure/network/getFirewall.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Azure Firewall. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupFirewall(ctx, &network.LookupFirewallArgs{ +// Name: "firewall1", +// ResourceGroupName: "firewall-RG", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("firewallPrivateIp", example.IpConfigurations[0].PrivateIpAddress) +// return nil +// }) +// } +// +// ``` func LookupFirewall(ctx *pulumi.Context, args *LookupFirewallArgs, opts ...pulumi.InvokeOption) (*LookupFirewallResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFirewallResult diff --git a/sdk/go/azure/network/getFirewallPolicy.go b/sdk/go/azure/network/getFirewallPolicy.go index b076cbdabe..d834b0a43f 100644 --- a/sdk/go/azure/network/getFirewallPolicy.go +++ b/sdk/go/azure/network/getFirewallPolicy.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Firewall Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupFirewallPolicy(ctx, &network.LookupFirewallPolicyArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupFirewallPolicy(ctx *pulumi.Context, args *LookupFirewallPolicyArgs, opts ...pulumi.InvokeOption) (*LookupFirewallPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFirewallPolicyResult diff --git a/sdk/go/azure/network/getGatewayConnection.go b/sdk/go/azure/network/getGatewayConnection.go index b1d0f6c620..9aeec297fb 100644 --- a/sdk/go/azure/network/getGatewayConnection.go +++ b/sdk/go/azure/network/getGatewayConnection.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Virtual Network Gateway Connection. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.GetGatewayConnection(ctx, &network.GetGatewayConnectionArgs{ +// Name: "production", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("virtualNetworkGatewayConnectionId", example.Id) +// return nil +// }) +// } +// +// ``` func GetGatewayConnection(ctx *pulumi.Context, args *GetGatewayConnectionArgs, opts ...pulumi.InvokeOption) (*GetGatewayConnectionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetGatewayConnectionResult diff --git a/sdk/go/azure/network/getIpGroup.go b/sdk/go/azure/network/getIpGroup.go index 58e57ef923..1e92e73099 100644 --- a/sdk/go/azure/network/getIpGroup.go +++ b/sdk/go/azure/network/getIpGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing IP Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.GetIpGroup(ctx, &network.GetIpGroupArgs{ +// Name: "example1-ipgroup", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("cidrs", example.Cidrs) +// return nil +// }) +// } +// +// ``` func GetIpGroup(ctx *pulumi.Context, args *GetIpGroupArgs, opts ...pulumi.InvokeOption) (*GetIpGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetIpGroupResult diff --git a/sdk/go/azure/network/getLocalNetworkGateway.go b/sdk/go/azure/network/getLocalNetworkGateway.go index b6075e6f55..8b59bcde99 100644 --- a/sdk/go/azure/network/getLocalNetworkGateway.go +++ b/sdk/go/azure/network/getLocalNetworkGateway.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Local Network Gateway. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupLocalNetworkGateway(ctx, &network.LookupLocalNetworkGatewayArgs{ +// Name: "existing-local-network-gateway", +// ResourceGroupName: "existing-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupLocalNetworkGateway(ctx *pulumi.Context, args *LookupLocalNetworkGatewayArgs, opts ...pulumi.InvokeOption) (*LookupLocalNetworkGatewayResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupLocalNetworkGatewayResult diff --git a/sdk/go/azure/network/getNetworkDdosProtectionPlan.go b/sdk/go/azure/network/getNetworkDdosProtectionPlan.go index ee0834a95e..dc277a88a6 100644 --- a/sdk/go/azure/network/getNetworkDdosProtectionPlan.go +++ b/sdk/go/azure/network/getNetworkDdosProtectionPlan.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Azure Network DDoS Protection Plan. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.GetNetworkDdosProtectionPlan(ctx, &network.GetNetworkDdosProtectionPlanArgs{ +// Name: azurerm_network_ddos_protection_plan.Example.Name, +// ResourceGroupName: azurerm_network_ddos_protection_plan.Example.Resource_group_name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("ddosProtectionPlanId", example.Id) +// return nil +// }) +// } +// +// ``` func GetNetworkDdosProtectionPlan(ctx *pulumi.Context, args *GetNetworkDdosProtectionPlanArgs, opts ...pulumi.InvokeOption) (*GetNetworkDdosProtectionPlanResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetNetworkDdosProtectionPlanResult diff --git a/sdk/go/azure/network/getNetworkInterface.go b/sdk/go/azure/network/getNetworkInterface.go index 5d3eaf9aee..563691852d 100644 --- a/sdk/go/azure/network/getNetworkInterface.go +++ b/sdk/go/azure/network/getNetworkInterface.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Network Interface. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupNetworkInterface(ctx, &network.LookupNetworkInterfaceArgs{ +// Name: "acctest-nic", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("networkInterfaceId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupNetworkInterface(ctx *pulumi.Context, args *LookupNetworkInterfaceArgs, opts ...pulumi.InvokeOption) (*LookupNetworkInterfaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkInterfaceResult diff --git a/sdk/go/azure/network/getNetworkSecurityGroup.go b/sdk/go/azure/network/getNetworkSecurityGroup.go index 249e85c12a..733e40c7fd 100644 --- a/sdk/go/azure/network/getNetworkSecurityGroup.go +++ b/sdk/go/azure/network/getNetworkSecurityGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Network Security Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupNetworkSecurityGroup(ctx, &network.LookupNetworkSecurityGroupArgs{ +// Name: "example", +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("location", example.Location) +// return nil +// }) +// } +// +// ``` func LookupNetworkSecurityGroup(ctx *pulumi.Context, args *LookupNetworkSecurityGroupArgs, opts ...pulumi.InvokeOption) (*LookupNetworkSecurityGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkSecurityGroupResult diff --git a/sdk/go/azure/network/getNetworkWatcher.go b/sdk/go/azure/network/getNetworkWatcher.go index 3d59759c7d..cdfe224e5d 100644 --- a/sdk/go/azure/network/getNetworkWatcher.go +++ b/sdk/go/azure/network/getNetworkWatcher.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Network Watcher. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupNetworkWatcher(ctx, &network.LookupNetworkWatcherArgs{ +// Name: azurerm_network_watcher.Example.Name, +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("networkWatcherId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupNetworkWatcher(ctx *pulumi.Context, args *LookupNetworkWatcherArgs, opts ...pulumi.InvokeOption) (*LookupNetworkWatcherResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNetworkWatcherResult diff --git a/sdk/go/azure/network/getPublicIP.go b/sdk/go/azure/network/getPublicIP.go index 2819fc67f5..f56b1ead57 100644 --- a/sdk/go/azure/network/getPublicIP.go +++ b/sdk/go/azure/network/getPublicIP.go @@ -15,6 +15,124 @@ import ( // Use this data source to access information about an existing Public IP Address. // // ## Example Usage +// ### Reference An Existing) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.GetPublicIP(ctx, &network.GetPublicIPArgs{ +// Name: "name_of_public_ip", +// ResourceGroupName: "name_of_resource_group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("domainNameLabel", example.DomainNameLabel) +// ctx.Export("publicIpAddress", example.IpAddress) +// return nil +// }) +// } +// +// ``` +// ### Retrieve The Dynamic Public IP Of A New VM) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// IdleTimeoutInMinutes: pulumi.Int(30), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("test"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Static"), +// PrivateIpAddress: pulumi.String("10.0.2.5"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualMachine, err := compute.NewVirtualMachine(ctx, "exampleVirtualMachine", &compute.VirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _ = network.GetPublicIPOutput(ctx, network.GetPublicIPOutputArgs{ +// Name: examplePublicIp.Name, +// ResourceGroupName: exampleVirtualMachine.ResourceGroupName, +// }, nil) +// ctx.Export("publicIpAddress", examplePublicIp.IpAddress) +// return nil +// }) +// } +// +// ``` func GetPublicIP(ctx *pulumi.Context, args *GetPublicIPArgs, opts ...pulumi.InvokeOption) (*GetPublicIPResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPublicIPResult diff --git a/sdk/go/azure/network/getPublicIPs.go b/sdk/go/azure/network/getPublicIPs.go index 461889dc80..36a565c778 100644 --- a/sdk/go/azure/network/getPublicIPs.go +++ b/sdk/go/azure/network/getPublicIPs.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about a set of existing Public IP Addresses. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := network.GetPublicIPs(ctx, &network.GetPublicIPsArgs{ +// AttachmentStatus: pulumi.StringRef("Attached"), +// ResourceGroupName: "pip-test", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetPublicIPs(ctx *pulumi.Context, args *GetPublicIPsArgs, opts ...pulumi.InvokeOption) (*GetPublicIPsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPublicIPsResult diff --git a/sdk/go/azure/network/getPublicIpPrefix.go b/sdk/go/azure/network/getPublicIpPrefix.go index 60556ad19b..34a9cde193 100644 --- a/sdk/go/azure/network/getPublicIpPrefix.go +++ b/sdk/go/azure/network/getPublicIpPrefix.go @@ -15,6 +15,33 @@ import ( // Use this data source to access information about an existing Public IP Prefix. // // ## Example Usage +// ### Reference An Existing) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupPublicIpPrefix(ctx, &network.LookupPublicIpPrefixArgs{ +// Name: "name_of_public_ip", +// ResourceGroupName: "name_of_resource_group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("publicIpPrefix", example.IpPrefix) +// return nil +// }) +// } +// +// ``` func LookupPublicIpPrefix(ctx *pulumi.Context, args *LookupPublicIpPrefixArgs, opts ...pulumi.InvokeOption) (*LookupPublicIpPrefixResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPublicIpPrefixResult diff --git a/sdk/go/azure/network/getRouteFilter.go b/sdk/go/azure/network/getRouteFilter.go index 86a525bc4a..02ce4efe4f 100644 --- a/sdk/go/azure/network/getRouteFilter.go +++ b/sdk/go/azure/network/getRouteFilter.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Route Filter. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupRouteFilter(ctx, &network.LookupRouteFilterArgs{ +// Name: "existing", +// ResourceGroupName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupRouteFilter(ctx *pulumi.Context, args *LookupRouteFilterArgs, opts ...pulumi.InvokeOption) (*LookupRouteFilterResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRouteFilterResult diff --git a/sdk/go/azure/network/getRouteTable.go b/sdk/go/azure/network/getRouteTable.go index 9fca9d5cdd..d4408541db 100644 --- a/sdk/go/azure/network/getRouteTable.go +++ b/sdk/go/azure/network/getRouteTable.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Route Table. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := network.LookupRouteTable(ctx, &network.LookupRouteTableArgs{ +// Name: "myroutetable", +// ResourceGroupName: "some-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupRouteTable(ctx *pulumi.Context, args *LookupRouteTableArgs, opts ...pulumi.InvokeOption) (*LookupRouteTableResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupRouteTableResult diff --git a/sdk/go/azure/network/getServiceTags.go b/sdk/go/azure/network/getServiceTags.go index d3e3d7e1f3..ae7cea3bae 100644 --- a/sdk/go/azure/network/getServiceTags.go +++ b/sdk/go/azure/network/getServiceTags.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about Service Tags. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.GetServiceTags(ctx, &network.GetServiceTagsArgs{ +// Location: "westcentralus", +// Service: "AzureKeyVault", +// LocationFilter: pulumi.StringRef("northeurope"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("addressPrefixes", example.AddressPrefixes) +// ctx.Export("ipv4Cidrs", example.Ipv4Cidrs) +// return nil +// }) +// } +// +// ``` func GetServiceTags(ctx *pulumi.Context, args *GetServiceTagsArgs, opts ...pulumi.InvokeOption) (*GetServiceTagsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetServiceTagsResult diff --git a/sdk/go/azure/network/getSubnet.go b/sdk/go/azure/network/getSubnet.go index 14f7f286b5..e336fc7150 100644 --- a/sdk/go/azure/network/getSubnet.go +++ b/sdk/go/azure/network/getSubnet.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Subnet within a Virtual Network. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupSubnet(ctx, &network.LookupSubnetArgs{ +// Name: "backend", +// VirtualNetworkName: "production", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("subnetId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupSubnet(ctx *pulumi.Context, args *LookupSubnetArgs, opts ...pulumi.InvokeOption) (*LookupSubnetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSubnetResult diff --git a/sdk/go/azure/network/getTrafficManager.go b/sdk/go/azure/network/getTrafficManager.go index cafe026ee0..ba93a419f6 100644 --- a/sdk/go/azure/network/getTrafficManager.go +++ b/sdk/go/azure/network/getTrafficManager.go @@ -15,6 +15,32 @@ import ( // Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. // // ## Example Usage +// ### World) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.GetTrafficManager(ctx, &network.GetTrafficManagerArgs{ +// Name: "World", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("locationCode", example.Id) +// return nil +// }) +// } +// +// ``` func GetTrafficManager(ctx *pulumi.Context, args *GetTrafficManagerArgs, opts ...pulumi.InvokeOption) (*GetTrafficManagerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetTrafficManagerResult diff --git a/sdk/go/azure/network/getTrafficManagerProfile.go b/sdk/go/azure/network/getTrafficManagerProfile.go index 980b5cb084..0eab65cc34 100644 --- a/sdk/go/azure/network/getTrafficManagerProfile.go +++ b/sdk/go/azure/network/getTrafficManagerProfile.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Traffic Manager Profile. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupTrafficManagerProfile(ctx, &network.LookupTrafficManagerProfileArgs{ +// Name: "test", +// ResourceGroupName: "test", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("trafficRoutingMethod", example.TrafficRoutingMethod) +// return nil +// }) +// } +// +// ``` func LookupTrafficManagerProfile(ctx *pulumi.Context, args *LookupTrafficManagerProfileArgs, opts ...pulumi.InvokeOption) (*LookupTrafficManagerProfileResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTrafficManagerProfileResult diff --git a/sdk/go/azure/network/getVirtualHub.go b/sdk/go/azure/network/getVirtualHub.go index 80393087b9..32877ad956 100644 --- a/sdk/go/azure/network/getVirtualHub.go +++ b/sdk/go/azure/network/getVirtualHub.go @@ -13,6 +13,34 @@ import ( ) // Uses this data source to access information about an existing Virtual Hub. +// +// ## Virtual Hub Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupVirtualHub(ctx, &network.LookupVirtualHubArgs{ +// Name: "example-hub", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("virtualHubId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVirtualHub(ctx *pulumi.Context, args *LookupVirtualHubArgs, opts ...pulumi.InvokeOption) (*LookupVirtualHubResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualHubResult diff --git a/sdk/go/azure/network/getVirtualHubConnection.go b/sdk/go/azure/network/getVirtualHubConnection.go index 4933fd34f0..732182e653 100644 --- a/sdk/go/azure/network/getVirtualHubConnection.go +++ b/sdk/go/azure/network/getVirtualHubConnection.go @@ -13,6 +13,35 @@ import ( ) // Uses this data source to access information about an existing Virtual Hub Connection. +// +// ## Virtual Hub Connection Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupVirtualHubConnection(ctx, &network.LookupVirtualHubConnectionArgs{ +// Name: "example-connection", +// ResourceGroupName: "example-resources", +// VirtualHubName: "example-hub-name", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("virtualHubConnectionId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVirtualHubConnection(ctx *pulumi.Context, args *LookupVirtualHubConnectionArgs, opts ...pulumi.InvokeOption) (*LookupVirtualHubConnectionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualHubConnectionResult diff --git a/sdk/go/azure/network/getVirtualHubRouteTable.go b/sdk/go/azure/network/getVirtualHubRouteTable.go index 5979d4b21d..7611818489 100644 --- a/sdk/go/azure/network/getVirtualHubRouteTable.go +++ b/sdk/go/azure/network/getVirtualHubRouteTable.go @@ -13,6 +13,35 @@ import ( ) // Uses this data source to access information about an existing Virtual Hub Route Table. +// +// ## Virtual Hub Route Table Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupVirtualHubRouteTable(ctx, &network.LookupVirtualHubRouteTableArgs{ +// Name: "example-hub-route-table", +// ResourceGroupName: "example-resources", +// VirtualHubName: "example-hub-name", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("virtualHubRouteTableId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVirtualHubRouteTable(ctx *pulumi.Context, args *LookupVirtualHubRouteTableArgs, opts ...pulumi.InvokeOption) (*LookupVirtualHubRouteTableResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualHubRouteTableResult diff --git a/sdk/go/azure/network/getVirtualNetwork.go b/sdk/go/azure/network/getVirtualNetwork.go index f1c182ade1..0f67cbe9b3 100644 --- a/sdk/go/azure/network/getVirtualNetwork.go +++ b/sdk/go/azure/network/getVirtualNetwork.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Virtual Network. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupVirtualNetwork(ctx, &network.LookupVirtualNetworkArgs{ +// Name: "production", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("virtualNetworkId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVirtualNetwork(ctx *pulumi.Context, args *LookupVirtualNetworkArgs, opts ...pulumi.InvokeOption) (*LookupVirtualNetworkResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualNetworkResult diff --git a/sdk/go/azure/network/getVirtualNetworkGateway.go b/sdk/go/azure/network/getVirtualNetworkGateway.go index 8e89c00618..2cfc3ef82b 100644 --- a/sdk/go/azure/network/getVirtualNetworkGateway.go +++ b/sdk/go/azure/network/getVirtualNetworkGateway.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Virtual Network Gateway. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupVirtualNetworkGateway(ctx, &network.LookupVirtualNetworkGatewayArgs{ +// Name: "production", +// ResourceGroupName: "networking", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("virtualNetworkGatewayId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVirtualNetworkGateway(ctx *pulumi.Context, args *LookupVirtualNetworkGatewayArgs, opts ...pulumi.InvokeOption) (*LookupVirtualNetworkGatewayResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualNetworkGatewayResult diff --git a/sdk/go/azure/network/getVpnGateway.go b/sdk/go/azure/network/getVpnGateway.go index d5c4fc9ba5..328bc6cc23 100644 --- a/sdk/go/azure/network/getVpnGateway.go +++ b/sdk/go/azure/network/getVpnGateway.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing VPN Gateway within a Virtual Hub. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.LookupVpnGateway(ctx, &network.LookupVpnGatewayArgs{ +// Name: "existing-local-vpn_gateway", +// ResourceGroupName: "existing-vpn_gateway", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("azurermVpnGatewayId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupVpnGateway(ctx *pulumi.Context, args *LookupVpnGatewayArgs, opts ...pulumi.InvokeOption) (*LookupVpnGatewayResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVpnGatewayResult diff --git a/sdk/go/azure/network/ipgroup.go b/sdk/go/azure/network/ipgroup.go index f193b6abef..a218eef5d7 100644 --- a/sdk/go/azure/network/ipgroup.go +++ b/sdk/go/azure/network/ipgroup.go @@ -15,6 +15,48 @@ import ( // Manages an IP group that contains a list of CIDRs and/or IP addresses. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewIPGroup(ctx, "exampleIPGroup", &network.IPGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Cidrs: pulumi.StringArray{ +// pulumi.String("192.168.0.1"), +// pulumi.String("172.16.240.0/20"), +// pulumi.String("10.48.0.0/12"), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IP Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/ipgroupCIDR.go b/sdk/go/azure/network/ipgroupCIDR.go index 2c3d8e9516..9917426414 100644 --- a/sdk/go/azure/network/ipgroupCIDR.go +++ b/sdk/go/azure/network/ipgroupCIDR.go @@ -19,6 +19,47 @@ import ( // `network.IPGroup` resource for the same IP Group. Doing so will cause a conflict and // CIDRS will be removed. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleIPGroup, err := network.NewIPGroup(ctx, "exampleIPGroup", &network.IPGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewIPGroupCIDR(ctx, "exampleIPGroupCIDR", &network.IPGroupCIDRArgs{ +// IpGroupId: exampleIPGroup.ID(), +// Cidr: pulumi.String("10.10.10.0/24"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // IP Group CIDRs can be imported using the `resource id` of the IP Group and the CIDR value (`/` characters have to be replaced by `_`), e.g. diff --git a/sdk/go/azure/network/localNetworkGateway.go b/sdk/go/azure/network/localNetworkGateway.go index e71599a5d1..c15b659924 100644 --- a/sdk/go/azure/network/localNetworkGateway.go +++ b/sdk/go/azure/network/localNetworkGateway.go @@ -15,6 +15,44 @@ import ( // Manages a local network gateway connection over which specific connections can be configured. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewLocalNetworkGateway(ctx, "home", &network.LocalNetworkGatewayArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// GatewayAddress: pulumi.String("12.13.14.15"), +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Local Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/natGateway.go b/sdk/go/azure/network/natGateway.go index c9f35b3ae9..a460a54249 100644 --- a/sdk/go/azure/network/natGateway.go +++ b/sdk/go/azure/network/natGateway.go @@ -15,6 +15,47 @@ import ( // Manages an Azure NAT Gateway. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNatGateway(ctx, "exampleNatGateway", &network.NatGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// IdleTimeoutInMinutes: pulumi.Int(10), +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// For more complete examples, please see the network.NatGatewayPublicIpAssociation and network.NatGatewayPublicIpPrefixAssociation resources. +// // ## Import // // NAT Gateway can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/natGatewayPublicIpAssociation.go b/sdk/go/azure/network/natGatewayPublicIpAssociation.go index 29001d5411..f6f1db41b9 100644 --- a/sdk/go/azure/network/natGatewayPublicIpAssociation.go +++ b/sdk/go/azure/network/natGatewayPublicIpAssociation.go @@ -15,6 +15,57 @@ import ( // Manages the association between a NAT Gateway and a Public IP. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleNatGateway, err := network.NewNatGateway(ctx, "exampleNatGateway", &network.NatGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNatGatewayPublicIpAssociation(ctx, "exampleNatGatewayPublicIpAssociation", &network.NatGatewayPublicIpAssociationArgs{ +// NatGatewayId: exampleNatGateway.ID(), +// PublicIpAddressId: examplePublicIp.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between NAT Gateway and Public IP Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/natGatewayPublicIpPrefixAssociation.go b/sdk/go/azure/network/natGatewayPublicIpPrefixAssociation.go index dddd8259ba..f0d1255f37 100644 --- a/sdk/go/azure/network/natGatewayPublicIpPrefixAssociation.go +++ b/sdk/go/azure/network/natGatewayPublicIpPrefixAssociation.go @@ -15,6 +15,59 @@ import ( // Manages the association between a NAT Gateway and a Public IP Prefix. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIpPrefix, err := network.NewPublicIpPrefix(ctx, "examplePublicIpPrefix", &network.PublicIpPrefixArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PrefixLength: pulumi.Int(30), +// Zones: pulumi.StringArray{ +// pulumi.String("1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNatGateway, err := network.NewNatGateway(ctx, "exampleNatGateway", &network.NatGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNatGatewayPublicIpPrefixAssociation(ctx, "exampleNatGatewayPublicIpPrefixAssociation", &network.NatGatewayPublicIpPrefixAssociationArgs{ +// NatGatewayId: exampleNatGateway.ID(), +// PublicIpPrefixId: examplePublicIpPrefix.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between NAT Gateway and Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkConnectionMonitor.go b/sdk/go/azure/network/networkConnectionMonitor.go index 221baba15e..2239972dbb 100644 --- a/sdk/go/azure/network/networkConnectionMonitor.go +++ b/sdk/go/azure/network/networkConnectionMonitor.go @@ -17,6 +17,181 @@ import ( // // > **NOTE:** Any Network Connection Monitor resource created with API versions 2019-06-01 or earlier (v1) are now incompatible with this provider, which now only supports v2. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkWatcher, err := network.NewNetworkWatcher(ctx, "exampleNetworkWatcher", &network.NetworkWatcherArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualMachine, err := compute.NewVirtualMachine(ctx, "exampleVirtualMachine", &compute.VirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// VmSize: pulumi.String("Standard_D2s_v3"), +// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{ +// Name: pulumi.String("osdisk-example01"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Standard_LRS"), +// }, +// OsProfile: &compute.VirtualMachineOsProfileArgs{ +// ComputerName: pulumi.String("hostnametest01"), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// }, +// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(false), +// }, +// }) +// if err != nil { +// return err +// } +// exampleExtension, err := compute.NewExtension(ctx, "exampleExtension", &compute.ExtensionArgs{ +// VirtualMachineId: exampleVirtualMachine.ID(), +// Publisher: pulumi.String("Microsoft.Azure.NetworkWatcher"), +// Type: pulumi.String("NetworkWatcherAgentLinux"), +// TypeHandlerVersion: pulumi.String("1.4"), +// AutoUpgradeMinorVersion: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkConnectionMonitor(ctx, "exampleNetworkConnectionMonitor", &network.NetworkConnectionMonitorArgs{ +// NetworkWatcherId: exampleNetworkWatcher.ID(), +// Location: exampleNetworkWatcher.Location, +// Endpoints: network.NetworkConnectionMonitorEndpointArray{ +// &network.NetworkConnectionMonitorEndpointArgs{ +// Name: pulumi.String("source"), +// TargetResourceId: exampleVirtualMachine.ID(), +// Filter: &network.NetworkConnectionMonitorEndpointFilterArgs{ +// Items: network.NetworkConnectionMonitorEndpointFilterItemArray{ +// &network.NetworkConnectionMonitorEndpointFilterItemArgs{ +// Address: exampleVirtualMachine.ID(), +// Type: pulumi.String("AgentAddress"), +// }, +// }, +// Type: pulumi.String("Include"), +// }, +// }, +// &network.NetworkConnectionMonitorEndpointArgs{ +// Name: pulumi.String("destination"), +// Address: pulumi.String("mycompany.io"), +// }, +// }, +// TestConfigurations: network.NetworkConnectionMonitorTestConfigurationArray{ +// &network.NetworkConnectionMonitorTestConfigurationArgs{ +// Name: pulumi.String("tcpName"), +// Protocol: pulumi.String("Tcp"), +// TestFrequencyInSeconds: pulumi.Int(60), +// TcpConfiguration: &network.NetworkConnectionMonitorTestConfigurationTcpConfigurationArgs{ +// Port: pulumi.Int(80), +// }, +// }, +// }, +// TestGroups: network.NetworkConnectionMonitorTestGroupArray{ +// &network.NetworkConnectionMonitorTestGroupArgs{ +// Name: pulumi.String("exampletg"), +// DestinationEndpoints: pulumi.StringArray{ +// pulumi.String("destination"), +// }, +// SourceEndpoints: pulumi.StringArray{ +// pulumi.String("source"), +// }, +// TestConfigurationNames: pulumi.StringArray{ +// pulumi.String("tcpName"), +// }, +// }, +// }, +// Notes: pulumi.String("examplenote"), +// OutputWorkspaceResourceIds: pulumi.StringArray{ +// exampleAnalyticsWorkspace.ID(), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleExtension, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Connection Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkInterface.go b/sdk/go/azure/network/networkInterface.go index 23c67f7c2d..f98c2bd324 100644 --- a/sdk/go/azure/network/networkInterface.go +++ b/sdk/go/azure/network/networkInterface.go @@ -15,6 +15,67 @@ import ( // Manages a Network Interface. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Interfaces can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkInterfaceApplicationSecurityGroupAssociation.go b/sdk/go/azure/network/networkInterfaceApplicationSecurityGroupAssociation.go index 959d54c879..bba1b05802 100644 --- a/sdk/go/azure/network/networkInterfaceApplicationSecurityGroupAssociation.go +++ b/sdk/go/azure/network/networkInterfaceApplicationSecurityGroupAssociation.go @@ -15,6 +15,81 @@ import ( // Manages the association between a Network Interface and a Application Security Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleApplicationSecurityGroup, err := network.NewApplicationSecurityGroup(ctx, "exampleApplicationSecurityGroup", &network.ApplicationSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkInterfaceApplicationSecurityGroupAssociation(ctx, "exampleNetworkInterfaceApplicationSecurityGroupAssociation", &network.NetworkInterfaceApplicationSecurityGroupAssociationArgs{ +// NetworkInterfaceId: exampleNetworkInterface.ID(), +// ApplicationSecurityGroupId: exampleApplicationSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between Network Interfaces and Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkInterfaceBackendAddressPoolAssociation.go b/sdk/go/azure/network/networkInterfaceBackendAddressPoolAssociation.go index ab5862034b..1a86bc0829 100644 --- a/sdk/go/azure/network/networkInterfaceBackendAddressPoolAssociation.go +++ b/sdk/go/azure/network/networkInterfaceBackendAddressPoolAssociation.go @@ -15,6 +15,103 @@ import ( // Manages the association between a Network Interface and a Load Balancer's Backend Address Pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("primary"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleBackendAddressPool, err := lb.NewBackendAddressPool(ctx, "exampleBackendAddressPool", &lb.BackendAddressPoolArgs{ +// LoadbalancerId: exampleLoadBalancer.ID(), +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkInterfaceBackendAddressPoolAssociation(ctx, "exampleNetworkInterfaceBackendAddressPoolAssociation", &network.NetworkInterfaceBackendAddressPoolAssociationArgs{ +// NetworkInterfaceId: exampleNetworkInterface.ID(), +// IpConfigurationName: pulumi.String("testconfiguration1"), +// BackendAddressPoolId: exampleBackendAddressPool.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between Network Interfaces and Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkInterfaceNatRuleAssociation.go b/sdk/go/azure/network/networkInterfaceNatRuleAssociation.go index fabec24cf4..671e3fbcbd 100644 --- a/sdk/go/azure/network/networkInterfaceNatRuleAssociation.go +++ b/sdk/go/azure/network/networkInterfaceNatRuleAssociation.go @@ -15,6 +15,108 @@ import ( // Manages the association between a Network Interface and a Load Balancer's NAT Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: pulumi.String("primary"), +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleNatRule, err := lb.NewNatRule(ctx, "exampleNatRule", &lb.NatRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// LoadbalancerId: exampleLoadBalancer.ID(), +// Protocol: pulumi.String("Tcp"), +// FrontendPort: pulumi.Int(3389), +// BackendPort: pulumi.Int(3389), +// FrontendIpConfigurationName: pulumi.String("primary"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkInterfaceNatRuleAssociation(ctx, "exampleNetworkInterfaceNatRuleAssociation", &network.NetworkInterfaceNatRuleAssociationArgs{ +// NetworkInterfaceId: exampleNetworkInterface.ID(), +// IpConfigurationName: pulumi.String("testconfiguration1"), +// NatRuleId: exampleNatRule.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between Network Interfaces and Load Balancer NAT Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkInterfaceSecurityGroupAssociation.go b/sdk/go/azure/network/networkInterfaceSecurityGroupAssociation.go index 7cfa780c1c..a70b8efe96 100644 --- a/sdk/go/azure/network/networkInterfaceSecurityGroupAssociation.go +++ b/sdk/go/azure/network/networkInterfaceSecurityGroupAssociation.go @@ -15,6 +15,81 @@ import ( // Manages the association between a Network Interface and a Network Security Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkInterfaceSecurityGroupAssociation(ctx, "exampleNetworkInterfaceSecurityGroupAssociation", &network.NetworkInterfaceSecurityGroupAssociationArgs{ +// NetworkInterfaceId: exampleNetworkInterface.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between Network Interfaces and Network Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManager.go b/sdk/go/azure/network/networkManager.go index 3f88a2e25d..f312cda984 100644 --- a/sdk/go/azure/network/networkManager.go +++ b/sdk/go/azure/network/networkManager.go @@ -15,6 +15,57 @@ import ( // Manages a Network Managers. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("Connectivity"), +// pulumi.String("SecurityAdmin"), +// }, +// Description: pulumi.String("example network manager"), +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Managers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerAdminRule.go b/sdk/go/azure/network/networkManagerAdminRule.go index 87eda1c4df..22dbf939cb 100644 --- a/sdk/go/azure/network/networkManagerAdminRule.go +++ b/sdk/go/azure/network/networkManagerAdminRule.go @@ -15,6 +15,109 @@ import ( // Manages a Network Manager Admin Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("Connectivity"), +// pulumi.String("SecurityAdmin"), +// }, +// Description: pulumi.String("example network manager"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerNetworkGroup, err := network.NewNetworkManagerNetworkGroup(ctx, "exampleNetworkManagerNetworkGroup", &network.NetworkManagerNetworkGroupArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerSecurityAdminConfiguration, err := network.NewNetworkManagerSecurityAdminConfiguration(ctx, "exampleNetworkManagerSecurityAdminConfiguration", &network.NetworkManagerSecurityAdminConfigurationArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerAdminRuleCollection, err := network.NewNetworkManagerAdminRuleCollection(ctx, "exampleNetworkManagerAdminRuleCollection", &network.NetworkManagerAdminRuleCollectionArgs{ +// SecurityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.ID(), +// NetworkGroupIds: pulumi.StringArray{ +// exampleNetworkManagerNetworkGroup.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerAdminRule(ctx, "exampleNetworkManagerAdminRule", &network.NetworkManagerAdminRuleArgs{ +// AdminRuleCollectionId: exampleNetworkManagerAdminRuleCollection.ID(), +// Action: pulumi.String("Deny"), +// Direction: pulumi.String("Outbound"), +// Priority: pulumi.Int(1), +// Protocol: pulumi.String("Tcp"), +// SourcePortRanges: pulumi.StringArray{ +// pulumi.String("80"), +// pulumi.String("1024-65535"), +// }, +// DestinationPortRanges: pulumi.StringArray{ +// pulumi.String("80"), +// }, +// Sources: network.NetworkManagerAdminRuleSourceArray{ +// &network.NetworkManagerAdminRuleSourceArgs{ +// AddressPrefixType: pulumi.String("ServiceTag"), +// AddressPrefix: pulumi.String("Internet"), +// }, +// }, +// Destinations: network.NetworkManagerAdminRuleDestinationArray{ +// &network.NetworkManagerAdminRuleDestinationArgs{ +// AddressPrefixType: pulumi.String("IPPrefix"), +// AddressPrefix: pulumi.String("10.1.0.1"), +// }, +// &network.NetworkManagerAdminRuleDestinationArgs{ +// AddressPrefixType: pulumi.String("IPPrefix"), +// AddressPrefix: pulumi.String("10.0.0.0/24"), +// }, +// }, +// Description: pulumi.String("example admin rule"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Admin Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerAdminRuleCollection.go b/sdk/go/azure/network/networkManagerAdminRuleCollection.go index f14468aeb8..d7ccd11a6d 100644 --- a/sdk/go/azure/network/networkManagerAdminRuleCollection.go +++ b/sdk/go/azure/network/networkManagerAdminRuleCollection.go @@ -15,6 +15,75 @@ import ( // Manages a Network Manager Admin Rule Collection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("Connectivity"), +// pulumi.String("SecurityAdmin"), +// }, +// Description: pulumi.String("example network manager"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerNetworkGroup, err := network.NewNetworkManagerNetworkGroup(ctx, "exampleNetworkManagerNetworkGroup", &network.NetworkManagerNetworkGroupArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerSecurityAdminConfiguration, err := network.NewNetworkManagerSecurityAdminConfiguration(ctx, "exampleNetworkManagerSecurityAdminConfiguration", &network.NetworkManagerSecurityAdminConfigurationArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerAdminRuleCollection(ctx, "exampleNetworkManagerAdminRuleCollection", &network.NetworkManagerAdminRuleCollectionArgs{ +// SecurityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.ID(), +// NetworkGroupIds: pulumi.StringArray{ +// exampleNetworkManagerNetworkGroup.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Admin Rule Collection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerConnectivityConfiguration.go b/sdk/go/azure/network/networkManagerConnectivityConfiguration.go index b2be762499..9d1c3646a5 100644 --- a/sdk/go/azure/network/networkManagerConnectivityConfiguration.go +++ b/sdk/go/azure/network/networkManagerConnectivityConfiguration.go @@ -17,6 +17,88 @@ import ( // // > **Note:** The `network.NetworkManagerConnectivityConfiguration` deployment may modify or delete existing Network Peering resource. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("Connectivity"), +// pulumi.String("SecurityAdmin"), +// }, +// Description: pulumi.String("example network manager"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerNetworkGroup, err := network.NewNetworkManagerNetworkGroup(ctx, "exampleNetworkManagerNetworkGroup", &network.NetworkManagerNetworkGroupArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// FlowTimeoutInMinutes: pulumi.Int(10), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerConnectivityConfiguration(ctx, "exampleNetworkManagerConnectivityConfiguration", &network.NetworkManagerConnectivityConfigurationArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// ConnectivityTopology: pulumi.String("HubAndSpoke"), +// AppliesToGroups: network.NetworkManagerConnectivityConfigurationAppliesToGroupArray{ +// &network.NetworkManagerConnectivityConfigurationAppliesToGroupArgs{ +// GroupConnectivity: pulumi.String("DirectlyConnected"), +// NetworkGroupId: exampleNetworkManagerNetworkGroup.ID(), +// }, +// }, +// Hub: &network.NetworkManagerConnectivityConfigurationHubArgs{ +// ResourceId: exampleVirtualNetwork.ID(), +// ResourceType: pulumi.String("Microsoft.Network/virtualNetworks"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Connectivity Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerDeployment.go b/sdk/go/azure/network/networkManagerDeployment.go index 217b9ceabf..3a9f864556 100644 --- a/sdk/go/azure/network/networkManagerDeployment.go +++ b/sdk/go/azure/network/networkManagerDeployment.go @@ -17,6 +17,99 @@ import ( // // > **NOTE on Virtual Network Peering:** Using Network Manager Deployment to deploy Connectivity Configuration may modify or delete existing Virtual Network Peering. At this time you should not use Network Peering resource in conjunction with Network Manager Deployment. Doing so may cause a conflict of Peering configurations. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("Connectivity"), +// pulumi.String("SecurityAdmin"), +// }, +// Description: pulumi.String("example network manager"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerNetworkGroup, err := network.NewNetworkManagerNetworkGroup(ctx, "exampleNetworkManagerNetworkGroup", &network.NetworkManagerNetworkGroupArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// FlowTimeoutInMinutes: pulumi.Int(10), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerConnectivityConfiguration, err := network.NewNetworkManagerConnectivityConfiguration(ctx, "exampleNetworkManagerConnectivityConfiguration", &network.NetworkManagerConnectivityConfigurationArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// ConnectivityTopology: pulumi.String("HubAndSpoke"), +// AppliesToGroups: network.NetworkManagerConnectivityConfigurationAppliesToGroupArray{ +// &network.NetworkManagerConnectivityConfigurationAppliesToGroupArgs{ +// GroupConnectivity: pulumi.String("None"), +// NetworkGroupId: exampleNetworkManagerNetworkGroup.ID(), +// }, +// }, +// Hub: &network.NetworkManagerConnectivityConfigurationHubArgs{ +// ResourceId: exampleVirtualNetwork.ID(), +// ResourceType: pulumi.String("Microsoft.Network/virtualNetworks"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerDeployment(ctx, "exampleNetworkManagerDeployment", &network.NetworkManagerDeploymentArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// Location: pulumi.String("eastus"), +// ScopeAccess: pulumi.String("Connectivity"), +// ConfigurationIds: pulumi.StringArray{ +// exampleNetworkManagerConnectivityConfiguration.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerManagementGroupConnection.go b/sdk/go/azure/network/networkManagerManagementGroupConnection.go index 5e8ac5c147..3debceb2c3 100644 --- a/sdk/go/azure/network/networkManagerManagementGroupConnection.go +++ b/sdk/go/azure/network/networkManagerManagementGroupConnection.go @@ -15,6 +15,93 @@ import ( // Manages a Network Manager Management Group Connection which may cross tenants. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleGroup, err := management.NewGroup(ctx, "exampleGroup", nil) +// if err != nil { +// return err +// } +// alt, err := core.LookupSubscription(ctx, &core.LookupSubscriptionArgs{ +// SubscriptionId: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = management.NewGroupSubscriptionAssociation(ctx, "exampleGroupSubscriptionAssociation", &management.GroupSubscriptionAssociationArgs{ +// ManagementGroupId: exampleGroup.ID(), +// SubscriptionId: *pulumi.String(alt.Id), +// }) +// if err != nil { +// return err +// } +// currentSubscription, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// currentClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// networkContributor, err := authorization.NewAssignment(ctx, "networkContributor", &authorization.AssignmentArgs{ +// Scope: exampleGroup.ID(), +// RoleDefinitionName: pulumi.String("Network Contributor"), +// PrincipalId: *pulumi.String(currentClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(currentSubscription.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("SecurityAdmin"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerManagementGroupConnection(ctx, "exampleNetworkManagerManagementGroupConnection", &network.NetworkManagerManagementGroupConnectionArgs{ +// ManagementGroupId: exampleGroup.ID(), +// NetworkManagerId: exampleNetworkManager.ID(), +// Description: pulumi.String("example"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// networkContributor, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Management Group Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerNetworkGroup.go b/sdk/go/azure/network/networkManagerNetworkGroup.go index 7f73454cd2..5f5c11570d 100644 --- a/sdk/go/azure/network/networkManagerNetworkGroup.go +++ b/sdk/go/azure/network/networkManagerNetworkGroup.go @@ -15,6 +15,60 @@ import ( // Manages a Network Manager Network Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("Connectivity"), +// pulumi.String("SecurityAdmin"), +// }, +// Description: pulumi.String("example network manager"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerNetworkGroup(ctx, "exampleNetworkManagerNetworkGroup", &network.NetworkManagerNetworkGroupArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Network Group can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerScopeConnection.go b/sdk/go/azure/network/networkManagerScopeConnection.go index dce502433f..d3f478b497 100644 --- a/sdk/go/azure/network/networkManagerScopeConnection.go +++ b/sdk/go/azure/network/networkManagerScopeConnection.go @@ -15,6 +15,71 @@ import ( // Manages a Network Manager Scope Connection which may cross tenants. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// currentClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// currentSubscription, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// alt, err := core.LookupSubscription(ctx, &core.LookupSubscriptionArgs{ +// SubscriptionId: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(currentSubscription.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("SecurityAdmin"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerScopeConnection(ctx, "exampleNetworkManagerScopeConnection", &network.NetworkManagerScopeConnectionArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// TenantId: *pulumi.String(currentClientConfig.TenantId), +// TargetScopeId: *pulumi.String(alt.Id), +// Description: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Scope Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerStaticMember.go b/sdk/go/azure/network/networkManagerStaticMember.go index 46dc457b40..df9bb6120e 100644 --- a/sdk/go/azure/network/networkManagerStaticMember.go +++ b/sdk/go/azure/network/networkManagerStaticMember.go @@ -15,6 +15,78 @@ import ( // Manages a Network Manager Static Member. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("Connectivity"), +// pulumi.String("SecurityAdmin"), +// }, +// Description: pulumi.String("example network manager"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkManagerNetworkGroup, err := network.NewNetworkManagerNetworkGroup(ctx, "exampleNetworkManagerNetworkGroup", &network.NetworkManagerNetworkGroupArgs{ +// NetworkManagerId: exampleNetworkManager.ID(), +// Description: pulumi.String("example network group"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerStaticMember(ctx, "exampleNetworkManagerStaticMember", &network.NetworkManagerStaticMemberArgs{ +// NetworkGroupId: exampleNetworkManagerNetworkGroup.ID(), +// TargetVirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Manager Static Member can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkManagerSubscriptionConnection.go b/sdk/go/azure/network/networkManagerSubscriptionConnection.go index efc4af6c52..c3a8066cf4 100644 --- a/sdk/go/azure/network/networkManagerSubscriptionConnection.go +++ b/sdk/go/azure/network/networkManagerSubscriptionConnection.go @@ -15,6 +15,60 @@ import ( // Manages a Network Manager Subscription Connection which may cross tenants. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleNetworkManager, err := network.NewNetworkManager(ctx, "exampleNetworkManager", &network.NetworkManagerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Scope: &network.NetworkManagerScopeArgs{ +// SubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.Id), +// }, +// }, +// ScopeAccesses: pulumi.StringArray{ +// pulumi.String("SecurityAdmin"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkManagerSubscriptionConnection(ctx, "exampleNetworkManagerSubscriptionConnection", &network.NetworkManagerSubscriptionConnectionArgs{ +// SubscriptionId: *pulumi.String(current.Id), +// NetworkManagerId: exampleNetworkManager.ID(), +// Description: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Subscription Network Manager Connection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkPacketCapture.go b/sdk/go/azure/network/networkPacketCapture.go index 9c58e35623..8cabdb3ca5 100644 --- a/sdk/go/azure/network/networkPacketCapture.go +++ b/sdk/go/azure/network/networkPacketCapture.go @@ -17,6 +17,141 @@ import ( // // !> **NOTE:** The `network.NetworkPacketCapture` resource is deprecated and will be removed in favour of `compute.PacketCapture` and `compute.ScaleSetPacketCapture` in version 4.0 of the AzureRM Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkWatcher, err := network.NewNetworkWatcher(ctx, "exampleNetworkWatcher", &network.NetworkWatcherArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("testconfiguration1"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualMachine, err := compute.NewVirtualMachine(ctx, "exampleVirtualMachine", &compute.VirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// VmSize: pulumi.String("Standard_F2"), +// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{ +// Name: pulumi.String("osdisk"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Standard_LRS"), +// }, +// OsProfile: &compute.VirtualMachineOsProfileArgs{ +// ComputerName: pulumi.String("pctest-vm"), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// }, +// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(false), +// }, +// }) +// if err != nil { +// return err +// } +// exampleExtension, err := compute.NewExtension(ctx, "exampleExtension", &compute.ExtensionArgs{ +// VirtualMachineId: exampleVirtualMachine.ID(), +// Publisher: pulumi.String("Microsoft.Azure.NetworkWatcher"), +// Type: pulumi.String("NetworkWatcherAgentLinux"), +// TypeHandlerVersion: pulumi.String("1.4"), +// AutoUpgradeMinorVersion: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkPacketCapture(ctx, "exampleNetworkPacketCapture", &network.NetworkPacketCaptureArgs{ +// NetworkWatcherName: exampleNetworkWatcher.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// TargetResourceId: exampleVirtualMachine.ID(), +// StorageLocation: &network.NetworkPacketCaptureStorageLocationArgs{ +// StorageAccountId: exampleAccount.ID(), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleExtension, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `compute.Extension` resource. +// // ## Import // // Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkSecurityGroup.go b/sdk/go/azure/network/networkSecurityGroup.go index c75146dd23..61f49d2cc5 100644 --- a/sdk/go/azure/network/networkSecurityGroup.go +++ b/sdk/go/azure/network/networkSecurityGroup.go @@ -19,6 +19,56 @@ import ( // provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. // At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SecurityRules: network.NetworkSecurityGroupSecurityRuleArray{ +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("test123"), +// Priority: pulumi.Int(100), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkSecurityRule.go b/sdk/go/azure/network/networkSecurityRule.go index 60a10b8bcb..7496b789bf 100644 --- a/sdk/go/azure/network/networkSecurityRule.go +++ b/sdk/go/azure/network/networkSecurityRule.go @@ -19,6 +19,55 @@ import ( // provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. // At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "exampleNetworkSecurityRule", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(100), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Security Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkWatcher.go b/sdk/go/azure/network/networkWatcher.go index fff671542f..21b76f133c 100644 --- a/sdk/go/azure/network/networkWatcher.go +++ b/sdk/go/azure/network/networkWatcher.go @@ -15,6 +15,40 @@ import ( // Manages a Network Watcher. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkWatcher(ctx, "exampleNetworkWatcher", &network.NetworkWatcherArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/networkWatcherFlowLog.go b/sdk/go/azure/network/networkWatcherFlowLog.go index 1ce0f201b9..b59a7a2006 100644 --- a/sdk/go/azure/network/networkWatcherFlowLog.go +++ b/sdk/go/azure/network/networkWatcherFlowLog.go @@ -13,6 +13,89 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// testNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "testNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// testNetworkWatcher, err := network.NewNetworkWatcher(ctx, "testNetworkWatcher", &network.NetworkWatcherArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// testAccount, err := storage.NewAccount(ctx, "testAccount", &storage.AccountArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// AccountTier: pulumi.String("Standard"), +// AccountKind: pulumi.String("StorageV2"), +// AccountReplicationType: pulumi.String("LRS"), +// EnableHttpsTrafficOnly: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// testAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "testAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkWatcherFlowLog(ctx, "testNetworkWatcherFlowLog", &network.NetworkWatcherFlowLogArgs{ +// NetworkWatcherName: testNetworkWatcher.Name, +// ResourceGroupName: example.Name, +// NetworkSecurityGroupId: testNetworkSecurityGroup.ID(), +// StorageAccountId: testAccount.ID(), +// Enabled: pulumi.Bool(true), +// RetentionPolicy: &network.NetworkWatcherFlowLogRetentionPolicyArgs{ +// Enabled: pulumi.Bool(true), +// Days: pulumi.Int(7), +// }, +// TrafficAnalytics: &network.NetworkWatcherFlowLogTrafficAnalyticsArgs{ +// Enabled: pulumi.Bool(true), +// WorkspaceId: testAnalyticsWorkspace.WorkspaceId, +// WorkspaceRegion: testAnalyticsWorkspace.Location, +// WorkspaceResourceId: testAnalyticsWorkspace.ID(), +// IntervalInMinutes: pulumi.Int(10), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Watcher Flow Logs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/pointToPointVpnGateway.go b/sdk/go/azure/network/pointToPointVpnGateway.go index 1b1e9b2e66..f643e58a35 100644 --- a/sdk/go/azure/network/pointToPointVpnGateway.go +++ b/sdk/go/azure/network/pointToPointVpnGateway.go @@ -15,6 +15,105 @@ import ( // Manages a Point-to-Site VPN Gateway. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.0.0/23"), +// }) +// if err != nil { +// return err +// } +// exampleVpnServerConfiguration, err := network.NewVpnServerConfiguration(ctx, "exampleVpnServerConfiguration", &network.VpnServerConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VpnAuthenticationTypes: pulumi.StringArray{ +// pulumi.String("Certificate"), +// }, +// ClientRootCertificates: network.VpnServerConfigurationClientRootCertificateArray{ +// &network.VpnServerConfigurationClientRootCertificateArgs{ +// Name: pulumi.String("DigiCert-Federated-ID-Root-CA"), +// PublicCertData: pulumi.String(`MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn +// +// MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +// d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg +// Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV +// BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp +// Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB +// MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j +// QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 +// zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf +// GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d +// GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 +// Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 +// DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV +// HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW +// jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP +// 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR +// QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL +// uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn +// WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq +// M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= +// `), +// +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewPointToPointVpnGateway(ctx, "examplePointToPointVpnGateway", &network.PointToPointVpnGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualHubId: exampleVirtualHub.ID(), +// VpnServerConfigurationId: exampleVpnServerConfiguration.ID(), +// ScaleUnit: pulumi.Int(1), +// ConnectionConfiguration: &network.PointToPointVpnGatewayConnectionConfigurationArgs{ +// Name: pulumi.String("example-gateway-config"), +// VpnClientAddressPool: &network.PointToPointVpnGatewayConnectionConfigurationVpnClientAddressPoolArgs{ +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Point-to-Site VPN Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/profile.go b/sdk/go/azure/network/profile.go index 09b4d87639..c57eaa559e 100644 --- a/sdk/go/azure/network/profile.go +++ b/sdk/go/azure/network/profile.go @@ -15,6 +15,80 @@ import ( // Manages a Network Profile. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.1.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.1.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("delegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.ContainerInstance/containerGroups"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewProfile(ctx, "exampleProfile", &network.ProfileArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// ContainerNetworkInterface: &network.ProfileContainerNetworkInterfaceArgs{ +// Name: pulumi.String("examplecnic"), +// IpConfigurations: network.ProfileContainerNetworkInterfaceIpConfigurationArray{ +// &network.ProfileContainerNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("exampleipconfig"), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Profile can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/publicIp.go b/sdk/go/azure/network/publicIp.go index 7207ae3e62..2fe113aa4c 100644 --- a/sdk/go/azure/network/publicIp.go +++ b/sdk/go/azure/network/publicIp.go @@ -17,6 +17,44 @@ import ( // // > **Note** If this resource is to be associated with a resource that requires disassociation before destruction (such as `network.NetworkInterface`) it is recommended to set the `lifecycle` argument `createBeforeDestroy = true`. Otherwise, it can fail to disassociate on destruction. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllocationMethod: pulumi.String("Static"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Public IPs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/publicIpPrefix.go b/sdk/go/azure/network/publicIpPrefix.go index d366e76838..6c188f4d64 100644 --- a/sdk/go/azure/network/publicIpPrefix.go +++ b/sdk/go/azure/network/publicIpPrefix.go @@ -15,6 +15,44 @@ import ( // Manages a Public IP Prefix. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewPublicIpPrefix(ctx, "examplePublicIpPrefix", &network.PublicIpPrefixArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// PrefixLength: pulumi.Int(31), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/pulumiTypes.go b/sdk/go/azure/network/pulumiTypes.go index f331f26e55..e430bf190c 100644 --- a/sdk/go/azure/network/pulumiTypes.go +++ b/sdk/go/azure/network/pulumiTypes.go @@ -2542,6 +2542,20 @@ type ApplicationGatewayPrivateLinkConfiguration struct { // One or more `ipConfiguration` blocks as defined below. // // > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` IpConfigurations []ApplicationGatewayPrivateLinkConfigurationIpConfiguration `pulumi:"ipConfigurations"` // The name of the private link configuration. Name string `pulumi:"name"` @@ -2564,6 +2578,20 @@ type ApplicationGatewayPrivateLinkConfigurationArgs struct { // One or more `ipConfiguration` blocks as defined below. // // > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` IpConfigurations ApplicationGatewayPrivateLinkConfigurationIpConfigurationArrayInput `pulumi:"ipConfigurations"` // The name of the private link configuration. Name pulumi.StringInput `pulumi:"name"` @@ -2646,6 +2674,23 @@ func (o ApplicationGatewayPrivateLinkConfigurationOutput) Id() pulumi.StringPtrO // One or more `ipConfiguration` blocks as defined below. // // > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` func (o ApplicationGatewayPrivateLinkConfigurationOutput) IpConfigurations() ApplicationGatewayPrivateLinkConfigurationIpConfigurationArrayOutput { return o.ApplyT(func(v ApplicationGatewayPrivateLinkConfiguration) []ApplicationGatewayPrivateLinkConfigurationIpConfiguration { return v.IpConfigurations diff --git a/sdk/go/azure/network/route.go b/sdk/go/azure/network/route.go index 5becf61296..26265c5076 100644 --- a/sdk/go/azure/network/route.go +++ b/sdk/go/azure/network/route.go @@ -19,6 +19,49 @@ import ( // provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource. // At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleRouteTable, err := network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewRoute(ctx, "exampleRoute", &network.RouteArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RouteTableName: exampleRouteTable.Name, +// AddressPrefix: pulumi.String("10.1.0.0/16"), +// NextHopType: pulumi.String("VnetLocal"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Routes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/routeFilter.go b/sdk/go/azure/network/routeFilter.go index ec35272579..03ce3833b1 100644 --- a/sdk/go/azure/network/routeFilter.go +++ b/sdk/go/azure/network/routeFilter.go @@ -15,6 +15,41 @@ import ( // Manages a Route Filter. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := network.NewRouteFilter(ctx, "example", &network.RouteFilterArgs{ +// Location: pulumi.String("East US"), +// ResourceGroupName: pulumi.String("example"), +// Rule: &network.RouteFilterRuleArgs{ +// Access: pulumi.String("Allow"), +// Communities: pulumi.StringArray{ +// pulumi.String("12076:52004"), +// }, +// Name: pulumi.String("rule"), +// RuleType: pulumi.String("Community"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Route Filters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/routeMap.go b/sdk/go/azure/network/routeMap.go index e6bca42e31..0e5c563e09 100644 --- a/sdk/go/azure/network/routeMap.go +++ b/sdk/go/azure/network/routeMap.go @@ -15,6 +15,81 @@ import ( // Manages a Route Map. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewRouteMap(ctx, "exampleRouteMap", &network.RouteMapArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// Rules: network.RouteMapRuleArray{ +// &network.RouteMapRuleArgs{ +// Name: pulumi.String("rule1"), +// NextStepIfMatched: pulumi.String("Continue"), +// Actions: network.RouteMapRuleActionArray{ +// &network.RouteMapRuleActionArgs{ +// Type: pulumi.String("Add"), +// Parameters: network.RouteMapRuleActionParameterArray{ +// &network.RouteMapRuleActionParameterArgs{ +// AsPaths: pulumi.StringArray{ +// pulumi.String("22334"), +// }, +// }, +// }, +// }, +// }, +// MatchCriterions: network.RouteMapRuleMatchCriterionArray{ +// &network.RouteMapRuleMatchCriterionArgs{ +// MatchCondition: pulumi.String("Contains"), +// RoutePrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/8"), +// }, +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Route Maps can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/routeServer.go b/sdk/go/azure/network/routeServer.go index a4165be3fa..c20112e6c6 100644 --- a/sdk/go/azure/network/routeServer.go +++ b/sdk/go/azure/network/routeServer.go @@ -15,6 +15,76 @@ import ( // Manages an Azure Route Server // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// VirtualNetworkName: exampleVirtualNetwork.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewRouteServer(ctx, "exampleRouteServer", &network.RouteServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard"), +// PublicIpAddressId: examplePublicIp.ID(), +// SubnetId: exampleSubnet.ID(), +// BranchToBranchTrafficEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Route Server can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/routeServerBgpConnection.go b/sdk/go/azure/network/routeServerBgpConnection.go index 5df9783cb1..1f0d362f08 100644 --- a/sdk/go/azure/network/routeServerBgpConnection.go +++ b/sdk/go/azure/network/routeServerBgpConnection.go @@ -15,6 +15,84 @@ import ( // Manages a Bgp Connection for a Route Server // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// VirtualNetworkName: exampleVirtualNetwork.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleRouteServer, err := network.NewRouteServer(ctx, "exampleRouteServer", &network.RouteServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard"), +// PublicIpAddressId: examplePublicIp.ID(), +// SubnetId: exampleSubnet.ID(), +// BranchToBranchTrafficEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewRouteServerBgpConnection(ctx, "exampleRouteServerBgpConnection", &network.RouteServerBgpConnectionArgs{ +// RouteServerId: exampleRouteServer.ID(), +// PeerAsn: pulumi.Int(65501), +// PeerIp: pulumi.String("169.254.21.5"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Route Server Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/routeTable.go b/sdk/go/azure/network/routeTable.go index 7b85bb1e1c..a831a38b6a 100644 --- a/sdk/go/azure/network/routeTable.go +++ b/sdk/go/azure/network/routeTable.go @@ -18,6 +18,51 @@ import ( // > **NOTE on Route Tables and Routes:** There is both a standalone `route` resource, and allows for Routes to be defined in-line within the `routeTable` resource. // At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DisableBgpRoutePropagation: pulumi.Bool(false), +// Routes: network.RouteTableRouteArray{ +// &network.RouteTableRouteArgs{ +// Name: pulumi.String("route1"), +// AddressPrefix: pulumi.String("10.1.0.0/16"), +// NextHopType: pulumi.String("VnetLocal"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/routingIntent.go b/sdk/go/azure/network/routingIntent.go index 27669f0541..c58a1b5596 100644 --- a/sdk/go/azure/network/routingIntent.go +++ b/sdk/go/azure/network/routingIntent.go @@ -15,6 +15,77 @@ import ( // Manages a Virtual Hub Routing Intent. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }) +// if err != nil { +// return err +// } +// exampleFirewall, err := network.NewFirewall(ctx, "exampleFirewall", &network.FirewallArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("AZFW_Hub"), +// SkuTier: pulumi.String("Standard"), +// VirtualHub: &network.FirewallVirtualHubArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// PublicIpCount: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewRoutingIntent(ctx, "exampleRoutingIntent", &network.RoutingIntentArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// RoutingPolicies: network.RoutingIntentRoutingPolicyArray{ +// &network.RoutingIntentRoutingPolicyArgs{ +// Name: pulumi.String("InternetTrafficPolicy"), +// Destinations: pulumi.StringArray{ +// pulumi.String("Internet"), +// }, +// NextHop: exampleFirewall.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Hub Routing Intents can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/securityPartnerProvider.go b/sdk/go/azure/network/securityPartnerProvider.go index 80af7bbd9d..bd3ac409ca 100644 --- a/sdk/go/azure/network/securityPartnerProvider.go +++ b/sdk/go/azure/network/securityPartnerProvider.go @@ -15,6 +15,71 @@ import ( // Manages a Security Partner Provider which could be associated to virtual hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.2.0/24"), +// }) +// if err != nil { +// return err +// } +// exampleVpnGateway, err := network.NewVpnGateway(ctx, "exampleVpnGateway", &network.VpnGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualHubId: exampleVirtualHub.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSecurityPartnerProvider(ctx, "exampleSecurityPartnerProvider", &network.SecurityPartnerProviderArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualHubId: exampleVirtualHub.ID(), +// SecurityProviderName: pulumi.String("IBoss"), +// Tags: pulumi.StringMap{ +// "ENV": pulumi.String("Prod"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleVpnGateway, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Security Partner Providers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/subnet.go b/sdk/go/azure/network/subnet.go index bb268ce1d4..87d5da7654 100644 --- a/sdk/go/azure/network/subnet.go +++ b/sdk/go/azure/network/subnet.go @@ -19,6 +19,65 @@ import ( // provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource. // At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnets. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("delegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.ContainerInstance/containerGroups"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subnets can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/subnetNatGatewayAssociation.go b/sdk/go/azure/network/subnetNatGatewayAssociation.go index aecd907159..4a3d91b71e 100644 --- a/sdk/go/azure/network/subnetNatGatewayAssociation.go +++ b/sdk/go/azure/network/subnetNatGatewayAssociation.go @@ -15,6 +15,67 @@ import ( // Associates a NAT Gateway with a Subnet within a Virtual Network. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNatGateway, err := network.NewNatGateway(ctx, "exampleNatGateway", &network.NatGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnetNatGatewayAssociation(ctx, "exampleSubnetNatGatewayAssociation", &network.SubnetNatGatewayAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// NatGatewayId: exampleNatGateway.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subnet NAT Gateway Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/go/azure/network/subnetNetworkSecurityGroupAssociation.go b/sdk/go/azure/network/subnetNetworkSecurityGroupAssociation.go index 6dabbc4bc9..719f2ef52b 100644 --- a/sdk/go/azure/network/subnetNetworkSecurityGroupAssociation.go +++ b/sdk/go/azure/network/subnetNetworkSecurityGroupAssociation.go @@ -15,6 +15,80 @@ import ( // Associates a Network Security Group with a Subnet within a Virtual Network. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SecurityRules: network.NetworkSecurityGroupSecurityRuleArray{ +// &network.NetworkSecurityGroupSecurityRuleArgs{ +// Name: pulumi.String("test123"), +// Priority: pulumi.Int(100), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnetNetworkSecurityGroupAssociation(ctx, "exampleSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subnet `<->` Network Security Group Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/go/azure/network/subnetRouteTableAssociation.go b/sdk/go/azure/network/subnetRouteTableAssociation.go index f01d91dc39..f0a4b41ab5 100644 --- a/sdk/go/azure/network/subnetRouteTableAssociation.go +++ b/sdk/go/azure/network/subnetRouteTableAssociation.go @@ -15,6 +15,75 @@ import ( // Associates a Route Table with a Subnet within a Virtual Network. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleRouteTable, err := network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Routes: network.RouteTableRouteArray{ +// &network.RouteTableRouteArgs{ +// Name: pulumi.String("example"), +// AddressPrefix: pulumi.String("10.100.0.0/14"), +// NextHopType: pulumi.String("VirtualAppliance"), +// NextHopInIpAddress: pulumi.String("10.10.1.1"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnetRouteTableAssociation(ctx, "exampleSubnetRouteTableAssociation", &network.SubnetRouteTableAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// RouteTableId: exampleRouteTable.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Subnet Route Table Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/go/azure/network/trafficManagerAzureEndpoint.go b/sdk/go/azure/network/trafficManagerAzureEndpoint.go index a5940326bf..123bbd1c1d 100644 --- a/sdk/go/azure/network/trafficManagerAzureEndpoint.go +++ b/sdk/go/azure/network/trafficManagerAzureEndpoint.go @@ -15,6 +15,72 @@ import ( // Manages an Azure Endpoint within a Traffic Manager Profile. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// DomainNameLabel: pulumi.String("example-public-ip"), +// }) +// if err != nil { +// return err +// } +// exampleTrafficManagerProfile, err := network.NewTrafficManagerProfile(ctx, "exampleTrafficManagerProfile", &network.TrafficManagerProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// TrafficRoutingMethod: pulumi.String("Weighted"), +// DnsConfig: &network.TrafficManagerProfileDnsConfigArgs{ +// RelativeName: pulumi.String("example-profile"), +// Ttl: pulumi.Int(100), +// }, +// MonitorConfig: &network.TrafficManagerProfileMonitorConfigArgs{ +// Protocol: pulumi.String("HTTP"), +// Port: pulumi.Int(80), +// Path: pulumi.String("/"), +// IntervalInSeconds: pulumi.Int(30), +// TimeoutInSeconds: pulumi.Int(9), +// ToleratedNumberOfFailures: pulumi.Int(3), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewTrafficManagerAzureEndpoint(ctx, "exampleTrafficManagerAzureEndpoint", &network.TrafficManagerAzureEndpointArgs{ +// ProfileId: exampleTrafficManagerProfile.ID(), +// Weight: pulumi.Int(100), +// TargetResourceId: examplePublicIp.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/trafficManagerExternalEndpoint.go b/sdk/go/azure/network/trafficManagerExternalEndpoint.go index 1878169195..9e72da3692 100644 --- a/sdk/go/azure/network/trafficManagerExternalEndpoint.go +++ b/sdk/go/azure/network/trafficManagerExternalEndpoint.go @@ -15,6 +15,63 @@ import ( // Manages an External Endpoint within a Traffic Manager Profile. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleTrafficManagerProfile, err := network.NewTrafficManagerProfile(ctx, "exampleTrafficManagerProfile", &network.TrafficManagerProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// TrafficRoutingMethod: pulumi.String("Weighted"), +// DnsConfig: &network.TrafficManagerProfileDnsConfigArgs{ +// RelativeName: pulumi.String("example-profile"), +// Ttl: pulumi.Int(100), +// }, +// MonitorConfig: &network.TrafficManagerProfileMonitorConfigArgs{ +// Protocol: pulumi.String("HTTP"), +// Port: pulumi.Int(80), +// Path: pulumi.String("/"), +// IntervalInSeconds: pulumi.Int(30), +// TimeoutInSeconds: pulumi.Int(9), +// ToleratedNumberOfFailures: pulumi.Int(3), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewTrafficManagerExternalEndpoint(ctx, "exampleTrafficManagerExternalEndpoint", &network.TrafficManagerExternalEndpointArgs{ +// ProfileId: exampleTrafficManagerProfile.ID(), +// Weight: pulumi.Int(100), +// Target: pulumi.String("www.example.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // External Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/trafficManagerNestedEndpoint.go b/sdk/go/azure/network/trafficManagerNestedEndpoint.go index f73afc2aeb..ad51cbca67 100644 --- a/sdk/go/azure/network/trafficManagerNestedEndpoint.go +++ b/sdk/go/azure/network/trafficManagerNestedEndpoint.go @@ -15,6 +15,90 @@ import ( // Manages a Nested Endpoint within a Traffic Manager Profile. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// DomainNameLabel: pulumi.String("example-pip"), +// }) +// if err != nil { +// return err +// } +// parent, err := network.NewTrafficManagerProfile(ctx, "parent", &network.TrafficManagerProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// TrafficRoutingMethod: pulumi.String("Weighted"), +// DnsConfig: &network.TrafficManagerProfileDnsConfigArgs{ +// RelativeName: pulumi.String("parent-profile"), +// Ttl: pulumi.Int(100), +// }, +// MonitorConfig: &network.TrafficManagerProfileMonitorConfigArgs{ +// Protocol: pulumi.String("HTTP"), +// Port: pulumi.Int(80), +// Path: pulumi.String("/"), +// IntervalInSeconds: pulumi.Int(30), +// TimeoutInSeconds: pulumi.Int(9), +// ToleratedNumberOfFailures: pulumi.Int(3), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// nested, err := network.NewTrafficManagerProfile(ctx, "nested", &network.TrafficManagerProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// TrafficRoutingMethod: pulumi.String("Priority"), +// DnsConfig: &network.TrafficManagerProfileDnsConfigArgs{ +// RelativeName: pulumi.String("nested-profile"), +// Ttl: pulumi.Int(30), +// }, +// MonitorConfig: &network.TrafficManagerProfileMonitorConfigArgs{ +// Protocol: pulumi.String("HTTP"), +// Port: pulumi.Int(443), +// Path: pulumi.String("/"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewTrafficManagerNestedEndpoint(ctx, "exampleTrafficManagerNestedEndpoint", &network.TrafficManagerNestedEndpointArgs{ +// TargetResourceId: nested.ID(), +// Priority: pulumi.Int(1), +// ProfileId: parent.ID(), +// MinimumChildEndpoints: pulumi.Int(9), +// Weight: pulumi.Int(5), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Nested Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/trafficManagerProfile.go b/sdk/go/azure/network/trafficManagerProfile.go index f3954e3fd4..413f0c21cb 100644 --- a/sdk/go/azure/network/trafficManagerProfile.go +++ b/sdk/go/azure/network/trafficManagerProfile.go @@ -15,6 +15,65 @@ import ( // Manages a Traffic Manager Profile to which multiple endpoints can be attached. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{ +// Keepers: pulumi.Map{ +// "azi_id": pulumi.Any(1), +// }, +// ByteLength: pulumi.Int(8), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewTrafficManagerProfile(ctx, "exampleTrafficManagerProfile", &network.TrafficManagerProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// TrafficRoutingMethod: pulumi.String("Weighted"), +// DnsConfig: &network.TrafficManagerProfileDnsConfigArgs{ +// RelativeName: server.Hex, +// Ttl: pulumi.Int(100), +// }, +// MonitorConfig: &network.TrafficManagerProfileMonitorConfigArgs{ +// Protocol: pulumi.String("HTTP"), +// Port: pulumi.Int(80), +// Path: pulumi.String("/"), +// IntervalInSeconds: pulumi.Int(30), +// TimeoutInSeconds: pulumi.Int(9), +// ToleratedNumberOfFailures: pulumi.Int(3), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualHub.go b/sdk/go/azure/network/virtualHub.go index b28862ec34..59b2d2ab24 100644 --- a/sdk/go/azure/network/virtualHub.go +++ b/sdk/go/azure/network/virtualHub.go @@ -15,6 +15,49 @@ import ( // Manages a Virtual Hub within a Virtual WAN. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.0.0/23"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Hub's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualHubConnection.go b/sdk/go/azure/network/virtualHubConnection.go index f31ade3262..6d698c860b 100644 --- a/sdk/go/azure/network/virtualHubConnection.go +++ b/sdk/go/azure/network/virtualHubConnection.go @@ -15,6 +15,66 @@ import ( // Manages a Connection for a Virtual Hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("172.16.0.0/12"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualHubConnection(ctx, "exampleVirtualHubConnection", &network.VirtualHubConnectionArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// RemoteVirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Hub Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualHubIp.go b/sdk/go/azure/network/virtualHubIp.go index 813a114912..943e0f270c 100644 --- a/sdk/go/azure/network/virtualHubIp.go +++ b/sdk/go/azure/network/virtualHubIp.go @@ -17,6 +17,80 @@ import ( // // > **NOTE** Virtual Hub IP only supports Standard Virtual Hub without Virtual Wan. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualHubIp(ctx, "exampleVirtualHubIp", &network.VirtualHubIpArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// PrivateIpAddress: pulumi.String("10.5.1.18"), +// PrivateIpAllocationMethod: pulumi.String("Static"), +// PublicIpAddressId: examplePublicIp.ID(), +// SubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Hub IPs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualHubRouteTable.go b/sdk/go/azure/network/virtualHubRouteTable.go index ef37c2b230..e6c4906052 100644 --- a/sdk/go/azure/network/virtualHubRouteTable.go +++ b/sdk/go/azure/network/virtualHubRouteTable.go @@ -15,6 +15,110 @@ import ( // Manages a Virtual Hub Route Table. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnetNetworkSecurityGroupAssociation(ctx, "exampleSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.2.0/24"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualHubConnection, err := network.NewVirtualHubConnection(ctx, "exampleVirtualHubConnection", &network.VirtualHubConnectionArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// RemoteVirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualHubRouteTable(ctx, "exampleVirtualHubRouteTable", &network.VirtualHubRouteTableArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// Labels: pulumi.StringArray{ +// pulumi.String("label1"), +// }, +// Routes: network.VirtualHubRouteTableRouteTypeArray{ +// &network.VirtualHubRouteTableRouteTypeArgs{ +// Name: pulumi.String("example-route"), +// DestinationsType: pulumi.String("CIDR"), +// Destinations: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// NextHopType: pulumi.String("ResourceId"), +// NextHop: exampleVirtualHubConnection.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Hub Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualHubRouteTableRoute.go b/sdk/go/azure/network/virtualHubRouteTableRoute.go index 5f32462340..9080a44c9a 100644 --- a/sdk/go/azure/network/virtualHubRouteTableRoute.go +++ b/sdk/go/azure/network/virtualHubRouteTableRoute.go @@ -17,6 +17,114 @@ import ( // // > **Note:** Route table routes can managed with this resource, or in-line with the virtualHubRouteTable resource. Using both is not supported. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnetNetworkSecurityGroupAssociation(ctx, "exampleSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.2.0/24"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualHubRouteTable, err := network.NewVirtualHubRouteTable(ctx, "exampleVirtualHubRouteTable", &network.VirtualHubRouteTableArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// Labels: pulumi.StringArray{ +// pulumi.String("label1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHubConnection, err := network.NewVirtualHubConnection(ctx, "exampleVirtualHubConnection", &network.VirtualHubConnectionArgs{ +// VirtualHubId: exampleVirtualHub.ID(), +// RemoteVirtualNetworkId: exampleVirtualNetwork.ID(), +// Routing: &network.VirtualHubConnectionRoutingArgs{ +// AssociatedRouteTableId: exampleVirtualHubRouteTable.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualHubRouteTableRoute(ctx, "exampleVirtualHubRouteTableRoute", &network.VirtualHubRouteTableRouteArgs{ +// RouteTableId: exampleVirtualHubRouteTable.ID(), +// DestinationsType: pulumi.String("CIDR"), +// Destinations: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// NextHopType: pulumi.String("ResourceId"), +// NextHop: exampleVirtualHubConnection.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Hub Route Table Routes can be imported using `/routes/`, e.g. diff --git a/sdk/go/azure/network/virtualNetwork.go b/sdk/go/azure/network/virtualNetwork.go index d3be63ad28..7e4baa372e 100644 --- a/sdk/go/azure/network/virtualNetwork.go +++ b/sdk/go/azure/network/virtualNetwork.go @@ -22,6 +22,68 @@ import ( // **NOTE on Virtual Networks and DNS Servers:** This provider currently provides both a standalone virtual network DNS Servers resource, and allows for DNS servers to be defined in-line within the Virtual Network resource. // At this time you cannot use a Virtual Network with in-line DNS servers in conjunction with any Virtual Network DNS Servers resources. Doing so will cause a conflict of Virtual Network DNS Servers configurations and will overwrite virtual networks DNS servers. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// DnsServers: pulumi.StringArray{ +// pulumi.String("10.0.0.4"), +// pulumi.String("10.0.0.5"), +// }, +// Subnets: network.VirtualNetworkSubnetArray{ +// &network.VirtualNetworkSubnetArgs{ +// Name: pulumi.String("subnet1"), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }, +// &network.VirtualNetworkSubnetArgs{ +// Name: pulumi.String("subnet2"), +// AddressPrefix: pulumi.String("10.0.2.0/24"), +// SecurityGroup: exampleNetworkSecurityGroup.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualNetworkDnsServers.go b/sdk/go/azure/network/virtualNetworkDnsServers.go index 744766a7c2..7e0e000fa2 100644 --- a/sdk/go/azure/network/virtualNetworkDnsServers.go +++ b/sdk/go/azure/network/virtualNetworkDnsServers.go @@ -13,6 +13,60 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Subnets: network.VirtualNetworkSubnetArray{ +// &network.VirtualNetworkSubnetArgs{ +// Name: pulumi.String("subnet1"), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkDnsServers(ctx, "exampleVirtualNetworkDnsServers", &network.VirtualNetworkDnsServersArgs{ +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// DnsServers: pulumi.StringArray{ +// pulumi.String("10.7.7.2"), +// pulumi.String("10.7.7.7"), +// pulumi.String("10.7.7.1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Network DNS Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualNetworkGateway.go b/sdk/go/azure/network/virtualNetworkGateway.go index 71a1462c76..b998676433 100644 --- a/sdk/go/azure/network/virtualNetworkGateway.go +++ b/sdk/go/azure/network/virtualNetworkGateway.go @@ -17,6 +17,120 @@ import ( // // > **Note:** Please be aware that provisioning a Virtual Network Gateway takes a long time (between 30 minutes and 1 hour) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkGateway(ctx, "exampleVirtualNetworkGateway", &network.VirtualNetworkGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Type: pulumi.String("Vpn"), +// VpnType: pulumi.String("RouteBased"), +// ActiveActive: pulumi.Bool(false), +// EnableBgp: pulumi.Bool(false), +// Sku: pulumi.String("Basic"), +// IpConfigurations: network.VirtualNetworkGatewayIpConfigurationArray{ +// &network.VirtualNetworkGatewayIpConfigurationArgs{ +// Name: pulumi.String("vnetGatewayConfig"), +// PublicIpAddressId: examplePublicIp.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// VpnClientConfiguration: &network.VirtualNetworkGatewayVpnClientConfigurationArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.2.0.0/24"), +// }, +// RootCertificates: network.VirtualNetworkGatewayVpnClientConfigurationRootCertificateArray{ +// &network.VirtualNetworkGatewayVpnClientConfigurationRootCertificateArgs{ +// Name: pulumi.String("DigiCert-Federated-ID-Root-CA"), +// PublicCertData: pulumi.String(`MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn +// +// MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +// d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg +// Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV +// BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp +// Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB +// MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j +// QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 +// zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf +// GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d +// GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 +// Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 +// DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV +// HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW +// jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP +// 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR +// QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL +// uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn +// WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq +// M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= +// `), +// +// }, +// }, +// RevokedCertificates: network.VirtualNetworkGatewayVpnClientConfigurationRevokedCertificateArray{ +// &network.VirtualNetworkGatewayVpnClientConfigurationRevokedCertificateArgs{ +// Name: pulumi.String("Verizon-Global-Root-CA"), +// Thumbprint: pulumi.String("912198EEF23DCAC40939312FEE97DD560BAE49B1"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/virtualNetworkGatewayConnection.go b/sdk/go/azure/network/virtualNetworkGatewayConnection.go index d941f4db5c..856d463baa 100644 --- a/sdk/go/azure/network/virtualNetworkGatewayConnection.go +++ b/sdk/go/azure/network/virtualNetworkGatewayConnection.go @@ -16,6 +16,251 @@ import ( // Manages a connection in an existing Virtual Network Gateway. // // ## Example Usage +// ### Site-to-Site connection +// +// The following example shows a connection between an Azure virtual network +// and an on-premises VPN device and network. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// onpremiseLocalNetworkGateway, err := network.NewLocalNetworkGateway(ctx, "onpremiseLocalNetworkGateway", &network.LocalNetworkGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// GatewayAddress: pulumi.String("168.62.225.23"), +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.1.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetworkGateway, err := network.NewVirtualNetworkGateway(ctx, "exampleVirtualNetworkGateway", &network.VirtualNetworkGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Type: pulumi.String("Vpn"), +// VpnType: pulumi.String("RouteBased"), +// ActiveActive: pulumi.Bool(false), +// EnableBgp: pulumi.Bool(false), +// Sku: pulumi.String("Basic"), +// IpConfigurations: network.VirtualNetworkGatewayIpConfigurationArray{ +// &network.VirtualNetworkGatewayIpConfigurationArgs{ +// PublicIpAddressId: examplePublicIp.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkGatewayConnection(ctx, "onpremiseVirtualNetworkGatewayConnection", &network.VirtualNetworkGatewayConnectionArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Type: pulumi.String("IPsec"), +// VirtualNetworkGatewayId: exampleVirtualNetworkGateway.ID(), +// LocalNetworkGatewayId: onpremiseLocalNetworkGateway.ID(), +// SharedKey: pulumi.String("4-v3ry-53cr37-1p53c-5h4r3d-k3y"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### VNet-to-VNet connection +// +// The following example shows a connection between two Azure virtual network +// in different locations/regions. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// usResourceGroup, err := core.NewResourceGroup(ctx, "usResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// usVirtualNetwork, err := network.NewVirtualNetwork(ctx, "usVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: usResourceGroup.Location, +// ResourceGroupName: usResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// usGateway, err := network.NewSubnet(ctx, "usGateway", &network.SubnetArgs{ +// ResourceGroupName: usResourceGroup.Name, +// VirtualNetworkName: usVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// usPublicIp, err := network.NewPublicIp(ctx, "usPublicIp", &network.PublicIpArgs{ +// Location: usResourceGroup.Location, +// ResourceGroupName: usResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// }) +// if err != nil { +// return err +// } +// usVirtualNetworkGateway, err := network.NewVirtualNetworkGateway(ctx, "usVirtualNetworkGateway", &network.VirtualNetworkGatewayArgs{ +// Location: usResourceGroup.Location, +// ResourceGroupName: usResourceGroup.Name, +// Type: pulumi.String("Vpn"), +// VpnType: pulumi.String("RouteBased"), +// Sku: pulumi.String("Basic"), +// IpConfigurations: network.VirtualNetworkGatewayIpConfigurationArray{ +// &network.VirtualNetworkGatewayIpConfigurationArgs{ +// PublicIpAddressId: usPublicIp.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// SubnetId: usGateway.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// europeResourceGroup, err := core.NewResourceGroup(ctx, "europeResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// europeVirtualNetwork, err := network.NewVirtualNetwork(ctx, "europeVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: europeResourceGroup.Location, +// ResourceGroupName: europeResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.1.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// europeGateway, err := network.NewSubnet(ctx, "europeGateway", &network.SubnetArgs{ +// ResourceGroupName: europeResourceGroup.Name, +// VirtualNetworkName: europeVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.1.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// europePublicIp, err := network.NewPublicIp(ctx, "europePublicIp", &network.PublicIpArgs{ +// Location: europeResourceGroup.Location, +// ResourceGroupName: europeResourceGroup.Name, +// AllocationMethod: pulumi.String("Dynamic"), +// }) +// if err != nil { +// return err +// } +// europeVirtualNetworkGateway, err := network.NewVirtualNetworkGateway(ctx, "europeVirtualNetworkGateway", &network.VirtualNetworkGatewayArgs{ +// Location: europeResourceGroup.Location, +// ResourceGroupName: europeResourceGroup.Name, +// Type: pulumi.String("Vpn"), +// VpnType: pulumi.String("RouteBased"), +// Sku: pulumi.String("Basic"), +// IpConfigurations: network.VirtualNetworkGatewayIpConfigurationArray{ +// &network.VirtualNetworkGatewayIpConfigurationArgs{ +// PublicIpAddressId: europePublicIp.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// SubnetId: europeGateway.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkGatewayConnection(ctx, "usToEurope", &network.VirtualNetworkGatewayConnectionArgs{ +// Location: usResourceGroup.Location, +// ResourceGroupName: usResourceGroup.Name, +// Type: pulumi.String("Vnet2Vnet"), +// VirtualNetworkGatewayId: usVirtualNetworkGateway.ID(), +// PeerVirtualNetworkGatewayId: europeVirtualNetworkGateway.ID(), +// SharedKey: pulumi.String("4-v3ry-53cr37-1p53c-5h4r3d-k3y"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkGatewayConnection(ctx, "europeToUs", &network.VirtualNetworkGatewayConnectionArgs{ +// Location: europeResourceGroup.Location, +// ResourceGroupName: europeResourceGroup.Name, +// Type: pulumi.String("Vnet2Vnet"), +// VirtualNetworkGatewayId: europeVirtualNetworkGateway.ID(), +// PeerVirtualNetworkGatewayId: usVirtualNetworkGateway.ID(), +// SharedKey: pulumi.String("4-v3ry-53cr37-1p53c-5h4r3d-k3y"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/network/virtualNetworkPeering.go b/sdk/go/azure/network/virtualNetworkPeering.go index a39d36f034..97b6b9b0b6 100644 --- a/sdk/go/azure/network/virtualNetworkPeering.go +++ b/sdk/go/azure/network/virtualNetworkPeering.go @@ -16,6 +16,68 @@ import ( // Manages a virtual network peering which allows resources to access other // resources in the linked virtual network. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetwork(ctx, "example-1VirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: example.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Location: example.Location, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetwork(ctx, "example-2VirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: example.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// Location: example.Location, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkPeering(ctx, "example-1VirtualNetworkPeering", &network.VirtualNetworkPeeringArgs{ +// ResourceGroupName: example.Name, +// VirtualNetworkName: example_1VirtualNetwork.Name, +// RemoteVirtualNetworkId: example_2VirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetworkPeering(ctx, "example-2VirtualNetworkPeering", &network.VirtualNetworkPeeringArgs{ +// ResourceGroupName: example.Name, +// VirtualNetworkName: example_2VirtualNetwork.Name, +// RemoteVirtualNetworkId: example_1VirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // ## Note // // Virtual Network peerings cannot be created, updated or deleted concurrently. diff --git a/sdk/go/azure/network/virtualWan.go b/sdk/go/azure/network/virtualWan.go index ad0e9e34cc..ecabb9b9bb 100644 --- a/sdk/go/azure/network/virtualWan.go +++ b/sdk/go/azure/network/virtualWan.go @@ -15,6 +15,40 @@ import ( // Manages a Virtual WAN. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Virtual WAN can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/vnpGatewayNatRule.go b/sdk/go/azure/network/vnpGatewayNatRule.go index 19e422aedd..018bc1fb89 100644 --- a/sdk/go/azure/network/vnpGatewayNatRule.go +++ b/sdk/go/azure/network/vnpGatewayNatRule.go @@ -15,6 +15,74 @@ import ( // Manages a VPN Gateway NAT Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// VirtualWanId: exampleVirtualWan.ID(), +// }) +// if err != nil { +// return err +// } +// exampleVpnGateway, err := network.NewVpnGateway(ctx, "exampleVpnGateway", &network.VpnGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualHubId: exampleVirtualHub.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVnpGatewayNatRule(ctx, "exampleVnpGatewayNatRule", &network.VnpGatewayNatRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VpnGatewayId: exampleVpnGateway.ID(), +// ExternalMappings: network.VnpGatewayNatRuleExternalMappingArray{ +// &network.VnpGatewayNatRuleExternalMappingArgs{ +// AddressSpace: pulumi.String("192.168.21.0/26"), +// }, +// }, +// InternalMappings: network.VnpGatewayNatRuleInternalMappingArray{ +// &network.VnpGatewayNatRuleInternalMappingArgs{ +// AddressSpace: pulumi.String("10.4.0.0/26"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VPN Gateway NAT Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/vpnGateway.go b/sdk/go/azure/network/vpnGateway.go index c5227c9761..ac444f4b21 100644 --- a/sdk/go/azure/network/vpnGateway.go +++ b/sdk/go/azure/network/vpnGateway.go @@ -15,6 +15,67 @@ import ( // Manages a VPN Gateway within a Virtual Hub, which enables Site-to-Site communication. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.1.0/24"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVpnGateway(ctx, "exampleVpnGateway", &network.VpnGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualHubId: exampleVirtualHub.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VPN Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/vpnGatewayConnection.go b/sdk/go/azure/network/vpnGatewayConnection.go index c357b38ad0..3e9e5b6fb3 100644 --- a/sdk/go/azure/network/vpnGatewayConnection.go +++ b/sdk/go/azure/network/vpnGatewayConnection.go @@ -15,6 +15,96 @@ import ( // Manages a VPN Gateway Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleVirtualHub, err := network.NewVirtualHub(ctx, "exampleVirtualHub", &network.VirtualHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressPrefix: pulumi.String("10.0.0.0/24"), +// }) +// if err != nil { +// return err +// } +// exampleVpnGateway, err := network.NewVpnGateway(ctx, "exampleVpnGateway", &network.VpnGatewayArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualHubId: exampleVirtualHub.ID(), +// }) +// if err != nil { +// return err +// } +// exampleVpnSite, err := network.NewVpnSite(ctx, "exampleVpnSite", &network.VpnSiteArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualWanId: exampleVirtualWan.ID(), +// Links: network.VpnSiteLinkArray{ +// &network.VpnSiteLinkArgs{ +// Name: pulumi.String("link1"), +// IpAddress: pulumi.String("10.1.0.0"), +// }, +// &network.VpnSiteLinkArgs{ +// Name: pulumi.String("link2"), +// IpAddress: pulumi.String("10.2.0.0"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVpnGatewayConnection(ctx, "exampleVpnGatewayConnection", &network.VpnGatewayConnectionArgs{ +// VpnGatewayId: exampleVpnGateway.ID(), +// RemoteVpnSiteId: exampleVpnSite.ID(), +// VpnLinks: network.VpnGatewayConnectionVpnLinkArray{ +// &network.VpnGatewayConnectionVpnLinkArgs{ +// Name: pulumi.String("link1"), +// VpnSiteLinkId: exampleVpnSite.Links.ApplyT(func(links []network.VpnSiteLink) (*string, error) { +// return &links[0].Id, nil +// }).(pulumi.StringPtrOutput), +// }, +// &network.VpnGatewayConnectionVpnLinkArgs{ +// Name: pulumi.String("link2"), +// VpnSiteLinkId: exampleVpnSite.Links.ApplyT(func(links []network.VpnSiteLink) (*string, error) { +// return &links[1].Id, nil +// }).(pulumi.StringPtrOutput), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VPN Gateway Connections can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/vpnServerConfiguration.go b/sdk/go/azure/network/vpnServerConfiguration.go index 2735ff7dfc..36f5535776 100644 --- a/sdk/go/azure/network/vpnServerConfiguration.go +++ b/sdk/go/azure/network/vpnServerConfiguration.go @@ -15,6 +15,71 @@ import ( // Manages a VPN Server Configuration. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVpnServerConfiguration(ctx, "test", &network.VpnServerConfigurationArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// VpnAuthenticationTypes: pulumi.StringArray{ +// pulumi.String("Certificate"), +// }, +// ClientRootCertificates: network.VpnServerConfigurationClientRootCertificateArray{ +// &network.VpnServerConfigurationClientRootCertificateArgs{ +// Name: pulumi.String("DigiCert-Federated-ID-Root-CA"), +// PublicCertData: pulumi.String(`MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn +// +// MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +// d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg +// Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV +// BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp +// Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB +// MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j +// QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 +// zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf +// GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d +// GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 +// Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 +// DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV +// HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW +// jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP +// 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR +// QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL +// uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn +// WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq +// M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= +// `), +// +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VPN Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/vpnServerConfigurationPolicyGroup.go b/sdk/go/azure/network/vpnServerConfigurationPolicyGroup.go index 927cb9d733..c753e88a32 100644 --- a/sdk/go/azure/network/vpnServerConfigurationPolicyGroup.go +++ b/sdk/go/azure/network/vpnServerConfigurationPolicyGroup.go @@ -15,6 +15,65 @@ import ( // Manages a VPN Server Configuration Policy Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVpnServerConfiguration, err := network.NewVpnServerConfiguration(ctx, "exampleVpnServerConfiguration", &network.VpnServerConfigurationArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VpnAuthenticationTypes: pulumi.StringArray{ +// pulumi.String("Radius"), +// }, +// Radius: &network.VpnServerConfigurationRadiusArgs{ +// Servers: network.VpnServerConfigurationRadiusServerArray{ +// &network.VpnServerConfigurationRadiusServerArgs{ +// Address: pulumi.String("10.105.1.1"), +// Secret: pulumi.String("vindicators-the-return-of-worldender"), +// Score: pulumi.Int(15), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVpnServerConfigurationPolicyGroup(ctx, "exampleVpnServerConfigurationPolicyGroup", &network.VpnServerConfigurationPolicyGroupArgs{ +// VpnServerConfigurationId: exampleVpnServerConfiguration.ID(), +// Policies: network.VpnServerConfigurationPolicyGroupPolicyArray{ +// &network.VpnServerConfigurationPolicyGroupPolicyArgs{ +// Name: pulumi.String("policy1"), +// Type: pulumi.String("RadiusAzureGroupId"), +// Value: pulumi.String("6ad1bd08"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VPN Server Configuration Policy Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/network/vpnSite.go b/sdk/go/azure/network/vpnSite.go index 6f68e4c611..6a046887b1 100644 --- a/sdk/go/azure/network/vpnSite.go +++ b/sdk/go/azure/network/vpnSite.go @@ -15,6 +15,57 @@ import ( // Manages a VPN Site. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualWan, err := network.NewVirtualWan(ctx, "exampleVirtualWan", &network.VirtualWanArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewVpnSite(ctx, "exampleVpnSite", &network.VpnSiteArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualWanId: exampleVirtualWan.ID(), +// AddressCidrs: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Links: network.VpnSiteLinkArray{ +// &network.VpnSiteLinkArgs{ +// Name: pulumi.String("link1"), +// IpAddress: pulumi.String("10.0.0.1"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VPN Sites can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/networkfunction/azureTrafficCollector.go b/sdk/go/azure/networkfunction/azureTrafficCollector.go index 9708742272..078f0b4d3f 100644 --- a/sdk/go/azure/networkfunction/azureTrafficCollector.go +++ b/sdk/go/azure/networkfunction/azureTrafficCollector.go @@ -15,6 +15,43 @@ import ( // Manages a Network Function Azure Traffic Collector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/networkfunction" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// _, err = networkfunction.NewAzureTrafficCollector(ctx, "exampleAzureTrafficCollector", &networkfunction.AzureTrafficCollectorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West US"), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network Function Azure Traffic Collector can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/newrelic/monitor.go b/sdk/go/azure/newrelic/monitor.go index c470451d58..3e266da950 100644 --- a/sdk/go/azure/newrelic/monitor.go +++ b/sdk/go/azure/newrelic/monitor.go @@ -15,6 +15,49 @@ import ( // Manages an Azure Native New Relic Monitor. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/newrelic" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// _, err = newrelic.NewMonitor(ctx, "exampleMonitor", &newrelic.MonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Plan: &newrelic.MonitorPlanArgs{ +// EffectiveDate: pulumi.String("2023-06-06T00:00:00Z"), +// }, +// User: &newrelic.MonitorUserArgs{ +// Email: pulumi.String("user@example.com"), +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// PhoneNumber: pulumi.String("+12313803556"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Native New Relic Monitor can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/newrelic/tagRule.go b/sdk/go/azure/newrelic/tagRule.go index 125bdfde2c..e2a5e71ce2 100644 --- a/sdk/go/azure/newrelic/tagRule.go +++ b/sdk/go/azure/newrelic/tagRule.go @@ -15,6 +15,73 @@ import ( // Manages an Azure Native New Relic Tag Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/newrelic" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleMonitor, err := newrelic.NewMonitor(ctx, "exampleMonitor", &newrelic.MonitorArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Plan: &newrelic.MonitorPlanArgs{ +// EffectiveDate: pulumi.String("2023-06-06T00:00:00Z"), +// }, +// User: &newrelic.MonitorUserArgs{ +// Email: pulumi.String("user@example.com"), +// FirstName: pulumi.String("Example"), +// LastName: pulumi.String("User"), +// PhoneNumber: pulumi.String("+12313803556"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = newrelic.NewTagRule(ctx, "exampleTagRule", &newrelic.TagRuleArgs{ +// MonitorId: exampleMonitor.ID(), +// AzureActiveDirectoryLogEnabled: pulumi.Bool(true), +// ActivityLogEnabled: pulumi.Bool(true), +// MetricEnabled: pulumi.Bool(true), +// SubscriptionLogEnabled: pulumi.Bool(true), +// LogTagFilters: newrelic.TagRuleLogTagFilterArray{ +// &newrelic.TagRuleLogTagFilterArgs{ +// Name: pulumi.String("key"), +// Action: pulumi.String("Include"), +// Value: pulumi.String("value"), +// }, +// }, +// MetricTagFilters: newrelic.TagRuleMetricTagFilterArray{ +// &newrelic.TagRuleMetricTagFilterArgs{ +// Name: pulumi.String("key"), +// Action: pulumi.String("Exclude"), +// Value: pulumi.String("value"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Native New Relic Tag Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/nginx/certificate.go b/sdk/go/azure/nginx/certificate.go index 962c5a4eda..0f56644718 100644 --- a/sdk/go/azure/nginx/certificate.go +++ b/sdk/go/azure/nginx/certificate.go @@ -15,6 +15,161 @@ import ( // Manages a Certificate for an NGinx Deployment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/nginx" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("delegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("NGINX.NGINXPLUS/nginxDeployments"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleDeployment, err := nginx.NewDeployment(ctx, "exampleDeployment", &nginx.DeploymentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("publicpreview_Monthly_gmz7xq9ge3py"), +// Location: exampleResourceGroup.Location, +// ManagedResourceGroup: pulumi.String("example"), +// DiagnoseSupportEnabled: pulumi.Bool(true), +// FrontendPublic: &nginx.DeploymentFrontendPublicArgs{ +// IpAddresses: pulumi.StringArray{ +// examplePublicIp.ID(), +// }, +// }, +// NetworkInterfaces: nginx.DeploymentNetworkInterfaceArray{ +// &nginx.DeploymentNetworkInterfaceArgs{ +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("DeleteIssuers"), +// pulumi.String("Get"), +// pulumi.String("GetIssuers"), +// pulumi.String("Import"), +// pulumi.String("List"), +// pulumi.String("ListIssuers"), +// pulumi.String("ManageContacts"), +// pulumi.String("ManageIssuers"), +// pulumi.String("SetIssuers"), +// pulumi.String("Update"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Certificate: &keyvault.CertificateCertificateArgs{ +// Contents: filebase64OrPanic("certificate-to-import.pfx"), +// Password: pulumi.String(""), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = nginx.NewCertificate(ctx, "exampleNginx/certificateCertificate", &nginx.CertificateArgs{ +// NginxDeploymentId: exampleDeployment.ID(), +// KeyVirtualPath: pulumi.String("/src/cert/soservermekey.key"), +// CertificateVirtualPath: pulumi.String("/src/cert/server.cert"), +// KeyVaultSecretId: exampleCertificate.SecretId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // An Nginx Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/nginx/deployment.go b/sdk/go/azure/nginx/deployment.go index df83ae9381..5a2f8f202a 100644 --- a/sdk/go/azure/nginx/deployment.go +++ b/sdk/go/azure/nginx/deployment.go @@ -15,6 +15,99 @@ import ( // Manages a Nginx Deployment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/nginx" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("delegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("NGINX.NGINXPLUS/nginxDeployments"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = nginx.NewDeployment(ctx, "exampleDeployment", &nginx.DeploymentArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("publicpreview_Monthly_gmz7xq9ge3py"), +// Location: exampleResourceGroup.Location, +// ManagedResourceGroup: pulumi.String("example"), +// DiagnoseSupportEnabled: pulumi.Bool(true), +// FrontendPublic: &nginx.DeploymentFrontendPublicArgs{ +// IpAddresses: pulumi.StringArray{ +// examplePublicIp.ID(), +// }, +// }, +// NetworkInterfaces: nginx.DeploymentNetworkInterfaceArray{ +// &nginx.DeploymentNetworkInterfaceArgs{ +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// Capacity: pulumi.Int(20), +// Email: pulumi.String("user@test.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Nginx Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/notificationhub/authorizationRule.go b/sdk/go/azure/notificationhub/authorizationRule.go index 903d77077d..866cbbbb3c 100644 --- a/sdk/go/azure/notificationhub/authorizationRule.go +++ b/sdk/go/azure/notificationhub/authorizationRule.go @@ -15,6 +15,61 @@ import ( // Manages an Authorization Rule associated with a Notification Hub within a Notification Hub Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/notificationhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := notificationhub.NewNamespace(ctx, "exampleNamespace", ¬ificationhub.NamespaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// NamespaceType: pulumi.String("NotificationHub"), +// SkuName: pulumi.String("Free"), +// }) +// if err != nil { +// return err +// } +// exampleHub, err := notificationhub.NewHub(ctx, "exampleHub", ¬ificationhub.HubArgs{ +// NamespaceName: exampleNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = notificationhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", ¬ificationhub.AuthorizationRuleArgs{ +// NotificationHubName: exampleHub.Name, +// NamespaceName: exampleNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Manage: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Listen: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Notification Hub Authorization Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/notificationhub/getHub.go b/sdk/go/azure/notificationhub/getHub.go index 9344672e12..e90b62027b 100644 --- a/sdk/go/azure/notificationhub/getHub.go +++ b/sdk/go/azure/notificationhub/getHub.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/notificationhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := notificationhub.LookupHub(ctx, ¬ificationhub.LookupHubArgs{ +// Name: "notification-hub", +// NamespaceName: "namespace-name", +// ResourceGroupName: "resource-group-name", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupHub(ctx *pulumi.Context, args *LookupHubArgs, opts ...pulumi.InvokeOption) (*LookupHubResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupHubResult diff --git a/sdk/go/azure/notificationhub/getNamespace.go b/sdk/go/azure/notificationhub/getNamespace.go index 4756b9e23f..5e308d9ff9 100644 --- a/sdk/go/azure/notificationhub/getNamespace.go +++ b/sdk/go/azure/notificationhub/getNamespace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Notification Hub Namespace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/notificationhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := notificationhub.LookupNamespace(ctx, ¬ificationhub.LookupNamespaceArgs{ +// Name: "my-namespace", +// ResourceGroupName: "my-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("servicebusEndpoint", example.ServicebusEndpoint) +// return nil +// }) +// } +// +// ``` func LookupNamespace(ctx *pulumi.Context, args *LookupNamespaceArgs, opts ...pulumi.InvokeOption) (*LookupNamespaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNamespaceResult diff --git a/sdk/go/azure/notificationhub/hub.go b/sdk/go/azure/notificationhub/hub.go index ae822f1449..e7b50a2d6c 100644 --- a/sdk/go/azure/notificationhub/hub.go +++ b/sdk/go/azure/notificationhub/hub.go @@ -15,6 +15,50 @@ import ( // Manages a Notification Hub within a Notification Hub Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/notificationhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := notificationhub.NewNamespace(ctx, "exampleNamespace", ¬ificationhub.NamespaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// NamespaceType: pulumi.String("NotificationHub"), +// SkuName: pulumi.String("Free"), +// }) +// if err != nil { +// return err +// } +// _, err = notificationhub.NewHub(ctx, "exampleHub", ¬ificationhub.HubArgs{ +// NamespaceName: exampleNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Notification Hubs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/notificationhub/namespace.go b/sdk/go/azure/notificationhub/namespace.go index 3f2fe4b43a..f8e62eb85c 100644 --- a/sdk/go/azure/notificationhub/namespace.go +++ b/sdk/go/azure/notificationhub/namespace.go @@ -15,6 +15,42 @@ import ( // Manages a Notification Hub Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/notificationhub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = notificationhub.NewNamespace(ctx, "exampleNamespace", ¬ificationhub.NamespaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// NamespaceType: pulumi.String("NotificationHub"), +// SkuName: pulumi.String("Free"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Notification Hub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/operationalinsights/analyticsSolution.go b/sdk/go/azure/operationalinsights/analyticsSolution.go index f85ddd8eb4..d771927c98 100644 --- a/sdk/go/azure/operationalinsights/analyticsSolution.go +++ b/sdk/go/azure/operationalinsights/analyticsSolution.go @@ -15,6 +15,65 @@ import ( // Manages a Log Analytics (formally Operational Insights) Solution. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = random.NewRandomId(ctx, "workspace", &random.RandomIdArgs{ +// Keepers: pulumi.Map{ +// "group_name": exampleResourceGroup.Name, +// }, +// ByteLength: pulumi.Int(8), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = operationalinsights.NewAnalyticsSolution(ctx, "exampleAnalyticsSolution", &operationalinsights.AnalyticsSolutionArgs{ +// SolutionName: pulumi.String("ContainerInsights"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// Plan: &operationalinsights.AnalyticsSolutionPlanArgs{ +// Publisher: pulumi.String("Microsoft"), +// Product: pulumi.String("OMSGallery/ContainerInsights"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Solutions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/operationalinsights/analyticsWorkspace.go b/sdk/go/azure/operationalinsights/analyticsWorkspace.go index 124038c770..209cd7cb5b 100644 --- a/sdk/go/azure/operationalinsights/analyticsWorkspace.go +++ b/sdk/go/azure/operationalinsights/analyticsWorkspace.go @@ -15,6 +15,42 @@ import ( // Manages a Log Analytics (formally Operational Insights) Workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/operationalinsights/getAnalyticsWorkspace.go b/sdk/go/azure/operationalinsights/getAnalyticsWorkspace.go index 1c9e9f3646..469c5cfdae 100644 --- a/sdk/go/azure/operationalinsights/getAnalyticsWorkspace.go +++ b/sdk/go/azure/operationalinsights/getAnalyticsWorkspace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := operationalinsights.LookupAnalyticsWorkspace(ctx, &operationalinsights.LookupAnalyticsWorkspaceArgs{ +// Name: "acctest-01", +// ResourceGroupName: "acctest", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("logAnalyticsWorkspaceId", example.WorkspaceId) +// return nil +// }) +// } +// +// ``` func LookupAnalyticsWorkspace(ctx *pulumi.Context, args *LookupAnalyticsWorkspaceArgs, opts ...pulumi.InvokeOption) (*LookupAnalyticsWorkspaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAnalyticsWorkspaceResult diff --git a/sdk/go/azure/operationalinsights/queryPackQuery.go b/sdk/go/azure/operationalinsights/queryPackQuery.go index e585c682b4..63d927cb51 100644 --- a/sdk/go/azure/operationalinsights/queryPackQuery.go +++ b/sdk/go/azure/operationalinsights/queryPackQuery.go @@ -15,6 +15,63 @@ import ( // Manages a Log Analytics Query Pack Query. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleQueryPack, err := loganalytics.NewQueryPack(ctx, "exampleQueryPack", &loganalytics.QueryPackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = operationalinsights.NewQueryPackQuery(ctx, "exampleQueryPackQuery", &operationalinsights.QueryPackQueryArgs{ +// QueryPackId: exampleQueryPack.ID(), +// Body: pulumi.String(`let newExceptionsTimeRange = 1d; +// +// let timeRangeToCheckBefore = 7d; +// exceptions +// | where timestamp < ago(timeRangeToCheckBefore) +// | summarize count() by problemId +// | join kind= rightanti ( +// exceptions +// | where timestamp >= ago(newExceptionsTimeRange) +// | extend stack = tostring(details[0].rawStack) +// | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId +// ) on problemId +// | order by count_ desc +// `), +// +// DisplayName: pulumi.String("Exceptions - New in the last 24 hours"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Log Analytics Query Pack Queries can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/orbital/contact.go b/sdk/go/azure/orbital/contact.go index fe100c1e86..05c0bdb47a 100644 --- a/sdk/go/azure/orbital/contact.go +++ b/sdk/go/azure/orbital/contact.go @@ -15,6 +15,135 @@ import ( // Manages an orbital contact. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/orbital" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSpacecraft, err := orbital.NewSpacecraft(ctx, "exampleSpacecraft", &orbital.SpacecraftArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("westeurope"), +// NoradId: pulumi.String("12345"), +// Links: orbital.SpacecraftLinkArray{ +// &orbital.SpacecraftLinkArgs{ +// BandwidthMhz: pulumi.Float64(100), +// CenterFrequencyMhz: pulumi.Float64(101), +// Direction: pulumi.String("Uplink"), +// Polarization: pulumi.String("LHCP"), +// Name: pulumi.String("examplename"), +// }, +// }, +// TwoLineElements: pulumi.StringArray{ +// pulumi.String("1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621"), +// pulumi.String("2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495"), +// }, +// TitleLine: pulumi.String("AQUA"), +// Tags: pulumi.StringMap{ +// "aks-managed-cluster-name": pulumi.String("9a57225d-a405-4d40-aa46-f13d2342abef"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("orbitalgateway"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Orbital/orbitalGateways"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/publicIPAddresses/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/read"), +// pulumi.String("Microsoft.Network/publicIPAddresses/read"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleContactProfile, err := orbital.NewContactProfile(ctx, "exampleContactProfile", &orbital.ContactProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MinimumVariableContactDuration: pulumi.String("PT1M"), +// AutoTracking: pulumi.String("disabled"), +// Links: orbital.ContactProfileLinkArray{ +// &orbital.ContactProfileLinkArgs{ +// Channels: orbital.ContactProfileLinkChannelArray{ +// &orbital.ContactProfileLinkChannelArgs{ +// Name: pulumi.String("channelname"), +// BandwidthMhz: pulumi.Float64(100), +// CenterFrequencyMhz: pulumi.Float64(101), +// EndPoints: orbital.ContactProfileLinkChannelEndPointArray{ +// &orbital.ContactProfileLinkChannelEndPointArgs{ +// EndPointName: pulumi.String("AQUA_command"), +// IpAddress: pulumi.String("10.0.1.0"), +// Port: pulumi.String("49153"), +// Protocol: pulumi.String("TCP"), +// }, +// }, +// }, +// }, +// Direction: pulumi.String("Uplink"), +// Name: pulumi.String("RHCP_UL"), +// Polarization: pulumi.String("RHCP"), +// }, +// }, +// NetworkConfigurationSubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = orbital.NewContact(ctx, "exampleContact", &orbital.ContactArgs{ +// SpacecraftId: exampleSpacecraft.ID(), +// ReservationStartTime: pulumi.String("2020-07-16T20:35:00.00Z"), +// ReservationEndTime: pulumi.String("2020-07-16T20:55:00.00Z"), +// GroundStationName: pulumi.String("WESTUS2_0"), +// ContactProfileId: exampleContactProfile.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/orbital/contactProfile.go b/sdk/go/azure/orbital/contactProfile.go index 541fac5b90..14fba99927 100644 --- a/sdk/go/azure/orbital/contactProfile.go +++ b/sdk/go/azure/orbital/contactProfile.go @@ -15,6 +15,100 @@ import ( // Manages a Contact profile. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/orbital" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("orbitalgateway"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Orbital/orbitalGateways"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/publicIPAddresses/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/read"), +// pulumi.String("Microsoft.Network/publicIPAddresses/read"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = orbital.NewContactProfile(ctx, "exampleContactProfile", &orbital.ContactProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// MinimumVariableContactDuration: pulumi.String("PT1M"), +// AutoTracking: pulumi.String("disabled"), +// Links: orbital.ContactProfileLinkArray{ +// &orbital.ContactProfileLinkArgs{ +// Channels: orbital.ContactProfileLinkChannelArray{ +// &orbital.ContactProfileLinkChannelArgs{ +// Name: pulumi.String("channelname"), +// BandwidthMhz: pulumi.Float64(100), +// CenterFrequencyMhz: pulumi.Float64(101), +// EndPoints: orbital.ContactProfileLinkChannelEndPointArray{ +// &orbital.ContactProfileLinkChannelEndPointArgs{ +// EndPointName: pulumi.String("AQUA_command"), +// IpAddress: pulumi.String("10.0.1.0"), +// Port: pulumi.String("49513"), +// Protocol: pulumi.String("TCP"), +// }, +// }, +// }, +// }, +// Direction: pulumi.String("Uplink"), +// Name: pulumi.String("RHCP_UL"), +// Polarization: pulumi.String("RHCP"), +// }, +// }, +// NetworkConfigurationSubnetId: exampleSubnet.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Contact profile can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/orbital/spacecraft.go b/sdk/go/azure/orbital/spacecraft.go index 1dd935bc54..1a0308d9ab 100644 --- a/sdk/go/azure/orbital/spacecraft.go +++ b/sdk/go/azure/orbital/spacecraft.go @@ -15,6 +15,58 @@ import ( // Manages a Spacecraft. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/orbital" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = orbital.NewSpacecraft(ctx, "exampleSpacecraft", &orbital.SpacecraftArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("westeurope"), +// NoradId: pulumi.String("12345"), +// Links: orbital.SpacecraftLinkArray{ +// &orbital.SpacecraftLinkArgs{ +// BandwidthMhz: pulumi.Float64(100), +// CenterFrequencyMhz: pulumi.Float64(101), +// Direction: pulumi.String("Uplink"), +// Polarization: pulumi.String("LHCP"), +// Name: pulumi.String("examplename"), +// }, +// }, +// TwoLineElements: pulumi.StringArray{ +// pulumi.String("1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621"), +// pulumi.String("2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495"), +// }, +// TitleLine: pulumi.String("AQUA"), +// Tags: pulumi.StringMap{ +// "aks-managed-cluster-name": pulumi.String("9a57225d-a405-4d40-aa46-f13d2342abef"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/paloalto/localRulestack.go b/sdk/go/azure/paloalto/localRulestack.go index 60a31bf51b..8cc15fce25 100644 --- a/sdk/go/azure/paloalto/localRulestack.go +++ b/sdk/go/azure/paloalto/localRulestack.go @@ -15,6 +15,40 @@ import ( // Manages a Palo Alto Networks Rulestack. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewLocalRulestack(ctx, "exampleLocalRulestack", &paloalto.LocalRulestackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Palo Alto Networks Rulestacks can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/paloalto/localRulestackCertificate.go b/sdk/go/azure/paloalto/localRulestackCertificate.go index 251dfe6bf2..6cbd6323be 100644 --- a/sdk/go/azure/paloalto/localRulestackCertificate.go +++ b/sdk/go/azure/paloalto/localRulestackCertificate.go @@ -15,6 +15,47 @@ import ( // Manages a Palo Alto Networks Rulestack Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestack, err := paloalto.NewLocalRulestack(ctx, "exampleLocalRulestack", &paloalto.LocalRulestackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewLocalRulestackCertificate(ctx, "exampleLocalRulestackCertificate", &paloalto.LocalRulestackCertificateArgs{ +// RulestackId: exampleLocalRulestack.ID(), +// SelfSigned: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Palo Alto Networks Rulestack Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/paloalto/localRulestackFqdnList.go b/sdk/go/azure/paloalto/localRulestackFqdnList.go index a4ae84f784..294737089b 100644 --- a/sdk/go/azure/paloalto/localRulestackFqdnList.go +++ b/sdk/go/azure/paloalto/localRulestackFqdnList.go @@ -15,6 +15,49 @@ import ( // Manages a Palo Alto Local Rulestack FQDN List. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestack, err := paloalto.NewLocalRulestack(ctx, "exampleLocalRulestack", &paloalto.LocalRulestackArgs{ +// ResourceGroupName: pulumi.Any(azurerm_resrouce_group.Example.Name), +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewLocalRulestackFqdnList(ctx, "exampleLocalRulestackFqdnList", &paloalto.LocalRulestackFqdnListArgs{ +// RulestackId: exampleLocalRulestack.ID(), +// FullyQualifiedDomainNames: pulumi.StringArray{ +// pulumi.String("contoso.com"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Palo Alto Local Rulestack FQDN Lists can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/paloalto/localRulestackOutboundTrustCertificateAssociation.go b/sdk/go/azure/paloalto/localRulestackOutboundTrustCertificateAssociation.go index 67df9453df..9bb6a12ebf 100644 --- a/sdk/go/azure/paloalto/localRulestackOutboundTrustCertificateAssociation.go +++ b/sdk/go/azure/paloalto/localRulestackOutboundTrustCertificateAssociation.go @@ -14,6 +14,53 @@ import ( ) // Manages a Palo Alto Networks Rulestack Outbound Trust Certificate Association. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestack, err := paloalto.NewLocalRulestack(ctx, "exampleLocalRulestack", &paloalto.LocalRulestackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestackCertificate, err := paloalto.NewLocalRulestackCertificate(ctx, "exampleLocalRulestackCertificate", &paloalto.LocalRulestackCertificateArgs{ +// RulestackId: exampleLocalRulestack.ID(), +// SelfSigned: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewLocalRulestackOutboundTrustCertificateAssociation(ctx, "exampleLocalRulestackOutboundTrustCertificateAssociation", &paloalto.LocalRulestackOutboundTrustCertificateAssociationArgs{ +// CertificateId: exampleLocalRulestackCertificate.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type LocalRulestackOutboundTrustCertificateAssociation struct { pulumi.CustomResourceState diff --git a/sdk/go/azure/paloalto/localRulestackOutboundUntrustCertificateAssociation.go b/sdk/go/azure/paloalto/localRulestackOutboundUntrustCertificateAssociation.go index c3e6cd52db..f620750b3d 100644 --- a/sdk/go/azure/paloalto/localRulestackOutboundUntrustCertificateAssociation.go +++ b/sdk/go/azure/paloalto/localRulestackOutboundUntrustCertificateAssociation.go @@ -14,6 +14,53 @@ import ( ) // Manages a Palo Alto Networks Rulestack Outbound Untrust Certificate Association. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestack, err := paloalto.NewLocalRulestack(ctx, "exampleLocalRulestack", &paloalto.LocalRulestackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestackCertificate, err := paloalto.NewLocalRulestackCertificate(ctx, "exampleLocalRulestackCertificate", &paloalto.LocalRulestackCertificateArgs{ +// RulestackId: exampleLocalRulestack.ID(), +// SelfSigned: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewLocalRulestackOutboundUntrustCertificateAssociation(ctx, "exampleLocalRulestackOutboundUntrustCertificateAssociation", &paloalto.LocalRulestackOutboundUntrustCertificateAssociationArgs{ +// CertificateId: exampleLocalRulestackCertificate.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` type LocalRulestackOutboundUntrustCertificateAssociation struct { pulumi.CustomResourceState diff --git a/sdk/go/azure/paloalto/localRulestackPrefixList.go b/sdk/go/azure/paloalto/localRulestackPrefixList.go index b58abf6c7d..5512716ac7 100644 --- a/sdk/go/azure/paloalto/localRulestackPrefixList.go +++ b/sdk/go/azure/paloalto/localRulestackPrefixList.go @@ -15,6 +15,49 @@ import ( // Manages a Palo Alto Local Rulestack Prefix List. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestack, err := paloalto.NewLocalRulestack(ctx, "exampleLocalRulestack", &paloalto.LocalRulestackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewLocalRulestackPrefixList(ctx, "exampleLocalRulestackPrefixList", &paloalto.LocalRulestackPrefixListArgs{ +// RulestackId: exampleLocalRulestack.ID(), +// PrefixLists: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Palo Alto Local Rulestack Prefix Lists can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/paloalto/localRulestackRule.go b/sdk/go/azure/paloalto/localRulestackRule.go index bc24d7ad5e..2be8ee9048 100644 --- a/sdk/go/azure/paloalto/localRulestackRule.go +++ b/sdk/go/azure/paloalto/localRulestackRule.go @@ -15,6 +15,61 @@ import ( // Manages a Palo Alto Local Rulestack Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleLocalRulestack, err := paloalto.NewLocalRulestack(ctx, "exampleLocalRulestack", &paloalto.LocalRulestackArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewLocalRulestackRule(ctx, "exampleLocalRulestackRule", &paloalto.LocalRulestackRuleArgs{ +// RulestackId: exampleLocalRulestack.ID(), +// Priority: pulumi.Int(1000), +// Action: pulumi.String("Allow"), +// Applications: pulumi.StringArray{ +// pulumi.String("any"), +// }, +// Source: &paloalto.LocalRulestackRuleSourceArgs{ +// Cidrs: pulumi.StringArray{ +// pulumi.String("10.0.0.0/8"), +// }, +// }, +// Destination: &paloalto.LocalRulestackRuleDestinationArgs{ +// Cidrs: pulumi.StringArray{ +// pulumi.String("192.168.16.0/24"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Palo Alto Local Rulestack Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/paloalto/nextGenerationFirewallVirtualNetworkPanorama.go b/sdk/go/azure/paloalto/nextGenerationFirewallVirtualNetworkPanorama.go index 9e0ee4ab9c..baf1b75e45 100644 --- a/sdk/go/azure/paloalto/nextGenerationFirewallVirtualNetworkPanorama.go +++ b/sdk/go/azure/paloalto/nextGenerationFirewallVirtualNetworkPanorama.go @@ -15,6 +15,137 @@ import ( // Manages a Palo Alto Next Generation Firewall Virtual Network Panorama. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/paloalto" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("westeurope"), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// trustSubnet, err := network.NewSubnet(ctx, "trustSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.1.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("trusted"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("PaloAltoNetworks.Cloudngfw/firewalls"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnetNetworkSecurityGroupAssociation(ctx, "trustSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: trustSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// untrustSubnet, err := network.NewSubnet(ctx, "untrustSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("untrusted"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("PaloAltoNetworks.Cloudngfw/firewalls"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewSubnetNetworkSecurityGroupAssociation(ctx, "untrustSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: untrustSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = paloalto.NewNextGenerationFirewallVirtualNetworkPanorama(ctx, "exampleNextGenerationFirewallVirtualNetworkPanorama", &paloalto.NextGenerationFirewallVirtualNetworkPanoramaArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PanoramaBase64Config: pulumi.String("e2RnbmFtZTogY25nZnctYXotZXhhbXBsZSwgdHBsbmFtZTogY25nZnctZXhhbXBsZS10ZW1wbGF0ZS1zdGFjaywgZXhhbXBsZS1wYW5vcmFtYS1zZXJ2ZXI6IDE5Mi4xNjguMC4xLCB2bS1hdXRoLWtleTogMDAwMDAwMDAwMDAwMDAwLCBleHBpcnk6IDIwMjQvMDcvMzF9Cg=="), +// NetworkProfile: &paloalto.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileArgs{ +// PublicIpAddressIds: pulumi.StringArray{ +// examplePublicIp.ID(), +// }, +// VnetConfiguration: &paloalto.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileVnetConfigurationArgs{ +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// TrustedSubnetId: trustSubnet.ID(), +// UntrustedSubnetId: untrustSubnet.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Palo Alto Next Generation Firewall Virtual Network Panoramas can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/pim/activeRoleAssignment.go b/sdk/go/azure/pim/activeRoleAssignment.go index 11455da074..9cd5cb33f9 100644 --- a/sdk/go/azure/pim/activeRoleAssignment.go +++ b/sdk/go/azure/pim/activeRoleAssignment.go @@ -16,6 +16,127 @@ import ( // Manages a Pim Active Role Assignment. // // ## Example Usage +// ### Subscription) +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/pim" +// "github.com/pulumi/pulumi-time/sdk/go/time" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// Name: pulumi.StringRef("Reader"), +// }, nil) +// if err != nil { +// return err +// } +// exampleStatic, err := time.NewStatic(ctx, "exampleStatic", nil) +// if err != nil { +// return err +// } +// _, err = pim.NewActiveRoleAssignment(ctx, "exampleActiveRoleAssignment", &pim.ActiveRoleAssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionId: pulumi.String(fmt.Sprintf("%v%v", primary.Id, exampleRoleDefinition.Id)), +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// Schedule: &pim.ActiveRoleAssignmentScheduleArgs{ +// StartDateTime: exampleStatic.Rfc3339, +// Expiration: &pim.ActiveRoleAssignmentScheduleExpirationArgs{ +// DurationHours: pulumi.Int(8), +// }, +// }, +// Justification: pulumi.String("Expiration Duration Set"), +// Ticket: &pim.ActiveRoleAssignmentTicketArgs{ +// Number: pulumi.String("1"), +// System: pulumi.String("example ticket system"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Management Group) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/pim" +// "github.com/pulumi/pulumi-time/sdk/go/time" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// Name: pulumi.StringRef("Reader"), +// }, nil) +// if err != nil { +// return err +// } +// exampleGroup, err := management.NewGroup(ctx, "exampleGroup", nil) +// if err != nil { +// return err +// } +// exampleStatic, err := time.NewStatic(ctx, "exampleStatic", nil) +// if err != nil { +// return err +// } +// _, err = pim.NewActiveRoleAssignment(ctx, "exampleActiveRoleAssignment", &pim.ActiveRoleAssignmentArgs{ +// Scope: exampleGroup.ID(), +// RoleDefinitionId: *pulumi.String(exampleRoleDefinition.Id), +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// Schedule: &pim.ActiveRoleAssignmentScheduleArgs{ +// StartDateTime: exampleStatic.Rfc3339, +// Expiration: &pim.ActiveRoleAssignmentScheduleExpirationArgs{ +// DurationHours: pulumi.Int(8), +// }, +// }, +// Justification: pulumi.String("Expiration Duration Set"), +// Ticket: &pim.ActiveRoleAssignmentTicketArgs{ +// Number: pulumi.String("1"), +// System: pulumi.String("example ticket system"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/pim/eligibleRoleAssignment.go b/sdk/go/azure/pim/eligibleRoleAssignment.go index b42bca03c8..c03dcab983 100644 --- a/sdk/go/azure/pim/eligibleRoleAssignment.go +++ b/sdk/go/azure/pim/eligibleRoleAssignment.go @@ -16,6 +16,127 @@ import ( // Manages a Pim Eligible Role Assignment. // // ## Example Usage +// ### Subscription) +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/pim" +// "github.com/pulumi/pulumi-time/sdk/go/time" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// Name: pulumi.StringRef("Reader"), +// }, nil) +// if err != nil { +// return err +// } +// exampleStatic, err := time.NewStatic(ctx, "exampleStatic", nil) +// if err != nil { +// return err +// } +// _, err = pim.NewEligibleRoleAssignment(ctx, "exampleEligibleRoleAssignment", &pim.EligibleRoleAssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionId: pulumi.String(fmt.Sprintf("%v%v", primary.Id, exampleRoleDefinition.Id)), +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// Schedule: &pim.EligibleRoleAssignmentScheduleArgs{ +// StartDateTime: exampleStatic.Rfc3339, +// Expiration: &pim.EligibleRoleAssignmentScheduleExpirationArgs{ +// DurationHours: pulumi.Int(8), +// }, +// }, +// Justification: pulumi.String("Expiration Duration Set"), +// Ticket: &pim.EligibleRoleAssignmentTicketArgs{ +// Number: pulumi.String("1"), +// System: pulumi.String("example ticket system"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Management Group) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/pim" +// "github.com/pulumi/pulumi-time/sdk/go/time" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{ +// Name: pulumi.StringRef("Reader"), +// }, nil) +// if err != nil { +// return err +// } +// exampleGroup, err := management.NewGroup(ctx, "exampleGroup", nil) +// if err != nil { +// return err +// } +// exampleStatic, err := time.NewStatic(ctx, "exampleStatic", nil) +// if err != nil { +// return err +// } +// _, err = pim.NewEligibleRoleAssignment(ctx, "exampleEligibleRoleAssignment", &pim.EligibleRoleAssignmentArgs{ +// Scope: exampleGroup.ID(), +// RoleDefinitionId: *pulumi.String(exampleRoleDefinition.Id), +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// Schedule: &pim.EligibleRoleAssignmentScheduleArgs{ +// StartDateTime: exampleStatic.Rfc3339, +// Expiration: &pim.EligibleRoleAssignmentScheduleExpirationArgs{ +// DurationHours: pulumi.Int(8), +// }, +// }, +// Justification: pulumi.String("Expiration Duration Set"), +// Ticket: &pim.EligibleRoleAssignmentTicketArgs{ +// Number: pulumi.String("1"), +// System: pulumi.String("example ticket system"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/policy/definition.go b/sdk/go/azure/policy/definition.go index 0caa5efd22..c2691d1e17 100644 --- a/sdk/go/azure/policy/definition.go +++ b/sdk/go/azure/policy/definition.go @@ -17,6 +17,62 @@ import ( // // Policy definitions do not take effect until they are assigned to a scope using a Policy Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := policy.NewDefinition(ctx, "policy", &policy.DefinitionArgs{ +// DisplayName: pulumi.String("acceptance test policy definition"), +// Metadata: pulumi.String(" {\n \"category\": \"General\"\n }\n\n\n"), +// Mode: pulumi.String("Indexed"), +// Parameters: pulumi.String(` { +// "allowedLocations": { +// "type": "Array", +// "metadata": { +// "description": "The list of allowed locations for resources.", +// "displayName": "Allowed locations", +// "strongType": "location" +// } +// } +// } +// +// `), +// +// PolicyRule: pulumi.String(` { +// "if": { +// "not": { +// "field": "location", +// "in": "[parameters('allowedLocations')]" +// } +// }, +// "then": { +// "effect": "audit" +// } +// } +// +// `), +// +// PolicyType: pulumi.String("Custom"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Policy Definitions can be imported using the `policy name`, e.g. diff --git a/sdk/go/azure/policy/getPolicyAssignment.go b/sdk/go/azure/policy/getPolicyAssignment.go index 80f41b3251..6ba5fe3479 100644 --- a/sdk/go/azure/policy/getPolicyAssignment.go +++ b/sdk/go/azure/policy/getPolicyAssignment.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Policy Assignment. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := policy.GetPolicyAssignment(ctx, &policy.GetPolicyAssignmentArgs{ +// Name: "existing", +// ScopeId: data.Azurerm_resource_group.Example.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetPolicyAssignment(ctx *pulumi.Context, args *GetPolicyAssignmentArgs, opts ...pulumi.InvokeOption) (*GetPolicyAssignmentResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPolicyAssignmentResult diff --git a/sdk/go/azure/policy/getPolicyDefintion.go b/sdk/go/azure/policy/getPolicyDefintion.go index 1e52a4a614..f8ed4d10cf 100644 --- a/sdk/go/azure/policy/getPolicyDefintion.go +++ b/sdk/go/azure/policy/getPolicyDefintion.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := policy.GetPolicyDefintion(ctx, &policy.GetPolicyDefintionArgs{ +// DisplayName: pulumi.StringRef("Allowed resource types"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetPolicyDefintion(ctx *pulumi.Context, args *GetPolicyDefintionArgs, opts ...pulumi.InvokeOption) (*GetPolicyDefintionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPolicyDefintionResult diff --git a/sdk/go/azure/policy/getPolicyDefintionBuiltIn.go b/sdk/go/azure/policy/getPolicyDefintionBuiltIn.go index f1179ac51d..d7a6d582f9 100644 --- a/sdk/go/azure/policy/getPolicyDefintionBuiltIn.go +++ b/sdk/go/azure/policy/getPolicyDefintionBuiltIn.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := policy.GetPolicyDefintionBuiltIn(ctx, &policy.GetPolicyDefintionBuiltInArgs{ +// DisplayName: pulumi.StringRef("Allowed resource types"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetPolicyDefintionBuiltIn(ctx *pulumi.Context, args *GetPolicyDefintionBuiltInArgs, opts ...pulumi.InvokeOption) (*GetPolicyDefintionBuiltInResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPolicyDefintionBuiltInResult diff --git a/sdk/go/azure/policy/getPolicySetDefinition.go b/sdk/go/azure/policy/getPolicySetDefinition.go index 1c9cabc319..9dd9c9b00c 100644 --- a/sdk/go/azure/policy/getPolicySetDefinition.go +++ b/sdk/go/azure/policy/getPolicySetDefinition.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Policy Set Definition. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := policy.LookupPolicySetDefinition(ctx, &policy.LookupPolicySetDefinitionArgs{ +// DisplayName: pulumi.StringRef("Policy Set Definition Example"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupPolicySetDefinition(ctx *pulumi.Context, args *LookupPolicySetDefinitionArgs, opts ...pulumi.InvokeOption) (*LookupPolicySetDefinitionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPolicySetDefinitionResult diff --git a/sdk/go/azure/policy/getVirtualMachineConfigurationAssignment.go b/sdk/go/azure/policy/getVirtualMachineConfigurationAssignment.go index 7a437a8f31..606eb74c05 100644 --- a/sdk/go/azure/policy/getVirtualMachineConfigurationAssignment.go +++ b/sdk/go/azure/policy/getVirtualMachineConfigurationAssignment.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Guest Configuration Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := policy.LookupVirtualMachineConfigurationAssignment(ctx, &policy.LookupVirtualMachineConfigurationAssignmentArgs{ +// Name: "AzureWindowsBaseline", +// ResourceGroupName: "example-RG", +// VirtualMachineName: "example-vm", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("complianceStatus", example.ComplianceStatus) +// return nil +// }) +// } +// +// ``` func LookupVirtualMachineConfigurationAssignment(ctx *pulumi.Context, args *LookupVirtualMachineConfigurationAssignmentArgs, opts ...pulumi.InvokeOption) (*LookupVirtualMachineConfigurationAssignmentResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVirtualMachineConfigurationAssignmentResult diff --git a/sdk/go/azure/policy/policySetDefinition.go b/sdk/go/azure/policy/policySetDefinition.go index cc41517be1..397a442bf7 100644 --- a/sdk/go/azure/policy/policySetDefinition.go +++ b/sdk/go/azure/policy/policySetDefinition.go @@ -17,6 +17,52 @@ import ( // // > **NOTE:** Policy set definitions (also known as policy initiatives) do not take effect until they are assigned to a scope using a Policy Set Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := policy.NewPolicySetDefinition(ctx, "example", &policy.PolicySetDefinitionArgs{ +// DisplayName: pulumi.String("Test Policy Set"), +// Parameters: pulumi.String(` { +// "allowedLocations": { +// "type": "Array", +// "metadata": { +// "description": "The list of allowed locations for resources.", +// "displayName": "Allowed locations", +// "strongType": "location" +// } +// } +// } +// +// `), +// +// PolicyDefinitionReferences: policy.PolicySetDefinitionPolicyDefinitionReferenceArray{ +// &policy.PolicySetDefinitionPolicyDefinitionReferenceArgs{ +// ParameterValues: pulumi.String(" {\n \"listOfAllowedLocations\": {\"value\": \"[parameters('allowedLocations')]\"}\n }\n \n"), +// PolicyDefinitionId: pulumi.String("/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988"), +// }, +// }, +// PolicyType: pulumi.String("Custom"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Policy Set Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/policy/virtualMachineConfigurationAssignment.go b/sdk/go/azure/policy/virtualMachineConfigurationAssignment.go index f7b2d40e54..65ebcbf19d 100644 --- a/sdk/go/azure/policy/virtualMachineConfigurationAssignment.go +++ b/sdk/go/azure/policy/virtualMachineConfigurationAssignment.go @@ -17,6 +17,138 @@ import ( // // > **NOTE:** You can create Guest Configuration Policies without defining a `compute.Extension` resource, however the policies will not be executed until a `compute.Extension` has been provisioned to the virtual machine. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/policy" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleWindowsVirtualMachine, err := compute.NewWindowsVirtualMachine(ctx, "exampleWindowsVirtualMachine", &compute.WindowsVirtualMachineArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Size: pulumi.String("Standard_F2"), +// AdminUsername: pulumi.String("adminuser"), +// AdminPassword: pulumi.String("P@$$w0rd1234!"), +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// Identity: &compute.WindowsVirtualMachineIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// OsDisk: &compute.WindowsVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// SourceImageReference: &compute.WindowsVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("MicrosoftWindowsServer"), +// Offer: pulumi.String("WindowsServer"), +// Sku: pulumi.String("2019-Datacenter"), +// Version: pulumi.String("latest"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = compute.NewExtension(ctx, "exampleExtension", &compute.ExtensionArgs{ +// VirtualMachineId: exampleWindowsVirtualMachine.ID(), +// Publisher: pulumi.String("Microsoft.GuestConfiguration"), +// Type: pulumi.String("ConfigurationforWindows"), +// TypeHandlerVersion: pulumi.String("1.29"), +// AutoUpgradeMinorVersion: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = policy.NewVirtualMachineConfigurationAssignment(ctx, "exampleVirtualMachineConfigurationAssignment", &policy.VirtualMachineConfigurationAssignmentArgs{ +// Location: exampleWindowsVirtualMachine.Location, +// VirtualMachineId: exampleWindowsVirtualMachine.ID(), +// Configuration: &policy.VirtualMachineConfigurationAssignmentConfigurationArgs{ +// AssignmentType: pulumi.String("ApplyAndMonitor"), +// Version: pulumi.String("1.*"), +// Parameters: policy.VirtualMachineConfigurationAssignmentConfigurationParameterArray{ +// &policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{ +// Name: pulumi.String("Minimum Password Length;ExpectedValue"), +// Value: pulumi.String("16"), +// }, +// &policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{ +// Name: pulumi.String("Minimum Password Age;ExpectedValue"), +// Value: pulumi.String("0"), +// }, +// &policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{ +// Name: pulumi.String("Maximum Password Age;ExpectedValue"), +// Value: pulumi.String("30,45"), +// }, +// &policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{ +// Name: pulumi.String("Enforce Password History;ExpectedValue"), +// Value: pulumi.String("10"), +// }, +// &policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs{ +// Name: pulumi.String("Password Must Meet Complexity Requirements;ExpectedValue"), +// Value: pulumi.String("1"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Policy Virtual Machine Configuration Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/portal/dashboard.go b/sdk/go/azure/portal/dashboard.go index beab563f3e..91b6b938c4 100644 --- a/sdk/go/azure/portal/dashboard.go +++ b/sdk/go/azure/portal/dashboard.go @@ -17,6 +17,173 @@ import ( // // !> **Note:** The `portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `portal.PortalDashboard` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/portal" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// cfg := config.New(ctx, "") +// mdContent := "# Hello all :)" +// if param := cfg.Get("mdContent"); param != "" { +// mdContent = param +// } +// videoLink := "https://www.youtube.com/watch?v=......" +// if param := cfg.Get("videoLink"); param != "" { +// videoLink = param +// } +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = portal.NewDashboard(ctx, "my-board", &portal.DashboardArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// Tags: pulumi.StringMap{ +// "source": pulumi.String("managed"), +// }, +// DashboardProperties: pulumi.String(fmt.Sprintf(`{ +// "lenses": { +// "0": { +// "order": 0, +// "parts": { +// "0": { +// "position": { +// "x": 0, +// "y": 0, +// "rowSpan": 2, +// "colSpan": 3 +// }, +// "metadata": { +// "inputs": [], +// "type": "Extension/HubsExtension/PartType/MarkdownPart", +// "settings": { +// "content": { +// "settings": { +// "content": "%v", +// "subtitle": "", +// "title": "" +// } +// } +// } +// } +// }, +// "1": { +// "position": { +// "x": 5, +// "y": 0, +// "rowSpan": 4, +// "colSpan": 6 +// }, +// "metadata": { +// "inputs": [], +// "type": "Extension/HubsExtension/PartType/VideoPart", +// "settings": { +// "content": { +// "settings": { +// "title": "Important Information", +// "subtitle": "", +// "src": "%v", +// "autoplay": true +// } +// } +// } +// } +// }, +// "2": { +// "position": { +// "x": 0, +// "y": 4, +// "rowSpan": 4, +// "colSpan": 6 +// }, +// "metadata": { +// "inputs": [ +// { +// "name": "ComponentId", +// "value": "/subscriptions/%v/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" +// } +// ], +// "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", +// "settings": {}, +// "asset": { +// "idInputName": "ComponentId", +// "type": "ApplicationInsights" +// } +// } +// } +// } +// } +// }, +// "metadata": { +// "model": { +// "timeRange": { +// "value": { +// "relative": { +// "duration": 24, +// "timeUnit": 1 +// } +// }, +// "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" +// }, +// "filterLocale": { +// "value": "en-us" +// }, +// "filters": { +// "value": { +// "MsPortalFx_TimeRange": { +// "model": { +// "format": "utc", +// "granularity": "auto", +// "relative": "24h" +// }, +// "displayCache": { +// "name": "UTC Time", +// "value": "Past 24 hours" +// }, +// "filteredPartIds": [ +// "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" +// ] +// } +// } +// } +// } +// } +// } +// +// `, mdContent, videoLink, current.SubscriptionId)), +// +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// It is recommended to follow the steps outlined +// [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. +// // ## Import // // Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/portal/getDashboard.go b/sdk/go/azure/portal/getDashboard.go index 246954d456..f57a859dc7 100644 --- a/sdk/go/azure/portal/getDashboard.go +++ b/sdk/go/azure/portal/getDashboard.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `portal.Dashboard` resource. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/portal" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := portal.LookupDashboard(ctx, &portal.LookupDashboardArgs{ +// Name: pulumi.StringRef("existing-dashboard"), +// ResourceGroupName: "dashboard-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", data.Azurerm_dashboard.Example.Id) +// return nil +// }) +// } +// +// ``` func LookupDashboard(ctx *pulumi.Context, args *LookupDashboardArgs, opts ...pulumi.InvokeOption) (*LookupDashboardResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDashboardResult diff --git a/sdk/go/azure/postgresql/activeDirectoryAdministrator.go b/sdk/go/azure/postgresql/activeDirectoryAdministrator.go index 0131d75911..9c633758c1 100644 --- a/sdk/go/azure/postgresql/activeDirectoryAdministrator.go +++ b/sdk/go/azure/postgresql/activeDirectoryAdministrator.go @@ -15,6 +15,59 @@ import ( // Allows you to set a user or group as the AD administrator for an PostgreSQL server in Azure // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("9.6"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// SkuName: pulumi.String("GP_Gen5_2"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewActiveDirectoryAdministrator(ctx, "exampleActiveDirectoryAdministrator", &postgresql.ActiveDirectoryAdministratorArgs{ +// ServerName: exampleServer.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Login: pulumi.String("sqladmin"), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A PostgreSQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/configuration.go b/sdk/go/azure/postgresql/configuration.go index 299a1acd9d..10ac6c2f41 100644 --- a/sdk/go/azure/postgresql/configuration.go +++ b/sdk/go/azure/postgresql/configuration.go @@ -19,6 +19,58 @@ import ( // // > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(false), +// AutoGrowEnabled: pulumi.Bool(true), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Version: pulumi.String("9.5"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewConfiguration(ctx, "exampleConfiguration", &postgresql.ConfigurationArgs{ +// Name: pulumi.String("backslash_quote"), +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Value: pulumi.String("on"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/database.go b/sdk/go/azure/postgresql/database.go index 3c07ed3b34..07162a3195 100644 --- a/sdk/go/azure/postgresql/database.go +++ b/sdk/go/azure/postgresql/database.go @@ -15,6 +15,58 @@ import ( // Manages a PostgreSQL Database within a PostgreSQL Server // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("B_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(false), +// AutoGrowEnabled: pulumi.Bool(true), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Version: pulumi.String("9.5"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewDatabase(ctx, "exampleDatabase", &postgresql.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// Charset: pulumi.String("UTF8"), +// Collation: pulumi.String("English_United States.1252"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PostgreSQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/firewallRule.go b/sdk/go/azure/postgresql/firewallRule.go index 925f7b6e28..8c7485b369 100644 --- a/sdk/go/azure/postgresql/firewallRule.go +++ b/sdk/go/azure/postgresql/firewallRule.go @@ -16,6 +16,90 @@ import ( // Manages a Firewall Rule for a PostgreSQL Server // // ## Example Usage +// ### Single IP Address) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("GP_Gen5_2"), +// Version: pulumi.String("11"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFirewallRule(ctx, "exampleFirewallRule", &postgresql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("40.112.8.12"), +// EndIpAddress: pulumi.String("40.112.8.12"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### IP Range) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", nil) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFirewallRule(ctx, "exampleFirewallRule", &postgresql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// StartIpAddress: pulumi.String("40.112.0.0"), +// EndIpAddress: pulumi.String("40.112.255.255"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/postgresql/flexibleServer.go b/sdk/go/azure/postgresql/flexibleServer.go index 5eca3c7359..8e1af60efb 100644 --- a/sdk/go/azure/postgresql/flexibleServer.go +++ b/sdk/go/azure/postgresql/flexibleServer.go @@ -15,6 +15,100 @@ import ( // Manages a PostgreSQL Flexible Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Storage"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("fs"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.DBforPostgreSQL/flexibleServers"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleZoneVirtualNetworkLink, err := privatedns.NewZoneVirtualNetworkLink(ctx, "exampleZoneVirtualNetworkLink", &privatedns.ZoneVirtualNetworkLinkArgs{ +// PrivateDnsZoneName: exampleZone.Name, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFlexibleServer(ctx, "exampleFlexibleServer", &postgresql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12"), +// DelegatedSubnetId: exampleSubnet.ID(), +// PrivateDnsZoneId: exampleZone.ID(), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// Zone: pulumi.String("1"), +// StorageMb: pulumi.Int(32768), +// SkuName: pulumi.String("GP_Standard_D4s_v3"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleZoneVirtualNetworkLink, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PostgreSQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/flexibleServerActiveDirectoryAdministrator.go b/sdk/go/azure/postgresql/flexibleServerActiveDirectoryAdministrator.go index 5bf8410c62..38d8ade25a 100644 --- a/sdk/go/azure/postgresql/flexibleServerActiveDirectoryAdministrator.go +++ b/sdk/go/azure/postgresql/flexibleServerActiveDirectoryAdministrator.go @@ -15,6 +15,72 @@ import ( // Allows you to set a user or group as the AD administrator for a PostgreSQL Flexible Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleServicePrincipal, err := azuread.LookupServicePrincipal(ctx, &azuread.LookupServicePrincipalArgs{ +// ObjectId: pulumi.StringRef(current.ObjectId), +// }, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := postgresql.NewFlexibleServer(ctx, "exampleFlexibleServer", &postgresql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLogin: pulumi.String("adminTerraform"), +// AdministratorPassword: pulumi.String("QAZwsx123"), +// StorageMb: pulumi.Int(32768), +// Version: pulumi.String("12"), +// SkuName: pulumi.String("GP_Standard_D2s_v3"), +// Zone: pulumi.String("2"), +// Authentication: &postgresql.FlexibleServerAuthenticationArgs{ +// ActiveDirectoryAuthEnabled: pulumi.Bool(true), +// TenantId: *pulumi.String(current.TenantId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFlexibleServerActiveDirectoryAdministrator(ctx, "exampleFlexibleServerActiveDirectoryAdministrator", &postgresql.FlexibleServerActiveDirectoryAdministratorArgs{ +// ServerName: exampleFlexibleServer.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(exampleServicePrincipal.ObjectId), +// PrincipalName: *pulumi.String(exampleServicePrincipal.DisplayName), +// PrincipalType: pulumi.String("ServicePrincipal"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A PostgreSQL Flexible Server Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/flexibleServerConfiguration.go b/sdk/go/azure/postgresql/flexibleServerConfiguration.go index 0c5d7d1d79..53f131a2d3 100644 --- a/sdk/go/azure/postgresql/flexibleServerConfiguration.go +++ b/sdk/go/azure/postgresql/flexibleServerConfiguration.go @@ -15,6 +15,97 @@ import ( // Sets a PostgreSQL Configuration value on a Azure PostgreSQL Flexible Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := postgresql.NewFlexibleServer(ctx, "exampleFlexibleServer", &postgresql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12"), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// StorageMb: pulumi.Int(32768), +// SkuName: pulumi.String("GP_Standard_D4s_v3"), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFlexibleServerConfiguration(ctx, "exampleFlexibleServerConfiguration", &postgresql.FlexibleServerConfigurationArgs{ +// ServerId: exampleFlexibleServer.ID(), +// Value: pulumi.String("on"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Azure Extensions +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := postgresql.NewFlexibleServer(ctx, "exampleFlexibleServer", &postgresql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12"), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// StorageMb: pulumi.Int(32768), +// SkuName: pulumi.String("GP_Standard_D4s_v3"), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFlexibleServerConfiguration(ctx, "exampleFlexibleServerConfiguration", &postgresql.FlexibleServerConfigurationArgs{ +// ServerId: exampleFlexibleServer.ID(), +// Value: pulumi.String("CUBE,CITEXT,BTREE_GIST"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/flexibleServerDatabase.go b/sdk/go/azure/postgresql/flexibleServerDatabase.go index 80e81a5a99..cc41c0a60f 100644 --- a/sdk/go/azure/postgresql/flexibleServerDatabase.go +++ b/sdk/go/azure/postgresql/flexibleServerDatabase.go @@ -15,6 +15,53 @@ import ( // Manages a PostgreSQL Flexible Server Database. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := postgresql.NewFlexibleServer(ctx, "exampleFlexibleServer", &postgresql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12"), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// StorageMb: pulumi.Int(32768), +// SkuName: pulumi.String("GP_Standard_D4s_v3"), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFlexibleServerDatabase(ctx, "exampleFlexibleServerDatabase", &postgresql.FlexibleServerDatabaseArgs{ +// ServerId: exampleFlexibleServer.ID(), +// Collation: pulumi.String("en_US.utf8"), +// Charset: pulumi.String("utf8"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure PostgreSQL Flexible Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/flexibleServerFirewallRule.go b/sdk/go/azure/postgresql/flexibleServerFirewallRule.go index 371194da5b..eab8c0eb30 100644 --- a/sdk/go/azure/postgresql/flexibleServerFirewallRule.go +++ b/sdk/go/azure/postgresql/flexibleServerFirewallRule.go @@ -15,6 +15,53 @@ import ( // Manages a PostgreSQL Flexible Server Firewall Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleFlexibleServer, err := postgresql.NewFlexibleServer(ctx, "exampleFlexibleServer", &postgresql.FlexibleServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12"), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorPassword: pulumi.String("H@Sh1CoR3!"), +// StorageMb: pulumi.Int(32768), +// SkuName: pulumi.String("GP_Standard_D4s_v3"), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewFlexibleServerFirewallRule(ctx, "exampleFlexibleServerFirewallRule", &postgresql.FlexibleServerFirewallRuleArgs{ +// ServerId: exampleFlexibleServer.ID(), +// StartIpAddress: pulumi.String("122.122.0.0"), +// EndIpAddress: pulumi.String("122.122.0.0"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PostgreSQL Flexible Server Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/getFlexibleServer.go b/sdk/go/azure/postgresql/getFlexibleServer.go index 1e78eff0e9..07cad063f3 100644 --- a/sdk/go/azure/postgresql/getFlexibleServer.go +++ b/sdk/go/azure/postgresql/getFlexibleServer.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing PostgreSQL Flexible Server. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := postgresql.LookupFlexibleServer(ctx, &postgresql.LookupFlexibleServerArgs{ +// Name: "existing-postgresql-fs", +// ResourceGroupName: "existing-postgresql-resgroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupFlexibleServer(ctx *pulumi.Context, args *LookupFlexibleServerArgs, opts ...pulumi.InvokeOption) (*LookupFlexibleServerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFlexibleServerResult diff --git a/sdk/go/azure/postgresql/getServer.go b/sdk/go/azure/postgresql/getServer.go index fbac4749cc..61a3a4f0ee 100644 --- a/sdk/go/azure/postgresql/getServer.go +++ b/sdk/go/azure/postgresql/getServer.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing PostgreSQL Azure Database Server. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := postgresql.LookupServer(ctx, &postgresql.LookupServerArgs{ +// Name: "postgresql-server-1", +// ResourceGroupName: "api-rg-pro", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("postgresqlServerId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupServer(ctx *pulumi.Context, args *LookupServerArgs, opts ...pulumi.InvokeOption) (*LookupServerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServerResult diff --git a/sdk/go/azure/postgresql/server.go b/sdk/go/azure/postgresql/server.go index 9ba8721e9c..b1fcc0bb3a 100644 --- a/sdk/go/azure/postgresql/server.go +++ b/sdk/go/azure/postgresql/server.go @@ -15,6 +15,51 @@ import ( // Manages a PostgreSQL Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("GP_Gen5_4"), +// Version: pulumi.String("11"), +// StorageMb: pulumi.Int(640000), +// BackupRetentionDays: pulumi.Int(7), +// GeoRedundantBackupEnabled: pulumi.Bool(true), +// AutoGrowEnabled: pulumi.Bool(true), +// PublicNetworkAccessEnabled: pulumi.Bool(false), +// SslEnforcementEnabled: pulumi.Bool(true), +// SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PostgreSQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/postgresql/serverKey.go b/sdk/go/azure/postgresql/serverKey.go index f210923375..5ad9889396 100644 --- a/sdk/go/azure/postgresql/serverKey.go +++ b/sdk/go/azure/postgresql/serverKey.go @@ -15,6 +15,135 @@ import ( // Manages a Customer Managed Key for a PostgreSQL Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// SkuName: pulumi.String("GP_Gen5_2"), +// Version: pulumi.String("11"), +// StorageMb: pulumi.Int(51200), +// SslEnforcementEnabled: pulumi.Bool(true), +// Identity: &postgresql.ServerIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// server, err := keyvault.NewAccessPolicy(ctx, "server", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: exampleServer.Identity.ApplyT(func(identity postgresql.ServerIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// client, err := keyvault.NewAccessPolicy(ctx, "client", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("List"), +// pulumi.String("Restore"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// pulumi.String("Purge"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("Verify"), +// pulumi.String("GetRotationPolicy"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// client, +// server, +// })) +// if err != nil { +// return err +// } +// _, err = postgresql.NewServerKey(ctx, "exampleServerKey", &postgresql.ServerKeyArgs{ +// ServerId: exampleServer.ID(), +// KeyVaultKeyId: exampleKey.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A PostgreSQL Server Key can be imported using the `resource id` of the PostgreSQL Server Key, e.g. diff --git a/sdk/go/azure/postgresql/virtualNetworkRule.go b/sdk/go/azure/postgresql/virtualNetworkRule.go index aacd800c0d..79f1f3bcae 100644 --- a/sdk/go/azure/postgresql/virtualNetworkRule.go +++ b/sdk/go/azure/postgresql/virtualNetworkRule.go @@ -17,6 +17,80 @@ import ( // // > **NOTE:** PostgreSQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/postgresql/concepts-data-access-and-security-vnet) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleServer, err := postgresql.NewServer(ctx, "exampleServer", &postgresql.ServerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("GP_Gen5_2"), +// StorageMb: pulumi.Int(5120), +// BackupRetentionDays: pulumi.Int(7), +// AdministratorLogin: pulumi.String("psqladmin"), +// AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Version: pulumi.String("9.5"), +// SslEnforcementEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = postgresql.NewVirtualNetworkRule(ctx, "exampleVirtualNetworkRule", &postgresql.VirtualNetworkRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleServer.Name, +// SubnetId: internal.ID(), +// IgnoreMissingVnetServiceEndpoint: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PostgreSQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/powerbi/embedded.go b/sdk/go/azure/powerbi/embedded.go index d4887a326b..b518ed5e06 100644 --- a/sdk/go/azure/powerbi/embedded.go +++ b/sdk/go/azure/powerbi/embedded.go @@ -15,6 +15,44 @@ import ( // Manages a PowerBI Embedded. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/powerbi" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = powerbi.NewEmbedded(ctx, "exampleEmbedded", &powerbi.EmbeddedArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("A1"), +// Administrators: pulumi.StringArray{ +// pulumi.String("azsdktest@microsoft.com"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // PowerBI Embedded can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/aaaarecord.go b/sdk/go/azure/privatedns/aaaarecord.go index cddce1b40a..87e0fb4a30 100644 --- a/sdk/go/azure/privatedns/aaaarecord.go +++ b/sdk/go/azure/privatedns/aaaarecord.go @@ -15,6 +15,51 @@ import ( // Enables you to manage DNS AAAA Records within Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// testZone, err := privatedns.NewZone(ctx, "testZone", &privatedns.ZoneArgs{ +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewAAAARecord(ctx, "testAAAARecord", &privatedns.AAAARecordArgs{ +// ZoneName: testZone.Name, +// ResourceGroupName: example.Name, +// Ttl: pulumi.Int(300), +// Records: pulumi.StringArray{ +// pulumi.String("fd5d:70bc:930e:d008:0000:0000:0000:7334"), +// pulumi.String("fd5d:70bc:930e:d008::7335"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS AAAA Records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/arecord.go b/sdk/go/azure/privatedns/arecord.go index 9ec31765dc..bd717eb5f9 100644 --- a/sdk/go/azure/privatedns/arecord.go +++ b/sdk/go/azure/privatedns/arecord.go @@ -15,6 +15,50 @@ import ( // Enables you to manage DNS A Records within Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewARecord(ctx, "exampleARecord", &privatedns.ARecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: pulumi.StringArray{ +// pulumi.String("10.0.180.17"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS A Records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/cnameRecord.go b/sdk/go/azure/privatedns/cnameRecord.go index 23745753ef..34139d8724 100644 --- a/sdk/go/azure/privatedns/cnameRecord.go +++ b/sdk/go/azure/privatedns/cnameRecord.go @@ -15,6 +15,48 @@ import ( // Enables you to manage DNS CNAME Records within Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewCnameRecord(ctx, "exampleCnameRecord", &privatedns.CnameRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Record: pulumi.String("contoso.com"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS CName Records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/getAAAARecord.go b/sdk/go/azure/privatedns/getAAAARecord.go index e720a5fed5..423711edd5 100644 --- a/sdk/go/azure/privatedns/getAAAARecord.go +++ b/sdk/go/azure/privatedns/getAAAARecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.NewAAAARecord(ctx, "example", &privatedns.AAAARecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsAaaaRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupAAAARecord(ctx *pulumi.Context, args *LookupAAAARecordArgs, opts ...pulumi.InvokeOption) (*LookupAAAARecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAAAARecordResult diff --git a/sdk/go/azure/privatedns/getARecord.go b/sdk/go/azure/privatedns/getARecord.go index 09059f15bc..2fddf76738 100644 --- a/sdk/go/azure/privatedns/getARecord.go +++ b/sdk/go/azure/privatedns/getARecord.go @@ -12,6 +12,34 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.LookupARecord(ctx, &privatedns.LookupARecordArgs{ +// Name: "test", +// ZoneName: "test-zone", +// ResourceGroupName: "test-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsARecordId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupARecord(ctx *pulumi.Context, args *LookupARecordArgs, opts ...pulumi.InvokeOption) (*LookupARecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupARecordResult diff --git a/sdk/go/azure/privatedns/getCnameRecord.go b/sdk/go/azure/privatedns/getCnameRecord.go index 6a5adc3d33..25e48c1fcb 100644 --- a/sdk/go/azure/privatedns/getCnameRecord.go +++ b/sdk/go/azure/privatedns/getCnameRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.NewCnameRecord(ctx, "example", &privatedns.CnameRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsCnameRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupCnameRecord(ctx *pulumi.Context, args *LookupCnameRecordArgs, opts ...pulumi.InvokeOption) (*LookupCnameRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupCnameRecordResult diff --git a/sdk/go/azure/privatedns/getDnsZone.go b/sdk/go/azure/privatedns/getDnsZone.go index 78783b87d6..31d0da0466 100644 --- a/sdk/go/azure/privatedns/getDnsZone.go +++ b/sdk/go/azure/privatedns/getDnsZone.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Private DNS Zone. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.GetDnsZone(ctx, &privatedns.GetDnsZoneArgs{ +// Name: "contoso.internal", +// ResourceGroupName: pulumi.StringRef("contoso-dns"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsZoneId", example.Id) +// return nil +// }) +// } +// +// ``` func GetDnsZone(ctx *pulumi.Context, args *GetDnsZoneArgs, opts ...pulumi.InvokeOption) (*GetDnsZoneResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetDnsZoneResult diff --git a/sdk/go/azure/privatedns/getMxRecord.go b/sdk/go/azure/privatedns/getMxRecord.go index 7ae83501fc..0575b296b4 100644 --- a/sdk/go/azure/privatedns/getMxRecord.go +++ b/sdk/go/azure/privatedns/getMxRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.NewMxRecord(ctx, "example", &privatedns.MxRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsMxRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupMxRecord(ctx *pulumi.Context, args *LookupMxRecordArgs, opts ...pulumi.InvokeOption) (*LookupMxRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupMxRecordResult diff --git a/sdk/go/azure/privatedns/getPtrRecord.go b/sdk/go/azure/privatedns/getPtrRecord.go index 85c3e83156..a800960c62 100644 --- a/sdk/go/azure/privatedns/getPtrRecord.go +++ b/sdk/go/azure/privatedns/getPtrRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.NewPTRRecord(ctx, "example", &privatedns.PTRRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsPtrRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func GetPtrRecord(ctx *pulumi.Context, args *GetPtrRecordArgs, opts ...pulumi.InvokeOption) (*GetPtrRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPtrRecordResult diff --git a/sdk/go/azure/privatedns/getResolver.go b/sdk/go/azure/privatedns/getResolver.go index 4f9852a9f7..387c2160ec 100644 --- a/sdk/go/azure/privatedns/getResolver.go +++ b/sdk/go/azure/privatedns/getResolver.go @@ -13,6 +13,33 @@ import ( ) // Gets information about an existing Private DNS Resolver. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := privatedns.LookupResolver(ctx, &privatedns.LookupResolverArgs{ +// Name: "example", +// ResourceGroupName: "example-resourcegroup-name", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupResolver(ctx *pulumi.Context, args *LookupResolverArgs, opts ...pulumi.InvokeOption) (*LookupResolverResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupResolverResult diff --git a/sdk/go/azure/privatedns/getResolverDnsForwardingRuleset.go b/sdk/go/azure/privatedns/getResolverDnsForwardingRuleset.go index 7ffb6cc72e..f02bf47bc7 100644 --- a/sdk/go/azure/privatedns/getResolverDnsForwardingRuleset.go +++ b/sdk/go/azure/privatedns/getResolverDnsForwardingRuleset.go @@ -13,6 +13,33 @@ import ( ) // Gets information about an existing Private DNS Resolver Dns Forwarding Ruleset. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := privatedns.LookupResolverDnsForwardingRuleset(ctx, &privatedns.LookupResolverDnsForwardingRulesetArgs{ +// Name: "example-ruleset", +// ResourceGroupName: "example-ruleset-resourcegroup", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupResolverDnsForwardingRuleset(ctx *pulumi.Context, args *LookupResolverDnsForwardingRulesetArgs, opts ...pulumi.InvokeOption) (*LookupResolverDnsForwardingRulesetResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupResolverDnsForwardingRulesetResult diff --git a/sdk/go/azure/privatedns/getResolverForwardingRule.go b/sdk/go/azure/privatedns/getResolverForwardingRule.go index 56afdd2fe1..b880149357 100644 --- a/sdk/go/azure/privatedns/getResolverForwardingRule.go +++ b/sdk/go/azure/privatedns/getResolverForwardingRule.go @@ -13,6 +13,33 @@ import ( ) // Gets information about an existing Private DNS Resolver Forwarding Rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := privatedns.LookupResolverForwardingRule(ctx, &privatedns.LookupResolverForwardingRuleArgs{ +// DnsForwardingRulesetId: "example-forwarding-rulset-id", +// Name: "example-rule", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupResolverForwardingRule(ctx *pulumi.Context, args *LookupResolverForwardingRuleArgs, opts ...pulumi.InvokeOption) (*LookupResolverForwardingRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupResolverForwardingRuleResult diff --git a/sdk/go/azure/privatedns/getResolverInboundEndpoint.go b/sdk/go/azure/privatedns/getResolverInboundEndpoint.go index 4d453a79c7..76c69cd0cb 100644 --- a/sdk/go/azure/privatedns/getResolverInboundEndpoint.go +++ b/sdk/go/azure/privatedns/getResolverInboundEndpoint.go @@ -13,6 +13,33 @@ import ( ) // Gets information about an existing Private DNS Resolver Inbound Endpoint. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := privatedns.LookupResolverInboundEndpoint(ctx, &privatedns.LookupResolverInboundEndpointArgs{ +// Name: "example-drie", +// PrivateDnsResolverId: "example-private-dns-resolver-id", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupResolverInboundEndpoint(ctx *pulumi.Context, args *LookupResolverInboundEndpointArgs, opts ...pulumi.InvokeOption) (*LookupResolverInboundEndpointResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupResolverInboundEndpointResult diff --git a/sdk/go/azure/privatedns/getResolverOutboundEndpoint.go b/sdk/go/azure/privatedns/getResolverOutboundEndpoint.go index eff2c33572..246051b9a9 100644 --- a/sdk/go/azure/privatedns/getResolverOutboundEndpoint.go +++ b/sdk/go/azure/privatedns/getResolverOutboundEndpoint.go @@ -13,6 +13,33 @@ import ( ) // Gets information about an existing Private DNS Resolver Outbound Endpoint. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := privatedns.LookupResolverOutboundEndpoint(ctx, &privatedns.LookupResolverOutboundEndpointArgs{ +// Name: "example-endpoint", +// PrivateDnsResolverId: "example-private-dns-resolver-id", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupResolverOutboundEndpoint(ctx *pulumi.Context, args *LookupResolverOutboundEndpointArgs, opts ...pulumi.InvokeOption) (*LookupResolverOutboundEndpointResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupResolverOutboundEndpointResult diff --git a/sdk/go/azure/privatedns/getResolverVirtualNetworkLink.go b/sdk/go/azure/privatedns/getResolverVirtualNetworkLink.go index a5051baade..f3b74e9cc1 100644 --- a/sdk/go/azure/privatedns/getResolverVirtualNetworkLink.go +++ b/sdk/go/azure/privatedns/getResolverVirtualNetworkLink.go @@ -13,6 +13,33 @@ import ( ) // Gets information about an existing Private DNS Resolver Virtual Network Link. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := privatedns.LookupResolverVirtualNetworkLink(ctx, &privatedns.LookupResolverVirtualNetworkLinkArgs{ +// DnsForwardingRulesetId: "example-dns-forwarding-ruleset-id", +// Name: "example-link", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupResolverVirtualNetworkLink(ctx *pulumi.Context, args *LookupResolverVirtualNetworkLinkArgs, opts ...pulumi.InvokeOption) (*LookupResolverVirtualNetworkLinkResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupResolverVirtualNetworkLinkResult diff --git a/sdk/go/azure/privatedns/getSrvRecord.go b/sdk/go/azure/privatedns/getSrvRecord.go index f7394cdcb3..cf8dad711e 100644 --- a/sdk/go/azure/privatedns/getSrvRecord.go +++ b/sdk/go/azure/privatedns/getSrvRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.NewSRVRecord(ctx, "example", &privatedns.SRVRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsSrvRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func GetSrvRecord(ctx *pulumi.Context, args *GetSrvRecordArgs, opts ...pulumi.InvokeOption) (*GetSrvRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetSrvRecordResult diff --git a/sdk/go/azure/privatedns/getTxtRecord.go b/sdk/go/azure/privatedns/getTxtRecord.go index b712d6b175..e958d718d5 100644 --- a/sdk/go/azure/privatedns/getTxtRecord.go +++ b/sdk/go/azure/privatedns/getTxtRecord.go @@ -12,6 +12,33 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.NewTxtRecord(ctx, "example", &privatedns.TxtRecordArgs{ +// ZoneName: pulumi.String("test-zone"), +// ResourceGroupName: pulumi.String("test-rg"), +// }) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsTxtRecordId", example.ID()) +// return nil +// }) +// } +// +// ``` func LookupTxtRecord(ctx *pulumi.Context, args *LookupTxtRecordArgs, opts ...pulumi.InvokeOption) (*LookupTxtRecordResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTxtRecordResult diff --git a/sdk/go/azure/privatedns/getZoneVirtualNetworkLink.go b/sdk/go/azure/privatedns/getZoneVirtualNetworkLink.go index 512c1bbc52..8c4fa7afe7 100644 --- a/sdk/go/azure/privatedns/getZoneVirtualNetworkLink.go +++ b/sdk/go/azure/privatedns/getZoneVirtualNetworkLink.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Private DNS zone Virtual Network Link. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatedns.LookupZoneVirtualNetworkLink(ctx, &privatedns.LookupZoneVirtualNetworkLinkArgs{ +// Name: "test", +// ResourceGroupName: "test-rg", +// PrivateDnsZoneName: "test-zone", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("privateDnsARecordId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupZoneVirtualNetworkLink(ctx *pulumi.Context, args *LookupZoneVirtualNetworkLinkArgs, opts ...pulumi.InvokeOption) (*LookupZoneVirtualNetworkLinkResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupZoneVirtualNetworkLinkResult diff --git a/sdk/go/azure/privatedns/linkService.go b/sdk/go/azure/privatedns/linkService.go index 21de71327e..c7687e3c4e 100644 --- a/sdk/go/azure/privatedns/linkService.go +++ b/sdk/go/azure/privatedns/linkService.go @@ -17,6 +17,113 @@ import ( // // > **NOTE** Private Link is now in [GA](https://docs.microsoft.com/en-gb/azure/private-link/). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.1.0/24"), +// }, +// EnforcePrivateLinkServiceNetworkPolicies: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Sku: pulumi.String("Standard"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Sku: pulumi.String("Standard"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: examplePublicIp.Name, +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewLinkService(ctx, "exampleLinkService", &privatedns.LinkServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AutoApprovalSubscriptionIds: pulumi.StringArray{ +// pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// VisibilitySubscriptionIds: pulumi.StringArray{ +// pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// LoadBalancerFrontendIpConfigurationIds: pulumi.StringArray{ +// exampleLoadBalancer.FrontendIpConfigurations.ApplyT(func(frontendIpConfigurations []lb.LoadBalancerFrontendIpConfiguration) (*string, error) { +// return &frontendIpConfigurations[0].Id, nil +// }).(pulumi.StringPtrOutput), +// }, +// NatIpConfigurations: privatedns.LinkServiceNatIpConfigurationArray{ +// &privatedns.LinkServiceNatIpConfigurationArgs{ +// Name: pulumi.String("primary"), +// PrivateIpAddress: pulumi.String("10.5.1.17"), +// PrivateIpAddressVersion: pulumi.String("IPv4"), +// SubnetId: exampleSubnet.ID(), +// Primary: pulumi.Bool(true), +// }, +// &privatedns.LinkServiceNatIpConfigurationArgs{ +// Name: pulumi.String("secondary"), +// PrivateIpAddress: pulumi.String("10.5.1.18"), +// PrivateIpAddressVersion: pulumi.String("IPv4"), +// SubnetId: exampleSubnet.ID(), +// Primary: pulumi.Bool(false), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private Link Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/mxRecord.go b/sdk/go/azure/privatedns/mxRecord.go index 674336c04b..776867fd36 100644 --- a/sdk/go/azure/privatedns/mxRecord.go +++ b/sdk/go/azure/privatedns/mxRecord.go @@ -15,6 +15,60 @@ import ( // Enables you to manage DNS MX Records within Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewMxRecord(ctx, "exampleMxRecord", &privatedns.MxRecordArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ZoneName: exampleZone.Name, +// Ttl: pulumi.Int(300), +// Records: privatedns.MxRecordRecordArray{ +// &privatedns.MxRecordRecordArgs{ +// Preference: pulumi.Int(10), +// Exchange: pulumi.String("mx1.contoso.com"), +// }, +// &privatedns.MxRecordRecordArgs{ +// Preference: pulumi.Int(20), +// Exchange: pulumi.String("backupmx.contoso.com"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS MX Records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/ptrrecord.go b/sdk/go/azure/privatedns/ptrrecord.go index 9a952a977e..d768157611 100644 --- a/sdk/go/azure/privatedns/ptrrecord.go +++ b/sdk/go/azure/privatedns/ptrrecord.go @@ -15,6 +15,50 @@ import ( // Enables you to manage DNS PTR Records within Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewPTRRecord(ctx, "examplePTRRecord", &privatedns.PTRRecordArgs{ +// ZoneName: exampleZone.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Ttl: pulumi.Int(300), +// Records: pulumi.StringArray{ +// pulumi.String("test.example.com"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS PTR Records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/resolver.go b/sdk/go/azure/privatedns/resolver.go index 7d8c3ea302..3d684d1989 100644 --- a/sdk/go/azure/privatedns/resolver.go +++ b/sdk/go/azure/privatedns/resolver.go @@ -15,6 +15,52 @@ import ( // Manages a Private DNS Resolver. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewResolver(ctx, "test", &privatedns.ResolverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // DNS Resolver can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/resolverDnsForwardingRuleset.go b/sdk/go/azure/privatedns/resolverDnsForwardingRuleset.go index 0a56614925..d3f56c9f52 100644 --- a/sdk/go/azure/privatedns/resolverDnsForwardingRuleset.go +++ b/sdk/go/azure/privatedns/resolverDnsForwardingRuleset.go @@ -15,6 +15,97 @@ import ( // Manages a Private DNS Resolver Dns Forwarding Ruleset. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.64/28"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("Microsoft.Network.dnsResolvers"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// Name: pulumi.String("Microsoft.Network/dnsResolvers"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleResolver, err := privatedns.NewResolver(ctx, "exampleResolver", &privatedns.ResolverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// exampleResolverOutboundEndpoint, err := privatedns.NewResolverOutboundEndpoint(ctx, "exampleResolverOutboundEndpoint", &privatedns.ResolverOutboundEndpointArgs{ +// PrivateDnsResolverId: exampleResolver.ID(), +// Location: exampleResolver.Location, +// SubnetId: exampleSubnet.ID(), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewResolverDnsForwardingRuleset(ctx, "exampleResolverDnsForwardingRuleset", &privatedns.ResolverDnsForwardingRulesetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PrivateDnsResolverOutboundEndpointIds: pulumi.StringArray{ +// exampleResolverOutboundEndpoint.ID(), +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS Resolver Dns Forwarding Ruleset can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/resolverForwardingRule.go b/sdk/go/azure/privatedns/resolverForwardingRule.go index 3ef312515d..cafe9a25c1 100644 --- a/sdk/go/azure/privatedns/resolverForwardingRule.go +++ b/sdk/go/azure/privatedns/resolverForwardingRule.go @@ -15,6 +15,111 @@ import ( // Manages a Private DNS Resolver Forwarding Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.64/28"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("Microsoft.Network.dnsResolvers"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// Name: pulumi.String("Microsoft.Network/dnsResolvers"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleResolver, err := privatedns.NewResolver(ctx, "exampleResolver", &privatedns.ResolverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// exampleResolverOutboundEndpoint, err := privatedns.NewResolverOutboundEndpoint(ctx, "exampleResolverOutboundEndpoint", &privatedns.ResolverOutboundEndpointArgs{ +// PrivateDnsResolverId: exampleResolver.ID(), +// Location: exampleResolver.Location, +// SubnetId: exampleSubnet.ID(), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleResolverDnsForwardingRuleset, err := privatedns.NewResolverDnsForwardingRuleset(ctx, "exampleResolverDnsForwardingRuleset", &privatedns.ResolverDnsForwardingRulesetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PrivateDnsResolverOutboundEndpointIds: pulumi.StringArray{ +// exampleResolverOutboundEndpoint.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewResolverForwardingRule(ctx, "exampleResolverForwardingRule", &privatedns.ResolverForwardingRuleArgs{ +// DnsForwardingRulesetId: exampleResolverDnsForwardingRuleset.ID(), +// DomainName: pulumi.String("onprem.local."), +// Enabled: pulumi.Bool(true), +// TargetDnsServers: privatedns.ResolverForwardingRuleTargetDnsServerArray{ +// &privatedns.ResolverForwardingRuleTargetDnsServerArgs{ +// IpAddress: pulumi.String("10.10.0.1"), +// Port: pulumi.Int(53), +// }, +// }, +// Metadata: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS Resolver Forwarding Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/resolverInboundEndpoint.go b/sdk/go/azure/privatedns/resolverInboundEndpoint.go index c779dcce56..34c1105e94 100644 --- a/sdk/go/azure/privatedns/resolverInboundEndpoint.go +++ b/sdk/go/azure/privatedns/resolverInboundEndpoint.go @@ -15,6 +15,89 @@ import ( // Manages a Private DNS Resolver Inbound Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleResolver, err := privatedns.NewResolver(ctx, "exampleResolver", &privatedns.ResolverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/28"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("Microsoft.Network.dnsResolvers"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// Name: pulumi.String("Microsoft.Network/dnsResolvers"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewResolverInboundEndpoint(ctx, "exampleResolverInboundEndpoint", &privatedns.ResolverInboundEndpointArgs{ +// PrivateDnsResolverId: exampleResolver.ID(), +// Location: exampleResolver.Location, +// IpConfigurations: privatedns.ResolverInboundEndpointIpConfigurationArray{ +// &privatedns.ResolverInboundEndpointIpConfigurationArgs{ +// PrivateIpAllocationMethod: pulumi.String("Dynamic"), +// SubnetId: exampleSubnet.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS Resolver Inbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/resolverOutboundEndpoint.go b/sdk/go/azure/privatedns/resolverOutboundEndpoint.go index 3a926ecc54..d7544d73c8 100644 --- a/sdk/go/azure/privatedns/resolverOutboundEndpoint.go +++ b/sdk/go/azure/privatedns/resolverOutboundEndpoint.go @@ -15,6 +15,84 @@ import ( // Manages a Private DNS Resolver Outbound Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.64/28"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("Microsoft.Network.dnsResolvers"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// Name: pulumi.String("Microsoft.Network/dnsResolvers"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleResolver, err := privatedns.NewResolver(ctx, "exampleResolver", &privatedns.ResolverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewResolverOutboundEndpoint(ctx, "exampleResolverOutboundEndpoint", &privatedns.ResolverOutboundEndpointArgs{ +// PrivateDnsResolverId: exampleResolver.ID(), +// Location: exampleResolver.Location, +// SubnetId: exampleSubnet.ID(), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS Resolver Outbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/resolverVirtualNetworkLink.go b/sdk/go/azure/privatedns/resolverVirtualNetworkLink.go index 50590a994e..ba5011bf1a 100644 --- a/sdk/go/azure/privatedns/resolverVirtualNetworkLink.go +++ b/sdk/go/azure/privatedns/resolverVirtualNetworkLink.go @@ -15,6 +15,107 @@ import ( // Manages a Private DNS Resolver Virtual Network Link. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.64/28"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("Microsoft.Network.dnsResolvers"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// }, +// Name: pulumi.String("Microsoft.Network/dnsResolvers"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleResolver, err := privatedns.NewResolver(ctx, "exampleResolver", &privatedns.ResolverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// exampleResolverOutboundEndpoint, err := privatedns.NewResolverOutboundEndpoint(ctx, "exampleResolverOutboundEndpoint", &privatedns.ResolverOutboundEndpointArgs{ +// PrivateDnsResolverId: exampleResolver.ID(), +// Location: exampleResolver.Location, +// SubnetId: exampleSubnet.ID(), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleResolverDnsForwardingRuleset, err := privatedns.NewResolverDnsForwardingRuleset(ctx, "exampleResolverDnsForwardingRuleset", &privatedns.ResolverDnsForwardingRulesetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// PrivateDnsResolverOutboundEndpointIds: pulumi.StringArray{ +// exampleResolverOutboundEndpoint.ID(), +// }, +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewResolverVirtualNetworkLink(ctx, "exampleResolverVirtualNetworkLink", &privatedns.ResolverVirtualNetworkLinkArgs{ +// DnsForwardingRulesetId: exampleResolverDnsForwardingRuleset.ID(), +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// Metadata: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS Resolver Virtual Network Link can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/srvrecord.go b/sdk/go/azure/privatedns/srvrecord.go index 99d0b8ed7d..e1fe55439a 100644 --- a/sdk/go/azure/privatedns/srvrecord.go +++ b/sdk/go/azure/privatedns/srvrecord.go @@ -15,6 +15,64 @@ import ( // Enables you to manage DNS SRV Records within Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewSRVRecord(ctx, "exampleSRVRecord", &privatedns.SRVRecordArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ZoneName: exampleZone.Name, +// Ttl: pulumi.Int(300), +// Records: privatedns.SRVRecordRecordArray{ +// &privatedns.SRVRecordRecordArgs{ +// Priority: pulumi.Int(1), +// Weight: pulumi.Int(5), +// Port: pulumi.Int(8080), +// Target: pulumi.String("target1.contoso.com"), +// }, +// &privatedns.SRVRecordRecordArgs{ +// Priority: pulumi.Int(10), +// Weight: pulumi.Int(10), +// Port: pulumi.Int(8080), +// Target: pulumi.String("target2.contoso.com"), +// }, +// }, +// Tags: pulumi.StringMap{ +// "Environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS SRV Records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/txtRecord.go b/sdk/go/azure/privatedns/txtRecord.go index 3c6efb2ed2..6a18a44f06 100644 --- a/sdk/go/azure/privatedns/txtRecord.go +++ b/sdk/go/azure/privatedns/txtRecord.go @@ -15,6 +15,52 @@ import ( // Enables you to manage DNS TXT Records within Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewTxtRecord(ctx, "exampleTxtRecord", &privatedns.TxtRecordArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ZoneName: exampleZone.Name, +// Ttl: pulumi.Int(300), +// Records: privatedns.TxtRecordRecordArray{ +// &privatedns.TxtRecordRecordArgs{ +// Value: pulumi.String("v=spf1 mx ~all"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS TXT Records can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/zone.go b/sdk/go/azure/privatedns/zone.go index 36fdcec09c..77dc218de5 100644 --- a/sdk/go/azure/privatedns/zone.go +++ b/sdk/go/azure/privatedns/zone.go @@ -15,6 +15,39 @@ import ( // Enables you to manage Private DNS zones within Azure DNS. These zones are hosted on Azure's name servers. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatedns/zoneVirtualNetworkLink.go b/sdk/go/azure/privatedns/zoneVirtualNetworkLink.go index c25361722d..226491ae67 100644 --- a/sdk/go/azure/privatedns/zoneVirtualNetworkLink.go +++ b/sdk/go/azure/privatedns/zoneVirtualNetworkLink.go @@ -15,6 +15,58 @@ import ( // Enables you to manage Private DNS zone Virtual Network Links. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleZone, err := privatedns.NewZone(ctx, "exampleZone", &privatedns.ZoneArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatedns.NewZoneVirtualNetworkLink(ctx, "exampleZoneVirtualNetworkLink", &privatedns.ZoneVirtualNetworkLinkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// PrivateDnsZoneName: exampleZone.Name, +// VirtualNetworkId: exampleVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Private DNS Zone Virtual Network Links can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatelink/applicationSecurityGroupAssociation.go b/sdk/go/azure/privatelink/applicationSecurityGroupAssociation.go index fcb5770426..c9afe6d15a 100644 --- a/sdk/go/azure/privatelink/applicationSecurityGroupAssociation.go +++ b/sdk/go/azure/privatelink/applicationSecurityGroupAssociation.go @@ -15,6 +15,147 @@ import ( // Manages an association between Private Endpoint and Application Security Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatedns" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatelink" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// service, err := network.NewSubnet(ctx, "service", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.1.0/24"), +// }, +// EnforcePrivateLinkServiceNetworkPolicies: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// endpoint, err := network.NewSubnet(ctx, "endpoint", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.2.0/24"), +// }, +// EnforcePrivateLinkEndpointNetworkPolicies: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// examplePublicIp, err := network.NewPublicIp(ctx, "examplePublicIp", &network.PublicIpArgs{ +// Sku: pulumi.String("Standard"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AllocationMethod: pulumi.String("Static"), +// }) +// if err != nil { +// return err +// } +// exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "exampleLoadBalancer", &lb.LoadBalancerArgs{ +// Sku: pulumi.String("Standard"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{ +// &lb.LoadBalancerFrontendIpConfigurationArgs{ +// Name: examplePublicIp.Name, +// PublicIpAddressId: examplePublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinkService, err := privatedns.NewLinkService(ctx, "exampleLinkService", &privatedns.LinkServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AutoApprovalSubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.SubscriptionId), +// }, +// VisibilitySubscriptionIds: pulumi.StringArray{ +// *pulumi.String(current.SubscriptionId), +// }, +// NatIpConfigurations: privatedns.LinkServiceNatIpConfigurationArray{ +// &privatedns.LinkServiceNatIpConfigurationArgs{ +// Name: pulumi.String("primaryIpConfiguration"), +// Primary: pulumi.Bool(true), +// SubnetId: service.ID(), +// }, +// }, +// LoadBalancerFrontendIpConfigurationIds: pulumi.StringArray{ +// exampleLoadBalancer.FrontendIpConfigurations.ApplyT(func(frontendIpConfigurations []lb.LoadBalancerFrontendIpConfiguration) (*string, error) { +// return &frontendIpConfigurations[0].Id, nil +// }).(pulumi.StringPtrOutput), +// }, +// }) +// if err != nil { +// return err +// } +// exampleEndpoint, err := privatelink.NewEndpoint(ctx, "exampleEndpoint", &privatelink.EndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubnetId: endpoint.ID(), +// PrivateServiceConnection: &privatelink.EndpointPrivateServiceConnectionArgs{ +// Name: exampleLinkService.Name, +// IsManualConnection: pulumi.Bool(false), +// PrivateConnectionResourceId: exampleLinkService.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// exampleApplicationSecurityGroup, err := network.NewApplicationSecurityGroup(ctx, "exampleApplicationSecurityGroup", &network.ApplicationSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = privatelink.NewApplicationSecurityGroupAssociation(ctx, "exampleApplicationSecurityGroupAssociation", &privatelink.ApplicationSecurityGroupAssociationArgs{ +// PrivateEndpointId: exampleEndpoint.ID(), +// ApplicationSecurityGroupId: exampleApplicationSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Associations between Private Endpoint and Application Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/privatelink/getEndpointConnection.go b/sdk/go/azure/privatelink/getEndpointConnection.go index 82b66aa4ae..9d00f20357 100644 --- a/sdk/go/azure/privatelink/getEndpointConnection.go +++ b/sdk/go/azure/privatelink/getEndpointConnection.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access the connection status information about an existing Private Endpoint Connection. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatelink" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatelink.GetEndpointConnection(ctx, &privatelink.GetEndpointConnectionArgs{ +// Name: "example-private-endpoint", +// ResourceGroupName: "example-rg", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("privateEndpointStatus", example.PrivateServiceConnections[0].Status) +// return nil +// }) +// } +// +// ``` func GetEndpointConnection(ctx *pulumi.Context, args *GetEndpointConnectionArgs, opts ...pulumi.InvokeOption) (*GetEndpointConnectionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetEndpointConnectionResult diff --git a/sdk/go/azure/privatelink/getService.go b/sdk/go/azure/privatelink/getService.go index 337442ab48..f7a4a569ef 100644 --- a/sdk/go/azure/privatelink/getService.go +++ b/sdk/go/azure/privatelink/getService.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Private Link Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatelink" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatelink.GetService(ctx, &privatelink.GetServiceArgs{ +// Name: "myPrivateLinkService", +// ResourceGroupName: "PrivateLinkServiceRG", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("privateLinkServiceId", example.Id) +// return nil +// }) +// } +// +// ``` func GetService(ctx *pulumi.Context, args *GetServiceArgs, opts ...pulumi.InvokeOption) (*GetServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetServiceResult diff --git a/sdk/go/azure/privatelink/getServiceEndpointConnections.go b/sdk/go/azure/privatelink/getServiceEndpointConnections.go index a8eaed726e..8ebc19e6fa 100644 --- a/sdk/go/azure/privatelink/getServiceEndpointConnections.go +++ b/sdk/go/azure/privatelink/getServiceEndpointConnections.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access endpoint connection information about an existing Private Link Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatelink" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := privatelink.GetServiceEndpointConnections(ctx, &privatelink.GetServiceEndpointConnectionsArgs{ +// ServiceId: azurerm_private_link_service.Example.Id, +// ResourceGroupName: azurerm_resource_group.Example.Name, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("privateEndpointStatus", example.PrivateEndpointConnections[0].Status) +// return nil +// }) +// } +// +// ``` func GetServiceEndpointConnections(ctx *pulumi.Context, args *GetServiceEndpointConnectionsArgs, opts ...pulumi.InvokeOption) (*GetServiceEndpointConnectionsResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetServiceEndpointConnectionsResult diff --git a/sdk/go/azure/proximity/getPlacementGroup.go b/sdk/go/azure/proximity/getPlacementGroup.go index 6646e19b0a..7f315cc557 100644 --- a/sdk/go/azure/proximity/getPlacementGroup.go +++ b/sdk/go/azure/proximity/getPlacementGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Proximity Placement Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/proximity" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := proximity.LookupPlacementGroup(ctx, &proximity.LookupPlacementGroupArgs{ +// Name: "tf-appsecuritygroup", +// ResourceGroupName: "my-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("proximityPlacementGroupId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupPlacementGroup(ctx *pulumi.Context, args *LookupPlacementGroupArgs, opts ...pulumi.InvokeOption) (*LookupPlacementGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupPlacementGroupResult diff --git a/sdk/go/azure/proximity/placementGroup.go b/sdk/go/azure/proximity/placementGroup.go index 38e8de2e2b..a277a747c6 100644 --- a/sdk/go/azure/proximity/placementGroup.go +++ b/sdk/go/azure/proximity/placementGroup.go @@ -15,6 +15,43 @@ import ( // Manages a proximity placement group for virtual machines, virtual machine scale sets and availability sets. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/proximity" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = proximity.NewPlacementGroup(ctx, "examplePlacementGroup", &proximity.PlacementGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Proximity Placement Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/purview/account.go b/sdk/go/azure/purview/account.go index 8f1f203575..b8f093f9be 100644 --- a/sdk/go/azure/purview/account.go +++ b/sdk/go/azure/purview/account.go @@ -15,6 +15,43 @@ import ( // Manages a Purview Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/purview" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = purview.NewAccount(ctx, "exampleAccount", &purview.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Identity: &purview.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Purview Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/recoveryservices/getVault.go b/sdk/go/azure/recoveryservices/getVault.go index 0e808e765d..b4392f4fce 100644 --- a/sdk/go/azure/recoveryservices/getVault.go +++ b/sdk/go/azure/recoveryservices/getVault.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Recovery Services Vault. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := recoveryservices.LookupVault(ctx, &recoveryservices.LookupVaultArgs{ +// Name: "tfex-recovery_vault", +// ResourceGroupName: "tfex-resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupVault(ctx *pulumi.Context, args *LookupVaultArgs, opts ...pulumi.InvokeOption) (*LookupVaultResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupVaultResult diff --git a/sdk/go/azure/recoveryservices/vault.go b/sdk/go/azure/recoveryservices/vault.go index 6a7ef698cb..cc7db60dab 100644 --- a/sdk/go/azure/recoveryservices/vault.go +++ b/sdk/go/azure/recoveryservices/vault.go @@ -15,6 +15,42 @@ import ( // Manages a Recovery Services Vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: pulumi.String("Standard"), +// SoftDeleteEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Recovery Services Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/recoveryservices/vaultResourceGuardAssociation.go b/sdk/go/azure/recoveryservices/vaultResourceGuardAssociation.go index a00243904c..484d1db779 100644 --- a/sdk/go/azure/recoveryservices/vaultResourceGuardAssociation.go +++ b/sdk/go/azure/recoveryservices/vaultResourceGuardAssociation.go @@ -15,6 +15,57 @@ import ( // Manages an association of a Resource Guard and Recovery Services Vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = dataprotection.NewResourceGuard(ctx, "exampleResourceGuard", &dataprotection.ResourceGuardArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// SoftDeleteEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = recoveryservices.NewVaultResourceGuardAssociation(ctx, "test", &recoveryservices.VaultResourceGuardAssociationArgs{ +// VaultId: pulumi.Any(azurerm_recovery_services_vault.Test.Id), +// ResourceGuardId: pulumi.Any(azurerm_data_protection_resource_guard.Test.Id), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/redis/cache.go b/sdk/go/azure/redis/cache.go index c39f3be520..e87a746b36 100644 --- a/sdk/go/azure/redis/cache.go +++ b/sdk/go/azure/redis/cache.go @@ -17,6 +17,47 @@ import ( // // > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines) // +// ## Example Usage +// +// This example provisions a Standard Redis Cache. +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = redis.NewCache(ctx, "exampleCache", &redis.CacheArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Capacity: pulumi.Int(2), +// Family: pulumi.String("C"), +// SkuName: pulumi.String("Standard"), +// EnableNonSslPort: pulumi.Bool(false), +// MinimumTlsVersion: pulumi.String("1.2"), +// RedisConfiguration: nil, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // ## Relevant Links // // * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq) diff --git a/sdk/go/azure/redis/enterpriseCluster.go b/sdk/go/azure/redis/enterpriseCluster.go index 53272e546f..d617be99ce 100644 --- a/sdk/go/azure/redis/enterpriseCluster.go +++ b/sdk/go/azure/redis/enterpriseCluster.go @@ -15,6 +15,41 @@ import ( // Manages a Redis Enterprise Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = redis.NewEnterpriseCluster(ctx, "exampleEnterpriseCluster", &redis.EnterpriseClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("EnterpriseFlash_F300-3"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Redis Enterprise Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/redis/enterpriseDatabase.go b/sdk/go/azure/redis/enterpriseDatabase.go index afcb2b3ffa..ed5c1e39b7 100644 --- a/sdk/go/azure/redis/enterpriseDatabase.go +++ b/sdk/go/azure/redis/enterpriseDatabase.go @@ -15,6 +15,71 @@ import ( // Manages a Redis Enterprise Database. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEnterpriseCluster, err := redis.NewEnterpriseCluster(ctx, "exampleEnterpriseCluster", &redis.EnterpriseClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("Enterprise_E20-4"), +// }) +// if err != nil { +// return err +// } +// example1, err := redis.NewEnterpriseCluster(ctx, "example1", &redis.EnterpriseClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SkuName: pulumi.String("Enterprise_E20-4"), +// }) +// if err != nil { +// return err +// } +// _, err = redis.NewEnterpriseDatabase(ctx, "exampleEnterpriseDatabase", &redis.EnterpriseDatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ClusterId: exampleEnterpriseCluster.ID(), +// ClientProtocol: pulumi.String("Encrypted"), +// ClusteringPolicy: pulumi.String("EnterpriseCluster"), +// EvictionPolicy: pulumi.String("NoEviction"), +// Port: pulumi.Int(10000), +// LinkedDatabaseIds: pulumi.StringArray{ +// exampleEnterpriseCluster.ID().ApplyT(func(id string) (string, error) { +// return fmt.Sprintf("%v/databases/default", id), nil +// }).(pulumi.StringOutput), +// example1.ID().ApplyT(func(id string) (string, error) { +// return fmt.Sprintf("%v/databases/default", id), nil +// }).(pulumi.StringOutput), +// }, +// LinkedDatabaseGroupNickname: pulumi.String("tftestGeoGroup"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Redis Enterprise Databases can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/redis/firewallRule.go b/sdk/go/azure/redis/firewallRule.go index 12256e7aff..d74a54dcdb 100644 --- a/sdk/go/azure/redis/firewallRule.go +++ b/sdk/go/azure/redis/firewallRule.go @@ -15,6 +15,68 @@ import ( // Manages a Firewall Rule associated with a Redis Cache. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{ +// Keepers: pulumi.Map{ +// "azi_id": pulumi.Any(1), +// }, +// ByteLength: pulumi.Int(8), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleCache, err := redis.NewCache(ctx, "exampleCache", &redis.CacheArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Capacity: pulumi.Int(1), +// Family: pulumi.String("P"), +// SkuName: pulumi.String("Premium"), +// EnableNonSslPort: pulumi.Bool(false), +// RedisConfiguration: &redis.CacheRedisConfigurationArgs{ +// MaxmemoryReserved: pulumi.Int(2), +// MaxmemoryDelta: pulumi.Int(2), +// MaxmemoryPolicy: pulumi.String("allkeys-lru"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = redis.NewFirewallRule(ctx, "exampleFirewallRule", &redis.FirewallRuleArgs{ +// RedisCacheName: exampleCache.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// StartIp: pulumi.String("1.2.3.4"), +// EndIp: pulumi.String("2.3.4.5"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Redis Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/redis/getCache.go b/sdk/go/azure/redis/getCache.go index 15b795a050..e571f5ec85 100644 --- a/sdk/go/azure/redis/getCache.go +++ b/sdk/go/azure/redis/getCache.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Redis Cache +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := redis.LookupCache(ctx, &redis.LookupCacheArgs{ +// Name: "myrediscache", +// ResourceGroupName: "redis-cache", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("primaryAccessKey", example.PrimaryAccessKey) +// ctx.Export("hostname", example.Hostname) +// return nil +// }) +// } +// +// ``` func LookupCache(ctx *pulumi.Context, args *LookupCacheArgs, opts ...pulumi.InvokeOption) (*LookupCacheResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupCacheResult diff --git a/sdk/go/azure/redis/getEnterpriseDatabase.go b/sdk/go/azure/redis/getEnterpriseDatabase.go index 7ec40aced9..7062292c85 100644 --- a/sdk/go/azure/redis/getEnterpriseDatabase.go +++ b/sdk/go/azure/redis/getEnterpriseDatabase.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about an existing Redis Enterprise Database +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := redis.LookupEnterpriseDatabase(ctx, &redis.LookupEnterpriseDatabaseArgs{ +// Name: "default", +// ResourceGroupName: pulumi.StringRef(azurerm_resource_group.Example.Name), +// ClusterId: azurerm_redis_enterprise_cluster.Example.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("redisEnterpriseDatabasePrimaryKey", example.PrimaryAccessKey) +// ctx.Export("redisEnterpriseDatabaseSecondaryKey", example.SecondaryAccessKey) +// return nil +// }) +// } +// +// ``` func LookupEnterpriseDatabase(ctx *pulumi.Context, args *LookupEnterpriseDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupEnterpriseDatabaseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupEnterpriseDatabaseResult diff --git a/sdk/go/azure/redis/linkedServer.go b/sdk/go/azure/redis/linkedServer.go index ebadf87368..75d10d7c4a 100644 --- a/sdk/go/azure/redis/linkedServer.go +++ b/sdk/go/azure/redis/linkedServer.go @@ -15,6 +15,81 @@ import ( // Manages a Redis Linked Server (ie Geo Location) // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := core.NewResourceGroup(ctx, "example-primaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// _, err = redis.NewCache(ctx, "example-primaryCache", &redis.CacheArgs{ +// Location: example_primaryResourceGroup.Location, +// ResourceGroupName: example_primaryResourceGroup.Name, +// Capacity: pulumi.Int(1), +// Family: pulumi.String("P"), +// SkuName: pulumi.String("Premium"), +// EnableNonSslPort: pulumi.Bool(false), +// RedisConfiguration: &redis.CacheRedisConfigurationArgs{ +// MaxmemoryReserved: pulumi.Int(2), +// MaxmemoryDelta: pulumi.Int(2), +// MaxmemoryPolicy: pulumi.String("allkeys-lru"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = core.NewResourceGroup(ctx, "example-secondaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// _, err = redis.NewCache(ctx, "example-secondaryCache", &redis.CacheArgs{ +// Location: example_secondaryResourceGroup.Location, +// ResourceGroupName: example_secondaryResourceGroup.Name, +// Capacity: pulumi.Int(1), +// Family: pulumi.String("P"), +// SkuName: pulumi.String("Premium"), +// EnableNonSslPort: pulumi.Bool(false), +// RedisConfiguration: &redis.CacheRedisConfigurationArgs{ +// MaxmemoryReserved: pulumi.Int(2), +// MaxmemoryDelta: pulumi.Int(2), +// MaxmemoryPolicy: pulumi.String("allkeys-lru"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = redis.NewLinkedServer(ctx, "example-link", &redis.LinkedServerArgs{ +// TargetRedisCacheName: example_primaryCache.Name, +// ResourceGroupName: example_primaryCache.ResourceGroupName, +// LinkedRedisCacheId: example_secondaryCache.ID(), +// LinkedRedisCacheLocation: example_secondaryCache.Location, +// ServerRole: pulumi.String("Secondary"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Redis can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/redis/pulumiTypes.go b/sdk/go/azure/redis/pulumiTypes.go index 936ae50084..17f276496e 100644 --- a/sdk/go/azure/redis/pulumiTypes.go +++ b/sdk/go/azure/redis/pulumiTypes.go @@ -387,6 +387,20 @@ type CacheRedisConfiguration struct { // Second Storage Account connection string for AOF persistence. // // Example usage: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` AofStorageConnectionString1 *string `pulumi:"aofStorageConnectionString1"` // If set to `false`, the Redis instance will be accessible without authentication. Defaults to `true`. // @@ -403,6 +417,20 @@ type CacheRedisConfiguration struct { // Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below. MaxmemoryReserved *int `pulumi:"maxmemoryReserved"` // Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` NotifyKeyspaceEvents *string `pulumi:"notifyKeyspaceEvents"` // Is Backup Enabled? Only supported on Premium SKUs. Defaults to `false`. // @@ -439,6 +467,20 @@ type CacheRedisConfigurationArgs struct { // Second Storage Account connection string for AOF persistence. // // Example usage: + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` AofStorageConnectionString1 pulumi.StringPtrInput `pulumi:"aofStorageConnectionString1"` // If set to `false`, the Redis instance will be accessible without authentication. Defaults to `true`. // @@ -455,6 +497,20 @@ type CacheRedisConfigurationArgs struct { // Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below. MaxmemoryReserved pulumi.IntPtrInput `pulumi:"maxmemoryReserved"` // Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + // + // ```go + // package main + // + // import ( + // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + // ) + // + // func main() { + // pulumi.Run(func(ctx *pulumi.Context) error { + // return nil + // }) + // } + // ``` NotifyKeyspaceEvents pulumi.StringPtrInput `pulumi:"notifyKeyspaceEvents"` // Is Backup Enabled? Only supported on Premium SKUs. Defaults to `false`. // @@ -580,6 +636,23 @@ func (o CacheRedisConfigurationOutput) AofStorageConnectionString0() pulumi.Stri // Second Storage Account connection string for AOF persistence. // // Example usage: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` func (o CacheRedisConfigurationOutput) AofStorageConnectionString1() pulumi.StringPtrOutput { return o.ApplyT(func(v CacheRedisConfiguration) *string { return v.AofStorageConnectionString1 }).(pulumi.StringPtrOutput) } @@ -617,6 +690,23 @@ func (o CacheRedisConfigurationOutput) MaxmemoryReserved() pulumi.IntPtrOutput { } // Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` func (o CacheRedisConfigurationOutput) NotifyKeyspaceEvents() pulumi.StringPtrOutput { return o.ApplyT(func(v CacheRedisConfiguration) *string { return v.NotifyKeyspaceEvents }).(pulumi.StringPtrOutput) } @@ -700,6 +790,23 @@ func (o CacheRedisConfigurationPtrOutput) AofStorageConnectionString0() pulumi.S // Second Storage Account connection string for AOF persistence. // // Example usage: +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` func (o CacheRedisConfigurationPtrOutput) AofStorageConnectionString1() pulumi.StringPtrOutput { return o.ApplyT(func(v *CacheRedisConfiguration) *string { if v == nil { @@ -772,6 +879,23 @@ func (o CacheRedisConfigurationPtrOutput) MaxmemoryReserved() pulumi.IntPtrOutpu } // Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// return nil +// }) +// } +// +// ``` func (o CacheRedisConfigurationPtrOutput) NotifyKeyspaceEvents() pulumi.StringPtrOutput { return o.ApplyT(func(v *CacheRedisConfiguration) *string { if v == nil { diff --git a/sdk/go/azure/relay/hybridConnection.go b/sdk/go/azure/relay/hybridConnection.go index 9f9095d14a..9d02c0da26 100644 --- a/sdk/go/azure/relay/hybridConnection.go +++ b/sdk/go/azure/relay/hybridConnection.go @@ -15,6 +15,53 @@ import ( // Manages an Azure Relay Hybrid Connection. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("managed"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = relay.NewHybridConnection(ctx, "exampleHybridConnection", &relay.HybridConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RelayNamespaceName: exampleNamespace.Name, +// RequiresClientAuthorization: pulumi.Bool(false), +// UserMetadata: pulumi.String("testmetadata"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Relay Hybrid Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/relay/hybridConnectionAuthorizationRule.go b/sdk/go/azure/relay/hybridConnectionAuthorizationRule.go index 809d31a693..ea43504095 100644 --- a/sdk/go/azure/relay/hybridConnectionAuthorizationRule.go +++ b/sdk/go/azure/relay/hybridConnectionAuthorizationRule.go @@ -15,6 +15,64 @@ import ( // Manages an Azure Relay Hybrid Connection Authorization Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("terraform"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleHybridConnection, err := relay.NewHybridConnection(ctx, "exampleHybridConnection", &relay.HybridConnectionArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// RelayNamespaceName: exampleNamespace.Name, +// RequiresClientAuthorization: pulumi.Bool(false), +// UserMetadata: pulumi.String("testmetadata"), +// }) +// if err != nil { +// return err +// } +// _, err = relay.NewHybridConnectionAuthorizationRule(ctx, "exampleHybridConnectionAuthorizationRule", &relay.HybridConnectionAuthorizationRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// HybridConnectionName: exampleHybridConnection.Name, +// NamespaceName: exampleNamespace.Name, +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Relay Hybrid Connection Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/relay/namespace.go b/sdk/go/azure/relay/namespace.go index 7f70cbd586..95a8c59db6 100644 --- a/sdk/go/azure/relay/namespace.go +++ b/sdk/go/azure/relay/namespace.go @@ -15,6 +15,44 @@ import ( // Manages an Azure Relay Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Relay Namespace's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/relay/namespaceAuthorizationRule.go b/sdk/go/azure/relay/namespaceAuthorizationRule.go index 4f769f4ad1..f9f8b33e0b 100644 --- a/sdk/go/azure/relay/namespaceAuthorizationRule.go +++ b/sdk/go/azure/relay/namespaceAuthorizationRule.go @@ -15,6 +15,54 @@ import ( // Manages an Azure Relay Namespace Authorization Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/relay" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := relay.NewNamespace(ctx, "exampleNamespace", &relay.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// SkuName: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("terraform"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = relay.NewNamespaceAuthorizationRule(ctx, "exampleNamespaceAuthorizationRule", &relay.NamespaceAuthorizationRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// NamespaceName: exampleNamespace.Name, +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Relay Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/role/assignment.go b/sdk/go/azure/role/assignment.go index 777f20a76c..7a1d8438ba 100644 --- a/sdk/go/azure/role/assignment.go +++ b/sdk/go/azure/role/assignment.go @@ -16,6 +16,214 @@ import ( // Assigns a given Principal (User or Group) to a given Role. // // ## Example Usage +// ### Using A Built-In Role) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionName: pulumi.String("Reader"), +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Custom Role & Service Principal) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.NewRoleDefinition(ctx, "exampleRoleDefinition", &authorization.RoleDefinitionArgs{ +// RoleDefinitionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Resources/subscriptions/resourceGroups/read"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Name: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionId: exampleRoleDefinition.RoleDefinitionResourceId, +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Custom Role & User) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.NewRoleDefinition(ctx, "exampleRoleDefinition", &authorization.RoleDefinitionArgs{ +// RoleDefinitionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Resources/subscriptions/resourceGroups/read"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Name: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// RoleDefinitionId: exampleRoleDefinition.RoleDefinitionResourceId, +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Custom Role & Management Group) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleClientConfig, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = management.LookupGroup(ctx, &management.LookupGroupArgs{ +// Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"), +// }, nil) +// if err != nil { +// return err +// } +// exampleRoleDefinition, err := authorization.NewRoleDefinition(ctx, "exampleRoleDefinition", &authorization.RoleDefinitionArgs{ +// RoleDefinitionId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: *pulumi.String(primary.Id), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Resources/subscriptions/resourceGroups/read"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = authorization.NewAssignment(ctx, "exampleAssignment", &authorization.AssignmentArgs{ +// Name: pulumi.String("00000000-0000-0000-0000-000000000000"), +// Scope: pulumi.Any(data.Azurerm_management_group.Primary.Id), +// RoleDefinitionId: exampleRoleDefinition.RoleDefinitionResourceId, +// PrincipalId: *pulumi.String(exampleClientConfig.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/role/definition.go b/sdk/go/azure/role/definition.go index ff0c1969ff..651540685b 100644 --- a/sdk/go/azure/role/definition.go +++ b/sdk/go/azure/role/definition.go @@ -15,6 +15,49 @@ import ( // Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.LookupSubscription(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = authorization.NewRoleDefinition(ctx, "example", &authorization.RoleDefinitionArgs{ +// Scope: *pulumi.String(primary.Id), +// Description: pulumi.String("This is a custom role created"), +// Permissions: authorization.RoleDefinitionPermissionArray{ +// &authorization.RoleDefinitionPermissionArgs{ +// Actions: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// NotActions: pulumi.StringArray{}, +// }, +// }, +// AssignableScopes: pulumi.StringArray{ +// *pulumi.String(primary.Id), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/search/getService.go b/sdk/go/azure/search/getService.go index b614be787a..c3bd354489 100644 --- a/sdk/go/azure/search/getService.go +++ b/sdk/go/azure/search/getService.go @@ -13,6 +13,37 @@ import ( ) // Manages a Search Service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/search" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _ = search.LookupServiceOutput(ctx, search.GetServiceOutputArgs{ +// Name: pulumi.String("example-search-service"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/search/service.go b/sdk/go/azure/search/service.go index 587847e09e..01d486e753 100644 --- a/sdk/go/azure/search/service.go +++ b/sdk/go/azure/search/service.go @@ -16,6 +16,111 @@ import ( // Manages a Search Service. // // ## Example Usage +// ### Supporting API Keys) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/search" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = search.NewService(ctx, "exampleService", &search.ServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Using Both AzureAD And API Keys) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/search" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = search.NewService(ctx, "exampleService", &search.ServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("standard"), +// LocalAuthenticationEnabled: pulumi.Bool(true), +// AuthenticationFailureMode: pulumi.String("http403"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Supporting Only AzureAD Authentication) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/search" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = search.NewService(ctx, "exampleService", &search.ServiceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("standard"), +// LocalAuthenticationEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/search/sharedPrivateLinkService.go b/sdk/go/azure/search/sharedPrivateLinkService.go index 3e86ff155e..970e6c81f0 100644 --- a/sdk/go/azure/search/sharedPrivateLinkService.go +++ b/sdk/go/azure/search/sharedPrivateLinkService.go @@ -15,6 +15,60 @@ import ( // Manages the Shared Private Link Service for an Azure Search Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/search" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testResourceGroup, err := core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// testService, err := search.NewService(ctx, "testService", &search.ServiceArgs{ +// ResourceGroupName: testResourceGroup.Name, +// Location: testResourceGroup.Location, +// Sku: pulumi.String("standard"), +// }) +// if err != nil { +// return err +// } +// testAccount, err := storage.NewAccount(ctx, "testAccount", &storage.AccountArgs{ +// ResourceGroupName: testResourceGroup.Name, +// Location: testResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = search.NewSharedPrivateLinkService(ctx, "testSharedPrivateLinkService", &search.SharedPrivateLinkServiceArgs{ +// SearchServiceId: testService.ID(), +// SubresourceName: pulumi.String("blob"), +// TargetResourceId: testAccount.ID(), +// RequestMessage: pulumi.String("please approve"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Search Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/advancedThreatProtection.go b/sdk/go/azure/securitycenter/advancedThreatProtection.go index 82249e8443..a96546d70d 100644 --- a/sdk/go/azure/securitycenter/advancedThreatProtection.go +++ b/sdk/go/azure/securitycenter/advancedThreatProtection.go @@ -15,6 +15,53 @@ import ( // Manages a resources Advanced Threat Protection setting. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = securitycenter.NewAdvancedThreatProtection(ctx, "exampleAdvancedThreatProtection", &securitycenter.AdvancedThreatProtectionArgs{ +// TargetResourceId: exampleAccount.ID(), +// Enabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Advanced Threat Protection can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/assessment.go b/sdk/go/azure/securitycenter/assessment.go index 9e829b6c2b..79e6574457 100644 --- a/sdk/go/azure/securitycenter/assessment.go +++ b/sdk/go/azure/securitycenter/assessment.go @@ -15,6 +15,122 @@ import ( // Manages the Security Center Assessment for Azure Security Center. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func readFileOrPanic(path string) pulumi.StringPtrInput { +// data, err := os.ReadFile(path) +// if err != nil { +// panic(err.Error()) +// } +// return pulumi.String(string(data)) +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachineScaleSet, err := compute.NewLinuxVirtualMachineScaleSet(ctx, "exampleLinuxVirtualMachineScaleSet", &compute.LinuxVirtualMachineScaleSetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: pulumi.String("Standard_F2"), +// Instances: pulumi.Int(1), +// AdminUsername: pulumi.String("adminuser"), +// AdminSshKeys: compute.LinuxVirtualMachineScaleSetAdminSshKeyArray{ +// &compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs{ +// Username: pulumi.String("adminuser"), +// PublicKey: readFileOrPanic("~/.ssh/id_rsa.pub"), +// }, +// }, +// SourceImageReference: &compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs{ +// Publisher: pulumi.String("Canonical"), +// Offer: pulumi.String("0001-com-ubuntu-server-focal"), +// Sku: pulumi.String("20_04-lts"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineScaleSetOsDiskArgs{ +// StorageAccountType: pulumi.String("Standard_LRS"), +// Caching: pulumi.String("ReadWrite"), +// }, +// NetworkInterfaces: compute.LinuxVirtualMachineScaleSetNetworkInterfaceArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs{ +// Name: pulumi.String("example"), +// Primary: pulumi.Bool(true), +// IpConfigurations: compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArray{ +// &compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("internal"), +// Primary: pulumi.Bool(true), +// SubnetId: internal.ID(), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleAssessmentPolicy, err := securitycenter.NewAssessmentPolicy(ctx, "exampleAssessmentPolicy", &securitycenter.AssessmentPolicyArgs{ +// DisplayName: pulumi.String("Test Display Name"), +// Severity: pulumi.String("Medium"), +// Description: pulumi.String("Test Description"), +// }) +// if err != nil { +// return err +// } +// _, err = securitycenter.NewAssessment(ctx, "exampleAssessment", &securitycenter.AssessmentArgs{ +// AssessmentPolicyId: exampleAssessmentPolicy.ID(), +// TargetResourceId: exampleLinuxVirtualMachineScaleSet.ID(), +// Status: &securitycenter.AssessmentStatusArgs{ +// Code: pulumi.String("Healthy"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Security Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/assessmentPolicy.go b/sdk/go/azure/securitycenter/assessmentPolicy.go index 254f9e3521..6534b3889a 100644 --- a/sdk/go/azure/securitycenter/assessmentPolicy.go +++ b/sdk/go/azure/securitycenter/assessmentPolicy.go @@ -15,6 +15,34 @@ import ( // Manages the Security Center Assessment Metadata for Azure Security Center. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := securitycenter.NewAssessmentPolicy(ctx, "example", &securitycenter.AssessmentPolicyArgs{ +// Description: pulumi.String("Test Description"), +// DisplayName: pulumi.String("Test Display Name"), +// Severity: pulumi.String("Medium"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Security Assessments Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/autoProvisioning.go b/sdk/go/azure/securitycenter/autoProvisioning.go index 70e2949010..c5066a61d9 100644 --- a/sdk/go/azure/securitycenter/autoProvisioning.go +++ b/sdk/go/azure/securitycenter/autoProvisioning.go @@ -17,6 +17,32 @@ import ( // // > **NOTE:** There is no resource name required, it will always be "default" // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := securitycenter.NewAutoProvisioning(ctx, "example", &securitycenter.AutoProvisioningArgs{ +// AutoProvision: pulumi.String("On"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Security Center Auto Provisioning can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/automation.go b/sdk/go/azure/securitycenter/automation.go index 11946ab1c2..56ebc48372 100644 --- a/sdk/go/azure/securitycenter/automation.go +++ b/sdk/go/azure/securitycenter/automation.go @@ -15,6 +15,103 @@ import ( // Manages Security Center Automation and Continuous Export. This resource supports three types of destination in the `action`, Logic Apps, Log Analytics and Event Hubs // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(2), +// }) +// if err != nil { +// return err +// } +// exampleAuthorizationRule, err := eventhub.NewAuthorizationRule(ctx, "exampleAuthorizationRule", &eventhub.AuthorizationRuleArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(false), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = securitycenter.NewAutomation(ctx, "exampleAutomation", &securitycenter.AutomationArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Actions: securitycenter.AutomationActionArray{ +// &securitycenter.AutomationActionArgs{ +// Type: pulumi.String("EventHub"), +// ResourceId: exampleEventHub.ID(), +// ConnectionString: exampleAuthorizationRule.PrimaryConnectionString, +// }, +// }, +// Sources: securitycenter.AutomationSourceArray{ +// &securitycenter.AutomationSourceArgs{ +// EventSource: pulumi.String("Alerts"), +// RuleSets: securitycenter.AutomationSourceRuleSetArray{ +// &securitycenter.AutomationSourceRuleSetArgs{ +// Rules: securitycenter.AutomationSourceRuleSetRuleArray{ +// &securitycenter.AutomationSourceRuleSetRuleArgs{ +// PropertyPath: pulumi.String("properties.metadata.severity"), +// Operator: pulumi.String("Equals"), +// ExpectedValue: pulumi.String("High"), +// PropertyType: pulumi.String("String"), +// }, +// }, +// }, +// }, +// }, +// }, +// Scopes: pulumi.StringArray{ +// pulumi.String(fmt.Sprintf("/subscriptions/%v", current.SubscriptionId)), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Security Center Automations can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/contact.go b/sdk/go/azure/securitycenter/contact.go index 33a128b8d9..fff022890e 100644 --- a/sdk/go/azure/securitycenter/contact.go +++ b/sdk/go/azure/securitycenter/contact.go @@ -17,6 +17,35 @@ import ( // // > **NOTE:** Owner access permission is required. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := securitycenter.NewContact(ctx, "example", &securitycenter.ContactArgs{ +// AlertNotifications: pulumi.Bool(true), +// AlertsToAdmins: pulumi.Bool(true), +// Email: pulumi.String("contact@example.com"), +// Phone: pulumi.String("+1-555-555-5555"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The contact can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/serverVulnerabilityAssessment.go b/sdk/go/azure/securitycenter/serverVulnerabilityAssessment.go index 34eaeeac66..8df6d5a52c 100644 --- a/sdk/go/azure/securitycenter/serverVulnerabilityAssessment.go +++ b/sdk/go/azure/securitycenter/serverVulnerabilityAssessment.go @@ -19,6 +19,99 @@ import ( // > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. // See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("vm-example"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Size: pulumi.String("Standard_B1s"), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// DisablePasswordAuthentication: pulumi.Bool(false), +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("OpenLogic"), +// Offer: pulumi.String("CentOS"), +// Sku: pulumi.String("7.5"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = securitycenter.NewServerVulnerabilityAssessment(ctx, "exampleServerVulnerabilityAssessment", &securitycenter.ServerVulnerabilityAssessmentArgs{ +// VirtualMachineId: exampleLinuxVirtualMachine.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/serverVulnerabilityAssessmentVirtualMachine.go b/sdk/go/azure/securitycenter/serverVulnerabilityAssessmentVirtualMachine.go index dadc207fe4..86cdb78c9f 100644 --- a/sdk/go/azure/securitycenter/serverVulnerabilityAssessmentVirtualMachine.go +++ b/sdk/go/azure/securitycenter/serverVulnerabilityAssessmentVirtualMachine.go @@ -18,6 +18,99 @@ import ( // > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. // See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "exampleNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("vm-example"), +// SubnetId: exampleSubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "exampleLinuxVirtualMachine", &compute.LinuxVirtualMachineArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Size: pulumi.String("Standard_B1s"), +// AdminUsername: pulumi.String("testadmin"), +// AdminPassword: pulumi.String("Password1234!"), +// DisablePasswordAuthentication: pulumi.Bool(false), +// SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{ +// Publisher: pulumi.String("OpenLogic"), +// Offer: pulumi.String("CentOS"), +// Sku: pulumi.String("7.5"), +// Version: pulumi.String("latest"), +// }, +// OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{ +// Caching: pulumi.String("ReadWrite"), +// StorageAccountType: pulumi.String("Standard_LRS"), +// }, +// NetworkInterfaceIds: pulumi.StringArray{ +// exampleNetworkInterface.ID(), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = securitycenter.NewServerVulnerabilityAssessmentVirtualMachine(ctx, "exampleServerVulnerabilityAssessmentVirtualMachine", &securitycenter.ServerVulnerabilityAssessmentVirtualMachineArgs{ +// VirtualMachineId: exampleLinuxVirtualMachine.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/setting.go b/sdk/go/azure/securitycenter/setting.go index e3e193ae08..e95d90adcf 100644 --- a/sdk/go/azure/securitycenter/setting.go +++ b/sdk/go/azure/securitycenter/setting.go @@ -19,6 +19,33 @@ import ( // // > **NOTE:** Deletion of this resource disables the setting. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := securitycenter.NewSetting(ctx, "example", &securitycenter.SettingArgs{ +// Enabled: pulumi.Bool(true), +// SettingName: pulumi.String("MCAS"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The setting can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/storageDefender.go b/sdk/go/azure/securitycenter/storageDefender.go index b07351df44..945d1b597e 100644 --- a/sdk/go/azure/securitycenter/storageDefender.go +++ b/sdk/go/azure/securitycenter/storageDefender.go @@ -15,6 +15,49 @@ import ( // Manages the Defender for Storage. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("westus2"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = securitycenter.NewStorageDefender(ctx, "exampleStorageDefender", &securitycenter.StorageDefenderArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The setting can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/securitycenter/subscriptionPricing.go b/sdk/go/azure/securitycenter/subscriptionPricing.go index 257aa5016f..2f56e98b7a 100644 --- a/sdk/go/azure/securitycenter/subscriptionPricing.go +++ b/sdk/go/azure/securitycenter/subscriptionPricing.go @@ -18,6 +18,75 @@ import ( // > **NOTE:** Deletion of this resource will reset the pricing tier to `Free` // // ## Example Usage +// ### Basic usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := securitycenter.NewSubscriptionPricing(ctx, "example", &securitycenter.SubscriptionPricingArgs{ +// ResourceType: pulumi.String("VirtualMachines"), +// Tier: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Using Extensions with Defender CSPM +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := securitycenter.NewSubscriptionPricing(ctx, "example1", &securitycenter.SubscriptionPricingArgs{ +// Extensions: securitycenter.SubscriptionPricingExtensionArray{ +// &securitycenter.SubscriptionPricingExtensionArgs{ +// Name: pulumi.String("ContainerRegistriesVulnerabilityAssessments"), +// }, +// &securitycenter.SubscriptionPricingExtensionArgs{ +// AdditionalExtensionProperties: pulumi.StringMap{ +// "ExclusionTags": pulumi.String("[]"), +// }, +// Name: pulumi.String("AgentlessVmScanning"), +// }, +// &securitycenter.SubscriptionPricingExtensionArgs{ +// Name: pulumi.String("AgentlessDiscoveryForKubernetes"), +// }, +// &securitycenter.SubscriptionPricingExtensionArgs{ +// Name: pulumi.String("SensitiveDataDiscovery"), +// }, +// }, +// ResourceType: pulumi.String("CloudPosture"), +// Tier: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/securitycenter/workspace.go b/sdk/go/azure/securitycenter/workspace.go index 8ebc13980f..3f4cb41996 100644 --- a/sdk/go/azure/securitycenter/workspace.go +++ b/sdk/go/azure/securitycenter/workspace.go @@ -17,6 +17,49 @@ import ( // // > **NOTE:** Owner access permission is required. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/securitycenter" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = securitycenter.NewWorkspace(ctx, "exampleWorkspace", &securitycenter.WorkspaceArgs{ +// Scope: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000"), +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // The contact can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleAnomalyBuiltIn.go b/sdk/go/azure/sentinel/alertRuleAnomalyBuiltIn.go index 6c1bab554f..b46f02cfe2 100644 --- a/sdk/go/azure/sentinel/alertRuleAnomalyBuiltIn.go +++ b/sdk/go/azure/sentinel/alertRuleAnomalyBuiltIn.go @@ -13,6 +13,62 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumix" ) +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// CustomerManagedKeyEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _ = sentinel.GetAlertRuleAnomalyOutput(ctx, sentinel.GetAlertRuleAnomalyOutputArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("Potential data staging"), +// }, nil) +// _, err = sentinel.NewAlertRuleAnomalyBuiltIn(ctx, "exampleAlertRuleAnomalyBuiltIn", &sentinel.AlertRuleAnomalyBuiltInArgs{ +// DisplayName: pulumi.String("Potential data staging"), +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// Mode: pulumi.String("Production"), +// Enabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleAnomalyDuplicate.go b/sdk/go/azure/sentinel/alertRuleAnomalyDuplicate.go index 6f17d5f514..24d4873e01 100644 --- a/sdk/go/azure/sentinel/alertRuleAnomalyDuplicate.go +++ b/sdk/go/azure/sentinel/alertRuleAnomalyDuplicate.go @@ -15,6 +15,71 @@ import ( // Manages a Duplicated Anomaly Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// CustomerManagedKeyEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// exampleAlertRuleAnomaly := sentinel.GetAlertRuleAnomalyOutput(ctx, sentinel.GetAlertRuleAnomalyOutputArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("UEBA Anomalous Sign In"), +// }, nil) +// _, err = sentinel.NewAlertRuleAnomalyDuplicate(ctx, "exampleAlertRuleAnomalyDuplicate", &sentinel.AlertRuleAnomalyDuplicateArgs{ +// DisplayName: pulumi.String("example duplicated UEBA Anomalous Sign In"), +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// BuiltInRuleId: exampleAlertRuleAnomaly.ApplyT(func(exampleAlertRuleAnomaly sentinel.GetAlertRuleAnomalyResult) (*string, error) { +// return &exampleAlertRuleAnomaly.Id, nil +// }).(pulumi.StringPtrOutput), +// Enabled: pulumi.Bool(true), +// Mode: pulumi.String("Flighting"), +// ThresholdObservations: sentinel.AlertRuleAnomalyDuplicateThresholdObservationArray{ +// &sentinel.AlertRuleAnomalyDuplicateThresholdObservationArgs{ +// Name: pulumi.String("Anomaly score threshold"), +// Value: pulumi.String("0.6"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleFusion.go b/sdk/go/azure/sentinel/alertRuleFusion.go index 51da889332..9166780ea5 100644 --- a/sdk/go/azure/sentinel/alertRuleFusion.go +++ b/sdk/go/azure/sentinel/alertRuleFusion.go @@ -15,6 +15,63 @@ import ( // Manages a Sentinel Fusion Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsSolution, err := operationalinsights.NewAnalyticsSolution(ctx, "exampleAnalyticsSolution", &operationalinsights.AnalyticsSolutionArgs{ +// SolutionName: pulumi.String("SecurityInsights"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// Plan: &operationalinsights.AnalyticsSolutionPlanArgs{ +// Publisher: pulumi.String("Microsoft"), +// Product: pulumi.String("OMSGallery/SecurityInsights"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewAlertRuleFusion(ctx, "exampleAlertRuleFusion", &sentinel.AlertRuleFusionArgs{ +// LogAnalyticsWorkspaceId: exampleAnalyticsSolution.WorkspaceResourceId, +// AlertRuleTemplateGuid: pulumi.String("f71aba3d-28fb-450b-b192-4e76a83015c8"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Fusion Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleMachineLearningBehaviorAnalytics.go b/sdk/go/azure/sentinel/alertRuleMachineLearningBehaviorAnalytics.go index 3f4a8f2f44..28c5a1e8e2 100644 --- a/sdk/go/azure/sentinel/alertRuleMachineLearningBehaviorAnalytics.go +++ b/sdk/go/azure/sentinel/alertRuleMachineLearningBehaviorAnalytics.go @@ -15,6 +15,55 @@ import ( // Manages a Sentinel Machine Learning Behavior Analytics Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewAlertRuleMachineLearningBehaviorAnalytics(ctx, "exampleAlertRuleMachineLearningBehaviorAnalytics", &sentinel.AlertRuleMachineLearningBehaviorAnalyticsArgs{ +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(), +// AlertRuleTemplateGuid: pulumi.String("737a2ce1-70a3-4968-9e90-3e6aca836abf"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Machine Learning Behavior Analytics Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleMsSecurityIncident.go b/sdk/go/azure/sentinel/alertRuleMsSecurityIncident.go index fc10fe090b..6d193d68a3 100644 --- a/sdk/go/azure/sentinel/alertRuleMsSecurityIncident.go +++ b/sdk/go/azure/sentinel/alertRuleMsSecurityIncident.go @@ -15,6 +15,59 @@ import ( // Manages a Sentinel MS Security Incident Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewAlertRuleMsSecurityIncident(ctx, "exampleAlertRuleMsSecurityIncident", &sentinel.AlertRuleMsSecurityIncidentArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// ProductFilter: pulumi.String("Microsoft Cloud App Security"), +// DisplayName: pulumi.String("example rule"), +// SeverityFilters: pulumi.StringArray{ +// pulumi.String("High"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel MS Security Incident Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleNrt.go b/sdk/go/azure/sentinel/alertRuleNrt.go index f47c6077ed..3b7ceacc8b 100644 --- a/sdk/go/azure/sentinel/alertRuleNrt.go +++ b/sdk/go/azure/sentinel/alertRuleNrt.go @@ -15,6 +15,57 @@ import ( // Manages a Sentinel NRT Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("pergb2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewAlertRuleNrt(ctx, "exampleAlertRuleNrt", &sentinel.AlertRuleNrtArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("example"), +// Severity: pulumi.String("High"), +// Query: pulumi.String("AzureActivity |\n where OperationName == \"Create or Update Virtual Machine\" or OperationName ==\"Create Deployment\" |\n where ActivityStatus == \"Succeeded\" |\n make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller\n"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel NRT Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleScheduled.go b/sdk/go/azure/sentinel/alertRuleScheduled.go index abb2ac4512..1395d43118 100644 --- a/sdk/go/azure/sentinel/alertRuleScheduled.go +++ b/sdk/go/azure/sentinel/alertRuleScheduled.go @@ -15,6 +15,57 @@ import ( // Manages a Sentinel Scheduled Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewAlertRuleScheduled(ctx, "exampleAlertRuleScheduled", &sentinel.AlertRuleScheduledArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("example"), +// Severity: pulumi.String("High"), +// Query: pulumi.String("AzureActivity |\n where OperationName == \"Create or Update Virtual Machine\" or OperationName ==\"Create Deployment\" |\n where ActivityStatus == \"Succeeded\" |\n make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller\n"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Scheduled Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/alertRuleThreatIntelligence.go b/sdk/go/azure/sentinel/alertRuleThreatIntelligence.go index 583b68f9bf..7800533d2c 100644 --- a/sdk/go/azure/sentinel/alertRuleThreatIntelligence.go +++ b/sdk/go/azure/sentinel/alertRuleThreatIntelligence.go @@ -15,6 +15,69 @@ import ( // Manages a Sentinel Threat Intelligence Alert Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("pergb2018"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsSolution, err := operationalinsights.NewAnalyticsSolution(ctx, "exampleAnalyticsSolution", &operationalinsights.AnalyticsSolutionArgs{ +// SolutionName: pulumi.String("SecurityInsights"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// Plan: &operationalinsights.AnalyticsSolutionPlanArgs{ +// Publisher: pulumi.String("Microsoft"), +// Product: pulumi.String("OMSGallery/SecurityInsights"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAlertRuleTemplate := sentinel.GetAlertRuleTemplateOutput(ctx, sentinel.GetAlertRuleTemplateOutputArgs{ +// DisplayName: pulumi.String("(Preview) Microsoft Defender Threat Intelligence Analytics"), +// LogAnalyticsWorkspaceId: exampleAnalyticsSolution.WorkspaceResourceId, +// }, nil) +// _, err = sentinel.NewAlertRuleThreatIntelligence(ctx, "exampleAlertRuleThreatIntelligence", &sentinel.AlertRuleThreatIntelligenceArgs{ +// LogAnalyticsWorkspaceId: exampleAnalyticsSolution.WorkspaceResourceId, +// AlertRuleTemplateGuid: exampleAlertRuleTemplate.ApplyT(func(exampleAlertRuleTemplate sentinel.GetAlertRuleTemplateResult) (*string, error) { +// return &exampleAlertRuleTemplate.Name, nil +// }).(pulumi.StringPtrOutput), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Threat Intelligence Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/authomationRule.go b/sdk/go/azure/sentinel/authomationRule.go index 7a4b2e6677..ab0c3ae577 100644 --- a/sdk/go/azure/sentinel/authomationRule.go +++ b/sdk/go/azure/sentinel/authomationRule.go @@ -15,6 +15,62 @@ import ( // Manages a Sentinel Automation Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewAutomationRule(ctx, "exampleAutomationRule", &sentinel.AutomationRuleArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("automation_rule1"), +// Order: pulumi.Int(1), +// ActionIncidents: sentinel.AutomationRuleActionIncidentArray{ +// &sentinel.AutomationRuleActionIncidentArgs{ +// Order: pulumi.Int(1), +// Status: pulumi.String("Active"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/automationRule.go b/sdk/go/azure/sentinel/automationRule.go index d6dedf4a21..58ecc016bc 100644 --- a/sdk/go/azure/sentinel/automationRule.go +++ b/sdk/go/azure/sentinel/automationRule.go @@ -15,6 +15,62 @@ import ( // Manages a Sentinel Automation Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewAutomationRule(ctx, "exampleAutomationRule", &sentinel.AutomationRuleArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("automation_rule1"), +// Order: pulumi.Int(1), +// ActionIncidents: sentinel.AutomationRuleActionIncidentArray{ +// &sentinel.AutomationRuleActionIncidentArgs{ +// Order: pulumi.Int(1), +// Status: pulumi.String("Active"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorAwsCloudTrail.go b/sdk/go/azure/sentinel/dataConnectorAwsCloudTrail.go index 0a9602861f..2f722dd2e8 100644 --- a/sdk/go/azure/sentinel/dataConnectorAwsCloudTrail.go +++ b/sdk/go/azure/sentinel/dataConnectorAwsCloudTrail.go @@ -15,6 +15,55 @@ import ( // Manages a AWS CloudTrail Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorAwsCloudTrail(ctx, "exampleDataConnectorAwsCloudTrail", &sentinel.DataConnectorAwsCloudTrailArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// AwsRoleArn: pulumi.String("arn:aws:iam::000000000000:role/role1"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // AWS CloudTrail Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorAwsS3.go b/sdk/go/azure/sentinel/dataConnectorAwsS3.go index de4de2a3b8..ec782e3abd 100644 --- a/sdk/go/azure/sentinel/dataConnectorAwsS3.go +++ b/sdk/go/azure/sentinel/dataConnectorAwsS3.go @@ -15,6 +15,59 @@ import ( // Manages a AWS S3 Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorAwsS3(ctx, "exampleDataConnectorAwsS3", &sentinel.DataConnectorAwsS3Args{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// AwsRoleArn: pulumi.String("arn:aws:iam::000000000000:role/role1"), +// DestinationTable: pulumi.String("AWSGuardDuty"), +// SqsUrls: pulumi.StringArray{ +// pulumi.String("https://sqs.us-east-1.amazonaws.com/000000000000/example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // AWS S3 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorAzureActiveDirectory.go b/sdk/go/azure/sentinel/dataConnectorAzureActiveDirectory.go index 219490bb50..f2d2bd430c 100644 --- a/sdk/go/azure/sentinel/dataConnectorAzureActiveDirectory.go +++ b/sdk/go/azure/sentinel/dataConnectorAzureActiveDirectory.go @@ -15,6 +15,54 @@ import ( // Manages a Azure Active Directory Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorAzureActiveDirectory(ctx, "exampleDataConnectorAzureActiveDirectory", &sentinel.DataConnectorAzureActiveDirectoryArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Active Directory Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorAzureAdvancedThreadProtection.go b/sdk/go/azure/sentinel/dataConnectorAzureAdvancedThreadProtection.go index 1de4bb8e61..7263e09a7a 100644 --- a/sdk/go/azure/sentinel/dataConnectorAzureAdvancedThreadProtection.go +++ b/sdk/go/azure/sentinel/dataConnectorAzureAdvancedThreadProtection.go @@ -17,6 +17,54 @@ import ( // // !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorAzureAdvancedThreadProtection(ctx, "exampleDataConnectorAzureAdvancedThreadProtection", &sentinel.DataConnectorAzureAdvancedThreadProtectionArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorAzureSecurityCenter.go b/sdk/go/azure/sentinel/dataConnectorAzureSecurityCenter.go index 0f5caadaf8..95a7682014 100644 --- a/sdk/go/azure/sentinel/dataConnectorAzureSecurityCenter.go +++ b/sdk/go/azure/sentinel/dataConnectorAzureSecurityCenter.go @@ -15,6 +15,54 @@ import ( // Manages a Azure Security Center Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorAzureSecurityCenter(ctx, "exampleDataConnectorAzureSecurityCenter", &sentinel.DataConnectorAzureSecurityCenterArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Security Center Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorDynamics365.go b/sdk/go/azure/sentinel/dataConnectorDynamics365.go index 3e3edc85d0..60a1ed741a 100644 --- a/sdk/go/azure/sentinel/dataConnectorDynamics365.go +++ b/sdk/go/azure/sentinel/dataConnectorDynamics365.go @@ -15,6 +15,54 @@ import ( // Manages a Dynamics 365 Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorDynamics365(ctx, "exampleDataConnectorDynamics365", &sentinel.DataConnectorDynamics365Args{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Dynamics 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorIot.go b/sdk/go/azure/sentinel/dataConnectorIot.go index 62800019f3..120f593019 100644 --- a/sdk/go/azure/sentinel/dataConnectorIot.go +++ b/sdk/go/azure/sentinel/dataConnectorIot.go @@ -15,6 +15,54 @@ import ( // Manages an Iot Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorIot(ctx, "exampleDataConnectorIot", &sentinel.DataConnectorIotArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Iot Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorMicrosoftCloudAppSecurity.go b/sdk/go/azure/sentinel/dataConnectorMicrosoftCloudAppSecurity.go index 3a761dd959..1f55cf1674 100644 --- a/sdk/go/azure/sentinel/dataConnectorMicrosoftCloudAppSecurity.go +++ b/sdk/go/azure/sentinel/dataConnectorMicrosoftCloudAppSecurity.go @@ -17,6 +17,54 @@ import ( // // !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorMicrosoftCloudAppSecurity(ctx, "exampleDataConnectorMicrosoftCloudAppSecurity", &sentinel.DataConnectorMicrosoftCloudAppSecurityArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Microsoft Cloud App Security Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.go b/sdk/go/azure/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.go index 253fa8b8d0..4057b55bff 100644 --- a/sdk/go/azure/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.go +++ b/sdk/go/azure/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.go @@ -15,6 +15,54 @@ import ( // Manages a Microsoft Defender Advanced Threat Protection Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorMicrosoftDefenderAdvancedThreatProtection(ctx, "exampleDataConnectorMicrosoftDefenderAdvancedThreatProtection", &sentinel.DataConnectorMicrosoftDefenderAdvancedThreatProtectionArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Microsoft Defender Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatIntelligence.go b/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatIntelligence.go index 7518af6f74..847f1f0a02 100644 --- a/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatIntelligence.go +++ b/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatIntelligence.go @@ -15,6 +15,55 @@ import ( // Manages a Microsoft Threat Intelligence Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorMicrosoftThreatIntelligence(ctx, "exampleDataConnectorMicrosoftThreatIntelligence", &sentinel.DataConnectorMicrosoftThreatIntelligenceArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// MicrosoftEmergingThreatFeedLookbackDate: pulumi.String("1970-01-01T00:00:00Z"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // sentinels can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatProtection.go b/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatProtection.go index 6c4f90dccf..036d98ae70 100644 --- a/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatProtection.go +++ b/sdk/go/azure/sentinel/dataConnectorMicrosoftThreatProtection.go @@ -15,6 +15,54 @@ import ( // Manages a Microsoft Threat Protection Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorMicrosoftThreatProtection(ctx, "exampleDataConnectorMicrosoftThreatProtection", &sentinel.DataConnectorMicrosoftThreatProtectionArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Microsoft Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorOffice365.go b/sdk/go/azure/sentinel/dataConnectorOffice365.go index e6edcff89f..5b846eb617 100644 --- a/sdk/go/azure/sentinel/dataConnectorOffice365.go +++ b/sdk/go/azure/sentinel/dataConnectorOffice365.go @@ -15,6 +15,54 @@ import ( // Manages a Office 365 Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorOffice365(ctx, "exampleDataConnectorOffice365", &sentinel.DataConnectorOffice365Args{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Office 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorOffice365Project.go b/sdk/go/azure/sentinel/dataConnectorOffice365Project.go index 06af58d355..b44eee684a 100644 --- a/sdk/go/azure/sentinel/dataConnectorOffice365Project.go +++ b/sdk/go/azure/sentinel/dataConnectorOffice365Project.go @@ -15,6 +15,54 @@ import ( // Manages an Office 365 Project Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorOffice365Project(ctx, "exampleDataConnectorOffice365Project", &sentinel.DataConnectorOffice365ProjectArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Office 365 Project Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorOfficeAtp.go b/sdk/go/azure/sentinel/dataConnectorOfficeAtp.go index 35322e6df0..f1aaea4c4f 100644 --- a/sdk/go/azure/sentinel/dataConnectorOfficeAtp.go +++ b/sdk/go/azure/sentinel/dataConnectorOfficeAtp.go @@ -15,6 +15,54 @@ import ( // Manages a Office ATP Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorOfficeAtp(ctx, "exampleDataConnectorOfficeAtp", &sentinel.DataConnectorOfficeAtpArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Office ATP Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorOfficeIrm.go b/sdk/go/azure/sentinel/dataConnectorOfficeIrm.go index 0a7861df95..a9819c8b61 100644 --- a/sdk/go/azure/sentinel/dataConnectorOfficeIrm.go +++ b/sdk/go/azure/sentinel/dataConnectorOfficeIrm.go @@ -15,6 +15,54 @@ import ( // Manages an Office IRM Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorOfficeIrm(ctx, "exampleDataConnectorOfficeIrm", &sentinel.DataConnectorOfficeIrmArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Office IRM Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorOfficePowerBi.go b/sdk/go/azure/sentinel/dataConnectorOfficePowerBi.go index c813e079fd..d4df44ec83 100644 --- a/sdk/go/azure/sentinel/dataConnectorOfficePowerBi.go +++ b/sdk/go/azure/sentinel/dataConnectorOfficePowerBi.go @@ -15,6 +15,54 @@ import ( // Manages an Office Power BI Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorOfficePowerBi(ctx, "exampleDataConnectorOfficePowerBi", &sentinel.DataConnectorOfficePowerBiArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Office Power BI Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorThreatIntelligence.go b/sdk/go/azure/sentinel/dataConnectorThreatIntelligence.go index 952a94b98a..8d035afd07 100644 --- a/sdk/go/azure/sentinel/dataConnectorThreatIntelligence.go +++ b/sdk/go/azure/sentinel/dataConnectorThreatIntelligence.go @@ -15,6 +15,54 @@ import ( // Manages a Threat Intelligence Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorThreatIntelligence(ctx, "exampleDataConnectorThreatIntelligence", &sentinel.DataConnectorThreatIntelligenceArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Threat Intelligence Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/dataConnectorThreatIntelligenceTaxii.go b/sdk/go/azure/sentinel/dataConnectorThreatIntelligenceTaxii.go index b8b32e4451..4c4fd266fd 100644 --- a/sdk/go/azure/sentinel/dataConnectorThreatIntelligenceTaxii.go +++ b/sdk/go/azure/sentinel/dataConnectorThreatIntelligenceTaxii.go @@ -15,6 +15,57 @@ import ( // Manages an Threat Intelligence TAXII Data Connector. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewDataConnectorThreatIntelligenceTaxii(ctx, "exampleDataConnectorThreatIntelligenceTaxii", &sentinel.DataConnectorThreatIntelligenceTaxiiArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("example"), +// ApiRootUrl: pulumi.String("https://foo/taxii2/api2/"), +// CollectionId: pulumi.String("someid"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Threat Intelligence TAXII Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/getAlertRule.go b/sdk/go/azure/sentinel/getAlertRule.go index 9af28e64c6..87c738e945 100644 --- a/sdk/go/azure/sentinel/getAlertRule.go +++ b/sdk/go/azure/sentinel/getAlertRule.go @@ -13,6 +13,42 @@ import ( ) // Use this data source to access information about an existing Sentinel Alert Rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAnalyticsWorkspace, err := operationalinsights.LookupAnalyticsWorkspace(ctx, &operationalinsights.LookupAnalyticsWorkspaceArgs{ +// Name: "example", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleAlertRule, err := sentinel.GetAlertRule(ctx, &sentinel.GetAlertRuleArgs{ +// Name: "existing", +// LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", exampleAlertRule.Id) +// return nil +// }) +// } +// +// ``` func GetAlertRule(ctx *pulumi.Context, args *GetAlertRuleArgs, opts ...pulumi.InvokeOption) (*GetAlertRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAlertRuleResult diff --git a/sdk/go/azure/sentinel/getAlertRuleAnomaly.go b/sdk/go/azure/sentinel/getAlertRuleAnomaly.go index 1a5ee07cec..b1cf903a62 100644 --- a/sdk/go/azure/sentinel/getAlertRuleAnomaly.go +++ b/sdk/go/azure/sentinel/getAlertRuleAnomaly.go @@ -13,6 +13,56 @@ import ( ) // Use this data source to access information about an existing Anomaly Alert Rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// CustomerManagedKeyEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// exampleAlertRuleAnomaly := sentinel.GetAlertRuleAnomalyOutput(ctx, sentinel.GetAlertRuleAnomalyOutputArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("Potential data staging"), +// }, nil) +// ctx.Export("id", exampleAlertRuleAnomaly.ApplyT(func(exampleAlertRuleAnomaly sentinel.GetAlertRuleAnomalyResult) (*string, error) { +// return &exampleAlertRuleAnomaly.Id, nil +// }).(pulumi.StringPtrOutput)) +// return nil +// }) +// } +// +// ``` func GetAlertRuleAnomaly(ctx *pulumi.Context, args *GetAlertRuleAnomalyArgs, opts ...pulumi.InvokeOption) (*GetAlertRuleAnomalyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAlertRuleAnomalyResult diff --git a/sdk/go/azure/sentinel/getAlertRuleTemplate.go b/sdk/go/azure/sentinel/getAlertRuleTemplate.go index f7d228c4f1..358d638098 100644 --- a/sdk/go/azure/sentinel/getAlertRuleTemplate.go +++ b/sdk/go/azure/sentinel/getAlertRuleTemplate.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Sentinel Alert Rule Template. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := sentinel.GetAlertRuleTemplate(ctx, &sentinel.GetAlertRuleTemplateArgs{ +// LogAnalyticsWorkspaceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", +// DisplayName: pulumi.StringRef("Create incidents based on Azure Security Center for IoT alerts"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetAlertRuleTemplate(ctx *pulumi.Context, args *GetAlertRuleTemplateArgs, opts ...pulumi.InvokeOption) (*GetAlertRuleTemplateResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAlertRuleTemplateResult diff --git a/sdk/go/azure/sentinel/logAnalyticsWorkspaceOnboarding.go b/sdk/go/azure/sentinel/logAnalyticsWorkspaceOnboarding.go index 839e409741..afce529aa7 100644 --- a/sdk/go/azure/sentinel/logAnalyticsWorkspaceOnboarding.go +++ b/sdk/go/azure/sentinel/logAnalyticsWorkspaceOnboarding.go @@ -14,6 +14,50 @@ import ( // Manages a Security Insights Sentinel Onboarding. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// CustomerManagedKeyEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Security Insights Sentinel Onboarding States can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/metadata.go b/sdk/go/azure/sentinel/metadata.go index 4734be4cc4..a01f7832b4 100644 --- a/sdk/go/azure/sentinel/metadata.go +++ b/sdk/go/azure/sentinel/metadata.go @@ -15,6 +15,74 @@ import ( // Manages a Sentinel Metadata. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("pergb2018"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsSolution, err := operationalinsights.NewAnalyticsSolution(ctx, "exampleAnalyticsSolution", &operationalinsights.AnalyticsSolutionArgs{ +// SolutionName: pulumi.String("SecurityInsights"), +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceResourceId: exampleAnalyticsWorkspace.ID(), +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// Plan: &operationalinsights.AnalyticsSolutionPlanArgs{ +// Publisher: pulumi.String("Microsoft"), +// Product: pulumi.String("OMSGallery/SecurityInsights"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAlertRuleNrt, err := sentinel.NewAlertRuleNrt(ctx, "exampleAlertRuleNrt", &sentinel.AlertRuleNrtArgs{ +// LogAnalyticsWorkspaceId: exampleAnalyticsSolution.WorkspaceResourceId, +// DisplayName: pulumi.String("example"), +// Severity: pulumi.String("High"), +// Query: pulumi.String("AzureActivity |\n where OperationName == \"Create or Update Virtual Machine\" or OperationName ==\"Create Deployment\" |\n where ActivityStatus == \"Succeeded\" |\n make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller\n"), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewMetadata(ctx, "exampleMetadata", &sentinel.MetadataArgs{ +// WorkspaceId: exampleAnalyticsSolution.WorkspaceResourceId, +// ContentId: exampleAlertRuleNrt.Name, +// Kind: pulumi.String("AnalyticsRule"), +// ParentId: exampleAlertRuleNrt.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Metadata can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/threatIntelligenceIndicator.go b/sdk/go/azure/sentinel/threatIntelligenceIndicator.go index 407c3c8d65..b774bad44d 100644 --- a/sdk/go/azure/sentinel/threatIntelligenceIndicator.go +++ b/sdk/go/azure/sentinel/threatIntelligenceIndicator.go @@ -15,6 +15,63 @@ import ( // Manages a Sentinel Threat Intelligence Indicator. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// RetentionInDays: pulumi.Int(30), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// WorkspaceName: exampleAnalyticsWorkspace.Name, +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewThreatIntelligenceIndicator(ctx, "exampleThreatIntelligenceIndicator", &sentinel.ThreatIntelligenceIndicatorArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// PatternType: pulumi.String("domain-name"), +// Pattern: pulumi.String("http://example.com"), +// Source: pulumi.String("Microsoft Sentinel"), +// ValidateFromUtc: pulumi.String("2022-12-14T16:00:00Z"), +// DisplayName: pulumi.String("example-indicator"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// azurerm_sentinel_log_analytics_workspace_onboarding.Test, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Threat Intelligence Indicators can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/watchlist.go b/sdk/go/azure/sentinel/watchlist.go index 574cfab2e0..053dd33ef9 100644 --- a/sdk/go/azure/sentinel/watchlist.go +++ b/sdk/go/azure/sentinel/watchlist.go @@ -15,6 +15,56 @@ import ( // Manages a Sentinel Watchlist. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewWatchlist(ctx, "exampleWatchlist", &sentinel.WatchlistArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("example-wl"), +// ItemSearchKey: pulumi.String("Key"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Watchlists can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sentinel/watchlistItem.go b/sdk/go/azure/sentinel/watchlistItem.go index 8e8319843e..de77472d68 100644 --- a/sdk/go/azure/sentinel/watchlistItem.go +++ b/sdk/go/azure/sentinel/watchlistItem.go @@ -15,6 +15,66 @@ import ( // Manages a Sentinel Watchlist Item. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("PerGB2018"), +// }) +// if err != nil { +// return err +// } +// exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "exampleLogAnalyticsWorkspaceOnboarding", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{ +// WorkspaceId: exampleAnalyticsWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWatchlist, err := sentinel.NewWatchlist(ctx, "exampleWatchlist", &sentinel.WatchlistArgs{ +// LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId, +// DisplayName: pulumi.String("example-wl"), +// ItemSearchKey: pulumi.String("Key"), +// }) +// if err != nil { +// return err +// } +// _, err = sentinel.NewWatchlistItem(ctx, "exampleWatchlistItem", &sentinel.WatchlistItemArgs{ +// WatchlistId: exampleWatchlist.ID(), +// Properties: pulumi.StringMap{ +// "k1": pulumi.String("v1"), +// "k2": pulumi.String("v2"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Sentinel Watchlist Items can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/getNamespace.go b/sdk/go/azure/servicebus/getNamespace.go index 342a9adb17..10352765a8 100644 --- a/sdk/go/azure/servicebus/getNamespace.go +++ b/sdk/go/azure/servicebus/getNamespace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing ServiceBus Namespace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := servicebus.LookupNamespace(ctx, &servicebus.LookupNamespaceArgs{ +// Name: "examplenamespace", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("location", example.Location) +// return nil +// }) +// } +// +// ``` func LookupNamespace(ctx *pulumi.Context, args *LookupNamespaceArgs, opts ...pulumi.InvokeOption) (*LookupNamespaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNamespaceResult diff --git a/sdk/go/azure/servicebus/getNamespaceAuthorizationRule.go b/sdk/go/azure/servicebus/getNamespaceAuthorizationRule.go index 11dbb35719..53bffbd363 100644 --- a/sdk/go/azure/servicebus/getNamespaceAuthorizationRule.go +++ b/sdk/go/azure/servicebus/getNamespaceAuthorizationRule.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing ServiceBus Namespace Authorization Rule. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := servicebus.LookupNamespaceAuthorizationRule(ctx, &servicebus.LookupNamespaceAuthorizationRuleArgs{ +// Name: "examplerule", +// NamespaceId: pulumi.StringRef("examplenamespace"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("ruleId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupNamespaceAuthorizationRule(ctx *pulumi.Context, args *LookupNamespaceAuthorizationRuleArgs, opts ...pulumi.InvokeOption) (*LookupNamespaceAuthorizationRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupNamespaceAuthorizationRuleResult diff --git a/sdk/go/azure/servicebus/getQueue.go b/sdk/go/azure/servicebus/getQueue.go index 7f8a4fc90b..0e2eb486a2 100644 --- a/sdk/go/azure/servicebus/getQueue.go +++ b/sdk/go/azure/servicebus/getQueue.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Service Bus Queue. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := servicebus.LookupQueue(ctx, &servicebus.LookupQueueArgs{ +// Name: "existing", +// NamespaceId: pulumi.StringRef("existing"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupQueue(ctx *pulumi.Context, args *LookupQueueArgs, opts ...pulumi.InvokeOption) (*LookupQueueResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupQueueResult diff --git a/sdk/go/azure/servicebus/getQueueAuthorizationRule.go b/sdk/go/azure/servicebus/getQueueAuthorizationRule.go index 408aaa1839..628d6e42e0 100644 --- a/sdk/go/azure/servicebus/getQueueAuthorizationRule.go +++ b/sdk/go/azure/servicebus/getQueueAuthorizationRule.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about an existing ServiceBus Queue Authorisation Rule within a ServiceBus Queue. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := servicebus.LookupQueueAuthorizationRule(ctx, &servicebus.LookupQueueAuthorizationRuleArgs{ +// Name: "example-tfex_name", +// ResourceGroupName: pulumi.StringRef("example-resources"), +// QueueName: pulumi.StringRef("example-servicebus_queue"), +// NamespaceName: pulumi.StringRef("example-namespace"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupQueueAuthorizationRule(ctx *pulumi.Context, args *LookupQueueAuthorizationRuleArgs, opts ...pulumi.InvokeOption) (*LookupQueueAuthorizationRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupQueueAuthorizationRuleResult diff --git a/sdk/go/azure/servicebus/getSubscription.go b/sdk/go/azure/servicebus/getSubscription.go index 38e7eec818..5d207e301e 100644 --- a/sdk/go/azure/servicebus/getSubscription.go +++ b/sdk/go/azure/servicebus/getSubscription.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing ServiceBus Subscription. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := servicebus.LookupSubscription(ctx, &servicebus.LookupSubscriptionArgs{ +// Name: "examplesubscription", +// TopicId: pulumi.StringRef("exampletopic"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("servicebusSubscription", data.Azurerm_servicebus_namespace.Example) +// return nil +// }) +// } +// +// ``` func LookupSubscription(ctx *pulumi.Context, args *LookupSubscriptionArgs, opts ...pulumi.InvokeOption) (*LookupSubscriptionResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSubscriptionResult diff --git a/sdk/go/azure/servicebus/getTopic.go b/sdk/go/azure/servicebus/getTopic.go index 784296a5fc..1530f47beb 100644 --- a/sdk/go/azure/servicebus/getTopic.go +++ b/sdk/go/azure/servicebus/getTopic.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Service Bus Topic. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := servicebus.LookupTopic(ctx, &servicebus.LookupTopicArgs{ +// Name: "existing", +// NamespaceId: pulumi.StringRef("existing"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupTopic(ctx *pulumi.Context, args *LookupTopicArgs, opts ...pulumi.InvokeOption) (*LookupTopicResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTopicResult diff --git a/sdk/go/azure/servicebus/getTopicAuthorizationRule.go b/sdk/go/azure/servicebus/getTopicAuthorizationRule.go index 48a0d1a23b..38974b5846 100644 --- a/sdk/go/azure/servicebus/getTopicAuthorizationRule.go +++ b/sdk/go/azure/servicebus/getTopicAuthorizationRule.go @@ -13,6 +13,36 @@ import ( ) // Use this data source to access information about a ServiceBus Topic Authorization Rule within a ServiceBus Topic. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := servicebus.LookupTopicAuthorizationRule(ctx, &servicebus.LookupTopicAuthorizationRuleArgs{ +// Name: "example-tfex_name", +// ResourceGroupName: pulumi.StringRef("example-resources"), +// NamespaceName: pulumi.StringRef("example-namespace"), +// TopicName: pulumi.StringRef("example-servicebus_topic"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("servicebusAuthorizationRuleId", data.Azurem_servicebus_topic_authorization_rule.Example.Id) +// return nil +// }) +// } +// +// ``` func LookupTopicAuthorizationRule(ctx *pulumi.Context, args *LookupTopicAuthorizationRuleArgs, opts ...pulumi.InvokeOption) (*LookupTopicAuthorizationRuleResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTopicAuthorizationRuleResult diff --git a/sdk/go/azure/servicebus/namespace.go b/sdk/go/azure/servicebus/namespace.go index b7a98b6ece..90e77cb61f 100644 --- a/sdk/go/azure/servicebus/namespace.go +++ b/sdk/go/azure/servicebus/namespace.go @@ -15,6 +15,44 @@ import ( // Manages a ServiceBus Namespace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/namespaceAuthorizationRule.go b/sdk/go/azure/servicebus/namespaceAuthorizationRule.go index c271276235..31f9dd1878 100644 --- a/sdk/go/azure/servicebus/namespaceAuthorizationRule.go +++ b/sdk/go/azure/servicebus/namespaceAuthorizationRule.go @@ -15,6 +15,53 @@ import ( // Manages a ServiceBus Namespace authorization Rule within a ServiceBus. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewNamespaceAuthorizationRule(ctx, "exampleNamespaceAuthorizationRule", &servicebus.NamespaceAuthorizationRuleArgs{ +// NamespaceId: exampleNamespace.ID(), +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/namespaceDisasterRecoveryConfig.go b/sdk/go/azure/servicebus/namespaceDisasterRecoveryConfig.go index 65e0f77721..832d61ae6c 100644 --- a/sdk/go/azure/servicebus/namespaceDisasterRecoveryConfig.go +++ b/sdk/go/azure/servicebus/namespaceDisasterRecoveryConfig.go @@ -17,6 +17,68 @@ import ( // // > **NOTE:** Disaster Recovery Config is a Premium SKU only capability. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// primary, err := servicebus.NewNamespace(ctx, "primary", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Premium"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// secondary, err := servicebus.NewNamespace(ctx, "secondary", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Premium"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleNamespaceAuthorizationRule, err := servicebus.NewNamespaceAuthorizationRule(ctx, "exampleNamespaceAuthorizationRule", &servicebus.NamespaceAuthorizationRuleArgs{ +// NamespaceId: pulumi.Any(azurerm_servicebus_namespace.Example.Id), +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewNamespaceDisasterRecoveryConfig(ctx, "exampleNamespaceDisasterRecoveryConfig", &servicebus.NamespaceDisasterRecoveryConfigArgs{ +// PrimaryNamespaceId: primary.ID(), +// PartnerNamespaceId: secondary.ID(), +// AliasAuthorizationRuleId: exampleNamespaceAuthorizationRule.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus DR configs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/namespaceNetworkRuleSet.go b/sdk/go/azure/servicebus/namespaceNetworkRuleSet.go index 1c2f8e8700..1c8e5b55d0 100644 --- a/sdk/go/azure/servicebus/namespaceNetworkRuleSet.go +++ b/sdk/go/azure/servicebus/namespaceNetworkRuleSet.go @@ -15,6 +15,87 @@ import ( // Manages a ServiceBus Namespace Network Rule Set. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Premium"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("172.17.0.0/16"), +// }, +// DnsServers: pulumi.StringArray{ +// pulumi.String("10.0.0.4"), +// pulumi.String("10.0.0.5"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("172.17.0.0/24"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.ServiceBus"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewNamespaceNetworkRuleSet(ctx, "exampleNamespaceNetworkRuleSet", &servicebus.NamespaceNetworkRuleSetArgs{ +// NamespaceId: exampleNamespace.ID(), +// DefaultAction: pulumi.String("Deny"), +// PublicNetworkAccessEnabled: pulumi.Bool(true), +// NetworkRules: servicebus.NamespaceNetworkRuleSetNetworkRuleArray{ +// &servicebus.NamespaceNetworkRuleSetNetworkRuleArgs{ +// SubnetId: exampleSubnet.ID(), +// IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false), +// }, +// }, +// IpRules: pulumi.StringArray{ +// pulumi.String("1.1.1.1"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/queue.go b/sdk/go/azure/servicebus/queue.go index e5fb19d8d3..95cce939a3 100644 --- a/sdk/go/azure/servicebus/queue.go +++ b/sdk/go/azure/servicebus/queue.go @@ -15,6 +15,51 @@ import ( // Manages a ServiceBus Queue. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewQueue(ctx, "exampleQueue", &servicebus.QueueArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/queueAuthorizationRule.go b/sdk/go/azure/servicebus/queueAuthorizationRule.go index 717d12ff70..4e10cd2281 100644 --- a/sdk/go/azure/servicebus/queueAuthorizationRule.go +++ b/sdk/go/azure/servicebus/queueAuthorizationRule.go @@ -15,6 +15,60 @@ import ( // Manages an Authorization Rule for a ServiceBus Queue. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleQueue, err := servicebus.NewQueue(ctx, "exampleQueue", &servicebus.QueueArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewQueueAuthorizationRule(ctx, "exampleQueueAuthorizationRule", &servicebus.QueueAuthorizationRuleArgs{ +// QueueId: exampleQueue.ID(), +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(true), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/subscription.go b/sdk/go/azure/servicebus/subscription.go index 19f459e250..9235a21356 100644 --- a/sdk/go/azure/servicebus/subscription.go +++ b/sdk/go/azure/servicebus/subscription.go @@ -15,6 +15,58 @@ import ( // Manages a ServiceBus Subscription. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewSubscription(ctx, "exampleSubscription", &servicebus.SubscriptionArgs{ +// TopicId: exampleTopic.ID(), +// MaxDeliveryCount: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/subscriptionRule.go b/sdk/go/azure/servicebus/subscriptionRule.go index af7d6b2272..b426964645 100644 --- a/sdk/go/azure/servicebus/subscriptionRule.go +++ b/sdk/go/azure/servicebus/subscriptionRule.go @@ -16,6 +16,130 @@ import ( // Manages a ServiceBus Subscription Rule. // // ## Example Usage +// ### SQL Filter) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleSubscription, err := servicebus.NewSubscription(ctx, "exampleSubscription", &servicebus.SubscriptionArgs{ +// TopicId: exampleTopic.ID(), +// MaxDeliveryCount: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewSubscriptionRule(ctx, "exampleSubscriptionRule", &servicebus.SubscriptionRuleArgs{ +// SubscriptionId: exampleSubscription.ID(), +// FilterType: pulumi.String("SqlFilter"), +// SqlFilter: pulumi.String("colour = 'red'"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Correlation Filter) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleSubscription, err := servicebus.NewSubscription(ctx, "exampleSubscription", &servicebus.SubscriptionArgs{ +// TopicId: exampleTopic.ID(), +// MaxDeliveryCount: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewSubscriptionRule(ctx, "exampleSubscriptionRule", &servicebus.SubscriptionRuleArgs{ +// SubscriptionId: exampleSubscription.ID(), +// FilterType: pulumi.String("CorrelationFilter"), +// CorrelationFilter: &servicebus.SubscriptionRuleCorrelationFilterArgs{ +// CorrelationId: pulumi.String("high"), +// Label: pulumi.String("red"), +// Properties: pulumi.StringMap{ +// "customProperty": pulumi.String("value"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` // // ## Import // diff --git a/sdk/go/azure/servicebus/topic.go b/sdk/go/azure/servicebus/topic.go index 015ee9a5d2..b94744aabe 100644 --- a/sdk/go/azure/servicebus/topic.go +++ b/sdk/go/azure/servicebus/topic.go @@ -17,6 +17,51 @@ import ( // // **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicebus/topicAuthorizationRule.go b/sdk/go/azure/servicebus/topicAuthorizationRule.go index 49556529c3..b64204f364 100644 --- a/sdk/go/azure/servicebus/topicAuthorizationRule.go +++ b/sdk/go/azure/servicebus/topicAuthorizationRule.go @@ -15,6 +15,59 @@ import ( // Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Tags: pulumi.StringMap{ +// "source": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = servicebus.NewTopicAuthorizationRule(ctx, "exampleTopicAuthorizationRule", &servicebus.TopicAuthorizationRuleArgs{ +// TopicId: exampleTopic.ID(), +// Listen: pulumi.Bool(true), +// Send: pulumi.Bool(false), +// Manage: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicefabric/cluster.go b/sdk/go/azure/servicefabric/cluster.go index 4664d7cbe4..bb3ad4b763 100644 --- a/sdk/go/azure/servicefabric/cluster.go +++ b/sdk/go/azure/servicefabric/cluster.go @@ -15,6 +15,54 @@ import ( // Manages a Service Fabric Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicefabric" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = servicefabric.NewCluster(ctx, "exampleCluster", &servicefabric.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ReliabilityLevel: pulumi.String("Bronze"), +// UpgradeMode: pulumi.String("Manual"), +// ClusterCodeVersion: pulumi.String("7.1.456.959"), +// VmImage: pulumi.String("Windows"), +// ManagementEndpoint: pulumi.String("https://example:80"), +// NodeTypes: servicefabric.ClusterNodeTypeArray{ +// &servicefabric.ClusterNodeTypeArgs{ +// Name: pulumi.String("first"), +// InstanceCount: pulumi.Int(3), +// IsPrimary: pulumi.Bool(true), +// ClientEndpointPort: pulumi.Int(2020), +// HttpEndpointPort: pulumi.Int(80), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Service Fabric Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/servicefabric/managedCluster.go b/sdk/go/azure/servicefabric/managedCluster.go index 7cebb7e96d..d059eedc81 100644 --- a/sdk/go/azure/servicefabric/managedCluster.go +++ b/sdk/go/azure/servicefabric/managedCluster.go @@ -15,6 +15,59 @@ import ( // Manages a Resource Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicefabric" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := servicefabric.NewManagedCluster(ctx, "example", &servicefabric.ManagedClusterArgs{ +// ClientConnectionPort: pulumi.Int(12345), +// HttpGatewayPort: pulumi.Int(4567), +// LbRules: servicefabric.ManagedClusterLbRuleArray{ +// &servicefabric.ManagedClusterLbRuleArgs{ +// BackendPort: pulumi.Int(38080), +// FrontendPort: pulumi.Int(80), +// ProbeProtocol: pulumi.String("http"), +// ProbeRequestPath: pulumi.String("/test"), +// Protocol: pulumi.String("tcp"), +// }, +// }, +// Location: pulumi.String("West Europe"), +// NodeTypes: servicefabric.ManagedClusterNodeTypeArray{ +// &servicefabric.ManagedClusterNodeTypeArgs{ +// ApplicationPortRange: pulumi.String("30000-49000"), +// DataDiskSizeGb: pulumi.Int(130), +// EphemeralPortRange: pulumi.String("10000-20000"), +// Name: pulumi.String("test1"), +// Primary: pulumi.Bool(true), +// VmImageOffer: pulumi.String("WindowsServer"), +// VmImagePublisher: pulumi.String("MicrosoftWindowsServer"), +// VmImageSku: pulumi.String("2019-Datacenter-with-Containers"), +// VmImageVersion: pulumi.String("latest"), +// VmInstanceCount: pulumi.Int(5), +// VmSize: pulumi.String("Standard_DS1_v2"), +// }, +// }, +// ResourceGroupName: pulumi.String("example"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/signalr/getService.go b/sdk/go/azure/signalr/getService.go index 5fc7953ecb..6996abdc32 100644 --- a/sdk/go/azure/signalr/getService.go +++ b/sdk/go/azure/signalr/getService.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Azure SignalR service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/signalr" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := signalr.LookupService(ctx, &signalr.LookupServiceArgs{ +// Name: "test-signalr", +// ResourceGroupName: "signalr-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/signalr/service.go b/sdk/go/azure/signalr/service.go index 8c4ef673d8..a7b378eb83 100644 --- a/sdk/go/azure/signalr/service.go +++ b/sdk/go/azure/signalr/service.go @@ -15,6 +15,70 @@ import ( // Manages an Azure SignalR service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/signalr" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// _, err = signalr.NewService(ctx, "exampleService", &signalr.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &signalr.ServiceSkuArgs{ +// Name: pulumi.String("Free_F1"), +// Capacity: pulumi.Int(1), +// }, +// Cors: signalr.ServiceCorArray{ +// &signalr.ServiceCorArgs{ +// AllowedOrigins: pulumi.StringArray{ +// pulumi.String("http://www.example.com"), +// }, +// }, +// }, +// PublicNetworkAccessEnabled: pulumi.Bool(false), +// ConnectivityLogsEnabled: pulumi.Bool(true), +// MessagingLogsEnabled: pulumi.Bool(true), +// ServiceMode: pulumi.String("Default"), +// UpstreamEndpoints: signalr.ServiceUpstreamEndpointArray{ +// &signalr.ServiceUpstreamEndpointArgs{ +// CategoryPatterns: pulumi.StringArray{ +// pulumi.String("connections"), +// pulumi.String("messages"), +// }, +// EventPatterns: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// HubPatterns: pulumi.StringArray{ +// pulumi.String("hub1"), +// }, +// UrlTemplate: pulumi.String("http://foo.com"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SignalR services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/signalr/serviceCustomCertificate.go b/sdk/go/azure/signalr/serviceCustomCertificate.go index c042d21be9..6ffdbc5847 100644 --- a/sdk/go/azure/signalr/serviceCustomCertificate.go +++ b/sdk/go/azure/signalr/serviceCustomCertificate.go @@ -15,6 +15,119 @@ import ( // Manages an Azure SignalR Custom Certificate. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/signalr" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := signalr.NewService(ctx, "exampleService", &signalr.ServiceArgs{ +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// Sku: &signalr.ServiceSkuArgs{ +// Name: pulumi.String("Premium_P1"), +// Capacity: pulumi.Int(1), +// }, +// Identity: &signalr.ServiceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: pulumi.Any(azurerm_signalr_service.Test.Identity[0].Principal_id), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Certificate: &keyvault.CertificateCertificateArgs{ +// Contents: filebase64OrPanic("certificate-to-import.pfx"), +// Password: pulumi.String(""), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = signalr.NewServiceCustomCertificate(ctx, "test", &signalr.ServiceCustomCertificateArgs{ +// SignalrServiceId: exampleService.ID(), +// CustomCertificateId: exampleCertificate.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// azurerm_key_vault_access_policy.Example, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Custom Certificate for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/signalr/serviceCustomDomain.go b/sdk/go/azure/signalr/serviceCustomDomain.go index 6f71fab5df..f94c600997 100644 --- a/sdk/go/azure/signalr/serviceCustomDomain.go +++ b/sdk/go/azure/signalr/serviceCustomDomain.go @@ -15,6 +15,127 @@ import ( // Manages an Azure SignalR Custom Domain. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/base64" +// "os" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/signalr" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func filebase64OrPanic(path string) pulumi.StringPtrInput { +// if fileData, err := os.ReadFile(path); err == nil { +// return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:])) +// } else { +// panic(err.Error()) +// } +// } +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := signalr.NewService(ctx, "exampleService", &signalr.ServiceArgs{ +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// Sku: &signalr.ServiceSkuArgs{ +// Name: pulumi.String("Premium_P1"), +// Capacity: pulumi.Int(1), +// }, +// Identity: &signalr.ServiceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("premium"), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// }, +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: pulumi.Any(azurerm_signalr_service.Test.Identity[0].Principal_id), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("List"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleCertificate, err := keyvault.NewCertificate(ctx, "exampleCertificate", &keyvault.CertificateArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// Certificate: &keyvault.CertificateCertificateArgs{ +// Contents: filebase64OrPanic("certificate-to-import.pfx"), +// Password: pulumi.String(""), +// }, +// }) +// if err != nil { +// return err +// } +// testServiceCustomCertificate, err := signalr.NewServiceCustomCertificate(ctx, "testServiceCustomCertificate", &signalr.ServiceCustomCertificateArgs{ +// SignalrServiceId: exampleService.ID(), +// CustomCertificateId: exampleCertificate.ID(), +// }, pulumi.DependsOn([]pulumi.Resource{ +// azurerm_key_vault_access_policy.Example, +// })) +// if err != nil { +// return err +// } +// _, err = signalr.NewServiceCustomDomain(ctx, "testServiceCustomDomain", &signalr.ServiceCustomDomainArgs{ +// SignalrServiceId: pulumi.Any(azurerm_signalr_service.Test.Id), +// DomainName: pulumi.String("tftest.com"), +// SignalrCustomCertificateId: testServiceCustomCertificate.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Custom Domain for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/signalr/serviceNetworkAcl.go b/sdk/go/azure/signalr/serviceNetworkAcl.go index 2747119117..1a97d188b0 100644 --- a/sdk/go/azure/signalr/serviceNetworkAcl.go +++ b/sdk/go/azure/signalr/serviceNetworkAcl.go @@ -15,6 +15,103 @@ import ( // Manages the Network ACL for a SignalR service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatelink" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/signalr" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := signalr.NewService(ctx, "exampleService", &signalr.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: &signalr.ServiceSkuArgs{ +// Name: pulumi.String("Standard_S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.2.0/24"), +// }, +// EnforcePrivateLinkEndpointNetworkPolicies: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleEndpoint, err := privatelink.NewEndpoint(ctx, "exampleEndpoint", &privatelink.EndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubnetId: exampleSubnet.ID(), +// PrivateServiceConnection: &privatelink.EndpointPrivateServiceConnectionArgs{ +// Name: pulumi.String("psc-sig-test"), +// IsManualConnection: pulumi.Bool(false), +// PrivateConnectionResourceId: exampleService.ID(), +// SubresourceNames: pulumi.StringArray{ +// pulumi.String("signalr"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = signalr.NewServiceNetworkAcl(ctx, "exampleServiceNetworkAcl", &signalr.ServiceNetworkAclArgs{ +// SignalrServiceId: exampleService.ID(), +// DefaultAction: pulumi.String("Deny"), +// PublicNetwork: &signalr.ServiceNetworkAclPublicNetworkArgs{ +// AllowedRequestTypes: pulumi.StringArray{ +// pulumi.String("ClientConnection"), +// }, +// }, +// PrivateEndpoints: signalr.ServiceNetworkAclPrivateEndpointArray{ +// &signalr.ServiceNetworkAclPrivateEndpointArgs{ +// Id: exampleEndpoint.ID(), +// AllowedRequestTypes: pulumi.StringArray{ +// pulumi.String("ServerConnection"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network ACLs for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/signalr/sharedPrivateLinkResource.go b/sdk/go/azure/signalr/sharedPrivateLinkResource.go index 164f2495b9..508b489a2c 100644 --- a/sdk/go/azure/signalr/sharedPrivateLinkResource.go +++ b/sdk/go/azure/signalr/sharedPrivateLinkResource.go @@ -15,6 +15,82 @@ import ( // Manages the Shared Private Link Resource for a Signalr service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/signalr" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("ManageContacts"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Set"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = signalr.NewService(ctx, "test", &signalr.ServiceArgs{ +// Location: pulumi.Any(azurerm_resource_group.Test.Location), +// ResourceGroupName: pulumi.Any(azurerm_resource_group.Test.Name), +// Sku: &signalr.ServiceSkuArgs{ +// Name: pulumi.String("Standard_S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = signalr.NewSharedPrivateLinkResource(ctx, "exampleSharedPrivateLinkResource", &signalr.SharedPrivateLinkResourceArgs{ +// SignalrServiceId: pulumi.Any(azurerm_signalr_service.Example.Id), +// SubResourceName: pulumi.String("vault"), +// TargetResourceId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Signalr Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/fabric.go b/sdk/go/azure/siterecovery/fabric.go index 8b25168f85..d42956b8d2 100644 --- a/sdk/go/azure/siterecovery/fabric.go +++ b/sdk/go/azure/siterecovery/fabric.go @@ -15,6 +15,56 @@ import ( // Manages a Azure Site Recovery Replication Fabric within a Recovery Services vault. Only Azure fabrics are supported at this time. Replication Fabrics serve as a container within an Azure region for other Site Recovery resources such as protection containers, protected items, network mappings. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.NewResourceGroup(ctx, "primary", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// secondary, err := core.NewResourceGroup(ctx, "secondary", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: secondary.Location, +// ResourceGroupName: secondary.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewFabric(ctx, "fabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondary.Name, +// RecoveryVaultName: vault.Name, +// Location: primary.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/getFabric.go b/sdk/go/azure/siterecovery/getFabric.go index c6bd690650..dfa6d76c01 100644 --- a/sdk/go/azure/siterecovery/getFabric.go +++ b/sdk/go/azure/siterecovery/getFabric.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Site Recovery Replication Fabric. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := siterecovery.LookupFabric(ctx, &siterecovery.LookupFabricArgs{ +// Name: "primary-fabric", +// RecoveryVaultName: "tfex-recovery_vault", +// ResourceGroupName: "tfex-resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupFabric(ctx *pulumi.Context, args *LookupFabricArgs, opts ...pulumi.InvokeOption) (*LookupFabricResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupFabricResult diff --git a/sdk/go/azure/siterecovery/getProtectionContainer.go b/sdk/go/azure/siterecovery/getProtectionContainer.go index f1725183e4..e9ee4cf97a 100644 --- a/sdk/go/azure/siterecovery/getProtectionContainer.go +++ b/sdk/go/azure/siterecovery/getProtectionContainer.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing site recovery services protection container. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := siterecovery.LookupProtectionContainer(ctx, &siterecovery.LookupProtectionContainerArgs{ +// Name: "primary-container", +// RecoveryFabricName: "primary-fabric", +// RecoveryVaultName: "tfex-recovery_vault", +// ResourceGroupName: "tfex-resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupProtectionContainer(ctx *pulumi.Context, args *LookupProtectionContainerArgs, opts ...pulumi.InvokeOption) (*LookupProtectionContainerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupProtectionContainerResult diff --git a/sdk/go/azure/siterecovery/getReplicationPolicy.go b/sdk/go/azure/siterecovery/getReplicationPolicy.go index e520e2eb7d..53086d7515 100644 --- a/sdk/go/azure/siterecovery/getReplicationPolicy.go +++ b/sdk/go/azure/siterecovery/getReplicationPolicy.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Azure Site Recovery replication policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := siterecovery.LookupReplicationPolicy(ctx, &siterecovery.LookupReplicationPolicyArgs{ +// Name: "replication-policy", +// RecoveryVaultName: "tfex-recovery_vault", +// ResourceGroupName: "tfex-resource_group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupReplicationPolicy(ctx *pulumi.Context, args *LookupReplicationPolicyArgs, opts ...pulumi.InvokeOption) (*LookupReplicationPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupReplicationPolicyResult diff --git a/sdk/go/azure/siterecovery/getReplicationRecoveryPlan.go b/sdk/go/azure/siterecovery/getReplicationRecoveryPlan.go index 07a667f1cd..825daafac2 100644 --- a/sdk/go/azure/siterecovery/getReplicationRecoveryPlan.go +++ b/sdk/go/azure/siterecovery/getReplicationRecoveryPlan.go @@ -13,6 +13,41 @@ import ( ) // Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// vault, err := recoveryservices.LookupVault(ctx, &recoveryservices.LookupVaultArgs{ +// Name: "tfex-recovery_vault", +// ResourceGroupName: "tfex-resource_group", +// }, nil) +// if err != nil { +// return err +// } +// _, err = siterecovery.LookupReplicationRecoveryPlan(ctx, &siterecovery.LookupReplicationRecoveryPlanArgs{ +// Name: "example-recovery-plan", +// RecoveryVaultId: vault.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupReplicationRecoveryPlan(ctx *pulumi.Context, args *LookupReplicationRecoveryPlanArgs, opts ...pulumi.InvokeOption) (*LookupReplicationRecoveryPlanResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupReplicationRecoveryPlanResult diff --git a/sdk/go/azure/siterecovery/hyperVReplicationPolicy.go b/sdk/go/azure/siterecovery/hyperVReplicationPolicy.go index 681cef524b..f410a1e11b 100644 --- a/sdk/go/azure/siterecovery/hyperVReplicationPolicy.go +++ b/sdk/go/azure/siterecovery/hyperVReplicationPolicy.go @@ -15,6 +15,51 @@ import ( // Manages a Azure Site Recovery replication policy for HyperV within a Recovery Vault. Replication policies define the frequency at which recovery points are created and how long they are stored. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewHyperVReplicationPolicy(ctx, "policy", &siterecovery.HyperVReplicationPolicyArgs{ +// RecoveryVaultId: vault.ID(), +// RecoveryPointRetentionInHours: pulumi.Int(2), +// ApplicationConsistentSnapshotFrequencyInHours: pulumi.Int(1), +// ReplicationIntervalInSeconds: pulumi.Int(300), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/hyperVReplicationPolicyAssociation.go b/sdk/go/azure/siterecovery/hyperVReplicationPolicyAssociation.go index 21ea8eec20..ce1a871f22 100644 --- a/sdk/go/azure/siterecovery/hyperVReplicationPolicyAssociation.go +++ b/sdk/go/azure/siterecovery/hyperVReplicationPolicyAssociation.go @@ -15,6 +15,64 @@ import ( // Manages an Azure Site Recovery replication policy for HyperV within a Recovery Vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleHyperVSite, err := siterecovery.NewHyperVSite(ctx, "exampleHyperVSite", &siterecovery.HyperVSiteArgs{ +// RecoveryVaultId: exampleVault.ID(), +// }) +// if err != nil { +// return err +// } +// exampleHyperVReplicationPolicy, err := siterecovery.NewHyperVReplicationPolicy(ctx, "exampleHyperVReplicationPolicy", &siterecovery.HyperVReplicationPolicyArgs{ +// RecoveryVaultId: exampleVault.ID(), +// RecoveryPointRetentionInHours: pulumi.Int(2), +// ApplicationConsistentSnapshotFrequencyInHours: pulumi.Int(1), +// ReplicationIntervalInSeconds: pulumi.Int(300), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewHyperVReplicationPolicyAssociation(ctx, "exampleHyperVReplicationPolicyAssociation", &siterecovery.HyperVReplicationPolicyAssociationArgs{ +// HypervSiteId: exampleHyperVSite.ID(), +// PolicyId: exampleHyperVReplicationPolicy.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/hyperVSite.go b/sdk/go/azure/siterecovery/hyperVSite.go index e7b9a69c34..adaa58ac5c 100644 --- a/sdk/go/azure/siterecovery/hyperVSite.go +++ b/sdk/go/azure/siterecovery/hyperVSite.go @@ -15,6 +15,49 @@ import ( // Manages a HyperV Site in Recovery Service Vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("eastus"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// SoftDeleteEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewHyperVSite(ctx, "exampleHyperVSite", &siterecovery.HyperVSiteArgs{ +// RecoveryVaultId: exampleVault.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Recovery Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/hypervNetworkMapping.go b/sdk/go/azure/siterecovery/hypervNetworkMapping.go index c051e172a1..a738de7751 100644 --- a/sdk/go/azure/siterecovery/hypervNetworkMapping.go +++ b/sdk/go/azure/siterecovery/hypervNetworkMapping.go @@ -15,6 +15,62 @@ import ( // Manages a HyperV site recovery network mapping on Azure. A HyperV network mapping decides how to translate connected networks when a VM is migrated from HyperV VMM Center to Azure. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// targetResourceGroup, err := core.NewResourceGroup(ctx, "targetResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: targetResourceGroup.Location, +// ResourceGroupName: targetResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// targetVirtualNetwork, err := network.NewVirtualNetwork(ctx, "targetVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: targetResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.2.0/24"), +// }, +// Location: targetResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewHypervNetworkMapping(ctx, "recovery-mapping", &siterecovery.HypervNetworkMappingArgs{ +// RecoveryVaultId: vault.ID(), +// SourceSystemCenterVirtualMachineManagerName: pulumi.String("my-vmm-server"), +// SourceNetworkName: pulumi.String("my-vmm-network"), +// TargetNetworkId: targetVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/networkMapping.go b/sdk/go/azure/siterecovery/networkMapping.go index 4f2c1a26e4..b813985e3b 100644 --- a/sdk/go/azure/siterecovery/networkMapping.go +++ b/sdk/go/azure/siterecovery/networkMapping.go @@ -15,6 +15,98 @@ import ( // Manages a site recovery network mapping on Azure. A network mapping decides how to translate connected networks when a VM is migrated from one region to another. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primaryResourceGroup, err := core.NewResourceGroup(ctx, "primaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// secondaryResourceGroup, err := core.NewResourceGroup(ctx, "secondaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: secondaryResourceGroup.Location, +// ResourceGroupName: secondaryResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// primaryFabric, err := siterecovery.NewFabric(ctx, "primaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: primaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewFabric(ctx, "secondaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: secondaryResourceGroup.Location, +// }, pulumi.DependsOn([]pulumi.Resource{ +// primaryFabric, +// })) +// if err != nil { +// return err +// } +// primaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "primaryVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: primaryResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: primaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// secondaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "secondaryVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.2.0/24"), +// }, +// Location: secondaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewNetworkMapping(ctx, "recovery-mapping", &siterecovery.NetworkMappingArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// SourceRecoveryFabricName: pulumi.String("primary-fabric"), +// TargetRecoveryFabricName: pulumi.String("secondary-fabric"), +// SourceNetworkId: primaryVirtualNetwork.ID(), +// TargetNetworkId: secondaryVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/protectionContainer.go b/sdk/go/azure/siterecovery/protectionContainer.go index eb98f8d566..4fdcb30cfa 100644 --- a/sdk/go/azure/siterecovery/protectionContainer.go +++ b/sdk/go/azure/siterecovery/protectionContainer.go @@ -15,6 +15,64 @@ import ( // Manages a Azure Site Recovery protection container. Protection containers serve as containers for replicated VMs and belong to a single region / recovery fabric. Protection containers can contain more than one replicated VM. To replicate a VM, a container must exist in both the source and target Azure regions. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primary, err := core.NewResourceGroup(ctx, "primary", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// secondary, err := core.NewResourceGroup(ctx, "secondary", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: secondary.Location, +// ResourceGroupName: secondary.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// fabric, err := siterecovery.NewFabric(ctx, "fabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondary.Name, +// RecoveryVaultName: vault.Name, +// Location: primary.Location, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewProtectionContainer(ctx, "protection-container", &siterecovery.ProtectionContainerArgs{ +// ResourceGroupName: secondary.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: fabric.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Protection Containers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/protectionContainerMapping.go b/sdk/go/azure/siterecovery/protectionContainerMapping.go index 149b773586..8574731625 100644 --- a/sdk/go/azure/siterecovery/protectionContainerMapping.go +++ b/sdk/go/azure/siterecovery/protectionContainerMapping.go @@ -15,6 +15,100 @@ import ( // Manages a Azure recovery vault protection container mapping. A protection container mapping decides how to translate the protection container when a VM is migrated from one region to another. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primaryResourceGroup, err := core.NewResourceGroup(ctx, "primaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// secondaryResourceGroup, err := core.NewResourceGroup(ctx, "secondaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: secondaryResourceGroup.Location, +// ResourceGroupName: secondaryResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// primaryFabric, err := siterecovery.NewFabric(ctx, "primaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: primaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// secondaryFabric, err := siterecovery.NewFabric(ctx, "secondaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: secondaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// primaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "primaryProtectionContainer", &siterecovery.ProtectionContainerArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: primaryFabric.Name, +// }) +// if err != nil { +// return err +// } +// secondaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "secondaryProtectionContainer", &siterecovery.ProtectionContainerArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: secondaryFabric.Name, +// }) +// if err != nil { +// return err +// } +// policy, err := siterecovery.NewReplicationPolicy(ctx, "policy", &siterecovery.ReplicationPolicyArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryPointRetentionInMinutes: 24 * 60, +// ApplicationConsistentSnapshotFrequencyInMinutes: 4 * 60, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewProtectionContainerMapping(ctx, "container-mapping", &siterecovery.ProtectionContainerMappingArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: primaryFabric.Name, +// RecoverySourceProtectionContainerName: primaryProtectionContainer.Name, +// RecoveryTargetProtectionContainerId: secondaryProtectionContainer.ID(), +// RecoveryReplicationPolicyId: policy.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Protection Container Mappings can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/replicatedVM.go b/sdk/go/azure/siterecovery/replicatedVM.go index c0dfdde57c..cc0a4e8cf0 100644 --- a/sdk/go/azure/siterecovery/replicatedVM.go +++ b/sdk/go/azure/siterecovery/replicatedVM.go @@ -15,6 +15,263 @@ import ( // Manages a VM replicated using Azure Site Recovery (Azure to Azure only). A replicated VM keeps a copiously updated image of the VM in another region in order to be able to start the VM in that region in case of a disaster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primaryResourceGroup, err := core.NewResourceGroup(ctx, "primaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// secondaryResourceGroup, err := core.NewResourceGroup(ctx, "secondaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// primaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "primaryVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: primaryResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: primaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// primarySubnet, err := network.NewSubnet(ctx, "primarySubnet", &network.SubnetArgs{ +// ResourceGroupName: primaryResourceGroup.Name, +// VirtualNetworkName: primaryVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// primaryPublicIp, err := network.NewPublicIp(ctx, "primaryPublicIp", &network.PublicIpArgs{ +// AllocationMethod: pulumi.String("Static"), +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// vmNetworkInterface, err := network.NewNetworkInterface(ctx, "vmNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("vm"), +// SubnetId: primarySubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// PublicIpAddressId: primaryPublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// vmVirtualMachine, err := compute.NewVirtualMachine(ctx, "vmVirtualMachine", &compute.VirtualMachineArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// VmSize: pulumi.String("Standard_B1s"), +// NetworkInterfaceIds: pulumi.StringArray{ +// vmNetworkInterface.ID(), +// }, +// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{ +// Publisher: pulumi.String("OpenLogic"), +// Offer: pulumi.String("CentOS"), +// Sku: pulumi.String("7.5"), +// Version: pulumi.String("latest"), +// }, +// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{ +// Name: pulumi.String("vm-os-disk"), +// OsType: pulumi.String("Linux"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Premium_LRS"), +// }, +// OsProfile: &compute.VirtualMachineOsProfileArgs{ +// AdminUsername: pulumi.String("test-admin-123"), +// AdminPassword: pulumi.String("test-pwd-123"), +// ComputerName: pulumi.String("vm"), +// }, +// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(false), +// }, +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: secondaryResourceGroup.Location, +// ResourceGroupName: secondaryResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// primaryFabric, err := siterecovery.NewFabric(ctx, "primaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: primaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// secondaryFabric, err := siterecovery.NewFabric(ctx, "secondaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: secondaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// primaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "primaryProtectionContainer", &siterecovery.ProtectionContainerArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: primaryFabric.Name, +// }) +// if err != nil { +// return err +// } +// secondaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "secondaryProtectionContainer", &siterecovery.ProtectionContainerArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: secondaryFabric.Name, +// }) +// if err != nil { +// return err +// } +// policy, err := siterecovery.NewReplicationPolicy(ctx, "policy", &siterecovery.ReplicationPolicyArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryPointRetentionInMinutes: 24 * 60, +// ApplicationConsistentSnapshotFrequencyInMinutes: 4 * 60, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewProtectionContainerMapping(ctx, "container-mapping", &siterecovery.ProtectionContainerMappingArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: primaryFabric.Name, +// RecoverySourceProtectionContainerName: primaryProtectionContainer.Name, +// RecoveryTargetProtectionContainerId: secondaryProtectionContainer.ID(), +// RecoveryReplicationPolicyId: policy.ID(), +// }) +// if err != nil { +// return err +// } +// secondaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "secondaryVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.2.0/24"), +// }, +// Location: secondaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewNetworkMapping(ctx, "network-mapping", &siterecovery.NetworkMappingArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// SourceRecoveryFabricName: primaryFabric.Name, +// TargetRecoveryFabricName: secondaryFabric.Name, +// SourceNetworkId: primaryVirtualNetwork.ID(), +// TargetNetworkId: secondaryVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// primaryAccount, err := storage.NewAccount(ctx, "primaryAccount", &storage.AccountArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// secondarySubnet, err := network.NewSubnet(ctx, "secondarySubnet", &network.SubnetArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// VirtualNetworkName: secondaryVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// secondaryPublicIp, err := network.NewPublicIp(ctx, "secondaryPublicIp", &network.PublicIpArgs{ +// AllocationMethod: pulumi.String("Static"), +// Location: secondaryResourceGroup.Location, +// ResourceGroupName: secondaryResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewReplicatedVM(ctx, "vm-replication", &siterecovery.ReplicatedVMArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// SourceRecoveryFabricName: primaryFabric.Name, +// SourceVmId: vmVirtualMachine.ID(), +// RecoveryReplicationPolicyId: policy.ID(), +// SourceRecoveryProtectionContainerName: primaryProtectionContainer.Name, +// TargetResourceGroupId: secondaryResourceGroup.ID(), +// TargetRecoveryFabricId: secondaryFabric.ID(), +// TargetRecoveryProtectionContainerId: secondaryProtectionContainer.ID(), +// ManagedDisks: siterecovery.ReplicatedVMManagedDiskArray{ +// &siterecovery.ReplicatedVMManagedDiskArgs{ +// DiskId: vmVirtualMachine.StorageOsDisk.ApplyT(func(storageOsDisk compute.VirtualMachineStorageOsDisk) (*string, error) { +// return &storageOsDisk.ManagedDiskId, nil +// }).(pulumi.StringPtrOutput), +// StagingStorageAccountId: primaryAccount.ID(), +// TargetResourceGroupId: secondaryResourceGroup.ID(), +// TargetDiskType: pulumi.String("Premium_LRS"), +// TargetReplicaDiskType: pulumi.String("Premium_LRS"), +// }, +// }, +// NetworkInterfaces: siterecovery.ReplicatedVMNetworkInterfaceArray{ +// &siterecovery.ReplicatedVMNetworkInterfaceArgs{ +// SourceNetworkInterfaceId: vmNetworkInterface.ID(), +// TargetSubnetName: secondarySubnet.Name, +// RecoveryPublicIpAddressId: secondaryPublicIp.ID(), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// container_mapping, +// network_mapping, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Replicated VM's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/replicationPolicy.go b/sdk/go/azure/siterecovery/replicationPolicy.go index e3e0d2a36b..677cfffedf 100644 --- a/sdk/go/azure/siterecovery/replicationPolicy.go +++ b/sdk/go/azure/siterecovery/replicationPolicy.go @@ -15,6 +15,51 @@ import ( // Manages a Azure Site Recovery replication policy within a recovery vault. Replication policies define the frequency at which recovery points are created and how long they are stored. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: example.Location, +// ResourceGroupName: example.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewReplicationPolicy(ctx, "policy", &siterecovery.ReplicationPolicyArgs{ +// ResourceGroupName: example.Name, +// RecoveryVaultName: vault.Name, +// RecoveryPointRetentionInMinutes: 24 * 60, +// ApplicationConsistentSnapshotFrequencyInMinutes: 4 * 60, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/replicationRecoveryPlan.go b/sdk/go/azure/siterecovery/replicationRecoveryPlan.go index ef71eea532..997cab594d 100644 --- a/sdk/go/azure/siterecovery/replicationRecoveryPlan.go +++ b/sdk/go/azure/siterecovery/replicationRecoveryPlan.go @@ -15,6 +15,280 @@ import ( // Manages a Site Recovery Replication Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// primaryResourceGroup, err := core.NewResourceGroup(ctx, "primaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West US"), +// }) +// if err != nil { +// return err +// } +// secondaryResourceGroup, err := core.NewResourceGroup(ctx, "secondaryResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// primaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "primaryVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: primaryResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// Location: primaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// primarySubnet, err := network.NewSubnet(ctx, "primarySubnet", &network.SubnetArgs{ +// ResourceGroupName: primaryResourceGroup.Name, +// VirtualNetworkName: primaryVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// primaryPublicIp, err := network.NewPublicIp(ctx, "primaryPublicIp", &network.PublicIpArgs{ +// AllocationMethod: pulumi.String("Static"), +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// vmNetworkInterface, err := network.NewNetworkInterface(ctx, "vmNetworkInterface", &network.NetworkInterfaceArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// IpConfigurations: network.NetworkInterfaceIpConfigurationArray{ +// &network.NetworkInterfaceIpConfigurationArgs{ +// Name: pulumi.String("vm"), +// SubnetId: primarySubnet.ID(), +// PrivateIpAddressAllocation: pulumi.String("Dynamic"), +// PublicIpAddressId: primaryPublicIp.ID(), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// vmVirtualMachine, err := compute.NewVirtualMachine(ctx, "vmVirtualMachine", &compute.VirtualMachineArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// VmSize: pulumi.String("Standard_B1s"), +// NetworkInterfaceIds: pulumi.StringArray{ +// vmNetworkInterface.ID(), +// }, +// StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{ +// Publisher: pulumi.String("OpenLogic"), +// Offer: pulumi.String("CentOS"), +// Sku: pulumi.String("7.5"), +// Version: pulumi.String("latest"), +// }, +// StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{ +// Name: pulumi.String("vm-os-disk"), +// OsType: pulumi.String("Linux"), +// Caching: pulumi.String("ReadWrite"), +// CreateOption: pulumi.String("FromImage"), +// ManagedDiskType: pulumi.String("Premium_LRS"), +// }, +// OsProfile: &compute.VirtualMachineOsProfileArgs{ +// AdminUsername: pulumi.String("test-admin-123"), +// AdminPassword: pulumi.String("test-pwd-123"), +// ComputerName: pulumi.String("vm"), +// }, +// OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{ +// DisablePasswordAuthentication: pulumi.Bool(false), +// }, +// }) +// if err != nil { +// return err +// } +// vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{ +// Location: secondaryResourceGroup.Location, +// ResourceGroupName: secondaryResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// primaryFabric, err := siterecovery.NewFabric(ctx, "primaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: primaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// secondaryFabric, err := siterecovery.NewFabric(ctx, "secondaryFabric", &siterecovery.FabricArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// Location: secondaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// primaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "primaryProtectionContainer", &siterecovery.ProtectionContainerArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: primaryFabric.Name, +// }) +// if err != nil { +// return err +// } +// secondaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "secondaryProtectionContainer", &siterecovery.ProtectionContainerArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: secondaryFabric.Name, +// }) +// if err != nil { +// return err +// } +// policy, err := siterecovery.NewReplicationPolicy(ctx, "policy", &siterecovery.ReplicationPolicyArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryPointRetentionInMinutes: 24 * 60, +// ApplicationConsistentSnapshotFrequencyInMinutes: 4 * 60, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewProtectionContainerMapping(ctx, "container-mapping", &siterecovery.ProtectionContainerMappingArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// RecoveryFabricName: primaryFabric.Name, +// RecoverySourceProtectionContainerName: primaryProtectionContainer.Name, +// RecoveryTargetProtectionContainerId: secondaryProtectionContainer.ID(), +// RecoveryReplicationPolicyId: policy.ID(), +// }) +// if err != nil { +// return err +// } +// secondaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "secondaryVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("192.168.2.0/24"), +// }, +// Location: secondaryResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewNetworkMapping(ctx, "network-mapping", &siterecovery.NetworkMappingArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// SourceRecoveryFabricName: primaryFabric.Name, +// TargetRecoveryFabricName: secondaryFabric.Name, +// SourceNetworkId: primaryVirtualNetwork.ID(), +// TargetNetworkId: secondaryVirtualNetwork.ID(), +// }) +// if err != nil { +// return err +// } +// primaryAccount, err := storage.NewAccount(ctx, "primaryAccount", &storage.AccountArgs{ +// Location: primaryResourceGroup.Location, +// ResourceGroupName: primaryResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// secondarySubnet, err := network.NewSubnet(ctx, "secondarySubnet", &network.SubnetArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// VirtualNetworkName: secondaryVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("192.168.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// secondaryPublicIp, err := network.NewPublicIp(ctx, "secondaryPublicIp", &network.PublicIpArgs{ +// AllocationMethod: pulumi.String("Static"), +// Location: secondaryResourceGroup.Location, +// ResourceGroupName: secondaryResourceGroup.Name, +// Sku: pulumi.String("Basic"), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewReplicatedVM(ctx, "vm-replication", &siterecovery.ReplicatedVMArgs{ +// ResourceGroupName: secondaryResourceGroup.Name, +// RecoveryVaultName: vault.Name, +// SourceRecoveryFabricName: primaryFabric.Name, +// SourceVmId: vmVirtualMachine.ID(), +// RecoveryReplicationPolicyId: policy.ID(), +// SourceRecoveryProtectionContainerName: primaryProtectionContainer.Name, +// TargetResourceGroupId: secondaryResourceGroup.ID(), +// TargetRecoveryFabricId: secondaryFabric.ID(), +// TargetRecoveryProtectionContainerId: secondaryProtectionContainer.ID(), +// ManagedDisks: siterecovery.ReplicatedVMManagedDiskArray{ +// &siterecovery.ReplicatedVMManagedDiskArgs{ +// DiskId: vmVirtualMachine.StorageOsDisk.ApplyT(func(storageOsDisk compute.VirtualMachineStorageOsDisk) (*string, error) { +// return &storageOsDisk.ManagedDiskId, nil +// }).(pulumi.StringPtrOutput), +// StagingStorageAccountId: primaryAccount.ID(), +// TargetResourceGroupId: secondaryResourceGroup.ID(), +// TargetDiskType: pulumi.String("Premium_LRS"), +// TargetReplicaDiskType: pulumi.String("Premium_LRS"), +// }, +// }, +// NetworkInterfaces: siterecovery.ReplicatedVMNetworkInterfaceArray{ +// &siterecovery.ReplicatedVMNetworkInterfaceArgs{ +// SourceNetworkInterfaceId: vmNetworkInterface.ID(), +// TargetSubnetName: secondarySubnet.Name, +// RecoveryPublicIpAddressId: secondaryPublicIp.ID(), +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// container_mapping, +// network_mapping, +// })) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewReplicationRecoveryPlan(ctx, "example", &siterecovery.ReplicationRecoveryPlanArgs{ +// RecoveryVaultId: vault.ID(), +// SourceRecoveryFabricId: primaryFabric.ID(), +// TargetRecoveryFabricId: secondaryFabric.ID(), +// ShutdownRecoveryGroup: nil, +// FailoverRecoveryGroup: nil, +// BootRecoveryGroups: siterecovery.ReplicationRecoveryPlanBootRecoveryGroupArray{ +// &siterecovery.ReplicationRecoveryPlanBootRecoveryGroupArgs{ +// ReplicatedProtectedItems: pulumi.StringArray{ +// vm_replication.ID(), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/vmwareReplicationPolicy.go b/sdk/go/azure/siterecovery/vmwareReplicationPolicy.go index 38b2c18a18..204b4ce6b0 100644 --- a/sdk/go/azure/siterecovery/vmwareReplicationPolicy.go +++ b/sdk/go/azure/siterecovery/vmwareReplicationPolicy.go @@ -15,6 +15,52 @@ import ( // Manages a VMWare Replication Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("eastus"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// ClassicVmwareReplicationEnabled: pulumi.Bool(true), +// SoftDeleteEnabled: pulumi.Bool(false), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewVMWareReplicationPolicy(ctx, "exampleVMWareReplicationPolicy", &siterecovery.VMWareReplicationPolicyArgs{ +// RecoveryVaultId: exampleVault.ID(), +// RecoveryPointRetentionInMinutes: pulumi.Int(1440), +// ApplicationConsistentSnapshotFrequencyInMinutes: pulumi.Int(240), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // VMWare Replication Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/siterecovery/vmwareReplicationPolicyAssociation.go b/sdk/go/azure/siterecovery/vmwareReplicationPolicyAssociation.go index df444aa695..1739d56178 100644 --- a/sdk/go/azure/siterecovery/vmwareReplicationPolicyAssociation.go +++ b/sdk/go/azure/siterecovery/vmwareReplicationPolicyAssociation.go @@ -15,6 +15,57 @@ import ( // Manages an Azure Site Recovery replication policy for VMWare within a Recovery Vault. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleVault, err := recoveryservices.NewVault(ctx, "exampleVault", &recoveryservices.VaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleVMWareReplicationPolicy, err := siterecovery.NewVMWareReplicationPolicy(ctx, "exampleVMWareReplicationPolicy", &siterecovery.VMWareReplicationPolicyArgs{ +// RecoveryVaultId: exampleVault.ID(), +// RecoveryPointRetentionInMinutes: pulumi.Int(1440), +// ApplicationConsistentSnapshotFrequencyInMinutes: pulumi.Int(240), +// }) +// if err != nil { +// return err +// } +// _, err = siterecovery.NewVmwareReplicationPolicyAssociation(ctx, "exampleVmwareReplicationPolicyAssociation", &siterecovery.VmwareReplicationPolicyAssociationArgs{ +// RecoveryVaultId: exampleVault.ID(), +// PolicyId: exampleVMWareReplicationPolicy.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/activeDirectoryAdministrator.go b/sdk/go/azure/sql/activeDirectoryAdministrator.go index 24d50f1776..5a665bcb8f 100644 --- a/sdk/go/azure/sql/activeDirectoryAdministrator.go +++ b/sdk/go/azure/sql/activeDirectoryAdministrator.go @@ -17,6 +17,57 @@ import ( // // > **Note:** The `sql.ActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azureadAdministrator` block of the `mssql.Server` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewActiveDirectoryAdministrator(ctx, "exampleActiveDirectoryAdministrator", &sql.ActiveDirectoryAdministratorArgs{ +// ServerName: exampleSqlServer.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Login: pulumi.String("sqladmin"), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/database.go b/sdk/go/azure/sql/database.go index e64c03c9cd..ed036490e2 100644 --- a/sdk/go/azure/sql/database.go +++ b/sdk/go/azure/sql/database.go @@ -17,6 +17,67 @@ import ( // // > **Note:** The `sql.Database` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Database` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewDatabase(ctx, "exampleDatabase", &sql.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServerName: exampleSqlServer.Name, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Databases can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/elasticPool.go b/sdk/go/azure/sql/elasticPool.go index bd6ad95e39..f203196daf 100644 --- a/sdk/go/azure/sql/elasticPool.go +++ b/sdk/go/azure/sql/elasticPool.go @@ -17,6 +17,58 @@ import ( // // > **Note:** The `sql.ElasticPool` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ElasticPool` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewElasticPool(ctx, "exampleElasticPool", &sql.ElasticPoolArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServerName: exampleSqlServer.Name, +// Edition: pulumi.String("Basic"), +// Dtu: pulumi.Int(50), +// DbDtuMin: pulumi.Int(0), +// DbDtuMax: pulumi.Int(5), +// PoolSize: pulumi.Int(5000), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// > **NOTE on `sql.ElasticPool`:** - The values of `edition`, `dtu`, and `poolSize` must be consistent with the [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). Any inconsistent argument configuration will be rejected. +// // ## Import // // SQL Elastic Pool's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/failoverGroup.go b/sdk/go/azure/sql/failoverGroup.go index 1ec085e3a2..a7fe9d46bb 100644 --- a/sdk/go/azure/sql/failoverGroup.go +++ b/sdk/go/azure/sql/failoverGroup.go @@ -17,6 +17,80 @@ import ( // // > **Note:** The `sql.FailoverGroup` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.FailoverGroup` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// primary, err := sql.NewSqlServer(ctx, "primary", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("sqladmin"), +// AdministratorLoginPassword: pulumi.String("pa$$w0rd"), +// }) +// if err != nil { +// return err +// } +// secondary, err := sql.NewSqlServer(ctx, "secondary", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("sqladmin"), +// AdministratorLoginPassword: pulumi.String("pa$$w0rd"), +// }) +// if err != nil { +// return err +// } +// db1, err := sql.NewDatabase(ctx, "db1", &sql.DatabaseArgs{ +// ResourceGroupName: primary.ResourceGroupName, +// Location: primary.Location, +// ServerName: primary.Name, +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewFailoverGroup(ctx, "exampleFailoverGroup", &sql.FailoverGroupArgs{ +// ResourceGroupName: primary.ResourceGroupName, +// ServerName: primary.Name, +// Databases: pulumi.StringArray{ +// db1.ID(), +// }, +// PartnerServers: sql.FailoverGroupPartnerServerArray{ +// &sql.FailoverGroupPartnerServerArgs{ +// Id: secondary.ID(), +// }, +// }, +// ReadWriteEndpointFailoverPolicy: &sql.FailoverGroupReadWriteEndpointFailoverPolicyArgs{ +// Mode: pulumi.String("Automatic"), +// GraceMinutes: pulumi.Int(60), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/firewallRule.go b/sdk/go/azure/sql/firewallRule.go index e1cf4cac40..93591cffc4 100644 --- a/sdk/go/azure/sql/firewallRule.go +++ b/sdk/go/azure/sql/firewallRule.go @@ -17,6 +17,52 @@ import ( // // > **Note:** The `sql.FirewallRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.FirewallRule` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewFirewallRule(ctx, "exampleFirewallRule", &sql.FirewallRuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// ServerName: exampleSqlServer.Name, +// StartIpAddress: pulumi.String("10.0.17.62"), +// EndIpAddress: pulumi.String("10.0.17.62"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/getDatabase.go b/sdk/go/azure/sql/getDatabase.go index 174c17652b..472ba25276 100644 --- a/sdk/go/azure/sql/getDatabase.go +++ b/sdk/go/azure/sql/getDatabase.go @@ -15,6 +15,35 @@ import ( // Use this data source to access information about an existing SQL Azure Database. // // > **Note:** The `sql.Database` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Database` data source instead. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := sql.LookupDatabase(ctx, &sql.LookupDatabaseArgs{ +// Name: "example_db", +// ServerName: "example_db_server", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("sqlDatabaseId", example.Id) +// return nil +// }) +// } +// +// ``` func LookupDatabase(ctx *pulumi.Context, args *LookupDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupDatabaseResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupDatabaseResult diff --git a/sdk/go/azure/sql/getServer.go b/sdk/go/azure/sql/getServer.go index 7dbdf6355e..d5c932efca 100644 --- a/sdk/go/azure/sql/getServer.go +++ b/sdk/go/azure/sql/getServer.go @@ -15,6 +15,34 @@ import ( // Use this data source to access information about an existing SQL Azure Database Server. // // > **Note:** The `sql.SqlServer` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Server` data source instead. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := sql.GetServer(ctx, &sql.GetServerArgs{ +// Name: "examplesqlservername", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("sqlServerId", example.Id) +// return nil +// }) +// } +// +// ``` func GetServer(ctx *pulumi.Context, args *GetServerArgs, opts ...pulumi.InvokeOption) (*GetServerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetServerResult diff --git a/sdk/go/azure/sql/getSqlManagedInstance.go b/sdk/go/azure/sql/getSqlManagedInstance.go index 08792aeabd..7fccdbb140 100644 --- a/sdk/go/azure/sql/getSqlManagedInstance.go +++ b/sdk/go/azure/sql/getSqlManagedInstance.go @@ -15,6 +15,34 @@ import ( // Use this data source to access information about an existing SQL Managed Instance. // // > **Note:** The `sql.ManagedInstance` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedInstance` data source instead. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := sql.GetSqlManagedInstance(ctx, &sql.GetSqlManagedInstanceArgs{ +// Name: "example_mi", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("sqlInstanceId", example.Id) +// return nil +// }) +// } +// +// ``` func GetSqlManagedInstance(ctx *pulumi.Context, args *GetSqlManagedInstanceArgs, opts ...pulumi.InvokeOption) (*GetSqlManagedInstanceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetSqlManagedInstanceResult diff --git a/sdk/go/azure/sql/managedDatabase.go b/sdk/go/azure/sql/managedDatabase.go index a2815303a5..d32ceca068 100644 --- a/sdk/go/azure/sql/managedDatabase.go +++ b/sdk/go/azure/sql/managedDatabase.go @@ -17,6 +17,75 @@ import ( // // > **Note:** The `sql.ManagedDatabase` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedDatabase` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := sql.NewManagedInstance(ctx, "exampleManagedInstance", &sql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLogin: pulumi.String("mradministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// LicenseType: pulumi.String("BasePrice"), +// SubnetId: exampleSubnet.ID(), +// SkuName: pulumi.String("GP_Gen5"), +// Vcores: pulumi.Int(4), +// StorageSizeInGb: pulumi.Int(32), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewManagedDatabase(ctx, "exampleManagedDatabase", &sql.ManagedDatabaseArgs{ +// SqlManagedInstanceId: exampleManagedInstance.ID(), +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/managedInstance.go b/sdk/go/azure/sql/managedInstance.go index 421e518b2c..a97b49c4e5 100644 --- a/sdk/go/azure/sql/managedInstance.go +++ b/sdk/go/azure/sql/managedInstance.go @@ -19,6 +19,245 @@ import ( // // > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowManagementInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(106), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRanges: pulumi.StringArray{ +// pulumi.String("9000"), +// pulumi.String("9003"), +// pulumi.String("1438"), +// pulumi.String("1440"), +// pulumi.String("1452"), +// }, +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowMisubnetInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(200), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("10.0.0.0/24"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowHealthProbeInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(300), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("AzureLoadBalancer"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowTdsInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(1000), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("1433"), +// SourceAddressPrefix: pulumi.String("VirtualNetwork"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "denyAllInbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(4096), +// Direction: pulumi.String("Inbound"), +// Access: pulumi.String("Deny"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowManagementOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(102), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("Tcp"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRanges: pulumi.StringArray{ +// pulumi.String("80"), +// pulumi.String("443"), +// pulumi.String("12000"), +// }, +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "allowMisubnetOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(200), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Allow"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("10.0.0.0/24"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = network.NewNetworkSecurityRule(ctx, "denyAllOutbound", &network.NetworkSecurityRuleArgs{ +// Priority: pulumi.Int(4096), +// Direction: pulumi.String("Outbound"), +// Access: pulumi.String("Deny"), +// Protocol: pulumi.String("*"), +// SourcePortRange: pulumi.String("*"), +// DestinationPortRange: pulumi.String("*"), +// SourceAddressPrefix: pulumi.String("*"), +// DestinationAddressPrefix: pulumi.String("*"), +// ResourceGroupName: exampleResourceGroup.Name, +// NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.0.0/24"), +// }, +// Delegations: network.SubnetDelegationArray{ +// &network.SubnetDelegationArgs{ +// Name: pulumi.String("managedinstancedelegation"), +// ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{ +// Name: pulumi.String("Microsoft.Sql/managedInstances"), +// Actions: pulumi.StringArray{ +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action"), +// pulumi.String("Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnetNetworkSecurityGroupAssociation, err := network.NewSubnetNetworkSecurityGroupAssociation(ctx, "exampleSubnetNetworkSecurityGroupAssociation", &network.SubnetNetworkSecurityGroupAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(), +// }) +// if err != nil { +// return err +// } +// exampleRouteTable, err := network.NewRouteTable(ctx, "exampleRouteTable", &network.RouteTableArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// DisableBgpRoutePropagation: pulumi.Bool(false), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleSubnet, +// })) +// if err != nil { +// return err +// } +// exampleSubnetRouteTableAssociation, err := network.NewSubnetRouteTableAssociation(ctx, "exampleSubnetRouteTableAssociation", &network.SubnetRouteTableAssociationArgs{ +// SubnetId: exampleSubnet.ID(), +// RouteTableId: exampleRouteTable.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewManagedInstance(ctx, "exampleManagedInstance", &sql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLogin: pulumi.String("mradministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// LicenseType: pulumi.String("BasePrice"), +// SubnetId: exampleSubnet.ID(), +// SkuName: pulumi.String("GP_Gen5"), +// Vcores: pulumi.Int(4), +// StorageSizeInGb: pulumi.Int(32), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleSubnetNetworkSecurityGroupAssociation, +// exampleSubnetRouteTableAssociation, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/managedInstanceActiveDirectoryAdministrator.go b/sdk/go/azure/sql/managedInstanceActiveDirectoryAdministrator.go index 21a2c933e4..efe3c1949c 100644 --- a/sdk/go/azure/sql/managedInstanceActiveDirectoryAdministrator.go +++ b/sdk/go/azure/sql/managedInstanceActiveDirectoryAdministrator.go @@ -17,6 +17,64 @@ import ( // // > **Note:** The `sql.ManagedInstanceActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedInstanceActiveDirectoryAdministrator` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleManagedInstance, err := sql.NewManagedInstance(ctx, "exampleManagedInstance", &sql.ManagedInstanceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AdministratorLogin: pulumi.String("mradministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// LicenseType: pulumi.String("BasePrice"), +// SubnetId: pulumi.Any(azurerm_subnet.Example.Id), +// SkuName: pulumi.String("GP_Gen5"), +// Vcores: pulumi.Int(4), +// StorageSizeInGb: pulumi.Int(32), +// }, pulumi.DependsOn([]pulumi.Resource{ +// azurerm_subnet_network_security_group_association.Example, +// azurerm_subnet_route_table_association.Example, +// })) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = sql.NewManagedInstanceActiveDirectoryAdministrator(ctx, "exampleManagedInstanceActiveDirectoryAdministrator", &sql.ManagedInstanceActiveDirectoryAdministratorArgs{ +// ManagedInstanceName: exampleManagedInstance.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// Login: pulumi.String("sqladmin"), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/sqlServer.go b/sdk/go/azure/sql/sqlServer.go index 43fca02711..9b0d7df6e1 100644 --- a/sdk/go/azure/sql/sqlServer.go +++ b/sdk/go/azure/sql/sqlServer.go @@ -15,6 +15,56 @@ import ( // Manages a Microsoft SQL Azure Database Server. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("mradministrator"), +// AdministratorLoginPassword: pulumi.String("thisIsDog11"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/sql/virtualNetworkRule.go b/sdk/go/azure/sql/virtualNetworkRule.go index 339e426f1a..a816533d42 100644 --- a/sdk/go/azure/sql/virtualNetworkRule.go +++ b/sdk/go/azure/sql/virtualNetworkRule.go @@ -17,6 +17,75 @@ import ( // // > **Note:** The `sql.VirtualNetworkRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.VirtualNetworkRule` resource instead. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// vnet, err := network.NewVirtualNetwork(ctx, "vnet", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// Location: example.Location, +// ResourceGroupName: example.Name, +// }) +// if err != nil { +// return err +// } +// subnet, err := network.NewSubnet(ctx, "subnet", &network.SubnetArgs{ +// ResourceGroupName: example.Name, +// VirtualNetworkName: vnet.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.7.29.0/29"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// }, +// }) +// if err != nil { +// return err +// } +// sqlserver, err := sql.NewSqlServer(ctx, "sqlserver", &sql.SqlServerArgs{ +// ResourceGroupName: example.Name, +// Location: example.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("4dm1n157r470r"), +// AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"), +// }) +// if err != nil { +// return err +// } +// _, err = sql.NewVirtualNetworkRule(ctx, "sqlvnetrule", &sql.VirtualNetworkRuleArgs{ +// ResourceGroupName: example.Name, +// ServerName: sqlserver.Name, +// SubnetId: subnet.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/stack/hciCluster.go b/sdk/go/azure/stack/hciCluster.go index 21e7ffbe70..aa6257db14 100644 --- a/sdk/go/azure/stack/hciCluster.go +++ b/sdk/go/azure/stack/hciCluster.go @@ -15,6 +15,53 @@ import ( // Manages an Azure Stack HCI Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/stack" +// "github.com/pulumi/pulumi-azuread/sdk/v5/go/azuread" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleApplication, err := azuread.LookupApplication(ctx, &azuread.LookupApplicationArgs{ +// DisplayName: pulumi.StringRef("Allowed resource types"), +// }, nil) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = stack.NewHciCluster(ctx, "exampleHciCluster", &stack.HciClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ClientId: *pulumi.String(exampleApplication.ApplicationId), +// TenantId: *pulumi.String(current.TenantId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Azure Stack HCI Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/account.go b/sdk/go/azure/storage/account.go index 2dc4eb2063..150fd903ac 100644 --- a/sdk/go/azure/storage/account.go +++ b/sdk/go/azure/storage/account.go @@ -15,6 +15,117 @@ import ( // Manages an Azure Storage Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### With Network Rules +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Sql"), +// pulumi.String("Microsoft.Storage"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// NetworkRules: &storage.AccountNetworkRulesTypeArgs{ +// DefaultAction: pulumi.String("Deny"), +// IpRules: pulumi.StringArray{ +// pulumi.String("100.0.0.1"), +// }, +// VirtualNetworkSubnetIds: pulumi.StringArray{ +// exampleSubnet.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/accountNetworkRules.go b/sdk/go/azure/storage/accountNetworkRules.go index 0f61cb894c..2c57304e9d 100644 --- a/sdk/go/azure/storage/accountNetworkRules.go +++ b/sdk/go/azure/storage/accountNetworkRules.go @@ -21,6 +21,85 @@ import ( // // > **NOTE:** Deleting this resource updates the storage account back to the default values it had when the storage account was created. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.0.0.0/16"), +// }, +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.0.2.0/24"), +// }, +// ServiceEndpoints: pulumi.StringArray{ +// pulumi.String("Microsoft.Storage"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewAccountNetworkRules(ctx, "exampleAccountNetworkRules", &storage.AccountNetworkRulesArgs{ +// StorageAccountId: exampleAccount.ID(), +// DefaultAction: pulumi.String("Allow"), +// IpRules: pulumi.StringArray{ +// pulumi.String("127.0.0.1"), +// }, +// VirtualNetworkSubnetIds: pulumi.StringArray{ +// exampleSubnet.ID(), +// }, +// Bypasses: pulumi.StringArray{ +// pulumi.String("Metrics"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Account Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/blob.go b/sdk/go/azure/storage/blob.go index a03800b41b..edf5d50488 100644 --- a/sdk/go/azure/storage/blob.go +++ b/sdk/go/azure/storage/blob.go @@ -15,6 +15,58 @@ import ( // Manages a Blob within a Storage Container. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewBlob(ctx, "exampleBlob", &storage.BlobArgs{ +// StorageAccountName: exampleAccount.Name, +// StorageContainerName: exampleContainer.Name, +// Type: pulumi.String("Block"), +// Source: pulumi.NewFileAsset("some-local-file.zip"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/blobInventoryPolicy.go b/sdk/go/azure/storage/blobInventoryPolicy.go index 040382e9cc..cfe259085f 100644 --- a/sdk/go/azure/storage/blobInventoryPolicy.go +++ b/sdk/go/azure/storage/blobInventoryPolicy.go @@ -15,6 +15,71 @@ import ( // Manages a Storage Blob Inventory Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// BlobProperties: &storage.AccountBlobPropertiesArgs{ +// VersioningEnabled: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewBlobInventoryPolicy(ctx, "exampleBlobInventoryPolicy", &storage.BlobInventoryPolicyArgs{ +// StorageAccountId: exampleAccount.ID(), +// Rules: storage.BlobInventoryPolicyRuleArray{ +// &storage.BlobInventoryPolicyRuleArgs{ +// Name: pulumi.String("rule1"), +// StorageContainerName: exampleContainer.Name, +// Format: pulumi.String("Csv"), +// Schedule: pulumi.String("Daily"), +// Scope: pulumi.String("Container"), +// SchemaFields: pulumi.StringArray{ +// pulumi.String("Name"), +// pulumi.String("Last-Modified"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Blob Inventory Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/container.go b/sdk/go/azure/storage/container.go index ac58426526..9d46b63d93 100644 --- a/sdk/go/azure/storage/container.go +++ b/sdk/go/azure/storage/container.go @@ -15,6 +15,52 @@ import ( // Manages a Container within an Azure Storage Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Containers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/customerManagedKey.go b/sdk/go/azure/storage/customerManagedKey.go index 86dca85b93..73485259b0 100644 --- a/sdk/go/azure/storage/customerManagedKey.go +++ b/sdk/go/azure/storage/customerManagedKey.go @@ -17,6 +17,133 @@ import ( // // > **NOTE:** It's possible to define a Customer Managed Key both within the `storage.Account` resource via the `customerManagedKey` block and by using the `storage.CustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Storage Account, since there'll be conflicts. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// Identity: &storage.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// storage, err := keyvault.NewAccessPolicy(ctx, "storage", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: exampleAccount.Identity.ApplyT(func(identity storage.AccountIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// }, +// }) +// if err != nil { +// return err +// } +// client, err := keyvault.NewAccessPolicy(ctx, "client", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("Create"), +// pulumi.String("Delete"), +// pulumi.String("List"), +// pulumi.String("Restore"), +// pulumi.String("Recover"), +// pulumi.String("UnwrapKey"), +// pulumi.String("WrapKey"), +// pulumi.String("Purge"), +// pulumi.String("Encrypt"), +// pulumi.String("Decrypt"), +// pulumi.String("Sign"), +// pulumi.String("Verify"), +// pulumi.String("GetRotationPolicy"), +// pulumi.String("SetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("decrypt"), +// pulumi.String("encrypt"), +// pulumi.String("sign"), +// pulumi.String("unwrapKey"), +// pulumi.String("verify"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// client, +// storage, +// })) +// if err != nil { +// return err +// } +// _, err = storage.NewCustomerManagedKey(ctx, "exampleCustomerManagedKey", &storage.CustomerManagedKeyArgs{ +// StorageAccountId: exampleAccount.ID(), +// KeyVaultId: exampleKeyVault.ID(), +// KeyName: exampleKey.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Customer Managed Keys for a Storage Account can be imported using the `resource id` of the Storage Account, e.g. diff --git a/sdk/go/azure/storage/dataLakeGen2Filesystem.go b/sdk/go/azure/storage/dataLakeGen2Filesystem.go index 2c7b173d62..91f5798d4a 100644 --- a/sdk/go/azure/storage/dataLakeGen2Filesystem.go +++ b/sdk/go/azure/storage/dataLakeGen2Filesystem.go @@ -17,6 +17,53 @@ import ( // // > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// Properties: pulumi.StringMap{ +// "hello": pulumi.String("aGVsbG8="), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Lake Gen2 File System's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/dataLakeGen2Path.go b/sdk/go/azure/storage/dataLakeGen2Path.go index a8b8b622c4..df6c3c8116 100644 --- a/sdk/go/azure/storage/dataLakeGen2Path.go +++ b/sdk/go/azure/storage/dataLakeGen2Path.go @@ -17,6 +17,59 @@ import ( // // > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewDataLakeGen2Path(ctx, "exampleDataLakeGen2Path", &storage.DataLakeGen2PathArgs{ +// Path: pulumi.String("example"), +// FilesystemName: exampleDataLakeGen2Filesystem.Name, +// StorageAccountId: exampleAccount.ID(), +// Resource: pulumi.String("directory"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Data Lake Gen2 Paths can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/encryptionScope.go b/sdk/go/azure/storage/encryptionScope.go index a7040927e7..dbe1dc15b3 100644 --- a/sdk/go/azure/storage/encryptionScope.go +++ b/sdk/go/azure/storage/encryptionScope.go @@ -17,6 +17,52 @@ import ( // // > **Note:** Storage Encryption Scopes are in Preview [more information can be found here](https://docs.microsoft.com/azure/storage/blobs/encryption-scope-manage). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// Identity: &storage.AccountIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewEncryptionScope(ctx, "exampleEncryptionScope", &storage.EncryptionScopeArgs{ +// StorageAccountId: exampleAccount.ID(), +// Source: pulumi.String("Microsoft.Storage"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Encryption Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/getAccount.go b/sdk/go/azure/storage/getAccount.go index d024ce8cd8..ae4fb6b8ed 100644 --- a/sdk/go/azure/storage/getAccount.go +++ b/sdk/go/azure/storage/getAccount.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Storage Account. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := storage.LookupAccount(ctx, &storage.LookupAccountArgs{ +// Name: "packerimages", +// ResourceGroupName: pulumi.StringRef("packer-storage"), +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("storageAccountTier", example.AccountTier) +// return nil +// }) +// } +// +// ``` func LookupAccount(ctx *pulumi.Context, args *LookupAccountArgs, opts ...pulumi.InvokeOption) (*LookupAccountResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupAccountResult diff --git a/sdk/go/azure/storage/getAccountBlobContainerSAS.go b/sdk/go/azure/storage/getAccountBlobContainerSAS.go index fef082cd5d..b7c756531e 100644 --- a/sdk/go/azure/storage/getAccountBlobContainerSAS.go +++ b/sdk/go/azure/storage/getAccountBlobContainerSAS.go @@ -15,6 +15,73 @@ import ( // Use this data source to obtain a Shared Access Signature (SAS Token) for an existing Storage Account Blob Container. // // Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// rg, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// storage, err := storage.NewAccount(ctx, "storage", &storage.AccountArgs{ +// ResourceGroupName: rg.Name, +// Location: rg.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// container, err := storage.NewContainer(ctx, "container", &storage.ContainerArgs{ +// StorageAccountName: storage.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// example := storage.GetAccountBlobContainerSASOutput(ctx, storage.GetAccountBlobContainerSASOutputArgs{ +// ConnectionString: storage.PrimaryConnectionString, +// ContainerName: container.Name, +// HttpsOnly: pulumi.Bool(true), +// IpAddress: pulumi.String("168.1.5.65"), +// Start: pulumi.String("2018-03-21"), +// Expiry: pulumi.String("2018-03-21"), +// Permissions: &storage.GetAccountBlobContainerSASPermissionsArgs{ +// Read: pulumi.Bool(true), +// Add: pulumi.Bool(true), +// Create: pulumi.Bool(false), +// Write: pulumi.Bool(false), +// Delete: pulumi.Bool(true), +// List: pulumi.Bool(true), +// }, +// CacheControl: pulumi.String("max-age=5"), +// ContentDisposition: pulumi.String("inline"), +// ContentEncoding: pulumi.String("deflate"), +// ContentLanguage: pulumi.String("en-US"), +// ContentType: pulumi.String("application/json"), +// }, nil) +// ctx.Export("sasUrlQueryString", example.ApplyT(func(example storage.GetAccountBlobContainerSASResult) (*string, error) { +// return &example.Sas, nil +// }).(pulumi.StringPtrOutput)) +// return nil +// }) +// } +// +// ``` func GetAccountBlobContainerSAS(ctx *pulumi.Context, args *GetAccountBlobContainerSASArgs, opts ...pulumi.InvokeOption) (*GetAccountBlobContainerSASResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAccountBlobContainerSASResult diff --git a/sdk/go/azure/storage/getAccountSAS.go b/sdk/go/azure/storage/getAccountSAS.go index 9fdf7dd1c0..4ccb5aa850 100644 --- a/sdk/go/azure/storage/getAccountSAS.go +++ b/sdk/go/azure/storage/getAccountSAS.go @@ -18,6 +18,78 @@ import ( // // Note that this is an [Account SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas) // and *not* a [Service SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-a-service-sas). +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleAccountSAS := storage.GetAccountSASOutput(ctx, storage.GetAccountSASOutputArgs{ +// ConnectionString: exampleAccount.PrimaryConnectionString, +// HttpsOnly: pulumi.Bool(true), +// SignedVersion: pulumi.String("2017-07-29"), +// ResourceTypes: &storage.GetAccountSASResourceTypesArgs{ +// Service: pulumi.Bool(true), +// Container: pulumi.Bool(false), +// Object: pulumi.Bool(false), +// }, +// Services: &storage.GetAccountSASServicesArgs{ +// Blob: pulumi.Bool(true), +// Queue: pulumi.Bool(false), +// Table: pulumi.Bool(false), +// File: pulumi.Bool(false), +// }, +// Start: pulumi.String("2018-03-21T00:00:00Z"), +// Expiry: pulumi.String("2020-03-21T00:00:00Z"), +// Permissions: &storage.GetAccountSASPermissionsArgs{ +// Read: pulumi.Bool(true), +// Write: pulumi.Bool(true), +// Delete: pulumi.Bool(false), +// List: pulumi.Bool(false), +// Add: pulumi.Bool(true), +// Create: pulumi.Bool(true), +// Update: pulumi.Bool(false), +// Process: pulumi.Bool(false), +// Tag: pulumi.Bool(false), +// Filter: pulumi.Bool(false), +// }, +// }, nil) +// ctx.Export("sasUrlQueryString", exampleAccountSAS.ApplyT(func(exampleAccountSAS storage.GetAccountSASResult) (*string, error) { +// return &exampleAccountSAS.Sas, nil +// }).(pulumi.StringPtrOutput)) +// return nil +// }) +// } +// +// ``` func GetAccountSAS(ctx *pulumi.Context, args *GetAccountSASArgs, opts ...pulumi.InvokeOption) (*GetAccountSASResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetAccountSASResult diff --git a/sdk/go/azure/storage/getBlob.go b/sdk/go/azure/storage/getBlob.go index e033a6e9e4..017c5fa264 100644 --- a/sdk/go/azure/storage/getBlob.go +++ b/sdk/go/azure/storage/getBlob.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Storage Blob. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := storage.LookupBlob(ctx, &storage.LookupBlobArgs{ +// Name: "example-blob-name", +// StorageAccountName: "example-storage-account-name", +// StorageContainerName: "example-storage-container-name", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupBlob(ctx *pulumi.Context, args *LookupBlobArgs, opts ...pulumi.InvokeOption) (*LookupBlobResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupBlobResult diff --git a/sdk/go/azure/storage/getEncryptionScope.go b/sdk/go/azure/storage/getEncryptionScope.go index 61a8efdd43..df569fb849 100644 --- a/sdk/go/azure/storage/getEncryptionScope.go +++ b/sdk/go/azure/storage/getEncryptionScope.go @@ -13,6 +13,41 @@ import ( ) // Use this data source to access information about an existing Storage Encryption Scope. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := storage.LookupAccount(ctx, &storage.LookupAccountArgs{ +// Name: "storageaccountname", +// ResourceGroupName: pulumi.StringRef("resourcegroupname"), +// }, nil) +// if err != nil { +// return err +// } +// exampleEncryptionScope, err := storage.LookupEncryptionScope(ctx, &storage.LookupEncryptionScopeArgs{ +// Name: "existingStorageES", +// StorageAccountId: exampleAccount.Id, +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", exampleEncryptionScope.Id) +// return nil +// }) +// } +// +// ``` func LookupEncryptionScope(ctx *pulumi.Context, args *LookupEncryptionScopeArgs, opts ...pulumi.InvokeOption) (*LookupEncryptionScopeResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupEncryptionScopeResult diff --git a/sdk/go/azure/storage/getPolicy.go b/sdk/go/azure/storage/getPolicy.go index 3b598c985d..f28dd758a8 100644 --- a/sdk/go/azure/storage/getPolicy.go +++ b/sdk/go/azure/storage/getPolicy.go @@ -13,6 +13,39 @@ import ( ) // Use this data source to access information about an existing Storage Management Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleAccount, err := storage.LookupAccount(ctx, &storage.LookupAccountArgs{ +// Name: "storageaccountname", +// ResourceGroupName: pulumi.StringRef("resourcegroupname"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = storage.GetPolicy(ctx, &storage.GetPolicyArgs{ +// StorageAccountId: exampleAccount.Id, +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetPolicy(ctx *pulumi.Context, args *GetPolicyArgs, opts ...pulumi.InvokeOption) (*GetPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPolicyResult diff --git a/sdk/go/azure/storage/getShare.go b/sdk/go/azure/storage/getShare.go index a3ce92c6ed..96a595c4c4 100644 --- a/sdk/go/azure/storage/getShare.go +++ b/sdk/go/azure/storage/getShare.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing File Share. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := storage.LookupShare(ctx, &storage.LookupShareArgs{ +// Name: "existing", +// StorageAccountName: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupShare(ctx *pulumi.Context, args *LookupShareArgs, opts ...pulumi.InvokeOption) (*LookupShareResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupShareResult diff --git a/sdk/go/azure/storage/getStorageContainer.go b/sdk/go/azure/storage/getStorageContainer.go index b51328a802..5e871bca55 100644 --- a/sdk/go/azure/storage/getStorageContainer.go +++ b/sdk/go/azure/storage/getStorageContainer.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Storage Container. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := storage.GetStorageContainer(ctx, &storage.GetStorageContainerArgs{ +// Name: "example-container-name", +// StorageAccountName: "example-storage-account-name", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func GetStorageContainer(ctx *pulumi.Context, args *GetStorageContainerArgs, opts ...pulumi.InvokeOption) (*GetStorageContainerResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetStorageContainerResult diff --git a/sdk/go/azure/storage/getSync.go b/sdk/go/azure/storage/getSync.go index 64abfc8d9d..ccfb978a22 100644 --- a/sdk/go/azure/storage/getSync.go +++ b/sdk/go/azure/storage/getSync.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Storage Sync. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := storage.LookupSync(ctx, &storage.LookupSyncArgs{ +// Name: "existingStorageSyncName", +// ResourceGroupName: "existingResGroup", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupSync(ctx *pulumi.Context, args *LookupSyncArgs, opts ...pulumi.InvokeOption) (*LookupSyncResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSyncResult diff --git a/sdk/go/azure/storage/getSyncGroup.go b/sdk/go/azure/storage/getSyncGroup.go index 101acb621f..e915c3539c 100644 --- a/sdk/go/azure/storage/getSyncGroup.go +++ b/sdk/go/azure/storage/getSyncGroup.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Storage Sync Group. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := storage.LookupSyncGroup(ctx, &storage.LookupSyncGroupArgs{ +// Name: "existing-ss-group", +// StorageSyncId: "existing-ss-id", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupSyncGroup(ctx *pulumi.Context, args *LookupSyncGroupArgs, opts ...pulumi.InvokeOption) (*LookupSyncGroupResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupSyncGroupResult diff --git a/sdk/go/azure/storage/getTableEntity.go b/sdk/go/azure/storage/getTableEntity.go index d8b9e51da1..5a28da22a7 100644 --- a/sdk/go/azure/storage/getTableEntity.go +++ b/sdk/go/azure/storage/getTableEntity.go @@ -13,6 +13,35 @@ import ( ) // Use this data source to access information about an existing Storage Table Entity. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := storage.LookupTableEntity(ctx, &storage.LookupTableEntityArgs{ +// PartitionKey: "example-partition-key", +// RowKey: "example-row-key", +// StorageAccountName: "example-storage-account-name", +// TableName: "example-table-name", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupTableEntity(ctx *pulumi.Context, args *LookupTableEntityArgs, opts ...pulumi.InvokeOption) (*LookupTableEntityResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupTableEntityResult diff --git a/sdk/go/azure/storage/localUser.go b/sdk/go/azure/storage/localUser.go index f74962d957..d646ade12b 100644 --- a/sdk/go/azure/storage/localUser.go +++ b/sdk/go/azure/storage/localUser.go @@ -15,6 +15,79 @@ import ( // Manages a Storage Account Local User. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("WestEurope"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("StorageV2"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewLocalUser(ctx, "exampleLocalUser", &storage.LocalUserArgs{ +// StorageAccountId: exampleAccount.ID(), +// SshKeyEnabled: pulumi.Bool(true), +// SshPasswordEnabled: pulumi.Bool(true), +// HomeDirectory: pulumi.String("example_path"), +// SshAuthorizedKeys: storage.LocalUserSshAuthorizedKeyArray{ +// &storage.LocalUserSshAuthorizedKeyArgs{ +// Description: pulumi.String("key1"), +// Key: pulumi.Any(local.First_public_key), +// }, +// &storage.LocalUserSshAuthorizedKeyArgs{ +// Description: pulumi.String("key2"), +// Key: pulumi.Any(local.Second_public_key), +// }, +// }, +// PermissionScopes: storage.LocalUserPermissionScopeArray{ +// &storage.LocalUserPermissionScopeArgs{ +// Permissions: &storage.LocalUserPermissionScopePermissionsArgs{ +// Read: pulumi.Bool(true), +// Create: pulumi.Bool(true), +// }, +// Service: pulumi.String("blob"), +// ResourceName: exampleContainer.Name, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Account Local Users can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/managementPolicy.go b/sdk/go/azure/storage/managementPolicy.go index a3e550418f..1aa9c77e92 100644 --- a/sdk/go/azure/storage/managementPolicy.go +++ b/sdk/go/azure/storage/managementPolicy.go @@ -15,6 +15,110 @@ import ( // Manages an Azure Storage Account Management Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("BlobStorage"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewManagementPolicy(ctx, "exampleManagementPolicy", &storage.ManagementPolicyArgs{ +// StorageAccountId: exampleAccount.ID(), +// Rules: storage.ManagementPolicyRuleArray{ +// &storage.ManagementPolicyRuleArgs{ +// Name: pulumi.String("rule1"), +// Enabled: pulumi.Bool(true), +// Filters: &storage.ManagementPolicyRuleFiltersArgs{ +// PrefixMatches: pulumi.StringArray{ +// pulumi.String("container1/prefix1"), +// }, +// BlobTypes: pulumi.StringArray{ +// pulumi.String("blockBlob"), +// }, +// MatchBlobIndexTags: storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArray{ +// &storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs{ +// Name: pulumi.String("tag1"), +// Operation: pulumi.String("=="), +// Value: pulumi.String("val1"), +// }, +// }, +// }, +// Actions: &storage.ManagementPolicyRuleActionsArgs{ +// BaseBlob: &storage.ManagementPolicyRuleActionsBaseBlobArgs{ +// TierToCoolAfterDaysSinceModificationGreaterThan: pulumi.Int(10), +// TierToArchiveAfterDaysSinceModificationGreaterThan: pulumi.Int(50), +// DeleteAfterDaysSinceModificationGreaterThan: pulumi.Int(100), +// }, +// Snapshot: &storage.ManagementPolicyRuleActionsSnapshotArgs{ +// DeleteAfterDaysSinceCreationGreaterThan: pulumi.Int(30), +// }, +// }, +// }, +// &storage.ManagementPolicyRuleArgs{ +// Name: pulumi.String("rule2"), +// Enabled: pulumi.Bool(false), +// Filters: &storage.ManagementPolicyRuleFiltersArgs{ +// PrefixMatches: pulumi.StringArray{ +// pulumi.String("container2/prefix1"), +// pulumi.String("container2/prefix2"), +// }, +// BlobTypes: pulumi.StringArray{ +// pulumi.String("blockBlob"), +// }, +// }, +// Actions: &storage.ManagementPolicyRuleActionsArgs{ +// BaseBlob: &storage.ManagementPolicyRuleActionsBaseBlobArgs{ +// TierToCoolAfterDaysSinceModificationGreaterThan: pulumi.Int(11), +// TierToArchiveAfterDaysSinceModificationGreaterThan: pulumi.Int(51), +// DeleteAfterDaysSinceModificationGreaterThan: pulumi.Int(101), +// }, +// Snapshot: &storage.ManagementPolicyRuleActionsSnapshotArgs{ +// ChangeTierToArchiveAfterDaysSinceCreation: pulumi.Int(90), +// ChangeTierToCoolAfterDaysSinceCreation: pulumi.Int(23), +// DeleteAfterDaysSinceCreationGreaterThan: pulumi.Int(31), +// }, +// Version: &storage.ManagementPolicyRuleActionsVersionArgs{ +// ChangeTierToArchiveAfterDaysSinceCreation: pulumi.Int(9), +// ChangeTierToCoolAfterDaysSinceCreation: pulumi.Int(90), +// DeleteAfterDaysSinceCreation: pulumi.Int(3), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Account Management Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/mover.go b/sdk/go/azure/storage/mover.go index a26d4a1b30..d25196067f 100644 --- a/sdk/go/azure/storage/mover.go +++ b/sdk/go/azure/storage/mover.go @@ -15,6 +15,44 @@ import ( // Manages a Storage Mover. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewMover(ctx, "exampleMover", &storage.MoverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// Description: pulumi.String("Example Storage Mover Description"), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Mover can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/moverAgent.go b/sdk/go/azure/storage/moverAgent.go index 9c1aaae971..eb11d54a83 100644 --- a/sdk/go/azure/storage/moverAgent.go +++ b/sdk/go/azure/storage/moverAgent.go @@ -15,6 +15,52 @@ import ( // Manages a Storage Mover Agent. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// exampleMover, err := storage.NewMover(ctx, "exampleMover", &storage.MoverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewMoverAgent(ctx, "exampleMoverAgent", &storage.MoverAgentArgs{ +// StorageMoverId: exampleMover.ID(), +// ArcVirtualMachineId: exampleResourceGroup.ID().ApplyT(func(id string) (string, error) { +// return fmt.Sprintf("%v/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", id), nil +// }).(pulumi.StringOutput), +// ArcVirtualMachineUuid: pulumi.String("3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9"), +// Description: pulumi.String("Example Agent Description"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Mover Agent can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/moverJobDefinition.go b/sdk/go/azure/storage/moverJobDefinition.go index 84fe180685..f4e5c565d3 100644 --- a/sdk/go/azure/storage/moverJobDefinition.go +++ b/sdk/go/azure/storage/moverJobDefinition.go @@ -15,6 +15,103 @@ import ( // Manages a Storage Mover Job Definition. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleMover, err := storage.NewMover(ctx, "exampleMover", &storage.MoverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleMoverAgent, err := storage.NewMoverAgent(ctx, "exampleMoverAgent", &storage.MoverAgentArgs{ +// StorageMoverId: exampleMover.ID(), +// ArcVirtualMachineId: exampleResourceGroup.ID().ApplyT(func(id string) (string, error) { +// return fmt.Sprintf("%v/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName", id), nil +// }).(pulumi.StringOutput), +// ArcVirtualMachineUuid: pulumi.String("3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AllowNestedItemsToBePublic: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("blob"), +// }) +// if err != nil { +// return err +// } +// exampleMoverTargetEndpoint, err := storage.NewMoverTargetEndpoint(ctx, "exampleMoverTargetEndpoint", &storage.MoverTargetEndpointArgs{ +// StorageMoverId: exampleMover.ID(), +// StorageAccountId: exampleAccount.ID(), +// StorageContainerName: exampleContainer.Name, +// }) +// if err != nil { +// return err +// } +// exampleMoverSourceEndpoint, err := storage.NewMoverSourceEndpoint(ctx, "exampleMoverSourceEndpoint", &storage.MoverSourceEndpointArgs{ +// StorageMoverId: exampleMover.ID(), +// Host: pulumi.String("192.168.0.1"), +// }) +// if err != nil { +// return err +// } +// exampleMoverProject, err := storage.NewMoverProject(ctx, "exampleMoverProject", &storage.MoverProjectArgs{ +// StorageMoverId: exampleMover.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewMoverJobDefinition(ctx, "exampleMoverJobDefinition", &storage.MoverJobDefinitionArgs{ +// StorageMoverProjectId: exampleMoverProject.ID(), +// AgentName: exampleMoverAgent.Name, +// CopyMode: pulumi.String("Additive"), +// SourceName: exampleMoverSourceEndpoint.Name, +// SourceSubPath: pulumi.String("/"), +// TargetName: exampleMoverTargetEndpoint.Name, +// TargetSubPath: pulumi.String("/"), +// Description: pulumi.String("Example Job Definition Description"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Mover Job Definition can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/moverProject.go b/sdk/go/azure/storage/moverProject.go index 4916f7c13e..1ca4a0090e 100644 --- a/sdk/go/azure/storage/moverProject.go +++ b/sdk/go/azure/storage/moverProject.go @@ -15,6 +15,47 @@ import ( // Manages a Storage Mover Project. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleMover, err := storage.NewMover(ctx, "exampleMover", &storage.MoverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewMoverProject(ctx, "exampleMoverProject", &storage.MoverProjectArgs{ +// StorageMoverId: exampleMover.ID(), +// Description: pulumi.String("Example Project Description"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Mover Project can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/moverSourceEndpoint.go b/sdk/go/azure/storage/moverSourceEndpoint.go index 57728142e8..2d199edc20 100644 --- a/sdk/go/azure/storage/moverSourceEndpoint.go +++ b/sdk/go/azure/storage/moverSourceEndpoint.go @@ -15,6 +15,49 @@ import ( // Manages a Storage Mover Source Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleMover, err := storage.NewMover(ctx, "exampleMover", &storage.MoverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewMoverSourceEndpoint(ctx, "exampleMoverSourceEndpoint", &storage.MoverSourceEndpointArgs{ +// StorageMoverId: exampleMover.ID(), +// Export: pulumi.String("/"), +// Host: pulumi.String("192.168.0.1"), +// NfsVersion: pulumi.String("NFSv3"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Mover Source Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/moverTargetEndpoint.go b/sdk/go/azure/storage/moverTargetEndpoint.go index 2d63d95fe9..707978a725 100644 --- a/sdk/go/azure/storage/moverTargetEndpoint.go +++ b/sdk/go/azure/storage/moverTargetEndpoint.go @@ -15,6 +15,66 @@ import ( // Manages a Storage Mover Target Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AllowNestedItemsToBePublic: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("blob"), +// }) +// if err != nil { +// return err +// } +// exampleMover, err := storage.NewMover(ctx, "exampleMover", &storage.MoverArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewMoverTargetEndpoint(ctx, "exampleMoverTargetEndpoint", &storage.MoverTargetEndpointArgs{ +// StorageMoverId: exampleMover.ID(), +// StorageAccountId: exampleAccount.ID(), +// StorageContainerName: exampleContainer.Name, +// Description: pulumi.String("Example Storage Container Endpoint Description"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Mover Target Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/objectReplication.go b/sdk/go/azure/storage/objectReplication.go index 3cca3d7857..7d0f60cad9 100644 --- a/sdk/go/azure/storage/objectReplication.go +++ b/sdk/go/azure/storage/objectReplication.go @@ -15,6 +15,92 @@ import ( // Manages a Storage Object Replication. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// srcResourceGroup, err := core.NewResourceGroup(ctx, "srcResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// srcAccount, err := storage.NewAccount(ctx, "srcAccount", &storage.AccountArgs{ +// ResourceGroupName: srcResourceGroup.Name, +// Location: srcResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// BlobProperties: &storage.AccountBlobPropertiesArgs{ +// VersioningEnabled: pulumi.Bool(true), +// ChangeFeedEnabled: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// srcContainer, err := storage.NewContainer(ctx, "srcContainer", &storage.ContainerArgs{ +// StorageAccountName: srcAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// dstResourceGroup, err := core.NewResourceGroup(ctx, "dstResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("East US"), +// }) +// if err != nil { +// return err +// } +// dstAccount, err := storage.NewAccount(ctx, "dstAccount", &storage.AccountArgs{ +// ResourceGroupName: dstResourceGroup.Name, +// Location: dstResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// BlobProperties: &storage.AccountBlobPropertiesArgs{ +// VersioningEnabled: pulumi.Bool(true), +// ChangeFeedEnabled: pulumi.Bool(true), +// }, +// }) +// if err != nil { +// return err +// } +// dstContainer, err := storage.NewContainer(ctx, "dstContainer", &storage.ContainerArgs{ +// StorageAccountName: dstAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewObjectReplication(ctx, "example", &storage.ObjectReplicationArgs{ +// SourceStorageAccountId: srcAccount.ID(), +// DestinationStorageAccountId: dstAccount.ID(), +// Rules: storage.ObjectReplicationRuleArray{ +// &storage.ObjectReplicationRuleArgs{ +// SourceContainerName: srcContainer.Name, +// DestinationContainerName: dstContainer.Name, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Object Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/queue.go b/sdk/go/azure/storage/queue.go index ce999294d8..9fe9848f89 100644 --- a/sdk/go/azure/storage/queue.go +++ b/sdk/go/azure/storage/queue.go @@ -15,6 +15,48 @@ import ( // Manages a Queue within an Azure Storage Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewQueue(ctx, "exampleQueue", &storage.QueueArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/share.go b/sdk/go/azure/storage/share.go index e99d4d7d2b..8690f756c9 100644 --- a/sdk/go/azure/storage/share.go +++ b/sdk/go/azure/storage/share.go @@ -17,6 +17,61 @@ import ( // // > **Note:** The storage share supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts. For further information, refer to the section "What storage tiers are supported in Azure Files?" of [documentation](https://docs.microsoft.com/azure/storage/files/storage-files-faq#general). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewShare(ctx, "exampleShare", &storage.ShareArgs{ +// StorageAccountName: exampleAccount.Name, +// Quota: pulumi.Int(50), +// Acls: storage.ShareAclArray{ +// &storage.ShareAclArgs{ +// Id: pulumi.String("MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"), +// AccessPolicies: storage.ShareAclAccessPolicyArray{ +// &storage.ShareAclAccessPolicyArgs{ +// Permissions: pulumi.String("rwdl"), +// Start: pulumi.String("2019-07-02T09:38:21.0000000Z"), +// Expiry: pulumi.String("2019-07-02T10:38:21.0000000Z"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Shares can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/shareDirectory.go b/sdk/go/azure/storage/shareDirectory.go index 350eb8eaa4..8316fab6d4 100644 --- a/sdk/go/azure/storage/shareDirectory.go +++ b/sdk/go/azure/storage/shareDirectory.go @@ -15,6 +15,56 @@ import ( // Manages a Directory within an Azure Storage File Share. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleShare, err := storage.NewShare(ctx, "exampleShare", &storage.ShareArgs{ +// StorageAccountName: exampleAccount.Name, +// Quota: pulumi.Int(50), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewShareDirectory(ctx, "exampleShareDirectory", &storage.ShareDirectoryArgs{ +// ShareName: exampleShare.Name, +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/shareFile.go b/sdk/go/azure/storage/shareFile.go index 92925d27a2..39cfb60f0a 100644 --- a/sdk/go/azure/storage/shareFile.go +++ b/sdk/go/azure/storage/shareFile.go @@ -15,6 +15,56 @@ import ( // Manages a File within an Azure Storage File Share. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleShare, err := storage.NewShare(ctx, "exampleShare", &storage.ShareArgs{ +// StorageAccountName: exampleAccount.Name, +// Quota: pulumi.Int(50), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewShareFile(ctx, "exampleShareFile", &storage.ShareFileArgs{ +// StorageShareId: exampleShare.ID(), +// Source: pulumi.String("some-local-file.zip"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/sync.go b/sdk/go/azure/storage/sync.go index 37e7435b46..95ea730c1d 100644 --- a/sdk/go/azure/storage/sync.go +++ b/sdk/go/azure/storage/sync.go @@ -15,6 +15,43 @@ import ( // Manages a Storage Sync. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewSync(ctx, "exampleSync", &storage.SyncArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Tags: pulumi.StringMap{ +// "foo": pulumi.String("bar"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Syncs can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/syncCloudEndpoint.go b/sdk/go/azure/storage/syncCloudEndpoint.go index c88dab94a6..d70940c596 100644 --- a/sdk/go/azure/storage/syncCloudEndpoint.go +++ b/sdk/go/azure/storage/syncCloudEndpoint.go @@ -17,6 +17,80 @@ import ( // // > **NOTE:** Please ensure Azure File Sync has access to the storage account in your subscription, which indicates that `Microsoft.StorageSync` is assigned role `Reader and Data Access` ( refer to details [here](https://docs.microsoft.com/azure/storage/files/storage-sync-files-troubleshoot?tabs=portal1%2Cazure-portal#common-troubleshooting-steps)). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSync, err := storage.NewSync(ctx, "exampleSync", &storage.SyncArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleSyncGroup, err := storage.NewSyncGroup(ctx, "exampleSyncGroup", &storage.SyncGroupArgs{ +// StorageSyncId: exampleSync.ID(), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleShare, err := storage.NewShare(ctx, "exampleShare", &storage.ShareArgs{ +// StorageAccountName: exampleAccount.Name, +// Quota: pulumi.Int(50), +// Acls: storage.ShareAclArray{ +// &storage.ShareAclArgs{ +// Id: pulumi.String("GhostedRecall"), +// AccessPolicies: storage.ShareAclAccessPolicyArray{ +// &storage.ShareAclAccessPolicyArgs{ +// Permissions: pulumi.String("r"), +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewSyncCloudEndpoint(ctx, "exampleSyncCloudEndpoint", &storage.SyncCloudEndpointArgs{ +// StorageSyncGroupId: exampleSyncGroup.ID(), +// FileShareName: exampleShare.Name, +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Sync Cloud Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/syncGroup.go b/sdk/go/azure/storage/syncGroup.go index 1fd855e36a..31e8dc2c2f 100644 --- a/sdk/go/azure/storage/syncGroup.go +++ b/sdk/go/azure/storage/syncGroup.go @@ -15,6 +15,46 @@ import ( // Manages a Storage Sync Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleSync, err := storage.NewSync(ctx, "exampleSync", &storage.SyncArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewSyncGroup(ctx, "exampleSyncGroup", &storage.SyncGroupArgs{ +// StorageSyncId: exampleSync.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Storage Sync Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/table.go b/sdk/go/azure/storage/table.go index 3d3444c392..587bb7bc34 100644 --- a/sdk/go/azure/storage/table.go +++ b/sdk/go/azure/storage/table.go @@ -15,6 +15,48 @@ import ( // Manages a Table within an Azure Storage Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewTable(ctx, "exampleTable", &storage.TableArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Table's within a Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/storage/tableEntity.go b/sdk/go/azure/storage/tableEntity.go index 825ee94e95..dd058d563a 100644 --- a/sdk/go/azure/storage/tableEntity.go +++ b/sdk/go/azure/storage/tableEntity.go @@ -15,6 +15,60 @@ import ( // Manages an Entity within a Table in an Azure Storage Account. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleTable, err := storage.NewTable(ctx, "exampleTable", &storage.TableArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewTableEntity(ctx, "exampleTableEntity", &storage.TableEntityArgs{ +// StorageAccountName: exampleAccount.Name, +// TableName: exampleTable.Name, +// PartitionKey: pulumi.String("examplepartition"), +// RowKey: pulumi.String("examplerow"), +// Entity: pulumi.StringMap{ +// "example": pulumi.String("example"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Entities within a Table in an Azure Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/cluster.go b/sdk/go/azure/streamanalytics/cluster.go index 708ffd38e1..6a950a6a5c 100644 --- a/sdk/go/azure/streamanalytics/cluster.go +++ b/sdk/go/azure/streamanalytics/cluster.go @@ -15,6 +15,41 @@ import ( // Manages a Stream Analytics Cluster. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewCluster(ctx, "exampleCluster", &streamanalytics.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StreamingCapacity: pulumi.Int(36), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/functionJavaScriptUDF.go b/sdk/go/azure/streamanalytics/functionJavaScriptUDF.go index f5cbe110b8..b178b4c482 100644 --- a/sdk/go/azure/streamanalytics/functionJavaScriptUDF.go +++ b/sdk/go/azure/streamanalytics/functionJavaScriptUDF.go @@ -15,6 +15,56 @@ import ( // Manages a JavaScript UDF Function within Stream Analytics Streaming Job. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{ +// Name: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{ +// Name: "example-job", +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewFunctionJavaScriptUDF(ctx, "exampleFunctionJavaScriptUDF", &streamanalytics.FunctionJavaScriptUDFArgs{ +// StreamAnalyticsJobName: *pulumi.String(exampleJob.Name), +// ResourceGroupName: *pulumi.String(exampleJob.ResourceGroupName), +// Script: pulumi.String("function getRandomNumber(in) {\n return in;\n}\n"), +// Inputs: streamanalytics.FunctionJavaScriptUDFInputTypeArray{ +// &streamanalytics.FunctionJavaScriptUDFInputTypeArgs{ +// Type: pulumi.String("bigint"), +// }, +// }, +// Output: &streamanalytics.FunctionJavaScriptUDFOutputTypeArgs{ +// Type: pulumi.String("bigint"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics JavaScript UDF Functions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/functionJavascriptUda.go b/sdk/go/azure/streamanalytics/functionJavascriptUda.go index ee67fc3f47..e1065378e3 100644 --- a/sdk/go/azure/streamanalytics/functionJavascriptUda.go +++ b/sdk/go/azure/streamanalytics/functionJavascriptUda.go @@ -15,6 +15,70 @@ import ( // Manages a JavaScript UDA Function within a Stream Analytics Streaming Job. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{ +// Name: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{ +// Name: "example-job", +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewFunctionJavascriptUda(ctx, "exampleFunctionJavascriptUda", &streamanalytics.FunctionJavascriptUdaArgs{ +// StreamAnalyticsJobId: *pulumi.String(exampleJob.Id), +// Script: pulumi.String(`function main() { +// this.init = function () { +// this.state = 0; +// } +// +// this.accumulate = function (value, timestamp) { +// this.state += value; +// } +// +// this.computeResult = function () { +// return this.state; +// } +// } +// +// `), +// +// Inputs: streamanalytics.FunctionJavascriptUdaInputTypeArray{ +// &streamanalytics.FunctionJavascriptUdaInputTypeArgs{ +// Type: pulumi.String("bigint"), +// }, +// }, +// Output: &streamanalytics.FunctionJavascriptUdaOutputTypeArgs{ +// Type: pulumi.String("bigint"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics JavaScript UDA Functions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/getJob.go b/sdk/go/azure/streamanalytics/getJob.go index 646c587566..e8438cf9e9 100644 --- a/sdk/go/azure/streamanalytics/getJob.go +++ b/sdk/go/azure/streamanalytics/getJob.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Stream Analytics Job. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{ +// Name: "example-job", +// ResourceGroupName: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("jobId", example.JobId) +// return nil +// }) +// } +// +// ``` func LookupJob(ctx *pulumi.Context, args *LookupJobArgs, opts ...pulumi.InvokeOption) (*LookupJobResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupJobResult diff --git a/sdk/go/azure/streamanalytics/job.go b/sdk/go/azure/streamanalytics/job.go index a159aa81a0..50c76f5e73 100644 --- a/sdk/go/azure/streamanalytics/job.go +++ b/sdk/go/azure/streamanalytics/job.go @@ -15,6 +15,51 @@ import ( // Manages a Stream Analytics Job. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewJob(ctx, "exampleJob", &streamanalytics.JobArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CompatibilityLevel: pulumi.String("1.2"), +// DataLocale: pulumi.String("en-GB"), +// EventsLateArrivalMaxDelayInSeconds: pulumi.Int(60), +// EventsOutOfOrderMaxDelayInSeconds: pulumi.Int(50), +// EventsOutOfOrderPolicy: pulumi.String("Adjust"), +// OutputErrorPolicy: pulumi.String("Drop"), +// StreamingUnits: pulumi.Int(3), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Example"), +// }, +// TransformationQuery: pulumi.String(" SELECT *\n INTO [YourOutputAlias]\n FROM [YourInputAlias]\n"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/jobSchedule.go b/sdk/go/azure/streamanalytics/jobSchedule.go index e55de87b0d..907c10dddd 100644 --- a/sdk/go/azure/streamanalytics/jobSchedule.go +++ b/sdk/go/azure/streamanalytics/jobSchedule.go @@ -15,6 +15,123 @@ import ( // Manages a Stream Analytics Job Schedule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewBlob(ctx, "exampleBlob", &storage.BlobArgs{ +// StorageAccountName: exampleAccount.Name, +// StorageContainerName: exampleContainer.Name, +// Type: pulumi.String("Block"), +// Source: pulumi.NewFileAsset("example.csv"), +// }) +// if err != nil { +// return err +// } +// exampleJob, err := streamanalytics.NewJob(ctx, "exampleJob", &streamanalytics.JobArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CompatibilityLevel: pulumi.String("1.2"), +// DataLocale: pulumi.String("en-GB"), +// EventsLateArrivalMaxDelayInSeconds: pulumi.Int(60), +// EventsOutOfOrderMaxDelayInSeconds: pulumi.Int(50), +// EventsOutOfOrderPolicy: pulumi.String("Adjust"), +// OutputErrorPolicy: pulumi.String("Drop"), +// StreamingUnits: pulumi.Int(3), +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Example"), +// }, +// TransformationQuery: pulumi.String(" SELECT *\n INTO [exampleoutput]\n FROM [exampleinput]\n"), +// }) +// if err != nil { +// return err +// } +// exampleStreamInputBlob, err := streamanalytics.NewStreamInputBlob(ctx, "exampleStreamInputBlob", &streamanalytics.StreamInputBlobArgs{ +// StreamAnalyticsJobName: exampleJob.Name, +// ResourceGroupName: exampleJob.ResourceGroupName, +// StorageAccountName: exampleAccount.Name, +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// StorageContainerName: exampleContainer.Name, +// PathPattern: pulumi.String(""), +// DateFormat: pulumi.String("yyyy/MM/dd"), +// TimeFormat: pulumi.String("HH"), +// Serialization: &streamanalytics.StreamInputBlobSerializationArgs{ +// Type: pulumi.String("Csv"), +// Encoding: pulumi.String("UTF8"), +// FieldDelimiter: pulumi.String(","), +// }, +// }) +// if err != nil { +// return err +// } +// exampleOutputBlob, err := streamanalytics.NewOutputBlob(ctx, "exampleOutputBlob", &streamanalytics.OutputBlobArgs{ +// StreamAnalyticsJobName: exampleJob.Name, +// ResourceGroupName: exampleJob.ResourceGroupName, +// StorageAccountName: exampleAccount.Name, +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// StorageContainerName: exampleContainer.Name, +// PathPattern: pulumi.String("example-{date}-{time}"), +// DateFormat: pulumi.String("yyyy-MM-dd"), +// TimeFormat: pulumi.String("HH"), +// Serialization: &streamanalytics.OutputBlobSerializationArgs{ +// Type: pulumi.String("Avro"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewJobSchedule(ctx, "exampleJobSchedule", &streamanalytics.JobScheduleArgs{ +// StreamAnalyticsJobId: exampleJob.ID(), +// StartMode: pulumi.String("CustomTime"), +// StartTime: pulumi.String("2022-09-21T00:00:00Z"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleJob, +// exampleStreamInputBlob, +// exampleOutputBlob, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/managedPrivateEndpoint.go b/sdk/go/azure/streamanalytics/managedPrivateEndpoint.go index a71a42f114..828efae71e 100644 --- a/sdk/go/azure/streamanalytics/managedPrivateEndpoint.go +++ b/sdk/go/azure/streamanalytics/managedPrivateEndpoint.go @@ -15,6 +15,62 @@ import ( // Manages a Stream Analytics Managed Private Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleCluster, err := streamanalytics.NewCluster(ctx, "exampleCluster", &streamanalytics.ClusterArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StreamingCapacity: pulumi.Int(36), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewManagedPrivateEndpoint(ctx, "exampleManagedPrivateEndpoint", &streamanalytics.ManagedPrivateEndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// StreamAnalyticsClusterName: exampleCluster.Name, +// TargetResourceId: exampleAccount.ID(), +// SubresourceName: pulumi.String("blob"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Private Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputBlob.go b/sdk/go/azure/streamanalytics/outputBlob.go index f83a59f549..0992611d7c 100644 --- a/sdk/go/azure/streamanalytics/outputBlob.go +++ b/sdk/go/azure/streamanalytics/outputBlob.go @@ -15,6 +15,76 @@ import ( // Manages a Stream Analytics Output to Blob Storage. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputBlob(ctx, "exampleOutputBlob", &streamanalytics.OutputBlobArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// StorageAccountName: exampleAccount.Name, +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// StorageContainerName: exampleContainer.Name, +// PathPattern: pulumi.String("some-pattern"), +// DateFormat: pulumi.String("yyyy-MM-dd"), +// TimeFormat: pulumi.String("HH"), +// Serialization: &streamanalytics.OutputBlobSerializationArgs{ +// Type: pulumi.String("Csv"), +// Encoding: pulumi.String("UTF8"), +// FieldDelimiter: pulumi.String(","), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Outputs to Blob Storage can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputCosmosdb.go b/sdk/go/azure/streamanalytics/outputCosmosdb.go index cd4be7a1bd..4c49dbd854 100644 --- a/sdk/go/azure/streamanalytics/outputCosmosdb.go +++ b/sdk/go/azure/streamanalytics/outputCosmosdb.go @@ -15,6 +15,87 @@ import ( // Manages a Stream Analytics Output to CosmosDB. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cosmosdb" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleAccount, err := cosmosdb.NewAccount(ctx, "exampleAccount", &cosmosdb.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// OfferType: pulumi.String("Standard"), +// Kind: pulumi.String("GlobalDocumentDB"), +// ConsistencyPolicy: &cosmosdb.AccountConsistencyPolicyArgs{ +// ConsistencyLevel: pulumi.String("BoundedStaleness"), +// MaxIntervalInSeconds: pulumi.Int(10), +// MaxStalenessPrefix: pulumi.Int(200), +// }, +// GeoLocations: cosmosdb.AccountGeoLocationArray{ +// &cosmosdb.AccountGeoLocationArgs{ +// Location: exampleResourceGroup.Location, +// FailoverPriority: pulumi.Int(0), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlDatabase, err := cosmosdb.NewSqlDatabase(ctx, "exampleSqlDatabase", &cosmosdb.SqlDatabaseArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// Throughput: pulumi.Int(400), +// }) +// if err != nil { +// return err +// } +// exampleSqlContainer, err := cosmosdb.NewSqlContainer(ctx, "exampleSqlContainer", &cosmosdb.SqlContainerArgs{ +// ResourceGroupName: exampleAccount.ResourceGroupName, +// AccountName: exampleAccount.Name, +// DatabaseName: exampleSqlDatabase.Name, +// PartitionKeyPath: pulumi.String("foo"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputCosmosdb(ctx, "exampleOutputCosmosdb", &streamanalytics.OutputCosmosdbArgs{ +// StreamAnalyticsJobId: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Id, nil +// }).(pulumi.StringPtrOutput), +// CosmosdbAccountKey: exampleAccount.PrimaryKey, +// CosmosdbSqlDatabaseId: exampleSqlDatabase.ID(), +// ContainerName: exampleSqlContainer.Name, +// DocumentId: pulumi.String("exampledocumentid"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Outputs for CosmosDB can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputEventHub.go b/sdk/go/azure/streamanalytics/outputEventHub.go index 247d77cf98..3a87f87adb 100644 --- a/sdk/go/azure/streamanalytics/outputEventHub.go +++ b/sdk/go/azure/streamanalytics/outputEventHub.go @@ -15,6 +15,74 @@ import ( // Manages a Stream Analytics Output to an EventHub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputEventHub(ctx, "exampleOutputEventHub", &streamanalytics.OutputEventHubArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// EventhubName: exampleEventHub.Name, +// ServicebusNamespace: exampleEventHubNamespace.Name, +// SharedAccessPolicyKey: exampleEventHubNamespace.DefaultPrimaryKey, +// SharedAccessPolicyName: pulumi.String("RootManageSharedAccessKey"), +// Serialization: &streamanalytics.OutputEventHubSerializationArgs{ +// Type: pulumi.String("Avro"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Outputs to an EventHub can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputFunction.go b/sdk/go/azure/streamanalytics/outputFunction.go index b358a785a1..635cb34e15 100644 --- a/sdk/go/azure/streamanalytics/outputFunction.go +++ b/sdk/go/azure/streamanalytics/outputFunction.go @@ -15,6 +15,88 @@ import ( // Manages a Stream Analytics Output Function. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Kind: pulumi.Any("FunctionApp"), +// Reserved: pulumi.Bool(true), +// Sku: &appservice.PlanSkuArgs{ +// Tier: pulumi.String("Dynamic"), +// Size: pulumi.String("Y1"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleFunctionApp, err := appservice.NewFunctionApp(ctx, "exampleFunctionApp", &appservice.FunctionAppArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AppServicePlanId: examplePlan.ID(), +// StorageAccountName: exampleAccount.Name, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// OsType: pulumi.String("linux"), +// Version: pulumi.String("~3"), +// }) +// if err != nil { +// return err +// } +// exampleJob, err := streamanalytics.NewJob(ctx, "exampleJob", &streamanalytics.JobArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StreamingUnits: pulumi.Int(3), +// TransformationQuery: pulumi.String(" SELECT *\n INTO [YourOutputAlias]\n FROM [YourInputAlias]\n"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputFunction(ctx, "exampleOutputFunction", &streamanalytics.OutputFunctionArgs{ +// ResourceGroupName: exampleJob.ResourceGroupName, +// StreamAnalyticsJobName: exampleJob.Name, +// FunctionApp: exampleFunctionApp.Name, +// FunctionName: pulumi.String("examplefunctionname"), +// ApiKey: pulumi.String("exampleapikey"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Output Functions can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputMssql.go b/sdk/go/azure/streamanalytics/outputMssql.go index e7d05557dd..b5a55457f1 100644 --- a/sdk/go/azure/streamanalytics/outputMssql.go +++ b/sdk/go/azure/streamanalytics/outputMssql.go @@ -15,6 +15,76 @@ import ( // Manages a Stream Analytics Output to Microsoft SQL Server Database. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleSqlServer, err := sql.NewSqlServer(ctx, "exampleSqlServer", &sql.SqlServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("dbadmin"), +// AdministratorLoginPassword: pulumi.String("example-password"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := sql.NewDatabase(ctx, "exampleDatabase", &sql.DatabaseArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// ServerName: exampleSqlServer.Name, +// RequestedServiceObjectiveName: pulumi.String("S0"), +// Collation: pulumi.String("SQL_LATIN1_GENERAL_CP1_CI_AS"), +// MaxSizeBytes: pulumi.String("268435456000"), +// CreateMode: pulumi.String("Default"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputMssql(ctx, "exampleOutputMssql", &streamanalytics.OutputMssqlArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// Server: exampleSqlServer.FullyQualifiedDomainName, +// User: exampleSqlServer.AdministratorLogin, +// Password: exampleSqlServer.AdministratorLoginPassword, +// Database: exampleDatabase.Name, +// Table: pulumi.String("ExampleTable"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Outputs to Microsoft SQL Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputPowerbi.go b/sdk/go/azure/streamanalytics/outputPowerbi.go index af9655c6f7..bc2709b987 100644 --- a/sdk/go/azure/streamanalytics/outputPowerbi.go +++ b/sdk/go/azure/streamanalytics/outputPowerbi.go @@ -15,6 +15,50 @@ import ( // Manages a Stream Analytics Output powerBI. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{ +// Name: "example-resources", +// }, nil) +// if err != nil { +// return err +// } +// exampleJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{ +// Name: "example-job", +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputPowerbi(ctx, "exampleOutputPowerbi", &streamanalytics.OutputPowerbiArgs{ +// StreamAnalyticsJobId: *pulumi.String(exampleJob.Id), +// Dataset: pulumi.String("example-dataset"), +// Table: pulumi.String("example-table"), +// GroupId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// GroupName: pulumi.String("some-group-name"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Output to Power BI can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputServiceBusQueue.go b/sdk/go/azure/streamanalytics/outputServiceBusQueue.go index 9467015b77..2ccc7db589 100644 --- a/sdk/go/azure/streamanalytics/outputServiceBusQueue.go +++ b/sdk/go/azure/streamanalytics/outputServiceBusQueue.go @@ -15,6 +15,72 @@ import ( // Manages a Stream Analytics Output to a ServiceBus Queue. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleQueue, err := servicebus.NewQueue(ctx, "exampleQueue", &servicebus.QueueArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputServiceBusQueue(ctx, "exampleOutputServiceBusQueue", &streamanalytics.OutputServiceBusQueueArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// QueueName: exampleQueue.Name, +// ServicebusNamespace: exampleNamespace.Name, +// SharedAccessPolicyKey: exampleNamespace.DefaultPrimaryKey, +// SharedAccessPolicyName: pulumi.String("RootManageSharedAccessKey"), +// Serialization: &streamanalytics.OutputServiceBusQueueSerializationArgs{ +// Type: pulumi.String("Csv"), +// Format: pulumi.String("Array"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Output ServiceBus Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputServicebusTopic.go b/sdk/go/azure/streamanalytics/outputServicebusTopic.go index cc849830a6..87edf4ecfa 100644 --- a/sdk/go/azure/streamanalytics/outputServicebusTopic.go +++ b/sdk/go/azure/streamanalytics/outputServicebusTopic.go @@ -15,6 +15,76 @@ import ( // Manages a Stream Analytics Output to a ServiceBus Topic. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleNamespace, err := servicebus.NewNamespace(ctx, "exampleNamespace", &servicebus.NamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// }) +// if err != nil { +// return err +// } +// exampleTopic, err := servicebus.NewTopic(ctx, "exampleTopic", &servicebus.TopicArgs{ +// NamespaceId: exampleNamespace.ID(), +// EnablePartitioning: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputServicebusTopic(ctx, "exampleOutputServicebusTopic", &streamanalytics.OutputServicebusTopicArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// TopicName: exampleTopic.Name, +// ServicebusNamespace: exampleNamespace.Name, +// SharedAccessPolicyKey: exampleNamespace.DefaultPrimaryKey, +// SharedAccessPolicyName: pulumi.String("RootManageSharedAccessKey"), +// PropertyColumns: pulumi.StringArray{ +// pulumi.String("col1"), +// pulumi.String("col2"), +// }, +// Serialization: &streamanalytics.OutputServicebusTopicSerializationArgs{ +// Type: pulumi.String("Csv"), +// Format: pulumi.String("Array"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Output ServiceBus Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputSynapse.go b/sdk/go/azure/streamanalytics/outputSynapse.go index 57b11ed4f0..4f0beef330 100644 --- a/sdk/go/azure/streamanalytics/outputSynapse.go +++ b/sdk/go/azure/streamanalytics/outputSynapse.go @@ -15,6 +15,87 @@ import ( // Manages a Stream Analytics Output to an Azure Synapse Analytics Workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputSynapse(ctx, "exampleOutputSynapse", &streamanalytics.OutputSynapseArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// Server: exampleWorkspace.ConnectivityEndpoints.ApplyT(func(connectivityEndpoints map[string]string) (string, error) { +// return connectivityEndpoints.SqlOnDemand, nil +// }).(pulumi.StringOutput), +// User: exampleWorkspace.SqlAdministratorLogin, +// Password: exampleWorkspace.SqlAdministratorLoginPassword, +// Database: pulumi.String("master"), +// Table: pulumi.String("ExampleTable"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // A Stream Analytics Output to an Azure Synapse Analytics Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/outputTable.go b/sdk/go/azure/streamanalytics/outputTable.go index cc4d07b9ca..c64b71c525 100644 --- a/sdk/go/azure/streamanalytics/outputTable.go +++ b/sdk/go/azure/streamanalytics/outputTable.go @@ -15,6 +15,70 @@ import ( // Manages a Stream Analytics Output Table. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleTable, err := storage.NewTable(ctx, "exampleTable", &storage.TableArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewOutputTable(ctx, "exampleOutputTable", &streamanalytics.OutputTableArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// StorageAccountName: exampleAccount.Name, +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// Table: exampleTable.Name, +// PartitionKey: pulumi.String("foo"), +// RowKey: pulumi.String("bar"), +// BatchSize: pulumi.Int(100), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Output to Table can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/referenceInputBlob.go b/sdk/go/azure/streamanalytics/referenceInputBlob.go index 9b4c72aa11..20efaa8faf 100644 --- a/sdk/go/azure/streamanalytics/referenceInputBlob.go +++ b/sdk/go/azure/streamanalytics/referenceInputBlob.go @@ -15,6 +15,75 @@ import ( // Manages a Stream Analytics Reference Input Blob. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-blob-storage). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewReferenceInputBlob(ctx, "test", &streamanalytics.ReferenceInputBlobArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// StorageAccountName: exampleAccount.Name, +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// StorageContainerName: exampleContainer.Name, +// PathPattern: pulumi.String("some-random-pattern"), +// DateFormat: pulumi.String("yyyy/MM/dd"), +// TimeFormat: pulumi.String("HH"), +// Serialization: &streamanalytics.ReferenceInputBlobSerializationArgs{ +// Type: pulumi.String("Json"), +// Encoding: pulumi.String("UTF8"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Reference Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/referenceInputMssql.go b/sdk/go/azure/streamanalytics/referenceInputMssql.go index ad72c1985b..007035d0aa 100644 --- a/sdk/go/azure/streamanalytics/referenceInputMssql.go +++ b/sdk/go/azure/streamanalytics/referenceInputMssql.go @@ -15,6 +15,72 @@ import ( // Manages a Stream Analytics Reference Input from MS SQL. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-sql-database). // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleServer, err := mssql.NewServer(ctx, "exampleServer", &mssql.ServerArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Version: pulumi.String("12.0"), +// AdministratorLogin: pulumi.String("admin"), +// AdministratorLoginPassword: pulumi.String("password"), +// }) +// if err != nil { +// return err +// } +// exampleDatabase, err := mssql.NewDatabase(ctx, "exampleDatabase", &mssql.DatabaseArgs{ +// ServerId: exampleServer.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewReferenceInputMssql(ctx, "exampleReferenceInputMssql", &streamanalytics.ReferenceInputMssqlArgs{ +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// Server: exampleServer.FullyQualifiedDomainName, +// Database: exampleDatabase.Name, +// Username: pulumi.String("exampleuser"), +// Password: pulumi.String("examplepassword"), +// RefreshType: pulumi.String("RefreshPeriodicallyWithFull"), +// RefreshIntervalDuration: pulumi.String("00:20:00"), +// FullSnapshotQuery: pulumi.String(" SELECT *\n INTO [YourOutputAlias]\n FROM [YourInputAlias]\n"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/streamInputBlob.go b/sdk/go/azure/streamanalytics/streamInputBlob.go index e1c15a2f50..acb159163f 100644 --- a/sdk/go/azure/streamanalytics/streamInputBlob.go +++ b/sdk/go/azure/streamanalytics/streamInputBlob.go @@ -15,6 +15,75 @@ import ( // Manages a Stream Analytics Stream Input Blob. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewStreamInputBlob(ctx, "exampleStreamInputBlob", &streamanalytics.StreamInputBlobArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// StorageAccountName: exampleAccount.Name, +// StorageAccountKey: exampleAccount.PrimaryAccessKey, +// StorageContainerName: exampleContainer.Name, +// PathPattern: pulumi.String("some-random-pattern"), +// DateFormat: pulumi.String("yyyy/MM/dd"), +// TimeFormat: pulumi.String("HH"), +// Serialization: &streamanalytics.StreamInputBlobSerializationArgs{ +// Type: pulumi.String("Json"), +// Encoding: pulumi.String("UTF8"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Stream Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/streamInputEventHub.go b/sdk/go/azure/streamanalytics/streamInputEventHub.go index 9705ca52cb..5b56d6add8 100644 --- a/sdk/go/azure/streamanalytics/streamInputEventHub.go +++ b/sdk/go/azure/streamanalytics/streamInputEventHub.go @@ -17,6 +17,84 @@ import ( // // Manages a Stream Analytics Stream Input EventHub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewStreamInputEventHub(ctx, "exampleStreamInputEventHub", &streamanalytics.StreamInputEventHubArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// EventhubConsumerGroupName: exampleConsumerGroup.Name, +// EventhubName: exampleEventHub.Name, +// ServicebusNamespace: exampleEventHubNamespace.Name, +// SharedAccessPolicyKey: exampleEventHubNamespace.DefaultPrimaryKey, +// SharedAccessPolicyName: pulumi.String("RootManageSharedAccessKey"), +// Serialization: &streamanalytics.StreamInputEventHubSerializationArgs{ +// Type: pulumi.String("Json"), +// Encoding: pulumi.String("UTF8"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/streamInputEventHubV2.go b/sdk/go/azure/streamanalytics/streamInputEventHubV2.go index 830f918830..b00fb59b00 100644 --- a/sdk/go/azure/streamanalytics/streamInputEventHubV2.go +++ b/sdk/go/azure/streamanalytics/streamInputEventHubV2.go @@ -17,6 +17,81 @@ import ( // // Manages a Stream Analytics Stream Input EventHub V2. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleEventHubNamespace, err := eventhub.NewEventHubNamespace(ctx, "exampleEventHubNamespace", &eventhub.EventHubNamespaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleEventHub, err := eventhub.NewEventHub(ctx, "exampleEventHub", &eventhub.EventHubArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// PartitionCount: pulumi.Int(2), +// MessageRetention: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleConsumerGroup, err := eventhub.NewConsumerGroup(ctx, "exampleConsumerGroup", &eventhub.ConsumerGroupArgs{ +// NamespaceName: exampleEventHubNamespace.Name, +// EventhubName: exampleEventHub.Name, +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewStreamInputEventHubV2(ctx, "exampleStreamInputEventHubV2", &streamanalytics.StreamInputEventHubV2Args{ +// StreamAnalyticsJobId: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Id, nil +// }).(pulumi.StringPtrOutput), +// EventhubConsumerGroupName: exampleConsumerGroup.Name, +// EventhubName: exampleEventHub.Name, +// ServicebusNamespace: exampleEventHubNamespace.Name, +// SharedAccessPolicyKey: exampleEventHubNamespace.DefaultPrimaryKey, +// SharedAccessPolicyName: pulumi.String("RootManageSharedAccessKey"), +// Serialization: &streamanalytics.StreamInputEventHubV2SerializationArgs{ +// Type: pulumi.String("Json"), +// Encoding: pulumi.String("UTF8"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/streamanalytics/streamInputIotHub.go b/sdk/go/azure/streamanalytics/streamInputIotHub.go index d05a704843..fffe608e4f 100644 --- a/sdk/go/azure/streamanalytics/streamInputIotHub.go +++ b/sdk/go/azure/streamanalytics/streamInputIotHub.go @@ -15,6 +15,71 @@ import ( // Manages a Stream Analytics Stream Input IoTHub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleJob := streamanalytics.LookupJobOutput(ctx, streamanalytics.GetJobOutputArgs{ +// Name: pulumi.String("example-job"), +// ResourceGroupName: exampleResourceGroup.Name, +// }, nil) +// exampleIoTHub, err := iot.NewIoTHub(ctx, "exampleIoTHub", &iot.IoTHubArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// Sku: &iot.IoTHubSkuArgs{ +// Name: pulumi.String("S1"), +// Capacity: pulumi.Int(1), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = streamanalytics.NewStreamInputIotHub(ctx, "exampleStreamInputIotHub", &streamanalytics.StreamInputIotHubArgs{ +// StreamAnalyticsJobName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.Name, nil +// }).(pulumi.StringPtrOutput), +// ResourceGroupName: exampleJob.ApplyT(func(exampleJob streamanalytics.GetJobResult) (*string, error) { +// return &exampleJob.ResourceGroupName, nil +// }).(pulumi.StringPtrOutput), +// Endpoint: pulumi.String("messages/events"), +// EventhubConsumerGroupName: pulumi.String("$Default"), +// IothubNamespace: exampleIoTHub.Name, +// SharedAccessPolicyKey: exampleIoTHub.SharedAccessPolicies.ApplyT(func(sharedAccessPolicies []iot.IoTHubSharedAccessPolicy) (*string, error) { +// return &sharedAccessPolicies[0].PrimaryKey, nil +// }).(pulumi.StringPtrOutput), +// SharedAccessPolicyName: pulumi.String("iothubowner"), +// Serialization: &streamanalytics.StreamInputIotHubSerializationArgs{ +// Type: pulumi.String("Json"), +// Encoding: pulumi.String("UTF8"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Stream Analytics Stream Input IoTHub's can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/firewallRule.go b/sdk/go/azure/synapse/firewallRule.go index 0f7049d473..65ea4b2080 100644 --- a/sdk/go/azure/synapse/firewallRule.go +++ b/sdk/go/azure/synapse/firewallRule.go @@ -15,6 +15,72 @@ import ( // Allows you to Manages a Synapse Firewall Rule. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewFirewallRule(ctx, "exampleFirewallRule", &synapse.FirewallRuleArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("255.255.255.255"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Firewall Rule can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/getWorkspace.go b/sdk/go/azure/synapse/getWorkspace.go index cb9d4ef43c..2d8b3b22a4 100644 --- a/sdk/go/azure/synapse/getWorkspace.go +++ b/sdk/go/azure/synapse/getWorkspace.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Synapse Workspace. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := synapse.LookupWorkspace(ctx, &synapse.LookupWorkspaceArgs{ +// Name: "existing", +// ResourceGroupName: "example-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func LookupWorkspace(ctx *pulumi.Context, args *LookupWorkspaceArgs, opts ...pulumi.InvokeOption) (*LookupWorkspaceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupWorkspaceResult diff --git a/sdk/go/azure/synapse/integrationRuntimeAzure.go b/sdk/go/azure/synapse/integrationRuntimeAzure.go index 395cbc936e..ae9530e7b4 100644 --- a/sdk/go/azure/synapse/integrationRuntimeAzure.go +++ b/sdk/go/azure/synapse/integrationRuntimeAzure.go @@ -15,6 +15,85 @@ import ( // Manages a Synapse Azure Integration Runtime. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// ManagedVirtualNetworkEnabled: pulumi.Bool(true), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewFirewallRule(ctx, "exampleFirewallRule", &synapse.FirewallRuleArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("255.255.255.255"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewIntegrationRuntimeAzure(ctx, "exampleIntegrationRuntimeAzure", &synapse.IntegrationRuntimeAzureArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/integrationRuntimeSelfHosted.go b/sdk/go/azure/synapse/integrationRuntimeSelfHosted.go index 8e412802d9..53e5a22c6e 100644 --- a/sdk/go/azure/synapse/integrationRuntimeSelfHosted.go +++ b/sdk/go/azure/synapse/integrationRuntimeSelfHosted.go @@ -15,6 +15,84 @@ import ( // Manages a Synapse Self-hosted Integration Runtime. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// ManagedVirtualNetworkEnabled: pulumi.Bool(true), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewFirewallRule(ctx, "exampleFirewallRule", &synapse.FirewallRuleArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("255.255.255.255"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewIntegrationRuntimeSelfHosted(ctx, "exampleIntegrationRuntimeSelfHosted", &synapse.IntegrationRuntimeSelfHostedArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Self-hosted Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/linkedService.go b/sdk/go/azure/synapse/linkedService.go index cf9cb76fc8..690ac8232c 100644 --- a/sdk/go/azure/synapse/linkedService.go +++ b/sdk/go/azure/synapse/linkedService.go @@ -15,6 +15,96 @@ import ( // Manages a Synapse Linked Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// ManagedVirtualNetworkEnabled: pulumi.Bool(true), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleFirewallRule, err := synapse.NewFirewallRule(ctx, "exampleFirewallRule", &synapse.FirewallRuleArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("255.255.255.255"), +// }) +// if err != nil { +// return err +// } +// exampleIntegrationRuntimeAzure, err := synapse.NewIntegrationRuntimeAzure(ctx, "exampleIntegrationRuntimeAzure", &synapse.IntegrationRuntimeAzureArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewLinkedService(ctx, "exampleLinkedService", &synapse.LinkedServiceArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Type: pulumi.String("AzureBlobStorage"), +// TypePropertiesJson: exampleAccount.PrimaryConnectionString.ApplyT(func(primaryConnectionString string) (string, error) { +// return fmt.Sprintf("{\n \"connectionString\": \"%v\"\n}\n", primaryConnectionString), nil +// }).(pulumi.StringOutput), +// IntegrationRuntime: &synapse.LinkedServiceIntegrationRuntimeArgs{ +// Name: exampleIntegrationRuntimeAzure.Name, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleFirewallRule, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/managedPrivateEndpoint.go b/sdk/go/azure/synapse/managedPrivateEndpoint.go index fdf02eba31..4413997ee0 100644 --- a/sdk/go/azure/synapse/managedPrivateEndpoint.go +++ b/sdk/go/azure/synapse/managedPrivateEndpoint.go @@ -15,6 +15,93 @@ import ( // Manages a Synapse Managed Private Endpoint. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// ManagedVirtualNetworkEnabled: pulumi.Bool(true), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleFirewallRule, err := synapse.NewFirewallRule(ctx, "exampleFirewallRule", &synapse.FirewallRuleArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("255.255.255.255"), +// }) +// if err != nil { +// return err +// } +// exampleConnect, err := storage.NewAccount(ctx, "exampleConnect", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("BlobStorage"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewManagedPrivateEndpoint(ctx, "exampleManagedPrivateEndpoint", &synapse.ManagedPrivateEndpointArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// TargetResourceId: exampleConnect.ID(), +// SubresourceName: pulumi.String("blob"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleFirewallRule, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/privateLinkHub.go b/sdk/go/azure/synapse/privateLinkHub.go index 24a8991116..ede3f09b2d 100644 --- a/sdk/go/azure/synapse/privateLinkHub.go +++ b/sdk/go/azure/synapse/privateLinkHub.go @@ -15,6 +15,33 @@ import ( // Manages a Synapse Private Link Hub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := synapse.NewPrivateLinkHub(ctx, "example", &synapse.PrivateLinkHubArgs{ +// Location: pulumi.String("West Europe"), +// ResourceGroupName: pulumi.String("example-rg"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Private Link Hub can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/roleAssignment.go b/sdk/go/azure/synapse/roleAssignment.go index a4e93e35e4..17a0c23680 100644 --- a/sdk/go/azure/synapse/roleAssignment.go +++ b/sdk/go/azure/synapse/roleAssignment.go @@ -15,6 +15,86 @@ import ( // Manages a Synapse Role Assignment. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleFirewallRule, err := synapse.NewFirewallRule(ctx, "exampleFirewallRule", &synapse.FirewallRuleArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// StartIpAddress: pulumi.String("0.0.0.0"), +// EndIpAddress: pulumi.String("255.255.255.255"), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// _, err = synapse.NewRoleAssignment(ctx, "exampleRoleAssignment", &synapse.RoleAssignmentArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// RoleName: pulumi.String("Synapse SQL Administrator"), +// PrincipalId: *pulumi.String(current.ObjectId), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleFirewallRule, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Role Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/sqlPool.go b/sdk/go/azure/synapse/sqlPool.go index c704bfb32d..8c70fc040a 100644 --- a/sdk/go/azure/synapse/sqlPool.go +++ b/sdk/go/azure/synapse/sqlPool.go @@ -15,6 +15,72 @@ import ( // Manages a Synapse SQL Pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("BlobStorage"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewSqlPool(ctx, "exampleSqlPool", &synapse.SqlPoolArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// SkuName: pulumi.String("DW100c"), +// CreateMode: pulumi.String("Default"), +// StorageAccountType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse SQL Pool can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/sqlPoolExtendedAuditingPolicy.go b/sdk/go/azure/synapse/sqlPoolExtendedAuditingPolicy.go index 8de881dfe7..a06a6fed85 100644 --- a/sdk/go/azure/synapse/sqlPoolExtendedAuditingPolicy.go +++ b/sdk/go/azure/synapse/sqlPoolExtendedAuditingPolicy.go @@ -15,6 +15,90 @@ import ( // Manages a Synapse SQL Pool Extended Auditing Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("BlobStorage"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlPool, err := synapse.NewSqlPool(ctx, "exampleSqlPool", &synapse.SqlPoolArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// SkuName: pulumi.String("DW100c"), +// CreateMode: pulumi.String("Default"), +// }) +// if err != nil { +// return err +// } +// auditLogs, err := storage.NewAccount(ctx, "auditLogs", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewSqlPoolExtendedAuditingPolicy(ctx, "exampleSqlPoolExtendedAuditingPolicy", &synapse.SqlPoolExtendedAuditingPolicyArgs{ +// SqlPoolId: exampleSqlPool.ID(), +// StorageEndpoint: auditLogs.PrimaryBlobEndpoint, +// StorageAccountAccessKey: auditLogs.PrimaryAccessKey, +// StorageAccountAccessKeyIsSecondary: pulumi.Bool(false), +// RetentionInDays: pulumi.Int(6), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse SQL Pool Extended Auditing Policys can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/sqlPoolSecurityAlertPolicy.go b/sdk/go/azure/synapse/sqlPoolSecurityAlertPolicy.go index 023bda42e2..5831700e60 100644 --- a/sdk/go/azure/synapse/sqlPoolSecurityAlertPolicy.go +++ b/sdk/go/azure/synapse/sqlPoolSecurityAlertPolicy.go @@ -15,6 +15,103 @@ import ( // Manages a Security Alert Policy for a Synapse SQL Pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// AadAdmin: &synapse.WorkspaceAadAdminTypeArgs{ +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlPool, err := synapse.NewSqlPool(ctx, "exampleSqlPool", &synapse.SqlPoolArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// SkuName: pulumi.String("DW100c"), +// CreateMode: pulumi.String("Default"), +// }) +// if err != nil { +// return err +// } +// auditLogs, err := storage.NewAccount(ctx, "auditLogs", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewSqlPoolSecurityAlertPolicy(ctx, "exampleSqlPoolSecurityAlertPolicy", &synapse.SqlPoolSecurityAlertPolicyArgs{ +// SqlPoolId: exampleSqlPool.ID(), +// PolicyState: pulumi.String("Enabled"), +// StorageEndpoint: auditLogs.PrimaryBlobEndpoint, +// StorageAccountAccessKey: auditLogs.PrimaryAccessKey, +// DisabledAlerts: pulumi.StringArray{ +// pulumi.String("Sql_Injection"), +// pulumi.String("Data_Exfiltration"), +// }, +// RetentionDays: pulumi.Int(20), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse SQL Pool Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessment.go b/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessment.go index 9db5826ddd..13f7b83265 100644 --- a/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessment.go +++ b/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessment.go @@ -15,6 +15,131 @@ import ( // Manages the Vulnerability Assessment for a Synapse SQL Pool. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// AadAdmin: &synapse.WorkspaceAadAdminTypeArgs{ +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlPool, err := synapse.NewSqlPool(ctx, "exampleSqlPool", &synapse.SqlPoolArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// SkuName: pulumi.String("DW100c"), +// CreateMode: pulumi.String("Default"), +// }) +// if err != nil { +// return err +// } +// auditLogs, err := storage.NewAccount(ctx, "auditLogs", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleSqlPoolSecurityAlertPolicy, err := synapse.NewSqlPoolSecurityAlertPolicy(ctx, "exampleSqlPoolSecurityAlertPolicy", &synapse.SqlPoolSecurityAlertPolicyArgs{ +// SqlPoolId: exampleSqlPool.ID(), +// PolicyState: pulumi.String("Enabled"), +// StorageEndpoint: auditLogs.PrimaryBlobEndpoint, +// StorageAccountAccessKey: auditLogs.PrimaryAccessKey, +// DisabledAlerts: pulumi.StringArray{ +// pulumi.String("Sql_Injection"), +// pulumi.String("Data_Exfiltration"), +// }, +// RetentionDays: pulumi.Int(20), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewSqlPoolVulnerabilityAssessment(ctx, "exampleSqlPoolVulnerabilityAssessment", &synapse.SqlPoolVulnerabilityAssessmentArgs{ +// SqlPoolSecurityAlertPolicyId: exampleSqlPoolSecurityAlertPolicy.ID(), +// StorageContainerPath: pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) { +// primaryBlobEndpoint := _args[0].(string) +// name := _args[1].(string) +// return fmt.Sprintf("%v%v/", primaryBlobEndpoint, name), nil +// }).(pulumi.StringOutput), +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// RecurringScans: &synapse.SqlPoolVulnerabilityAssessmentRecurringScansArgs{ +// Enabled: pulumi.Bool(true), +// EmailSubscriptionAdminsEnabled: pulumi.Bool(true), +// Emails: pulumi.StringArray{ +// pulumi.String("email@example1.com"), +// pulumi.String("email@example2.com"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse SQL Pool Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessmentBaseline.go b/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessmentBaseline.go index 1ef67824cf..3dad28fc8a 100644 --- a/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessmentBaseline.go +++ b/sdk/go/azure/synapse/sqlPoolVulnerabilityAssessmentBaseline.go @@ -15,6 +15,122 @@ import ( // Manages a Synapse SQL Pool Vulnerability Assessment Rule Baseline. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlPool, err := synapse.NewSqlPool(ctx, "exampleSqlPool", &synapse.SqlPoolArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// SkuName: pulumi.String("DW100c"), +// CreateMode: pulumi.String("Default"), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// ContainerAccessType: pulumi.String("private"), +// }) +// if err != nil { +// return err +// } +// exampleSqlPoolSecurityAlertPolicy, err := synapse.NewSqlPoolSecurityAlertPolicy(ctx, "exampleSqlPoolSecurityAlertPolicy", &synapse.SqlPoolSecurityAlertPolicyArgs{ +// SqlPoolId: exampleSqlPool.ID(), +// PolicyState: pulumi.String("Enabled"), +// StorageEndpoint: exampleAccount.PrimaryBlobEndpoint, +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// exampleSqlPoolVulnerabilityAssessment, err := synapse.NewSqlPoolVulnerabilityAssessment(ctx, "exampleSqlPoolVulnerabilityAssessment", &synapse.SqlPoolVulnerabilityAssessmentArgs{ +// SqlPoolSecurityAlertPolicyId: exampleSqlPoolSecurityAlertPolicy.ID(), +// StorageContainerPath: pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) { +// primaryBlobEndpoint := _args[0].(string) +// name := _args[1].(string) +// return fmt.Sprintf("%v%v/", primaryBlobEndpoint, name), nil +// }).(pulumi.StringOutput), +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewSqlPoolVulnerabilityAssessmentBaseline(ctx, "exampleSqlPoolVulnerabilityAssessmentBaseline", &synapse.SqlPoolVulnerabilityAssessmentBaselineArgs{ +// RuleName: pulumi.String("VA1017"), +// SqlPoolVulnerabilityAssessmentId: exampleSqlPoolVulnerabilityAssessment.ID(), +// Baselines: synapse.SqlPoolVulnerabilityAssessmentBaselineBaselineArray{ +// &synapse.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs{ +// Results: pulumi.StringArray{ +// pulumi.String("userA"), +// pulumi.String("SELECT"), +// }, +// }, +// &synapse.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs{ +// Results: pulumi.StringArray{ +// pulumi.String("userB"), +// pulumi.String("SELECT"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse SQL Pool Vulnerability Assessment Rule Baselines can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/sqlPoolWorkloadClassifier.go b/sdk/go/azure/synapse/sqlPoolWorkloadClassifier.go index dcbbcba53b..2446533fab 100644 --- a/sdk/go/azure/synapse/sqlPoolWorkloadClassifier.go +++ b/sdk/go/azure/synapse/sqlPoolWorkloadClassifier.go @@ -15,6 +15,95 @@ import ( // Manages a Synapse SQL Pool Workload Classifier. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlPool, err := synapse.NewSqlPool(ctx, "exampleSqlPool", &synapse.SqlPoolArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// SkuName: pulumi.String("DW100c"), +// CreateMode: pulumi.String("Default"), +// }) +// if err != nil { +// return err +// } +// exampleSqlPoolWorkloadGroup, err := synapse.NewSqlPoolWorkloadGroup(ctx, "exampleSqlPoolWorkloadGroup", &synapse.SqlPoolWorkloadGroupArgs{ +// SqlPoolId: exampleSqlPool.ID(), +// Importance: pulumi.String("normal"), +// MaxResourcePercent: pulumi.Int(100), +// MinResourcePercent: pulumi.Int(0), +// MaxResourcePercentPerRequest: pulumi.Float64(3), +// MinResourcePercentPerRequest: pulumi.Float64(3), +// QueryExecutionTimeoutInSeconds: pulumi.Int(0), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewSqlPoolWorkloadClassifier(ctx, "exampleSqlPoolWorkloadClassifier", &synapse.SqlPoolWorkloadClassifierArgs{ +// WorkloadGroupId: exampleSqlPoolWorkloadGroup.ID(), +// Context: pulumi.String("example_context"), +// EndTime: pulumi.String("14:00"), +// Importance: pulumi.String("high"), +// Label: pulumi.String("example_label"), +// MemberName: pulumi.String("dbo"), +// StartTime: pulumi.String("12:00"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse SQL Pool Workload Classifiers can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/sqlPoolWorkloadGroup.go b/sdk/go/azure/synapse/sqlPoolWorkloadGroup.go index 264568f835..cb41fbcd27 100644 --- a/sdk/go/azure/synapse/sqlPoolWorkloadGroup.go +++ b/sdk/go/azure/synapse/sqlPoolWorkloadGroup.go @@ -15,6 +15,83 @@ import ( // Manages a Synapse SQL Pool Workload Group. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("west europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountKind: pulumi.String("BlobStorage"), +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSqlPool, err := synapse.NewSqlPool(ctx, "exampleSqlPool", &synapse.SqlPoolArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// SkuName: pulumi.String("DW100c"), +// CreateMode: pulumi.String("Default"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewSqlPoolWorkloadGroup(ctx, "exampleSqlPoolWorkloadGroup", &synapse.SqlPoolWorkloadGroupArgs{ +// SqlPoolId: exampleSqlPool.ID(), +// Importance: pulumi.String("normal"), +// MaxResourcePercent: pulumi.Int(100), +// MinResourcePercent: pulumi.Int(0), +// MaxResourcePercentPerRequest: pulumi.Float64(3), +// MinResourcePercentPerRequest: pulumi.Float64(3), +// QueryExecutionTimeoutInSeconds: pulumi.Int(0), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse SQL Pool Workload Groups can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/workspace.go b/sdk/go/azure/synapse/workspace.go index 2523291235..6fc01ba218 100644 --- a/sdk/go/azure/synapse/workspace.go +++ b/sdk/go/azure/synapse/workspace.go @@ -15,6 +15,219 @@ import ( // Manages a Synapse Workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// AadAdmin: &synapse.WorkspaceAadAdminTypeArgs{ +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// ### Creating A Workspace With Customer Managed Key And Azure AD Admin +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// deployer, err := keyvault.NewAccessPolicy(ctx, "deployer", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("unwrapKey"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// deployer, +// })) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// CustomerManagedKey: &synapse.WorkspaceCustomerManagedKeyArgs{ +// KeyVersionlessId: exampleKey.VersionlessId, +// KeyName: pulumi.String("enckey"), +// }, +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// workspacePolicy, err := keyvault.NewAccessPolicy(ctx, "workspacePolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: exampleWorkspace.Identity.ApplyT(func(identity synapse.WorkspaceIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleWorkspace.Identity.ApplyT(func(identity synapse.WorkspaceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("WrapKey"), +// pulumi.String("UnwrapKey"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleWorkspaceKey, err := synapse.NewWorkspaceKey(ctx, "exampleWorkspaceKey", &synapse.WorkspaceKeyArgs{ +// CustomerManagedKeyVersionlessId: exampleKey.VersionlessId, +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Active: pulumi.Bool(true), +// CustomerManagedKeyName: pulumi.String("enckey"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// workspacePolicy, +// })) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspaceAadAdmin(ctx, "exampleWorkspaceAadAdmin", &synapse.WorkspaceAadAdminArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleWorkspaceKey, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/workspaceAadAdmin.go b/sdk/go/azure/synapse/workspaceAadAdmin.go index c5d4ba75f3..92dc0b2a7d 100644 --- a/sdk/go/azure/synapse/workspaceAadAdmin.go +++ b/sdk/go/azure/synapse/workspaceAadAdmin.go @@ -15,6 +15,120 @@ import ( // Manages an Azure Active Directory Administrator setting for a Synapse Workspace // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// deployer, err := keyvault.NewAccessPolicy(ctx, "deployer", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("unwrapKey"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// deployer, +// })) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspaceAadAdmin(ctx, "exampleWorkspaceAadAdmin", &synapse.WorkspaceAadAdminArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: *pulumi.String(current.ObjectId), +// TenantId: *pulumi.String(current.TenantId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/workspaceExtendedAuditingPolicy.go b/sdk/go/azure/synapse/workspaceExtendedAuditingPolicy.go index 5eb2ad31c7..b23b7824d2 100644 --- a/sdk/go/azure/synapse/workspaceExtendedAuditingPolicy.go +++ b/sdk/go/azure/synapse/workspaceExtendedAuditingPolicy.go @@ -15,6 +15,82 @@ import ( // Manages a Synapse Workspace Extended Auditing Policy. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("BlobStorage"), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// auditLogs, err := storage.NewAccount(ctx, "auditLogs", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspaceExtendedAuditingPolicy(ctx, "exampleWorkspaceExtendedAuditingPolicy", &synapse.WorkspaceExtendedAuditingPolicyArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// StorageEndpoint: auditLogs.PrimaryBlobEndpoint, +// StorageAccountAccessKey: auditLogs.PrimaryAccessKey, +// StorageAccountAccessKeyIsSecondary: pulumi.Bool(false), +// RetentionInDays: pulumi.Int(6), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Workspace Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/workspaceKey.go b/sdk/go/azure/synapse/workspaceKey.go index 46b4d86e7e..1b7bcff9b2 100644 --- a/sdk/go/azure/synapse/workspaceKey.go +++ b/sdk/go/azure/synapse/workspaceKey.go @@ -17,6 +17,143 @@ import ( // // > **Note:** Keys that are actively protecting a workspace cannot be deleted. When the keys resource is deleted, if the key is inactive it will be deleted, if it is active it will not be deleted. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// deployer, err := keyvault.NewAccessPolicy(ctx, "deployer", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleKey, err := keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("unwrapKey"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// deployer, +// })) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// CustomerManagedKey: &synapse.WorkspaceCustomerManagedKeyArgs{ +// KeyVersionlessId: exampleKey.VersionlessId, +// KeyName: pulumi.String("enckey"), +// }, +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// workspacePolicy, err := keyvault.NewAccessPolicy(ctx, "workspacePolicy", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: exampleWorkspace.Identity.ApplyT(func(identity synapse.WorkspaceIdentity) (*string, error) { +// return &identity.TenantId, nil +// }).(pulumi.StringPtrOutput), +// ObjectId: exampleWorkspace.Identity.ApplyT(func(identity synapse.WorkspaceIdentity) (*string, error) { +// return &identity.PrincipalId, nil +// }).(pulumi.StringPtrOutput), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Get"), +// pulumi.String("WrapKey"), +// pulumi.String("UnwrapKey"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspaceKey(ctx, "exampleWorkspaceKey", &synapse.WorkspaceKeyArgs{ +// CustomerManagedKeyVersionlessId: exampleKey.VersionlessId, +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Active: pulumi.Bool(true), +// CustomerManagedKeyName: pulumi.String("enckey"), +// }, pulumi.DependsOn([]pulumi.Resource{ +// workspacePolicy, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Workspace Keys can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/workspaceSecurityAlertPolicy.go b/sdk/go/azure/synapse/workspaceSecurityAlertPolicy.go index 1d522de8b1..9e5e82bbcf 100644 --- a/sdk/go/azure/synapse/workspaceSecurityAlertPolicy.go +++ b/sdk/go/azure/synapse/workspaceSecurityAlertPolicy.go @@ -15,6 +15,95 @@ import ( // Manages a Security Alert Policy for a Synapse Workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// AadAdmin: &synapse.WorkspaceAadAdminTypeArgs{ +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// auditLogs, err := storage.NewAccount(ctx, "auditLogs", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspaceSecurityAlertPolicy(ctx, "exampleWorkspaceSecurityAlertPolicy", &synapse.WorkspaceSecurityAlertPolicyArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// PolicyState: pulumi.String("Enabled"), +// StorageEndpoint: auditLogs.PrimaryBlobEndpoint, +// StorageAccountAccessKey: auditLogs.PrimaryAccessKey, +// DisabledAlerts: pulumi.StringArray{ +// pulumi.String("Sql_Injection"), +// pulumi.String("Data_Exfiltration"), +// }, +// RetentionDays: pulumi.Int(20), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Workspace Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/workspaceSqlAadAdmin.go b/sdk/go/azure/synapse/workspaceSqlAadAdmin.go index 241a0fa473..fe82db7bbe 100644 --- a/sdk/go/azure/synapse/workspaceSqlAadAdmin.go +++ b/sdk/go/azure/synapse/workspaceSqlAadAdmin.go @@ -15,6 +15,120 @@ import ( // Manages an Azure Active Directory SQL Administrator setting for a Synapse Workspace // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// PurgeProtectionEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// deployer, err := keyvault.NewAccessPolicy(ctx, "deployer", &keyvault.AccessPolicyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("Create"), +// pulumi.String("Get"), +// pulumi.String("Delete"), +// pulumi.String("Purge"), +// pulumi.String("GetRotationPolicy"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = keyvault.NewKey(ctx, "exampleKey", &keyvault.KeyArgs{ +// KeyVaultId: exampleKeyVault.ID(), +// KeyType: pulumi.String("RSA"), +// KeySize: pulumi.Int(2048), +// KeyOpts: pulumi.StringArray{ +// pulumi.String("unwrapKey"), +// pulumi.String("wrapKey"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// deployer, +// })) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspaceSqlAadAdmin(ctx, "exampleWorkspaceSqlAadAdmin", &synapse.WorkspaceSqlAadAdminArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: *pulumi.String(current.ObjectId), +// TenantId: *pulumi.String(current.TenantId), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/synapse/workspaceVulnerabilityAssessment.go b/sdk/go/azure/synapse/workspaceVulnerabilityAssessment.go index d695f4278a..77b68fe948 100644 --- a/sdk/go/azure/synapse/workspaceVulnerabilityAssessment.go +++ b/sdk/go/azure/synapse/workspaceVulnerabilityAssessment.go @@ -15,6 +15,123 @@ import ( // Manages the Vulnerability Assessment for a Synapse Workspace. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "fmt" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/synapse" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// AccountKind: pulumi.String("StorageV2"), +// IsHnsEnabled: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleContainer, err := storage.NewContainer(ctx, "exampleContainer", &storage.ContainerArgs{ +// StorageAccountName: exampleAccount.Name, +// }) +// if err != nil { +// return err +// } +// exampleDataLakeGen2Filesystem, err := storage.NewDataLakeGen2Filesystem(ctx, "exampleDataLakeGen2Filesystem", &storage.DataLakeGen2FilesystemArgs{ +// StorageAccountId: exampleAccount.ID(), +// }) +// if err != nil { +// return err +// } +// exampleWorkspace, err := synapse.NewWorkspace(ctx, "exampleWorkspace", &synapse.WorkspaceArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// StorageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.ID(), +// SqlAdministratorLogin: pulumi.String("sqladminuser"), +// SqlAdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"), +// AadAdmin: &synapse.WorkspaceAadAdminTypeArgs{ +// Login: pulumi.String("AzureAD Admin"), +// ObjectId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// TenantId: pulumi.String("00000000-0000-0000-0000-000000000000"), +// }, +// Identity: &synapse.WorkspaceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// Tags: pulumi.StringMap{ +// "Env": pulumi.String("production"), +// }, +// }) +// if err != nil { +// return err +// } +// auditLogs, err := storage.NewAccount(ctx, "auditLogs", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("LRS"), +// }) +// if err != nil { +// return err +// } +// exampleWorkspaceSecurityAlertPolicy, err := synapse.NewWorkspaceSecurityAlertPolicy(ctx, "exampleWorkspaceSecurityAlertPolicy", &synapse.WorkspaceSecurityAlertPolicyArgs{ +// SynapseWorkspaceId: exampleWorkspace.ID(), +// PolicyState: pulumi.String("Enabled"), +// StorageEndpoint: auditLogs.PrimaryBlobEndpoint, +// StorageAccountAccessKey: auditLogs.PrimaryAccessKey, +// DisabledAlerts: pulumi.StringArray{ +// pulumi.String("Sql_Injection"), +// pulumi.String("Data_Exfiltration"), +// }, +// RetentionDays: pulumi.Int(20), +// }) +// if err != nil { +// return err +// } +// _, err = synapse.NewWorkspaceVulnerabilityAssessment(ctx, "exampleWorkspaceVulnerabilityAssessment", &synapse.WorkspaceVulnerabilityAssessmentArgs{ +// WorkspaceSecurityAlertPolicyId: exampleWorkspaceSecurityAlertPolicy.ID(), +// StorageContainerPath: pulumi.All(exampleAccount.PrimaryBlobEndpoint, exampleContainer.Name).ApplyT(func(_args []interface{}) (string, error) { +// primaryBlobEndpoint := _args[0].(string) +// name := _args[1].(string) +// return fmt.Sprintf("%v%v/", primaryBlobEndpoint, name), nil +// }).(pulumi.StringOutput), +// StorageAccountAccessKey: exampleAccount.PrimaryAccessKey, +// RecurringScans: &synapse.WorkspaceVulnerabilityAssessmentRecurringScansArgs{ +// Enabled: pulumi.Bool(true), +// EmailSubscriptionAdminsEnabled: pulumi.Bool(true), +// Emails: pulumi.StringArray{ +// pulumi.String("email@example1.com"), +// pulumi.String("email@example2.com"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Synapse Workspace Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/trafficmanager/getGeographicalLocation.go b/sdk/go/azure/trafficmanager/getGeographicalLocation.go index 9357ad8a2b..539a9bc8d0 100644 --- a/sdk/go/azure/trafficmanager/getGeographicalLocation.go +++ b/sdk/go/azure/trafficmanager/getGeographicalLocation.go @@ -15,6 +15,32 @@ import ( // Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. // // ## Example Usage +// ### World) +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := network.GetTrafficManager(ctx, &network.GetTrafficManagerArgs{ +// Name: "World", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("locationCode", example.Id) +// return nil +// }) +// } +// +// ``` // // Deprecated: azure.trafficmanager.getGeographicalLocation has been deprecated in favor of azure.network.getTrafficManager func GetGeographicalLocation(ctx *pulumi.Context, args *GetGeographicalLocationArgs, opts ...pulumi.InvokeOption) (*GetGeographicalLocationResult, error) { diff --git a/sdk/go/azure/trafficmanager/profile.go b/sdk/go/azure/trafficmanager/profile.go index b1a435ed88..3e9efec0ef 100644 --- a/sdk/go/azure/trafficmanager/profile.go +++ b/sdk/go/azure/trafficmanager/profile.go @@ -15,6 +15,65 @@ import ( // Manages a Traffic Manager Profile to which multiple endpoints can be attached. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-random/sdk/v4/go/random" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{ +// Keepers: pulumi.Map{ +// "azi_id": pulumi.Any(1), +// }, +// ByteLength: pulumi.Int(8), +// }) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = network.NewTrafficManagerProfile(ctx, "exampleTrafficManagerProfile", &network.TrafficManagerProfileArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// TrafficRoutingMethod: pulumi.String("Weighted"), +// DnsConfig: &network.TrafficManagerProfileDnsConfigArgs{ +// RelativeName: server.Hex, +// Ttl: pulumi.Int(100), +// }, +// MonitorConfig: &network.TrafficManagerProfileMonitorConfigArgs{ +// Protocol: pulumi.String("HTTP"), +// Port: pulumi.Int(80), +// Path: pulumi.String("/"), +// IntervalInSeconds: pulumi.Int(30), +// TimeoutInSeconds: pulumi.Int(9), +// ToleratedNumberOfFailures: pulumi.Int(3), +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("Production"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/videoanalyzer/analyzer.go b/sdk/go/azure/videoanalyzer/analyzer.go index f247612a27..358f7a3255 100644 --- a/sdk/go/azure/videoanalyzer/analyzer.go +++ b/sdk/go/azure/videoanalyzer/analyzer.go @@ -17,6 +17,90 @@ import ( // // !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `videoanalyzer.Analyzer` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/videoanalyzer" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// contributor, err := authorization.NewAssignment(ctx, "contributor", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// reader, err := authorization.NewAssignment(ctx, "reader", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Reader"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// _, err = videoanalyzer.NewAnalyzer(ctx, "exampleAnalyzer", &videoanalyzer.AnalyzerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccount: &videoanalyzer.AnalyzerStorageAccountArgs{ +// Id: exampleAccount.ID(), +// UserAssignedIdentityId: exampleUserAssignedIdentity.ID(), +// }, +// Identity: &videoanalyzer.AnalyzerIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// contributor, +// reader, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Video Analyzer can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/videoanalyzer/edgeModule.go b/sdk/go/azure/videoanalyzer/edgeModule.go index b35e6acca7..e1ee848a09 100644 --- a/sdk/go/azure/videoanalyzer/edgeModule.go +++ b/sdk/go/azure/videoanalyzer/edgeModule.go @@ -17,6 +17,98 @@ import ( // // !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `videoanalyzer.EdgeModule` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/videoanalyzer" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// exampleAccount, err := storage.NewAccount(ctx, "exampleAccount", &storage.AccountArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AccountTier: pulumi.String("Standard"), +// AccountReplicationType: pulumi.String("GRS"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// contributor, err := authorization.NewAssignment(ctx, "contributor", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Storage Blob Data Contributor"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// reader, err := authorization.NewAssignment(ctx, "reader", &authorization.AssignmentArgs{ +// Scope: exampleAccount.ID(), +// RoleDefinitionName: pulumi.String("Reader"), +// PrincipalId: exampleUserAssignedIdentity.PrincipalId, +// }) +// if err != nil { +// return err +// } +// exampleAnalyzer, err := videoanalyzer.NewAnalyzer(ctx, "exampleAnalyzer", &videoanalyzer.AnalyzerArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// StorageAccount: &videoanalyzer.AnalyzerStorageAccountArgs{ +// Id: exampleAccount.ID(), +// UserAssignedIdentityId: exampleUserAssignedIdentity.ID(), +// }, +// Identity: &videoanalyzer.AnalyzerIdentityArgs{ +// Type: pulumi.String("UserAssigned"), +// IdentityIds: pulumi.StringArray{ +// exampleUserAssignedIdentity.ID(), +// }, +// }, +// Tags: pulumi.StringMap{ +// "environment": pulumi.String("staging"), +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleUserAssignedIdentity, +// contributor, +// reader, +// })) +// if err != nil { +// return err +// } +// _, err = videoanalyzer.NewEdgeModule(ctx, "exampleEdgeModule", &videoanalyzer.EdgeModuleArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VideoAnalyzerName: exampleAnalyzer.Name, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Video Analyzer Edge Module can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/voice/servicesCommunicationsGateway.go b/sdk/go/azure/voice/servicesCommunicationsGateway.go index 4691808015..c671329551 100644 --- a/sdk/go/azure/voice/servicesCommunicationsGateway.go +++ b/sdk/go/azure/voice/servicesCommunicationsGateway.go @@ -19,6 +19,97 @@ import ( // // !> **NOTE:** Access to Azure Communications Gateway is restricted, see [`Get access to Azure Communications Gateway for your Azure subscription`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#9-get-access-to-azure-communications-gateway-for-your-azure-subscription) for details. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "encoding/json" +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/voice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// tmpJSON0, err := json.Marshal(nil) +// if err != nil { +// return err +// } +// json0 := string(tmpJSON0) +// _, err = voice.NewServicesCommunicationsGateway(ctx, "exampleServicesCommunicationsGateway", &voice.ServicesCommunicationsGatewayArgs{ +// Location: pulumi.String("West Europe"), +// ResourceGroupName: exampleResourceGroup.Name, +// Connectivity: pulumi.String("PublicAddress"), +// Codecs: pulumi.String("PCMA"), +// E911Type: pulumi.String("DirectToEsrp"), +// Platforms: pulumi.StringArray{ +// pulumi.String("OperatorConnect"), +// pulumi.String("TeamsPhoneMobile"), +// }, +// ServiceLocations: voice.ServicesCommunicationsGatewayServiceLocationArray{ +// &voice.ServicesCommunicationsGatewayServiceLocationArgs{ +// Location: pulumi.String("eastus"), +// AllowedMediaSourceAddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.1.2.0/24"), +// }, +// AllowedSignalingSourceAddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.1.1.0/24"), +// }, +// EsrpAddresses: pulumi.StringArray{ +// pulumi.String("198.51.100.3"), +// }, +// OperatorAddresses: pulumi.StringArray{ +// pulumi.String("198.51.100.1"), +// }, +// }, +// &voice.ServicesCommunicationsGatewayServiceLocationArgs{ +// Location: pulumi.String("eastus2"), +// AllowedMediaSourceAddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.2.2.0/24"), +// }, +// AllowedSignalingSourceAddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.2.1.0/24"), +// }, +// EsrpAddresses: pulumi.StringArray{ +// pulumi.String("198.51.100.4"), +// }, +// OperatorAddresses: pulumi.StringArray{ +// pulumi.String("198.51.100.2"), +// }, +// }, +// }, +// AutoGeneratedDomainNameLabelScope: pulumi.String("SubscriptionReuse"), +// ApiBridge: pulumi.String(json0), +// EmergencyDialStrings: pulumi.StringArray{ +// pulumi.String("911"), +// pulumi.String("933"), +// }, +// OnPremMcpEnabled: pulumi.Bool(false), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// MicrosoftTeamsVoicemailPilotNumber: pulumi.String("1"), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Voice Services Communications Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/voice/servicesCommunicationsGatewayTestLine.go b/sdk/go/azure/voice/servicesCommunicationsGatewayTestLine.go index 54c74c00d1..2515774ef4 100644 --- a/sdk/go/azure/voice/servicesCommunicationsGatewayTestLine.go +++ b/sdk/go/azure/voice/servicesCommunicationsGatewayTestLine.go @@ -15,6 +15,51 @@ import ( // Manages a Voice Services Communications Gateway Test Line. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/voice" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Central US"), +// }) +// if err != nil { +// return err +// } +// exampleServicesCommunicationsGateway, err := voice.NewServicesCommunicationsGateway(ctx, "exampleServicesCommunicationsGateway", &voice.ServicesCommunicationsGatewayArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// }) +// if err != nil { +// return err +// } +// _, err = voice.NewServicesCommunicationsGatewayTestLine(ctx, "exampleServicesCommunicationsGatewayTestLine", &voice.ServicesCommunicationsGatewayTestLineArgs{ +// Location: pulumi.String("West Central US"), +// VoiceServicesCommunicationsGatewayId: exampleServicesCommunicationsGateway.ID(), +// PhoneNumber: pulumi.String("123456789"), +// Purpose: pulumi.String("Automated"), +// Tags: pulumi.StringMap{ +// "key": pulumi.String("value"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Voice Services Communications Gateway Test Line can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/waf/getFirewallPolicy.go b/sdk/go/azure/waf/getFirewallPolicy.go index 106018e933..f8b2e6e1ad 100644 --- a/sdk/go/azure/waf/getFirewallPolicy.go +++ b/sdk/go/azure/waf/getFirewallPolicy.go @@ -13,6 +13,34 @@ import ( ) // Use this data source to access information about an existing Web Application Firewall Policy. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/waf" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// example, err := waf.GetFirewallPolicy(ctx, &waf.GetFirewallPolicyArgs{ +// ResourceGroupName: "existing", +// Name: "existing", +// }, nil) +// if err != nil { +// return err +// } +// ctx.Export("id", example.Id) +// return nil +// }) +// } +// +// ``` func GetFirewallPolicy(ctx *pulumi.Context, args *GetFirewallPolicyArgs, opts ...pulumi.InvokeOption) (*GetFirewallPolicyResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetFirewallPolicyResult diff --git a/sdk/go/azure/waf/policy.go b/sdk/go/azure/waf/policy.go index ac415d1540..c4605bd013 100644 --- a/sdk/go/azure/waf/policy.go +++ b/sdk/go/azure/waf/policy.go @@ -15,6 +15,140 @@ import ( // Manages a Azure Web Application Firewall Policy instance. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/waf" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("West Europe"), +// }) +// if err != nil { +// return err +// } +// _, err = waf.NewPolicy(ctx, "examplePolicy", &waf.PolicyArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// CustomRules: waf.PolicyCustomRuleArray{ +// &waf.PolicyCustomRuleArgs{ +// Name: pulumi.String("Rule1"), +// Priority: pulumi.Int(1), +// RuleType: pulumi.String("MatchRule"), +// MatchConditions: waf.PolicyCustomRuleMatchConditionArray{ +// &waf.PolicyCustomRuleMatchConditionArgs{ +// MatchVariables: waf.PolicyCustomRuleMatchConditionMatchVariableArray{ +// &waf.PolicyCustomRuleMatchConditionMatchVariableArgs{ +// VariableName: pulumi.String("RemoteAddr"), +// }, +// }, +// Operator: pulumi.String("IPMatch"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// pulumi.String("10.0.0.0/24"), +// }, +// }, +// }, +// Action: pulumi.String("Block"), +// }, +// &waf.PolicyCustomRuleArgs{ +// Name: pulumi.String("Rule2"), +// Priority: pulumi.Int(2), +// RuleType: pulumi.String("MatchRule"), +// MatchConditions: waf.PolicyCustomRuleMatchConditionArray{ +// &waf.PolicyCustomRuleMatchConditionArgs{ +// MatchVariables: waf.PolicyCustomRuleMatchConditionMatchVariableArray{ +// &waf.PolicyCustomRuleMatchConditionMatchVariableArgs{ +// VariableName: pulumi.String("RemoteAddr"), +// }, +// }, +// Operator: pulumi.String("IPMatch"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("192.168.1.0/24"), +// }, +// }, +// &waf.PolicyCustomRuleMatchConditionArgs{ +// MatchVariables: waf.PolicyCustomRuleMatchConditionMatchVariableArray{ +// &waf.PolicyCustomRuleMatchConditionMatchVariableArgs{ +// VariableName: pulumi.String("RequestHeaders"), +// Selector: pulumi.String("UserAgent"), +// }, +// }, +// Operator: pulumi.String("Contains"), +// NegationCondition: pulumi.Bool(false), +// MatchValues: pulumi.StringArray{ +// pulumi.String("Windows"), +// }, +// }, +// }, +// Action: pulumi.String("Block"), +// }, +// }, +// PolicySettings: &waf.PolicyPolicySettingsArgs{ +// Enabled: pulumi.Bool(true), +// Mode: pulumi.String("Prevention"), +// RequestBodyCheck: pulumi.Bool(true), +// FileUploadLimitInMb: pulumi.Int(100), +// MaxRequestBodySizeInKb: pulumi.Int(128), +// }, +// ManagedRules: &waf.PolicyManagedRulesArgs{ +// Exclusions: waf.PolicyManagedRulesExclusionArray{ +// &waf.PolicyManagedRulesExclusionArgs{ +// MatchVariable: pulumi.String("RequestHeaderNames"), +// Selector: pulumi.String("x-company-secret-header"), +// SelectorMatchOperator: pulumi.String("Equals"), +// }, +// &waf.PolicyManagedRulesExclusionArgs{ +// MatchVariable: pulumi.String("RequestCookieNames"), +// Selector: pulumi.String("too-tasty"), +// SelectorMatchOperator: pulumi.String("EndsWith"), +// }, +// }, +// ManagedRuleSets: waf.PolicyManagedRulesManagedRuleSetArray{ +// &waf.PolicyManagedRulesManagedRuleSetArgs{ +// Type: pulumi.String("OWASP"), +// Version: pulumi.String("3.2"), +// RuleGroupOverrides: waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideArray{ +// &waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs{ +// RuleGroupName: pulumi.String("REQUEST-920-PROTOCOL-ENFORCEMENT"), +// Rules: waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArray{ +// &waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs{ +// Id: pulumi.String("920300"), +// Enabled: pulumi.Bool(true), +// Action: pulumi.String("Log"), +// }, +// &waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs{ +// Id: pulumi.String("920440"), +// Enabled: pulumi.Bool(true), +// Action: pulumi.String("Block"), +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/webpubsub/getPrivateLinkResource.go b/sdk/go/azure/webpubsub/getPrivateLinkResource.go index aaa7286567..d550891fac 100644 --- a/sdk/go/azure/webpubsub/getPrivateLinkResource.go +++ b/sdk/go/azure/webpubsub/getPrivateLinkResource.go @@ -13,6 +13,45 @@ import ( ) // Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// testResourceGroup, err := core.NewResourceGroup(ctx, "testResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// testService, err := webpubsub.NewService(ctx, "testService", &webpubsub.ServiceArgs{ +// Location: testResourceGroup.Location, +// ResourceGroupName: testResourceGroup.Name, +// Sku: pulumi.String("Standard_S1"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _ = webpubsub.GetPrivateLinkResourceOutput(ctx, webpubsub.GetPrivateLinkResourceOutputArgs{ +// WebPubsubId: testService.ID(), +// }, nil) +// return nil +// }) +// } +// +// ``` func GetPrivateLinkResource(ctx *pulumi.Context, args *GetPrivateLinkResourceArgs, opts ...pulumi.InvokeOption) (*GetPrivateLinkResourceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv GetPrivateLinkResourceResult diff --git a/sdk/go/azure/webpubsub/getService.go b/sdk/go/azure/webpubsub/getService.go index f8c67aab32..7ff03a02c7 100644 --- a/sdk/go/azure/webpubsub/getService.go +++ b/sdk/go/azure/webpubsub/getService.go @@ -13,6 +13,33 @@ import ( ) // Use this data source to access information about an existing Azure Web Pubsub service. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := webpubsub.LookupService(ctx, &webpubsub.LookupServiceArgs{ +// Name: "test-webpubsub", +// ResourceGroupName: "wps-resource-group", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` func LookupService(ctx *pulumi.Context, args *LookupServiceArgs, opts ...pulumi.InvokeOption) (*LookupServiceResult, error) { opts = internal.PkgInvokeDefaultOpts(opts) var rv LookupServiceResult diff --git a/sdk/go/azure/webpubsub/hub.go b/sdk/go/azure/webpubsub/hub.go index ca85c16247..8f2bd5152c 100644 --- a/sdk/go/azure/webpubsub/hub.go +++ b/sdk/go/azure/webpubsub/hub.go @@ -15,6 +15,112 @@ import ( // Manages the hub settings for a Web Pubsub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "exampleUserAssignedIdentity", &authorization.UserAssignedIdentityArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// }) +// if err != nil { +// return err +// } +// exampleService, err := webpubsub.NewService(ctx, "exampleService", &webpubsub.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard_S1"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = webpubsub.NewHub(ctx, "exampleHub", &webpubsub.HubArgs{ +// WebPubsubId: exampleService.ID(), +// EventHandlers: webpubsub.HubEventHandlerArray{ +// &webpubsub.HubEventHandlerArgs{ +// UrlTemplate: pulumi.String("https://test.com/api/{hub}/{event}"), +// UserEventPattern: pulumi.String("*"), +// SystemEvents: pulumi.StringArray{ +// pulumi.String("connect"), +// pulumi.String("connected"), +// }, +// }, +// &webpubsub.HubEventHandlerArgs{ +// UrlTemplate: pulumi.String("https://test.com/api/{hub}/{event}"), +// UserEventPattern: pulumi.String("event1, event2"), +// SystemEvents: pulumi.StringArray{ +// pulumi.String("connected"), +// }, +// Auth: &webpubsub.HubEventHandlerAuthArgs{ +// ManagedIdentityId: exampleUserAssignedIdentity.ID(), +// }, +// }, +// }, +// EventListeners: webpubsub.HubEventListenerArray{ +// &webpubsub.HubEventListenerArgs{ +// SystemEventNameFilters: pulumi.StringArray{ +// pulumi.String("connected"), +// }, +// UserEventNameFilters: pulumi.StringArray{ +// pulumi.String("event1"), +// pulumi.String("event2"), +// }, +// EventhubNamespaceName: pulumi.Any(azurerm_eventhub_namespace.Test.Name), +// EventhubName: pulumi.Any(azurerm_eventhub.Test1.Name), +// }, +// &webpubsub.HubEventListenerArgs{ +// SystemEventNameFilters: pulumi.StringArray{ +// pulumi.String("connected"), +// }, +// UserEventNameFilters: pulumi.StringArray{ +// pulumi.String("*"), +// }, +// EventhubNamespaceName: pulumi.Any(azurerm_eventhub_namespace.Test.Name), +// EventhubName: pulumi.Any(azurerm_eventhub.Test1.Name), +// }, +// &webpubsub.HubEventListenerArgs{ +// SystemEventNameFilters: pulumi.StringArray{ +// pulumi.String("connected"), +// }, +// UserEventNameFilters: pulumi.StringArray{ +// pulumi.String("event1"), +// }, +// EventhubNamespaceName: pulumi.Any(azurerm_eventhub_namespace.Test.Name), +// EventhubName: pulumi.Any(azurerm_eventhub.Test1.Name), +// }, +// }, +// AnonymousConnectionsEnabled: pulumi.Bool(true), +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleService, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Web Pubsub Hub can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/webpubsub/networkAcl.go b/sdk/go/azure/webpubsub/networkAcl.go index 373ff73505..ab4be08c1e 100644 --- a/sdk/go/azure/webpubsub/networkAcl.go +++ b/sdk/go/azure/webpubsub/networkAcl.go @@ -15,6 +15,104 @@ import ( // Manages the Network ACL for a Web Pubsub. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/privatelink" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleService, err := webpubsub.NewService(ctx, "exampleService", &webpubsub.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard_S1"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// AddressSpaces: pulumi.StringArray{ +// pulumi.String("10.5.0.0/16"), +// }, +// }) +// if err != nil { +// return err +// } +// exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// VirtualNetworkName: exampleVirtualNetwork.Name, +// AddressPrefixes: pulumi.StringArray{ +// pulumi.String("10.5.2.0/24"), +// }, +// EnforcePrivateLinkEndpointNetworkPolicies: pulumi.Bool(true), +// }) +// if err != nil { +// return err +// } +// exampleEndpoint, err := privatelink.NewEndpoint(ctx, "exampleEndpoint", &privatelink.EndpointArgs{ +// ResourceGroupName: exampleResourceGroup.Name, +// Location: exampleResourceGroup.Location, +// SubnetId: exampleSubnet.ID(), +// PrivateServiceConnection: &privatelink.EndpointPrivateServiceConnectionArgs{ +// Name: pulumi.String("psc-sig-test"), +// IsManualConnection: pulumi.Bool(false), +// PrivateConnectionResourceId: exampleService.ID(), +// SubresourceNames: pulumi.StringArray{ +// pulumi.String("webpubsub"), +// }, +// }, +// }) +// if err != nil { +// return err +// } +// _, err = webpubsub.NewNetworkAcl(ctx, "exampleNetworkAcl", &webpubsub.NetworkAclArgs{ +// WebPubsubId: exampleService.ID(), +// DefaultAction: pulumi.String("Allow"), +// PublicNetwork: &webpubsub.NetworkAclPublicNetworkArgs{ +// DeniedRequestTypes: pulumi.StringArray{ +// pulumi.String("ClientConnection"), +// }, +// }, +// PrivateEndpoints: webpubsub.NetworkAclPrivateEndpointArray{ +// &webpubsub.NetworkAclPrivateEndpointArgs{ +// Id: exampleEndpoint.ID(), +// DeniedRequestTypes: pulumi.StringArray{ +// pulumi.String("RESTAPI"), +// pulumi.String("ClientConnection"), +// }, +// }, +// }, +// }, pulumi.DependsOn([]pulumi.Resource{ +// exampleEndpoint, +// })) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Network ACLs for a Web Pubsub service can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/webpubsub/service.go b/sdk/go/azure/webpubsub/service.go index 7cf3f77d26..f97aed53a5 100644 --- a/sdk/go/azure/webpubsub/service.go +++ b/sdk/go/azure/webpubsub/service.go @@ -15,6 +15,51 @@ import ( // Manages an Azure Web PubSub Service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// _, err = webpubsub.NewService(ctx, "exampleService", &webpubsub.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard_S1"), +// Capacity: pulumi.Int(1), +// PublicNetworkAccessEnabled: pulumi.Bool(false), +// LiveTrace: &webpubsub.ServiceLiveTraceArgs{ +// Enabled: pulumi.Bool(true), +// MessagingLogsEnabled: pulumi.Bool(true), +// ConnectivityLogsEnabled: pulumi.Bool(false), +// }, +// Identity: &webpubsub.ServiceIdentityArgs{ +// Type: pulumi.String("SystemAssigned"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Web PubSub services can be imported using the `resource id`, e.g. diff --git a/sdk/go/azure/webpubsub/sharedPrivateLinkResource.go b/sdk/go/azure/webpubsub/sharedPrivateLinkResource.go index ee7addc363..e8184320f4 100644 --- a/sdk/go/azure/webpubsub/sharedPrivateLinkResource.go +++ b/sdk/go/azure/webpubsub/sharedPrivateLinkResource.go @@ -15,6 +15,80 @@ import ( // Manages the Shared Private Link Resource for a Web Pubsub service. // +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault" +// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// current, err := core.GetClientConfig(ctx, nil, nil) +// if err != nil { +// return err +// } +// exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{ +// Location: pulumi.String("east us"), +// }) +// if err != nil { +// return err +// } +// exampleKeyVault, err := keyvault.NewKeyVault(ctx, "exampleKeyVault", &keyvault.KeyVaultArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// TenantId: *pulumi.String(current.TenantId), +// SkuName: pulumi.String("standard"), +// SoftDeleteRetentionDays: pulumi.Int(7), +// AccessPolicies: keyvault.KeyVaultAccessPolicyArray{ +// &keyvault.KeyVaultAccessPolicyArgs{ +// TenantId: *pulumi.String(current.TenantId), +// ObjectId: *pulumi.String(current.ObjectId), +// CertificatePermissions: pulumi.StringArray{ +// pulumi.String("managecontacts"), +// }, +// KeyPermissions: pulumi.StringArray{ +// pulumi.String("create"), +// }, +// SecretPermissions: pulumi.StringArray{ +// pulumi.String("set"), +// }, +// }, +// }, +// }) +// if err != nil { +// return err +// } +// exampleService, err := webpubsub.NewService(ctx, "exampleService", &webpubsub.ServiceArgs{ +// Location: exampleResourceGroup.Location, +// ResourceGroupName: exampleResourceGroup.Name, +// Sku: pulumi.String("Standard_S1"), +// Capacity: pulumi.Int(1), +// }) +// if err != nil { +// return err +// } +// _, err = webpubsub.NewSharedPrivateLinkResource(ctx, "exampleSharedPrivateLinkResource", &webpubsub.SharedPrivateLinkResourceArgs{ +// WebPubsubId: exampleService.ID(), +// SubresourceName: pulumi.String("vault"), +// TargetResourceId: exampleKeyVault.ID(), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// // ## Import // // Web Pubsub Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/aadb2c/directory.ts b/sdk/nodejs/aadb2c/directory.ts index fe748e6134..0a8f8fa588 100644 --- a/sdk/nodejs/aadb2c/directory.ts +++ b/sdk/nodejs/aadb2c/directory.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an AAD B2C Directory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.aadb2c.Directory("example", { + * countryCode: "US", + * dataResidencyLocation: "United States", + * displayName: "example-b2c-tenant", + * domainName: "exampleb2ctenant.onmicrosoft.com", + * resourceGroupName: "example-rg", + * skuName: "PremiumP1", + * }); + * ``` + * * ## Import * * AAD B2C Directories can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/aadb2c/getDirectory.ts b/sdk/nodejs/aadb2c/getDirectory.ts index cee1ccb1f8..cba6a36af8 100644 --- a/sdk/nodejs/aadb2c/getDirectory.ts +++ b/sdk/nodejs/aadb2c/getDirectory.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing AAD B2C Directory. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.aadb2c.getDirectory({ + * resourceGroupName: "example-rg", + * domainName: "exampleb2ctenant.onmicrosoft.com", + * }); + * export const tenantId = example.then(example => example.tenantId); + * ``` */ export function getDirectory(args: GetDirectoryArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +80,19 @@ export interface GetDirectoryResult { } /** * Use this data source to access information about an existing AAD B2C Directory. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.aadb2c.getDirectory({ + * resourceGroupName: "example-rg", + * domainName: "exampleb2ctenant.onmicrosoft.com", + * }); + * export const tenantId = example.then(example => example.tenantId); + * ``` */ export function getDirectoryOutput(args: GetDirectoryOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDirectory(a, opts)) diff --git a/sdk/nodejs/advisor/getRecommendations.ts b/sdk/nodejs/advisor/getRecommendations.ts index e5931b1f91..c8991851e9 100644 --- a/sdk/nodejs/advisor/getRecommendations.ts +++ b/sdk/nodejs/advisor/getRecommendations.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Advisor Recommendations. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.advisor.getRecommendations({ + * filterByCategories: [ + * "security", + * "cost", + * ], + * filterByResourceGroups: ["example-resgroups"], + * }); + * export const recommendations = example.then(example => example.recommendations); + * ``` */ export function getRecommendations(args?: GetRecommendationsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -50,6 +66,22 @@ export interface GetRecommendationsResult { } /** * Use this data source to access information about an existing Advisor Recommendations. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.advisor.getRecommendations({ + * filterByCategories: [ + * "security", + * "cost", + * ], + * filterByResourceGroups: ["example-resgroups"], + * }); + * export const recommendations = example.then(example => example.recommendations); + * ``` */ export function getRecommendationsOutput(args?: GetRecommendationsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRecommendations(a, opts)) diff --git a/sdk/nodejs/analysisservices/server.ts b/sdk/nodejs/analysisservices/server.ts index de41283a30..5304def77e 100644 --- a/sdk/nodejs/analysisservices/server.ts +++ b/sdk/nodejs/analysisservices/server.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages an Analysis Services Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const server = new azure.analysisservices.Server("server", { + * location: example.location, + * resourceGroupName: example.name, + * sku: "S0", + * adminUsers: ["myuser@domain.tld"], + * enablePowerBiService: true, + * ipv4FirewallRules: [{ + * name: "myRule1", + * rangeStart: "210.117.252.0", + * rangeEnd: "210.117.252.255", + * }], + * tags: { + * abc: "123", + * }, + * }); + * ``` + * + * > **NOTE:** The server resource will automatically be started and stopped during an update if it is in `paused` state. + * * ## Import * * Analysis Services Server can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/api.ts b/sdk/nodejs/apimanagement/api.ts index 417e0b5740..b06b5ed056 100644 --- a/sdk/nodejs/apimanagement/api.ts +++ b/sdk/nodejs/apimanagement/api.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages an API within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * const exampleApi = new azure.apimanagement.Api("exampleApi", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * revision: "1", + * displayName: "Example API", + * path: "example", + * protocols: ["https"], + * "import": { + * contentFormat: "swagger-link-json", + * contentValue: "http://conferenceapi.azurewebsites.net/?format=json", + * }, + * }); + * ``` + * * ## Import * * API Management API's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiDiagnostic.ts b/sdk/nodejs/apimanagement/apiDiagnostic.ts index 1b37f3a9b3..392246ca25 100644 --- a/sdk/nodejs/apimanagement/apiDiagnostic.ts +++ b/sdk/nodejs/apimanagement/apiDiagnostic.ts @@ -9,6 +9,90 @@ import * as utilities from "../utilities"; /** * Manages a API Management Service API Diagnostics Logs. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@mycompany.io", + * skuName: "Developer_1", + * }); + * const exampleApi = new azure.apimanagement.Api("exampleApi", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * revision: "1", + * displayName: "Example API", + * path: "example", + * protocols: ["https"], + * "import": { + * contentFormat: "swagger-link-json", + * contentValue: "http://conferenceapi.azurewebsites.net/?format=json", + * }, + * }); + * const exampleLogger = new azure.apimanagement.Logger("exampleLogger", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsights: { + * instrumentationKey: exampleInsights.instrumentationKey, + * }, + * }); + * const exampleApiDiagnostic = new azure.apimanagement.ApiDiagnostic("exampleApiDiagnostic", { + * identifier: "applicationinsights", + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * apiName: exampleApi.name, + * apiManagementLoggerId: exampleLogger.id, + * samplingPercentage: 5, + * alwaysLogErrors: true, + * logClientIp: true, + * verbosity: "verbose", + * httpCorrelationProtocol: "W3C", + * frontendRequest: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "accept", + * "origin", + * ], + * }, + * frontendResponse: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "content-length", + * "origin", + * ], + * }, + * backendRequest: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "accept", + * "origin", + * ], + * }, + * backendResponse: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "content-length", + * "origin", + * ], + * }, + * }); + * ``` + * * ## Import * * API Management Service API Diagnostics Logs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiOperation.ts b/sdk/nodejs/apimanagement/apiOperation.ts index 7a303e16c1..19f351f630 100644 --- a/sdk/nodejs/apimanagement/apiOperation.ts +++ b/sdk/nodejs/apimanagement/apiOperation.ts @@ -9,6 +9,33 @@ import * as utilities from "../utilities"; /** * Manages an API Operation within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleApi = azure.apimanagement.getApi({ + * name: "search-api", + * apiManagementName: "search-api-management", + * resourceGroupName: "search-service", + * revision: "2", + * }); + * const exampleApiOperation = new azure.apimanagement.ApiOperation("exampleApiOperation", { + * operationId: "user-delete", + * apiName: exampleApi.then(exampleApi => exampleApi.name), + * apiManagementName: exampleApi.then(exampleApi => exampleApi.apiManagementName), + * resourceGroupName: exampleApi.then(exampleApi => exampleApi.resourceGroupName), + * displayName: "Delete User Operation", + * method: "DELETE", + * urlTemplate: "/users/{id}/delete", + * description: "This can only be done by the logged in user.", + * responses: [{ + * statusCode: 200, + * }], + * }); + * ``` + * * ## Import * * API Management API Operation's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiOperationPolicy.ts b/sdk/nodejs/apimanagement/apiOperationPolicy.ts index 6629ae2f26..edb3e93355 100644 --- a/sdk/nodejs/apimanagement/apiOperationPolicy.ts +++ b/sdk/nodejs/apimanagement/apiOperationPolicy.ts @@ -7,6 +7,48 @@ import * as utilities from "../utilities"; /** * Manages an API Management API Operation Policy * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * }); + * const exampleApi = new azure.apimanagement.Api("exampleApi", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * revision: "1", + * }); + * const exampleApiOperation = new azure.apimanagement.ApiOperation("exampleApiOperation", { + * operationId: "acctest-operation", + * apiName: exampleApi.name, + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * displayName: "DELETE Resource", + * method: "DELETE", + * urlTemplate: "/resource", + * }); + * const exampleApiOperationPolicy = new azure.apimanagement.ApiOperationPolicy("exampleApiOperationPolicy", { + * apiName: exampleApiOperation.apiName, + * apiManagementName: exampleApiOperation.apiManagementName, + * resourceGroupName: exampleApiOperation.resourceGroupName, + * operationId: exampleApiOperation.operationId, + * xmlContent: ` + * + * + * + * + * `, + * }); + * ``` + * * ## Import * * API Management API Operation Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiOperationTag.ts b/sdk/nodejs/apimanagement/apiOperationTag.ts index d254acd2f9..c22a190f80 100644 --- a/sdk/nodejs/apimanagement/apiOperationTag.ts +++ b/sdk/nodejs/apimanagement/apiOperationTag.ts @@ -7,6 +7,37 @@ import * as utilities from "../utilities"; /** * Manages a API Management API Operation Tag. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleApi = azure.apimanagement.getApi({ + * name: "search-api", + * apiManagementName: "search-api-management", + * resourceGroupName: "search-service", + * revision: "2", + * }); + * const exampleApiOperation = new azure.apimanagement.ApiOperation("exampleApiOperation", { + * operationId: "user-delete", + * apiName: exampleApi.then(exampleApi => exampleApi.name), + * apiManagementName: exampleApi.then(exampleApi => exampleApi.apiManagementName), + * resourceGroupName: exampleApi.then(exampleApi => exampleApi.resourceGroupName), + * displayName: "Delete User Operation", + * method: "DELETE", + * urlTemplate: "/users/{id}/delete", + * description: "This can only be done by the logged in user.", + * responses: [{ + * statusCode: 200, + * }], + * }); + * const exampleApiOperationTag = new azure.apimanagement.ApiOperationTag("exampleApiOperationTag", { + * apiOperationId: exampleApiOperation.id, + * displayName: "example-Tag", + * }); + * ``` + * * ## Import * * API Management API Operation Tags can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiPolicy.ts b/sdk/nodejs/apimanagement/apiPolicy.ts index 50d4991721..4b582c46dd 100644 --- a/sdk/nodejs/apimanagement/apiPolicy.ts +++ b/sdk/nodejs/apimanagement/apiPolicy.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages an API Management API Policy * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleApi = azure.apimanagement.getApi({ + * name: "my-api", + * apiManagementName: "example-apim", + * resourceGroupName: "search-service", + * revision: "2", + * }); + * const exampleApiPolicy = new azure.apimanagement.ApiPolicy("exampleApiPolicy", { + * apiName: exampleApi.then(exampleApi => exampleApi.name), + * apiManagementName: exampleApi.then(exampleApi => exampleApi.apiManagementName), + * resourceGroupName: exampleApi.then(exampleApi => exampleApi.resourceGroupName), + * xmlContent: ` + * + * + * + * + * `, + * }); + * ``` + * * ## Import * * API Management API Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiRelease.ts b/sdk/nodejs/apimanagement/apiRelease.ts index 32e03911ab..97813fe43b 100644 --- a/sdk/nodejs/apimanagement/apiRelease.ts +++ b/sdk/nodejs/apimanagement/apiRelease.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages a API Management API Release. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * }); + * const exampleApi = new azure.apimanagement.Api("exampleApi", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * revision: "1", + * displayName: "Example API", + * path: "example", + * protocols: ["https"], + * "import": { + * contentFormat: "swagger-link-json", + * contentValue: "http://conferenceapi.azurewebsites.net/?format=json", + * }, + * }); + * const exampleApiRelease = new azure.apimanagement.ApiRelease("exampleApiRelease", {apiId: exampleApi.id}); + * ``` + * * ## Import * * API Management API Releases can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiSchema.ts b/sdk/nodejs/apimanagement/apiSchema.ts index 3a15d94531..7d15ed74c2 100644 --- a/sdk/nodejs/apimanagement/apiSchema.ts +++ b/sdk/nodejs/apimanagement/apiSchema.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an API Schema within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleApi = azure.apimanagement.getApi({ + * name: "search-api", + * apiManagementName: "search-api-management", + * resourceGroupName: "search-service", + * revision: "2", + * }); + * const exampleApiSchema = new azure.apimanagement.ApiSchema("exampleApiSchema", { + * apiName: exampleApi.then(exampleApi => exampleApi.name), + * apiManagementName: exampleApi.then(exampleApi => exampleApi.apiManagementName), + * resourceGroupName: exampleApi.then(exampleApi => exampleApi.resourceGroupName), + * schemaId: "example-schema", + * contentType: "application/vnd.ms-azure-apim.xsd+xml", + * value: fs.readFileSync("api_management_api_schema.xml"), + * }); + * ``` + * * ## Import * * API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiTag.ts b/sdk/nodejs/apimanagement/apiTag.ts index d8067e0649..4c4861d282 100644 --- a/sdk/nodejs/apimanagement/apiTag.ts +++ b/sdk/nodejs/apimanagement/apiTag.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages the Assignment of an API Management API Tag to an API. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = azure.apimanagement.getServiceOutput({ + * name: "example-apim", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleApi = new azure.apimanagement.Api("exampleApi", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.apply(exampleService => exampleService.name), + * revision: "1", + * }); + * const exampleTag = new azure.apimanagement.Tag("exampleTag", {apiManagementId: exampleService.apply(exampleService => exampleService.id)}); + * const exampleApiTag = new azure.apimanagement.ApiTag("exampleApiTag", {apiId: exampleApi.id}); + * ``` + * * ## Import * * API Management API Tags can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/apiVersionSet.ts b/sdk/nodejs/apimanagement/apiVersionSet.ts index 6593f28587..285590c48d 100644 --- a/sdk/nodejs/apimanagement/apiVersionSet.ts +++ b/sdk/nodejs/apimanagement/apiVersionSet.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an API Version Set within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Developer_1", + * }); + * const exampleApiVersionSet = new azure.apimanagement.ApiVersionSet("exampleApiVersionSet", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * displayName: "ExampleAPIVersionSet", + * versioningScheme: "Segment", + * }); + * ``` + * * ## Import * * API Version Set can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/authorizationServer.ts b/sdk/nodejs/apimanagement/authorizationServer.ts index e0565d5072..4b7082b13b 100644 --- a/sdk/nodejs/apimanagement/authorizationServer.ts +++ b/sdk/nodejs/apimanagement/authorizationServer.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages an Authorization Server within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "search-api", + * resourceGroupName: "search-service", + * }); + * const exampleAuthorizationServer = new azure.apimanagement.AuthorizationServer("exampleAuthorizationServer", { + * apiManagementName: exampleService.then(exampleService => exampleService.name), + * resourceGroupName: exampleService.then(exampleService => exampleService.resourceGroupName), + * displayName: "Test Server", + * authorizationEndpoint: "https://example.mydomain.com/client/authorize", + * clientId: "42424242-4242-4242-4242-424242424242", + * clientRegistrationEndpoint: "https://example.mydomain.com/client/register", + * grantTypes: ["authorizationCode"], + * authorizationMethods: ["GET"], + * }); + * ``` + * * ## Import * * API Management Authorization Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/backend.ts b/sdk/nodejs/apimanagement/backend.ts index 369a465e30..95244cc928 100644 --- a/sdk/nodejs/apimanagement/backend.ts +++ b/sdk/nodejs/apimanagement/backend.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a backend within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * const exampleBackend = new azure.apimanagement.Backend("exampleBackend", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * protocol: "http", + * url: "https://backend", + * }); + * ``` + * * ## Import * * API Management backends can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/certificate.ts b/sdk/nodejs/apimanagement/certificate.ts index 46739004be..462a00f476 100644 --- a/sdk/nodejs/apimanagement/certificate.ts +++ b/sdk/nodejs/apimanagement/certificate.ts @@ -8,6 +8,86 @@ import * as utilities from "../utilities"; * Manages an Certificate within an API Management Service. * * ## Example Usage + * ### With Base64 Certificate) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * const exampleCertificate = new azure.apimanagement.Certificate("exampleCertificate", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * data: Buffer.from(fs.readFileSync("example.pfx"), 'binary').toString('base64'), + * }); + * ``` + * ### With Key Vault Certificate) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * }); + * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("exampleAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: exampleService.identity.apply(identity => identity?.tenantId), + * objectId: exampleService.identity.apply(identity => identity?.principalId), + * secretPermissions: ["Get"], + * certificatePermissions: ["Get"], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificate: { + * contents: Buffer.from(fs.readFileSync("example_cert.pfx"), 'binary').toString('base64'), + * password: "terraform", + * }, + * certificatePolicy: { + * issuerParameters: { + * name: "Self", + * }, + * keyProperties: { + * exportable: true, + * keySize: 2048, + * keyType: "RSA", + * reuseKey: false, + * }, + * secretProperties: { + * contentType: "application/x-pkcs12", + * }, + * }, + * }); + * const exampleApimanagement_certificateCertificate = new azure.apimanagement.Certificate("exampleApimanagement/certificateCertificate", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * keyVaultSecretId: exampleCertificate.secretId, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/apimanagement/customDomain.ts b/sdk/nodejs/apimanagement/customDomain.ts index d655797219..11c451b92f 100644 --- a/sdk/nodejs/apimanagement/customDomain.ts +++ b/sdk/nodejs/apimanagement/customDomain.ts @@ -13,6 +13,80 @@ import * as utilities from "../utilities"; * * > **Note:** It's possible to define Custom Domains both within the `azure.apimanagement.Service` resource via the `hostnameConfigurations` block and by using this resource. However it's not possible to use both methods to manage Custom Domains within an API Management Service, since there will be conflicts. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "mykeyvault", + * resourceGroupName: "some-resource-group", + * }); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Developer_1", + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.then(exampleKeyVault => exampleKeyVault.id), + * certificatePolicy: { + * issuerParameters: { + * name: "Self", + * }, + * keyProperties: { + * exportable: true, + * keySize: 2048, + * keyType: "RSA", + * reuseKey: true, + * }, + * lifetimeActions: [{ + * action: { + * actionType: "AutoRenew", + * }, + * trigger: { + * daysBeforeExpiry: 30, + * }, + * }], + * secretProperties: { + * contentType: "application/x-pkcs12", + * }, + * x509CertificateProperties: { + * keyUsages: [ + * "cRLSign", + * "dataEncipherment", + * "digitalSignature", + * "keyAgreement", + * "keyCertSign", + * "keyEncipherment", + * ], + * subject: "CN=api.example.com", + * validityInMonths: 12, + * subjectAlternativeNames: { + * dnsNames: [ + * "api.example.com", + * "portal.example.com", + * ], + * }, + * }, + * }, + * }); + * const exampleCustomDomain = new azure.apimanagement.CustomDomain("exampleCustomDomain", { + * apiManagementId: exampleService.id, + * gateways: [{ + * hostName: "api.example.com", + * keyVaultId: exampleCertificate.versionlessSecretId, + * }], + * developerPortals: [{ + * hostName: "portal.example.com", + * keyVaultId: exampleCertificate.versionlessSecretId, + * }], + * }); + * ``` + * * ## Import * * API Management Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/diagnostic.ts b/sdk/nodejs/apimanagement/diagnostic.ts index 47b608d042..a100b14052 100644 --- a/sdk/nodejs/apimanagement/diagnostic.ts +++ b/sdk/nodejs/apimanagement/diagnostic.ts @@ -9,6 +9,77 @@ import * as utilities from "../utilities"; /** * Manages an API Management Service Diagnostic. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@mycompany.io", + * skuName: "Developer_1", + * }); + * const exampleLogger = new azure.apimanagement.Logger("exampleLogger", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsights: { + * instrumentationKey: exampleInsights.instrumentationKey, + * }, + * }); + * const exampleDiagnostic = new azure.apimanagement.Diagnostic("exampleDiagnostic", { + * identifier: "applicationinsights", + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * apiManagementLoggerId: exampleLogger.id, + * samplingPercentage: 5, + * alwaysLogErrors: true, + * logClientIp: true, + * verbosity: "verbose", + * httpCorrelationProtocol: "W3C", + * frontendRequest: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "accept", + * "origin", + * ], + * }, + * frontendResponse: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "content-length", + * "origin", + * ], + * }, + * backendRequest: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "accept", + * "origin", + * ], + * }, + * backendResponse: { + * bodyBytes: 32, + * headersToLogs: [ + * "content-type", + * "content-length", + * "origin", + * ], + * }, + * }); + * ``` + * * ## Import * * API Management Diagnostics can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/emailTemplate.ts b/sdk/nodejs/apimanagement/emailTemplate.ts index 0a2137c548..33b8f4a791 100644 --- a/sdk/nodejs/apimanagement/emailTemplate.ts +++ b/sdk/nodejs/apimanagement/emailTemplate.ts @@ -7,6 +7,39 @@ import * as utilities from "../utilities"; /** * Manages a API Management Email Template. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * }); + * const exampleEmailTemplate = new azure.apimanagement.EmailTemplate("exampleEmailTemplate", { + * templateName: "ConfirmSignUpIdentityDefault", + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * subject: "Customized confirmation email for your new $OrganizationName API account", + * body: ` + * + * + * + * Customized Letter Title + * + * + *

Dear $DevFirstName $DevLastName,

+ * + * + * `, + * }); + * ``` + * * ## Import * * API Management Email Templates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/gateway.ts b/sdk/nodejs/apimanagement/gateway.ts index df99e85238..8203b2c72f 100644 --- a/sdk/nodejs/apimanagement/gateway.ts +++ b/sdk/nodejs/apimanagement/gateway.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages an API Management Gateway. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Consumption_0", + * }); + * const exampleGateway = new azure.apimanagement.Gateway("exampleGateway", { + * apiManagementId: exampleService.id, + * description: "Example API Management gateway", + * locationData: { + * name: "example name", + * city: "example city", + * district: "example district", + * region: "example region", + * }, + * }); + * ``` + * * ## Import * * API Management Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/gatewayApi.ts b/sdk/nodejs/apimanagement/gatewayApi.ts index b82605d55a..4dd02fb692 100644 --- a/sdk/nodejs/apimanagement/gatewayApi.ts +++ b/sdk/nodejs/apimanagement/gatewayApi.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages a API Management Gateway API. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-api", + * resourceGroupName: "example-resources", + * }); + * const exampleApi = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getApi({ + * name: "search-api", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleService1.resourceGroupName, + * revision: "2", + * })); + * const exampleGateway = exampleService.then(exampleService => azure.apimanagement.getGateway({ + * name: "example-gateway", + * apiManagementId: exampleService.id, + * })); + * const exampleGatewayApi = new azure.apimanagement.GatewayApi("exampleGatewayApi", { + * gatewayId: exampleGateway.then(exampleGateway => exampleGateway.id), + * apiId: exampleApi.then(exampleApi => exampleApi.id), + * }); + * ``` + * * ## Import * * API Management Gateway APIs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/gatewayCertificateAuthority.ts b/sdk/nodejs/apimanagement/gatewayCertificateAuthority.ts index abebe0c7a8..339b3c1c98 100644 --- a/sdk/nodejs/apimanagement/gatewayCertificateAuthority.ts +++ b/sdk/nodejs/apimanagement/gatewayCertificateAuthority.ts @@ -7,6 +7,44 @@ import * as utilities from "../utilities"; /** * Manages an API Management Gateway Certificate Authority. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Consumption_0", + * }); + * const exampleGateway = new azure.apimanagement.Gateway("exampleGateway", { + * apiManagementId: exampleService.id, + * description: "Example API Management gateway", + * locationData: { + * name: "example name", + * city: "example city", + * district: "example district", + * region: "example region", + * }, + * }); + * const exampleCertificate = new azure.apimanagement.Certificate("exampleCertificate", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * data: Buffer.from(fs.readFileSync("example.pfx"), 'binary').toString('base64'), + * }); + * const exampleGatewayCertificateAuthority = new azure.apimanagement.GatewayCertificateAuthority("exampleGatewayCertificateAuthority", { + * apiManagementId: exampleService.id, + * certificateName: exampleCertificate.name, + * gatewayName: exampleGateway.name, + * isTrusted: true, + * }); + * ``` + * * ## Import * * API Management Gateway Certificate Authority can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/gatewayHostNameConfiguration.ts b/sdk/nodejs/apimanagement/gatewayHostNameConfiguration.ts index 50c8e4fc2d..8d526c4ae2 100644 --- a/sdk/nodejs/apimanagement/gatewayHostNameConfiguration.ts +++ b/sdk/nodejs/apimanagement/gatewayHostNameConfiguration.ts @@ -7,6 +7,48 @@ import * as utilities from "../utilities"; /** * Manages an API Management Gateway Host Name Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Consumption_0", + * }); + * const exampleGateway = new azure.apimanagement.Gateway("exampleGateway", { + * apiManagementId: exampleService.id, + * description: "Example API Management gateway", + * locationData: { + * name: "example name", + * city: "example city", + * district: "example district", + * region: "example region", + * }, + * }); + * const exampleCertificate = new azure.apimanagement.Certificate("exampleCertificate", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * data: Buffer.from(fs.readFileSync("example.pfx"), 'binary').toString('base64'), + * }); + * const exampleGatewayHostNameConfiguration = new azure.apimanagement.GatewayHostNameConfiguration("exampleGatewayHostNameConfiguration", { + * apiManagementId: exampleService.id, + * gatewayName: exampleGateway.name, + * certificateId: exampleCertificate.id, + * hostName: "example-host-name", + * requestClientCertificateEnabled: true, + * http2Enabled: true, + * tls10Enabled: true, + * tls11Enabled: false, + * }); + * ``` + * * ## Import * * API Management Gateway Host Name Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/getApi.ts b/sdk/nodejs/apimanagement/getApi.ts index c11a170e22..dabcfb2c0c 100644 --- a/sdk/nodejs/apimanagement/getApi.ts +++ b/sdk/nodejs/apimanagement/getApi.ts @@ -8,6 +8,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing API Management API. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getApi({ + * name: "search-api", + * apiManagementName: "search-api-management", + * resourceGroupName: "search-service", + * revision: "2", + * }); + * export const apiManagementApiId = example.then(example => example.id); + * ``` */ export function getApi(args: GetApiArgs, opts?: pulumi.InvokeOptions): Promise { @@ -105,6 +120,21 @@ export interface GetApiResult { } /** * Use this data source to access information about an existing API Management API. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getApi({ + * name: "search-api", + * apiManagementName: "search-api-management", + * resourceGroupName: "search-service", + * revision: "2", + * }); + * export const apiManagementApiId = example.then(example => example.id); + * ``` */ export function getApiOutput(args: GetApiOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getApi(a, opts)) diff --git a/sdk/nodejs/apimanagement/getApiVersionSet.ts b/sdk/nodejs/apimanagement/getApiVersionSet.ts index c7c4e55ad0..a6960302c8 100644 --- a/sdk/nodejs/apimanagement/getApiVersionSet.ts +++ b/sdk/nodejs/apimanagement/getApiVersionSet.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an API Version Set within an API Management Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getApiVersionSet({ + * resourceGroupName: "example-resources", + * apiManagementName: "example-api", + * name: "example-api-version-set", + * }); + * export const apiManagementApiVersionSetId = example.then(example => example.id); + * ``` */ export function getApiVersionSet(args: GetApiVersionSetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -66,6 +80,20 @@ export interface GetApiVersionSetResult { } /** * Uses this data source to access information about an API Version Set within an API Management Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getApiVersionSet({ + * resourceGroupName: "example-resources", + * apiManagementName: "example-api", + * name: "example-api-version-set", + * }); + * export const apiManagementApiVersionSetId = example.then(example => example.id); + * ``` */ export function getApiVersionSetOutput(args: GetApiVersionSetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getApiVersionSet(a, opts)) diff --git a/sdk/nodejs/apimanagement/getGateway.ts b/sdk/nodejs/apimanagement/getGateway.ts index 6cad1bc5e2..924d1a6560 100644 --- a/sdk/nodejs/apimanagement/getGateway.ts +++ b/sdk/nodejs/apimanagement/getGateway.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing API Management Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-apim", + * resourceGroupName: "example-rg", + * }); + * const exampleGateway = exampleService.then(exampleService => azure.apimanagement.getGateway({ + * name: "example-api-gateway", + * apiManagementId: exampleService.id, + * })); + * ``` */ export function getGateway(args: GetGatewayArgs, opts?: pulumi.InvokeOptions): Promise { @@ -56,6 +72,22 @@ export interface GetGatewayResult { } /** * Use this data source to access information about an existing API Management Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-apim", + * resourceGroupName: "example-rg", + * }); + * const exampleGateway = exampleService.then(exampleService => azure.apimanagement.getGateway({ + * name: "example-api-gateway", + * apiManagementId: exampleService.id, + * })); + * ``` */ export function getGatewayOutput(args: GetGatewayOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getGateway(a, opts)) diff --git a/sdk/nodejs/apimanagement/getGatewayHostNameConfiguration.ts b/sdk/nodejs/apimanagement/getGatewayHostNameConfiguration.ts index ed8fdebd7d..cf3df75fd2 100644 --- a/sdk/nodejs/apimanagement/getGatewayHostNameConfiguration.ts +++ b/sdk/nodejs/apimanagement/getGatewayHostNameConfiguration.ts @@ -6,6 +6,28 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing API Management Gateway Host Configuration. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-apim", + * resourceGroupName: "example-resources", + * }); + * const exampleGateway = azure.apimanagement.getGateway({ + * name: "example-gateway", + * apiManagementId: data.azurerm_api_management.main.id, + * }); + * const exampleGatewayHostNameConfiguration = Promise.all([exampleService, exampleGateway]).then(([exampleService, exampleGateway]) => azure.apimanagement.getGatewayHostNameConfiguration({ + * name: "example-host-configuration", + * apiManagementId: exampleService.id, + * gatewayName: exampleGateway.name, + * })); + * export const hostName = exampleGatewayHostNameConfiguration.then(exampleGatewayHostNameConfiguration => exampleGatewayHostNameConfiguration.hostName); + * ``` */ export function getGatewayHostNameConfiguration(args: GetGatewayHostNameConfigurationArgs, opts?: pulumi.InvokeOptions): Promise { @@ -74,6 +96,28 @@ export interface GetGatewayHostNameConfigurationResult { } /** * Use this data source to access information about an existing API Management Gateway Host Configuration. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-apim", + * resourceGroupName: "example-resources", + * }); + * const exampleGateway = azure.apimanagement.getGateway({ + * name: "example-gateway", + * apiManagementId: data.azurerm_api_management.main.id, + * }); + * const exampleGatewayHostNameConfiguration = Promise.all([exampleService, exampleGateway]).then(([exampleService, exampleGateway]) => azure.apimanagement.getGatewayHostNameConfiguration({ + * name: "example-host-configuration", + * apiManagementId: exampleService.id, + * gatewayName: exampleGateway.name, + * })); + * export const hostName = exampleGatewayHostNameConfiguration.then(exampleGatewayHostNameConfiguration => exampleGatewayHostNameConfiguration.hostName); + * ``` */ export function getGatewayHostNameConfigurationOutput(args: GetGatewayHostNameConfigurationOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getGatewayHostNameConfiguration(a, opts)) diff --git a/sdk/nodejs/apimanagement/getGroup.ts b/sdk/nodejs/apimanagement/getGroup.ts index 2f84beab7b..ec411b8f6b 100644 --- a/sdk/nodejs/apimanagement/getGroup.ts +++ b/sdk/nodejs/apimanagement/getGroup.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing API Management Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getGroup({ + * name: "my-group", + * apiManagementName: "example-apim", + * resourceGroupName: "search-service", + * }); + * export const groupType = example.then(example => example.type); + * ``` */ export function getGroup(args: GetGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +79,20 @@ export interface GetGroupResult { } /** * Use this data source to access information about an existing API Management Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getGroup({ + * name: "my-group", + * apiManagementName: "example-apim", + * resourceGroupName: "search-service", + * }); + * export const groupType = example.then(example => example.type); + * ``` */ export function getGroupOutput(args: GetGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getGroup(a, opts)) diff --git a/sdk/nodejs/apimanagement/getProduct.ts b/sdk/nodejs/apimanagement/getProduct.ts index e708fd48ae..d33a9e6501 100644 --- a/sdk/nodejs/apimanagement/getProduct.ts +++ b/sdk/nodejs/apimanagement/getProduct.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing API Management Product. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getProduct({ + * productId: "my-product", + * apiManagementName: "example-apim", + * resourceGroupName: "search-service", + * }); + * export const productTerms = example.then(example => example.terms); + * ``` */ export function getProduct(args: GetProductArgs, opts?: pulumi.InvokeOptions): Promise { @@ -77,6 +91,20 @@ export interface GetProductResult { } /** * Use this data source to access information about an existing API Management Product. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getProduct({ + * productId: "my-product", + * apiManagementName: "example-apim", + * resourceGroupName: "search-service", + * }); + * export const productTerms = example.then(example => example.terms); + * ``` */ export function getProductOutput(args: GetProductOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getProduct(a, opts)) diff --git a/sdk/nodejs/apimanagement/getService.ts b/sdk/nodejs/apimanagement/getService.ts index 20b69ad130..4d70e599dc 100644 --- a/sdk/nodejs/apimanagement/getService.ts +++ b/sdk/nodejs/apimanagement/getService.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing API Management Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getService({ + * name: "search-api", + * resourceGroupName: "search-service", + * }); + * export const apiManagementId = example.then(example => example.id); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -126,6 +139,19 @@ export interface GetServiceResult { } /** * Use this data source to access information about an existing API Management Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.apimanagement.getService({ + * name: "search-api", + * resourceGroupName: "search-service", + * }); + * export const apiManagementId = example.then(example => example.id); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/apimanagement/globalSchema.ts b/sdk/nodejs/apimanagement/globalSchema.ts index 2a77fb77f6..34d0bdec7f 100644 --- a/sdk/nodejs/apimanagement/globalSchema.ts +++ b/sdk/nodejs/apimanagement/globalSchema.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a Global Schema within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Consumption_0", + * }); + * const exampleGlobalSchema = new azure.apimanagement.GlobalSchema("exampleGlobalSchema", { + * schemaId: "example-schema1", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * type: "xml", + * value: fs.readFileSync("api_management_api_schema.xml"), + * }); + * ``` + * * ## Import * * API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/group.ts b/sdk/nodejs/apimanagement/group.ts index 59b87a8cca..32c3562098 100644 --- a/sdk/nodejs/apimanagement/group.ts +++ b/sdk/nodejs/apimanagement/group.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an API Management Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Developer_1", + * }); + * const exampleGroup = new azure.apimanagement.Group("exampleGroup", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * displayName: "Example Group", + * description: "This is an example API management group.", + * }); + * ``` + * * ## Import * * API Management Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/groupUser.ts b/sdk/nodejs/apimanagement/groupUser.ts index e3ebe570fe..35c219c73a 100644 --- a/sdk/nodejs/apimanagement/groupUser.ts +++ b/sdk/nodejs/apimanagement/groupUser.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages an API Management User Assignment to a Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleUser = azure.apimanagement.getUser({ + * userId: "my-user", + * apiManagementName: "example-apim", + * resourceGroupName: "search-service", + * }); + * const exampleGroupUser = new azure.apimanagement.GroupUser("exampleGroupUser", { + * userId: exampleUser.then(exampleUser => exampleUser.id), + * groupName: "example-group", + * resourceGroupName: exampleUser.then(exampleUser => exampleUser.resourceGroupName), + * apiManagementName: exampleUser.then(exampleUser => exampleUser.apiManagementName), + * }); + * ``` + * * ## Import * * API Management Group Users can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/identityProviderAad.ts b/sdk/nodejs/apimanagement/identityProviderAad.ts index e5dc156ffb..30448699d3 100644 --- a/sdk/nodejs/apimanagement/identityProviderAad.ts +++ b/sdk/nodejs/apimanagement/identityProviderAad.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an API Management AAD Identity Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@mycompany.io", + * skuName: "Developer_1", + * }); + * const exampleIdentityProviderAad = new azure.apimanagement.IdentityProviderAad("exampleIdentityProviderAad", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * clientId: "00000000-0000-0000-0000-000000000000", + * clientSecret: "00000000000000000000000000000000", + * allowedTenants: ["00000000-0000-0000-0000-000000000000"], + * }); + * ``` + * * ## Import * * API Management AAD Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/identityProviderAadb2c.ts b/sdk/nodejs/apimanagement/identityProviderAadb2c.ts index 722f4cc250..33928abae7 100644 --- a/sdk/nodejs/apimanagement/identityProviderAadb2c.ts +++ b/sdk/nodejs/apimanagement/identityProviderAadb2c.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages an API Management Azure AD B2C Identity Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * }); + * const exampleApplication = new azuread.Application("exampleApplication", {displayName: "acctestam-example"}); + * const exampleApplicationPassword = new azuread.ApplicationPassword("exampleApplicationPassword", { + * applicationObjectId: exampleApplication.objectId, + * endDateRelative: "36h", + * }); + * const exampleIdentityProviderAadb2c = new azure.apimanagement.IdentityProviderAadb2c("exampleIdentityProviderAadb2c", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * clientId: exampleApplication.applicationId, + * clientSecret: "P@55w0rD!", + * allowedTenant: "myb2ctenant.onmicrosoft.com", + * signinTenant: "myb2ctenant.onmicrosoft.com", + * authority: "myb2ctenant.b2clogin.com", + * signinPolicy: "B2C_1_Login", + * signupPolicy: "B2C_1_Signup", + * }, { + * dependsOn: [exampleApplicationPassword], + * }); + * ``` + * * ## Import * * API Management Azure AD B2C Identity Providers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/identityProviderFacebook.ts b/sdk/nodejs/apimanagement/identityProviderFacebook.ts index c9da5a39dc..9326846130 100644 --- a/sdk/nodejs/apimanagement/identityProviderFacebook.ts +++ b/sdk/nodejs/apimanagement/identityProviderFacebook.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an API Management Facebook Identity Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@mycompany.io", + * skuName: "Developer_1", + * }); + * const exampleIdentityProviderFacebook = new azure.apimanagement.IdentityProviderFacebook("exampleIdentityProviderFacebook", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * appId: "00000000000000000000000000000000", + * appSecret: "00000000000000000000000000000000", + * }); + * ``` + * * ## Import * * API Management Facebook Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/identityProviderGoogle.ts b/sdk/nodejs/apimanagement/identityProviderGoogle.ts index b61b827c63..a028273799 100644 --- a/sdk/nodejs/apimanagement/identityProviderGoogle.ts +++ b/sdk/nodejs/apimanagement/identityProviderGoogle.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an API Management Google Identity Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@mycompany.io", + * skuName: "Developer_1", + * }); + * const exampleIdentityProviderGoogle = new azure.apimanagement.IdentityProviderGoogle("exampleIdentityProviderGoogle", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * clientId: "00000000.apps.googleusercontent.com", + * clientSecret: "00000000000000000000000000000000", + * }); + * ``` + * * ## Import * * API Management Google Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/identityProviderMicrosoft.ts b/sdk/nodejs/apimanagement/identityProviderMicrosoft.ts index 9803ae5c58..1b22cca594 100644 --- a/sdk/nodejs/apimanagement/identityProviderMicrosoft.ts +++ b/sdk/nodejs/apimanagement/identityProviderMicrosoft.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an API Management Microsoft Identity Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@mycompany.io", + * skuName: "Developer_1", + * }); + * const exampleIdentityProviderMicrosoft = new azure.apimanagement.IdentityProviderMicrosoft("exampleIdentityProviderMicrosoft", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * clientId: "00000000-0000-0000-0000-000000000000", + * clientSecret: "00000000000000000000000000000000", + * }); + * ``` + * * ## Import * * API Management Microsoft Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/identityProviderTwitter.ts b/sdk/nodejs/apimanagement/identityProviderTwitter.ts index 3f1c4b18fc..e7b907c6fc 100644 --- a/sdk/nodejs/apimanagement/identityProviderTwitter.ts +++ b/sdk/nodejs/apimanagement/identityProviderTwitter.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an API Management Twitter Identity Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@mycompany.io", + * skuName: "Developer_1", + * }); + * const exampleIdentityProviderTwitter = new azure.apimanagement.IdentityProviderTwitter("exampleIdentityProviderTwitter", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * apiKey: "00000000000000000000000000000000", + * apiSecretKey: "00000000000000000000000000000000", + * }); + * ``` + * * ## Import * * API Management Twitter Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/logger.ts b/sdk/nodejs/apimanagement/logger.ts index 8df80a0def..4c2d4dee22 100644 --- a/sdk/nodejs/apimanagement/logger.ts +++ b/sdk/nodejs/apimanagement/logger.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Logger within an API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "other", + * }); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * const exampleLogger = new azure.apimanagement.Logger("exampleLogger", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * resourceId: exampleInsights.id, + * applicationInsights: { + * instrumentationKey: exampleInsights.instrumentationKey, + * }, + * }); + * ``` + * * ## Import * * API Management Loggers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/namedValue.ts b/sdk/nodejs/apimanagement/namedValue.ts index af78693d39..2fe18771be 100644 --- a/sdk/nodejs/apimanagement/namedValue.ts +++ b/sdk/nodejs/apimanagement/namedValue.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages an API Management Named Value. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Developer_1", + * }); + * const exampleNamedValue = new azure.apimanagement.NamedValue("exampleNamedValue", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * displayName: "ExampleProperty", + * value: "Example Value", + * }); + * ``` + * * ## Import * * API Management Properties can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/notificationRecipientEmail.ts b/sdk/nodejs/apimanagement/notificationRecipientEmail.ts index 3bceecedd9..ca850471aa 100644 --- a/sdk/nodejs/apimanagement/notificationRecipientEmail.ts +++ b/sdk/nodejs/apimanagement/notificationRecipientEmail.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a API Management Notification Recipient Email. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * }); + * const exampleNotificationRecipientEmail = new azure.apimanagement.NotificationRecipientEmail("exampleNotificationRecipientEmail", { + * apiManagementId: exampleService.id, + * notificationType: "AccountClosedPublisher", + * email: "foo@bar.com", + * }); + * ``` + * * ## Import * * API Management Notification Recipient Emails can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/notificationRecipientUser.ts b/sdk/nodejs/apimanagement/notificationRecipientUser.ts index a0401dccf6..a0f808b3de 100644 --- a/sdk/nodejs/apimanagement/notificationRecipientUser.ts +++ b/sdk/nodejs/apimanagement/notificationRecipientUser.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a API Management Notification Recipient User. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * }); + * const exampleUser = new azure.apimanagement.User("exampleUser", { + * userId: "123", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * firstName: "Example", + * lastName: "User", + * email: "foo@bar.com", + * state: "active", + * }); + * const exampleNotificationRecipientUser = new azure.apimanagement.NotificationRecipientUser("exampleNotificationRecipientUser", { + * apiManagementId: exampleService.id, + * notificationType: "AccountClosedPublisher", + * userId: exampleUser.userId, + * }); + * ``` + * * ## Import * * API Management Notification Recipient Users can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/openIdConnectProvider.ts b/sdk/nodejs/apimanagement/openIdConnectProvider.ts index 8797ed8a89..b17ffcd585 100644 --- a/sdk/nodejs/apimanagement/openIdConnectProvider.ts +++ b/sdk/nodejs/apimanagement/openIdConnectProvider.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages an OpenID Connect Provider within a API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * const exampleOpenIdConnectProvider = new azure.apimanagement.OpenIdConnectProvider("exampleOpenIdConnectProvider", { + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * clientId: "00001111-2222-3333-4444-555566667777", + * clientSecret: "00001111-423egvwdcsjx-00001111", + * displayName: "Example Provider", + * metadataEndpoint: "https://example.com/example", + * }); + * ``` + * * ## Import * * API Management OpenID Connect Providers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/policy.ts b/sdk/nodejs/apimanagement/policy.ts index 0074f9489c..5719f9cac3 100644 --- a/sdk/nodejs/apimanagement/policy.ts +++ b/sdk/nodejs/apimanagement/policy.ts @@ -9,6 +9,33 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource will, upon creation, **overwrite any existing policy in the API Management service**, as there is no feasible way to test whether the policy has been modified from the default. Similarly, when this resource is destroyed, the API Management service will revert to its default policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Developer_1", + * }); + * const exampleNamedValue = new azure.apimanagement.NamedValue("exampleNamedValue", { + * resourceGroupName: exampleResourceGroup.name, + * apiManagementName: exampleService.name, + * displayName: "ExampleProperty", + * value: "Example Value", + * }); + * const examplePolicy = new azure.apimanagement.Policy("examplePolicy", { + * apiManagementId: exampleService.id, + * xmlContent: fs.readFileSync("example.xml"), + * }); + * ``` + * * ## Import * * API Management service Policys can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/product.ts b/sdk/nodejs/apimanagement/product.ts index e448b26723..5705fbba5b 100644 --- a/sdk/nodejs/apimanagement/product.ts +++ b/sdk/nodejs/apimanagement/product.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages an API Management Product. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * const exampleProduct = new azure.apimanagement.Product("exampleProduct", { + * productId: "test-product", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * displayName: "Test Product", + * subscriptionRequired: true, + * approvalRequired: true, + * published: true, + * }); + * ``` + * * ## Import * * API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/productApi.ts b/sdk/nodejs/apimanagement/productApi.ts index 2c68a6bcfe..7232682dbc 100644 --- a/sdk/nodejs/apimanagement/productApi.ts +++ b/sdk/nodejs/apimanagement/productApi.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages an API Management API Assignment to a Product. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-api", + * resourceGroupName: "example-resources", + * }); + * const exampleApi = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getApi({ + * name: "search-api", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleService1.resourceGroupName, + * revision: "2", + * })); + * const exampleProduct = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getProduct({ + * productId: "my-product", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleService1.resourceGroupName, + * })); + * const exampleProductApi = new azure.apimanagement.ProductApi("exampleProductApi", { + * apiName: exampleApi.then(exampleApi => exampleApi.name), + * productId: exampleProduct.then(exampleProduct => exampleProduct.productId), + * apiManagementName: exampleService.then(exampleService => exampleService.name), + * resourceGroupName: exampleService.then(exampleService => exampleService.resourceGroupName), + * }); + * ``` + * * ## Import * * API Management Product API's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/productGroup.ts b/sdk/nodejs/apimanagement/productGroup.ts index 6d2cd90015..13d98454b6 100644 --- a/sdk/nodejs/apimanagement/productGroup.ts +++ b/sdk/nodejs/apimanagement/productGroup.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages an API Management Product Assignment to a Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-api", + * resourceGroupName: "example-resources", + * }); + * const exampleProduct = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getProduct({ + * productId: "my-product", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleService1.resourceGroupName, + * })); + * const exampleGroup = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getGroup({ + * name: "my-group", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleService1.resourceGroupName, + * })); + * const exampleProductGroup = new azure.apimanagement.ProductGroup("exampleProductGroup", { + * productId: exampleProduct.then(exampleProduct => exampleProduct.productId), + * groupName: exampleGroup.then(exampleGroup => exampleGroup.name), + * apiManagementName: exampleService.then(exampleService => exampleService.name), + * resourceGroupName: exampleService.then(exampleService => exampleService.resourceGroupName), + * }); + * ``` + * * ## Import * * API Management Product Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/productPolicy.ts b/sdk/nodejs/apimanagement/productPolicy.ts index 15320b46ae..d3de2cdb2b 100644 --- a/sdk/nodejs/apimanagement/productPolicy.ts +++ b/sdk/nodejs/apimanagement/productPolicy.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages an API Management Product Policy * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleProduct = azure.apimanagement.getProduct({ + * productId: "my-product", + * apiManagementName: "example-apim", + * resourceGroupName: "search-service", + * }); + * const exampleProductPolicy = new azure.apimanagement.ProductPolicy("exampleProductPolicy", { + * productId: exampleProduct.then(exampleProduct => exampleProduct.productId), + * apiManagementName: exampleProduct.then(exampleProduct => exampleProduct.apiManagementName), + * resourceGroupName: exampleProduct.then(exampleProduct => exampleProduct.resourceGroupName), + * xmlContent: ` + * + * + * + * + * `, + * }); + * ``` + * * ## Import * * API Management Product Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/productTag.ts b/sdk/nodejs/apimanagement/productTag.ts index 4ccde37f2f..7960a88cc3 100644 --- a/sdk/nodejs/apimanagement/productTag.ts +++ b/sdk/nodejs/apimanagement/productTag.ts @@ -7,6 +7,37 @@ import * as utilities from "../utilities"; /** * Manages an API Management Product tag * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Developer_1", + * }); + * const exampleProduct = new azure.apimanagement.Product("exampleProduct", { + * productId: "test-product", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * displayName: "Test Product", + * subscriptionRequired: true, + * approvalRequired: true, + * published: true, + * }); + * const exampleTag = new azure.apimanagement.Tag("exampleTag", {apiManagementId: exampleService.id}); + * const exampleProductTag = new azure.apimanagement.ProductTag("exampleProductTag", { + * apiManagementProductId: exampleProduct.productId, + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/redisCache.ts b/sdk/nodejs/apimanagement/redisCache.ts index 20215d931e..ef3ba13be2 100644 --- a/sdk/nodejs/apimanagement/redisCache.ts +++ b/sdk/nodejs/apimanagement/redisCache.ts @@ -7,6 +7,39 @@ import * as utilities from "../utilities"; /** * Manages a API Management Redis Cache. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "pub1", + * publisherEmail: "pub1@email.com", + * skuName: "Consumption_0", + * }); + * const exampleCache = new azure.redis.Cache("exampleCache", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * capacity: 1, + * family: "C", + * skuName: "Basic", + * enableNonSslPort: false, + * minimumTlsVersion: "1.2", + * redisConfiguration: {}, + * }); + * const exampleRedisCache = new azure.apimanagement.RedisCache("exampleRedisCache", { + * apiManagementId: exampleService.id, + * connectionString: exampleCache.primaryConnectionString, + * description: "Redis cache instances", + * redisCacheId: exampleCache.id, + * cacheLocation: "East Us", + * }); + * ``` + * * ## Import * * API Management Redis Caches can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/service.ts b/sdk/nodejs/apimanagement/service.ts index 4efc232c62..d64210ca24 100644 --- a/sdk/nodejs/apimanagement/service.ts +++ b/sdk/nodejs/apimanagement/service.ts @@ -7,6 +7,22 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * ``` + * * ## Import * * API Management Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/subscription.ts b/sdk/nodejs/apimanagement/subscription.ts index 7e9616d5e4..cbff1de5b5 100644 --- a/sdk/nodejs/apimanagement/subscription.ts +++ b/sdk/nodejs/apimanagement/subscription.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages a Subscription within a API Management Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.apimanagement.getService({ + * name: "example-apim", + * resourceGroupName: "example-resources", + * }); + * const exampleProduct = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getProduct({ + * productId: "00000000-0000-0000-0000-000000000000", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleService1.resourceGroupName, + * })); + * const exampleUser = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getUser({ + * userId: "11111111-1111-1111-1111-111111111111", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleService1.resourceGroupName, + * })); + * const exampleSubscription = new azure.apimanagement.Subscription("exampleSubscription", { + * apiManagementName: exampleService.then(exampleService => exampleService.name), + * resourceGroupName: exampleService.then(exampleService => exampleService.resourceGroupName), + * userId: exampleUser.then(exampleUser => exampleUser.id), + * productId: exampleProduct.then(exampleProduct => exampleProduct.id), + * displayName: "Parser API", + * }); + * ``` + * * ## Import * * API Management Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/tag.ts b/sdk/nodejs/apimanagement/tag.ts index 82787319e1..683dbddbc2 100644 --- a/sdk/nodejs/apimanagement/tag.ts +++ b/sdk/nodejs/apimanagement/tag.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a API Management Tag. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@terraform.io", + * skuName: "Consumption_0", + * }); + * const exampleTag = new azure.apimanagement.Tag("exampleTag", {apiManagementId: exampleService.id}); + * ``` + * * ## Import * * API Management Tags can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/apimanagement/user.ts b/sdk/nodejs/apimanagement/user.ts index 11c8ab72d6..ba37730812 100644 --- a/sdk/nodejs/apimanagement/user.ts +++ b/sdk/nodejs/apimanagement/user.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages an API Management User. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.apimanagement.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * publisherName: "My Company", + * publisherEmail: "company@exmaple.com", + * skuName: "Developer_1", + * }); + * const exampleUser = new azure.apimanagement.User("exampleUser", { + * userId: "5931a75ae4bbd512288c680b", + * apiManagementName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * firstName: "Example", + * lastName: "User", + * email: "user@example.com", + * state: "active", + * }); + * ``` + * * ## Import * * API Management Users can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appconfiguration/configurationFeature.ts b/sdk/nodejs/appconfiguration/configurationFeature.ts index e51cdf0149..25eb9fd997 100644 --- a/sdk/nodejs/appconfiguration/configurationFeature.ts +++ b/sdk/nodejs/appconfiguration/configurationFeature.ts @@ -11,6 +11,31 @@ import * as utilities from "../utilities"; * * > **Note:** App Configuration Features are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). This is similar to providing App Configuration Keys. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const appconf = new azure.appconfiguration.ConfigurationStore("appconf", { + * resourceGroupName: example.name, + * location: example.location, + * }); + * const current = azure.core.getClientConfig({}); + * const appconfDataowner = new azure.authorization.Assignment("appconfDataowner", { + * scope: appconf.id, + * roleDefinitionName: "App Configuration Data Owner", + * principalId: current.then(current => current.objectId), + * }); + * const test = new azure.appconfiguration.ConfigurationFeature("test", { + * configurationStoreId: appconf.id, + * description: "test description", + * label: "test-ackeylabel", + * enabled: true, + * }); + * ``` + * * ## Import * * App Configuration Features can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appconfiguration/configurationKey.ts b/sdk/nodejs/appconfiguration/configurationKey.ts index 52e37021c9..131c6a9ddf 100644 --- a/sdk/nodejs/appconfiguration/configurationKey.ts +++ b/sdk/nodejs/appconfiguration/configurationKey.ts @@ -10,6 +10,85 @@ import * as utilities from "../utilities"; * > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). * * ## Example Usage + * ### `Kv` Type + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const appconf = new azure.appconfiguration.ConfigurationStore("appconf", { + * resourceGroupName: example.name, + * location: example.location, + * }); + * const current = azure.core.getClientConfig({}); + * const appconfDataowner = new azure.authorization.Assignment("appconfDataowner", { + * scope: appconf.id, + * roleDefinitionName: "App Configuration Data Owner", + * principalId: current.then(current => current.objectId), + * }); + * const test = new azure.appconfiguration.ConfigurationKey("test", { + * configurationStoreId: appconf.id, + * key: "appConfKey1", + * label: "somelabel", + * value: "a test", + * }, { + * dependsOn: [appconfDataowner], + * }); + * ``` + * ### `Vault` Type + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const appconf = new azure.appconfiguration.ConfigurationStore("appconf", { + * resourceGroupName: example.name, + * location: example.location, + * }); + * const current = azure.core.getClientConfig({}); + * const kv = new azure.keyvault.KeyVault("kv", { + * location: azurerm_resource_group.test.location, + * resourceGroupName: azurerm_resource_group.test.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * softDeleteRetentionDays: 7, + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * ], + * secretPermissions: [ + * "Set", + * "Get", + * "Delete", + * "Purge", + * "Recover", + * ], + * }], + * }); + * const kvs = new azure.keyvault.Secret("kvs", { + * value: "szechuan", + * keyVaultId: kv.id, + * }); + * const appconfDataowner = new azure.authorization.Assignment("appconfDataowner", { + * scope: appconf.id, + * roleDefinitionName: "App Configuration Data Owner", + * principalId: current.then(current => current.objectId), + * }); + * const test = new azure.appconfiguration.ConfigurationKey("test", { + * configurationStoreId: azurerm_app_configuration.test.id, + * key: "key1", + * type: "vault", + * label: "label1", + * vaultKeyReference: kvs.versionlessId, + * }, { + * dependsOn: [appconfDataowner], + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/appconfiguration/configurationStore.ts b/sdk/nodejs/appconfiguration/configurationStore.ts index 8c2d4d4a00..8e91065c8b 100644 --- a/sdk/nodejs/appconfiguration/configurationStore.ts +++ b/sdk/nodejs/appconfiguration/configurationStore.ts @@ -7,6 +7,120 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const appconf = new azure.appconfiguration.ConfigurationStore("appconf", { + * resourceGroupName: example.name, + * location: example.location, + * }); + * ``` + * ### Encryption) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const current = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * softDeleteRetentionDays: 7, + * purgeProtectionEnabled: true, + * }); + * const server = new azure.keyvault.AccessPolicy("server", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleUserAssignedIdentity.principalId, + * keyPermissions: [ + * "Get", + * "UnwrapKey", + * "WrapKey", + * ], + * secretPermissions: ["Get"], + * }); + * const client = new azure.keyvault.AccessPolicy("client", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "Create", + * "Delete", + * "List", + * "Restore", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * "Purge", + * "Encrypt", + * "Decrypt", + * "Sign", + * "Verify", + * "GetRotationPolicy", + * ], + * secretPermissions: ["Get"], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * client, + * server, + * ], + * }); + * const exampleConfigurationStore = new azure.appconfiguration.ConfigurationStore("exampleConfigurationStore", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "standard", + * localAuthEnabled: true, + * publicNetworkAccess: "Enabled", + * purgeProtectionEnabled: false, + * softDeleteRetentionDays: 1, + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * encryption: { + * keyVaultKeyIdentifier: exampleKey.id, + * identityClientId: exampleUserAssignedIdentity.clientId, + * }, + * replicas: [{ + * name: "replica1", + * location: "West US", + * }], + * tags: { + * environment: "development", + * }, + * }, { + * dependsOn: [ + * client, + * server, + * ], + * }); + * ``` + * * ## Import * * App Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appconfiguration/getConfigurationKey.ts b/sdk/nodejs/appconfiguration/getConfigurationKey.ts index 01d146ed02..cbd12496e7 100644 --- a/sdk/nodejs/appconfiguration/getConfigurationKey.ts +++ b/sdk/nodejs/appconfiguration/getConfigurationKey.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing Azure App Configuration Key. * * > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.appconfiguration.getConfigurationKey({ + * configurationStoreId: azurerm_app_configuration.appconf.id, + * key: "appConfKey1", + * label: "somelabel", + * }); + * export const value = test.then(test => test.value); + * ``` */ export function getConfigurationKey(args: GetConfigurationKeyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -81,6 +95,20 @@ export interface GetConfigurationKeyResult { * Use this data source to access information about an existing Azure App Configuration Key. * * > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.appconfiguration.getConfigurationKey({ + * configurationStoreId: azurerm_app_configuration.appconf.id, + * key: "appConfKey1", + * label: "somelabel", + * }); + * export const value = test.then(test => test.value); + * ``` */ export function getConfigurationKeyOutput(args: GetConfigurationKeyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getConfigurationKey(a, opts)) diff --git a/sdk/nodejs/appconfiguration/getConfigurationKeys.ts b/sdk/nodejs/appconfiguration/getConfigurationKeys.ts index 2a54343c07..9ab282c534 100644 --- a/sdk/nodejs/appconfiguration/getConfigurationKeys.ts +++ b/sdk/nodejs/appconfiguration/getConfigurationKeys.ts @@ -10,6 +10,18 @@ import * as utilities from "../utilities"; * Use this data source to access information about existing Azure App Configuration Keys. * * > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.appconfiguration.getConfigurationKeys({ + * configurationStoreId: azurerm_app_configuration.appconf.id, + * }); + * export const value = test.then(test => test.items); + * ``` */ export function getConfigurationKeys(args: GetConfigurationKeysArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +77,18 @@ export interface GetConfigurationKeysResult { * Use this data source to access information about existing Azure App Configuration Keys. * * > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.appconfiguration.getConfigurationKeys({ + * configurationStoreId: azurerm_app_configuration.appconf.id, + * }); + * export const value = test.then(test => test.items); + * ``` */ export function getConfigurationKeysOutput(args: GetConfigurationKeysOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getConfigurationKeys(a, opts)) diff --git a/sdk/nodejs/appconfiguration/getConfigurationStore.ts b/sdk/nodejs/appconfiguration/getConfigurationStore.ts index c88997a920..5ba0dc4d87 100644 --- a/sdk/nodejs/appconfiguration/getConfigurationStore.ts +++ b/sdk/nodejs/appconfiguration/getConfigurationStore.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing App Configuration. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appconfiguration.getConfigurationStore({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getConfigurationStore(args: GetConfigurationStoreArgs, opts?: pulumi.InvokeOptions): Promise { @@ -106,6 +119,19 @@ export interface GetConfigurationStoreResult { } /** * Use this data source to access information about an existing App Configuration. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appconfiguration.getConfigurationStore({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getConfigurationStoreOutput(args: GetConfigurationStoreOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getConfigurationStore(a, opts)) diff --git a/sdk/nodejs/appconfiguration/licationLoadBalancer.ts b/sdk/nodejs/appconfiguration/licationLoadBalancer.ts index 62d5083138..d3c7399226 100644 --- a/sdk/nodejs/appconfiguration/licationLoadBalancer.ts +++ b/sdk/nodejs/appconfiguration/licationLoadBalancer.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages an Application Gateway for Containers (ALB). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLicationLoadBalancer = new azure.appconfiguration.LicationLoadBalancer("exampleLicationLoadBalancer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Application Gateway for Containers (ALB) can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/analyticsItem.ts b/sdk/nodejs/appinsights/analyticsItem.ts index be01202dcf..85091b865d 100644 --- a/sdk/nodejs/appinsights/analyticsItem.ts +++ b/sdk/nodejs/appinsights/analyticsItem.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages an Application Insights Analytics Item component. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleAnalyticsItem = new azure.appinsights.AnalyticsItem("exampleAnalyticsItem", { + * applicationInsightsId: exampleInsights.id, + * content: "requests //simple example query", + * scope: "shared", + * type: "query", + * }); + * ``` + * * ## Import * * Application Insights Analytics Items can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/apiKey.ts b/sdk/nodejs/appinsights/apiKey.ts index 18b6d3e18f..a08ca91263 100644 --- a/sdk/nodejs/appinsights/apiKey.ts +++ b/sdk/nodejs/appinsights/apiKey.ts @@ -7,6 +7,54 @@ import * as utilities from "../utilities"; /** * Manages an Application Insights API key. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const readTelemetry = new azure.appinsights.ApiKey("readTelemetry", { + * applicationInsightsId: exampleInsights.id, + * readPermissions: [ + * "aggregate", + * "api", + * "draft", + * "extendqueries", + * "search", + * ], + * }); + * const writeAnnotations = new azure.appinsights.ApiKey("writeAnnotations", { + * applicationInsightsId: exampleInsights.id, + * writePermissions: ["annotations"], + * }); + * const authenticateSdkControlChannelApiKey = new azure.appinsights.ApiKey("authenticateSdkControlChannelApiKey", { + * applicationInsightsId: exampleInsights.id, + * readPermissions: ["agentconfig"], + * }); + * const fullPermissions = new azure.appinsights.ApiKey("fullPermissions", { + * applicationInsightsId: exampleInsights.id, + * readPermissions: [ + * "agentconfig", + * "aggregate", + * "api", + * "draft", + * "extendqueries", + * "search", + * ], + * writePermissions: ["annotations"], + * }); + * export const readTelemetryApiKey = readTelemetry.apiKey; + * export const writeAnnotationsApiKey = writeAnnotations.apiKey; + * export const authenticateSdkControlChannel = authenticateSdkControlChannelApiKey.apiKey; + * export const fullPermissionsApiKey = fullPermissions.apiKey; + * ``` + * * ## Import * * Application Insights API keys can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/getInsights.ts b/sdk/nodejs/appinsights/getInsights.ts index 4455a342ba..65c0cea9f2 100644 --- a/sdk/nodejs/appinsights/getInsights.ts +++ b/sdk/nodejs/appinsights/getInsights.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Application Insights component. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appinsights.getInsights({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const applicationInsightsInstrumentationKey = example.then(example => example.instrumentationKey); + * ``` */ export function getInsights(args: GetInsightsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -75,6 +88,19 @@ export interface GetInsightsResult { } /** * Use this data source to access information about an existing Application Insights component. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appinsights.getInsights({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const applicationInsightsInstrumentationKey = example.then(example => example.instrumentationKey); + * ``` */ export function getInsightsOutput(args: GetInsightsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getInsights(a, opts)) diff --git a/sdk/nodejs/appinsights/insights.ts b/sdk/nodejs/appinsights/insights.ts index 15a23bba77..b209b8a98e 100644 --- a/sdk/nodejs/appinsights/insights.ts +++ b/sdk/nodejs/appinsights/insights.ts @@ -7,6 +7,44 @@ import * as utilities from "../utilities"; /** * Manages an Application Insights component. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * export const instrumentationKey = exampleInsights.instrumentationKey; + * export const appId = exampleInsights.appId; + * ``` + * ### Workspace Mode + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * workspaceId: exampleAnalyticsWorkspace.id, + * applicationType: "web", + * }); + * export const instrumentationKey = exampleInsights.instrumentationKey; + * export const appId = exampleInsights.appId; + * ``` + * * ## Import * * Application Insights instances can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/smartDetectionRule.ts b/sdk/nodejs/appinsights/smartDetectionRule.ts index 9f775e672a..8548cde7d1 100644 --- a/sdk/nodejs/appinsights/smartDetectionRule.ts +++ b/sdk/nodejs/appinsights/smartDetectionRule.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages an Application Insights Smart Detection Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleSmartDetectionRule = new azure.appinsights.SmartDetectionRule("exampleSmartDetectionRule", { + * applicationInsightsId: exampleInsights.id, + * enabled: false, + * }); + * ``` + * * ## Import * * Application Insights Smart Detection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/standardWebTest.ts b/sdk/nodejs/appinsights/standardWebTest.ts index 7b69595595..763426d08e 100644 --- a/sdk/nodejs/appinsights/standardWebTest.ts +++ b/sdk/nodejs/appinsights/standardWebTest.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages a Application Insights Standard WebTest. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleStandardWebTest = new azure.appinsights.StandardWebTest("exampleStandardWebTest", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * applicationInsightsId: exampleInsights.id, + * geoLocations: ["example"], + * request: { + * url: "http://www.example.com", + * }, + * }); + * ``` + * * ## Import * * Application Insights Standard WebTests can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/webTest.ts b/sdk/nodejs/appinsights/webTest.ts index 1925b43e15..bcfeb44b0e 100644 --- a/sdk/nodejs/appinsights/webTest.ts +++ b/sdk/nodejs/appinsights/webTest.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages an Application Insights WebTest. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleWebTest = new azure.appinsights.WebTest("exampleWebTest", { + * location: exampleInsights.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * kind: "ping", + * frequency: 300, + * timeout: 60, + * enabled: true, + * geoLocations: [ + * "us-tx-sn1-azr", + * "us-il-ch1-azr", + * ], + * configuration: ` + * + * + * + * + * `, + * }); + * export const webtestId = exampleWebTest.id; + * export const webtestsSyntheticId = exampleWebTest.syntheticMonitorId; + * ``` + * * ## Import * * Application Insights Web Tests can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/workbook.ts b/sdk/nodejs/appinsights/workbook.ts index 99325f630f..8ae476f87e 100644 --- a/sdk/nodejs/appinsights/workbook.ts +++ b/sdk/nodejs/appinsights/workbook.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages an Azure Workbook. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkbook = new azure.appinsights.Workbook("exampleWorkbook", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * displayName: "workbook1", + * dataJson: JSON.stringify({ + * version: "Notebook/1.0", + * items: [{ + * type: 1, + * content: { + * json: "Test2022", + * }, + * name: "text - 0", + * }], + * isLocked: false, + * fallbackResourceIds: ["Azure Monitor"], + * }), + * tags: { + * ENV: "Test", + * }, + * }); + * ``` + * * ## Import * * Workbooks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appinsights/workbookTemplate.ts b/sdk/nodejs/appinsights/workbookTemplate.ts index cda7763238..1d8441aae9 100644 --- a/sdk/nodejs/appinsights/workbookTemplate.ts +++ b/sdk/nodejs/appinsights/workbookTemplate.ts @@ -9,6 +9,72 @@ import * as utilities from "../utilities"; /** * Manages an Application Insights Workbook Template. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkbookTemplate = new azure.appinsights.WorkbookTemplate("exampleWorkbookTemplate", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * author: "test author", + * priority: 1, + * galleries: [{ + * category: "workbook", + * name: "test", + * order: 100, + * resourceType: "microsoft.insights/components", + * type: "tsg", + * }], + * templateData: JSON.stringify({ + * version: "Notebook/1.0", + * items: [{ + * type: 1, + * content: { + * json: `## New workbook + * --- + * + * Welcome to your new workbook.`, + * }, + * name: "text - 2", + * }], + * styleSettings: {}, + * $schema: "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + * }), + * localized: JSON.stringify({ + * ar: [{ + * galleries: [{ + * name: "test", + * category: "Failures", + * type: "tsg", + * resourceType: "microsoft.insights/components", + * order: 100, + * }], + * templateData: { + * version: "Notebook/1.0", + * items: [{ + * type: 1, + * content: { + * json: `## New workbook + * --- + * + * Welcome to your new workbook.`, + * }, + * name: "text - 2", + * }], + * styleSettings: {}, + * $schema: "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + * }, + * }], + * }), + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Application Insights Workbook Template can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/getSpringCloudApp.ts b/sdk/nodejs/appplatform/getSpringCloudApp.ts index 716ea1ed8b..d54d351cbf 100644 --- a/sdk/nodejs/appplatform/getSpringCloudApp.ts +++ b/sdk/nodejs/appplatform/getSpringCloudApp.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Spring Cloud Application. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appplatform.getSpringCloudApp({ + * name: azurerm_spring_cloud_app.example.name, + * resourceGroupName: azurerm_spring_cloud_app.example.resource_group_name, + * serviceName: azurerm_spring_cloud_app.example.service_name, + * }); + * export const springCloudAppId = example.then(example => example.id); + * ``` */ export function getSpringCloudApp(args: GetSpringCloudAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -79,6 +93,20 @@ export interface GetSpringCloudAppResult { } /** * Use this data source to access information about an existing Spring Cloud Application. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appplatform.getSpringCloudApp({ + * name: azurerm_spring_cloud_app.example.name, + * resourceGroupName: azurerm_spring_cloud_app.example.resource_group_name, + * serviceName: azurerm_spring_cloud_app.example.service_name, + * }); + * export const springCloudAppId = example.then(example => example.id); + * ``` */ export function getSpringCloudAppOutput(args: GetSpringCloudAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSpringCloudApp(a, opts)) diff --git a/sdk/nodejs/appplatform/getSpringCloudService.ts b/sdk/nodejs/appplatform/getSpringCloudService.ts index 7c8cc2dab3..1387a8aa99 100644 --- a/sdk/nodejs/appplatform/getSpringCloudService.ts +++ b/sdk/nodejs/appplatform/getSpringCloudService.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Spring Cloud Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appplatform.getSpringCloudService({ + * name: azurerm_spring_cloud_service.example.name, + * resourceGroupName: azurerm_spring_cloud_service.example.resource_group_name, + * }); + * export const springCloudServiceId = example.then(example => example.id); + * ``` */ export function getSpringCloudService(args: GetSpringCloudServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface GetSpringCloudServiceResult { } /** * Use this data source to access information about an existing Spring Cloud Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appplatform.getSpringCloudService({ + * name: azurerm_spring_cloud_service.example.name, + * resourceGroupName: azurerm_spring_cloud_service.example.resource_group_name, + * }); + * export const springCloudServiceId = example.then(example => example.id); + * ``` */ export function getSpringCloudServiceOutput(args: GetSpringCloudServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSpringCloudService(a, opts)) diff --git a/sdk/nodejs/appplatform/springCloudAccelerator.ts b/sdk/nodejs/appplatform/springCloudAccelerator.ts index b4715e757e..93fa6992eb 100644 --- a/sdk/nodejs/appplatform/springCloudAccelerator.ts +++ b/sdk/nodejs/appplatform/springCloudAccelerator.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; * * Manages a Spring Cloud Accelerator. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudAccelerator = new azure.appplatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", {springCloudServiceId: exampleSpringCloudService.id}); + * ``` + * * ## Import * * Spring Cloud Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudActiveDeployment.ts b/sdk/nodejs/appplatform/springCloudActiveDeployment.ts index d6a38e2ab5..e9bb2c7867 100644 --- a/sdk/nodejs/appplatform/springCloudActiveDeployment.ts +++ b/sdk/nodejs/appplatform/springCloudActiveDeployment.ts @@ -7,6 +7,43 @@ import * as utilities from "../utilities"; /** * Manages an Active Azure Spring Cloud Deployment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSpringCloudJavaDeployment = new azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", { + * springCloudAppId: exampleSpringCloudApp.id, + * instanceCount: 2, + * jvmOptions: "-XX:+PrintGC", + * runtimeVersion: "Java_11", + * quota: { + * cpu: "2", + * memory: "4Gi", + * }, + * environmentVariables: { + * Env: "Staging", + * }, + * }); + * const exampleSpringCloudActiveDeployment = new azure.appplatform.SpringCloudActiveDeployment("exampleSpringCloudActiveDeployment", { + * springCloudAppId: exampleSpringCloudApp.id, + * deploymentName: exampleSpringCloudJavaDeployment.name, + * }); + * ``` + * * ## Import * * Spring Cloud Active Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudApiPortal.ts b/sdk/nodejs/appplatform/springCloudApiPortal.ts index 460c1fed0b..fcf8defb6a 100644 --- a/sdk/nodejs/appplatform/springCloudApiPortal.ts +++ b/sdk/nodejs/appplatform/springCloudApiPortal.ts @@ -11,6 +11,34 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudGateway = new azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", {springCloudServiceId: exampleSpringCloudService.id}); + * const exampleSpringCloudApiPortal = new azure.appplatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", { + * springCloudServiceId: exampleSpringCloudService.id, + * gatewayIds: [exampleSpringCloudGateway.id], + * httpsOnlyEnabled: false, + * publicNetworkAccessEnabled: true, + * instanceCount: 1, + * sso: { + * clientId: "test", + * clientSecret: "secret", + * issuerUri: "https://www.example.com/issueToken", + * scopes: ["read"], + * }, + * }); + * ``` + * * ## Import * * Spring Cloud API Portals can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudApiPortalCustomDomain.ts b/sdk/nodejs/appplatform/springCloudApiPortalCustomDomain.ts index f62bdc77a2..4c9960d5e6 100644 --- a/sdk/nodejs/appplatform/springCloudApiPortalCustomDomain.ts +++ b/sdk/nodejs/appplatform/springCloudApiPortalCustomDomain.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudGateway = new azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", {springCloudServiceId: exampleSpringCloudService.id}); + * const exampleSpringCloudApiPortal = new azure.appplatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", { + * springCloudServiceId: exampleSpringCloudService.id, + * gatewayIds: [exampleSpringCloudGateway.id], + * }); + * const exampleSpringCloudApiPortalCustomDomain = new azure.appplatform.SpringCloudApiPortalCustomDomain("exampleSpringCloudApiPortalCustomDomain", {springCloudApiPortalId: exampleSpringCloudApiPortal.id}); + * ``` + * * ## Import * * Spring Cloud API Portal Domains can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudApp.ts b/sdk/nodejs/appplatform/springCloudApp.ts index 7bed249e41..36364720b6 100644 --- a/sdk/nodejs/appplatform/springCloudApp.ts +++ b/sdk/nodejs/appplatform/springCloudApp.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; /** * Manage an Azure Spring Cloud Application. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` + * * ## Import * * Spring Cloud Application can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudAppCosmosDBAssociation.ts b/sdk/nodejs/appplatform/springCloudAppCosmosDBAssociation.ts index 1cb076e18c..4eec4b35af 100644 --- a/sdk/nodejs/appplatform/springCloudAppCosmosDBAssociation.ts +++ b/sdk/nodejs/appplatform/springCloudAppCosmosDBAssociation.ts @@ -7,6 +7,42 @@ import * as utilities from "../utilities"; /** * Associates a Spring Cloud Application with a CosmosDB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * }); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSpringCloudAppCosmosDBAssociation = new azure.appplatform.SpringCloudAppCosmosDBAssociation("exampleSpringCloudAppCosmosDBAssociation", { + * springCloudAppId: exampleSpringCloudApp.id, + * cosmosdbAccountId: exampleAccount.id, + * apiType: "table", + * cosmosdbAccessKey: exampleAccount.primaryKey, + * }); + * ``` + * * ## Import * * Spring Cloud Application CosmosDB Association can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudAppMysqlAssociation.ts b/sdk/nodejs/appplatform/springCloudAppMysqlAssociation.ts index 8d107f7d5e..c1c48fba31 100644 --- a/sdk/nodejs/appplatform/springCloudAppMysqlAssociation.ts +++ b/sdk/nodejs/appplatform/springCloudAppMysqlAssociation.ts @@ -7,6 +7,47 @@ import * as utilities from "../utilities"; /** * Associates a Spring Cloud Application with a MySQL Database. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * }); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mysqladminun", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "B_Gen5_2", + * storageMb: 5120, + * version: "5.7", + * sslEnforcementEnabled: true, + * sslMinimalTlsVersionEnforced: "TLS1_2", + * }); + * const exampleDatabase = new azure.mysql.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * charset: "utf8", + * collation: "utf8_unicode_ci", + * }); + * const exampleSpringCloudAppMysqlAssociation = new azure.appplatform.SpringCloudAppMysqlAssociation("exampleSpringCloudAppMysqlAssociation", { + * springCloudAppId: exampleSpringCloudApp.id, + * mysqlServerId: exampleServer.id, + * databaseName: exampleDatabase.name, + * username: exampleServer.administratorLogin, + * password: exampleServer.administratorLoginPassword, + * }); + * ``` + * * ## Import * * Spring Cloud Application MySQL Association can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudAppRedisAssociation.ts b/sdk/nodejs/appplatform/springCloudAppRedisAssociation.ts index b262437404..dfbf0787ab 100644 --- a/sdk/nodejs/appplatform/springCloudAppRedisAssociation.ts +++ b/sdk/nodejs/appplatform/springCloudAppRedisAssociation.ts @@ -7,6 +7,37 @@ import * as utilities from "../utilities"; /** * Associates a Spring Cloud Application with a Redis Cache. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * }); + * const exampleCache = new azure.redis.Cache("exampleCache", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * capacity: 0, + * family: "C", + * skuName: "Basic", + * enableNonSslPort: true, + * }); + * const exampleSpringCloudAppRedisAssociation = new azure.appplatform.SpringCloudAppRedisAssociation("exampleSpringCloudAppRedisAssociation", { + * springCloudAppId: exampleSpringCloudApp.id, + * redisCacheId: exampleCache.id, + * redisAccessKey: exampleCache.primaryAccessKey, + * sslEnabled: true, + * }); + * ``` + * * ## Import * * Spring Cloud Application Redis Association can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.ts b/sdk/nodejs/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.ts index bfc90911c2..17d7ae4dfe 100644 --- a/sdk/nodejs/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.ts +++ b/sdk/nodejs/appplatform/springCloudApplicationInsightsApplicationPerformanceMonitoring.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; * * Manages a Spring Cloud Application Performance Monitoring resource for Application Insights. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudApplicationInsightsApplicationPerformanceMonitoring = new azure.appplatform.SpringCloudApplicationInsightsApplicationPerformanceMonitoring("exampleSpringCloudApplicationInsightsApplicationPerformanceMonitoring", { + * springCloudServiceId: exampleSpringCloudService.id, + * connectionString: exampleInsights.instrumentationKey, + * globallyEnabled: true, + * roleName: "test-role", + * roleInstance: "test-instance", + * samplingPercentage: 50, + * samplingRequestsPerSecond: 10, + * }); + * ``` + * * ## Import * * Spring Cloud Application Performance Monitoring resource for Application Insights can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudApplicationLiveView.ts b/sdk/nodejs/appplatform/springCloudApplicationLiveView.ts index 8eb72788d1..1300b096b3 100644 --- a/sdk/nodejs/appplatform/springCloudApplicationLiveView.ts +++ b/sdk/nodejs/appplatform/springCloudApplicationLiveView.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; * * Manages a Spring Cloud Application Live View. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudApplicationLiveView = new azure.appplatform.SpringCloudApplicationLiveView("exampleSpringCloudApplicationLiveView", {springCloudServiceId: exampleSpringCloudService.id}); + * ``` + * * ## Import * * Spring Cloud Application Live Views can be imported using the `resource id`, e.g. g diff --git a/sdk/nodejs/appplatform/springCloudBuildDeployment.ts b/sdk/nodejs/appplatform/springCloudBuildDeployment.ts index 58e2fdc0dc..431383516e 100644 --- a/sdk/nodejs/appplatform/springCloudBuildDeployment.ts +++ b/sdk/nodejs/appplatform/springCloudBuildDeployment.ts @@ -11,6 +11,37 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleSpringCloudService.resourceGroupName, + * serviceName: exampleSpringCloudService.name, + * }); + * const exampleSpringCloudBuildDeployment = new azure.appplatform.SpringCloudBuildDeployment("exampleSpringCloudBuildDeployment", { + * springCloudAppId: exampleSpringCloudApp.id, + * buildResultId: "", + * instanceCount: 2, + * environmentVariables: { + * Foo: "Bar", + * Env: "Staging", + * }, + * quota: { + * cpu: "2", + * memory: "4Gi", + * }, + * }); + * ``` + * * ## Import * * Spring Cloud Build Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudBuildPackBinding.ts b/sdk/nodejs/appplatform/springCloudBuildPackBinding.ts index f52368ef6d..1924a31611 100644 --- a/sdk/nodejs/appplatform/springCloudBuildPackBinding.ts +++ b/sdk/nodejs/appplatform/springCloudBuildPackBinding.ts @@ -11,6 +11,45 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "E0", + * }); + * const exampleSpringCloudBuilder = new azure.appplatform.SpringCloudBuilder("exampleSpringCloudBuilder", { + * springCloudServiceId: exampleSpringCloudService.id, + * buildPackGroups: [{ + * name: "mix", + * buildPackIds: ["tanzu-Build Packs/java-azure"], + * }], + * stack: { + * id: "io.Build Packs.stacks.bionic", + * version: "base", + * }, + * }); + * const exampleSpringCloudBuildPackBinding = new azure.appplatform.SpringCloudBuildPackBinding("exampleSpringCloudBuildPackBinding", { + * springCloudBuilderId: exampleSpringCloudBuilder.id, + * bindingType: "ApplicationInsights", + * launch: { + * properties: { + * abc: "def", + * "any-string": "any-string", + * "sampling-rate": "12.0", + * }, + * secrets: { + * "connection-string": "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX", + * }, + * }, + * }); + * ``` + * * ## Import * * Spring Cloud Build Pack Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudBuilder.ts b/sdk/nodejs/appplatform/springCloudBuilder.ts index 7809914db5..9b3fb56939 100644 --- a/sdk/nodejs/appplatform/springCloudBuilder.ts +++ b/sdk/nodejs/appplatform/springCloudBuilder.ts @@ -11,6 +11,31 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "E0", + * }); + * const exampleSpringCloudBuilder = new azure.appplatform.SpringCloudBuilder("exampleSpringCloudBuilder", { + * springCloudServiceId: exampleSpringCloudService.id, + * buildPackGroups: [{ + * name: "mix", + * buildPackIds: ["tanzu-buildpacks/java-azure"], + * }], + * stack: { + * id: "io.buildpacks.stacks.bionic", + * version: "base", + * }, + * }); + * ``` + * * ## Import * * Spring Cloud Builders can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudCertificate.ts b/sdk/nodejs/appplatform/springCloudCertificate.ts index 1f6d0370ba..07636b92b2 100644 --- a/sdk/nodejs/appplatform/springCloudCertificate.ts +++ b/sdk/nodejs/appplatform/springCloudCertificate.ts @@ -7,6 +7,98 @@ import * as utilities from "../utilities"; /** * Manages an Azure Spring Cloud Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getClientConfig({}); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "Azure Spring Cloud Resource Provider", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * secretPermissions: ["Set"], + * certificatePermissions: [ + * "Create", + * "Delete", + * "Get", + * "Update", + * ], + * }, + * { + * tenantId: current.then(current => current.tenantId), + * objectId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId), + * secretPermissions: [ + * "Get", + * "List", + * ], + * certificatePermissions: [ + * "Get", + * "List", + * ], + * }, + * ], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificatePolicy: { + * issuerParameters: { + * name: "Self", + * }, + * keyProperties: { + * exportable: true, + * keySize: 2048, + * keyType: "RSA", + * reuseKey: true, + * }, + * lifetimeActions: [{ + * action: { + * actionType: "AutoRenew", + * }, + * trigger: { + * daysBeforeExpiry: 30, + * }, + * }], + * secretProperties: { + * contentType: "application/x-pkcs12", + * }, + * x509CertificateProperties: { + * keyUsages: [ + * "cRLSign", + * "dataEncipherment", + * "digitalSignature", + * "keyAgreement", + * "keyCertSign", + * "keyEncipherment", + * ], + * subject: "CN=contoso.com", + * validityInMonths: 12, + * }, + * }, + * }); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudCertificate = new azure.appplatform.SpringCloudCertificate("exampleSpringCloudCertificate", { + * resourceGroupName: exampleSpringCloudService.resourceGroupName, + * serviceName: exampleSpringCloudService.name, + * keyVaultCertificateId: exampleCertificate.id, + * excludePrivateKey: true, + * }); + * ``` + * * ## Import * * Spring Cloud Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudConfigurationService.ts b/sdk/nodejs/appplatform/springCloudConfigurationService.ts index 344318e11f..b5aa30983f 100644 --- a/sdk/nodejs/appplatform/springCloudConfigurationService.ts +++ b/sdk/nodejs/appplatform/springCloudConfigurationService.ts @@ -11,6 +11,36 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudConfigurationService = new azure.appplatform.SpringCloudConfigurationService("exampleSpringCloudConfigurationService", { + * springCloudServiceId: exampleSpringCloudService.id, + * repositories: [{ + * name: "fake", + * label: "master", + * patterns: ["app/dev"], + * uri: "https://github.com/Azure-Samples/piggymetrics", + * searchPaths: [ + * "dir1", + * "dir2", + * ], + * strictHostKeyChecking: false, + * username: "adminuser", + * password: "H@Sh1CoR3!", + * }], + * }); + * ``` + * * ## Import * * Spring Cloud Configuration Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudConnection.ts b/sdk/nodejs/appplatform/springCloudConnection.ts index 25785087b6..cac37c4cd1 100644 --- a/sdk/nodejs/appplatform/springCloudConnection.ts +++ b/sdk/nodejs/appplatform/springCloudConnection.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; /** * Manages a service connector for spring cloud app. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "BoundedStaleness", + * maxIntervalInSeconds: 10, + * maxStalenessPrefix: 200, + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * throughput: 400, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/definition", + * }); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSpringCloudJavaDeployment = new azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", {springCloudAppId: exampleSpringCloudApp.id}); + * const exampleSpringCloudConnection = new azure.appplatform.SpringCloudConnection("exampleSpringCloudConnection", { + * springCloudId: exampleSpringCloudJavaDeployment.id, + * targetResourceId: exampleSqlDatabase.id, + * authentication: { + * type: "systemAssignedIdentity", + * }, + * }); + * ``` + * * ## Import * * Service Connector for spring cloud can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudContainerDeployment.ts b/sdk/nodejs/appplatform/springCloudContainerDeployment.ts index 5a45ddec8c..63e0bb56ea 100644 --- a/sdk/nodejs/appplatform/springCloudContainerDeployment.ts +++ b/sdk/nodejs/appplatform/springCloudContainerDeployment.ts @@ -9,6 +9,41 @@ import * as utilities from "../utilities"; /** * Manages a Spring Cloud Container Deployment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleSpringCloudService.resourceGroupName, + * serviceName: exampleSpringCloudService.name, + * }); + * const exampleSpringCloudContainerDeployment = new azure.appplatform.SpringCloudContainerDeployment("exampleSpringCloudContainerDeployment", { + * springCloudAppId: exampleSpringCloudApp.id, + * instanceCount: 2, + * arguments: [ + * "-cp", + * "/app/resources:/app/classes:/app/libs/*", + * "hello.Application", + * ], + * commands: ["java"], + * environmentVariables: { + * Foo: "Bar", + * Env: "Staging", + * }, + * server: "docker.io", + * image: "springio/gs-spring-boot-docker", + * languageFramework: "springboot", + * }); + * ``` + * * ## Import * * Spring Cloud Container Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudCustomizedAccelerator.ts b/sdk/nodejs/appplatform/springCloudCustomizedAccelerator.ts index ab03e60336..1cc9ce9c4b 100644 --- a/sdk/nodejs/appplatform/springCloudCustomizedAccelerator.ts +++ b/sdk/nodejs/appplatform/springCloudCustomizedAccelerator.ts @@ -9,6 +9,36 @@ import * as utilities from "../utilities"; /** * Manages a Spring Cloud Customized Accelerator. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudAccelerator = new azure.appplatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", {springCloudServiceId: exampleSpringCloudService.id}); + * const exampleSpringCloudCustomizedAccelerator = new azure.appplatform.SpringCloudCustomizedAccelerator("exampleSpringCloudCustomizedAccelerator", { + * springCloudAcceleratorId: exampleSpringCloudAccelerator.id, + * gitRepository: { + * url: "https://github.com/Azure-Samples/piggymetrics", + * gitTag: "spring.version.2.0.3", + * intervalInSeconds: 100, + * }, + * acceleratorTags: [ + * "tag-a", + * "tag-b", + * ], + * description: "example description", + * displayName: "example name", + * iconUrl: "https://images.freecreatives.com/wp-content/uploads/2015/05/smiley-559124_640.jpg", + * }); + * ``` + * * ## Import * * Spring Cloud Customized Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudDevToolPortal.ts b/sdk/nodejs/appplatform/springCloudDevToolPortal.ts index 436a9ac6ce..77dfa4b655 100644 --- a/sdk/nodejs/appplatform/springCloudDevToolPortal.ts +++ b/sdk/nodejs/appplatform/springCloudDevToolPortal.ts @@ -11,6 +11,37 @@ import * as utilities from "../utilities"; * * Manages a Spring Cloud Dev Tool Portal. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudDevToolPortal = new azure.appplatform.SpringCloudDevToolPortal("exampleSpringCloudDevToolPortal", { + * springCloudServiceId: exampleSpringCloudService.id, + * publicNetworkAccessEnabled: true, + * sso: { + * clientId: "example id", + * clientSecret: "example secret", + * metadataUrl: current.then(current => `https://login.microsoftonline.com/${current.tenantId}/v2.0/.well-known/openid-configuration`), + * scopes: [ + * "openid", + * "profile", + * "email", + * ], + * }, + * applicationAcceleratorEnabled: true, + * applicationLiveViewEnabled: true, + * }); + * ``` + * * ## Import * * Spring Cloud Dev Tool Portals can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudGateway.ts b/sdk/nodejs/appplatform/springCloudGateway.ts index 0f4980fe5b..619fa94574 100644 --- a/sdk/nodejs/appplatform/springCloudGateway.ts +++ b/sdk/nodejs/appplatform/springCloudGateway.ts @@ -11,6 +11,51 @@ import * as utilities from "../utilities"; * * Manages a Spring Cloud Gateway. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudGateway = new azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", { + * springCloudServiceId: exampleSpringCloudService.id, + * httpsOnly: false, + * publicNetworkAccessEnabled: true, + * instanceCount: 2, + * apiMetadata: { + * description: "example description", + * documentationUrl: "https://www.example.com/docs", + * serverUrl: "https://wwww.example.com", + * title: "example title", + * version: "1.0", + * }, + * cors: { + * credentialsAllowed: false, + * allowedHeaders: ["*"], + * allowedMethods: ["PUT"], + * allowedOrigins: ["example.com"], + * exposedHeaders: ["x-example-header"], + * maxAgeSeconds: 86400, + * }, + * quota: { + * cpu: "1", + * memory: "2Gi", + * }, + * sso: { + * clientId: "example id", + * clientSecret: "example secret", + * issuerUri: "https://www.test.com/issueToken", + * scopes: ["read"], + * }, + * }); + * ``` + * * ## Import * * Spring Cloud Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudGatewayCustomDomain.ts b/sdk/nodejs/appplatform/springCloudGatewayCustomDomain.ts index 3324caa703..0ec8c4454f 100644 --- a/sdk/nodejs/appplatform/springCloudGatewayCustomDomain.ts +++ b/sdk/nodejs/appplatform/springCloudGatewayCustomDomain.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudGateway = new azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", {springCloudServiceId: exampleSpringCloudService.id}); + * const exampleSpringCloudGatewayCustomDomain = new azure.appplatform.SpringCloudGatewayCustomDomain("exampleSpringCloudGatewayCustomDomain", {springCloudGatewayId: exampleSpringCloudGateway.id}); + * ``` + * * ## Import * * Spring Cloud Gateway Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudGatewayRouteConfig.ts b/sdk/nodejs/appplatform/springCloudGatewayRouteConfig.ts index d4831d9dc4..4894c6f529 100644 --- a/sdk/nodejs/appplatform/springCloudGatewayRouteConfig.ts +++ b/sdk/nodejs/appplatform/springCloudGatewayRouteConfig.ts @@ -11,6 +11,47 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "E0", + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * }); + * const exampleSpringCloudGateway = new azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", {springCloudServiceId: exampleSpringCloudService.id}); + * const exampleSpringCloudGatewayRouteConfig = new azure.appplatform.SpringCloudGatewayRouteConfig("exampleSpringCloudGatewayRouteConfig", { + * springCloudGatewayId: exampleSpringCloudGateway.id, + * springCloudAppId: exampleSpringCloudApp.id, + * protocol: "HTTPS", + * routes: [{ + * description: "example description", + * filters: [ + * "StripPrefix=2", + * "RateLimit=1,1s", + * ], + * order: 1, + * predicates: ["Path=/api5/customer/**"], + * ssoValidationEnabled: true, + * title: "myApp route config", + * tokenRelay: true, + * uri: "https://www.example.com", + * classificationTags: [ + * "tag1", + * "tag2", + * ], + * }], + * }); + * ``` + * * ## Import * * Spring Cloud Gateway Route Configs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudJavaDeployment.ts b/sdk/nodejs/appplatform/springCloudJavaDeployment.ts index 685988f37f..46f3cb74c4 100644 --- a/sdk/nodejs/appplatform/springCloudJavaDeployment.ts +++ b/sdk/nodejs/appplatform/springCloudJavaDeployment.ts @@ -11,6 +11,40 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is applicable only for Spring Cloud Service with basic and standard tier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("exampleSpringCloudApp", { + * resourceGroupName: exampleResourceGroup.name, + * serviceName: exampleSpringCloudService.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSpringCloudJavaDeployment = new azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", { + * springCloudAppId: exampleSpringCloudApp.id, + * instanceCount: 2, + * jvmOptions: "-XX:+PrintGC", + * quota: { + * cpu: "2", + * memory: "4Gi", + * }, + * runtimeVersion: "Java_11", + * environmentVariables: { + * Foo: "Bar", + * Env: "Staging", + * }, + * }); + * ``` + * * ## Import * * Spring Cloud Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudService.ts b/sdk/nodejs/appplatform/springCloudService.ts index ac29399241..60f64578b1 100644 --- a/sdk/nodejs/appplatform/springCloudService.ts +++ b/sdk/nodejs/appplatform/springCloudService.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; /** * Manages an Azure Spring Cloud Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "S0", + * configServerGitSetting: { + * uri: "https://github.com/Azure-Samples/piggymetrics", + * label: "config", + * searchPaths: [ + * "dir1", + * "dir2", + * ], + * }, + * trace: { + * connectionString: exampleInsights.connectionString, + * sampleRate: 10, + * }, + * tags: { + * Env: "staging", + * }, + * }); + * ``` + * * ## Import * * Spring Cloud services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appplatform/springCloudStorage.ts b/sdk/nodejs/appplatform/springCloudStorage.ts index 176e5fd0cd..b4bca64021 100644 --- a/sdk/nodejs/appplatform/springCloudStorage.ts +++ b/sdk/nodejs/appplatform/springCloudStorage.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a Spring Cloud Storage. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("exampleSpringCloudService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSpringCloudStorage = new azure.appplatform.SpringCloudStorage("exampleSpringCloudStorage", { + * springCloudServiceId: exampleSpringCloudService.id, + * storageAccountName: exampleAccount.name, + * storageAccountKey: exampleAccount.primaryAccessKey, + * }); + * ``` + * * ## Import * * Spring Cloud Storages can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/activeSlot.ts b/sdk/nodejs/appservice/activeSlot.ts index da012a84a2..5e00565a7c 100644 --- a/sdk/nodejs/appservice/activeSlot.ts +++ b/sdk/nodejs/appservice/activeSlot.ts @@ -10,6 +10,30 @@ import * as utilities from "../utilities"; * !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.WebAppActiveSlot` resource instead. * * > **Note:** When using Slots - the `appSettings`, `connectionString` and `siteConfig` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const server = new random.RandomId("server", {}); + * // ... + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {}); + * // ... + * const examplePlan = new azure.appservice.Plan("examplePlan", {}); + * // ... + * const exampleAppService = new azure.appservice.AppService("exampleAppService", {}); + * // ... + * const exampleSlot = new azure.appservice.Slot("exampleSlot", {}); + * // ... + * const exampleActiveSlot = new azure.appservice.ActiveSlot("exampleActiveSlot", { + * resourceGroupName: exampleResourceGroup.name, + * appServiceName: exampleAppService.name, + * appServiceSlotName: exampleSlot.name, + * }); + * ``` */ export class ActiveSlot extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/appservice/appConnection.ts b/sdk/nodejs/appservice/appConnection.ts index 4cca5bab7e..6fb40286a0 100644 --- a/sdk/nodejs/appservice/appConnection.ts +++ b/sdk/nodejs/appservice/appConnection.ts @@ -9,6 +9,67 @@ import * as utilities from "../utilities"; /** * Manages a service connector for function app. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "BoundedStaleness", + * maxIntervalInSeconds: 10, + * maxStalenessPrefix: 200, + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * throughput: 400, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/definition", + * }); + * const exampleStorage_accountAccount = new azure.storage.Account("exampleStorage/accountAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "P1v2", + * osType: "Linux", + * }); + * const test = new azure.appservice.FunctionApp("test", { + * location: azurerm_resource_group.test.location, + * resourceGroupName: azurerm_resource_group.test.name, + * appServicePlanId: azurerm_app_service_plan.test.id, + * storageAccountName: azurerm_storage_account.test.name, + * storageAccountAccessKey: azurerm_storage_account.test.primary_access_key, + * }); + * const exampleAppConnection = new azure.appservice.AppConnection("exampleAppConnection", { + * functionAppId: azurerm_function_app.example.id, + * targetResourceId: azurerm_cosmosdb_account.test.id, + * authentication: { + * type: "systemAssignedIdentity", + * }, + * }); + * ``` + * * ## Import * * Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/appService.ts b/sdk/nodejs/appservice/appService.ts index 4ab83ace49..1a4fdeb191 100644 --- a/sdk/nodejs/appservice/appService.ts +++ b/sdk/nodejs/appservice/appService.ts @@ -13,6 +13,42 @@ import * as utilities from "../utilities"; * * > **Note:** When using Slots - the `appSettings`, `connectionString` and `siteConfig` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource. * + * ## Example Usage + * + * This example provisions a Windows App Service. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * siteConfig: { + * dotnetFrameworkVersion: "v4.0", + * scmType: "LocalGit", + * }, + * appSettings: { + * SOME_KEY: "some-value", + * }, + * connectionStrings: [{ + * name: "Database", + * type: "SQLServer", + * value: "Server=some-server.mydomain.com;Integrated Security=SSPI", + * }], + * }); + * ``` + * * ## Import * * App Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/certificate.ts b/sdk/nodejs/appservice/certificate.ts index e992d4f9d7..9f65621b73 100644 --- a/sdk/nodejs/appservice/certificate.ts +++ b/sdk/nodejs/appservice/certificate.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages an App Service certificate. * + * ## Example Usage + * + * This example provisions an App Service Certificate from a Local File. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCertificate = new azure.appservice.Certificate("exampleCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * pfxBlob: Buffer.from(fs.readFileSync("certificate.pfx"), 'binary').toString('base64'), + * password: "password123!", + * }); + * ``` + * * ## Import * * App Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/certificateOrder.ts b/sdk/nodejs/appservice/certificateOrder.ts index db74905284..7d7d1424ff 100644 --- a/sdk/nodejs/appservice/certificateOrder.ts +++ b/sdk/nodejs/appservice/certificateOrder.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; /** * Manages an App Service Certificate Order. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCertificateOrder = new azure.appservice.CertificateOrder("exampleCertificateOrder", { + * resourceGroupName: exampleResourceGroup.name, + * location: "global", + * distinguishedName: "CN=example.com", + * productType: "Standard", + * }); + * ``` + * * ## Import * * App Service Certificate Orders can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/connection.ts b/sdk/nodejs/appservice/connection.ts index 0ba7498a12..3c51b7be1e 100644 --- a/sdk/nodejs/appservice/connection.ts +++ b/sdk/nodejs/appservice/connection.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; /** * Manages a service connector for app service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "BoundedStaleness", + * maxIntervalInSeconds: 10, + * maxStalenessPrefix: 200, + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * throughput: 400, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/definition", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "P1v2", + * osType: "Linux", + * }); + * const exampleLinuxWebApp = new azure.appservice.LinuxWebApp("exampleLinuxWebApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleConnection = new azure.appservice.Connection("exampleConnection", { + * appServiceId: exampleLinuxWebApp.id, + * targetResourceId: exampleSqlDatabase.id, + * authentication: { + * type: "systemAssignedIdentity", + * }, + * }); + * ``` + * * ## Import * * Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/customHostnameBinding.ts b/sdk/nodejs/appservice/customHostnameBinding.ts index c5115a09be..c88a0672cf 100644 --- a/sdk/nodejs/appservice/customHostnameBinding.ts +++ b/sdk/nodejs/appservice/customHostnameBinding.ts @@ -7,6 +7,40 @@ import * as utilities from "../utilities"; /** * Manages a Hostname Binding within an App Service (or Function App). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const server = new random.RandomId("server", { + * keepers: { + * azi_id: 1, + * }, + * byteLength: 8, + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * }); + * const exampleCustomHostnameBinding = new azure.appservice.CustomHostnameBinding("exampleCustomHostnameBinding", { + * hostname: "www.mywebsite.com", + * appServiceName: exampleAppService.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/environment.ts b/sdk/nodejs/appservice/environment.ts index f3a28ef42a..23f3caf3d0 100644 --- a/sdk/nodejs/appservice/environment.ts +++ b/sdk/nodejs/appservice/environment.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages an App Service Environment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const ase = new azure.network.Subnet("ase", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const gateway = new azure.network.Subnet("gateway", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleEnvironment = new azure.appservice.Environment("exampleEnvironment", { + * resourceGroupName: exampleResourceGroup.name, + * subnetId: ase.id, + * pricingTier: "I2", + * frontEndScaleFactor: 10, + * internalLoadBalancingMode: "Web, Publishing", + * allowedUserIpCidrs: [ + * "11.22.33.44/32", + * "55.66.77.0/24", + * ], + * clusterSettings: [{ + * name: "DisableTls1.0", + * value: "1", + * }], + * }); + * ``` + * * ## Import * * The App Service Environment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/functionApp.ts b/sdk/nodejs/appservice/functionApp.ts index a7be4001b6..cd46ea116d 100644 --- a/sdk/nodejs/appservice/functionApp.ts +++ b/sdk/nodejs/appservice/functionApp.ts @@ -15,6 +15,100 @@ import * as utilities from "../utilities"; * For an example, check the `azure.appservice.VirtualNetworkSwiftConnection` documentation. * * ## Example Usage + * ### With App Service Plan) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleFunctionApp = new azure.appservice.FunctionApp("exampleFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * ``` + * ### In A Consumption Plan) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "FunctionApp", + * sku: { + * tier: "Dynamic", + * size: "Y1", + * }, + * }); + * const exampleFunctionApp = new azure.appservice.FunctionApp("exampleFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * ``` + * ### Linux) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "Linux", + * reserved: true, + * sku: { + * tier: "Dynamic", + * size: "Y1", + * }, + * }); + * const exampleFunctionApp = new azure.appservice.FunctionApp("exampleFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * osType: "linux", + * version: "~3", + * }); + * ``` + * + * > **Note:** Version `~3` or `~4` is required for Linux Function Apps. * * ## Import * diff --git a/sdk/nodejs/appservice/functionAppActiveSlot.ts b/sdk/nodejs/appservice/functionAppActiveSlot.ts index 47e0e4c9ab..ae9df318ff 100644 --- a/sdk/nodejs/appservice/functionAppActiveSlot.ts +++ b/sdk/nodejs/appservice/functionAppActiveSlot.ts @@ -8,6 +8,72 @@ import * as utilities from "../utilities"; * Manages a Function App Active Slot. * * ## Example Usage + * ### Windows Function App + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Windows", + * skuName: "Y1", + * }); + * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageAccountName: exampleAccount.name, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleWindowsFunctionAppSlot = new azure.appservice.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", { + * functionAppId: exampleWindowsFunctionApp.id, + * storageAccountName: exampleAccount.name, + * siteConfig: {}, + * }); + * const exampleFunctionAppActiveSlot = new azure.appservice.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", {slotId: exampleWindowsFunctionAppSlot.id}); + * ``` + * ### Linux Function App + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "Y1", + * }); + * const exampleLinuxFunctionApp = new azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * servicePlanId: exampleServicePlan.id, + * storageAccountName: exampleAccount.name, + * siteConfig: {}, + * }); + * const exampleLinuxFunctionAppSlot = new azure.appservice.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", { + * functionAppId: exampleLinuxFunctionApp.name, + * storageAccountName: exampleAccount.name, + * siteConfig: {}, + * }); + * const exampleFunctionAppActiveSlot = new azure.appservice.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", {slotId: exampleLinuxFunctionAppSlot.id}); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/functionAppFunction.ts b/sdk/nodejs/appservice/functionAppFunction.ts index 1231b61345..1b38aabb57 100644 --- a/sdk/nodejs/appservice/functionAppFunction.ts +++ b/sdk/nodejs/appservice/functionAppFunction.ts @@ -10,6 +10,127 @@ import * as utilities from "../utilities"; * Manages a Function App Function. * * ## Example Usage + * ### Basic HTTP Trigger + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * osType: "Linux", + * skuName: "S1", + * }); + * const exampleLinuxFunctionApp = new azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * servicePlanId: exampleServicePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * siteConfig: { + * applicationStack: { + * pythonVersion: "3.9", + * }, + * }, + * }); + * const exampleFunctionAppFunction = new azure.appservice.FunctionAppFunction("exampleFunctionAppFunction", { + * functionAppId: exampleLinuxFunctionApp.id, + * language: "Python", + * testData: JSON.stringify({ + * name: "Azure", + * }), + * configJson: JSON.stringify({ + * bindings: [ + * { + * authLevel: "function", + * direction: "in", + * methods: [ + * "get", + * "post", + * ], + * name: "req", + * type: "httpTrigger", + * }, + * { + * direction: "out", + * name: "$return", + * type: "http", + * }, + * ], + * }), + * }); + * ``` + * ### HTTP Trigger With Code Upload + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * osType: "Windows", + * skuName: "S1", + * }); + * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * servicePlanId: exampleServicePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * siteConfig: { + * applicationStack: { + * dotnetVersion: "6", + * }, + * }, + * }); + * const exampleFunctionAppFunction = new azure.appservice.FunctionAppFunction("exampleFunctionAppFunction", { + * functionAppId: exampleWindowsFunctionApp.id, + * language: "CSharp", + * files: [{ + * name: "run.csx", + * content: fs.readFileSync("exampledata/run.csx"), + * }], + * testData: JSON.stringify({ + * name: "Azure", + * }), + * configJson: JSON.stringify({ + * bindings: [ + * { + * authLevel: "function", + * direction: "in", + * methods: [ + * "get", + * "post", + * ], + * name: "req", + * type: "httpTrigger", + * }, + * { + * direction: "out", + * name: "$return", + * type: "http", + * }, + * ], + * }), + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/functionAppHybridConnection.ts b/sdk/nodejs/appservice/functionAppHybridConnection.ts index a6d20ad696..957bca8ce2 100644 --- a/sdk/nodejs/appservice/functionAppHybridConnection.ts +++ b/sdk/nodejs/appservice/functionAppHybridConnection.ts @@ -7,6 +7,56 @@ import * as utilities from "../utilities"; /** * Manages a Function App Hybrid Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * osType: "Windows", + * skuName: "S1", + * }); + * const exampleNamespace = new azure.relay.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleHybridConnection = new azure.relay.HybridConnection("exampleHybridConnection", { + * resourceGroupName: exampleResourceGroup.name, + * relayNamespaceName: exampleNamespace.name, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleWindowsWebApp = new azure.appservice.WindowsWebApp("exampleWindowsWebApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * servicePlanId: exampleServicePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * siteConfig: {}, + * }); + * const exampleFunctionAppHybridConnection = new azure.appservice.FunctionAppHybridConnection("exampleFunctionAppHybridConnection", { + * functionAppId: exampleWindowsWebApp.id, + * relayId: exampleHybridConnection.id, + * hostname: "myhostname.example", + * port: 8081, + * }); + * ``` + * * ## Import * * a Function App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/functionAppSlot.ts b/sdk/nodejs/appservice/functionAppSlot.ts index 6fc1e8faa2..cec671855e 100644 --- a/sdk/nodejs/appservice/functionAppSlot.ts +++ b/sdk/nodejs/appservice/functionAppSlot.ts @@ -12,6 +12,43 @@ import * as utilities from "../utilities"; * !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.LinuxFunctionAppSlot` resources instead. * * ## Example Usage + * ### With App Service Plan) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleFunctionApp = new azure.appservice.FunctionApp("exampleFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * const exampleFunctionAppSlot = new azure.appservice.FunctionAppSlot("exampleFunctionAppSlot", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * functionAppName: exampleFunctionApp.name, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/getAppService.ts b/sdk/nodejs/appservice/getAppService.ts index ca63ee6876..d82a7dfa15 100644 --- a/sdk/nodejs/appservice/getAppService.ts +++ b/sdk/nodejs/appservice/getAppService.ts @@ -10,6 +10,19 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing App Service. * * !> **Note:** The `azure.appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxWebApp` data sources instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getAppService({ + * name: "search-app-service", + * resourceGroupName: "search-service", + * }); + * export const appServiceId = example.then(example => example.id); + * ``` */ export function getAppService(args: GetAppServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -121,6 +134,19 @@ export interface GetAppServiceResult { * Use this data source to access information about an existing App Service. * * !> **Note:** The `azure.appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxWebApp` data sources instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getAppService({ + * name: "search-app-service", + * resourceGroupName: "search-service", + * }); + * export const appServiceId = example.then(example => example.id); + * ``` */ export function getAppServiceOutput(args: GetAppServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAppService(a, opts)) diff --git a/sdk/nodejs/appservice/getAppServiceEnvironment.ts b/sdk/nodejs/appservice/getAppServiceEnvironment.ts index 09d625164b..02126d8525 100644 --- a/sdk/nodejs/appservice/getAppServiceEnvironment.ts +++ b/sdk/nodejs/appservice/getAppServiceEnvironment.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing App Service Environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getAppServiceEnvironment({ + * name: "existing-ase", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getAppServiceEnvironment(args: GetAppServiceEnvironmentArgs, opts?: pulumi.InvokeOptions): Promise { @@ -80,6 +93,19 @@ export interface GetAppServiceEnvironmentResult { } /** * Use this data source to access information about an existing App Service Environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getAppServiceEnvironment({ + * name: "existing-ase", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getAppServiceEnvironmentOutput(args: GetAppServiceEnvironmentOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAppServiceEnvironment(a, opts)) diff --git a/sdk/nodejs/appservice/getAppServicePlan.ts b/sdk/nodejs/appservice/getAppServicePlan.ts index 0b8d9b6747..b05cc1efa8 100644 --- a/sdk/nodejs/appservice/getAppServicePlan.ts +++ b/sdk/nodejs/appservice/getAppServicePlan.ts @@ -10,6 +10,19 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing App Service Plan (formerly known as a `Server Farm`). * * !> **Note:** The `azure.appservice.Plan` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.ServicePlan` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getAppServicePlan({ + * name: "search-app-service-plan", + * resourceGroupName: "search-service", + * }); + * export const appServicePlanId = example.then(example => example.id); + * ``` */ export function getAppServicePlan(args: GetAppServicePlanArgs, opts?: pulumi.InvokeOptions): Promise { @@ -93,6 +106,19 @@ export interface GetAppServicePlanResult { * Use this data source to access information about an existing App Service Plan (formerly known as a `Server Farm`). * * !> **Note:** The `azure.appservice.Plan` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.ServicePlan` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getAppServicePlan({ + * name: "search-app-service-plan", + * resourceGroupName: "search-service", + * }); + * export const appServicePlanId = example.then(example => example.id); + * ``` */ export function getAppServicePlanOutput(args: GetAppServicePlanOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAppServicePlan(a, opts)) diff --git a/sdk/nodejs/appservice/getCertificate.ts b/sdk/nodejs/appservice/getCertificate.ts index 69891f7ae7..7fd30491ec 100644 --- a/sdk/nodejs/appservice/getCertificate.ts +++ b/sdk/nodejs/appservice/getCertificate.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an App Service Certificate. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getCertificate({ + * name: "example-app-service-certificate", + * resourceGroupName: "example-rg", + * }); + * export const appServiceCertificateId = example.then(example => example.id); + * ``` */ export function getCertificate(args: GetCertificateArgs, opts?: pulumi.InvokeOptions): Promise { @@ -75,6 +88,19 @@ export interface GetCertificateResult { } /** * Use this data source to access information about an App Service Certificate. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getCertificate({ + * name: "example-app-service-certificate", + * resourceGroupName: "example-rg", + * }); + * export const appServiceCertificateId = example.then(example => example.id); + * ``` */ export function getCertificateOutput(args: GetCertificateOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCertificate(a, opts)) diff --git a/sdk/nodejs/appservice/getCertificateOrder.ts b/sdk/nodejs/appservice/getCertificateOrder.ts index 09b92bb811..5441b794b1 100644 --- a/sdk/nodejs/appservice/getCertificateOrder.ts +++ b/sdk/nodejs/appservice/getCertificateOrder.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing App Service Certificate Order. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getCertificateOrder({ + * name: "example-cert-order", + * resourceGroupName: "example-resources", + * }); + * export const certificateOrderId = example.then(example => example.id); + * ``` */ export function getCertificateOrder(args: GetCertificateOrderArgs, opts?: pulumi.InvokeOptions): Promise { @@ -113,6 +126,19 @@ export interface GetCertificateOrderResult { } /** * Use this data source to access information about an existing App Service Certificate Order. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getCertificateOrder({ + * name: "example-cert-order", + * resourceGroupName: "example-resources", + * }); + * export const certificateOrderId = example.then(example => example.id); + * ``` */ export function getCertificateOrderOutput(args: GetCertificateOrderOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCertificateOrder(a, opts)) diff --git a/sdk/nodejs/appservice/getEnvironmentV3.ts b/sdk/nodejs/appservice/getEnvironmentV3.ts index 0250f86157..d8ff731db6 100644 --- a/sdk/nodejs/appservice/getEnvironmentV3.ts +++ b/sdk/nodejs/appservice/getEnvironmentV3.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing 3rd Generation (v3) App Service Environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getEnvironmentV3({ + * name: "example-ASE", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getEnvironmentV3(args: GetEnvironmentV3Args, opts?: pulumi.InvokeOptions): Promise { @@ -109,6 +122,19 @@ export interface GetEnvironmentV3Result { } /** * Use this data source to access information about an existing 3rd Generation (v3) App Service Environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getEnvironmentV3({ + * name: "example-ASE", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getEnvironmentV3Output(args: GetEnvironmentV3OutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEnvironmentV3(a, opts)) diff --git a/sdk/nodejs/appservice/getFunctionApp.ts b/sdk/nodejs/appservice/getFunctionApp.ts index 5733f4241d..69411f80a4 100644 --- a/sdk/nodejs/appservice/getFunctionApp.ts +++ b/sdk/nodejs/appservice/getFunctionApp.ts @@ -10,6 +10,18 @@ import * as utilities from "../utilities"; * Use this data source to access information about a Function App. * * !> **Note:** The `azure.appservice.FunctionApp` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxFunctionApp` data sources instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getFunctionApp({ + * name: "test-azure-functions", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getFunctionApp(args: GetFunctionAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -109,6 +121,18 @@ export interface GetFunctionAppResult { * Use this data source to access information about a Function App. * * !> **Note:** The `azure.appservice.FunctionApp` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.appservice.LinuxFunctionApp` data sources instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getFunctionApp({ + * name: "test-azure-functions", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getFunctionAppOutput(args: GetFunctionAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFunctionApp(a, opts)) diff --git a/sdk/nodejs/appservice/getFunctionAppHostKeys.ts b/sdk/nodejs/appservice/getFunctionAppHostKeys.ts index e894349d95..5a25d0c639 100644 --- a/sdk/nodejs/appservice/getFunctionAppHostKeys.ts +++ b/sdk/nodejs/appservice/getFunctionAppHostKeys.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to fetch the Host Keys of an existing Function App + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getFunctionAppHostKeys({ + * name: "example-function", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getFunctionAppHostKeys(args: GetFunctionAppHostKeysArgs, opts?: pulumi.InvokeOptions): Promise { @@ -71,6 +83,18 @@ export interface GetFunctionAppHostKeysResult { } /** * Use this data source to fetch the Host Keys of an existing Function App + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getFunctionAppHostKeys({ + * name: "example-function", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getFunctionAppHostKeysOutput(args: GetFunctionAppHostKeysOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFunctionAppHostKeys(a, opts)) diff --git a/sdk/nodejs/appservice/getLinuxFunctionApp.ts b/sdk/nodejs/appservice/getLinuxFunctionApp.ts index 43bf196a59..9bf16357d2 100644 --- a/sdk/nodejs/appservice/getLinuxFunctionApp.ts +++ b/sdk/nodejs/appservice/getLinuxFunctionApp.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Linux Function App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getLinuxFunctionApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLinuxFunctionApp(args: GetLinuxFunctionAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -193,6 +206,19 @@ export interface GetLinuxFunctionAppResult { } /** * Use this data source to access information about an existing Linux Function App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getLinuxFunctionApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLinuxFunctionAppOutput(args: GetLinuxFunctionAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getLinuxFunctionApp(a, opts)) diff --git a/sdk/nodejs/appservice/getLinuxWebApp.ts b/sdk/nodejs/appservice/getLinuxWebApp.ts index 8f136d5a2e..10cf5ff0d8 100644 --- a/sdk/nodejs/appservice/getLinuxWebApp.ts +++ b/sdk/nodejs/appservice/getLinuxWebApp.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Linux Web App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getLinuxWebApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLinuxWebApp(args: GetLinuxWebAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -179,6 +192,19 @@ export interface GetLinuxWebAppResult { } /** * Use this data source to access information about an existing Linux Web App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getLinuxWebApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLinuxWebAppOutput(args: GetLinuxWebAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getLinuxWebApp(a, opts)) diff --git a/sdk/nodejs/appservice/getServicePlan.ts b/sdk/nodejs/appservice/getServicePlan.ts index ece2232b03..46aeccabf9 100644 --- a/sdk/nodejs/appservice/getServicePlan.ts +++ b/sdk/nodejs/appservice/getServicePlan.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Service Plan. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getServicePlan({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getServicePlan(args: GetServicePlanArgs, opts?: pulumi.InvokeOptions): Promise { @@ -87,6 +100,19 @@ export interface GetServicePlanResult { } /** * Use this data source to access information about an existing Service Plan. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getServicePlan({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getServicePlanOutput(args: GetServicePlanOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getServicePlan(a, opts)) diff --git a/sdk/nodejs/appservice/getSourceControlToken.ts b/sdk/nodejs/appservice/getSourceControlToken.ts index 46eb3615bc..6cac54007d 100644 --- a/sdk/nodejs/appservice/getSourceControlToken.ts +++ b/sdk/nodejs/appservice/getSourceControlToken.ts @@ -4,6 +4,19 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getSourceControlToken({ + * type: "GitHub", + * }); + * export const id = data.azurerm_app_service_github_token.example.id; + * ``` + */ export function getSourceControlToken(args: GetSourceControlTokenArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -37,6 +50,19 @@ export interface GetSourceControlTokenResult { readonly tokenSecret: string; readonly type: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getSourceControlToken({ + * type: "GitHub", + * }); + * export const id = data.azurerm_app_service_github_token.example.id; + * ``` + */ export function getSourceControlTokenOutput(args: GetSourceControlTokenOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSourceControlToken(a, opts)) } diff --git a/sdk/nodejs/appservice/getWindowsFunctionApp.ts b/sdk/nodejs/appservice/getWindowsFunctionApp.ts index 55e26d8ea4..1279a1289d 100644 --- a/sdk/nodejs/appservice/getWindowsFunctionApp.ts +++ b/sdk/nodejs/appservice/getWindowsFunctionApp.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Windows Function App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getWindowsFunctionApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getWindowsFunctionApp(args: GetWindowsFunctionAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -185,6 +198,19 @@ export interface GetWindowsFunctionAppResult { } /** * Use this data source to access information about an existing Windows Function App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getWindowsFunctionApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getWindowsFunctionAppOutput(args: GetWindowsFunctionAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWindowsFunctionApp(a, opts)) diff --git a/sdk/nodejs/appservice/getWindowsWebApp.ts b/sdk/nodejs/appservice/getWindowsWebApp.ts index 52b0d4b11d..6d5ca5c9fa 100644 --- a/sdk/nodejs/appservice/getWindowsWebApp.ts +++ b/sdk/nodejs/appservice/getWindowsWebApp.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Windows Web App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getWindowsWebApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getWindowsWebApp(args: GetWindowsWebAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -165,6 +178,19 @@ export interface GetWindowsWebAppResult { } /** * Use this data source to access information about an existing Windows Web App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.appservice.getWindowsWebApp({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getWindowsWebAppOutput(args: GetWindowsWebAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWindowsWebApp(a, opts)) diff --git a/sdk/nodejs/appservice/hybridConnection.ts b/sdk/nodejs/appservice/hybridConnection.ts index 3500e7b1d8..97fb3b7713 100644 --- a/sdk/nodejs/appservice/hybridConnection.ts +++ b/sdk/nodejs/appservice/hybridConnection.ts @@ -9,6 +9,48 @@ import * as utilities from "../utilities"; * * !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.FunctionAppHybridConnection` resources instead. * + * ## Example Usage + * + * This example provisions an App Service, a Relay Hybrid Connection, and a Service Bus using their outputs to create the App Service Hybrid Connection. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * }); + * const exampleNamespace = new azure.relay.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleHybridConnection = new azure.relay.HybridConnection("exampleHybridConnection", { + * resourceGroupName: exampleResourceGroup.name, + * relayNamespaceName: exampleNamespace.name, + * userMetadata: "examplemetadata", + * }); + * const exampleAppservice_hybridConnectionHybridConnection = new azure.appservice.HybridConnection("exampleAppservice/hybridConnectionHybridConnection", { + * appServiceName: exampleAppService.name, + * resourceGroupName: exampleResourceGroup.name, + * relayId: exampleHybridConnection.id, + * hostname: "testhostname.example", + * port: 8080, + * sendKeyName: "exampleSharedAccessKey", + * }); + * ``` + * * ## Import * * App Service Hybrid Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/linuxFunctionApp.ts b/sdk/nodejs/appservice/linuxFunctionApp.ts index a6eee8f65e..2d31afa1db 100644 --- a/sdk/nodejs/appservice/linuxFunctionApp.ts +++ b/sdk/nodejs/appservice/linuxFunctionApp.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Linux Function App. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "Y1", + * }); + * const exampleLinuxFunctionApp = new azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * Linux Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/linuxFunctionAppSlot.ts b/sdk/nodejs/appservice/linuxFunctionAppSlot.ts index 0c994e2bf3..dee220165c 100644 --- a/sdk/nodejs/appservice/linuxFunctionAppSlot.ts +++ b/sdk/nodejs/appservice/linuxFunctionAppSlot.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a Linux Function App Slot. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "Y1", + * }); + * const exampleLinuxFunctionApp = new azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * servicePlanId: exampleServicePlan.id, + * storageAccountName: exampleAccount.name, + * siteConfig: {}, + * }); + * const exampleLinuxFunctionAppSlot = new azure.appservice.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", { + * functionAppId: exampleLinuxFunctionApp.id, + * storageAccountName: exampleAccount.name, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * A Linux Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/linuxWebApp.ts b/sdk/nodejs/appservice/linuxWebApp.ts index 1ec01e8973..c0a8d0e02c 100644 --- a/sdk/nodejs/appservice/linuxWebApp.ts +++ b/sdk/nodejs/appservice/linuxWebApp.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a Linux Web App. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "P1v2", + * }); + * const exampleLinuxWebApp = new azure.appservice.LinuxWebApp("exampleLinuxWebApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleServicePlan.location, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/linuxWebAppSlot.ts b/sdk/nodejs/appservice/linuxWebAppSlot.ts index 537ac42748..2876322981 100644 --- a/sdk/nodejs/appservice/linuxWebAppSlot.ts +++ b/sdk/nodejs/appservice/linuxWebAppSlot.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Linux Web App Slot. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "P1v2", + * }); + * const exampleLinuxWebApp = new azure.appservice.LinuxWebApp("exampleLinuxWebApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleServicePlan.location, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleLinuxWebAppSlot = new azure.appservice.LinuxWebAppSlot("exampleLinuxWebAppSlot", { + * appServiceId: exampleLinuxWebApp.id, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/plan.ts b/sdk/nodejs/appservice/plan.ts index 4278a9d2bc..3402a236e4 100644 --- a/sdk/nodejs/appservice/plan.ts +++ b/sdk/nodejs/appservice/plan.ts @@ -14,6 +14,75 @@ import {Kind} from "./index"; * !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.appservice.ServicePlan` resource instead. * * ## Example Usage + * ### Dedicated) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * ``` + * ### Shared / Consumption Plan) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "FunctionApp", + * sku: { + * tier: "Dynamic", + * size: "Y1", + * }, + * }); + * ``` + * ### Linux) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "Linux", + * reserved: true, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * ``` + * ### Windows Container) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "xenon", + * isXenon: true, + * sku: { + * tier: "PremiumContainer", + * size: "PC2", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/publicCertificate.ts b/sdk/nodejs/appservice/publicCertificate.ts index 76f3551e0c..3769adef7b 100644 --- a/sdk/nodejs/appservice/publicCertificate.ts +++ b/sdk/nodejs/appservice/publicCertificate.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages an App Service Public Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * }); + * const examplePublicCertificate = new azure.appservice.PublicCertificate("examplePublicCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * appServiceName: exampleAppService.name, + * certificateName: "example-public-certificate", + * certificateLocation: "Unknown", + * blob: Buffer.from(fs.readFileSync("app_service_public_certificate.cer"), 'binary').toString('base64'), + * }); + * ``` + * * ## Import * * App Service Public Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/servicePlan.ts b/sdk/nodejs/appservice/servicePlan.ts index a47b8faedf..cacb8532bf 100644 --- a/sdk/nodejs/appservice/servicePlan.ts +++ b/sdk/nodejs/appservice/servicePlan.ts @@ -7,6 +7,21 @@ import * as utilities from "../utilities"; /** * Manages an App Service: Service Plan. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "P1v2", + * }); + * ``` + * * ## Import * * AppServices can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/slot.ts b/sdk/nodejs/appservice/slot.ts index ed0a9dc1a4..f38cc9dc86 100644 --- a/sdk/nodejs/appservice/slot.ts +++ b/sdk/nodejs/appservice/slot.ts @@ -14,6 +14,106 @@ import * as utilities from "../utilities"; * > **Note:** When using Slots - the `appSettings`, `connectionString` and `siteConfig` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource. * * ## Example Usage + * ### NET 4.X) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const server = new random.RandomId("server", { + * keepers: { + * azi_id: 1, + * }, + * byteLength: 8, + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * siteConfig: { + * dotnetFrameworkVersion: "v4.0", + * }, + * appSettings: { + * SOME_KEY: "some-value", + * }, + * connectionStrings: [{ + * name: "Database", + * type: "SQLServer", + * value: "Server=some-server.mydomain.com;Integrated Security=SSPI", + * }], + * }); + * const exampleSlot = new azure.appservice.Slot("exampleSlot", { + * appServiceName: exampleAppService.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * siteConfig: { + * dotnetFrameworkVersion: "v4.0", + * }, + * appSettings: { + * SOME_KEY: "some-value", + * }, + * connectionStrings: [{ + * name: "Database", + * type: "SQLServer", + * value: "Server=some-server.mydomain.com;Integrated Security=SSPI", + * }], + * }); + * ``` + * ### Java 1.8) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const server = new random.RandomId("server", { + * keepers: { + * azi_id: 1, + * }, + * byteLength: 8, + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * siteConfig: { + * javaVersion: "1.8", + * javaContainer: "JETTY", + * javaContainerVersion: "9.3", + * }, + * }); + * const exampleSlot = new azure.appservice.Slot("exampleSlot", { + * appServiceName: exampleAppService.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * siteConfig: { + * javaVersion: "1.8", + * javaContainer: "JETTY", + * javaContainerVersion: "9.3", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/slotCustomHostnameBinding.ts b/sdk/nodejs/appservice/slotCustomHostnameBinding.ts index 4556a4303b..de666630fc 100644 --- a/sdk/nodejs/appservice/slotCustomHostnameBinding.ts +++ b/sdk/nodejs/appservice/slotCustomHostnameBinding.ts @@ -7,6 +7,38 @@ import * as utilities from "../utilities"; /** * Manages a Hostname Binding within an App Service Slot. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * }); + * const exampleSlot = new azure.appservice.Slot("exampleSlot", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServiceName: exampleAppService.name, + * appServicePlanId: examplePlan.id, + * }); + * const exampleSlotCustomHostnameBinding = new azure.appservice.SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", { + * appServiceSlotId: exampleSlot.id, + * hostname: "www.mywebsite.com", + * }); + * ``` + * * ## Import * * App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/slotVirtualNetworkSwiftConnection.ts b/sdk/nodejs/appservice/slotVirtualNetworkSwiftConnection.ts index b142599c87..af97ceca76 100644 --- a/sdk/nodejs/appservice/slotVirtualNetworkSwiftConnection.ts +++ b/sdk/nodejs/appservice/slotVirtualNetworkSwiftConnection.ts @@ -7,6 +7,56 @@ import * as utilities from "../utilities"; /** * Manages an App Service Slot's Virtual Network Association (this is for the [Regional VNet Integration](https://docs.microsoft.com/azure/app-service/web-sites-integrate-with-vnet#regional-vnet-integration) which is still in preview). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * delegations: [{ + * name: "example-delegation", + * serviceDelegation: { + * name: "Microsoft.Web/serverFarms", + * actions: ["Microsoft.Network/virtualNetworks/subnets/action"], + * }, + * }], + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * }); + * const example_staging = new azure.appservice.Slot("example-staging", { + * appServiceName: exampleAppService.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * }); + * const exampleSlotVirtualNetworkSwiftConnection = new azure.appservice.SlotVirtualNetworkSwiftConnection("exampleSlotVirtualNetworkSwiftConnection", { + * slotName: example_staging.name, + * appServiceId: exampleAppService.id, + * subnetId: exampleSubnet.id, + * }); + * ``` + * * ## Import * * App Service Slot Virtual Network Associations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/sourceCodeToken.ts b/sdk/nodejs/appservice/sourceCodeToken.ts index c502ec553e..704561c96e 100644 --- a/sdk/nodejs/appservice/sourceCodeToken.ts +++ b/sdk/nodejs/appservice/sourceCodeToken.ts @@ -11,6 +11,18 @@ import * as utilities from "../utilities"; * * > **NOTE:** Source Control Tokens are configured at the subscription level, not on each App Service - as such this can only be configured Subscription-wide * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.appservice.SourceCodeToken("example", { + * token: "7e57735e77e577e57", + * type: "GitHub", + * }); + * ``` + * * ## Import * * App Service Source Control Token's can be imported using the `type`, e.g. diff --git a/sdk/nodejs/appservice/sourceControl.ts b/sdk/nodejs/appservice/sourceControl.ts index a99df392bc..6455078716 100644 --- a/sdk/nodejs/appservice/sourceControl.ts +++ b/sdk/nodejs/appservice/sourceControl.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages an App Service Web App or Function App Source Control Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "P1v2", + * }); + * const exampleLinuxWebApp = new azure.appservice.LinuxWebApp("exampleLinuxWebApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleServicePlan.location, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleSourceControl = new azure.appservice.SourceControl("exampleSourceControl", { + * appId: exampleLinuxWebApp.id, + * repoUrl: "https://github.com/Azure-Samples/python-docs-hello-world", + * branch: "master", + * }); + * ``` + * * ## Import * * App Service Source Controls can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/sourceControlSlot.ts b/sdk/nodejs/appservice/sourceControlSlot.ts index 5ecf644704..e007dc6242 100644 --- a/sdk/nodejs/appservice/sourceControlSlot.ts +++ b/sdk/nodejs/appservice/sourceControlSlot.ts @@ -9,6 +9,36 @@ import * as utilities from "../utilities"; /** * Manages an App Service Source Control Slot. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * skuName: "P1v2", + * }); + * const exampleLinuxWebApp = new azure.appservice.LinuxWebApp("exampleLinuxWebApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleServicePlan.location, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleLinuxWebAppSlot = new azure.appservice.LinuxWebAppSlot("exampleLinuxWebAppSlot", { + * appServiceId: exampleLinuxWebApp.id, + * siteConfig: {}, + * }); + * const exampleSourceControlSlot = new azure.appservice.SourceControlSlot("exampleSourceControlSlot", { + * slotId: exampleLinuxWebAppSlot.id, + * repoUrl: "https://github.com/Azure-Samples/python-docs-hello-world", + * branch: "master", + * }); + * ``` + * * ## Import * * an App Service Source Control Slot can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/sourceControlToken.ts b/sdk/nodejs/appservice/sourceControlToken.ts index b24711ae6b..05ae8c0e75 100644 --- a/sdk/nodejs/appservice/sourceControlToken.ts +++ b/sdk/nodejs/appservice/sourceControlToken.ts @@ -5,6 +5,18 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.appservice.SourceControlToken("example", { + * token: "ghp_sometokenvaluesecretsauce", + * type: "GitHub", + * }); + * ``` + * * ## Import * * App Service Source GitHub Tokens can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/staticSite.ts b/sdk/nodejs/appservice/staticSite.ts index e76c3f93ea..ec52350df6 100644 --- a/sdk/nodejs/appservice/staticSite.ts +++ b/sdk/nodejs/appservice/staticSite.ts @@ -11,6 +11,18 @@ import * as utilities from "../utilities"; * * ->**NOTE:** After the Static Site is provisioned, you'll need to associate your target repository, which contains your web app, to the Static Site, by following the [Azure Static Site document](https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.appservice.StaticSite("example", { + * location: "West Europe", + * resourceGroupName: "example", + * }); + * ``` + * * ## Import * * Static Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/staticSiteCustomDomain.ts b/sdk/nodejs/appservice/staticSiteCustomDomain.ts index 7f210126ed..495b2d01c8 100644 --- a/sdk/nodejs/appservice/staticSiteCustomDomain.ts +++ b/sdk/nodejs/appservice/staticSiteCustomDomain.ts @@ -6,6 +6,54 @@ import * as utilities from "../utilities"; /** * ## Example Usage + * ### CNAME validation + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleStaticSite = new azure.appservice.StaticSite("exampleStaticSite", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleCNameRecord = new azure.dns.CNameRecord("exampleCNameRecord", { + * zoneName: "contoso.com", + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * record: exampleStaticSite.defaultHostName, + * }); + * const exampleStaticSiteCustomDomain = new azure.appservice.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", { + * staticSiteId: exampleStaticSite.id, + * domainName: pulumi.interpolate`${exampleCNameRecord.name}.${exampleCNameRecord.zoneName}`, + * validationType: "cname-delegation", + * }); + * ``` + * ### TXT validation + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleStaticSite = new azure.appservice.StaticSite("exampleStaticSite", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleStaticSiteCustomDomain = new azure.appservice.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", { + * staticSiteId: exampleStaticSite.id, + * domainName: "my-domain.contoso.com", + * validationType: "dns-txt-token", + * }); + * const exampleTxtRecord = new azure.dns.TxtRecord("exampleTxtRecord", { + * zoneName: "contoso.com", + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: [{ + * value: exampleStaticSiteCustomDomain.validationToken, + * }], + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/virtualNetworkSwiftConnection.ts b/sdk/nodejs/appservice/virtualNetworkSwiftConnection.ts index 20165ce72d..c9d10fd655 100644 --- a/sdk/nodejs/appservice/virtualNetworkSwiftConnection.ts +++ b/sdk/nodejs/appservice/virtualNetworkSwiftConnection.ts @@ -29,6 +29,98 @@ import * as utilities from "../utilities"; * Multiple apps in the same App Service plan can use the same VNet. * * ## Example Usage + * ### With App Service) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * delegations: [{ + * name: "example-delegation", + * serviceDelegation: { + * name: "Microsoft.Web/serverFarms", + * actions: ["Microsoft.Network/virtualNetworks/subnets/action"], + * }, + * }], + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAppService = new azure.appservice.AppService("exampleAppService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * }); + * const exampleVirtualNetworkSwiftConnection = new azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", { + * appServiceId: exampleAppService.id, + * subnetId: exampleSubnet.id, + * }); + * ``` + * ### With Function App) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * delegations: [{ + * name: "example-delegation", + * serviceDelegation: { + * name: "Microsoft.Web/serverFarms", + * actions: ["Microsoft.Network/virtualNetworks/subnets/action"], + * }, + * }], + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * tier: "Standard", + * size: "S1", + * }, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleFunctionApp = new azure.appservice.FunctionApp("exampleFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * const exampleVirtualNetworkSwiftConnection = new azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", { + * appServiceId: exampleFunctionApp.id, + * subnetId: exampleSubnet.id, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/webAppActiveSlot.ts b/sdk/nodejs/appservice/webAppActiveSlot.ts index 150aca7036..e4934947c8 100644 --- a/sdk/nodejs/appservice/webAppActiveSlot.ts +++ b/sdk/nodejs/appservice/webAppActiveSlot.ts @@ -8,6 +8,31 @@ import * as utilities from "../utilities"; * Manages a Web App Active Slot. * * ## Example Usage + * ### Windows Web App + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Windows", + * skuName: "P1v2", + * }); + * const exampleWindowsWebApp = new azure.appservice.WindowsWebApp("exampleWindowsWebApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleServicePlan.location, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleWindowsWebAppSlot = new azure.appservice.WindowsWebAppSlot("exampleWindowsWebAppSlot", { + * appServiceId: exampleWindowsWebApp.name, + * siteConfig: {}, + * }); + * const exampleWebAppActiveSlot = new azure.appservice.WebAppActiveSlot("exampleWebAppActiveSlot", {slotId: exampleWindowsWebAppSlot.id}); + * ``` * * ## Import * diff --git a/sdk/nodejs/appservice/webAppHybridConnection.ts b/sdk/nodejs/appservice/webAppHybridConnection.ts index d54a40b596..c8928479df 100644 --- a/sdk/nodejs/appservice/webAppHybridConnection.ts +++ b/sdk/nodejs/appservice/webAppHybridConnection.ts @@ -7,6 +7,42 @@ import * as utilities from "../utilities"; /** * Manages a Web App Hybrid Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * osType: "Windows", + * skuName: "S1", + * }); + * const exampleNamespace = new azure.relay.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleHybridConnection = new azure.relay.HybridConnection("exampleHybridConnection", { + * resourceGroupName: exampleResourceGroup.name, + * relayNamespaceName: exampleNamespace.name, + * }); + * const exampleWindowsWebApp = new azure.appservice.WindowsWebApp("exampleWindowsWebApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleWebAppHybridConnection = new azure.appservice.WebAppHybridConnection("exampleWebAppHybridConnection", { + * webAppId: exampleWindowsWebApp.id, + * relayId: exampleHybridConnection.id, + * hostname: "myhostname.example", + * port: 8081, + * }); + * ``` + * * ## Import * * a Web App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/windowsFunctionApp.ts b/sdk/nodejs/appservice/windowsFunctionApp.ts index 3137bdcbaf..30c6d11203 100644 --- a/sdk/nodejs/appservice/windowsFunctionApp.ts +++ b/sdk/nodejs/appservice/windowsFunctionApp.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Windows Function App. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Windows", + * skuName: "Y1", + * }); + * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * Windows Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/windowsFunctionAppSlot.ts b/sdk/nodejs/appservice/windowsFunctionAppSlot.ts index e0b42fc01d..8f8bd1133b 100644 --- a/sdk/nodejs/appservice/windowsFunctionAppSlot.ts +++ b/sdk/nodejs/appservice/windowsFunctionAppSlot.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a Windows Function App Slot. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Windows", + * skuName: "Y1", + * }); + * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageAccountName: exampleAccount.name, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleWindowsFunctionAppSlot = new azure.appservice.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", { + * functionAppId: exampleWindowsFunctionApp.id, + * storageAccountName: exampleAccount.name, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * A Windows Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/windowsWebApp.ts b/sdk/nodejs/appservice/windowsWebApp.ts index 27443d29ee..24e7353b79 100644 --- a/sdk/nodejs/appservice/windowsWebApp.ts +++ b/sdk/nodejs/appservice/windowsWebApp.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a Windows Web App. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "P1v2", + * osType: "Windows", + * }); + * const exampleWindowsWebApp = new azure.appservice.WindowsWebApp("exampleWindowsWebApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleServicePlan.location, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/appservice/windowsWebAppSlot.ts b/sdk/nodejs/appservice/windowsWebAppSlot.ts index ae0a302fcf..3e1fe4419e 100644 --- a/sdk/nodejs/appservice/windowsWebAppSlot.ts +++ b/sdk/nodejs/appservice/windowsWebAppSlot.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Windows Web App Slot. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.appservice.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Windows", + * skuName: "P1v2", + * }); + * const exampleWindowsWebApp = new azure.appservice.WindowsWebApp("exampleWindowsWebApp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleServicePlan.location, + * servicePlanId: exampleServicePlan.id, + * siteConfig: {}, + * }); + * const exampleWindowsWebAppSlot = new azure.appservice.WindowsWebAppSlot("exampleWindowsWebAppSlot", { + * appServiceId: exampleWindowsWebApp.id, + * siteConfig: {}, + * }); + * ``` + * * ## Import * * Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/arc/privateLinkScope.ts b/sdk/nodejs/arc/privateLinkScope.ts index b7cb1d4239..1b9f78fe83 100644 --- a/sdk/nodejs/arc/privateLinkScope.ts +++ b/sdk/nodejs/arc/privateLinkScope.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages an Azure Arc Private Link Scope. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const examplePrivateLinkScope = new azure.arc.PrivateLinkScope("examplePrivateLinkScope", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Azure Arc Private Link Scope can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/arc/resourceBridgeAppliance.ts b/sdk/nodejs/arc/resourceBridgeAppliance.ts index aaad1bb12a..76cf72e778 100644 --- a/sdk/nodejs/arc/resourceBridgeAppliance.ts +++ b/sdk/nodejs/arc/resourceBridgeAppliance.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages an Arc Resource Bridge Appliance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleResourceBridgeAppliance = new azure.arc.ResourceBridgeAppliance("exampleResourceBridgeAppliance", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * distro: "AKSEdge", + * infrastructureProvider: "VMWare", + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * hello: "world", + * }, + * }); + * ``` + * * ## Import * * Arc Resource Bridge Appliance can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/arckubernetes/clusterExtension.ts b/sdk/nodejs/arckubernetes/clusterExtension.ts index a2c3ce506a..7cb4209fea 100644 --- a/sdk/nodejs/arckubernetes/clusterExtension.ts +++ b/sdk/nodejs/arckubernetes/clusterExtension.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages an Arc Kubernetes Cluster Extension. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.arckubernetes.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * agentPublicKeyCertificate: Buffer.from(fs.readFileSync("testdata/public.cer"), 'binary').toString('base64'), + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * ENV: "Test", + * }, + * }); + * const exampleClusterExtension = new azure.arckubernetes.ClusterExtension("exampleClusterExtension", { + * clusterId: exampleCluster.id, + * extensionType: "microsoft.flux", + * }); + * ``` + * * ## Import * * Arc Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/nodejs/arckubernetes/fluxConfiguration.ts b/sdk/nodejs/arckubernetes/fluxConfiguration.ts index b0ff18b882..44ee326db4 100644 --- a/sdk/nodejs/arckubernetes/fluxConfiguration.ts +++ b/sdk/nodejs/arckubernetes/fluxConfiguration.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages an Arc Kubernetes Flux Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.arckubernetes.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * agentPublicKeyCertificate: Buffer.from(fs.readFileSync("testdata/public.cer"), 'binary').toString('base64'), + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * ENV: "Test", + * }, + * }); + * const exampleClusterExtension = new azure.arckubernetes.ClusterExtension("exampleClusterExtension", { + * clusterId: azurerm_arc_kubernetes_cluster.test.id, + * extensionType: "microsoft.flux", + * }); + * const exampleFluxConfiguration = new azure.arckubernetes.FluxConfiguration("exampleFluxConfiguration", { + * clusterId: azurerm_arc_kubernetes_cluster.test.id, + * namespace: "flux", + * gitRepository: { + * url: "https://github.com/Azure/arc-k8s-demo", + * referenceType: "branch", + * referenceValue: "main", + * }, + * kustomizations: [{ + * name: "kustomization-1", + * }], + * }, { + * dependsOn: [exampleClusterExtension], + * }); + * ``` + * * ## Import * * Arc Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/nodejs/arcmachine/get.ts b/sdk/nodejs/arcmachine/get.ts index 8e8897c4d2..a21fbabbe0 100644 --- a/sdk/nodejs/arcmachine/get.ts +++ b/sdk/nodejs/arcmachine/get.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure Arc machine. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.arcmachine.get({ + * name: "existing-hcmachine", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function get(args: GetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -156,6 +169,19 @@ export interface GetResult { } /** * Use this data source to access information about an existing Azure Arc machine. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.arcmachine.get({ + * name: "existing-hcmachine", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getOutput(args: GetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => get(a, opts)) diff --git a/sdk/nodejs/attestation/provider.ts b/sdk/nodejs/attestation/provider.ts index 046271881f..dce3686d32 100644 --- a/sdk/nodejs/attestation/provider.ts +++ b/sdk/nodejs/attestation/provider.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; /** * Manages an Attestation Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleProvider = new azure.attestation.Provider("exampleProvider", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * policySigningCertificateData: fs.readFileSync("./example/cert.pem"), + * }); + * ``` + * * ## Import * * Attestation Providers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/authorization/assignment.ts b/sdk/nodejs/authorization/assignment.ts index c0664083c9..d11aa58fd1 100644 --- a/sdk/nodejs/authorization/assignment.ts +++ b/sdk/nodejs/authorization/assignment.ts @@ -8,6 +8,95 @@ import * as utilities from "../utilities"; * Assigns a given Principal (User or Group) to a given Role. * * ## Example Usage + * ### Using A Built-In Role) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: primary.then(primary => primary.id), + * roleDefinitionName: "Reader", + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` + * ### Custom Role & Service Principal) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = new azure.authorization.RoleDefinition("exampleRoleDefinition", { + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * permissions: [{ + * actions: ["Microsoft.Resources/subscriptions/resourceGroups/read"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * name: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * roleDefinitionId: exampleRoleDefinition.roleDefinitionResourceId, + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` + * ### Custom Role & User) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = new azure.authorization.RoleDefinition("exampleRoleDefinition", { + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * permissions: [{ + * actions: ["Microsoft.Resources/subscriptions/resourceGroups/read"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * name: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * roleDefinitionId: exampleRoleDefinition.roleDefinitionResourceId, + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` + * ### Custom Role & Management Group) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleGroup = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * const exampleRoleDefinition = new azure.authorization.RoleDefinition("exampleRoleDefinition", { + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * permissions: [{ + * actions: ["Microsoft.Resources/subscriptions/resourceGroups/read"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * name: "00000000-0000-0000-0000-000000000000", + * scope: data.azurerm_management_group.primary.id, + * roleDefinitionId: exampleRoleDefinition.roleDefinitionResourceId, + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/authorization/getUserAssignedIdentity.ts b/sdk/nodejs/authorization/getUserAssignedIdentity.ts index ab8128cc7d..e87bb8b11b 100644 --- a/sdk/nodejs/authorization/getUserAssignedIdentity.ts +++ b/sdk/nodejs/authorization/getUserAssignedIdentity.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing User Assigned Identity. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.authorization.getUserAssignedIdentity({ + * name: "name_of_user_assigned_identity", + * resourceGroupName: "name_of_resource_group", + * }); + * export const uaiClientId = example.then(example => example.clientId); + * export const uaiPrincipalId = example.then(example => example.principalId); + * export const uaiTenantId = example.then(example => example.tenantId); + * ``` */ export function getUserAssignedIdentity(args: GetUserAssignedIdentityArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +81,20 @@ export interface GetUserAssignedIdentityResult { * Use this data source to access information about an existing User Assigned Identity. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.authorization.getUserAssignedIdentity({ + * name: "name_of_user_assigned_identity", + * resourceGroupName: "name_of_resource_group", + * }); + * export const uaiClientId = example.then(example => example.clientId); + * export const uaiPrincipalId = example.then(example => example.principalId); + * export const uaiTenantId = example.then(example => example.tenantId); + * ``` */ export function getUserAssignedIdentityOutput(args: GetUserAssignedIdentityOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getUserAssignedIdentity(a, opts)) diff --git a/sdk/nodejs/authorization/roleDefinition.ts b/sdk/nodejs/authorization/roleDefinition.ts index 5a704f01e2..15fe31ef4c 100644 --- a/sdk/nodejs/authorization/roleDefinition.ts +++ b/sdk/nodejs/authorization/roleDefinition.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const example = new azure.authorization.RoleDefinition("example", { + * scope: primary.then(primary => primary.id), + * description: "This is a custom role created", + * permissions: [{ + * actions: ["*"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * ``` + * * ## Import * * Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/authorization/userAssignedIdentity.ts b/sdk/nodejs/authorization/userAssignedIdentity.ts index 8fc7a61d20..a292b6c74e 100644 --- a/sdk/nodejs/authorization/userAssignedIdentity.ts +++ b/sdk/nodejs/authorization/userAssignedIdentity.ts @@ -9,6 +9,19 @@ import * as utilities from "../utilities"; * * Manages a User Assigned Identity. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/nodejs/automanage/configuration.ts b/sdk/nodejs/automanage/configuration.ts index 6eb37441a1..1303c9e5f4 100644 --- a/sdk/nodejs/automanage/configuration.ts +++ b/sdk/nodejs/automanage/configuration.ts @@ -9,6 +9,74 @@ import * as utilities from "../utilities"; /** * Manages an Automanage Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleConfiguration = new azure.automanage.Configuration("exampleConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * antimalware: { + * exclusions: { + * extensions: "exe;dll", + * paths: "C:\\Windows\\Temp;D:\\Temp", + * processes: "svchost.exe;notepad.exe", + * }, + * realTimeProtectionEnabled: true, + * scheduledScanEnabled: true, + * scheduledScanType: "Quick", + * scheduledScanDay: 1, + * scheduledScanTimeInMinutes: 1339, + * }, + * azureSecurityBaseline: { + * assignmentType: "ApplyAndAutoCorrect", + * }, + * automationAccountEnabled: true, + * backup: { + * policyName: "acctest-backup-policy-%d", + * timeZone: "UTC", + * instantRpRetentionRangeInDays: 2, + * schedulePolicy: { + * scheduleRunFrequency: "Daily", + * scheduleRunDays: [ + * "Monday", + * "Tuesday", + * ], + * scheduleRunTimes: ["12:00"], + * schedulePolicyType: "SimpleSchedulePolicy", + * }, + * retentionPolicy: { + * retentionPolicyType: "LongTermRetentionPolicy", + * dailySchedule: { + * retentionTimes: ["12:00"], + * retentionDuration: { + * count: 7, + * durationType: "Days", + * }, + * }, + * weeklySchedule: { + * retentionTimes: ["14:00"], + * retentionDuration: { + * count: 4, + * durationType: "Weeks", + * }, + * }, + * }, + * }, + * bootDiagnosticsEnabled: true, + * defenderForCloudEnabled: true, + * guestConfigurationEnabled: true, + * logAnalyticsEnabled: true, + * statusChangeAlertEnabled: true, + * tags: { + * env: "test", + * }, + * }); + * ``` + * * ## Import * * Automanage Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/account.ts b/sdk/nodejs/automation/account.ts index 58c26de483..4f9a337d2a 100644 --- a/sdk/nodejs/automation/account.ts +++ b/sdk/nodejs/automation/account.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a Automation Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * tags: { + * environment: "development", + * }, + * }); + * ``` + * * ## Import * * Automation Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/boolVariable.ts b/sdk/nodejs/automation/boolVariable.ts index 378c708915..8aec3f1b79 100644 --- a/sdk/nodejs/automation/boolVariable.ts +++ b/sdk/nodejs/automation/boolVariable.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a boolean variable in Azure Automation * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleBoolVariable = new azure.automation.BoolVariable("exampleBoolVariable", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * value: false, + * }); + * ``` + * * ## Import * * Automation Bool Variable can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/certificate.ts b/sdk/nodejs/automation/certificate.ts index bda3c371e4..544c02f475 100644 --- a/sdk/nodejs/automation/certificate.ts +++ b/sdk/nodejs/automation/certificate.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an Automation Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleCertificate = new azure.automation.Certificate("exampleCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * description: "This is an example certificate", + * base64: Buffer.from(fs.readFileSync("certificate.pfx"), 'binary').toString('base64'), + * exportable: true, + * }); + * ``` + * * ## Import * * Automation Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/connection.ts b/sdk/nodejs/automation/connection.ts index 88d9db09ed..e23c80022f 100644 --- a/sdk/nodejs/automation/connection.ts +++ b/sdk/nodejs/automation/connection.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages an Automation Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleConnection = new azure.automation.Connection("exampleConnection", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * type: "AzureServicePrincipal", + * values: { + * ApplicationId: "00000000-0000-0000-0000-000000000000", + * TenantId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.tenantId), + * SubscriptionId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.subscriptionId), + * CertificateThumbprint: "sample-certificate-thumbprint", + * }, + * }); + * ``` + * * ## Import * * Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/connectionCertificate.ts b/sdk/nodejs/automation/connectionCertificate.ts index 7a0beac626..20db244a0d 100644 --- a/sdk/nodejs/automation/connectionCertificate.ts +++ b/sdk/nodejs/automation/connectionCertificate.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages an Automation Connection with type `Azure`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleCertificate = new azure.automation.Certificate("exampleCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * base64: Buffer.from(fs.readFileSync("certificate.pfx"), 'binary').toString('base64'), + * }); + * const exampleConnectionCertificate = new azure.automation.ConnectionCertificate("exampleConnectionCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * automationCertificateName: exampleCertificate.name, + * subscriptionId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.subscriptionId), + * }); + * ``` + * * ## Import * * Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/connectionClassicCertificate.ts b/sdk/nodejs/automation/connectionClassicCertificate.ts index 074c0ba5c5..6a0647808e 100644 --- a/sdk/nodejs/automation/connectionClassicCertificate.ts +++ b/sdk/nodejs/automation/connectionClassicCertificate.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an Automation Connection with type `AzureClassicCertificate`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleConnectionClassicCertificate = new azure.automation.ConnectionClassicCertificate("exampleConnectionClassicCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * certificateAssetName: "cert1", + * subscriptionName: "subs1", + * subscriptionId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.subscriptionId), + * }); + * ``` + * * ## Import * * Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/connectionServicePrincipal.ts b/sdk/nodejs/automation/connectionServicePrincipal.ts index 684888b782..9cfa9c915e 100644 --- a/sdk/nodejs/automation/connectionServicePrincipal.ts +++ b/sdk/nodejs/automation/connectionServicePrincipal.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages an Automation Connection with type `AzureServicePrincipal`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleConnectionServicePrincipal = new azure.automation.ConnectionServicePrincipal("exampleConnectionServicePrincipal", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * applicationId: "00000000-0000-0000-0000-000000000000", + * tenantId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.tenantId), + * subscriptionId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.subscriptionId), + * certificateThumbprint: fs.readFileSync("automation_certificate_test.thumb"), + * }); + * ``` + * * ## Import * * Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/connectionType.ts b/sdk/nodejs/automation/connectionType.ts index 25c7ef4418..26679d9852 100644 --- a/sdk/nodejs/automation/connectionType.ts +++ b/sdk/nodejs/automation/connectionType.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages anAutomation Connection Type. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleConnectionType = new azure.automation.ConnectionType("exampleConnectionType", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * fields: [{ + * name: "example", + * type: "string", + * }], + * }); + * ``` + * * ## Import * * Automations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/credential.ts b/sdk/nodejs/automation/credential.ts index f3a655ef0f..807284c31d 100644 --- a/sdk/nodejs/automation/credential.ts +++ b/sdk/nodejs/automation/credential.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Automation Credential. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleCredential = new azure.automation.Credential("exampleCredential", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * username: "example_user", + * password: "example_pwd", + * description: "This is an example credential", + * }); + * ``` + * * ## Import * * Automation Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/dateTimeVariable.ts b/sdk/nodejs/automation/dateTimeVariable.ts index 39fa87f834..e8881a1216 100644 --- a/sdk/nodejs/automation/dateTimeVariable.ts +++ b/sdk/nodejs/automation/dateTimeVariable.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a DateTime variable in Azure Automation * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleDateTimeVariable = new azure.automation.DateTimeVariable("exampleDateTimeVariable", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * value: "2019-04-24T21:40:54.074Z", + * }); + * ``` + * * ## Import * * Automation DateTime Variable can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/dscConfiguration.ts b/sdk/nodejs/automation/dscConfiguration.ts index 989fd0b5a8..4da2794d4f 100644 --- a/sdk/nodejs/automation/dscConfiguration.ts +++ b/sdk/nodejs/automation/dscConfiguration.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Automation DSC Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleDscConfiguration = new azure.automation.DscConfiguration("exampleDscConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * location: exampleResourceGroup.location, + * contentEmbedded: "configuration test {}", + * }); + * ``` + * * ## Import * * Automation DSC Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/dscNodeConfiguration.ts b/sdk/nodejs/automation/dscNodeConfiguration.ts index a0b68543b8..c955ed58da 100644 --- a/sdk/nodejs/automation/dscNodeConfiguration.ts +++ b/sdk/nodejs/automation/dscNodeConfiguration.ts @@ -7,6 +7,54 @@ import * as utilities from "../utilities"; /** * Manages a Automation DSC Node Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleDscConfiguration = new azure.automation.DscConfiguration("exampleDscConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * location: exampleResourceGroup.location, + * contentEmbedded: "configuration test {}", + * }); + * const exampleDscNodeConfiguration = new azure.automation.DscNodeConfiguration("exampleDscNodeConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * contentEmbedded: `instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref + * { + * ResourceID = "[File]bla"; + * Ensure = "Present"; + * Contents = "bogus Content"; + * DestinationPath = "c:\\\\bogus.txt"; + * ModuleName = "PSDesiredStateConfiguration"; + * SourceInfo = "::3::9::file"; + * ModuleVersion = "1.0"; + * ConfigurationName = "bla"; + * }; + * instance of OMI_ConfigurationDocument + * { + * Version="2.0.0"; + * MinimumCompatibleVersion = "1.0.0"; + * CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"}; + * Author="bogusAuthor"; + * GenerationDate="06/15/2018 14:06:24"; + * GenerationHost="bogusComputer"; + * Name="test"; + * }; + * `, + * }, { + * dependsOn: [exampleDscConfiguration], + * }); + * ``` + * * ## Import * * Automation DSC Node Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/getAccount.ts b/sdk/nodejs/automation/getAccount.ts index abd2cd6e06..cb050a9543 100644 --- a/sdk/nodejs/automation/getAccount.ts +++ b/sdk/nodejs/automation/getAccount.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Automation Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resources", + * }); + * export const automationAccountId = example.then(example => example.id); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -66,6 +79,19 @@ export interface GetAccountResult { } /** * Use this data source to access information about an existing Automation Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resources", + * }); + * export const automationAccountId = example.then(example => example.id); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/automation/getBoolVariable.ts b/sdk/nodejs/automation/getBoolVariable.ts index 9e1f14e04f..553e12df6b 100644 --- a/sdk/nodejs/automation/getBoolVariable.ts +++ b/sdk/nodejs/automation/getBoolVariable.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Automation Bool Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getBoolVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getBoolVariable(args: GetBoolVariableArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +75,20 @@ export interface GetBoolVariableResult { } /** * Use this data source to access information about an existing Automation Bool Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getBoolVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getBoolVariableOutput(args: GetBoolVariableOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBoolVariable(a, opts)) diff --git a/sdk/nodejs/automation/getDateTimeVariable.ts b/sdk/nodejs/automation/getDateTimeVariable.ts index 7f51b23f0d..1734cd95a6 100644 --- a/sdk/nodejs/automation/getDateTimeVariable.ts +++ b/sdk/nodejs/automation/getDateTimeVariable.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Automation Datetime Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getDateTimeVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getDateTimeVariable(args: GetDateTimeVariableArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +75,20 @@ export interface GetDateTimeVariableResult { } /** * Use this data source to access information about an existing Automation Datetime Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getDateTimeVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getDateTimeVariableOutput(args: GetDateTimeVariableOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDateTimeVariable(a, opts)) diff --git a/sdk/nodejs/automation/getIntVariable.ts b/sdk/nodejs/automation/getIntVariable.ts index 2d91bfdb2c..446f3c908a 100644 --- a/sdk/nodejs/automation/getIntVariable.ts +++ b/sdk/nodejs/automation/getIntVariable.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Automation Int Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getIntVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getIntVariable(args: GetIntVariableArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +75,20 @@ export interface GetIntVariableResult { } /** * Use this data source to access information about an existing Automation Int Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getIntVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getIntVariableOutput(args: GetIntVariableOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getIntVariable(a, opts)) diff --git a/sdk/nodejs/automation/getStringVariable.ts b/sdk/nodejs/automation/getStringVariable.ts index 07cec428da..5c8bcf028e 100644 --- a/sdk/nodejs/automation/getStringVariable.ts +++ b/sdk/nodejs/automation/getStringVariable.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Automation String Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getStringVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getStringVariable(args: GetStringVariableArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +75,20 @@ export interface GetStringVariableResult { } /** * Use this data source to access information about an existing Automation String Variable. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.automation.getStringVariable({ + * name: "tfex-example-var", + * resourceGroupName: "tfex-example-rg", + * automationAccountName: "tfex-example-account", + * }); + * export const variableId = example.then(example => example.id); + * ``` */ export function getStringVariableOutput(args: GetStringVariableOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getStringVariable(a, opts)) diff --git a/sdk/nodejs/automation/getVariables.ts b/sdk/nodejs/automation/getVariables.ts index 72f11d76de..fb89538000 100644 --- a/sdk/nodejs/automation/getVariables.ts +++ b/sdk/nodejs/automation/getVariables.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Use this data source to get all variables in an Automation Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.automation.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resources", + * }); + * const exampleVariables = exampleAccount.then(exampleAccount => azure.automation.getVariables({ + * automationAccountId: exampleAccount.id, + * })); + * export const stringVars = data.azurerm_automation_variable_string.example.string; + * ``` */ export function getVariables(args: GetVariablesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -64,6 +80,22 @@ export interface GetVariablesResult { } /** * Use this data source to get all variables in an Automation Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.automation.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resources", + * }); + * const exampleVariables = exampleAccount.then(exampleAccount => azure.automation.getVariables({ + * automationAccountId: exampleAccount.id, + * })); + * export const stringVars = data.azurerm_automation_variable_string.example.string; + * ``` */ export function getVariablesOutput(args: GetVariablesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVariables(a, opts)) diff --git a/sdk/nodejs/automation/hybridRunbookWorker.ts b/sdk/nodejs/automation/hybridRunbookWorker.ts index 01f5f0d889..f8a3196760 100644 --- a/sdk/nodejs/automation/hybridRunbookWorker.ts +++ b/sdk/nodejs/automation/hybridRunbookWorker.ts @@ -7,6 +7,70 @@ import * as utilities from "../utilities"; /** * Manages a Automation Hybrid Runbook Worker. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleHybridRunbookWorkerGroup = new azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["192.168.1.0/24"], + * location: exampleResourceGroup.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["192.168.1.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "vm-example", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * size: "Standard_B1s", + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * disablePasswordAuthentication: false, + * sourceImageReference: { + * publisher: "OpenLogic", + * offer: "CentOS", + * sku: "7.5", + * version: "latest", + * }, + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * networkInterfaceIds: [exampleNetworkInterface.id], + * }); + * const exampleHybridRunbookWorker = new azure.automation.HybridRunbookWorker("exampleHybridRunbookWorker", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * workerGroupName: exampleHybridRunbookWorkerGroup.name, + * vmResourceId: exampleLinuxVirtualMachine.id, + * workerId: "00000000-0000-0000-0000-000000000000", + * }); + * //unique uuid + * ``` + * * ## Import * * Automations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/hybridRunbookWorkerGroup.ts b/sdk/nodejs/automation/hybridRunbookWorkerGroup.ts index fcc7f8ca68..cd79c0e549 100644 --- a/sdk/nodejs/automation/hybridRunbookWorkerGroup.ts +++ b/sdk/nodejs/automation/hybridRunbookWorkerGroup.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages a Automation Hybrid Runbook Worker Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleHybridRunbookWorkerGroup = new azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * }); + * ``` + * * ## Import * * Automations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/intVariable.ts b/sdk/nodejs/automation/intVariable.ts index b0c679c1b4..198ec26890 100644 --- a/sdk/nodejs/automation/intVariable.ts +++ b/sdk/nodejs/automation/intVariable.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a integer variable in Azure Automation * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleIntVariable = new azure.automation.IntVariable("exampleIntVariable", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * value: 1234, + * }); + * ``` + * * ## Import * * Automation Int Variable can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/jobSchedule.ts b/sdk/nodejs/automation/jobSchedule.ts index b257d1a8cf..d4ac55db6e 100644 --- a/sdk/nodejs/automation/jobSchedule.ts +++ b/sdk/nodejs/automation/jobSchedule.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Links an Automation Runbook and Schedule. * + * ## Example Usage + * + * This is an example of just the Job Schedule. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.automation.JobSchedule("example", { + * automationAccountName: "tf-automation-account", + * parameters: { + * resourcegroup: "tf-rgr-vm", + * vmname: "TF-VM-01", + * }, + * resourceGroupName: "tf-rgr-automation", + * runbookName: "Get-VirtualMachine", + * scheduleName: "hour", + * }); + * ``` + * * ## Import * * Automation Job Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/module.ts b/sdk/nodejs/automation/module.ts index 63fb912cfd..88b32e786e 100644 --- a/sdk/nodejs/automation/module.ts +++ b/sdk/nodejs/automation/module.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a Automation Module. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleModule = new azure.automation.Module("exampleModule", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * moduleLink: { + * uri: "https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg", + * }, + * }); + * ``` + * * ## Import * * Automation Modules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/python3Package.ts b/sdk/nodejs/automation/python3Package.ts index 123e98ab21..21d6331b91 100644 --- a/sdk/nodejs/automation/python3Package.ts +++ b/sdk/nodejs/automation/python3Package.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a Automation Python3 Package. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "%[2]s"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const examplePython3Package = new azure.automation.Python3Package("examplePython3Package", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * contentUri: "https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz", + * contentVersion: "2.31.0", + * hashAlgorithm: "sha256", + * hashValue: "942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1", + * tags: { + * key: "foo", + * }, + * }); + * ``` + * * ## Import * * Automation Python3 Packages can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/runBook.ts b/sdk/nodejs/automation/runBook.ts index f688c2be08..500f139402 100644 --- a/sdk/nodejs/automation/runBook.ts +++ b/sdk/nodejs/automation/runBook.ts @@ -9,6 +9,59 @@ import * as utilities from "../utilities"; /** * Manages a Automation Runbook. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleRunBook = new azure.automation.RunBook("exampleRunBook", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * logVerbose: true, + * logProgress: true, + * description: "This is an example runbook", + * runbookType: "PowerShellWorkflow", + * publishContentLink: { + * uri: "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + * }, + * }); + * ``` + * ### Custom Content + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as local from "@pulumi/local"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleFile = local.getFile({ + * filename: `${path.module}/example.ps1`, + * }); + * const exampleRunBook = new azure.automation.RunBook("exampleRunBook", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * logVerbose: true, + * logProgress: true, + * description: "This is an example runbook", + * runbookType: "PowerShell", + * content: exampleFile.then(exampleFile => exampleFile.content), + * }); + * ``` + * * ## Import * * Automation Runbooks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/schedule.ts b/sdk/nodejs/automation/schedule.ts index 48726e9a1e..ab990e4280 100644 --- a/sdk/nodejs/automation/schedule.ts +++ b/sdk/nodejs/automation/schedule.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a Automation Schedule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleSchedule = new azure.automation.Schedule("exampleSchedule", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * frequency: "Week", + * interval: 1, + * timezone: "Australia/Perth", + * startTime: "2014-04-15T18:00:15+02:00", + * description: "This is an example schedule", + * weekDays: ["Friday"], + * }); + * ``` + * * ## Import * * Automation Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/softwareUpdateConfiguration.ts b/sdk/nodejs/automation/softwareUpdateConfiguration.ts index 66cac685f7..644020fbae 100644 --- a/sdk/nodejs/automation/softwareUpdateConfiguration.ts +++ b/sdk/nodejs/automation/softwareUpdateConfiguration.ts @@ -9,6 +9,52 @@ import * as utilities from "../utilities"; /** * Manages an Automation Software Update Configuraion. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleRunBook = new azure.automation.RunBook("exampleRunBook", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * logVerbose: true, + * logProgress: true, + * description: "This is a example runbook for terraform acceptance example", + * runbookType: "Python3", + * content: `# Some example content + * # for Terraform acceptance example + * `, + * tags: { + * ENV: "runbook_test", + * }, + * }); + * const exampleSoftwareUpdateConfiguration = new azure.automation.SoftwareUpdateConfiguration("exampleSoftwareUpdateConfiguration", { + * automationAccountId: exampleAccount.id, + * operatingSystem: "Linux", + * linuxes: [{ + * classificationIncluded: "Security", + * excludedPackages: ["apt"], + * includedPackages: ["vim"], + * reboot: "IfRequired", + * }], + * preTasks: [{ + * source: exampleRunBook.name, + * parameters: { + * COMPUTER_NAME: "Foo", + * }, + * }], + * duration: "PT2H2M2S", + * }); + * ``` + * * ## Import * * Automations Software Update Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/sourceControl.ts b/sdk/nodejs/automation/sourceControl.ts index d380d6978c..2e419c1a61 100644 --- a/sdk/nodejs/automation/sourceControl.ts +++ b/sdk/nodejs/automation/sourceControl.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages an Automation Source Control. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleSourceControl = new azure.automation.SourceControl("exampleSourceControl", { + * automationAccountId: exampleAccount.id, + * folderPath: "runbook", + * security: { + * token: "ghp_xxx", + * tokenType: "PersonalAccessToken", + * }, + * repositoryUrl: "https://github.com/foo/bat.git", + * sourceControlType: "GitHub", + * branch: "main", + * }); + * ``` + * * ## Import * * Automations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/stringVariable.ts b/sdk/nodejs/automation/stringVariable.ts index 0d0054a9c2..3d691e2b0b 100644 --- a/sdk/nodejs/automation/stringVariable.ts +++ b/sdk/nodejs/automation/stringVariable.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a string variable in Azure Automation * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleStringVariable = new azure.automation.StringVariable("exampleStringVariable", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * value: "Hello, Basic Test.", + * }); + * ``` + * * ## Import * * Automation String Variable can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/variableObject.ts b/sdk/nodejs/automation/variableObject.ts index c95533d71d..ac17ee72fa 100644 --- a/sdk/nodejs/automation/variableObject.ts +++ b/sdk/nodejs/automation/variableObject.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an object variable in Azure Automation * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleVariableObject = new azure.automation.VariableObject("exampleVariableObject", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * value: JSON.stringify({ + * greeting: "Hello, Terraform Basic Test.", + * language: "en", + * }), + * }); + * ``` + * * ## Import * * Automation Object Variable can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/watcher.ts b/sdk/nodejs/automation/watcher.ts index f29e4da749..6aa949834c 100644 --- a/sdk/nodejs/automation/watcher.ts +++ b/sdk/nodejs/automation/watcher.ts @@ -7,6 +7,50 @@ import * as utilities from "../utilities"; /** * Manages an Automation Wacher. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleHybridRunbookWorkerGroup = new azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * }); + * const exampleRunBook = new azure.automation.RunBook("exampleRunBook", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * logVerbose: true, + * logProgress: true, + * description: "This is an example runbook", + * runbookType: "PowerShellWorkflow", + * publishContentLink: { + * uri: "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + * }, + * }); + * const exampleWatcher = new azure.automation.Watcher("exampleWatcher", { + * automationAccountId: exampleAccount.id, + * location: "West Europe", + * scriptName: exampleRunBook.name, + * scriptRunOn: exampleHybridRunbookWorkerGroup.name, + * description: "example-watcher desc", + * executionFrequencyInSeconds: 42, + * tags: { + * foo: "bar", + * }, + * scriptParameters: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Automation Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/automation/webhook.ts b/sdk/nodejs/automation/webhook.ts index 75a810f12f..e50ddc13f9 100644 --- a/sdk/nodejs/automation/webhook.ts +++ b/sdk/nodejs/automation/webhook.ts @@ -7,6 +7,42 @@ import * as utilities from "../utilities"; /** * Manages an Automation Runbook's Webhook. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleRunBook = new azure.automation.RunBook("exampleRunBook", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * logVerbose: true, + * logProgress: true, + * description: "This is an example runbook", + * runbookType: "PowerShellWorkflow", + * publishContentLink: { + * uri: "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + * }, + * }); + * const exampleWebhook = new azure.automation.Webhook("exampleWebhook", { + * resourceGroupName: exampleResourceGroup.name, + * automationAccountName: exampleAccount.name, + * expiryTime: "2021-12-31T00:00:00Z", + * enabled: true, + * runbookName: exampleRunBook.name, + * parameters: { + * input: "parameter", + * }, + * }); + * ``` + * * ## Import * * Automation Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/avs/cluster.ts b/sdk/nodejs/avs/cluster.ts index e4adeb6531..de6ebe5900 100644 --- a/sdk/nodejs/avs/cluster.ts +++ b/sdk/nodejs/avs/cluster.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages a VMware Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePrivateCloud = new azure.avs.PrivateCloud("examplePrivateCloud", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "av36", + * managementCluster: { + * size: 3, + * }, + * networkSubnetCidr: "192.168.48.0/22", + * internetConnectionEnabled: false, + * nsxtPassword: "QazWsx13$Edc", + * vcenterPassword: "WsxEdc23$Rfv", + * }); + * const exampleCluster = new azure.avs.Cluster("exampleCluster", { + * vmwareCloudId: examplePrivateCloud.id, + * clusterNodeCount: 3, + * skuName: "av36", + * }); + * ``` + * * ## Import * * VMware Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/avs/expressRouteAuthorization.ts b/sdk/nodejs/avs/expressRouteAuthorization.ts index 05bf736402..fc411281bf 100644 --- a/sdk/nodejs/avs/expressRouteAuthorization.ts +++ b/sdk/nodejs/avs/expressRouteAuthorization.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an Express Route VMware Authorization. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePrivateCloud = new azure.avs.PrivateCloud("examplePrivateCloud", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "av36", + * managementCluster: { + * size: 3, + * }, + * networkSubnetCidr: "192.168.48.0/22", + * internetConnectionEnabled: false, + * nsxtPassword: "QazWsx13$Edc", + * vcenterPassword: "WsxEdc23$Rfv", + * }); + * const exampleExpressRouteAuthorization = new azure.avs.ExpressRouteAuthorization("exampleExpressRouteAuthorization", {privateCloudId: examplePrivateCloud.id}); + * ``` + * * ## Import * * VMware Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/avs/getPrivateCloud.ts b/sdk/nodejs/avs/getPrivateCloud.ts index e9073b99d1..0850f1297b 100644 --- a/sdk/nodejs/avs/getPrivateCloud.ts +++ b/sdk/nodejs/avs/getPrivateCloud.ts @@ -8,6 +8,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing VMware Private Cloud. + * + * ## Example Usage + * + * > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.avs.getPrivateCloud({ + * name: "existing-vmware-private-cloud", + * resourceGroupName: "existing-resgroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPrivateCloud(args: GetPrivateCloudArgs, opts?: pulumi.InvokeOptions): Promise { @@ -105,6 +120,21 @@ export interface GetPrivateCloudResult { } /** * Use this data source to access information about an existing VMware Private Cloud. + * + * ## Example Usage + * + * > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.avs.getPrivateCloud({ + * name: "existing-vmware-private-cloud", + * resourceGroupName: "existing-resgroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPrivateCloudOutput(args: GetPrivateCloudOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPrivateCloud(a, opts)) diff --git a/sdk/nodejs/avs/privateCloud.ts b/sdk/nodejs/avs/privateCloud.ts index 88610d57a2..f32fab5430 100644 --- a/sdk/nodejs/avs/privateCloud.ts +++ b/sdk/nodejs/avs/privateCloud.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages a VMware Private Cloud. * + * ## Example Usage + * + * > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePrivateCloud = new azure.avs.PrivateCloud("examplePrivateCloud", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "av36", + * managementCluster: { + * size: 3, + * }, + * networkSubnetCidr: "192.168.48.0/22", + * internetConnectionEnabled: false, + * nsxtPassword: "QazWsx13$Edc", + * vcenterPassword: "WsxEdc23$Rfv", + * }); + * ``` + * * ## Import * * VMware Private Clouds can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/backup/containerStorageAccount.ts b/sdk/nodejs/backup/containerStorageAccount.ts index a7e8a5e325..22cc44e1f3 100644 --- a/sdk/nodejs/backup/containerStorageAccount.ts +++ b/sdk/nodejs/backup/containerStorageAccount.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages registration of a storage account with Azure Backup. Storage accounts must be registered with an Azure Recovery Vault in order to backup file shares within the storage account. Registering a storage account with a vault creates what is known as a protection container within Azure Recovery Services. Once the container is created, Azure file shares within the storage account can be backed up using the `azure.backup.ProtectedFileShare` resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: example.location, + * resourceGroupName: example.name, + * sku: "Standard", + * }); + * const sa = new azure.storage.Account("sa", { + * location: example.location, + * resourceGroupName: example.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const container = new azure.backup.ContainerStorageAccount("container", { + * resourceGroupName: example.name, + * recoveryVaultName: vault.name, + * storageAccountId: sa.id, + * }); + * ``` + * * ## Import * * Backup Storage Account Containers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/backup/getPolicyFileshare.ts b/sdk/nodejs/backup/getPolicyFileshare.ts index 861a6a5cbe..3384607a67 100644 --- a/sdk/nodejs/backup/getPolicyFileshare.ts +++ b/sdk/nodejs/backup/getPolicyFileshare.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing File Share Backup Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const policy = azure.backup.getPolicyFileshare({ + * name: "policy", + * recoveryVaultName: "recovery_vault", + * resourceGroupName: "resource_group", + * }); + * ``` */ export function getPolicyFileshare(args: GetPolicyFileshareArgs, opts?: pulumi.InvokeOptions): Promise { @@ -49,6 +62,19 @@ export interface GetPolicyFileshareResult { } /** * Use this data source to access information about an existing File Share Backup Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const policy = azure.backup.getPolicyFileshare({ + * name: "policy", + * recoveryVaultName: "recovery_vault", + * resourceGroupName: "resource_group", + * }); + * ``` */ export function getPolicyFileshareOutput(args: GetPolicyFileshareOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPolicyFileshare(a, opts)) diff --git a/sdk/nodejs/backup/getPolicyVM.ts b/sdk/nodejs/backup/getPolicyVM.ts index 6f01ab7f3a..6f2540835a 100644 --- a/sdk/nodejs/backup/getPolicyVM.ts +++ b/sdk/nodejs/backup/getPolicyVM.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing VM Backup Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const policy = azure.backup.getPolicyVM({ + * name: "policy", + * recoveryVaultName: "recovery_vault", + * resourceGroupName: "resource_group", + * }); + * ``` */ export function getPolicyVM(args: GetPolicyVMArgs, opts?: pulumi.InvokeOptions): Promise { @@ -49,6 +62,19 @@ export interface GetPolicyVMResult { } /** * Use this data source to access information about an existing VM Backup Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const policy = azure.backup.getPolicyVM({ + * name: "policy", + * recoveryVaultName: "recovery_vault", + * resourceGroupName: "resource_group", + * }); + * ``` */ export function getPolicyVMOutput(args: GetPolicyVMOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPolicyVM(a, opts)) diff --git a/sdk/nodejs/backup/policyFileShare.ts b/sdk/nodejs/backup/policyFileShare.ts index bb5181a4cb..9c56b1ed19 100644 --- a/sdk/nodejs/backup/policyFileShare.ts +++ b/sdk/nodejs/backup/policyFileShare.ts @@ -9,6 +9,58 @@ import * as utilities from "../utilities"; /** * Manages an Azure File Share Backup Policy within a Recovery Services vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const policy = new azure.backup.PolicyFileShare("policy", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: exampleVault.name, + * timezone: "UTC", + * backup: { + * frequency: "Daily", + * time: "23:00", + * }, + * retentionDaily: { + * count: 10, + * }, + * retentionWeekly: { + * count: 7, + * weekdays: [ + * "Sunday", + * "Wednesday", + * "Friday", + * "Saturday", + * ], + * }, + * retentionMonthly: { + * count: 7, + * weekdays: [ + * "Sunday", + * "Wednesday", + * ], + * weeks: [ + * "First", + * "Last", + * ], + * }, + * retentionYearly: { + * count: 7, + * weekdays: ["Sunday"], + * weeks: ["Last"], + * months: ["January"], + * }, + * }); + * ``` + * * ## Import * * Azure File Share Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/backup/policyVM.ts b/sdk/nodejs/backup/policyVM.ts index b1efa8a01d..919807f4d4 100644 --- a/sdk/nodejs/backup/policyVM.ts +++ b/sdk/nodejs/backup/policyVM.ts @@ -9,6 +9,58 @@ import * as utilities from "../utilities"; /** * Manages an Azure Backup VM Backup Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const examplePolicyVM = new azure.backup.PolicyVM("examplePolicyVM", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: exampleVault.name, + * timezone: "UTC", + * backup: { + * frequency: "Daily", + * time: "23:00", + * }, + * retentionDaily: { + * count: 10, + * }, + * retentionWeekly: { + * count: 42, + * weekdays: [ + * "Sunday", + * "Wednesday", + * "Friday", + * "Saturday", + * ], + * }, + * retentionMonthly: { + * count: 7, + * weekdays: [ + * "Sunday", + * "Wednesday", + * ], + * weeks: [ + * "First", + * "Last", + * ], + * }, + * retentionYearly: { + * count: 77, + * weekdays: ["Sunday"], + * weeks: ["Last"], + * months: ["January"], + * }, + * }); + * ``` + * * ## Import * * VM Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/backup/policyVMWorkload.ts b/sdk/nodejs/backup/policyVMWorkload.ts index 6acb5a060b..1df32b187e 100644 --- a/sdk/nodejs/backup/policyVMWorkload.ts +++ b/sdk/nodejs/backup/policyVMWorkload.ts @@ -9,6 +9,51 @@ import * as utilities from "../utilities"; /** * Manages an Azure VM Workload Backup Policy within a Recovery Services vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * softDeleteEnabled: false, + * }); + * const examplePolicyVMWorkload = new azure.backup.PolicyVMWorkload("examplePolicyVMWorkload", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: exampleVault.name, + * workloadType: "SQLDataBase", + * settings: { + * timeZone: "UTC", + * compressionEnabled: false, + * }, + * protectionPolicies: [ + * { + * policyType: "Full", + * backup: { + * frequency: "Daily", + * time: "15:00", + * }, + * retentionDaily: { + * count: 8, + * }, + * }, + * { + * policyType: "Log", + * backup: { + * frequencyInMinutes: 15, + * }, + * simpleRetention: { + * count: 8, + * }, + * }, + * ], + * }); + * ``` + * * ## Import * * Azure VM Workload Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/backup/protectedFileShare.ts b/sdk/nodejs/backup/protectedFileShare.ts index db27138cd4..13772d77fb 100644 --- a/sdk/nodejs/backup/protectedFileShare.ts +++ b/sdk/nodejs/backup/protectedFileShare.ts @@ -7,6 +7,53 @@ import * as utilities from "../utilities"; /** * Manages an Azure Backup Protected File Share to enable backups for file shares within an Azure Storage Account * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const sa = new azure.storage.Account("sa", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleShare = new azure.storage.Share("exampleShare", { + * storageAccountName: sa.name, + * quota: 1, + * }); + * const protection_container = new azure.backup.ContainerStorageAccount("protection-container", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: vault.name, + * storageAccountId: sa.id, + * }); + * const examplePolicyFileShare = new azure.backup.PolicyFileShare("examplePolicyFileShare", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: vault.name, + * backup: { + * frequency: "Daily", + * time: "23:00", + * }, + * retentionDaily: { + * count: 10, + * }, + * }); + * const share1 = new azure.backup.ProtectedFileShare("share1", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: vault.name, + * sourceStorageAccountId: protection_container.storageAccountId, + * sourceFileShareName: exampleShare.name, + * backupPolicyId: examplePolicyFileShare.id, + * }); + * ``` + * * ## Import * * Azure Backup Protected File Shares can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/backup/protectedVM.ts b/sdk/nodejs/backup/protectedVM.ts index d9aa392bcc..cd214d1883 100644 --- a/sdk/nodejs/backup/protectedVM.ts +++ b/sdk/nodejs/backup/protectedVM.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages Azure Backup for an Azure VM * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const examplePolicyVM = new azure.backup.PolicyVM("examplePolicyVM", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: exampleVault.name, + * backup: { + * frequency: "Daily", + * time: "23:00", + * }, + * retentionDaily: { + * count: 10, + * }, + * }); + * const exampleVirtualMachine = azure.compute.getVirtualMachineOutput({ + * name: "example-vm", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const vm1 = new azure.backup.ProtectedVM("vm1", { + * resourceGroupName: exampleResourceGroup.name, + * recoveryVaultName: exampleVault.name, + * sourceVmId: exampleVirtualMachine.apply(exampleVirtualMachine => exampleVirtualMachine.id), + * backupPolicyId: examplePolicyVM.id, + * }); + * ``` + * * ## Import * * Recovery Services Protected VMs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/batch/account.ts b/sdk/nodejs/batch/account.ts index 95ea69c1a5..258c9c5cc8 100644 --- a/sdk/nodejs/batch/account.ts +++ b/sdk/nodejs/batch/account.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages an Azure Batch account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleBatch_accountAccount = new azure.batch.Account("exampleBatch/accountAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * poolAllocationMode: "BatchService", + * storageAccountId: exampleAccount.id, + * storageAccountAuthenticationMode: "StorageKeys", + * tags: { + * env: "test", + * }, + * }); + * ``` + * * ## Import * * Batch Account can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/batch/application.ts b/sdk/nodejs/batch/application.ts index 008f271e2a..d01f888430 100644 --- a/sdk/nodejs/batch/application.ts +++ b/sdk/nodejs/batch/application.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages Azure Batch Application instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleBatch_accountAccount = new azure.batch.Account("exampleBatch/accountAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * poolAllocationMode: "BatchService", + * storageAccountId: exampleAccount.id, + * storageAccountAuthenticationMode: "StorageKeys", + * }); + * const exampleApplication = new azure.batch.Application("exampleApplication", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleBatch / accountAccount.name, + * }); + * ``` + * * ## Import * * Batch Applications can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/batch/certificate.ts b/sdk/nodejs/batch/certificate.ts index 823dc53d96..be189a226f 100644 --- a/sdk/nodejs/batch/certificate.ts +++ b/sdk/nodejs/batch/certificate.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages a certificate in an Azure Batch account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleBatch_accountAccount = new azure.batch.Account("exampleBatch/accountAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * poolAllocationMode: "BatchService", + * storageAccountId: exampleAccount.id, + * storageAccountAuthenticationMode: "StorageKeys", + * tags: { + * env: "test", + * }, + * }); + * const exampleCertificate = new azure.batch.Certificate("exampleCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleBatch / accountAccount.name, + * certificate: Buffer.from(fs.readFileSync("certificate.pfx"), 'binary').toString('base64'), + * format: "Pfx", + * password: "password", + * thumbprint: "42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + * thumbprintAlgorithm: "SHA1", + * }); + * ``` + * * ## Import * * Batch Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/batch/getAccount.ts b/sdk/nodejs/batch/getAccount.ts index a364a37168..72ac831005 100644 --- a/sdk/nodejs/batch/getAccount.ts +++ b/sdk/nodejs/batch/getAccount.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Batch Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getAccount({ + * name: "testbatchaccount", + * resourceGroupName: "test", + * }); + * export const poolAllocationMode = example.then(example => example.poolAllocationMode); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -89,6 +102,19 @@ export interface GetAccountResult { } /** * Use this data source to access information about an existing Batch Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getAccount({ + * name: "testbatchaccount", + * resourceGroupName: "test", + * }); + * export const poolAllocationMode = example.then(example => example.poolAllocationMode); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/batch/getApplication.ts b/sdk/nodejs/batch/getApplication.ts index d0b3b2d5aa..ab1b06d069 100644 --- a/sdk/nodejs/batch/getApplication.ts +++ b/sdk/nodejs/batch/getApplication.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Batch Application instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getApplication({ + * name: "testapplication", + * resourceGroupName: "test", + * accountName: "testbatchaccount", + * }); + * export const batchApplicationId = example.then(example => example.id); + * ``` */ export function getApplication(args: GetApplicationArgs, opts?: pulumi.InvokeOptions): Promise { @@ -64,6 +78,20 @@ export interface GetApplicationResult { } /** * Use this data source to access information about an existing Batch Application instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getApplication({ + * name: "testapplication", + * resourceGroupName: "test", + * accountName: "testbatchaccount", + * }); + * export const batchApplicationId = example.then(example => example.id); + * ``` */ export function getApplicationOutput(args: GetApplicationOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getApplication(a, opts)) diff --git a/sdk/nodejs/batch/getCertificate.ts b/sdk/nodejs/batch/getCertificate.ts index dc58c4e9a2..95ba58401b 100644 --- a/sdk/nodejs/batch/getCertificate.ts +++ b/sdk/nodejs/batch/getCertificate.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing certificate in a Batch Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getCertificate({ + * name: "SHA1-42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + * accountName: "examplebatchaccount", + * resourceGroupName: "example", + * }); + * export const thumbprint = example.then(example => example.thumbprint); + * ``` */ export function getCertificate(args: GetCertificateArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +79,20 @@ export interface GetCertificateResult { } /** * Use this data source to access information about an existing certificate in a Batch Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getCertificate({ + * name: "SHA1-42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + * accountName: "examplebatchaccount", + * resourceGroupName: "example", + * }); + * export const thumbprint = example.then(example => example.thumbprint); + * ``` */ export function getCertificateOutput(args: GetCertificateOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCertificate(a, opts)) diff --git a/sdk/nodejs/batch/getPool.ts b/sdk/nodejs/batch/getPool.ts index a9c5bfb592..f2c2dd9ef4 100644 --- a/sdk/nodejs/batch/getPool.ts +++ b/sdk/nodejs/batch/getPool.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Batch pool + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getPool({ + * accountName: "testbatchaccount", + * name: "testbatchpool", + * resourceGroupName: "test", + * }); + * ``` */ export function getPool(args: GetPoolArgs, opts?: pulumi.InvokeOptions): Promise { @@ -137,6 +150,19 @@ export interface GetPoolResult { } /** * Use this data source to access information about an existing Batch pool + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.batch.getPool({ + * accountName: "testbatchaccount", + * name: "testbatchpool", + * resourceGroupName: "test", + * }); + * ``` */ export function getPoolOutput(args: GetPoolOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPool(a, opts)) diff --git a/sdk/nodejs/batch/job.ts b/sdk/nodejs/batch/job.ts index af2168d50b..7da2b5bfe2 100644 --- a/sdk/nodejs/batch/job.ts +++ b/sdk/nodejs/batch/job.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages a Batch Job. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAccount = new azure.batch.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const examplePool = new azure.batch.Pool("examplePool", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * nodeAgentSkuId: "batch.node.ubuntu 16.04", + * vmSize: "Standard_A1", + * fixedScale: { + * targetDedicatedNodes: 1, + * }, + * storageImageReference: { + * publisher: "Canonical", + * offer: "UbuntuServer", + * sku: "16.04.0-LTS", + * version: "latest", + * }, + * }); + * const exampleJob = new azure.batch.Job("exampleJob", {batchPoolId: examplePool.id}); + * ``` + * * ## Import * * Batch Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/batch/pool.ts b/sdk/nodejs/batch/pool.ts index eac6c9abbb..adb6ce6acd 100644 --- a/sdk/nodejs/batch/pool.ts +++ b/sdk/nodejs/batch/pool.ts @@ -9,6 +9,89 @@ import * as utilities from "../utilities"; /** * Manages an Azure Batch pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleBatch_accountAccount = new azure.batch.Account("exampleBatch/accountAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * poolAllocationMode: "BatchService", + * storageAccountId: exampleAccount.id, + * storageAccountAuthenticationMode: "StorageKeys", + * tags: { + * env: "test", + * }, + * }); + * const exampleCertificate = new azure.batch.Certificate("exampleCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleBatch / accountAccount.name, + * certificate: Buffer.from(fs.readFileSync("certificate.cer"), 'binary').toString('base64'), + * format: "Cer", + * thumbprint: "312d31a79fa0cef49c00f769afc2b73e9f4edf34", + * thumbprintAlgorithm: "SHA1", + * }); + * const examplePool = new azure.batch.Pool("examplePool", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleBatch / accountAccount.name, + * displayName: "Test Acc Pool Auto", + * vmSize: "Standard_A1", + * nodeAgentSkuId: "batch.node.ubuntu 20.04", + * autoScale: { + * evaluationInterval: "PT15M", + * formula: ` startingNumberOfVMs = 1; + * maxNumberofVMs = 25; + * pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(180 * TimeInterval_Second); + * pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(180 * TimeInterval_Second)); + * $TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples); + * `, + * }, + * storageImageReference: { + * publisher: "microsoft-azure-batch", + * offer: "ubuntu-server-container", + * sku: "20-04-lts", + * version: "latest", + * }, + * containerConfiguration: { + * type: "DockerCompatible", + * containerRegistries: [{ + * registryServer: "docker.io", + * userName: "login", + * password: "apassword", + * }], + * }, + * startTask: { + * commandLine: "echo 'Hello World from $env'", + * taskRetryMaximum: 1, + * waitForSuccess: true, + * commonEnvironmentProperties: { + * env: "TEST", + * }, + * userIdentity: { + * autoUser: { + * elevationLevel: "NonAdmin", + * scope: "Task", + * }, + * }, + * }, + * certificates: [{ + * id: exampleCertificate.id, + * storeLocation: "CurrentUser", + * visibilities: ["StartTask"], + * }], + * }); + * ``` + * * ## Import * * Batch Pools can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/billing/accountCostManagementExport.ts b/sdk/nodejs/billing/accountCostManagementExport.ts index 2d5e9bdc09..50f76d535e 100644 --- a/sdk/nodejs/billing/accountCostManagementExport.ts +++ b/sdk/nodejs/billing/accountCostManagementExport.ts @@ -9,6 +9,36 @@ import * as utilities from "../utilities"; /** * Manages a Cost Management Export for a Billing Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name}); + * const exampleAccountCostManagementExport = new azure.billing.AccountCostManagementExport("exampleAccountCostManagementExport", { + * billingAccountId: "example", + * recurrenceType: "Monthly", + * recurrencePeriodStartDate: "2020-08-18T00:00:00Z", + * recurrencePeriodEndDate: "2020-09-18T00:00:00Z", + * exportDataStorageLocation: { + * containerId: exampleContainer.resourceManagerId, + * rootFolderPath: "/root/updated", + * }, + * exportDataOptions: { + * type: "Usage", + * timeFrame: "WeekToDate", + * }, + * }); + * ``` + * * ## Import * * Billing Account Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/billing/getEnrollmentAccountScope.ts b/sdk/nodejs/billing/getEnrollmentAccountScope.ts index f5040abb70..bd8c36baa6 100644 --- a/sdk/nodejs/billing/getEnrollmentAccountScope.ts +++ b/sdk/nodejs/billing/getEnrollmentAccountScope.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Enrollment Account Billing Scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.billing.getEnrollmentAccountScope({ + * billingAccountName: "existing", + * enrollmentAccountName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getEnrollmentAccountScope(args: GetEnrollmentAccountScopeArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +56,19 @@ export interface GetEnrollmentAccountScopeResult { } /** * Use this data source to access information about an existing Enrollment Account Billing Scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.billing.getEnrollmentAccountScope({ + * billingAccountName: "existing", + * enrollmentAccountName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getEnrollmentAccountScopeOutput(args: GetEnrollmentAccountScopeOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEnrollmentAccountScope(a, opts)) diff --git a/sdk/nodejs/billing/getMcaAccountScope.ts b/sdk/nodejs/billing/getMcaAccountScope.ts index edfb4cc8a8..16aa49e165 100644 --- a/sdk/nodejs/billing/getMcaAccountScope.ts +++ b/sdk/nodejs/billing/getMcaAccountScope.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access an ID for your MCA Account billing scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.billing.getMcaAccountScope({ + * billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + * billingProfileName: "PE2Q-NOIT-BG7-TGB", + * invoiceSectionName: "MTT4-OBS7-PJA-TGB", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getMcaAccountScope(args: GetMcaAccountScopeArgs, opts?: pulumi.InvokeOptions): Promise { @@ -49,6 +63,20 @@ export interface GetMcaAccountScopeResult { } /** * Use this data source to access an ID for your MCA Account billing scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.billing.getMcaAccountScope({ + * billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + * billingProfileName: "PE2Q-NOIT-BG7-TGB", + * invoiceSectionName: "MTT4-OBS7-PJA-TGB", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getMcaAccountScopeOutput(args: GetMcaAccountScopeOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMcaAccountScope(a, opts)) diff --git a/sdk/nodejs/billing/getMpaAccountScope.ts b/sdk/nodejs/billing/getMpaAccountScope.ts index 94e08157a7..e1585eec0f 100644 --- a/sdk/nodejs/billing/getMpaAccountScope.ts +++ b/sdk/nodejs/billing/getMpaAccountScope.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access an ID for your MPA Account billing scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.billing.getMpaAccountScope({ + * billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + * customerName: "2281f543-7321-4cf9-1e23-edb4Oc31a31c", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getMpaAccountScope(args: GetMpaAccountScopeArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +56,19 @@ export interface GetMpaAccountScopeResult { } /** * Use this data source to access an ID for your MPA Account billing scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.billing.getMpaAccountScope({ + * billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + * customerName: "2281f543-7321-4cf9-1e23-edb4Oc31a31c", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getMpaAccountScopeOutput(args: GetMpaAccountScopeOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMpaAccountScope(a, opts)) diff --git a/sdk/nodejs/blueprint/assignment.ts b/sdk/nodejs/blueprint/assignment.ts index 87f4d1a6ab..31a5326128 100644 --- a/sdk/nodejs/blueprint/assignment.ts +++ b/sdk/nodejs/blueprint/assignment.ts @@ -13,6 +13,73 @@ import * as utilities from "../utilities"; * * > **NOTE:** Azure Blueprint Assignments can only be applied to Subscriptions. Assignments to Management Groups is not currently supported by the service or by this provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleSubscription = azure.core.getSubscription({}); + * const exampleDefinition = exampleSubscription.then(exampleSubscription => azure.blueprint.getDefinition({ + * name: "exampleBlueprint", + * scopeId: exampleSubscription.id, + * })); + * const examplePublishedVersion = Promise.all([exampleDefinition, exampleDefinition]).then(([exampleDefinition, exampleDefinition1]) => azure.blueprint.getPublishedVersion({ + * scopeId: exampleDefinition.scopeId, + * blueprintName: exampleDefinition1.name, + * version: "v1.0.0", + * })); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", { + * location: "West Europe", + * tags: { + * Environment: "example", + * }, + * }); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const operator = new azure.authorization.Assignment("operator", { + * scope: exampleSubscription.then(exampleSubscription => exampleSubscription.id), + * roleDefinitionName: "Blueprint Operator", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const owner = new azure.authorization.Assignment("owner", { + * scope: exampleSubscription.then(exampleSubscription => exampleSubscription.id), + * roleDefinitionName: "Owner", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const exampleAssignment = new azure.blueprint.Assignment("exampleAssignment", { + * targetSubscriptionId: exampleSubscription.then(exampleSubscription => exampleSubscription.id), + * versionId: examplePublishedVersion.then(examplePublishedVersion => examplePublishedVersion.id), + * location: exampleResourceGroup.location, + * lockMode: "AllResourcesDoNotDelete", + * lockExcludePrincipals: [current.then(current => current.objectId)], + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * resourceGroups: ` { + * "ResourceGroup": { + * "name": "exampleRG-bp" + * } + * } + * `, + * parameterValues: ` { + * "allowedlocationsforresourcegroups_listOfAllowedLocations": { + * "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"] + * } + * } + * `, + * }, { + * dependsOn: [ + * operator, + * owner, + * ], + * }); + * ``` + * * ## Import * * Azure Blueprint Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/blueprint/getDefinition.ts b/sdk/nodejs/blueprint/getDefinition.ts index 7359260f8e..898649c28e 100644 --- a/sdk/nodejs/blueprint/getDefinition.ts +++ b/sdk/nodejs/blueprint/getDefinition.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing Azure Blueprint Definition * * > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const root = current.then(current => azure.management.getGroup({ + * name: current.tenantId, + * })); + * const example = root.then(root => azure.blueprint.getDefinition({ + * name: "exampleManagementGroupBP", + * scopeId: root.id, + * })); + * ``` */ export function getDefinition(args: GetDefinitionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -71,6 +87,22 @@ export interface GetDefinitionResult { * Use this data source to access information about an existing Azure Blueprint Definition * * > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const root = current.then(current => azure.management.getGroup({ + * name: current.tenantId, + * })); + * const example = root.then(root => azure.blueprint.getDefinition({ + * name: "exampleManagementGroupBP", + * scopeId: root.id, + * })); + * ``` */ export function getDefinitionOutput(args: GetDefinitionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDefinition(a, opts)) diff --git a/sdk/nodejs/blueprint/getPublishedVersion.ts b/sdk/nodejs/blueprint/getPublishedVersion.ts index 56d6e20842..9730dcd50e 100644 --- a/sdk/nodejs/blueprint/getPublishedVersion.ts +++ b/sdk/nodejs/blueprint/getPublishedVersion.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing Blueprint Published Version * * > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const test = current.then(current => azure.blueprint.getPublishedVersion({ + * scopeId: current.id, + * blueprintName: "exampleBluePrint", + * version: "dev_v2.3", + * })); + * ``` */ export function getPublishedVersion(args: GetPublishedVersionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -71,6 +85,20 @@ export interface GetPublishedVersionResult { * Use this data source to access information about an existing Blueprint Published Version * * > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const test = current.then(current => azure.blueprint.getPublishedVersion({ + * scopeId: current.id, + * blueprintName: "exampleBluePrint", + * version: "dev_v2.3", + * })); + * ``` */ export function getPublishedVersionOutput(args: GetPublishedVersionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPublishedVersion(a, opts)) diff --git a/sdk/nodejs/bot/channelAlexa.ts b/sdk/nodejs/bot/channelAlexa.ts index c0f68883d0..0ce4474dbf 100644 --- a/sdk/nodejs/bot/channelAlexa.ts +++ b/sdk/nodejs/bot/channelAlexa.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; * * > **Note** A bot can only have a single Alexa Channel associated with it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelAlexa = new azure.bot.ChannelAlexa("exampleChannelAlexa", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * skillId: "amzn1.ask.skill.00000000-0000-0000-0000-000000000000", + * }); + * ``` + * * ## Import * * The Alexa Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelDirectLine.ts b/sdk/nodejs/bot/channelDirectLine.ts index 000f098995..ac4217cff4 100644 --- a/sdk/nodejs/bot/channelDirectLine.ts +++ b/sdk/nodejs/bot/channelDirectLine.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Directline integration for a Bot Channel * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelDirectLine = new azure.bot.ChannelDirectLine("exampleChannelDirectLine", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * sites: [{ + * name: "default", + * enabled: true, + * }], + * }); + * ``` + * * ## Import * * The Directline Channel for a Bot can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelDirectLineSpeech.ts b/sdk/nodejs/bot/channelDirectLineSpeech.ts index ba30bd1de1..e7cd631e67 100644 --- a/sdk/nodejs/bot/channelDirectLineSpeech.ts +++ b/sdk/nodejs/bot/channelDirectLineSpeech.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages a Direct Line Speech integration for a Bot Channel * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cognitive.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "SpeechServices", + * skuName: "S0", + * }); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelDirectLineSpeech = new azure.bot.ChannelDirectLineSpeech("exampleChannelDirectLineSpeech", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * cognitiveServiceLocation: exampleAccount.location, + * cognitiveServiceAccessKey: exampleAccount.primaryAccessKey, + * }); + * ``` + * * ## Import * * Direct Line Speech Channels can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelEmail.ts b/sdk/nodejs/bot/channelEmail.ts index 2d4530d65f..f6852694cd 100644 --- a/sdk/nodejs/bot/channelEmail.ts +++ b/sdk/nodejs/bot/channelEmail.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; * * > **Note** A bot can only have a single Email Channel associated with it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelEmail = new azure.bot.ChannelEmail("exampleChannelEmail", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * emailAddress: "example.com", + * emailPassword: "123456", + * }); + * ``` + * * ## Import * * The Email Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelFacebook.ts b/sdk/nodejs/bot/channelFacebook.ts index aa4dd3fade..9eb7646e9f 100644 --- a/sdk/nodejs/bot/channelFacebook.ts +++ b/sdk/nodejs/bot/channelFacebook.ts @@ -11,6 +11,33 @@ import * as utilities from "../utilities"; * * > **Note** A bot can only have a single Facebook Channel associated with it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelFacebook = new azure.bot.ChannelFacebook("exampleChannelFacebook", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * facebookApplicationId: "563490254873576", + * facebookApplicationSecret: "8976d2536445ad5b976dee8437b9beb0", + * pages: [{ + * id: "876248795081953", + * accessToken: "CGGCec3UAFPMBAKwK3Ft8SEpO8ZCuvpNBI5DClaJCDfqJj2BgEHCKxcY0FDarmUQap6XxpZC9GWCW4nZCzjcKosAZAP7SO44X8Q8gAntbDIXgYUBGp9xtS8wUkwgKPobUePcOOVFkvClxvYZByuiQxoTiK9fQ9jZCPEorbmZCsKDZAx4VLnrNwCTZAPUwXxO61gfq4ZD", + * }], + * }); + * ``` + * * ## Import * * The Facebook Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelLine.ts b/sdk/nodejs/bot/channelLine.ts index 9de0d60594..64be94bfc1 100644 --- a/sdk/nodejs/bot/channelLine.ts +++ b/sdk/nodejs/bot/channelLine.ts @@ -11,6 +11,31 @@ import * as utilities from "../utilities"; * * > **Note** A bot can only have a single Line Channel associated with it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelLine = new azure.bot.ChannelLine("exampleChannelLine", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * lineChannels: [{ + * accessToken: "asdfdsdfTYUIOIoj1231hkjhk", + * secret: "aagfdgfd123567", + * }], + * }); + * ``` + * * ## Import * * The Line Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelSlack.ts b/sdk/nodejs/bot/channelSlack.ts index 51970b7628..055cf9ebb5 100644 --- a/sdk/nodejs/bot/channelSlack.ts +++ b/sdk/nodejs/bot/channelSlack.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; * * > **Note** A bot can only have a single Slack Channel associated with it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelSlack = new azure.bot.ChannelSlack("exampleChannelSlack", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * clientId: "exampleId", + * clientSecret: "exampleSecret", + * verificationToken: "exampleVerificationToken", + * }); + * ``` + * * ## Import * * The Slack Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelSms.ts b/sdk/nodejs/bot/channelSms.ts index d163a14da9..f354a9a43f 100644 --- a/sdk/nodejs/bot/channelSms.ts +++ b/sdk/nodejs/bot/channelSms.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; * * > **Note** A bot can only have a single SMS Channel associated with it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelSms = new azure.bot.ChannelSms("exampleChannelSms", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * smsChannelAccountSecurityId: "BG61f7cf5157f439b084e98256409c2815", + * smsChannelAuthToken: "jh8980432610052ed4e29565c5e232f", + * phoneNumber: "+12313803556", + * }); + * ``` + * * ## Import * * The SMS Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelTeams.ts b/sdk/nodejs/bot/channelTeams.ts index 92da8209e9..0cde02957d 100644 --- a/sdk/nodejs/bot/channelTeams.ts +++ b/sdk/nodejs/bot/channelTeams.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; * * > **Note** A bot can only have a single MS Teams Channel associated with it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelTeams = new azure.bot.ChannelTeams("exampleChannelTeams", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * The Microsoft Teams Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelWebChat.ts b/sdk/nodejs/bot/channelWebChat.ts index 92256adaaa..282df6af3a 100644 --- a/sdk/nodejs/bot/channelWebChat.ts +++ b/sdk/nodejs/bot/channelWebChat.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a Web Chat integration for a Bot Channel * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleChannelWebChat = new azure.bot.ChannelWebChat("exampleChannelWebChat", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * sites: [{ + * name: "TestSite", + * }], + * }); + * ``` + * * ## Import * * Web Chat Channels can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/channelsRegistration.ts b/sdk/nodejs/bot/channelsRegistration.ts index 8b8b7196d9..805bcf88d1 100644 --- a/sdk/nodejs/bot/channelsRegistration.ts +++ b/sdk/nodejs/bot/channelsRegistration.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Bot Channels Registration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * ``` + * * ## Import * * Bot Channels Registration can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/connection.ts b/sdk/nodejs/bot/connection.ts index 2a55c64f6a..6f3a6f989a 100644 --- a/sdk/nodejs/bot/connection.ts +++ b/sdk/nodejs/bot/connection.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a Bot Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("exampleChannelsRegistration", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * const exampleConnection = new azure.bot.Connection("exampleConnection", { + * botName: exampleChannelsRegistration.name, + * location: exampleChannelsRegistration.location, + * resourceGroupName: exampleResourceGroup.name, + * serviceProviderName: "box", + * clientId: "exampleId", + * clientSecret: "exampleSecret", + * }); + * ``` + * * ## Import * * Bot Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/healthbot.ts b/sdk/nodejs/bot/healthbot.ts index 70e27666e3..6e89f1e67e 100644 --- a/sdk/nodejs/bot/healthbot.ts +++ b/sdk/nodejs/bot/healthbot.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manages a Healthbot Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleHealthbot = new azure.bot.Healthbot("exampleHealthbot", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "F0", + * }); + * ``` + * * ## Import * * Healthbot Service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/serviceAzureBot.ts b/sdk/nodejs/bot/serviceAzureBot.ts index 7088f36cdc..3f7e5623c4 100644 --- a/sdk/nodejs/bot/serviceAzureBot.ts +++ b/sdk/nodejs/bot/serviceAzureBot.ts @@ -7,6 +7,43 @@ import * as utilities from "../utilities"; /** * Manages an Azure Bot Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleApiKey = new azure.appinsights.ApiKey("exampleApiKey", { + * applicationInsightsId: exampleInsights.id, + * readPermissions: [ + * "aggregate", + * "api", + * "draft", + * "extendqueries", + * "search", + * ], + * }); + * const current = azure.core.getClientConfig({}); + * const exampleServiceAzureBot = new azure.bot.ServiceAzureBot("exampleServiceAzureBot", { + * resourceGroupName: exampleResourceGroup.name, + * location: "global", + * microsoftAppId: current.then(current => current.clientId), + * sku: "F0", + * endpoint: "https://example.com", + * developerAppInsightsApiKey: exampleApiKey.apiKey, + * developerAppInsightsApplicationId: exampleInsights.appId, + * tags: { + * environment: "test", + * }, + * }); + * ``` + * * ## Import * * Azure Bot Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/bot/webApp.ts b/sdk/nodejs/bot/webApp.ts index b0f90f91e4..d5b551064e 100644 --- a/sdk/nodejs/bot/webApp.ts +++ b/sdk/nodejs/bot/webApp.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Bot Web App. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWebApp = new azure.bot.WebApp("exampleWebApp", { + * location: "global", + * resourceGroupName: exampleResourceGroup.name, + * sku: "F0", + * microsoftAppId: current.then(current => current.clientId), + * }); + * ``` + * * ## Import * * Bot Web App's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/endpoint.ts b/sdk/nodejs/cdn/endpoint.ts index 5d391128f4..3f86142c40 100644 --- a/sdk/nodejs/cdn/endpoint.ts +++ b/sdk/nodejs/cdn/endpoint.ts @@ -7,6 +7,29 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleProfile = new azure.cdn.Profile("exampleProfile", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard_Verizon", + * }); + * const exampleEndpoint = new azure.cdn.Endpoint("exampleEndpoint", { + * profileName: exampleProfile.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * origins: [{ + * name: "example", + * hostName: "www.contoso.com", + * }], + * }); + * ``` + * * ## Import * * CDN Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/endpointCustomDomain.ts b/sdk/nodejs/cdn/endpointCustomDomain.ts index 8ea5bead1c..16c60bef38 100644 --- a/sdk/nodejs/cdn/endpointCustomDomain.ts +++ b/sdk/nodejs/cdn/endpointCustomDomain.ts @@ -9,6 +9,49 @@ import * as utilities from "../utilities"; /** * Manages a Custom Domain for a CDN Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleProfile = new azure.cdn.Profile("exampleProfile", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard_Verizon", + * }); + * const exampleEndpoint = new azure.cdn.Endpoint("exampleEndpoint", { + * profileName: exampleProfile.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * origins: [{ + * name: "example", + * hostName: exampleAccount.primaryBlobHost, + * }], + * }); + * const exampleZone = azure.dns.getZone({ + * name: "example-domain.com", + * resourceGroupName: "domain-rg", + * }); + * const exampleCNameRecord = new azure.dns.CNameRecord("exampleCNameRecord", { + * zoneName: exampleZone.then(exampleZone => exampleZone.name), + * resourceGroupName: exampleZone.then(exampleZone => exampleZone.resourceGroupName), + * ttl: 3600, + * targetResourceId: exampleEndpoint.id, + * }); + * const exampleEndpointCustomDomain = new azure.cdn.EndpointCustomDomain("exampleEndpointCustomDomain", { + * cdnEndpointId: exampleEndpoint.id, + * hostName: pulumi.all([exampleCNameRecord.name, exampleZone]).apply(([name, exampleZone]) => `${name}.${exampleZone.name}`), + * }); + * ``` + * * ## Import * * CDN Endpoint Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorCustomDomain.ts b/sdk/nodejs/cdn/frontdoorCustomDomain.ts index fcc374c732..733360ebc5 100644 --- a/sdk/nodejs/cdn/frontdoorCustomDomain.ts +++ b/sdk/nodejs/cdn/frontdoorCustomDomain.ts @@ -7,6 +7,49 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard_AzureFrontDoor", + * }); + * const exampleFrontdoorCustomDomain = new azure.cdn.FrontdoorCustomDomain("exampleFrontdoorCustomDomain", { + * cdnFrontdoorProfileId: exampleFrontdoorProfile.id, + * dnsZoneId: exampleZone.id, + * hostName: "contoso.fabrikam.com", + * tls: { + * certificateType: "ManagedCertificate", + * minimumTlsVersion: "TLS12", + * }, + * }); + * ``` + * ## Example CNAME Record Usage + * + * !>**IMPORTANT:** You **must** include the `dependsOn` meta-argument which references both the `azure.cdn.FrontdoorRoute` and the `azure.cdn.FrontdoorSecurityPolicy` that are associated with your Custom Domain. The reason for these `dependsOn` meta-arguments is because all of the resources for the Custom Domain need to be associated within Front Door before the CNAME record can be written to the domains DNS, else the CNAME validation will fail and Front Door will not enable traffic to the Domain. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.CNameRecord("example", { + * zoneName: azurerm_dns_zone.example.name, + * resourceGroupName: azurerm_resource_group.example.name, + * ttl: 3600, + * record: azurerm_cdn_frontdoor_endpoint.example.host_name, + * }, { + * dependsOn: [ + * azurerm_cdn_frontdoor_route.example, + * azurerm_cdn_frontdoor_security_policy.example, + * ], + * }); + * ``` + * * ## Import * * Front Door Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorEndpoint.ts b/sdk/nodejs/cdn/frontdoorEndpoint.ts index 4157be0abb..0ed515de9a 100644 --- a/sdk/nodejs/cdn/frontdoorEndpoint.ts +++ b/sdk/nodejs/cdn/frontdoorEndpoint.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Front Door (standard/premium) Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard_AzureFrontDoor", + * }); + * const exampleFrontdoorEndpoint = new azure.cdn.FrontdoorEndpoint("exampleFrontdoorEndpoint", { + * cdnFrontdoorProfileId: exampleFrontdoorProfile.id, + * tags: { + * ENV: "example", + * }, + * }); + * ``` + * * ## Import * * Front Door Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorFirewallPolicy.ts b/sdk/nodejs/cdn/frontdoorFirewallPolicy.ts index 36f3e92569..5c5556b07b 100644 --- a/sdk/nodejs/cdn/frontdoorFirewallPolicy.ts +++ b/sdk/nodejs/cdn/frontdoorFirewallPolicy.ts @@ -9,6 +9,119 @@ import * as utilities from "../utilities"; /** * Manages a Front Door (standard/premium) Firewall Policy instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Premium_AzureFrontDoor", + * }); + * const exampleFrontdoorFirewallPolicy = new azure.cdn.FrontdoorFirewallPolicy("exampleFrontdoorFirewallPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: exampleFrontdoorProfile.skuName, + * enabled: true, + * mode: "Prevention", + * redirectUrl: "https://www.contoso.com", + * customBlockResponseStatusCode: 403, + * customBlockResponseBody: "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + * customRules: [ + * { + * name: "Rule1", + * enabled: true, + * priority: 1, + * rateLimitDurationInMinutes: 1, + * rateLimitThreshold: 10, + * type: "MatchRule", + * action: "Block", + * matchConditions: [{ + * matchVariable: "RemoteAddr", + * operator: "IPMatch", + * negationCondition: false, + * matchValues: [ + * "10.0.1.0/24", + * "10.0.0.0/24", + * ], + * }], + * }, + * { + * name: "Rule2", + * enabled: true, + * priority: 2, + * rateLimitDurationInMinutes: 1, + * rateLimitThreshold: 10, + * type: "MatchRule", + * action: "Block", + * matchConditions: [ + * { + * matchVariable: "RemoteAddr", + * operator: "IPMatch", + * negationCondition: false, + * matchValues: ["192.168.1.0/24"], + * }, + * { + * matchVariable: "RequestHeader", + * selector: "UserAgent", + * operator: "Contains", + * negationCondition: false, + * matchValues: ["windows"], + * transforms: [ + * "Lowercase", + * "Trim", + * ], + * }, + * ], + * }, + * ], + * managedRules: [ + * { + * type: "DefaultRuleSet", + * version: "1.0", + * exclusions: [{ + * matchVariable: "QueryStringArgNames", + * operator: "Equals", + * selector: "not_suspicious", + * }], + * overrides: [ + * { + * ruleGroupName: "PHP", + * rules: [{ + * ruleId: "933100", + * enabled: false, + * action: "Block", + * }], + * }, + * { + * ruleGroupName: "SQLI", + * exclusions: [{ + * matchVariable: "QueryStringArgNames", + * operator: "Equals", + * selector: "really_not_suspicious", + * }], + * rules: [{ + * ruleId: "942200", + * action: "Block", + * exclusions: [{ + * matchVariable: "QueryStringArgNames", + * operator: "Equals", + * selector: "innocent", + * }], + * }], + * }, + * ], + * }, + * { + * type: "Microsoft_BotManagerRuleSet", + * version: "1.0", + * action: "Log", + * }, + * ], + * }); + * ``` + * * ## Import * * Front Door Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorOriginGroup.ts b/sdk/nodejs/cdn/frontdoorOriginGroup.ts index 9ca49740af..8a8c3527e1 100644 --- a/sdk/nodejs/cdn/frontdoorOriginGroup.ts +++ b/sdk/nodejs/cdn/frontdoorOriginGroup.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Front Door (standard/premium) Origin Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard_AzureFrontDoor", + * }); + * const exampleFrontdoorOriginGroup = new azure.cdn.FrontdoorOriginGroup("exampleFrontdoorOriginGroup", { + * cdnFrontdoorProfileId: exampleFrontdoorProfile.id, + * sessionAffinityEnabled: true, + * restoreTrafficTimeToHealedOrNewEndpointInMinutes: 10, + * healthProbe: { + * intervalInSeconds: 240, + * path: "/healthProbe", + * protocol: "Https", + * requestType: "HEAD", + * }, + * loadBalancing: { + * additionalLatencyInMilliseconds: 0, + * sampleSize: 16, + * successfulSamplesRequired: 3, + * }, + * }); + * ``` + * * ## Import * * Front Door Origin Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorProfile.ts b/sdk/nodejs/cdn/frontdoorProfile.ts index 87349f32f8..d2a8eb04a5 100644 --- a/sdk/nodejs/cdn/frontdoorProfile.ts +++ b/sdk/nodejs/cdn/frontdoorProfile.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Front Door (standard/premium) Profile which contains a collection of endpoints and origin groups. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard_AzureFrontDoor", + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Front Door Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorRouteDisableLinkToDefaultDomain.ts b/sdk/nodejs/cdn/frontdoorRouteDisableLinkToDefaultDomain.ts index c080e6fda9..3d9ca46e5d 100644 --- a/sdk/nodejs/cdn/frontdoorRouteDisableLinkToDefaultDomain.ts +++ b/sdk/nodejs/cdn/frontdoorRouteDisableLinkToDefaultDomain.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; * * !>**IMPORTANT:** This resource has been deprecated and should not be used for new deployments. The `azure.cdn.FrontdoorRouteDisableLinkToDefaultDomain` resource will be removed from the 4.0 AzureRM provider. Please use the `linkToDefaultDomain` field in the `azure.cdn.FrontdoorRoute` resource to control this value. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.cdn.FrontdoorRouteDisableLinkToDefaultDomain("example", { + * cdnFrontdoorRouteId: azurerm_cdn_frontdoor_route.example.id, + * cdnFrontdoorCustomDomainIds: [ + * azurerm_cdn_frontdoor_custom_domain.contoso.id, + * azurerm_cdn_frontdoor_custom_domain.fabrikam.id, + * ], + * }); + * ``` + * * ## Import * * FrontDoor Route Disable Link To Default Domain can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorRuleSet.ts b/sdk/nodejs/cdn/frontdoorRuleSet.ts index a2a6d21687..16ebbff398 100644 --- a/sdk/nodejs/cdn/frontdoorRuleSet.ts +++ b/sdk/nodejs/cdn/frontdoorRuleSet.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manages a Front Door (standard/premium) Rule Set. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard_AzureFrontDoor", + * }); + * const exampleFrontdoorRuleSet = new azure.cdn.FrontdoorRuleSet("exampleFrontdoorRuleSet", {cdnFrontdoorProfileId: exampleFrontdoorProfile.id}); + * ``` + * * ## Import * * Front Door Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/frontdoorSecret.ts b/sdk/nodejs/cdn/frontdoorSecret.ts index 6153b6ebb4..d072b737b6 100644 --- a/sdk/nodejs/cdn/frontdoorSecret.ts +++ b/sdk/nodejs/cdn/frontdoorSecret.ts @@ -9,6 +9,69 @@ import * as utilities from "../utilities"; /** * Manages a Front Door (standard/premium) Secret. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * import * as fs from "fs"; + * + * const current = azure.core.getClientConfig({}); + * const frontdoor = azuread.getServicePrincipal({ + * displayName: "Microsoft.Azure.Cdn", + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * softDeleteRetentionDays: 7, + * networkAcls: { + * defaultAction: "Deny", + * bypass: "AzureServices", + * ipRules: ["10.0.0.0/24"], + * }, + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: frontdoor.then(frontdoor => frontdoor.objectId), + * secretPermissions: ["Get"], + * }, + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Get", + * "Import", + * "Delete", + * "Purge", + * ], + * secretPermissions: ["Get"], + * }, + * ], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificate: { + * contents: Buffer.from(fs.readFileSync("my-certificate.pfx"), 'binary').toString('base64'), + * }, + * }); + * const exampleFrontdoorProfile = new azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard_AzureFrontDoor", + * }); + * const exampleFrontdoorSecret = new azure.cdn.FrontdoorSecret("exampleFrontdoorSecret", { + * cdnFrontdoorProfileId: exampleFrontdoorProfile.id, + * secret: { + * customerCertificates: [{ + * keyVaultCertificateId: exampleCertificate.id, + * }], + * }, + * }); + * ``` + * * ## Import * * Front Door Secrets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cdn/getFrontdoorCustomDomain.ts b/sdk/nodejs/cdn/getFrontdoorCustomDomain.ts index b7e1e2225f..ed88520069 100644 --- a/sdk/nodejs/cdn/getFrontdoorCustomDomain.ts +++ b/sdk/nodejs/cdn/getFrontdoorCustomDomain.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Front Door (standard/premium) Custom Domain. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorCustomDomain({ + * name: azurerm_cdn_frontdoor_custom_domain.example.name, + * profileName: azurerm_cdn_frontdoor_profile.example.name, + * resourceGroupName: azurerm_cdn_frontdoor_profile.example.resource_group_name, + * }); + * ``` */ export function getFrontdoorCustomDomain(args: GetFrontdoorCustomDomainArgs, opts?: pulumi.InvokeOptions): Promise { @@ -72,6 +85,19 @@ export interface GetFrontdoorCustomDomainResult { } /** * Use this data source to access information about an existing Front Door (standard/premium) Custom Domain. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorCustomDomain({ + * name: azurerm_cdn_frontdoor_custom_domain.example.name, + * profileName: azurerm_cdn_frontdoor_profile.example.name, + * resourceGroupName: azurerm_cdn_frontdoor_profile.example.resource_group_name, + * }); + * ``` */ export function getFrontdoorCustomDomainOutput(args: GetFrontdoorCustomDomainOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFrontdoorCustomDomain(a, opts)) diff --git a/sdk/nodejs/cdn/getFrontdoorEndpoint.ts b/sdk/nodejs/cdn/getFrontdoorEndpoint.ts index 9819572584..593a2c07ff 100644 --- a/sdk/nodejs/cdn/getFrontdoorEndpoint.ts +++ b/sdk/nodejs/cdn/getFrontdoorEndpoint.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Front Door (standard/premium) Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorEndpoint({ + * name: "existing-endpoint", + * profileName: "existing-cdn-profile", + * resourceGroupName: "existing-resources", + * }); + * ``` */ export function getFrontdoorEndpoint(args: GetFrontdoorEndpointArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +74,19 @@ export interface GetFrontdoorEndpointResult { } /** * Use this data source to access information about an existing Front Door (standard/premium) Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorEndpoint({ + * name: "existing-endpoint", + * profileName: "existing-cdn-profile", + * resourceGroupName: "existing-resources", + * }); + * ``` */ export function getFrontdoorEndpointOutput(args: GetFrontdoorEndpointOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFrontdoorEndpoint(a, opts)) diff --git a/sdk/nodejs/cdn/getFrontdoorFirewallPolicy.ts b/sdk/nodejs/cdn/getFrontdoorFirewallPolicy.ts index 5df6eabb03..f551889f82 100644 --- a/sdk/nodejs/cdn/getFrontdoorFirewallPolicy.ts +++ b/sdk/nodejs/cdn/getFrontdoorFirewallPolicy.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorFirewallPolicy({ + * name: "examplecdnfdwafpolicy", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getFrontdoorFirewallPolicy(args: GetFrontdoorFirewallPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +75,18 @@ export interface GetFrontdoorFirewallPolicyResult { } /** * Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorFirewallPolicy({ + * name: "examplecdnfdwafpolicy", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getFrontdoorFirewallPolicyOutput(args: GetFrontdoorFirewallPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFrontdoorFirewallPolicy(a, opts)) diff --git a/sdk/nodejs/cdn/getFrontdoorOriginGroup.ts b/sdk/nodejs/cdn/getFrontdoorOriginGroup.ts index 161e1a7dfa..e52c6e420d 100644 --- a/sdk/nodejs/cdn/getFrontdoorOriginGroup.ts +++ b/sdk/nodejs/cdn/getFrontdoorOriginGroup.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Front Door (standard/premium) Origin Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorOriginGroup({ + * name: "example-origin-group", + * profileName: "example-profile", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getFrontdoorOriginGroup(args: GetFrontdoorOriginGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface GetFrontdoorOriginGroupResult { } /** * Use this data source to access information about an existing Front Door (standard/premium) Origin Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorOriginGroup({ + * name: "example-origin-group", + * profileName: "example-profile", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getFrontdoorOriginGroupOutput(args: GetFrontdoorOriginGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFrontdoorOriginGroup(a, opts)) diff --git a/sdk/nodejs/cdn/getFrontdoorProfile.ts b/sdk/nodejs/cdn/getFrontdoorProfile.ts index 8b815200e6..4dad48f087 100644 --- a/sdk/nodejs/cdn/getFrontdoorProfile.ts +++ b/sdk/nodejs/cdn/getFrontdoorProfile.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Front Door (standard/premium) Profile. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorProfile({ + * name: "existing-cdn-profile", + * resourceGroupName: "existing-resources", + * }); + * ``` */ export function getFrontdoorProfile(args: GetFrontdoorProfileArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +71,18 @@ export interface GetFrontdoorProfileResult { } /** * Use this data source to access information about an existing Front Door (standard/premium) Profile. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorProfile({ + * name: "existing-cdn-profile", + * resourceGroupName: "existing-resources", + * }); + * ``` */ export function getFrontdoorProfileOutput(args: GetFrontdoorProfileOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFrontdoorProfile(a, opts)) diff --git a/sdk/nodejs/cdn/getFrontdoorRuleSet.ts b/sdk/nodejs/cdn/getFrontdoorRuleSet.ts index 1063655b30..6ed1366f30 100644 --- a/sdk/nodejs/cdn/getFrontdoorRuleSet.ts +++ b/sdk/nodejs/cdn/getFrontdoorRuleSet.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Front Door (standard/premium) Rule Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorRuleSet({ + * name: "existing-rule-set", + * profileName: "existing-profile", + * resourceGroupName: "existing-resources", + * }); + * ``` */ export function getFrontdoorRuleSet(args: GetFrontdoorRuleSetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +66,19 @@ export interface GetFrontdoorRuleSetResult { } /** * Use this data source to access information about an existing Front Door (standard/premium) Rule Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorRuleSet({ + * name: "existing-rule-set", + * profileName: "existing-profile", + * resourceGroupName: "existing-resources", + * }); + * ``` */ export function getFrontdoorRuleSetOutput(args: GetFrontdoorRuleSetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFrontdoorRuleSet(a, opts)) diff --git a/sdk/nodejs/cdn/getFrontdoorSecret.ts b/sdk/nodejs/cdn/getFrontdoorSecret.ts index 82e6929c6e..bbd3a3a2b6 100644 --- a/sdk/nodejs/cdn/getFrontdoorSecret.ts +++ b/sdk/nodejs/cdn/getFrontdoorSecret.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Front Door (standard/premium) Secret. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorSecret({ + * name: "example-secret", + * profileName: "example-profile", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getFrontdoorSecret(args: GetFrontdoorSecretArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +72,19 @@ export interface GetFrontdoorSecretResult { } /** * Use this data source to access information about an existing Front Door (standard/premium) Secret. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getFrontdoorSecret({ + * name: "example-secret", + * profileName: "example-profile", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getFrontdoorSecretOutput(args: GetFrontdoorSecretOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFrontdoorSecret(a, opts)) diff --git a/sdk/nodejs/cdn/getProfile.ts b/sdk/nodejs/cdn/getProfile.ts index 1d9d46f76c..0acf54b17c 100644 --- a/sdk/nodejs/cdn/getProfile.ts +++ b/sdk/nodejs/cdn/getProfile.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing CDN Profile. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getProfile({ + * name: "myfirstcdnprofile", + * resourceGroupName: "example-resources", + * }); + * export const cdnProfileId = example.then(example => example.id); + * ``` */ export function getProfile(args: GetProfileArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetProfileResult { } /** * Use this data source to access information about an existing CDN Profile. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cdn.getProfile({ + * name: "myfirstcdnprofile", + * resourceGroupName: "example-resources", + * }); + * export const cdnProfileId = example.then(example => example.id); + * ``` */ export function getProfileOutput(args: GetProfileOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getProfile(a, opts)) diff --git a/sdk/nodejs/cdn/profile.ts b/sdk/nodejs/cdn/profile.ts index e7de9dcf37..a4b49ae441 100644 --- a/sdk/nodejs/cdn/profile.ts +++ b/sdk/nodejs/cdn/profile.ts @@ -5,6 +5,24 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleProfile = new azure.cdn.Profile("exampleProfile", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard_Verizon", + * tags: { + * environment: "Production", + * cost_center: "MSFT", + * }, + * }); + * ``` + * * ## Import * * CDN Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cognitive/account.ts b/sdk/nodejs/cognitive/account.ts index 223a0fde36..efa9f28c60 100644 --- a/sdk/nodejs/cognitive/account.ts +++ b/sdk/nodejs/cognitive/account.ts @@ -11,6 +11,24 @@ import * as utilities from "../utilities"; * * > **Note:** Version v2.65.0 of the Azure Provider and later will attempt to Purge the Cognitive Account during deletion. This feature can be disabled using the `features` block within the `provider` block, see the provider documentation on the features block for more information. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cognitive.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "Face", + * skuName: "S0", + * tags: { + * Acceptance: "Test", + * }, + * }); + * ``` + * * ## Import * * Cognitive Service Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cognitive/accountCustomerManagedKey.ts b/sdk/nodejs/cognitive/accountCustomerManagedKey.ts index 968d8512fc..e60bf9e8fc 100644 --- a/sdk/nodejs/cognitive/accountCustomerManagedKey.ts +++ b/sdk/nodejs/cognitive/accountCustomerManagedKey.ts @@ -9,6 +9,118 @@ import * as utilities from "../utilities"; * * > **NOTE:** It's possible to define a Customer Managed Key both within the `azure.cognitive.Account` resource via the `customerManagedKey` block and by using the `azure.cognitive.AccountCustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Cognitive Account, since there'll be conflicts. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleAccount = new azure.cognitive.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "Face", + * skuName: "E0", + * customSubdomainName: "example-account", + * identity: { + * type: "SystemAssigned, UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * accessPolicies: [ + * { + * tenantId: exampleAccount.identity.apply(identity => identity?.tenantId), + * objectId: exampleAccount.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "Create", + * "List", + * "Restore", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * "Purge", + * "Encrypt", + * "Decrypt", + * "Sign", + * "Verify", + * ], + * secretPermissions: ["Get"], + * }, + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "Create", + * "Delete", + * "List", + * "Restore", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * "Purge", + * "Encrypt", + * "Decrypt", + * "Sign", + * "Verify", + * "GetRotationPolicy", + * ], + * secretPermissions: ["Get"], + * }, + * { + * tenantId: exampleUserAssignedIdentity.tenantId, + * objectId: exampleUserAssignedIdentity.principalId, + * keyPermissions: [ + * "Get", + * "Create", + * "Delete", + * "List", + * "Restore", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * "Purge", + * "Encrypt", + * "Decrypt", + * "Sign", + * "Verify", + * ], + * secretPermissions: ["Get"], + * }, + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }); + * const exampleAccountCustomerManagedKey = new azure.cognitive.AccountCustomerManagedKey("exampleAccountCustomerManagedKey", { + * cognitiveAccountId: exampleAccount.id, + * keyVaultKeyId: exampleKey.id, + * identityClientId: exampleUserAssignedIdentity.clientId, + * }); + * ``` + * * ## Import * * Customer Managed Keys for a Cognitive Account can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cognitive/deployment.ts b/sdk/nodejs/cognitive/deployment.ts index e711bf61dd..53539a965e 100644 --- a/sdk/nodejs/cognitive/deployment.ts +++ b/sdk/nodejs/cognitive/deployment.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages a Cognitive Services Account Deployment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cognitive.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "OpenAI", + * skuName: "S0", + * }); + * const exampleDeployment = new azure.cognitive.Deployment("exampleDeployment", { + * cognitiveAccountId: exampleAccount.id, + * model: { + * format: "OpenAI", + * name: "text-curie-001", + * version: "1", + * }, + * scale: { + * type: "Standard", + * }, + * }); + * ``` + * * ## Import * * Cognitive Services Account Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cognitive/getAccount.ts b/sdk/nodejs/cognitive/getAccount.ts index ca97875146..f34f446a0b 100644 --- a/sdk/nodejs/cognitive/getAccount.ts +++ b/sdk/nodejs/cognitive/getAccount.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Cognitive Services Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.cognitive.getAccount({ + * name: "example-account", + * resourceGroupName: "cognitive_account_rg", + * }); + * export const primaryAccessKey = test.then(test => test.primaryAccessKey); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -80,6 +93,19 @@ export interface GetAccountResult { } /** * Use this data source to access information about an existing Cognitive Services Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.cognitive.getAccount({ + * name: "example-account", + * resourceGroupName: "cognitive_account_rg", + * }); + * export const primaryAccessKey = test.then(test => test.primaryAccessKey); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/communication/emailService.ts b/sdk/nodejs/communication/emailService.ts index bd1be51c5c..c56fe2fab9 100644 --- a/sdk/nodejs/communication/emailService.ts +++ b/sdk/nodejs/communication/emailService.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages an Email Communication Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEmailService = new azure.communication.EmailService("exampleEmailService", { + * resourceGroupName: exampleResourceGroup.name, + * dataLocation: "United States", + * }); + * ``` + * * ## Import * * Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/communication/getService.ts b/sdk/nodejs/communication/getService.ts index 7fa4d59940..6fb6c0d6c1 100644 --- a/sdk/nodejs/communication/getService.ts +++ b/sdk/nodejs/communication/getService.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Communication Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.communication.getService({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -69,6 +82,19 @@ export interface GetServiceResult { } /** * Use this data source to access information about an existing Communication Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.communication.getService({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/communication/service.ts b/sdk/nodejs/communication/service.ts index 62fb8d0c42..d36adf3436 100644 --- a/sdk/nodejs/communication/service.ts +++ b/sdk/nodejs/communication/service.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Communication Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.communication.Service("exampleService", { + * resourceGroupName: exampleResourceGroup.name, + * dataLocation: "United States", + * }); + * ``` + * * ## Import * * Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/availabilitySet.ts b/sdk/nodejs/compute/availabilitySet.ts index 2039e62bef..a016aefdb0 100644 --- a/sdk/nodejs/compute/availabilitySet.ts +++ b/sdk/nodejs/compute/availabilitySet.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an Availability Set for Virtual Machines. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAvailabilitySet = new azure.compute.AvailabilitySet("exampleAvailabilitySet", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Availability Sets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/bastionHost.ts b/sdk/nodejs/compute/bastionHost.ts index 93967c7488..c5ac5f0f20 100644 --- a/sdk/nodejs/compute/bastionHost.ts +++ b/sdk/nodejs/compute/bastionHost.ts @@ -9,6 +9,42 @@ import * as utilities from "../utilities"; /** * Manages a Bastion Host. * + * ## Example Usage + * + * This example deploys an Azure Bastion Host Instance to a target virtual network. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["192.168.1.0/24"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["192.168.1.224/27"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleBastionHost = new azure.compute.BastionHost("exampleBastionHost", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfiguration: { + * name: "configuration", + * subnetId: exampleSubnet.id, + * publicIpAddressId: examplePublicIp.id, + * }, + * }); + * ``` + * * ## Import * * Bastion Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/capacityReservation.ts b/sdk/nodejs/compute/capacityReservation.ts index 84dfb49b6c..1c8b028a6d 100644 --- a/sdk/nodejs/compute/capacityReservation.ts +++ b/sdk/nodejs/compute/capacityReservation.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; /** * Manages a Capacity Reservation within a Capacity Reservation Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCapacityReservationGroup = new azure.compute.CapacityReservationGroup("exampleCapacityReservationGroup", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleCapacityReservation = new azure.compute.CapacityReservation("exampleCapacityReservation", { + * capacityReservationGroupId: exampleCapacityReservationGroup.id, + * sku: { + * name: "Standard_D2s_v3", + * capacity: 1, + * }, + * }); + * ``` + * * ## Import * * Capacity Reservations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/capacityReservationGroup.ts b/sdk/nodejs/compute/capacityReservationGroup.ts index 4e9e577da0..d837bedd18 100644 --- a/sdk/nodejs/compute/capacityReservationGroup.ts +++ b/sdk/nodejs/compute/capacityReservationGroup.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Capacity Reservation Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCapacityReservationGroup = new azure.compute.CapacityReservationGroup("exampleCapacityReservationGroup", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Capacity Reservation Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/dataDiskAttachment.ts b/sdk/nodejs/compute/dataDiskAttachment.ts index 95620d6095..7ba06710ae 100644 --- a/sdk/nodejs/compute/dataDiskAttachment.ts +++ b/sdk/nodejs/compute/dataDiskAttachment.ts @@ -11,6 +11,76 @@ import * as utilities from "../utilities"; * * > **Please Note:** only Managed Disks are supported via this separate resource, Unmanaged Disks can be attached using the `storageDataDisk` block in the `azure.compute.VirtualMachine` resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const config = new pulumi.Config(); + * const prefix = config.get("prefix") || "example"; + * const vmName = `${prefix}-vm`; + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const mainVirtualNetwork = new azure.network.VirtualNetwork("mainVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: mainVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const mainNetworkInterface = new azure.network.NetworkInterface("mainNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "internal", + * subnetId: internal.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleVirtualMachine = new azure.compute.VirtualMachine("exampleVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * networkInterfaceIds: [mainNetworkInterface.id], + * vmSize: "Standard_F2", + * storageImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * storageOsDisk: { + * name: "myosdisk1", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Standard_LRS", + * }, + * osProfile: { + * computerName: vmName, + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: false, + * }, + * }); + * const exampleManagedDisk = new azure.compute.ManagedDisk("exampleManagedDisk", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccountType: "Standard_LRS", + * createOption: "Empty", + * diskSizeGb: 10, + * }); + * const exampleDataDiskAttachment = new azure.compute.DataDiskAttachment("exampleDataDiskAttachment", { + * managedDiskId: exampleManagedDisk.id, + * virtualMachineId: exampleVirtualMachine.id, + * lun: 10, + * caching: "ReadWrite", + * }); + * ``` + * * ## Import * * Virtual Machines Data Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/dedicatedHost.ts b/sdk/nodejs/compute/dedicatedHost.ts index 944a1dff43..a368d1532a 100644 --- a/sdk/nodejs/compute/dedicatedHost.ts +++ b/sdk/nodejs/compute/dedicatedHost.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manage a Dedicated Host within a Dedicated Host Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDedicatedHostGroup = new azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * platformFaultDomainCount: 2, + * }); + * const exampleDedicatedHost = new azure.compute.DedicatedHost("exampleDedicatedHost", { + * location: exampleResourceGroup.location, + * dedicatedHostGroupId: exampleDedicatedHostGroup.id, + * skuName: "DSv3-Type1", + * platformFaultDomain: 1, + * }); + * ``` + * * ## Import * * Dedicated Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/dedicatedHostGroup.ts b/sdk/nodejs/compute/dedicatedHostGroup.ts index cb0a0a7b26..2546b8b1d0 100644 --- a/sdk/nodejs/compute/dedicatedHostGroup.ts +++ b/sdk/nodejs/compute/dedicatedHostGroup.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manage a Dedicated Host Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDedicatedHostGroup = new azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * platformFaultDomainCount: 1, + * }); + * ``` + * * ## Import * * Dedicated Host Group can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/diskAccess.ts b/sdk/nodejs/compute/diskAccess.ts index eb740916f5..2d796fa1b4 100644 --- a/sdk/nodejs/compute/diskAccess.ts +++ b/sdk/nodejs/compute/diskAccess.ts @@ -7,6 +7,18 @@ import * as utilities from "../utilities"; /** * Manages a Disk Access. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.compute.DiskAccess("example", { + * location: "West Europe", + * resourceGroupName: "example", + * }); + * ``` + * * ## Import * * Disk Access resource can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/diskEncryptionSet.ts b/sdk/nodejs/compute/diskEncryptionSet.ts index 4c03abe92b..40ca4b50d9 100644 --- a/sdk/nodejs/compute/diskEncryptionSet.ts +++ b/sdk/nodejs/compute/diskEncryptionSet.ts @@ -11,6 +11,164 @@ import * as utilities from "../utilities"; * * > **NOTE:** At this time the Key Vault used to store the Active Key for this Disk Encryption Set must have both Soft Delete & Purge Protection enabled - which are not yet supported by this provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * enabledForDiskEncryption: true, + * purgeProtectionEnabled: true, + * }); + * const example_user = new azure.keyvault.AccessPolicy("example-user", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Delete", + * "Get", + * "Purge", + * "Recover", + * "Update", + * "List", + * "Decrypt", + * "Sign", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [example_user], + * }); + * const exampleDiskEncryptionSet = new azure.compute.DiskEncryptionSet("exampleDiskEncryptionSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * keyVaultKeyId: exampleKey.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const example_diskAccessPolicy = new azure.keyvault.AccessPolicy("example-diskAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: exampleDiskEncryptionSet.identity.apply(identity => identity.tenantId), + * objectId: exampleDiskEncryptionSet.identity.apply(identity => identity.principalId), + * keyPermissions: [ + * "Create", + * "Delete", + * "Get", + * "Purge", + * "Recover", + * "Update", + * "List", + * "Decrypt", + * "Sign", + * ], + * }); + * const example_diskAssignment = new azure.authorization.Assignment("example-diskAssignment", { + * scope: exampleKeyVault.id, + * roleDefinitionName: "Key Vault Crypto Service Encryption User", + * principalId: exampleDiskEncryptionSet.identity.apply(identity => identity.principalId), + * }); + * ``` + * ### With Automatic Key Rotation Enabled + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * enabledForDiskEncryption: true, + * purgeProtectionEnabled: true, + * }); + * const example_user = new azure.keyvault.AccessPolicy("example-user", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Delete", + * "Get", + * "Purge", + * "Recover", + * "Update", + * "List", + * "Decrypt", + * "Sign", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [example_user], + * }); + * const exampleDiskEncryptionSet = new azure.compute.DiskEncryptionSet("exampleDiskEncryptionSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * keyVaultKeyId: exampleKey.versionlessId, + * autoKeyRotationEnabled: true, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const example_diskAccessPolicy = new azure.keyvault.AccessPolicy("example-diskAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: exampleDiskEncryptionSet.identity.apply(identity => identity.tenantId), + * objectId: exampleDiskEncryptionSet.identity.apply(identity => identity.principalId), + * keyPermissions: [ + * "Create", + * "Delete", + * "Get", + * "Purge", + * "Recover", + * "Update", + * "List", + * "Decrypt", + * "Sign", + * ], + * }); + * const example_diskAssignment = new azure.authorization.Assignment("example-diskAssignment", { + * scope: exampleKeyVault.id, + * roleDefinitionName: "Key Vault Crypto Service Encryption User", + * principalId: exampleDiskEncryptionSet.identity.apply(identity => identity.principalId), + * }); + * ``` + * * ## Import * * Disk Encryption Sets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/diskPool.ts b/sdk/nodejs/compute/diskPool.ts index e43955f759..88221a6f6b 100644 --- a/sdk/nodejs/compute/diskPool.ts +++ b/sdk/nodejs/compute/diskPool.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; * * !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleVirtualNetwork.resourceGroupName, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "diskspool", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/read"], + * name: "Microsoft.StoragePool/diskPools", + * }, + * }], + * }); + * const exampleDiskPool = new azure.compute.DiskPool("exampleDiskPool", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "Basic_B1", + * subnetId: exampleSubnet.id, + * zones: ["1"], + * }); + * ``` + * * ## Import * * Disk Pools can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/diskPoolIscsiTarget.ts b/sdk/nodejs/compute/diskPoolIscsiTarget.ts index ba449a5d0b..49d787ad8c 100644 --- a/sdk/nodejs/compute/diskPoolIscsiTarget.ts +++ b/sdk/nodejs/compute/diskPoolIscsiTarget.ts @@ -11,6 +11,77 @@ import * as utilities from "../utilities"; * * !> **Note:** Each Disk Pool can have a maximum of 1 iSCSI Target. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "diskspool", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/read"], + * name: "Microsoft.StoragePool/diskPools", + * }, + * }], + * }); + * const exampleDiskPool = new azure.compute.DiskPool("exampleDiskPool", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subnetId: exampleSubnet.id, + * zones: ["1"], + * skuName: "Basic_B1", + * }); + * const exampleManagedDisk = new azure.compute.ManagedDisk("exampleManagedDisk", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * createOption: "Empty", + * storageAccountType: "Premium_LRS", + * diskSizeGb: 4, + * maxShares: 2, + * zone: "1", + * }); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "StoragePool Resource Provider", + * }); + * const roles = [ + * "Disk Pool Operator", + * "Virtual Machine Contributor", + * ]; + * const exampleAssignment: azure.authorization.Assignment[] = []; + * for (const range = {value: 0}; range.value < roles.length; range.value++) { + * exampleAssignment.push(new azure.authorization.Assignment(`exampleAssignment-${range.value}`, { + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.id), + * roleDefinitionName: roles[range.value], + * scope: exampleManagedDisk.id, + * })); + * } + * const exampleDiskPoolManagedDiskAttachment = new azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", { + * diskPoolId: exampleDiskPool.id, + * managedDiskId: exampleManagedDisk.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * const exampleDiskPoolIscsiTarget = new azure.compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", { + * aclMode: "Dynamic", + * disksPoolId: exampleDiskPool.id, + * targetIqn: "iqn.2021-11.com.microsoft:test", + * }, { + * dependsOn: [exampleDiskPoolManagedDiskAttachment], + * }); + * ``` + * * ## Import * * iSCSI Targets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/diskPoolIscsiTargetLun.ts b/sdk/nodejs/compute/diskPoolIscsiTargetLun.ts index b5f6e86942..6a0d8894dd 100644 --- a/sdk/nodejs/compute/diskPoolIscsiTargetLun.ts +++ b/sdk/nodejs/compute/diskPoolIscsiTargetLun.ts @@ -9,6 +9,81 @@ import * as utilities from "../utilities"; * * !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "diskspool", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/read"], + * name: "Microsoft.StoragePool/diskPools", + * }, + * }], + * }); + * const exampleDiskPool = new azure.compute.DiskPool("exampleDiskPool", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subnetId: exampleSubnet.id, + * zones: ["1"], + * skuName: "Basic_B1", + * }); + * const exampleManagedDisk = new azure.compute.ManagedDisk("exampleManagedDisk", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * createOption: "Empty", + * storageAccountType: "Premium_LRS", + * diskSizeGb: 4, + * maxShares: 2, + * zone: "1", + * }); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "StoragePool Resource Provider", + * }); + * const roles = [ + * "Disk Pool Operator", + * "Virtual Machine Contributor", + * ]; + * const exampleAssignment: azure.authorization.Assignment[] = []; + * for (const range = {value: 0}; range.value < roles.length; range.value++) { + * exampleAssignment.push(new azure.authorization.Assignment(`exampleAssignment-${range.value}`, { + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.id), + * roleDefinitionName: roles[range.value], + * scope: exampleManagedDisk.id, + * })); + * } + * const exampleDiskPoolManagedDiskAttachment = new azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", { + * diskPoolId: exampleDiskPool.id, + * managedDiskId: exampleManagedDisk.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * const exampleDiskPoolIscsiTarget = new azure.compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", { + * aclMode: "Dynamic", + * disksPoolId: exampleDiskPool.id, + * targetIqn: "iqn.2021-11.com.microsoft:test", + * }, { + * dependsOn: [exampleDiskPoolManagedDiskAttachment], + * }); + * const exampleDiskPoolIscsiTargetLun = new azure.compute.DiskPoolIscsiTargetLun("exampleDiskPoolIscsiTargetLun", { + * iscsiTargetId: exampleDiskPoolIscsiTarget.id, + * diskPoolManagedDiskAttachmentId: exampleDiskPoolManagedDiskAttachment.id, + * }); + * ``` + * * ## Import * * iSCSI Target Luns can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/diskPoolManagedDiskAttachment.ts b/sdk/nodejs/compute/diskPoolManagedDiskAttachment.ts index e265cd1979..21e3be32e3 100644 --- a/sdk/nodejs/compute/diskPoolManagedDiskAttachment.ts +++ b/sdk/nodejs/compute/diskPoolManagedDiskAttachment.ts @@ -17,6 +17,70 @@ import * as utilities from "../utilities"; * * > **Note:** You must provide the StoragePool resource provider RBAC permissions to the disks that will be added to the disk pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "diskspool", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/read"], + * name: "Microsoft.StoragePool/diskPools", + * }, + * }], + * }); + * const exampleDiskPool = new azure.compute.DiskPool("exampleDiskPool", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subnetId: exampleSubnet.id, + * zones: ["1"], + * skuName: "Basic_B1", + * }); + * const exampleManagedDisk = new azure.compute.ManagedDisk("exampleManagedDisk", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * createOption: "Empty", + * storageAccountType: "Premium_LRS", + * diskSizeGb: 4, + * maxShares: 2, + * zone: "1", + * }); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "StoragePool Resource Provider", + * }); + * const roles = [ + * "Disk Pool Operator", + * "Virtual Machine Contributor", + * ]; + * const exampleAssignment: azure.authorization.Assignment[] = []; + * for (const range = {value: 0}; range.value < roles.length; range.value++) { + * exampleAssignment.push(new azure.authorization.Assignment(`exampleAssignment-${range.value}`, { + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.id), + * roleDefinitionName: roles[range.value], + * scope: exampleManagedDisk.id, + * })); + * } + * const exampleDiskPoolManagedDiskAttachment = new azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", { + * diskPoolId: exampleDiskPool.id, + * managedDiskId: exampleManagedDisk.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Disks Pool Managed Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/extension.ts b/sdk/nodejs/compute/extension.ts index 02eb152e35..dda9e1156f 100644 --- a/sdk/nodejs/compute/extension.ts +++ b/sdk/nodejs/compute/extension.ts @@ -14,6 +14,69 @@ import * as utilities from "../utilities"; * * > **NOTE:** Custom Script Extensions require that the Azure Virtual Machine Guest Agent is running on the Virtual Machine. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_F2", + * adminUsername: "adminuser", + * networkInterfaceIds: [exampleNetworkInterface.id], + * adminSshKeys: [{ + * username: "adminuser", + * publicKey: fs.readFileSync("~/.ssh/id_rsa.pub"), + * }], + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * }); + * const exampleExtension = new azure.compute.Extension("exampleExtension", { + * virtualMachineId: exampleLinuxVirtualMachine.id, + * publisher: "Microsoft.Azure.Extensions", + * type: "CustomScript", + * typeHandlerVersion: "2.0", + * settings: ` { + * "commandToExecute": "hostname && uptime" + * } + * `, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Virtual Machine Extensions can be imported using the `resource id`, e.g. @@ -102,6 +165,10 @@ export class Extension extends pulumi.CustomResource { * The type of extension, available types for a publisher can be found using the Azure CLI. * * > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ public readonly type!: pulumi.Output; /** @@ -230,6 +297,10 @@ export interface ExtensionState { * The type of extension, available types for a publisher can be found using the Azure CLI. * * > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ type?: pulumi.Input; /** @@ -298,6 +369,10 @@ export interface ExtensionArgs { * The type of extension, available types for a publisher can be found using the Azure CLI. * * > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ type: pulumi.Input; /** diff --git a/sdk/nodejs/compute/galleryApplication.ts b/sdk/nodejs/compute/galleryApplication.ts index e10e94176d..b79b4e892b 100644 --- a/sdk/nodejs/compute/galleryApplication.ts +++ b/sdk/nodejs/compute/galleryApplication.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages a Gallery Application. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSharedImageGallery = new azure.compute.SharedImageGallery("exampleSharedImageGallery", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleGalleryApplication = new azure.compute.GalleryApplication("exampleGalleryApplication", { + * galleryId: exampleSharedImageGallery.id, + * location: exampleResourceGroup.location, + * supportedOsType: "Linux", + * }); + * ``` + * * ## Import * * Gallery Applications can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/galleryApplicationVersion.ts b/sdk/nodejs/compute/galleryApplicationVersion.ts index da9cffdc78..9965d0f815 100644 --- a/sdk/nodejs/compute/galleryApplicationVersion.ts +++ b/sdk/nodejs/compute/galleryApplicationVersion.ts @@ -9,6 +9,55 @@ import * as utilities from "../utilities"; /** * Manages a Gallery Application Version. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSharedImageGallery = new azure.compute.SharedImageGallery("exampleSharedImageGallery", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleGalleryApplication = new azure.compute.GalleryApplication("exampleGalleryApplication", { + * galleryId: exampleSharedImageGallery.id, + * location: exampleResourceGroup.location, + * supportedOsType: "Linux", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "blob", + * }); + * const exampleBlob = new azure.storage.Blob("exampleBlob", { + * storageAccountName: exampleAccount.name, + * storageContainerName: exampleContainer.name, + * type: "Block", + * sourceContent: "[scripts file content]", + * }); + * const exampleGalleryApplicationVersion = new azure.compute.GalleryApplicationVersion("exampleGalleryApplicationVersion", { + * galleryApplicationId: exampleGalleryApplication.id, + * location: exampleGalleryApplication.location, + * manageAction: { + * install: "[install command]", + * remove: "[remove command]", + * }, + * source: { + * mediaLink: exampleBlob.id, + * }, + * targetRegions: [{ + * name: exampleGalleryApplication.location, + * regionalReplicaCount: 1, + * }], + * }); + * ``` + * * ## Import * * Gallery Application Versions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/getAvailabilitySet.ts b/sdk/nodejs/compute/getAvailabilitySet.ts index 2511bd85eb..7580d8c048 100644 --- a/sdk/nodejs/compute/getAvailabilitySet.ts +++ b/sdk/nodejs/compute/getAvailabilitySet.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Availability Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getAvailabilitySet({ + * name: "tf-appsecuritygroup", + * resourceGroupName: "my-resource-group", + * }); + * export const availabilitySetId = example.then(example => example.id); + * ``` */ export function getAvailabilitySet(args: GetAvailabilitySetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +76,19 @@ export interface GetAvailabilitySetResult { } /** * Use this data source to access information about an existing Availability Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getAvailabilitySet({ + * name: "tf-appsecuritygroup", + * resourceGroupName: "my-resource-group", + * }); + * export const availabilitySetId = example.then(example => example.id); + * ``` */ export function getAvailabilitySetOutput(args: GetAvailabilitySetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAvailabilitySet(a, opts)) diff --git a/sdk/nodejs/compute/getBastionHost.ts b/sdk/nodejs/compute/getBastionHost.ts index a9fb93cf3d..46e0079d59 100644 --- a/sdk/nodejs/compute/getBastionHost.ts +++ b/sdk/nodejs/compute/getBastionHost.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Bastion Host. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getBastionHost({ + * name: "existing-bastion", + * resourceGroupName: "existing-resources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getBastionHost(args: GetBastionHostArgs, opts?: pulumi.InvokeOptions): Promise { @@ -92,6 +105,19 @@ export interface GetBastionHostResult { } /** * Use this data source to access information about an existing Bastion Host. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getBastionHost({ + * name: "existing-bastion", + * resourceGroupName: "existing-resources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getBastionHostOutput(args: GetBastionHostOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBastionHost(a, opts)) diff --git a/sdk/nodejs/compute/getConfidentialLedger.ts b/sdk/nodejs/compute/getConfidentialLedger.ts index 33382fc163..776d3d5a13 100644 --- a/sdk/nodejs/compute/getConfidentialLedger.ts +++ b/sdk/nodejs/compute/getConfidentialLedger.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Gets information about an existing Confidential Ledger. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.compute.getConfidentialLedger({ + * name: "example-ledger", + * resourceGroupName: "example-resources", + * }); + * export const ledgerEndpoint = current.then(current => current.ledgerEndpoint); + * ``` */ export function getConfidentialLedger(args: GetConfidentialLedgerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +80,19 @@ export interface GetConfidentialLedgerResult { } /** * Gets information about an existing Confidential Ledger. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.compute.getConfidentialLedger({ + * name: "example-ledger", + * resourceGroupName: "example-resources", + * }); + * export const ledgerEndpoint = current.then(current => current.ledgerEndpoint); + * ``` */ export function getConfidentialLedgerOutput(args: GetConfidentialLedgerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getConfidentialLedger(a, opts)) diff --git a/sdk/nodejs/compute/getDedicatedHost.ts b/sdk/nodejs/compute/getDedicatedHost.ts index 174b107973..1ecfbe5bac 100644 --- a/sdk/nodejs/compute/getDedicatedHost.ts +++ b/sdk/nodejs/compute/getDedicatedHost.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Dedicated Host. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getDedicatedHost({ + * name: "example-host", + * dedicatedHostGroupName: "example-host-group", + * resourceGroupName: "example-resources", + * }); + * export const dedicatedHostId = example.then(example => example.id); + * ``` */ export function getDedicatedHost(args: GetDedicatedHostArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +71,20 @@ export interface GetDedicatedHostResult { } /** * Use this data source to access information about an existing Dedicated Host. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getDedicatedHost({ + * name: "example-host", + * dedicatedHostGroupName: "example-host-group", + * resourceGroupName: "example-resources", + * }); + * export const dedicatedHostId = example.then(example => example.id); + * ``` */ export function getDedicatedHostOutput(args: GetDedicatedHostOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDedicatedHost(a, opts)) diff --git a/sdk/nodejs/compute/getDedicatedHostGroup.ts b/sdk/nodejs/compute/getDedicatedHostGroup.ts index b21656ecb2..5580b3d97e 100644 --- a/sdk/nodejs/compute/getDedicatedHostGroup.ts +++ b/sdk/nodejs/compute/getDedicatedHostGroup.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Dedicated Host Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getDedicatedHostGroup({ + * name: "example-dedicated-host-group", + * resourceGroupName: "example-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDedicatedHostGroup(args: GetDedicatedHostGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +76,19 @@ export interface GetDedicatedHostGroupResult { } /** * Use this data source to access information about an existing Dedicated Host Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getDedicatedHostGroup({ + * name: "example-dedicated-host-group", + * resourceGroupName: "example-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDedicatedHostGroupOutput(args: GetDedicatedHostGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDedicatedHostGroup(a, opts)) diff --git a/sdk/nodejs/compute/getDiskAccess.ts b/sdk/nodejs/compute/getDiskAccess.ts index ede81c796f..7f9024504c 100644 --- a/sdk/nodejs/compute/getDiskAccess.ts +++ b/sdk/nodejs/compute/getDiskAccess.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Disk Access. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getDiskAccess({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDiskAccess(args: GetDiskAccessArgs, opts?: pulumi.InvokeOptions): Promise { @@ -44,6 +57,19 @@ export interface GetDiskAccessResult { } /** * Use this data source to access information about an existing Disk Access. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getDiskAccess({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDiskAccessOutput(args: GetDiskAccessOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDiskAccess(a, opts)) diff --git a/sdk/nodejs/compute/getDiskEncryptionSet.ts b/sdk/nodejs/compute/getDiskEncryptionSet.ts index 74bc523624..733ed4a6f5 100644 --- a/sdk/nodejs/compute/getDiskEncryptionSet.ts +++ b/sdk/nodejs/compute/getDiskEncryptionSet.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Disk Encryption Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.compute.getDiskEncryptionSet({ + * name: "example-des", + * resourceGroupName: "example-resources", + * }); + * export const id = existing.then(existing => existing.id); + * ``` */ export function getDiskEncryptionSet(args: GetDiskEncryptionSetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetDiskEncryptionSetResult { } /** * Use this data source to access information about an existing Disk Encryption Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.compute.getDiskEncryptionSet({ + * name: "example-des", + * resourceGroupName: "example-resources", + * }); + * export const id = existing.then(existing => existing.id); + * ``` */ export function getDiskEncryptionSetOutput(args: GetDiskEncryptionSetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDiskEncryptionSet(a, opts)) diff --git a/sdk/nodejs/compute/getImage.ts b/sdk/nodejs/compute/getImage.ts index 64519fb3a1..6e48ec9c7d 100644 --- a/sdk/nodejs/compute/getImage.ts +++ b/sdk/nodejs/compute/getImage.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Image. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const search = azure.compute.getImage({ + * name: "search-api", + * resourceGroupName: "packerimages", + * }); + * export const imageId = search.then(search => search.id); + * ``` */ export function getImage(args: GetImageArgs, opts?: pulumi.InvokeOptions): Promise { @@ -80,6 +93,19 @@ export interface GetImageResult { } /** * Use this data source to access information about an existing Image. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const search = azure.compute.getImage({ + * name: "search-api", + * resourceGroupName: "packerimages", + * }); + * export const imageId = search.then(search => search.id); + * ``` */ export function getImageOutput(args: GetImageOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getImage(a, opts)) diff --git a/sdk/nodejs/compute/getImages.ts b/sdk/nodejs/compute/getImages.ts index 0ba060a69c..2dcc1c76a4 100644 --- a/sdk/nodejs/compute/getImages.ts +++ b/sdk/nodejs/compute/getImages.ts @@ -8,6 +8,17 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about existing Images within a Resource Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getImages({ + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getImages(args: GetImagesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -49,6 +60,17 @@ export interface GetImagesResult { } /** * Use this data source to access information about existing Images within a Resource Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getImages({ + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getImagesOutput(args: GetImagesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getImages(a, opts)) diff --git a/sdk/nodejs/compute/getManagedDisk.ts b/sdk/nodejs/compute/getManagedDisk.ts index c9f3b73ce1..cb713dcab2 100644 --- a/sdk/nodejs/compute/getManagedDisk.ts +++ b/sdk/nodejs/compute/getManagedDisk.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Managed Disk. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.compute.getManagedDisk({ + * name: "example-datadisk", + * resourceGroupName: "example-resources", + * }); + * export const id = existing.then(existing => existing.id); + * ``` */ export function getManagedDisk(args: GetManagedDiskArgs, opts?: pulumi.InvokeOptions): Promise { @@ -106,6 +119,19 @@ export interface GetManagedDiskResult { } /** * Use this data source to access information about an existing Managed Disk. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.compute.getManagedDisk({ + * name: "example-datadisk", + * resourceGroupName: "example-resources", + * }); + * export const id = existing.then(existing => existing.id); + * ``` */ export function getManagedDiskOutput(args: GetManagedDiskOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getManagedDisk(a, opts)) diff --git a/sdk/nodejs/compute/getOrchestratedVirtualMachineScaleSet.ts b/sdk/nodejs/compute/getOrchestratedVirtualMachineScaleSet.ts index 9a7581563f..2e1830934d 100644 --- a/sdk/nodejs/compute/getOrchestratedVirtualMachineScaleSet.ts +++ b/sdk/nodejs/compute/getOrchestratedVirtualMachineScaleSet.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Orchestrated Virtual Machine Scale Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getOrchestratedVirtualMachineScaleSet({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getOrchestratedVirtualMachineScaleSet(args: GetOrchestratedVirtualMachineScaleSetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -60,6 +73,19 @@ export interface GetOrchestratedVirtualMachineScaleSetResult { } /** * Use this data source to access information about an existing Orchestrated Virtual Machine Scale Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getOrchestratedVirtualMachineScaleSet({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getOrchestratedVirtualMachineScaleSetOutput(args: GetOrchestratedVirtualMachineScaleSetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getOrchestratedVirtualMachineScaleSet(a, opts)) diff --git a/sdk/nodejs/compute/getPlatformImage.ts b/sdk/nodejs/compute/getPlatformImage.ts index 3d6f34ae1f..e297883f55 100644 --- a/sdk/nodejs/compute/getPlatformImage.ts +++ b/sdk/nodejs/compute/getPlatformImage.ts @@ -6,6 +6,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about a Platform Image. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getPlatformImage({ + * location: "West Europe", + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPlatformImage(args: GetPlatformImageArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +76,21 @@ export interface GetPlatformImageResult { } /** * Use this data source to access information about a Platform Image. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getPlatformImage({ + * location: "West Europe", + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPlatformImageOutput(args: GetPlatformImageOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPlatformImage(a, opts)) diff --git a/sdk/nodejs/compute/getSharedImage.ts b/sdk/nodejs/compute/getSharedImage.ts index a030458fe4..0b1482b60a 100644 --- a/sdk/nodejs/compute/getSharedImage.ts +++ b/sdk/nodejs/compute/getSharedImage.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Shared Image within a Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImage({ + * galleryName: "my-image-gallery", + * name: "my-image", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImage(args: GetSharedImageArgs, opts?: pulumi.InvokeOptions): Promise { @@ -99,6 +112,19 @@ export interface GetSharedImageResult { } /** * Use this data source to access information about an existing Shared Image within a Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImage({ + * galleryName: "my-image-gallery", + * name: "my-image", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImageOutput(args: GetSharedImageOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSharedImage(a, opts)) diff --git a/sdk/nodejs/compute/getSharedImageGallery.ts b/sdk/nodejs/compute/getSharedImageGallery.ts index dc1213c307..deb6c90cbe 100644 --- a/sdk/nodejs/compute/getSharedImageGallery.ts +++ b/sdk/nodejs/compute/getSharedImageGallery.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImageGallery({ + * name: "my-image-gallery", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImageGallery(args: GetSharedImageGalleryArgs, opts?: pulumi.InvokeOptions): Promise { @@ -56,6 +68,18 @@ export interface GetSharedImageGalleryResult { } /** * Use this data source to access information about an existing Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImageGallery({ + * name: "my-image-gallery", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImageGalleryOutput(args: GetSharedImageGalleryOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSharedImageGallery(a, opts)) diff --git a/sdk/nodejs/compute/getSharedImageVersion.ts b/sdk/nodejs/compute/getSharedImageVersion.ts index 7673b9cfb2..26e5890ce8 100644 --- a/sdk/nodejs/compute/getSharedImageVersion.ts +++ b/sdk/nodejs/compute/getSharedImageVersion.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Version of a Shared Image within a Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImageVersion({ + * galleryName: "my-image-gallery", + * imageName: "my-image", + * name: "1.0.0", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImageVersion(args: GetSharedImageVersionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -98,6 +112,20 @@ export interface GetSharedImageVersionResult { } /** * Use this data source to access information about an existing Version of a Shared Image within a Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImageVersion({ + * galleryName: "my-image-gallery", + * imageName: "my-image", + * name: "1.0.0", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImageVersionOutput(args: GetSharedImageVersionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSharedImageVersion(a, opts)) diff --git a/sdk/nodejs/compute/getSharedImageVersions.ts b/sdk/nodejs/compute/getSharedImageVersions.ts index b2201c839b..9b6c7c3b19 100644 --- a/sdk/nodejs/compute/getSharedImageVersions.ts +++ b/sdk/nodejs/compute/getSharedImageVersions.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about existing Versions of a Shared Image within a Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImageVersions({ + * galleryName: "my-image-gallery", + * imageName: "my-image", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImageVersions(args: GetSharedImageVersionsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +74,19 @@ export interface GetSharedImageVersionsResult { } /** * Use this data source to access information about existing Versions of a Shared Image within a Shared Image Gallery. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSharedImageVersions({ + * galleryName: "my-image-gallery", + * imageName: "my-image", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSharedImageVersionsOutput(args: GetSharedImageVersionsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSharedImageVersions(a, opts)) diff --git a/sdk/nodejs/compute/getSnapshot.ts b/sdk/nodejs/compute/getSnapshot.ts index fdf0c09237..743cc716cb 100644 --- a/sdk/nodejs/compute/getSnapshot.ts +++ b/sdk/nodejs/compute/getSnapshot.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Snapshot. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSnapshot({ + * name: "my-snapshot", + * resourceGroupName: "my-resource-group", + * }); + * ``` */ export function getSnapshot(args: GetSnapshotArgs, opts?: pulumi.InvokeOptions): Promise { @@ -69,6 +81,18 @@ export interface GetSnapshotResult { } /** * Use this data source to access information about an existing Snapshot. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSnapshot({ + * name: "my-snapshot", + * resourceGroupName: "my-resource-group", + * }); + * ``` */ export function getSnapshotOutput(args: GetSnapshotOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSnapshot(a, opts)) diff --git a/sdk/nodejs/compute/getSshPublicKey.ts b/sdk/nodejs/compute/getSshPublicKey.ts index 0ddc36e112..5c43f732f8 100644 --- a/sdk/nodejs/compute/getSshPublicKey.ts +++ b/sdk/nodejs/compute/getSshPublicKey.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing SSH Public Key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSshPublicKey({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getSshPublicKey(args: GetSshPublicKeyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +66,19 @@ export interface GetSshPublicKeyResult { } /** * Use this data source to access information about an existing SSH Public Key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getSshPublicKey({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getSshPublicKeyOutput(args: GetSshPublicKeyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSshPublicKey(a, opts)) diff --git a/sdk/nodejs/compute/getVirtualMachine.ts b/sdk/nodejs/compute/getVirtualMachine.ts index 5d0a606348..a45a450b37 100644 --- a/sdk/nodejs/compute/getVirtualMachine.ts +++ b/sdk/nodejs/compute/getVirtualMachine.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Virtual Machine. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getVirtualMachine({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualMachineId = example.then(example => example.id); + * ``` */ export function getVirtualMachine(args: GetVirtualMachineArgs, opts?: pulumi.InvokeOptions): Promise { @@ -70,6 +83,19 @@ export interface GetVirtualMachineResult { } /** * Use this data source to access information about an existing Virtual Machine. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getVirtualMachine({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualMachineId = example.then(example => example.id); + * ``` */ export function getVirtualMachineOutput(args: GetVirtualMachineOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualMachine(a, opts)) diff --git a/sdk/nodejs/compute/getVirtualMachineScaleSet.ts b/sdk/nodejs/compute/getVirtualMachineScaleSet.ts index e31951f4f2..d502389d79 100644 --- a/sdk/nodejs/compute/getVirtualMachineScaleSet.ts +++ b/sdk/nodejs/compute/getVirtualMachineScaleSet.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Virtual Machine Scale Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getVirtualMachineScaleSet({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getVirtualMachineScaleSet(args: GetVirtualMachineScaleSetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -64,6 +77,19 @@ export interface GetVirtualMachineScaleSetResult { } /** * Use this data source to access information about an existing Virtual Machine Scale Set. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.compute.getVirtualMachineScaleSet({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getVirtualMachineScaleSetOutput(args: GetVirtualMachineScaleSetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualMachineScaleSet(a, opts)) diff --git a/sdk/nodejs/compute/linuxVirtualMachine.ts b/sdk/nodejs/compute/linuxVirtualMachine.ts index c6db2bcfa8..4cbfb436f3 100644 --- a/sdk/nodejs/compute/linuxVirtualMachine.ts +++ b/sdk/nodejs/compute/linuxVirtualMachine.ts @@ -21,6 +21,58 @@ import * as utilities from "../utilities"; * * > In this release there's a known issue where the `publicIpAddress` and `publicIpAddresses` fields may not be fully populated for Dynamic Public IP's. * + * ## Example Usage + * + * This example provisions a basic Linux Virtual Machine on an internal network. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "internal", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_F2", + * adminUsername: "adminuser", + * networkInterfaceIds: [exampleNetworkInterface.id], + * adminSshKeys: [{ + * username: "adminuser", + * publicKey: fs.readFileSync("~/.ssh/id_rsa.pub"), + * }], + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * }); + * ``` + * * ## Import * * Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/linuxVirtualMachineScaleSet.ts b/sdk/nodejs/compute/linuxVirtualMachineScaleSet.ts index f31d72c86d..99e7fd45c9 100644 --- a/sdk/nodejs/compute/linuxVirtualMachineScaleSet.ts +++ b/sdk/nodejs/compute/linuxVirtualMachineScaleSet.ts @@ -13,6 +13,58 @@ import * as utilities from "../utilities"; * * > **NOTE:** This provider will automatically update & reimage the nodes in the Scale Set (if Required) during an Update - this behaviour can be configured using the `features` setting within the Provider block. * + * ## Example Usage + * + * This example provisions a basic Linux Virtual Machine Scale Set on an internal network. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const firstPublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com"; + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard_F2", + * instances: 1, + * adminUsername: "adminuser", + * adminSshKeys: [{ + * username: "adminuser", + * publicKey: firstPublicKey, + * }], + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * osDisk: { + * storageAccountType: "Standard_LRS", + * caching: "ReadWrite", + * }, + * networkInterfaces: [{ + * name: "example", + * primary: true, + * ipConfigurations: [{ + * name: "internal", + * primary: true, + * subnetId: internal.id, + * }], + * }], + * }); + * ``` + * * ## Import * * Linux Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/managedDisk.ts b/sdk/nodejs/compute/managedDisk.ts index 9ec7164b25..23787daef3 100644 --- a/sdk/nodejs/compute/managedDisk.ts +++ b/sdk/nodejs/compute/managedDisk.ts @@ -10,6 +10,53 @@ import * as utilities from "../utilities"; * Manages a managed disk. * * ## Example Usage + * ### With Create Empty + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleManagedDisk = new azure.compute.ManagedDisk("exampleManagedDisk", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccountType: "Standard_LRS", + * createOption: "Empty", + * diskSizeGb: 1, + * tags: { + * environment: "staging", + * }, + * }); + * ``` + * ### With Create Copy + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const source = new azure.compute.ManagedDisk("source", { + * location: example.location, + * resourceGroupName: example.name, + * storageAccountType: "Standard_LRS", + * createOption: "Empty", + * diskSizeGb: 1, + * tags: { + * environment: "staging", + * }, + * }); + * const copy = new azure.compute.ManagedDisk("copy", { + * location: example.location, + * resourceGroupName: example.name, + * storageAccountType: "Standard_LRS", + * createOption: "Copy", + * sourceResourceId: source.id, + * diskSizeGb: 1, + * tags: { + * environment: "staging", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/compute/managedDiskSasToken.ts b/sdk/nodejs/compute/managedDiskSasToken.ts index 6907ea9e0b..7be53bd5e7 100644 --- a/sdk/nodejs/compute/managedDiskSasToken.ts +++ b/sdk/nodejs/compute/managedDiskSasToken.ts @@ -13,6 +13,27 @@ import * as utilities from "../utilities"; * * With the help of this resource, data from the disk can be copied from managed disk to a storage blob or to some other system without the need of azcopy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const testResourceGroup = new azure.core.ResourceGroup("testResourceGroup", {location: "West Europe"}); + * const testManagedDisk = new azure.compute.ManagedDisk("testManagedDisk", { + * location: testResourceGroup.location, + * resourceGroupName: testResourceGroup.name, + * storageAccountType: "Standard_LRS", + * createOption: "Empty", + * diskSizeGb: 1, + * }); + * const testManagedDiskSasToken = new azure.compute.ManagedDiskSasToken("testManagedDiskSasToken", { + * managedDiskId: testManagedDisk.id, + * durationInSeconds: 300, + * accessLevel: "Read", + * }); + * ``` + * * ## Import * * Disk SAS Token can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/orchestratedVirtualMachineScaleSet.ts b/sdk/nodejs/compute/orchestratedVirtualMachineScaleSet.ts index 45eada53fe..9e16e0fbb1 100644 --- a/sdk/nodejs/compute/orchestratedVirtualMachineScaleSet.ts +++ b/sdk/nodejs/compute/orchestratedVirtualMachineScaleSet.ts @@ -15,6 +15,21 @@ import * as utilities from "../utilities"; * * > **NOTE:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleOrchestratedVirtualMachineScaleSet = new azure.compute.OrchestratedVirtualMachineScaleSet("exampleOrchestratedVirtualMachineScaleSet", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * platformFaultDomainCount: 1, + * zones: ["1"], + * }); + * ``` + * * ## Import * * An Orchestrated Virtual Machine Scale Set can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/packetCapture.ts b/sdk/nodejs/compute/packetCapture.ts index 4d33320a67..c8f376c6eb 100644 --- a/sdk/nodejs/compute/packetCapture.ts +++ b/sdk/nodejs/compute/packetCapture.ts @@ -9,6 +9,88 @@ import * as utilities from "../utilities"; /** * Configures Network Packet Capturing against a Virtual Machine using a Network Watcher. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkWatcher = new azure.network.NetworkWatcher("exampleNetworkWatcher", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleVirtualMachine = new azure.compute.VirtualMachine("exampleVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * networkInterfaceIds: [exampleNetworkInterface.id], + * vmSize: "Standard_F2", + * storageImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * storageOsDisk: { + * name: "osdisk", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Standard_LRS", + * }, + * osProfile: { + * computerName: "pctest-vm", + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: false, + * }, + * }); + * const exampleExtension = new azure.compute.Extension("exampleExtension", { + * virtualMachineId: exampleVirtualMachine.id, + * publisher: "Microsoft.Azure.NetworkWatcher", + * type: "NetworkWatcherAgentLinux", + * typeHandlerVersion: "1.4", + * autoUpgradeMinorVersion: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePacketCapture = new azure.compute.PacketCapture("examplePacketCapture", { + * networkWatcherId: exampleNetworkWatcher.id, + * virtualMachineId: exampleVirtualMachine.id, + * storageLocation: { + * storageAccountId: exampleAccount.id, + * }, + * }, { + * dependsOn: [exampleExtension], + * }); + * ``` + * + * > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `azure.compute.Extension` resource. + * * ## Import * * Virtual Machine Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/scaleSet.ts b/sdk/nodejs/compute/scaleSet.ts index 872f10d1e3..f174bb6251 100644 --- a/sdk/nodejs/compute/scaleSet.ts +++ b/sdk/nodejs/compute/scaleSet.ts @@ -10,6 +10,206 @@ import * as utilities from "../utilities"; * Manages a virtual machine scale set. * * ## Example Usage + * ### With Managed Disks (Recommended) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * domainNameLabel: exampleResourceGroup.name, + * tags: { + * environment: "staging", + * }, + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const bpepool = new azure.lb.BackendAddressPool("bpepool", {loadbalancerId: exampleLoadBalancer.id}); + * const lbnatpool = new azure.lb.NatPool("lbnatpool", { + * resourceGroupName: exampleResourceGroup.name, + * loadbalancerId: exampleLoadBalancer.id, + * protocol: "Tcp", + * frontendPortStart: 50000, + * frontendPortEnd: 50119, + * backendPort: 22, + * frontendIpConfigurationName: "PublicIPAddress", + * }); + * const exampleProbe = new azure.lb.Probe("exampleProbe", { + * loadbalancerId: exampleLoadBalancer.id, + * protocol: "Http", + * requestPath: "/health", + * port: 8080, + * }); + * const exampleScaleSet = new azure.compute.ScaleSet("exampleScaleSet", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * automaticOsUpgrade: true, + * upgradePolicyMode: "Rolling", + * rollingUpgradePolicy: { + * maxBatchInstancePercent: 20, + * maxUnhealthyInstancePercent: 20, + * maxUnhealthyUpgradedInstancePercent: 5, + * pauseTimeBetweenBatches: "PT0S", + * }, + * healthProbeId: exampleProbe.id, + * sku: { + * name: "Standard_F2", + * tier: "Standard", + * capacity: 2, + * }, + * storageProfileImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * storageProfileOsDisk: { + * name: "", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Standard_LRS", + * }, + * storageProfileDataDisks: [{ + * lun: 0, + * caching: "ReadWrite", + * createOption: "Empty", + * diskSizeGb: 10, + * }], + * osProfile: { + * computerNamePrefix: "testvm", + * adminUsername: "myadmin", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: true, + * sshKeys: [{ + * path: "/home/myadmin/.ssh/authorized_keys", + * keyData: fs.readFileSync("~/.ssh/demo_key.pub"), + * }], + * }, + * networkProfiles: [{ + * name: "mynetworkprofile", + * primary: true, + * ipConfigurations: [{ + * name: "TestIPConfiguration", + * primary: true, + * subnetId: exampleSubnet.id, + * loadBalancerBackendAddressPoolIds: [bpepool.id], + * loadBalancerInboundNatRulesIds: [lbnatpool.id], + * }], + * }], + * tags: { + * environment: "staging", + * }, + * }); + * ``` + * ### With Unmanaged Disks + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleScaleSet = new azure.compute.ScaleSet("exampleScaleSet", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * upgradePolicyMode: "Manual", + * sku: { + * name: "Standard_F2", + * tier: "Standard", + * capacity: 2, + * }, + * osProfile: { + * computerNamePrefix: "testvm", + * adminUsername: "myadmin", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: true, + * sshKeys: [{ + * path: "/home/myadmin/.ssh/authorized_keys", + * keyData: fs.readFileSync("~/.ssh/demo_key.pub"), + * }], + * }, + * networkProfiles: [{ + * name: "TestNetworkProfile", + * primary: true, + * ipConfigurations: [{ + * name: "TestIPConfiguration", + * primary: true, + * subnetId: exampleSubnet.id, + * }], + * }], + * storageProfileOsDisk: { + * name: "osDiskProfile", + * caching: "ReadWrite", + * createOption: "FromImage", + * vhdContainers: [pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}`], + * }, + * storageProfileImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * }); + * ``` + * ## Example of storageProfileImageReference with id + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleImage = new azure.compute.Image("exampleImage", {}); + * // ... + * const exampleScaleSet = new azure.compute.ScaleSet("exampleScaleSet", {storageProfileImageReference: { + * id: exampleImage.id, + * }}); + * // ... + * ``` * * ## Import * diff --git a/sdk/nodejs/compute/scaleSetPacketCapture.ts b/sdk/nodejs/compute/scaleSetPacketCapture.ts index 285c04cbb0..177c4e6c29 100644 --- a/sdk/nodejs/compute/scaleSetPacketCapture.ts +++ b/sdk/nodejs/compute/scaleSetPacketCapture.ts @@ -9,6 +9,82 @@ import * as utilities from "../utilities"; /** * Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkWatcher = new azure.network.NetworkWatcher("exampleNetworkWatcher", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard_F2", + * instances: 4, + * adminUsername: "adminuser", + * adminPassword: "P@ssword1234!", + * computerNamePrefix: "my-linux-computer-name-prefix", + * upgradeMode: "Automatic", + * disablePasswordAuthentication: false, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * osDisk: { + * storageAccountType: "Standard_LRS", + * caching: "ReadWrite", + * }, + * networkInterfaces: [{ + * name: "example", + * primary: true, + * ipConfigurations: [{ + * name: "internal", + * primary: true, + * subnetId: exampleSubnet.id, + * }], + * }], + * }); + * const exampleVirtualMachineScaleSetExtension = new azure.compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", { + * virtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.id, + * publisher: "Microsoft.Azure.NetworkWatcher", + * type: "NetworkWatcherAgentLinux", + * typeHandlerVersion: "1.4", + * autoUpgradeMinorVersion: true, + * automaticUpgradeEnabled: true, + * }); + * const exampleScaleSetPacketCapture = new azure.compute.ScaleSetPacketCapture("exampleScaleSetPacketCapture", { + * networkWatcherId: exampleNetworkWatcher.id, + * virtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.id, + * storageLocation: { + * filePath: "/var/captures/packet.cap", + * }, + * machineScope: { + * includeInstanceIds: ["0"], + * excludeInstanceIds: ["1"], + * }, + * }, { + * dependsOn: [exampleVirtualMachineScaleSetExtension], + * }); + * ``` + * + * > **NOTE:** This Resource requires that [the Network Watcher Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine Scale Set before capturing can be enabled which can be installed via the `azure.compute.VirtualMachineScaleSetExtension` resource. + * * ## Import * * Virtual Machine Scale Set Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/sharedImage.ts b/sdk/nodejs/compute/sharedImage.ts index 48e53b2135..ba572d64d5 100644 --- a/sdk/nodejs/compute/sharedImage.ts +++ b/sdk/nodejs/compute/sharedImage.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Shared Image within a Shared Image Gallery. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSharedImageGallery = new azure.compute.SharedImageGallery("exampleSharedImageGallery", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * description: "Shared images and things.", + * tags: { + * Hello: "There", + * World: "Example", + * }, + * }); + * const exampleSharedImage = new azure.compute.SharedImage("exampleSharedImage", { + * galleryName: exampleSharedImageGallery.name, + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * osType: "Linux", + * identifier: { + * publisher: "PublisherName", + * offer: "OfferName", + * sku: "ExampleSku", + * }, + * }); + * ``` + * * ## Import * * Shared Images can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/sharedImageGallery.ts b/sdk/nodejs/compute/sharedImageGallery.ts index d4d1b98dbd..36122e24cb 100644 --- a/sdk/nodejs/compute/sharedImageGallery.ts +++ b/sdk/nodejs/compute/sharedImageGallery.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages a Shared Image Gallery. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSharedImageGallery = new azure.compute.SharedImageGallery("exampleSharedImageGallery", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * description: "Shared images and things.", + * tags: { + * Hello: "There", + * World: "Example", + * }, + * }); + * ``` + * * ## Import * * Shared Image Galleries can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/sharedImageVersion.ts b/sdk/nodejs/compute/sharedImageVersion.ts index d24b3c7dfe..f2b12c4c6b 100644 --- a/sdk/nodejs/compute/sharedImageVersion.ts +++ b/sdk/nodejs/compute/sharedImageVersion.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Version of a Shared Image within a Shared Image Gallery. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existingImage = azure.compute.getImage({ + * name: "search-api", + * resourceGroupName: "packerimages", + * }); + * const existingSharedImage = azure.compute.getSharedImage({ + * name: "existing-image", + * galleryName: "existing_gallery", + * resourceGroupName: "existing-resources", + * }); + * const example = new azure.compute.SharedImageVersion("example", { + * galleryName: existingSharedImage.then(existingSharedImage => existingSharedImage.galleryName), + * imageName: existingSharedImage.then(existingSharedImage => existingSharedImage.name), + * resourceGroupName: existingSharedImage.then(existingSharedImage => existingSharedImage.resourceGroupName), + * location: existingSharedImage.then(existingSharedImage => existingSharedImage.location), + * managedImageId: existingImage.then(existingImage => existingImage.id), + * targetRegions: [{ + * name: existingSharedImage.then(existingSharedImage => existingSharedImage.location), + * regionalReplicaCount: 5, + * storageAccountType: "Standard_LRS", + * }], + * }); + * ``` + * * ## Import * * Shared Image Versions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/snapshot.ts b/sdk/nodejs/compute/snapshot.ts index 27ed6f38a2..68b8759a7a 100644 --- a/sdk/nodejs/compute/snapshot.ts +++ b/sdk/nodejs/compute/snapshot.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Disk Snapshot. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleManagedDisk = new azure.compute.ManagedDisk("exampleManagedDisk", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccountType: "Standard_LRS", + * createOption: "Empty", + * diskSizeGb: 10, + * }); + * const exampleSnapshot = new azure.compute.Snapshot("exampleSnapshot", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * createOption: "Copy", + * sourceUri: exampleManagedDisk.id, + * }); + * ``` + * * ## Import * * Snapshots can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/sshPublicKey.ts b/sdk/nodejs/compute/sshPublicKey.ts index bba4abd410..f084a3085b 100644 --- a/sdk/nodejs/compute/sshPublicKey.ts +++ b/sdk/nodejs/compute/sshPublicKey.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manages a SSH Public Key. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const example = new azure.compute.SshPublicKey("example", { + * resourceGroupName: "example", + * location: "West Europe", + * publicKey: fs.readFileSync("~/.ssh/id_rsa.pub"), + * }); + * ``` + * * ## Import * * SSH Public Keys can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/virtualMachine.ts b/sdk/nodejs/compute/virtualMachine.ts index b0edb5dca6..5c14dd46f1 100644 --- a/sdk/nodejs/compute/virtualMachine.ts +++ b/sdk/nodejs/compute/virtualMachine.ts @@ -16,6 +16,66 @@ import * as utilities from "../utilities"; * > **Note:** Data Disks can be attached either directly on the `azure.compute.VirtualMachine` resource, or using the `azure.compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur. * * ## Example Usage + * ### From An Azure Platform Image) + * + * This example provisions a Virtual Machine with Managed Disks. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const config = new pulumi.Config(); + * const prefix = config.get("prefix") || "tfvmex"; + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const mainVirtualNetwork = new azure.network.VirtualNetwork("mainVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: example.location, + * resourceGroupName: example.name, + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: example.name, + * virtualNetworkName: mainVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const mainNetworkInterface = new azure.network.NetworkInterface("mainNetworkInterface", { + * location: example.location, + * resourceGroupName: example.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: internal.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const mainVirtualMachine = new azure.compute.VirtualMachine("mainVirtualMachine", { + * location: example.location, + * resourceGroupName: example.name, + * networkInterfaceIds: [mainNetworkInterface.id], + * vmSize: "Standard_DS1_v2", + * storageImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * storageOsDisk: { + * name: "myosdisk1", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Standard_LRS", + * }, + * osProfile: { + * computerName: "hostname", + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: false, + * }, + * tags: { + * environment: "staging", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/compute/virtualMachineScaleSetExtension.ts b/sdk/nodejs/compute/virtualMachineScaleSetExtension.ts index 615e11e9e2..546ab45a8a 100644 --- a/sdk/nodejs/compute/virtualMachineScaleSetExtension.ts +++ b/sdk/nodejs/compute/virtualMachineScaleSetExtension.ts @@ -11,6 +11,47 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource is not intended to be used with the `azure.compute.ScaleSet` resource - instead it's intended for this to be used with the `azure.compute.LinuxVirtualMachineScaleSet` and `azure.compute.WindowsVirtualMachineScaleSet` resources. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard_F2", + * adminUsername: "adminuser", + * instances: 1, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * networkInterfaces: [{ + * name: "example", + * ipConfigurations: [{ + * name: "internal", + * }], + * }], + * osDisk: { + * storageAccountType: "Standard_LRS", + * caching: "ReadWrite", + * }, + * }); + * const exampleVirtualMachineScaleSetExtension = new azure.compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", { + * virtualMachineScaleSetId: exampleLinuxVirtualMachineScaleSet.id, + * publisher: "Microsoft.Azure.Extensions", + * type: "CustomScript", + * typeHandlerVersion: "2.0", + * settings: JSON.stringify({ + * commandToExecute: "echo $HOSTNAME", + * }), + * }); + * ``` + * * ## Import * * Virtual Machine Scale Set Extensions can be imported using the `resource id`, e.g. @@ -103,6 +144,10 @@ export class VirtualMachineScaleSetExtension extends pulumi.CustomResource { * Specifies the version of the extension to use, available versions can be found using the Azure CLI. * * > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ public readonly typeHandlerVersion!: pulumi.Output; /** @@ -233,6 +278,10 @@ export interface VirtualMachineScaleSetExtensionState { * Specifies the version of the extension to use, available versions can be found using the Azure CLI. * * > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ typeHandlerVersion?: pulumi.Input; /** @@ -303,6 +352,10 @@ export interface VirtualMachineScaleSetExtensionArgs { * Specifies the version of the extension to use, available versions can be found using the Azure CLI. * * > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ typeHandlerVersion: pulumi.Input; /** diff --git a/sdk/nodejs/compute/windowsVirtualMachine.ts b/sdk/nodejs/compute/windowsVirtualMachine.ts index 269f7f7b44..44379a6921 100644 --- a/sdk/nodejs/compute/windowsVirtualMachine.ts +++ b/sdk/nodejs/compute/windowsVirtualMachine.ts @@ -21,6 +21,54 @@ import * as utilities from "../utilities"; * * > In this release there's a known issue where the `publicIpAddress` and `publicIpAddresses` fields may not be fully populated for Dynamic Public IP's. * + * ## Example Usage + * + * This example provisions a basic Windows Virtual Machine on an internal network. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "internal", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleWindowsVirtualMachine = new azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_F2", + * adminUsername: "adminuser", + * adminPassword: "P@$$w0rd1234!", + * networkInterfaceIds: [exampleNetworkInterface.id], + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * sourceImageReference: { + * publisher: "MicrosoftWindowsServer", + * offer: "WindowsServer", + * sku: "2016-Datacenter", + * version: "latest", + * }, + * }); + * ``` + * * ## Import * * Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/compute/windowsVirtualMachineScaleSet.ts b/sdk/nodejs/compute/windowsVirtualMachineScaleSet.ts index a5255fffb1..d6f0eeca9a 100644 --- a/sdk/nodejs/compute/windowsVirtualMachineScaleSet.ts +++ b/sdk/nodejs/compute/windowsVirtualMachineScaleSet.ts @@ -17,6 +17,54 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `azure.compute.ScaleSet` resource instead * + * ## Example Usage + * + * This example provisions a basic Windows Virtual Machine Scale Set on an internal network. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleWindowsVirtualMachineScaleSet = new azure.compute.WindowsVirtualMachineScaleSet("exampleWindowsVirtualMachineScaleSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard_F2", + * instances: 1, + * adminPassword: "P@55w0rd1234!", + * adminUsername: "adminuser", + * sourceImageReference: { + * publisher: "MicrosoftWindowsServer", + * offer: "WindowsServer", + * sku: "2016-Datacenter-Server-Core", + * version: "latest", + * }, + * osDisk: { + * storageAccountType: "Standard_LRS", + * caching: "ReadWrite", + * }, + * networkInterfaces: [{ + * name: "example", + * primary: true, + * ipConfigurations: [{ + * name: "internal", + * primary: true, + * subnetId: internal.id, + * }], + * }], + * }); + * ``` + * * ## Import * * Windows Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/confidentialledger/ledger.ts b/sdk/nodejs/confidentialledger/ledger.ts index 7d2bff86ab..559832bf12 100644 --- a/sdk/nodejs/confidentialledger/ledger.ts +++ b/sdk/nodejs/confidentialledger/ledger.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; /** * Manages a Confidential Ledger. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const ledger = new azure.confidentialledger.Ledger("ledger", { + * resourceGroupName: example.name, + * location: example.location, + * ledgerType: "Private", + * azureadBasedServicePrincipals: [{ + * principalId: current.then(current => current.objectId), + * tenantId: current.then(current => current.tenantId), + * ledgerRoleName: "Administrator", + * }], + * }); + * ``` + * * ## Import * * Confidential Ledgers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/connections/apiConnection.ts b/sdk/nodejs/connections/apiConnection.ts index 43ec7fc0d1..d0cc5ad880 100644 --- a/sdk/nodejs/connections/apiConnection.ts +++ b/sdk/nodejs/connections/apiConnection.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages an API Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleManagedApi = azure.connections.getManagedApiOutput({ + * name: "servicebus", + * location: exampleResourceGroup.location, + * }); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Basic", + * }); + * const exampleApiConnection = new azure.connections.ApiConnection("exampleApiConnection", { + * resourceGroupName: exampleResourceGroup.name, + * managedApiId: exampleManagedApi.apply(exampleManagedApi => exampleManagedApi.id), + * displayName: "Example 1", + * parameterValues: { + * connectionString: exampleNamespace.defaultPrimaryConnectionString, + * }, + * tags: { + * Hello: "World", + * }, + * }); + * ``` + * * ## Import * * API Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/connections/getManagedApi.ts b/sdk/nodejs/connections/getManagedApi.ts index e2c7ef45c2..45d1343b49 100644 --- a/sdk/nodejs/connections/getManagedApi.ts +++ b/sdk/nodejs/connections/getManagedApi.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing Managed API. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.connections.getManagedApi({ + * name: "servicebus", + * location: "West Europe", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getManagedApi(args: GetManagedApiArgs, opts?: pulumi.InvokeOptions): Promise { @@ -44,6 +57,19 @@ export interface GetManagedApiResult { } /** * Uses this data source to access information about an existing Managed API. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.connections.getManagedApi({ + * name: "servicebus", + * location: "West Europe", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getManagedApiOutput(args: GetManagedApiOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getManagedApi(a, opts)) diff --git a/sdk/nodejs/consumption/budgetManagementGroup.ts b/sdk/nodejs/consumption/budgetManagementGroup.ts index 7b98c7dc9d..67de7a5f22 100644 --- a/sdk/nodejs/consumption/budgetManagementGroup.ts +++ b/sdk/nodejs/consumption/budgetManagementGroup.ts @@ -9,6 +9,59 @@ import * as utilities from "../utilities"; /** * Manages a Consumption Budget for a Management Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleGroup = new azure.management.Group("exampleGroup", {displayName: "example"}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "eastus"}); + * const exampleBudgetManagementGroup = new azure.consumption.BudgetManagementGroup("exampleBudgetManagementGroup", { + * managementGroupId: exampleGroup.id, + * amount: 1000, + * timeGrain: "Monthly", + * timePeriod: { + * startDate: "2022-06-01T00:00:00Z", + * endDate: "2022-07-01T00:00:00Z", + * }, + * filter: { + * dimensions: [{ + * name: "ResourceGroupName", + * values: [exampleResourceGroup.name], + * }], + * tags: [{ + * name: "foo", + * values: [ + * "bar", + * "baz", + * ], + * }], + * }, + * notifications: [ + * { + * enabled: true, + * threshold: 90, + * operator: "EqualTo", + * contactEmails: [ + * "foo@example.com", + * "bar@example.com", + * ], + * }, + * { + * enabled: false, + * threshold: 100, + * operator: "GreaterThan", + * thresholdType: "Forecasted", + * contactEmails: [ + * "foo@example.com", + * "bar@example.com", + * ], + * }, + * ], + * }); + * ``` + * * ## Import * * Management Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/consumption/budgetResourceGroup.ts b/sdk/nodejs/consumption/budgetResourceGroup.ts index 9b1b89f777..dcf63f3eb2 100644 --- a/sdk/nodejs/consumption/budgetResourceGroup.ts +++ b/sdk/nodejs/consumption/budgetResourceGroup.ts @@ -9,6 +9,64 @@ import * as utilities from "../utilities"; /** * Manages a Resource Group Consumption Budget. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "eastus"}); + * const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "example", + * }); + * const exampleBudgetResourceGroup = new azure.consumption.BudgetResourceGroup("exampleBudgetResourceGroup", { + * resourceGroupId: exampleResourceGroup.id, + * amount: 1000, + * timeGrain: "Monthly", + * timePeriod: { + * startDate: "2022-06-01T00:00:00Z", + * endDate: "2022-07-01T00:00:00Z", + * }, + * filter: { + * dimensions: [{ + * name: "ResourceId", + * values: [exampleActionGroup.id], + * }], + * tags: [{ + * name: "foo", + * values: [ + * "bar", + * "baz", + * ], + * }], + * }, + * notifications: [ + * { + * enabled: true, + * threshold: 90, + * operator: "EqualTo", + * thresholdType: "Forecasted", + * contactEmails: [ + * "foo@example.com", + * "bar@example.com", + * ], + * contactGroups: [exampleActionGroup.id], + * contactRoles: ["Owner"], + * }, + * { + * enabled: false, + * threshold: 100, + * operator: "GreaterThan", + * contactEmails: [ + * "foo@example.com", + * "bar@example.com", + * ], + * }, + * ], + * }); + * ``` + * * ## Import * * Resource Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/consumption/budgetSubscription.ts b/sdk/nodejs/consumption/budgetSubscription.ts index 76b1809ac9..91c75df423 100644 --- a/sdk/nodejs/consumption/budgetSubscription.ts +++ b/sdk/nodejs/consumption/budgetSubscription.ts @@ -9,6 +9,65 @@ import * as utilities from "../utilities"; /** * Manages a Subscription Consumption Budget. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "eastus"}); + * const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "example", + * }); + * const exampleBudgetSubscription = new azure.consumption.BudgetSubscription("exampleBudgetSubscription", { + * subscriptionId: current.then(current => current.id), + * amount: 1000, + * timeGrain: "Monthly", + * timePeriod: { + * startDate: "2022-06-01T00:00:00Z", + * endDate: "2022-07-01T00:00:00Z", + * }, + * filter: { + * dimensions: [{ + * name: "ResourceGroupName", + * values: [exampleResourceGroup.name], + * }], + * tags: [{ + * name: "foo", + * values: [ + * "bar", + * "baz", + * ], + * }], + * }, + * notifications: [ + * { + * enabled: true, + * threshold: 90, + * operator: "EqualTo", + * contactEmails: [ + * "foo@example.com", + * "bar@example.com", + * ], + * contactGroups: [exampleActionGroup.id], + * contactRoles: ["Owner"], + * }, + * { + * enabled: false, + * threshold: 100, + * operator: "GreaterThan", + * thresholdType: "Forecasted", + * contactEmails: [ + * "foo@example.com", + * "bar@example.com", + * ], + * }, + * ], + * }); + * ``` + * * ## Import * * Subscription Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/consumption/getBudgetResourceGroup.ts b/sdk/nodejs/consumption/getBudgetResourceGroup.ts index 40df91e3d0..ca9a73e818 100644 --- a/sdk/nodejs/consumption/getBudgetResourceGroup.ts +++ b/sdk/nodejs/consumption/getBudgetResourceGroup.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Consumption Budget for a specific resource group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.consumption.getBudgetResourceGroup({ + * name: "existing", + * resourceGroupId: azurerm_resource_group.example.id, + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getBudgetResourceGroup(args: GetBudgetResourceGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface GetBudgetResourceGroupResult { } /** * Use this data source to access information about an existing Consumption Budget for a specific resource group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.consumption.getBudgetResourceGroup({ + * name: "existing", + * resourceGroupId: azurerm_resource_group.example.id, + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getBudgetResourceGroupOutput(args: GetBudgetResourceGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBudgetResourceGroup(a, opts)) diff --git a/sdk/nodejs/consumption/getBudgetSubscription.ts b/sdk/nodejs/consumption/getBudgetSubscription.ts index bfa966346b..f6ea0ca452 100644 --- a/sdk/nodejs/consumption/getBudgetSubscription.ts +++ b/sdk/nodejs/consumption/getBudgetSubscription.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Consumption Budget for a specific subscription. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.consumption.getBudgetSubscription({ + * name: "existing", + * subscriptionId: "/subscriptions/00000000-0000-0000-0000-000000000000/", + * }); + * export const id = data.azurerm_consumption_budget.example.id; + * ``` */ export function getBudgetSubscription(args: GetBudgetSubscriptionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface GetBudgetSubscriptionResult { } /** * Use this data source to access information about an existing Consumption Budget for a specific subscription. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.consumption.getBudgetSubscription({ + * name: "existing", + * subscriptionId: "/subscriptions/00000000-0000-0000-0000-000000000000/", + * }); + * export const id = data.azurerm_consumption_budget.example.id; + * ``` */ export function getBudgetSubscriptionOutput(args: GetBudgetSubscriptionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBudgetSubscription(a, opts)) diff --git a/sdk/nodejs/containerapp/app.ts b/sdk/nodejs/containerapp/app.ts index ad7062bea0..b66759cac1 100644 --- a/sdk/nodejs/containerapp/app.ts +++ b/sdk/nodejs/containerapp/app.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a Container App. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleEnvironment = new azure.containerapp.Environment("exampleEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * }); + * const exampleApp = new azure.containerapp.App("exampleApp", { + * containerAppEnvironmentId: exampleEnvironment.id, + * resourceGroupName: exampleResourceGroup.name, + * revisionMode: "Single", + * template: { + * containers: [{ + * name: "examplecontainerapp", + * image: "mcr.microsoft.com/azuredocs/containerapps-helloworld:latest", + * cpu: 0.25, + * memory: "0.5Gi", + * }], + * }, + * }); + * ``` + * * ## Import * * A Container App can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerapp/environment.ts b/sdk/nodejs/containerapp/environment.ts index 75495ce42a..f9937a1b8a 100644 --- a/sdk/nodejs/containerapp/environment.ts +++ b/sdk/nodejs/containerapp/environment.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Container App Environment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleEnvironment = new azure.containerapp.Environment("exampleEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * }); + * ``` + * * ## Import * * A Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerapp/environmentDaprComponent.ts b/sdk/nodejs/containerapp/environmentDaprComponent.ts index 96b5f18aff..63fad61dbd 100644 --- a/sdk/nodejs/containerapp/environmentDaprComponent.ts +++ b/sdk/nodejs/containerapp/environmentDaprComponent.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Dapr Component for a Container App Environment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleEnvironment = new azure.containerapp.Environment("exampleEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * }); + * const exampleEnvironmentDaprComponent = new azure.containerapp.EnvironmentDaprComponent("exampleEnvironmentDaprComponent", { + * containerAppEnvironmentId: exampleEnvironment.id, + * componentType: "state.azure.blobstorage", + * version: "v1", + * }); + * ``` + * * ## Import * * A Dapr Component for a Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerapp/environmentStorage.ts b/sdk/nodejs/containerapp/environmentStorage.ts index 1c720e8d64..9f0d3486c8 100644 --- a/sdk/nodejs/containerapp/environmentStorage.ts +++ b/sdk/nodejs/containerapp/environmentStorage.ts @@ -7,6 +7,43 @@ import * as utilities from "../utilities"; /** * Manages a Container App Environment Storage. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleEnvironment = new azure.containerapp.Environment("exampleEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleShare = new azure.storage.Share("exampleShare", { + * storageAccountName: exampleAccount.name, + * quota: 5, + * }); + * const exampleEnvironmentStorage = new azure.containerapp.EnvironmentStorage("exampleEnvironmentStorage", { + * containerAppEnvironmentId: exampleEnvironment.id, + * accountName: exampleAccount.name, + * shareName: exampleShare.name, + * accessKey: exampleAccount.primaryAccessKey, + * accessMode: "ReadOnly", + * }); + * ``` + * * ## Import * * A Container App Environment Storage can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerapp/getApp.ts b/sdk/nodejs/containerapp/getApp.ts index 8dab879a2f..0ab4922cee 100644 --- a/sdk/nodejs/containerapp/getApp.ts +++ b/sdk/nodejs/containerapp/getApp.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Container App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerapp.getApp({ + * name: "example-app", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getApp(args: GetAppArgs, opts?: pulumi.InvokeOptions): Promise { @@ -89,6 +101,18 @@ export interface GetAppResult { } /** * Use this data source to access information about an existing Container App. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerapp.getApp({ + * name: "example-app", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getAppOutput(args: GetAppOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getApp(a, opts)) diff --git a/sdk/nodejs/containerapp/getEnvironment.ts b/sdk/nodejs/containerapp/getEnvironment.ts index fa16778d5f..427e7de358 100644 --- a/sdk/nodejs/containerapp/getEnvironment.ts +++ b/sdk/nodejs/containerapp/getEnvironment.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Container App Environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerapp.getEnvironment({ + * name: "example-environment", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getEnvironment(args: GetEnvironmentArgs, opts?: pulumi.InvokeOptions): Promise { @@ -83,6 +95,18 @@ export interface GetEnvironmentResult { } /** * Use this data source to access information about an existing Container App Environment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerapp.getEnvironment({ + * name: "example-environment", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getEnvironmentOutput(args: GetEnvironmentOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEnvironment(a, opts)) diff --git a/sdk/nodejs/containerapp/getEnvironmentCertificate.ts b/sdk/nodejs/containerapp/getEnvironmentCertificate.ts index 7fb5df68af..a2117b0b18 100644 --- a/sdk/nodejs/containerapp/getEnvironmentCertificate.ts +++ b/sdk/nodejs/containerapp/getEnvironmentCertificate.ts @@ -6,6 +6,22 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Container App Environment Certificate. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleEnvironment = azure.containerapp.getEnvironment({ + * name: "example-environment", + * resourceGroupName: "example-resources", + * }); + * const exampleEnvironmentCertificate = exampleEnvironment.then(exampleEnvironment => azure.containerapp.getEnvironmentCertificate({ + * name: "mycertificate", + * containerAppEnvironmentId: exampleEnvironment.id, + * })); + * ``` */ export function getEnvironmentCertificate(args: GetEnvironmentCertificateArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +83,22 @@ export interface GetEnvironmentCertificateResult { } /** * Use this data source to access information about an existing Container App Environment Certificate. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleEnvironment = azure.containerapp.getEnvironment({ + * name: "example-environment", + * resourceGroupName: "example-resources", + * }); + * const exampleEnvironmentCertificate = exampleEnvironment.then(exampleEnvironment => azure.containerapp.getEnvironmentCertificate({ + * name: "mycertificate", + * containerAppEnvironmentId: exampleEnvironment.id, + * })); + * ``` */ export function getEnvironmentCertificateOutput(args: GetEnvironmentCertificateOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEnvironmentCertificate(a, opts)) diff --git a/sdk/nodejs/containerservice/clusterTrustedAccessRoleBinding.ts b/sdk/nodejs/containerservice/clusterTrustedAccessRoleBinding.ts index 5490b9baa1..bad75596e6 100644 --- a/sdk/nodejs/containerservice/clusterTrustedAccessRoleBinding.ts +++ b/sdk/nodejs/containerservice/clusterTrustedAccessRoleBinding.ts @@ -11,6 +11,68 @@ import * as utilities from "../utilities"; * > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name TrustedAccessPreview` and then `az provider register -n Microsoft.ContainerService` * . * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "example-value", + * }); + * const test = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: data.azurerm_client_config.example.tenant_id, + * skuName: "example-value", + * softDeleteRetentionDays: "example-value", + * }); + * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("exampleAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: data.azurerm_client_config.example.tenant_id, + * objectId: data.azurerm_client_config.example.object_id, + * keyPermissions: "example-value", + * }); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "acctestaksexample", + * defaultNodePool: { + * name: "example-value", + * nodeCount: "example-value", + * vmSize: "example-value", + * }, + * identity: { + * type: "example-value", + * }, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "example-value", + * accountReplicationType: "example-value", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * applicationInsightsId: exampleInsights.id, + * identity: { + * type: "example-value", + * }, + * }); + * const exampleClusterTrustedAccessRoleBinding = new azure.containerservice.ClusterTrustedAccessRoleBinding("exampleClusterTrustedAccessRoleBinding", { + * kubernetesClusterId: exampleKubernetesCluster.id, + * roles: "example-value", + * sourceResourceId: exampleWorkspace.id, + * }); + * ``` + * * ## Import * * An existing Kubernetes Cluster Trusted Access Role Binding can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/connectedRegistry.ts b/sdk/nodejs/containerservice/connectedRegistry.ts index 69327c1b30..a90685747c 100644 --- a/sdk/nodejs/containerservice/connectedRegistry.ts +++ b/sdk/nodejs/containerservice/connectedRegistry.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages a Container Connected Registry. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Premium", + * dataEndpointEnabled: true, + * }); + * const exampleRegistryScopeMap = new azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", { + * containerRegistryName: exampleRegistry.name, + * resourceGroupName: exampleRegistry.resourceGroupName, + * actions: [ + * "repositories/hello-world/content/delete", + * "repositories/hello-world/content/read", + * "repositories/hello-world/content/write", + * "repositories/hello-world/metadata/read", + * "repositories/hello-world/metadata/write", + * "gateway/examplecr/config/read", + * "gateway/examplecr/config/write", + * "gateway/examplecr/message/read", + * "gateway/examplecr/message/write", + * ], + * }); + * const exampleRegistryToken = new azure.containerservice.RegistryToken("exampleRegistryToken", { + * containerRegistryName: exampleRegistry.name, + * resourceGroupName: exampleRegistry.resourceGroupName, + * scopeMapId: exampleRegistryScopeMap.id, + * }); + * const exampleConnectedRegistry = new azure.containerservice.ConnectedRegistry("exampleConnectedRegistry", { + * containerRegistryId: exampleRegistry.id, + * syncTokenId: exampleRegistryToken.id, + * }); + * ``` + * * ## Import * * Container Connected Registries can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/fluxConfiguration.ts b/sdk/nodejs/containerservice/fluxConfiguration.ts index 11a69927d6..4a2a21e7d5 100644 --- a/sdk/nodejs/containerservice/fluxConfiguration.ts +++ b/sdk/nodejs/containerservice/fluxConfiguration.ts @@ -9,6 +9,46 @@ import * as utilities from "../utilities"; /** * Manages a Kubernetes Flux Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: "West Europe", + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "example-aks", + * defaultNodePool: { + * name: "default", + * nodeCount: 1, + * vmSize: "Standard_DS2_v2", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleKubernetesClusterExtension = new azure.containerservice.KubernetesClusterExtension("exampleKubernetesClusterExtension", { + * clusterId: azurerm_kubernetes_cluster.test.id, + * extensionType: "microsoft.flux", + * }); + * const exampleFluxConfiguration = new azure.containerservice.FluxConfiguration("exampleFluxConfiguration", { + * clusterId: azurerm_kubernetes_cluster.test.id, + * namespace: "flux", + * gitRepository: { + * url: "https://github.com/Azure/arc-k8s-demo", + * referenceType: "branch", + * referenceValue: "main", + * }, + * kustomizations: [{ + * name: "kustomization-1", + * }], + * }, { + * dependsOn: [exampleKubernetesClusterExtension], + * }); + * ``` + * * ## Import * * Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/nodejs/containerservice/getClusterNodePool.ts b/sdk/nodejs/containerservice/getClusterNodePool.ts index a6ad507330..ab208feba9 100644 --- a/sdk/nodejs/containerservice/getClusterNodePool.ts +++ b/sdk/nodejs/containerservice/getClusterNodePool.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Kubernetes Cluster Node Pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getClusterNodePool({ + * name: "existing", + * kubernetesClusterName: "existing-cluster", + * resourceGroupName: "existing-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getClusterNodePool(args: GetClusterNodePoolArgs, opts?: pulumi.InvokeOptions): Promise { @@ -143,6 +157,20 @@ export interface GetClusterNodePoolResult { } /** * Use this data source to access information about an existing Kubernetes Cluster Node Pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getClusterNodePool({ + * name: "existing", + * kubernetesClusterName: "existing-cluster", + * resourceGroupName: "existing-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getClusterNodePoolOutput(args: GetClusterNodePoolOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getClusterNodePool(a, opts)) diff --git a/sdk/nodejs/containerservice/getGroup.ts b/sdk/nodejs/containerservice/getGroup.ts index dd26ff8c0e..656d2f83e0 100644 --- a/sdk/nodejs/containerservice/getGroup.ts +++ b/sdk/nodejs/containerservice/getGroup.ts @@ -8,6 +8,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Container Group instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getGroup({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * export const ipAddress = example.then(example => example.ipAddress); + * export const fqdn = example.then(example => example.fqdn); + * ``` */ export function getGroup(args: GetGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -78,6 +93,21 @@ export interface GetGroupResult { } /** * Use this data source to access information about an existing Container Group instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getGroup({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * export const ipAddress = example.then(example => example.ipAddress); + * export const fqdn = example.then(example => example.fqdn); + * ``` */ export function getGroupOutput(args: GetGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getGroup(a, opts)) diff --git a/sdk/nodejs/containerservice/getKubernetesCluster.ts b/sdk/nodejs/containerservice/getKubernetesCluster.ts index a08ca4a7f7..e54df79041 100644 --- a/sdk/nodejs/containerservice/getKubernetesCluster.ts +++ b/sdk/nodejs/containerservice/getKubernetesCluster.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Managed Kubernetes Cluster (AKS). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getKubernetesCluster({ + * name: "myakscluster", + * resourceGroupName: "my-example-resource-group", + * }); + * ``` */ export function getKubernetesCluster(args: GetKubernetesClusterArgs, opts?: pulumi.InvokeOptions): Promise { @@ -205,6 +217,18 @@ export interface GetKubernetesClusterResult { } /** * Use this data source to access information about an existing Managed Kubernetes Cluster (AKS). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getKubernetesCluster({ + * name: "myakscluster", + * resourceGroupName: "my-example-resource-group", + * }); + * ``` */ export function getKubernetesClusterOutput(args: GetKubernetesClusterOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getKubernetesCluster(a, opts)) diff --git a/sdk/nodejs/containerservice/getKubernetesNodePoolSnapshot.ts b/sdk/nodejs/containerservice/getKubernetesNodePoolSnapshot.ts index 48c0b7a055..5a0722f25a 100644 --- a/sdk/nodejs/containerservice/getKubernetesNodePoolSnapshot.ts +++ b/sdk/nodejs/containerservice/getKubernetesNodePoolSnapshot.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Kubernetes Node Pool Snapshot. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getKubernetesNodePoolSnapshot({ + * name: "example", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getKubernetesNodePoolSnapshot(args: GetKubernetesNodePoolSnapshotArgs, opts?: pulumi.InvokeOptions): Promise { @@ -48,6 +60,18 @@ export interface GetKubernetesNodePoolSnapshotResult { } /** * Use this data source to access information about an existing Kubernetes Node Pool Snapshot. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getKubernetesNodePoolSnapshot({ + * name: "example", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getKubernetesNodePoolSnapshotOutput(args: GetKubernetesNodePoolSnapshotOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getKubernetesNodePoolSnapshot(a, opts)) diff --git a/sdk/nodejs/containerservice/getKubernetesServiceVersions.ts b/sdk/nodejs/containerservice/getKubernetesServiceVersions.ts index 5e05666b42..a7a1b84aec 100644 --- a/sdk/nodejs/containerservice/getKubernetesServiceVersions.ts +++ b/sdk/nodejs/containerservice/getKubernetesServiceVersions.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to retrieve the version of Kubernetes supported by Azure Kubernetes Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.containerservice.getKubernetesServiceVersions({ + * location: "West Europe", + * }); + * export const versions = current.then(current => current.versions); + * export const latestVersion = current.then(current => current.latestVersion); + * ``` */ export function getKubernetesServiceVersions(args: GetKubernetesServiceVersionsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +70,19 @@ export interface GetKubernetesServiceVersionsResult { } /** * Use this data source to retrieve the version of Kubernetes supported by Azure Kubernetes Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.containerservice.getKubernetesServiceVersions({ + * location: "West Europe", + * }); + * export const versions = current.then(current => current.versions); + * export const latestVersion = current.then(current => current.latestVersion); + * ``` */ export function getKubernetesServiceVersionsOutput(args: GetKubernetesServiceVersionsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getKubernetesServiceVersions(a, opts)) diff --git a/sdk/nodejs/containerservice/getRegistry.ts b/sdk/nodejs/containerservice/getRegistry.ts index 115a4ff29a..372c4f7499 100644 --- a/sdk/nodejs/containerservice/getRegistry.ts +++ b/sdk/nodejs/containerservice/getRegistry.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Container Registry. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getRegistry({ + * name: "testacr", + * resourceGroupName: "test", + * }); + * export const loginServer = example.then(example => example.loginServer); + * ``` */ export function getRegistry(args: GetRegistryArgs, opts?: pulumi.InvokeOptions): Promise { @@ -75,6 +88,19 @@ export interface GetRegistryResult { } /** * Use this data source to access information about an existing Container Registry. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getRegistry({ + * name: "testacr", + * resourceGroupName: "test", + * }); + * export const loginServer = example.then(example => example.loginServer); + * ``` */ export function getRegistryOutput(args: GetRegistryOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRegistry(a, opts)) diff --git a/sdk/nodejs/containerservice/getRegistryScopeMap.ts b/sdk/nodejs/containerservice/getRegistryScopeMap.ts index 3b578750a9..c6c84acb1b 100644 --- a/sdk/nodejs/containerservice/getRegistryScopeMap.ts +++ b/sdk/nodejs/containerservice/getRegistryScopeMap.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Container Registry scope map. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getRegistryScopeMap({ + * name: "example-scope-map", + * resourceGroupName: "example-resource-group", + * containerRegistryName: "example-registry", + * }); + * export const actions = example.then(example => example.actions); + * ``` */ export function getRegistryScopeMap(args: GetRegistryScopeMapArgs, opts?: pulumi.InvokeOptions): Promise { @@ -54,6 +68,20 @@ export interface GetRegistryScopeMapResult { } /** * Use this data source to access information about an existing Container Registry scope map. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getRegistryScopeMap({ + * name: "example-scope-map", + * resourceGroupName: "example-resource-group", + * containerRegistryName: "example-registry", + * }); + * export const actions = example.then(example => example.actions); + * ``` */ export function getRegistryScopeMapOutput(args: GetRegistryScopeMapOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRegistryScopeMap(a, opts)) diff --git a/sdk/nodejs/containerservice/getRegistryToken.ts b/sdk/nodejs/containerservice/getRegistryToken.ts index 9fdb5b0693..ab5d41aec8 100644 --- a/sdk/nodejs/containerservice/getRegistryToken.ts +++ b/sdk/nodejs/containerservice/getRegistryToken.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Container Registry token. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getRegistryToken({ + * name: "exampletoken", + * resourceGroupName: "example-resource-group", + * containerRegistryName: "example-registry", + * }); + * export const scopeMapId = example.then(example => example.scopeMapId); + * ``` */ export function getRegistryToken(args: GetRegistryTokenArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +71,20 @@ export interface GetRegistryTokenResult { } /** * Use this data source to access information about an existing Container Registry token. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.containerservice.getRegistryToken({ + * name: "exampletoken", + * resourceGroupName: "example-resource-group", + * containerRegistryName: "example-registry", + * }); + * export const scopeMapId = example.then(example => example.scopeMapId); + * ``` */ export function getRegistryTokenOutput(args: GetRegistryTokenOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRegistryToken(a, opts)) diff --git a/sdk/nodejs/containerservice/group.ts b/sdk/nodejs/containerservice/group.ts index 5b4e3ad16b..7c5d1e2699 100644 --- a/sdk/nodejs/containerservice/group.ts +++ b/sdk/nodejs/containerservice/group.ts @@ -11,6 +11,45 @@ import * as utilities from "../utilities"; * * > **Note** `networkProfileId` is [deprecated](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet) by Azure. For users who want to continue to manage existing `azure.containerservice.Group` that rely on `networkProfileId`, please stay on provider versions prior to v3.16.0. Otherwise, use `subnetIds` instead. * + * ## Example Usage + * + * This example provisions a Basic Container. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleGroup = new azure.containerservice.Group("exampleGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipAddressType: "Public", + * dnsNameLabel: "aci-label", + * osType: "Linux", + * containers: [ + * { + * name: "hello-world", + * image: "mcr.microsoft.com/azuredocs/aci-helloworld:latest", + * cpu: 0.5, + * memory: 1.5, + * ports: [{ + * port: 443, + * protocol: "TCP", + * }], + * }, + * { + * name: "sidecar", + * image: "mcr.microsoft.com/azuredocs/aci-tutorial-sidecar", + * cpu: 0.5, + * memory: 1.5, + * }, + * ], + * tags: { + * environment: "testing", + * }, + * }); + * ``` + * * ## Import * * Container Group's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/kubernetesCluster.ts b/sdk/nodejs/containerservice/kubernetesCluster.ts index b8267ebd9d..12c2db882b 100644 --- a/sdk/nodejs/containerservice/kubernetesCluster.ts +++ b/sdk/nodejs/containerservice/kubernetesCluster.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service) * + * ## Example Usage + * + * This example provisions a basic Managed Kubernetes Cluster. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "exampleaks1", + * defaultNodePool: { + * name: "default", + * nodeCount: 1, + * vmSize: "Standard_D2_v2", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Environment: "Production", + * }, + * }); + * export const clientCertificate = exampleKubernetesCluster.kubeConfigs.apply(kubeConfigs => kubeConfigs[0].clientCertificate); + * export const kubeConfig = exampleKubernetesCluster.kubeConfigRaw; + * ``` + * * ## Import * * Managed Kubernetes Clusters can be imported using the `resource id`, e.g. @@ -279,6 +308,32 @@ export class KubernetesCluster extends pulumi.CustomResource { * Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. * * > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleZone.id, + * roleDefinitionName: "Private DNS Zone Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "aksexamplednsprefix1", + * privateClusterEnabled: true, + * privateDnsZoneId: exampleZone.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` */ public readonly privateClusterPublicFqdnEnabled!: pulumi.Output; /** @@ -755,6 +810,32 @@ export interface KubernetesClusterState { * Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. * * > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleZone.id, + * roleDefinitionName: "Private DNS Zone Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "aksexamplednsprefix1", + * privateClusterEnabled: true, + * privateDnsZoneId: exampleZone.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` */ privateClusterPublicFqdnEnabled?: pulumi.Input; /** @@ -1035,6 +1116,32 @@ export interface KubernetesClusterArgs { * Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. * * > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleZone.id, + * roleDefinitionName: "Private DNS Zone Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "aksexamplednsprefix1", + * privateClusterEnabled: true, + * privateDnsZoneId: exampleZone.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` */ privateClusterPublicFqdnEnabled?: pulumi.Input; /** diff --git a/sdk/nodejs/containerservice/kubernetesClusterExtension.ts b/sdk/nodejs/containerservice/kubernetesClusterExtension.ts index 1e853f3be9..f71ea4daef 100644 --- a/sdk/nodejs/containerservice/kubernetesClusterExtension.ts +++ b/sdk/nodejs/containerservice/kubernetesClusterExtension.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages a Kubernetes Cluster Extension. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: "West Europe", + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "example-aks", + * defaultNodePool: { + * name: "default", + * nodeCount: 1, + * vmSize: "Standard_DS2_v2", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleKubernetesClusterExtension = new azure.containerservice.KubernetesClusterExtension("exampleKubernetesClusterExtension", { + * clusterId: exampleKubernetesCluster.id, + * extensionType: "microsoft.flux", + * }); + * ``` + * * ## Import * * Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/nodejs/containerservice/kubernetesClusterNodePool.ts b/sdk/nodejs/containerservice/kubernetesClusterNodePool.ts index 94d705949e..30aef3da12 100644 --- a/sdk/nodejs/containerservice/kubernetesClusterNodePool.ts +++ b/sdk/nodejs/containerservice/kubernetesClusterNodePool.ts @@ -11,6 +11,39 @@ import * as utilities from "../utilities"; * * > **NOTE:** Multiple Node Pools are only supported when the Kubernetes Cluster is using Virtual Machine Scale Sets. * + * ## Example Usage + * + * This example provisions a basic Kubernetes Node Pool. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "exampleaks1", + * defaultNodePool: { + * name: "default", + * nodeCount: 1, + * vmSize: "Standard_D2_v2", + * }, + * servicePrincipal: { + * clientId: "00000000-0000-0000-0000-000000000000", + * clientSecret: "00000000000000000000000000000000", + * }, + * }); + * const exampleKubernetesClusterNodePool = new azure.containerservice.KubernetesClusterNodePool("exampleKubernetesClusterNodePool", { + * kubernetesClusterId: exampleKubernetesCluster.id, + * vmSize: "Standard_DS2_v2", + * nodeCount: 1, + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Kubernetes Cluster Node Pools can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/kubernetesFleetManager.ts b/sdk/nodejs/containerservice/kubernetesFleetManager.ts index 895f5f5723..95a1b6a988 100644 --- a/sdk/nodejs/containerservice/kubernetesFleetManager.ts +++ b/sdk/nodejs/containerservice/kubernetesFleetManager.ts @@ -14,6 +14,18 @@ import * as utilities from "../utilities"; * > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name FleetResourcePreview` and then `az provider register -n Microsoft.ContainerService` * . * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKubernetesFleetManager = new azure.containerservice.KubernetesFleetManager("exampleKubernetesFleetManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` * ## Blocks Reference * * ### `hubProfile` Block diff --git a/sdk/nodejs/containerservice/registry.ts b/sdk/nodejs/containerservice/registry.ts index 9ced7edc52..5a240621f7 100644 --- a/sdk/nodejs/containerservice/registry.ts +++ b/sdk/nodejs/containerservice/registry.ts @@ -9,6 +9,98 @@ import * as utilities from "../utilities"; /** * Manages an Azure Container Registry. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const acr = new azure.containerservice.Registry("acr", { + * resourceGroupName: example.name, + * location: example.location, + * sku: "Premium", + * adminEnabled: false, + * georeplications: [ + * { + * location: "East US", + * zoneRedundancyEnabled: true, + * tags: {}, + * }, + * { + * location: "North Europe", + * zoneRedundancyEnabled: true, + * tags: {}, + * }, + * ], + * }); + * ``` + * ### Encryption) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleKey = azure.keyvault.getKey({ + * name: "super-secret", + * keyVaultId: data.azurerm_key_vault.existing.id, + * }); + * const acr = new azure.containerservice.Registry("acr", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Premium", + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * encryption: { + * enabled: true, + * keyVaultKeyId: exampleKey.then(exampleKey => exampleKey.id), + * identityClientId: exampleUserAssignedIdentity.clientId, + * }, + * }); + * ``` + * ### Attaching A Container Registry To A Kubernetes Cluster) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Premium", + * }); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefix: "exampleaks1", + * defaultNodePool: { + * name: "default", + * nodeCount: 1, + * vmSize: "Standard_D2_v2", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Environment: "Production", + * }, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * principalId: exampleKubernetesCluster.kubeletIdentity.apply(kubeletIdentity => kubeletIdentity.objectId), + * roleDefinitionName: "AcrPull", + * scope: exampleRegistry.id, + * skipServicePrincipalAadCheck: true, + * }); + * ``` + * * ## Import * * Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/registryAgentPool.ts b/sdk/nodejs/containerservice/registryAgentPool.ts index e4de54bd2e..2e9a8fbc16 100644 --- a/sdk/nodejs/containerservice/registryAgentPool.ts +++ b/sdk/nodejs/containerservice/registryAgentPool.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages an Azure Container Registry Agent Pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europ"}); + * const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Premium", + * }); + * const exampleRegistryAgentPool = new azure.containerservice.RegistryAgentPool("exampleRegistryAgentPool", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * containerRegistryName: exampleRegistry.name, + * }); + * ``` + * * ## Import * * Azure Container Registry Agent Pool can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/registryScopeMap.ts b/sdk/nodejs/containerservice/registryScopeMap.ts index 4587dac871..136d580e3a 100644 --- a/sdk/nodejs/containerservice/registryScopeMap.ts +++ b/sdk/nodejs/containerservice/registryScopeMap.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages an Azure Container Registry scope map. Scope Maps are a preview feature only available in Premium SKU Container registries. * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Premium", + * adminEnabled: false, + * georeplications: [ + * { + * location: "East US", + * }, + * { + * location: "West Europe", + * }, + * ], + * }); + * const exampleRegistryScopeMap = new azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", { + * containerRegistryName: exampleRegistry.name, + * resourceGroupName: exampleResourceGroup.name, + * actions: [ + * "repositories/repo1/content/read", + * "repositories/repo1/content/write", + * ], + * }); + * ``` + * * ## Import * * Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/registryTask.ts b/sdk/nodejs/containerservice/registryTask.ts index 3529af6bda..72c9161f08 100644 --- a/sdk/nodejs/containerservice/registryTask.ts +++ b/sdk/nodejs/containerservice/registryTask.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages a Container Registry Task. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Basic", + * }); + * const exampleRegistryTask = new azure.containerservice.RegistryTask("exampleRegistryTask", { + * containerRegistryId: exampleRegistry.id, + * platform: { + * os: "Linux", + * }, + * dockerStep: { + * dockerfilePath: "Dockerfile", + * contextPath: "https://github.com//#:", + * contextAccessToken: "", + * imageNames: ["helloworld:{{.Run.ID}}"], + * }, + * }); + * ``` + * * ## Import * * Container Registry Tasks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/registryTaskScheduleRunNow.ts b/sdk/nodejs/containerservice/registryTaskScheduleRunNow.ts index 3d8896fef1..8472c86982 100644 --- a/sdk/nodejs/containerservice/registryTaskScheduleRunNow.ts +++ b/sdk/nodejs/containerservice/registryTaskScheduleRunNow.ts @@ -6,6 +6,33 @@ import * as utilities from "../utilities"; /** * Runs a Container Registry Task Schedule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Basic", + * }); + * const exampleRegistryTask = new azure.containerservice.RegistryTask("exampleRegistryTask", { + * containerRegistryId: exampleRegistry.id, + * platform: { + * os: "Linux", + * }, + * dockerStep: { + * dockerfilePath: "Dockerfile", + * contextPath: "https://github.com//acr-build-helloworld-node#main", + * contextAccessToken: "", + * imageNames: ["helloworld:{{.Run.ID}}"], + * }, + * }); + * const exampleRegistryTaskScheduleRunNow = new azure.containerservice.RegistryTaskScheduleRunNow("exampleRegistryTaskScheduleRunNow", {containerRegistryTaskId: exampleRegistryTask.id}); + * ``` */ export class RegistryTaskScheduleRunNow extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/containerservice/registryToken.ts b/sdk/nodejs/containerservice/registryToken.ts index 5fa6c2c21f..a6ae302f7e 100644 --- a/sdk/nodejs/containerservice/registryToken.ts +++ b/sdk/nodejs/containerservice/registryToken.ts @@ -7,6 +7,40 @@ import * as utilities from "../utilities"; /** * Manages an Azure Container Registry token. Tokens are a preview feature only available in Premium SKU Container registries. * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRegistry = new azure.containerservice.Registry("exampleRegistry", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Premium", + * adminEnabled: false, + * georeplications: [ + * { + * location: "East US", + * }, + * { + * location: "West Europe", + * }, + * ], + * }); + * const exampleRegistryScopeMap = new azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", { + * containerRegistryName: exampleRegistry.name, + * resourceGroupName: exampleResourceGroup.name, + * actions: [ + * "repositories/repo1/content/read", + * "repositories/repo1/content/write", + * ], + * }); + * const exampleRegistryToken = new azure.containerservice.RegistryToken("exampleRegistryToken", { + * containerRegistryName: exampleRegistry.name, + * resourceGroupName: exampleResourceGroup.name, + * scopeMapId: exampleRegistryScopeMap.id, + * }); + * ``` + * * ## Import * * Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/registryWebhook.ts b/sdk/nodejs/containerservice/registryWebhook.ts index 56a0a571f9..2eb1b2d708 100644 --- a/sdk/nodejs/containerservice/registryWebhook.ts +++ b/sdk/nodejs/containerservice/registryWebhook.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages an Azure Container Registry Webhook. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const acr = new azure.containerservice.Registry("acr", { + * resourceGroupName: example.name, + * location: example.location, + * sku: "Standard", + * adminEnabled: false, + * }); + * const webhook = new azure.containerservice.RegistryWebhook("webhook", { + * resourceGroupName: example.name, + * registryName: acr.name, + * location: example.location, + * serviceUri: "https://mywebhookreceiver.example/mytag", + * status: "enabled", + * scope: "mytag:*", + * actions: ["push"], + * customHeaders: { + * "Content-Type": "application/json", + * }, + * }); + * ``` + * * ## Import * * Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/containerservice/registryWebook.ts b/sdk/nodejs/containerservice/registryWebook.ts index e9e07f9d94..c9ceaacbe7 100644 --- a/sdk/nodejs/containerservice/registryWebook.ts +++ b/sdk/nodejs/containerservice/registryWebook.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages an Azure Container Registry Webhook. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const acr = new azure.containerservice.Registry("acr", { + * resourceGroupName: example.name, + * location: example.location, + * sku: "Standard", + * adminEnabled: false, + * }); + * const webhook = new azure.containerservice.RegistryWebhook("webhook", { + * resourceGroupName: example.name, + * registryName: acr.name, + * location: example.location, + * serviceUri: "https://mywebhookreceiver.example/mytag", + * status: "enabled", + * scope: "mytag:*", + * actions: ["push"], + * customHeaders: { + * "Content-Type": "application/json", + * }, + * }); + * ``` + * * ## Import * * Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/customProvider.ts b/sdk/nodejs/core/customProvider.ts index e7da259b2e..9c8ab6d5a2 100644 --- a/sdk/nodejs/core/customProvider.ts +++ b/sdk/nodejs/core/customProvider.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages an Azure Custom Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCustomProvider = new azure.core.CustomProvider("exampleCustomProvider", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * resourceTypes: [{ + * name: "dEf1", + * endpoint: "https://testendpoint.com/", + * }], + * }); + * ``` + * * ## Import * * Custom Provider can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/getClientConfig.ts b/sdk/nodejs/core/getClientConfig.ts index 27f1e5c836..3e362dfb47 100644 --- a/sdk/nodejs/core/getClientConfig.ts +++ b/sdk/nodejs/core/getClientConfig.ts @@ -6,6 +6,16 @@ import * as utilities from "../utilities"; /** * Use this data source to access the configuration of the AzureRM provider. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * export const accountId = current.then(current => current.clientId); + * ``` */ export function getClientConfig(opts?: pulumi.InvokeOptions): Promise { @@ -41,6 +51,16 @@ export interface GetClientConfigResult { } /** * Use this data source to access the configuration of the AzureRM provider. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * export const accountId = current.then(current => current.clientId); + * ``` */ export function getClientConfigOutput(opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(getClientConfig(opts)) diff --git a/sdk/nodejs/core/getExtendedLocations.ts b/sdk/nodejs/core/getExtendedLocations.ts index 79afef6d7d..202ff2f2d1 100644 --- a/sdk/nodejs/core/getExtendedLocations.ts +++ b/sdk/nodejs/core/getExtendedLocations.ts @@ -6,6 +6,17 @@ import * as utilities from "../utilities"; /** * This data source return the available Extended Locations for a specific Azure Region. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.core.getExtendedLocations({ + * location: "West Europe", + * }); + * ``` */ export function getExtendedLocations(args: GetExtendedLocationsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -41,6 +52,17 @@ export interface GetExtendedLocationsResult { } /** * This data source return the available Extended Locations for a specific Azure Region. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.core.getExtendedLocations({ + * location: "West Europe", + * }); + * ``` */ export function getExtendedLocationsOutput(args: GetExtendedLocationsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getExtendedLocations(a, opts)) diff --git a/sdk/nodejs/core/getResourceGroup.ts b/sdk/nodejs/core/getResourceGroup.ts index 1d5c0cbfdb..4a76af2174 100644 --- a/sdk/nodejs/core/getResourceGroup.ts +++ b/sdk/nodejs/core/getResourceGroup.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Resource Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.core.getResourceGroup({ + * name: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getResourceGroup(args: GetResourceGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -46,6 +58,18 @@ export interface GetResourceGroupResult { } /** * Use this data source to access information about an existing Resource Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.core.getResourceGroup({ + * name: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getResourceGroupOutput(args: GetResourceGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getResourceGroup(a, opts)) diff --git a/sdk/nodejs/core/getSubscription.ts b/sdk/nodejs/core/getSubscription.ts index 8907c9015c..91a5c2c69a 100644 --- a/sdk/nodejs/core/getSubscription.ts +++ b/sdk/nodejs/core/getSubscription.ts @@ -6,6 +6,16 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Subscription. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * export const currentSubscriptionDisplayName = current.then(current => current.displayName); + * ``` */ export function getSubscription(args?: GetSubscriptionArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -69,6 +79,16 @@ export interface GetSubscriptionResult { } /** * Use this data source to access information about an existing Subscription. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * export const currentSubscriptionDisplayName = current.then(current => current.displayName); + * ``` */ export function getSubscriptionOutput(args?: GetSubscriptionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSubscription(a, opts)) diff --git a/sdk/nodejs/core/getSubscriptions.ts b/sdk/nodejs/core/getSubscriptions.ts index 698a90672c..018582682c 100644 --- a/sdk/nodejs/core/getSubscriptions.ts +++ b/sdk/nodejs/core/getSubscriptions.ts @@ -8,6 +8,17 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about all the Subscriptions currently available. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const available = azure.core.getSubscriptions({}); + * export const availableSubscriptions = available.then(available => available.subscriptions); + * export const firstAvailableSubscriptionDisplayName = available.then(available => available.subscriptions?.[0]?.displayName); + * ``` */ export function getSubscriptions(args?: GetSubscriptionsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -50,6 +61,17 @@ export interface GetSubscriptionsResult { } /** * Use this data source to access information about all the Subscriptions currently available. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const available = azure.core.getSubscriptions({}); + * export const availableSubscriptions = available.then(available => available.subscriptions); + * export const firstAvailableSubscriptionDisplayName = available.then(available => available.subscriptions?.[0]?.displayName); + * ``` */ export function getSubscriptionsOutput(args?: GetSubscriptionsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSubscriptions(a, opts)) diff --git a/sdk/nodejs/core/getTemplateSpecVersion.ts b/sdk/nodejs/core/getTemplateSpecVersion.ts index b0ac5dec0a..e8dff7be56 100644 --- a/sdk/nodejs/core/getTemplateSpecVersion.ts +++ b/sdk/nodejs/core/getTemplateSpecVersion.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Template Spec Version. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.core.getTemplateSpecVersion({ + * name: "exampleTemplateSpec", + * resourceGroupName: "MyResourceGroup", + * version: "v1.0.4", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getTemplateSpecVersion(args: GetTemplateSpecVersionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +71,20 @@ export interface GetTemplateSpecVersionResult { } /** * Use this data source to access information about an existing Template Spec Version. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.core.getTemplateSpecVersion({ + * name: "exampleTemplateSpec", + * resourceGroupName: "MyResourceGroup", + * version: "v1.0.4", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getTemplateSpecVersionOutput(args: GetTemplateSpecVersionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTemplateSpecVersion(a, opts)) diff --git a/sdk/nodejs/core/getUserAssignedIdentity.ts b/sdk/nodejs/core/getUserAssignedIdentity.ts index 9811874958..673fc3199c 100644 --- a/sdk/nodejs/core/getUserAssignedIdentity.ts +++ b/sdk/nodejs/core/getUserAssignedIdentity.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing User Assigned Identity. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.authorization.getUserAssignedIdentity({ + * name: "name_of_user_assigned_identity", + * resourceGroupName: "name_of_resource_group", + * }); + * export const uaiClientId = example.then(example => example.clientId); + * export const uaiPrincipalId = example.then(example => example.principalId); + * export const uaiTenantId = example.then(example => example.tenantId); + * ``` */ /** @deprecated azure.core.getUserAssignedIdentity has been deprecated in favor of azure.authorization.getUserAssignedIdentity */ export function getUserAssignedIdentity(args: GetUserAssignedIdentityArgs, opts?: pulumi.InvokeOptions): Promise { @@ -69,6 +83,20 @@ export interface GetUserAssignedIdentityResult { * Use this data source to access information about an existing User Assigned Identity. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.authorization.getUserAssignedIdentity({ + * name: "name_of_user_assigned_identity", + * resourceGroupName: "name_of_resource_group", + * }); + * export const uaiClientId = example.then(example => example.clientId); + * export const uaiPrincipalId = example.then(example => example.principalId); + * export const uaiTenantId = example.then(example => example.tenantId); + * ``` */ /** @deprecated azure.core.getUserAssignedIdentity has been deprecated in favor of azure.authorization.getUserAssignedIdentity */ export function getUserAssignedIdentityOutput(args: GetUserAssignedIdentityOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { diff --git a/sdk/nodejs/core/portalTenantConfiguration.ts b/sdk/nodejs/core/portalTenantConfiguration.ts index a46498b32e..bc5af23601 100644 --- a/sdk/nodejs/core/portalTenantConfiguration.ts +++ b/sdk/nodejs/core/portalTenantConfiguration.ts @@ -15,6 +15,15 @@ import * as utilities from "../utilities"; * * > **Note:** While assigning the role to the existing/new Service Principal at the Tenant Scope, the user assigning role must already have the `Owner` role assigned at the Tenant Scope. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.PortalTenantConfiguration("example", {privateMarkdownStorageEnforced: true}); + * ``` + * * ## Import * * Portal Tenant Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceDeploymentScriptAzureCli.ts b/sdk/nodejs/core/resourceDeploymentScriptAzureCli.ts index 1ea845131e..6475ccf00a 100644 --- a/sdk/nodejs/core/resourceDeploymentScriptAzureCli.ts +++ b/sdk/nodejs/core/resourceDeploymentScriptAzureCli.ts @@ -9,6 +9,37 @@ import * as utilities from "../utilities"; /** * Manages a Resource Deployment Script of Azure Cli. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleResourceDeploymentScriptAzureCli = new azure.core.ResourceDeploymentScriptAzureCli("exampleResourceDeploymentScriptAzureCli", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * version: "2.40.0", + * retentionInterval: "P1D", + * commandLine: "'foo' 'bar'", + * cleanupPreference: "OnSuccess", + * forceUpdateTag: "1", + * timeout: "PT30M", + * scriptContent: " echo \"{\\\"name\\\":{\\\"displayName\\\":\\\"$1 $2\\\"}}\" > $AZ_SCRIPTS_OUTPUT_PATH\n", + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceDeploymentScriptPowerShell.ts b/sdk/nodejs/core/resourceDeploymentScriptPowerShell.ts index 66ff9b6bad..26d510e77e 100644 --- a/sdk/nodejs/core/resourceDeploymentScriptPowerShell.ts +++ b/sdk/nodejs/core/resourceDeploymentScriptPowerShell.ts @@ -9,6 +9,42 @@ import * as utilities from "../utilities"; /** * Manages a Resource Deployment Script of Azure PowerShell. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleResourceDeploymentScriptPowerShell = new azure.core.ResourceDeploymentScriptPowerShell("exampleResourceDeploymentScriptPowerShell", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * version: "8.3", + * retentionInterval: "P1D", + * commandLine: "-name \"John Dole\"", + * cleanupPreference: "OnSuccess", + * forceUpdateTag: "1", + * timeout: "PT30M", + * scriptContent: ` param([string] $name) + * $output = 'Hello {0}.' -f $name + * Write-Output $output + * $DeploymentScriptOutputs = @{} + * $DeploymentScriptOutputs['text'] = $output + * `, + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceGroup.ts b/sdk/nodejs/core/resourceGroup.ts index da84fe35da..326db3fab6 100644 --- a/sdk/nodejs/core/resourceGroup.ts +++ b/sdk/nodejs/core/resourceGroup.ts @@ -5,6 +5,15 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * ``` + * * ## Import * * Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceGroupCostManagementExport.ts b/sdk/nodejs/core/resourceGroupCostManagementExport.ts index 3ab9e1ac04..8bf5e15f93 100644 --- a/sdk/nodejs/core/resourceGroupCostManagementExport.ts +++ b/sdk/nodejs/core/resourceGroupCostManagementExport.ts @@ -9,6 +9,36 @@ import * as utilities from "../utilities"; /** * Manages a Cost Management Export for a Resource Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name}); + * const exampleResourceGroupCostManagementExport = new azure.core.ResourceGroupCostManagementExport("exampleResourceGroupCostManagementExport", { + * resourceGroupId: exampleResourceGroup.id, + * recurrenceType: "Monthly", + * recurrencePeriodStartDate: "2020-08-18T00:00:00Z", + * recurrencePeriodEndDate: "2020-09-18T00:00:00Z", + * exportDataStorageLocation: { + * containerId: exampleContainer.resourceManagerId, + * rootFolderPath: "/root/updated", + * }, + * exportDataOptions: { + * type: "Usage", + * timeFrame: "WeekToDate", + * }, + * }); + * ``` + * * ## Import * * Cost Management Export for a Resource Group can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceGroupCostManagementView.ts b/sdk/nodejs/core/resourceGroupCostManagementView.ts index f7dac8c127..ac0ac3b21e 100644 --- a/sdk/nodejs/core/resourceGroupCostManagementView.ts +++ b/sdk/nodejs/core/resourceGroupCostManagementView.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages an Azure Cost Management View for a Resource Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleResourceGroupCostManagementView = new azure.core.ResourceGroupCostManagementView("exampleResourceGroupCostManagementView", { + * displayName: "Cost View per Month", + * chartType: "StackedColumn", + * accumulated: false, + * resourceGroupId: exampleResourceGroup.id, + * reportType: "Usage", + * timeframe: "MonthToDate", + * dataset: { + * granularity: "Monthly", + * aggregations: [{ + * name: "totalCost", + * columnName: "Cost", + * }], + * }, + * }); + * ``` + * * ## Import * * Cost Management View for a Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceGroupPolicyAssignment.ts b/sdk/nodejs/core/resourceGroupPolicyAssignment.ts index c7ec0c8b57..280e4b864a 100644 --- a/sdk/nodejs/core/resourceGroupPolicyAssignment.ts +++ b/sdk/nodejs/core/resourceGroupPolicyAssignment.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages a Resource Group Policy Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDefinition = new azure.policy.Definition("exampleDefinition", { + * policyType: "Custom", + * mode: "All", + * displayName: "my-policy-definition", + * policyRule: ` { + * "if": { + * "not": { + * "field": "location", + * "equals": "westeurope" + * } + * }, + * "then": { + * "effect": "Deny" + * } + * } + * `, + * }); + * const exampleResourceGroupPolicyAssignment = new azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", { + * resourceGroupId: exampleResourceGroup.id, + * policyDefinitionId: exampleDefinition.id, + * parameters: ` { + * "tagName": { + * "value": "Business Unit" + * }, + * "tagValue": { + * "value": "BU" + * } + * } + * `, + * }); + * ``` + * * ## Import * * Resource Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceGroupPolicyExemption.ts b/sdk/nodejs/core/resourceGroupPolicyExemption.ts index adfb4bbe4a..9fd4a9c81c 100644 --- a/sdk/nodejs/core/resourceGroupPolicyExemption.ts +++ b/sdk/nodejs/core/resourceGroupPolicyExemption.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages a Resource Group Policy Exemption. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westus"}); + * const examplePolicyDefintion = azure.policy.getPolicyDefintion({ + * displayName: "Allowed locations", + * }); + * const exampleResourceGroupPolicyAssignment = new azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", { + * resourceGroupId: exampleResourceGroup.id, + * policyDefinitionId: examplePolicyDefintion.then(examplePolicyDefintion => examplePolicyDefintion.id), + * parameters: exampleResourceGroup.location.apply(location => JSON.stringify({ + * listOfAllowedLocations: { + * value: [location], + * }, + * })), + * }); + * const exampleResourceGroupPolicyExemption = new azure.core.ResourceGroupPolicyExemption("exampleResourceGroupPolicyExemption", { + * resourceGroupId: exampleResourceGroup.id, + * policyAssignmentId: exampleResourceGroupPolicyAssignment.id, + * exemptionCategory: "Mitigated", + * }); + * ``` + * * ## Import * * Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourcePolicyAssignment.ts b/sdk/nodejs/core/resourcePolicyAssignment.ts index 8389da18d1..de93775de8 100644 --- a/sdk/nodejs/core/resourcePolicyAssignment.ts +++ b/sdk/nodejs/core/resourcePolicyAssignment.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a Policy Assignment to a Resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleVirtualNetwork = azure.network.getVirtualNetwork({ + * name: "production", + * resourceGroupName: "networking", + * }); + * const exampleDefinition = new azure.policy.Definition("exampleDefinition", { + * policyType: "Custom", + * mode: "All", + * displayName: "my-policy-definition", + * policyRule: ` { + * "if": { + * "not": { + * "field": "location", + * "equals": "westeurope" + * } + * }, + * "then": { + * "effect": "Deny" + * } + * } + * `, + * }); + * const exampleResourcePolicyAssignment = new azure.core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", { + * resourceId: exampleVirtualNetwork.then(exampleVirtualNetwork => exampleVirtualNetwork.id), + * policyDefinitionId: exampleDefinition.id, + * }); + * ``` + * * ## Import * * Resource Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourcePolicyExemption.ts b/sdk/nodejs/core/resourcePolicyExemption.ts index 7db35b106b..cf3f0861f9 100644 --- a/sdk/nodejs/core/resourcePolicyExemption.ts +++ b/sdk/nodejs/core/resourcePolicyExemption.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a Resource Policy Exemption. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westus"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const examplePolicySetDefinition = azure.policy.getPolicySetDefinition({ + * displayName: "Audit machines with insecure password security settings", + * }); + * const exampleResourcePolicyAssignment = new azure.core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", { + * resourceId: exampleVirtualNetwork.id, + * policyDefinitionId: examplePolicySetDefinition.then(examplePolicySetDefinition => examplePolicySetDefinition.id), + * location: exampleResourceGroup.location, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleResourcePolicyExemption = new azure.core.ResourcePolicyExemption("exampleResourcePolicyExemption", { + * resourceId: exampleResourcePolicyAssignment.resourceId, + * policyAssignmentId: exampleResourcePolicyAssignment.id, + * exemptionCategory: "Mitigated", + * }); + * ``` + * * ## Import * * Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/resourceProviderRegistration.ts b/sdk/nodejs/core/resourceProviderRegistration.ts index caeddef0cc..2d20773421 100644 --- a/sdk/nodejs/core/resourceProviderRegistration.ts +++ b/sdk/nodejs/core/resourceProviderRegistration.ts @@ -15,6 +15,26 @@ import * as utilities from "../utilities"; * * > **Note:** Adding or Removing a Preview Feature will re-register the Resource Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceProviderRegistration("example", {}); + * ``` + * ### Registering A Preview Feature) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceProviderRegistration("example", {features: [{ + * name: "AKS-DataPlaneAutoApprove", + * registered: true, + * }]}); + * ``` + * * ## Import * * Resource Provider Registrations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/subscription.ts b/sdk/nodejs/core/subscription.ts index c30145084f..7d60d4a923 100644 --- a/sdk/nodejs/core/subscription.ts +++ b/sdk/nodejs/core/subscription.ts @@ -6,6 +6,64 @@ import * as utilities from "../utilities"; /** * ## Example Usage + * ### Creating A New Alias And Subscription For An Enrollment Account + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleEnrollmentAccountScope = azure.billing.getEnrollmentAccountScope({ + * billingAccountName: "1234567890", + * enrollmentAccountName: "0123456", + * }); + * const exampleSubscription = new azure.core.Subscription("exampleSubscription", { + * subscriptionName: "My Example EA Subscription", + * billingScopeId: exampleEnrollmentAccountScope.then(exampleEnrollmentAccountScope => exampleEnrollmentAccountScope.id), + * }); + * ``` + * ### Creating A New Alias And Subscription For A Microsoft Customer Account + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleMcaAccountScope = azure.billing.getMcaAccountScope({ + * billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + * billingProfileName: "PE2Q-NOIT-BG7-TGB", + * invoiceSectionName: "MTT4-OBS7-PJA-TGB", + * }); + * const exampleSubscription = new azure.core.Subscription("exampleSubscription", { + * subscriptionName: "My Example MCA Subscription", + * billingScopeId: exampleMcaAccountScope.then(exampleMcaAccountScope => exampleMcaAccountScope.id), + * }); + * ``` + * ### Creating A New Alias And Subscription For A Microsoft Partner Account + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleMpaAccountScope = azure.billing.getMpaAccountScope({ + * billingAccountName: "e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + * customerName: "2281f543-7321-4cf9-1e23-edb4Oc31a31c", + * }); + * const exampleSubscription = new azure.core.Subscription("exampleSubscription", { + * subscriptionName: "My Example MPA Subscription", + * billingScopeId: exampleMpaAccountScope.then(exampleMpaAccountScope => exampleMpaAccountScope.id), + * }); + * ``` + * ### Adding An Alias To An Existing Subscription + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.Subscription("example", { + * alias: "examplesub", + * subscriptionId: "12345678-12234-5678-9012-123456789012", + * subscriptionName: "My Example Subscription", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/core/subscriptionCostManagementExport.ts b/sdk/nodejs/core/subscriptionCostManagementExport.ts index 7b475ab5fa..0868f9c645 100644 --- a/sdk/nodejs/core/subscriptionCostManagementExport.ts +++ b/sdk/nodejs/core/subscriptionCostManagementExport.ts @@ -9,6 +9,37 @@ import * as utilities from "../utilities"; /** * Manages a Cost Management Export for a Subscription. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleSubscription = azure.core.getSubscription({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name}); + * const exampleSubscriptionCostManagementExport = new azure.core.SubscriptionCostManagementExport("exampleSubscriptionCostManagementExport", { + * subscriptionId: exampleSubscription.then(exampleSubscription => exampleSubscription.id), + * recurrenceType: "Monthly", + * recurrencePeriodStartDate: "2020-08-18T00:00:00Z", + * recurrencePeriodEndDate: "2020-09-18T00:00:00Z", + * exportDataStorageLocation: { + * containerId: exampleContainer.resourceManagerId, + * rootFolderPath: "/root/updated", + * }, + * exportDataOptions: { + * type: "Usage", + * timeFrame: "WeekToDate", + * }, + * }); + * ``` + * * ## Import * * Subscription Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/subscriptionCostManagementView.ts b/sdk/nodejs/core/subscriptionCostManagementView.ts index d726c27662..8837f9fb04 100644 --- a/sdk/nodejs/core/subscriptionCostManagementView.ts +++ b/sdk/nodejs/core/subscriptionCostManagementView.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages an Azure Cost Management View for a Subscription. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.SubscriptionCostManagementView("example", { + * accumulated: false, + * chartType: "StackedColumn", + * dataset: { + * aggregations: [{ + * columnName: "Cost", + * name: "totalCost", + * }], + * granularity: "Monthly", + * }, + * displayName: "Cost View per Month", + * reportType: "Usage", + * subscriptionId: "/subscription/00000000-0000-0000-0000-000000000000", + * timeframe: "MonthToDate", + * }); + * ``` + * * ## Import * * Cost Management View for a Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/subscriptionPolicyAssignment.ts b/sdk/nodejs/core/subscriptionPolicyAssignment.ts index f1c8f9825d..6b91748952 100644 --- a/sdk/nodejs/core/subscriptionPolicyAssignment.ts +++ b/sdk/nodejs/core/subscriptionPolicyAssignment.ts @@ -9,6 +9,36 @@ import * as utilities from "../utilities"; /** * Manages a Subscription Policy Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const exampleDefinition = new azure.policy.Definition("exampleDefinition", { + * policyType: "Custom", + * mode: "All", + * displayName: "Allowed resource types", + * policyRule: ` { + * "if": { + * "not": { + * "field": "location", + * "equals": "westeurope" + * } + * }, + * "then": { + * "effect": "Deny" + * } + * } + * `, + * }); + * const exampleSubscriptionPolicyAssignment = new azure.core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", { + * policyDefinitionId: exampleDefinition.id, + * subscriptionId: current.then(current => current.id), + * }); + * ``` + * * ## Import * * Subscription Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/subscriptionPolicyExemption.ts b/sdk/nodejs/core/subscriptionPolicyExemption.ts index f5c8577d8b..455ad99883 100644 --- a/sdk/nodejs/core/subscriptionPolicyExemption.ts +++ b/sdk/nodejs/core/subscriptionPolicyExemption.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a Subscription Policy Exemption. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleSubscription = azure.core.getSubscription({}); + * const examplePolicySetDefinition = azure.policy.getPolicySetDefinition({ + * displayName: "Audit machines with insecure password security settings", + * }); + * const exampleSubscriptionPolicyAssignment = new azure.core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", { + * subscriptionId: exampleSubscription.then(exampleSubscription => exampleSubscription.id), + * policyDefinitionId: examplePolicySetDefinition.then(examplePolicySetDefinition => examplePolicySetDefinition.id), + * location: "westus", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSubscriptionPolicyExemption = new azure.core.SubscriptionPolicyExemption("exampleSubscriptionPolicyExemption", { + * subscriptionId: exampleSubscription.then(exampleSubscription => exampleSubscription.id), + * policyAssignmentId: exampleSubscriptionPolicyAssignment.id, + * exemptionCategory: "Mitigated", + * }); + * ``` + * * ## Import * * Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/subscriptionTemplateDeployment.ts b/sdk/nodejs/core/subscriptionTemplateDeployment.ts index 60ee9d7105..b1b9584d90 100644 --- a/sdk/nodejs/core/subscriptionTemplateDeployment.ts +++ b/sdk/nodejs/core/subscriptionTemplateDeployment.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a Subscription Template Deployment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.SubscriptionTemplateDeployment("example", { + * location: "West Europe", + * templateContent: ` { + * "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + * "contentVersion": "1.0.0.0", + * "parameters": {}, + * "variables": {}, + * "resources": [ + * { + * "type": "Microsoft.Resources/resourceGroups", + * "apiVersion": "2018-05-01", + * "location": "West Europe", + * "name": "some-resource-group", + * "properties": {} + * } + * ] + * } + * + * `, + * }); + * ``` + * * ## Import * * Subscription Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/core/templateDeployment.ts b/sdk/nodejs/core/templateDeployment.ts index e5fe387cc1..5f22113c99 100644 --- a/sdk/nodejs/core/templateDeployment.ts +++ b/sdk/nodejs/core/templateDeployment.ts @@ -11,6 +11,80 @@ import * as utilities from "../utilities"; * This means that when deleting the `azure.core.TemplateDeployment` resource, this provider will only remove the reference to the deployment, whilst leaving any resources created by that ARM Template Deployment. * One workaround for this is to use a unique Resource Group for each ARM Template Deployment, which means deleting the Resource Group would contain any resources created within it - however this isn't ideal. [More information](https://docs.microsoft.com/en-us/rest/api/resources/deployments#Deployments_Delete). * + * ## Example Usage + * + * > **Note:** This example uses Storage Accounts and Public IP's which are natively supported by this provider - we'd highly recommend using the Native Resources where possible instead rather than an ARM Template, for the reasons outlined above. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTemplateDeployment = new azure.core.TemplateDeployment("exampleTemplateDeployment", { + * resourceGroupName: exampleResourceGroup.name, + * templateBody: `{ + * "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + * "contentVersion": "1.0.0.0", + * "parameters": { + * "storageAccountType": { + * "type": "string", + * "defaultValue": "Standard_LRS", + * "allowedValues": [ + * "Standard_LRS", + * "Standard_GRS", + * "Standard_ZRS" + * ], + * "metadata": { + * "description": "Storage Account type" + * } + * } + * }, + * "variables": { + * "location": "[resourceGroup().location]", + * "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'storage')]", + * "publicIPAddressName": "[concat('myPublicIp', uniquestring(resourceGroup().id))]", + * "publicIPAddressType": "Dynamic", + * "apiVersion": "2015-06-15", + * "dnsLabelPrefix": "example-acctest" + * }, + * "resources": [ + * { + * "type": "Microsoft.Storage/storageAccounts", + * "name": "[variables('storageAccountName')]", + * "apiVersion": "[variables('apiVersion')]", + * "location": "[variables('location')]", + * "properties": { + * "accountType": "[parameters('storageAccountType')]" + * } + * }, + * { + * "type": "Microsoft.Network/publicIPAddresses", + * "apiVersion": "[variables('apiVersion')]", + * "name": "[variables('publicIPAddressName')]", + * "location": "[variables('location')]", + * "properties": { + * "publicIPAllocationMethod": "[variables('publicIPAddressType')]", + * "dnsSettings": { + * "domainNameLabel": "[variables('dnsLabelPrefix')]" + * } + * } + * } + * ], + * "outputs": { + * "storageAccountName": { + * "type": "string", + * "value": "[variables('storageAccountName')]" + * } + * } + * } + * `, + * parameters: { + * storageAccountType: "Standard_GRS", + * }, + * deploymentMode: "Incremental", + * }); + * export const storageAccountName = exampleTemplateDeployment.outputs.storageAccountName; + * ``` * ## Note * * This provider does not know about the individual resources created by Azure using a deployment template and therefore cannot delete these resources during a destroy. Destroying a template deployment removes the associated deployment operations, but will not delete the Azure resources created by the deployment. In order to delete these resources, the containing resource group must also be destroyed. [More information](https://docs.microsoft.com/rest/api/resources/deployments#Deployments_Delete). diff --git a/sdk/nodejs/core/tenantTemplateDeployment.ts b/sdk/nodejs/core/tenantTemplateDeployment.ts index 6696ae2e3c..0a79211888 100644 --- a/sdk/nodejs/core/tenantTemplateDeployment.ts +++ b/sdk/nodejs/core/tenantTemplateDeployment.ts @@ -5,6 +5,23 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleTemplateSpecVersion = azure.core.getTemplateSpecVersion({ + * name: "myTemplateForTenant", + * resourceGroupName: "myResourceGroup", + * version: "v0.1", + * }); + * const exampleTenantTemplateDeployment = new azure.core.TenantTemplateDeployment("exampleTenantTemplateDeployment", { + * location: "West Europe", + * templateSpecVersionId: exampleTemplateSpecVersion.then(exampleTemplateSpecVersion => exampleTemplateSpecVersion.id), + * }); + * ``` + * * ## Import * * Tenant Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/account.ts b/sdk/nodejs/cosmosdb/account.ts index 391e8a530b..5e7c417d54 100644 --- a/sdk/nodejs/cosmosdb/account.ts +++ b/sdk/nodejs/cosmosdb/account.ts @@ -9,6 +9,56 @@ import * as utilities from "../utilities"; /** * Manages a CosmosDB (formally DocumentDB) Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const rg = new azure.core.ResourceGroup("rg", {location: "westus"}); + * const ri = new random.RandomInteger("ri", { + * min: 10000, + * max: 99999, + * }); + * const db = new azure.cosmosdb.Account("db", { + * location: azurerm_resource_group.example.location, + * resourceGroupName: azurerm_resource_group.example.name, + * offerType: "Standard", + * kind: "MongoDB", + * enableAutomaticFailover: true, + * capabilities: [ + * { + * name: "EnableAggregationPipeline", + * }, + * { + * name: "mongoEnableDocLevelTTL", + * }, + * { + * name: "MongoDBv3.4", + * }, + * { + * name: "EnableMongo", + * }, + * ], + * consistencyPolicy: { + * consistencyLevel: "BoundedStaleness", + * maxIntervalInSeconds: 300, + * maxStalenessPrefix: 100000, + * }, + * geoLocations: [ + * { + * location: "eastus", + * failoverPriority: 1, + * }, + * { + * location: "westus", + * failoverPriority: 0, + * }, + * ], + * }); + * ``` + * * ## Import * * CosmosDB Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/cassandraCluster.ts b/sdk/nodejs/cosmosdb/cassandraCluster.ts index 5b7b3360e3..08638b6daa 100644 --- a/sdk/nodejs/cosmosdb/cassandraCluster.ts +++ b/sdk/nodejs/cosmosdb/cassandraCluster.ts @@ -11,6 +11,46 @@ import * as utilities from "../utilities"; * * > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "Azure Cosmos DB", + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleVirtualNetwork.id, + * roleDefinitionName: "Network Contributor", + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId), + * }); + * const exampleCassandraCluster = new azure.cosmosdb.CassandraCluster("exampleCassandraCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * delegatedManagementSubnetId: exampleSubnet.id, + * defaultAdminPassword: "Password1234", + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Cassandra Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/cassandraDatacenter.ts b/sdk/nodejs/cosmosdb/cassandraDatacenter.ts index 4747ae490f..56917c18a5 100644 --- a/sdk/nodejs/cosmosdb/cassandraDatacenter.ts +++ b/sdk/nodejs/cosmosdb/cassandraDatacenter.ts @@ -9,6 +9,55 @@ import * as utilities from "../utilities"; * * > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "Azure Cosmos DB", + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleVirtualNetwork.id, + * roleDefinitionName: "Network Contributor", + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId), + * }); + * const exampleCassandraCluster = new azure.cosmosdb.CassandraCluster("exampleCassandraCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * delegatedManagementSubnetId: exampleSubnet.id, + * defaultAdminPassword: "Password1234", + * }, { + * dependsOn: [exampleAssignment], + * }); + * const exampleCassandraDatacenter = new azure.cosmosdb.CassandraDatacenter("exampleCassandraDatacenter", { + * location: exampleCassandraCluster.location, + * cassandraClusterId: exampleCassandraCluster.id, + * delegatedManagementSubnetId: exampleSubnet.id, + * nodeCount: 3, + * diskCount: 4, + * skuName: "Standard_DS14_v2", + * availabilityZonesEnabled: false, + * }); + * ``` + * * ## Import * * Cassandra Datacenters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/cassandraKeyspace.ts b/sdk/nodejs/cosmosdb/cassandraKeyspace.ts index c1fade74d9..013573981e 100644 --- a/sdk/nodejs/cosmosdb/cassandraKeyspace.ts +++ b/sdk/nodejs/cosmosdb/cassandraKeyspace.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Cassandra KeySpace within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * offerType: "Standard", + * capabilities: [{ + * name: "EnableCassandra", + * }], + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleCassandraKeyspace = new azure.cosmosdb.CassandraKeyspace("exampleCassandraKeyspace", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * throughput: 400, + * }); + * ``` + * * ## Import * * Cosmos Cassandra KeySpace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/cassandraTable.ts b/sdk/nodejs/cosmosdb/cassandraTable.ts index ce914a16a7..44dde29a6a 100644 --- a/sdk/nodejs/cosmosdb/cassandraTable.ts +++ b/sdk/nodejs/cosmosdb/cassandraTable.ts @@ -9,6 +9,53 @@ import * as utilities from "../utilities"; /** * Manages a Cassandra Table within a Cosmos DB Cassandra Keyspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * offerType: "Standard", + * capabilities: [{ + * name: "EnableCassandra", + * }], + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleCassandraKeyspace = new azure.cosmosdb.CassandraKeyspace("exampleCassandraKeyspace", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * throughput: 400, + * }); + * const exampleCassandraTable = new azure.cosmosdb.CassandraTable("exampleCassandraTable", { + * cassandraKeyspaceId: exampleCassandraKeyspace.id, + * schema: { + * columns: [ + * { + * name: "test1", + * type: "ascii", + * }, + * { + * name: "test2", + * type: "int", + * }, + * ], + * partitionKeys: [{ + * name: "test1", + * }], + * }, + * }); + * ``` + * * ## Import * * Cosmos Cassandra Table can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/getAccount.ts b/sdk/nodejs/cosmosdb/getAccount.ts index c2977e32e0..f2a9bdff2f 100644 --- a/sdk/nodejs/cosmosdb/getAccount.ts +++ b/sdk/nodejs/cosmosdb/getAccount.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * export const cosmosdbAccountEndpoint = example.then(example => example.endpoint); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -123,6 +136,19 @@ export interface GetAccountResult { } /** * Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * export const cosmosdbAccountEndpoint = example.then(example => example.endpoint); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/cosmosdb/getMongoDatabase.ts b/sdk/nodejs/cosmosdb/getMongoDatabase.ts index 2b0d28904a..47435490cb 100644 --- a/sdk/nodejs/cosmosdb/getMongoDatabase.ts +++ b/sdk/nodejs/cosmosdb/getMongoDatabase.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Cosmos DB Mongo Database. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getMongoDatabase({ + * name: "test-cosmosdb-mongo-db", + * resourceGroupName: "test-cosmosdb-account-rg", + * accountName: "test-cosmosdb-account", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getMongoDatabase(args: GetMongoDatabaseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +67,20 @@ export interface GetMongoDatabaseResult { } /** * Use this data source to access information about an existing Cosmos DB Mongo Database. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getMongoDatabase({ + * name: "test-cosmosdb-mongo-db", + * resourceGroupName: "test-cosmosdb-account-rg", + * accountName: "test-cosmosdb-account", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getMongoDatabaseOutput(args: GetMongoDatabaseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMongoDatabase(a, opts)) diff --git a/sdk/nodejs/cosmosdb/getRestorableDatabaseAccounts.ts b/sdk/nodejs/cosmosdb/getRestorableDatabaseAccounts.ts index e26b79446a..3da0ad2460 100644 --- a/sdk/nodejs/cosmosdb/getRestorableDatabaseAccounts.ts +++ b/sdk/nodejs/cosmosdb/getRestorableDatabaseAccounts.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about Cosmos DB Restorable Database Accounts. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getRestorableDatabaseAccounts({ + * name: "example-ca", + * location: "West Europe", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getRestorableDatabaseAccounts(args: GetRestorableDatabaseAccountsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -52,6 +65,19 @@ export interface GetRestorableDatabaseAccountsResult { } /** * Use this data source to access information about Cosmos DB Restorable Database Accounts. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getRestorableDatabaseAccounts({ + * name: "example-ca", + * location: "West Europe", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getRestorableDatabaseAccountsOutput(args: GetRestorableDatabaseAccountsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRestorableDatabaseAccounts(a, opts)) diff --git a/sdk/nodejs/cosmosdb/getSqlDatabase.ts b/sdk/nodejs/cosmosdb/getSqlDatabase.ts index b61475a479..faab50f3da 100644 --- a/sdk/nodejs/cosmosdb/getSqlDatabase.ts +++ b/sdk/nodejs/cosmosdb/getSqlDatabase.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing CosmosDB SQL Database. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getSqlDatabase({ + * accountName: "tfex-cosmosdb-sql-database-account-name", + * name: "tfex-cosmosdb-sql-database", + * resourceGroupName: "tfex-cosmosdb-sql-database-rg", + * }); + * ``` */ export function getSqlDatabase(args: GetSqlDatabaseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +72,19 @@ export interface GetSqlDatabaseResult { } /** * Use this data source to access information about an existing CosmosDB SQL Database. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getSqlDatabase({ + * accountName: "tfex-cosmosdb-sql-database-account-name", + * name: "tfex-cosmosdb-sql-database", + * resourceGroupName: "tfex-cosmosdb-sql-database-rg", + * }); + * ``` */ export function getSqlDatabaseOutput(args: GetSqlDatabaseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSqlDatabase(a, opts)) diff --git a/sdk/nodejs/cosmosdb/getSqlRoleDefinition.ts b/sdk/nodejs/cosmosdb/getSqlRoleDefinition.ts index d254754a65..13b3c6b023 100644 --- a/sdk/nodejs/cosmosdb/getSqlRoleDefinition.ts +++ b/sdk/nodejs/cosmosdb/getSqlRoleDefinition.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Cosmos DB SQL Role Definition. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getSqlRoleDefinition({ + * accountName: "tfex-cosmosdb-sql-role-definition-account-name", + * resourceGroupName: "tfex-cosmosdb-sql-role-definition-rg", + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * }); + * ``` */ export function getSqlRoleDefinition(args: GetSqlRoleDefinitionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +80,19 @@ export interface GetSqlRoleDefinitionResult { } /** * Use this data source to access information about an existing Cosmos DB SQL Role Definition. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.cosmosdb.getSqlRoleDefinition({ + * accountName: "tfex-cosmosdb-sql-role-definition-account-name", + * resourceGroupName: "tfex-cosmosdb-sql-role-definition-rg", + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * }); + * ``` */ export function getSqlRoleDefinitionOutput(args: GetSqlRoleDefinitionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSqlRoleDefinition(a, opts)) diff --git a/sdk/nodejs/cosmosdb/gremlinDatabase.ts b/sdk/nodejs/cosmosdb/gremlinDatabase.ts index cfd5f62ad4..e91df254c8 100644 --- a/sdk/nodejs/cosmosdb/gremlinDatabase.ts +++ b/sdk/nodejs/cosmosdb/gremlinDatabase.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a Gremlin Database within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleGremlinDatabase = new azure.cosmosdb.GremlinDatabase("exampleGremlinDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * throughput: 400, + * }); + * ``` + * * ## Import * * CosmosDB Gremlin Databases can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/gremlinGraph.ts b/sdk/nodejs/cosmosdb/gremlinGraph.ts index 98c80d2209..675696773d 100644 --- a/sdk/nodejs/cosmosdb/gremlinGraph.ts +++ b/sdk/nodejs/cosmosdb/gremlinGraph.ts @@ -9,6 +9,47 @@ import * as utilities from "../utilities"; /** * Manages a Gremlin Graph within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleGremlinDatabase = new azure.cosmosdb.GremlinDatabase("exampleGremlinDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * }); + * const exampleGremlinGraph = new azure.cosmosdb.GremlinGraph("exampleGremlinGraph", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * databaseName: exampleGremlinDatabase.name, + * partitionKeyPath: "/Example", + * throughput: 400, + * indexPolicy: { + * automatic: true, + * indexingMode: "consistent", + * includedPaths: ["/*"], + * excludedPaths: ["/\"_etag\"/?"], + * }, + * conflictResolutionPolicy: { + * mode: "LastWriterWins", + * conflictResolutionPath: "/_ts", + * }, + * uniqueKeys: [{ + * paths: [ + * "/definition/id1", + * "/definition/id2", + * ], + * }], + * }); + * ``` + * + * > **NOTE:** The CosmosDB Account needs to have the `EnableGremlin` capability enabled to use this resource - which can be done by adding this to the `capabilities` list within the `azure.cosmosdb.Account` resource. + * * ## Import * * Cosmos Gremlin Graphs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/mongoCollection.ts b/sdk/nodejs/cosmosdb/mongoCollection.ts index 20c2b3b756..78ac6ab0c0 100644 --- a/sdk/nodejs/cosmosdb/mongoCollection.ts +++ b/sdk/nodejs/cosmosdb/mongoCollection.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages a Mongo Collection within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleMongoDatabase = new azure.cosmosdb.MongoDatabase("exampleMongoDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * }); + * const exampleMongoCollection = new azure.cosmosdb.MongoCollection("exampleMongoCollection", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * databaseName: exampleMongoDatabase.name, + * defaultTtlSeconds: 777, + * shardKey: "uniqueKey", + * throughput: 400, + * indices: [{ + * keys: ["_id"], + * unique: true, + * }], + * }); + * ``` + * * ## Import * * CosmosDB Mongo Collection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/mongoDatabase.ts b/sdk/nodejs/cosmosdb/mongoDatabase.ts index 4406cf3444..f1944ea513 100644 --- a/sdk/nodejs/cosmosdb/mongoDatabase.ts +++ b/sdk/nodejs/cosmosdb/mongoDatabase.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a Mongo Database within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleMongoDatabase = new azure.cosmosdb.MongoDatabase("exampleMongoDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * throughput: 400, + * }); + * ``` + * * ## Import * * Cosmos Mongo Database can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/mongoRoleDefinition.ts b/sdk/nodejs/cosmosdb/mongoRoleDefinition.ts index 6680732562..88c11980d0 100644 --- a/sdk/nodejs/cosmosdb/mongoRoleDefinition.ts +++ b/sdk/nodejs/cosmosdb/mongoRoleDefinition.ts @@ -9,6 +9,44 @@ import * as utilities from "../utilities"; /** * Manages a Cosmos DB Mongo Role Definition. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "MongoDB", + * capabilities: [ + * { + * name: "EnableMongo", + * }, + * { + * name: "EnableMongoRoleBasedAccessControl", + * }, + * ], + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleMongoDatabase = new azure.cosmosdb.MongoDatabase("exampleMongoDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * }); + * const exampleMongoRoleDefinition = new azure.cosmosdb.MongoRoleDefinition("exampleMongoRoleDefinition", { + * cosmosMongoDatabaseId: exampleMongoDatabase.id, + * roleName: "example-roledefinition", + * }); + * ``` + * * ## Import * * Cosmos DB Mongo Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/mongoUserDefinition.ts b/sdk/nodejs/cosmosdb/mongoUserDefinition.ts index ea13d4cac0..e9737fc6b7 100644 --- a/sdk/nodejs/cosmosdb/mongoUserDefinition.ts +++ b/sdk/nodejs/cosmosdb/mongoUserDefinition.ts @@ -7,6 +7,45 @@ import * as utilities from "../utilities"; /** * Manages a Cosmos DB Mongo User Definition. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "MongoDB", + * capabilities: [ + * { + * name: "EnableMongo", + * }, + * { + * name: "EnableMongoRoleBasedAccessControl", + * }, + * ], + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleMongoDatabase = new azure.cosmosdb.MongoDatabase("exampleMongoDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * }); + * const exampleMongoUserDefinition = new azure.cosmosdb.MongoUserDefinition("exampleMongoUserDefinition", { + * cosmosMongoDatabaseId: exampleMongoDatabase.id, + * username: "myUserName", + * password: "myPassword", + * }); + * ``` + * * ## Import * * Cosmos DB Mongo User Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/notebookWorkspace.ts b/sdk/nodejs/cosmosdb/notebookWorkspace.ts index 9a4ae788ea..386fbdc899 100644 --- a/sdk/nodejs/cosmosdb/notebookWorkspace.ts +++ b/sdk/nodejs/cosmosdb/notebookWorkspace.ts @@ -13,6 +13,32 @@ import * as utilities from "../utilities"; * * > **NOTE:** However, CosmosDb Notebook feature no longer uses the permanent notebook workspace being referred to the public surface in the RP (have since moved to temporary notebooks workspaces which are short-lived <1 hour). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "BoundedStaleness", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleNotebookWorkspace = new azure.cosmosdb.NotebookWorkspace("exampleNotebookWorkspace", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * }); + * ``` + * * ## Import * * =SQL Notebook Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/postgresqlCluster.ts b/sdk/nodejs/cosmosdb/postgresqlCluster.ts index 9e08044d41..bbb41bdd4a 100644 --- a/sdk/nodejs/cosmosdb/postgresqlCluster.ts +++ b/sdk/nodejs/cosmosdb/postgresqlCluster.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages an Azure Cosmos DB for PostgreSQL Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePostgresqlCluster = new azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLoginPassword: "H@Sh1CoR3!", + * coordinatorStorageQuotaInMb: 131072, + * coordinatorVcoreCount: 2, + * nodeCount: 0, + * }); + * ``` + * * ## Import * * Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/postgresqlCoordinatorConfiguration.ts b/sdk/nodejs/cosmosdb/postgresqlCoordinatorConfiguration.ts index 2ff2369d76..3a8cb24fda 100644 --- a/sdk/nodejs/cosmosdb/postgresqlCoordinatorConfiguration.ts +++ b/sdk/nodejs/cosmosdb/postgresqlCoordinatorConfiguration.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Sets a Coordinator Configuration value on Azure Cosmos DB for PostgreSQL Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = new azure.core.ResourceGroup("test", {location: "West Europe"}); + * const examplePostgresqlCluster = new azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", { + * resourceGroupName: azurerm_resource_group.example.name, + * location: azurerm_resource_group.example.location, + * administratorLoginPassword: "H@Sh1CoR3!", + * coordinatorStorageQuotaInMb: 131072, + * coordinatorVcoreCount: 2, + * nodeCount: 2, + * nodeStorageQuotaInMb: 131072, + * nodeVcores: 2, + * }); + * const examplePostgresqlCoordinatorConfiguration = new azure.cosmosdb.PostgresqlCoordinatorConfiguration("examplePostgresqlCoordinatorConfiguration", { + * clusterId: examplePostgresqlCluster.id, + * value: "on", + * }); + * ``` + * * ## Import * * Coordinator Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/postgresqlFirewallRule.ts b/sdk/nodejs/cosmosdb/postgresqlFirewallRule.ts index 45ca126b67..68ec8ad649 100644 --- a/sdk/nodejs/cosmosdb/postgresqlFirewallRule.ts +++ b/sdk/nodejs/cosmosdb/postgresqlFirewallRule.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages an Azure Cosmos DB for PostgreSQL Firewall Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePostgresqlCluster = new azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLoginPassword: "H@Sh1CoR3!", + * coordinatorStorageQuotaInMb: 131072, + * coordinatorVcoreCount: 2, + * nodeCount: 0, + * }); + * const examplePostgresqlFirewallRule = new azure.cosmosdb.PostgresqlFirewallRule("examplePostgresqlFirewallRule", { + * clusterId: examplePostgresqlCluster.id, + * startIpAddress: "10.0.17.62", + * endIpAddress: "10.0.17.64", + * }); + * ``` + * * ## Import * * Azure Cosmos DB for PostgreSQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/postgresqlNodeConfiguration.ts b/sdk/nodejs/cosmosdb/postgresqlNodeConfiguration.ts index 1bdab34fbe..35b2cc091f 100644 --- a/sdk/nodejs/cosmosdb/postgresqlNodeConfiguration.ts +++ b/sdk/nodejs/cosmosdb/postgresqlNodeConfiguration.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Sets a Node Configuration value on Azure Cosmos DB for PostgreSQL Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePostgresqlCluster = new azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLoginPassword: "H@Sh1CoR3!", + * coordinatorStorageQuotaInMb: 131072, + * coordinatorVcoreCount: 2, + * nodeCount: 2, + * nodeStorageQuotaInMb: 131072, + * nodeVcores: 2, + * }); + * const examplePostgresqlNodeConfiguration = new azure.cosmosdb.PostgresqlNodeConfiguration("examplePostgresqlNodeConfiguration", { + * clusterId: examplePostgresqlCluster.id, + * value: "on", + * }); + * ``` + * * ## Import * * Node Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/postgresqlRole.ts b/sdk/nodejs/cosmosdb/postgresqlRole.ts index 2cffcf1b0f..f4211d6cd7 100644 --- a/sdk/nodejs/cosmosdb/postgresqlRole.ts +++ b/sdk/nodejs/cosmosdb/postgresqlRole.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages an Azure Cosmos DB for PostgreSQL Role. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePostgresqlCluster = new azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLoginPassword: "H@Sh1CoR3!", + * coordinatorStorageQuotaInMb: 131072, + * coordinatorVcoreCount: 2, + * nodeCount: 0, + * }); + * const examplePostgresqlRole = new azure.cosmosdb.PostgresqlRole("examplePostgresqlRole", { + * clusterId: examplePostgresqlCluster.id, + * password: "H@Sh1CoR3!", + * }); + * ``` + * * ## Import * * Azure Cosmos DB for PostgreSQL Roles can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlContainer.ts b/sdk/nodejs/cosmosdb/sqlContainer.ts index 69fc12f6d0..86dc2fd348 100644 --- a/sdk/nodejs/cosmosdb/sqlContainer.ts +++ b/sdk/nodejs/cosmosdb/sqlContainer.ts @@ -9,6 +9,50 @@ import * as utilities from "../utilities"; /** * Manages a SQL Container within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/definition/id", + * partitionKeyVersion: 1, + * throughput: 400, + * indexingPolicy: { + * indexingMode: "consistent", + * includedPaths: [ + * { + * path: "/*", + * }, + * { + * path: "/included/?", + * }, + * ], + * excludedPaths: [{ + * path: "/excluded/?", + * }], + * }, + * uniqueKeys: [{ + * paths: [ + * "/definition/idlong", + * "/definition/idshort", + * ], + * }], + * }); + * ``` + * * ## Import * * Cosmos SQL Containers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlDatabase.ts b/sdk/nodejs/cosmosdb/sqlDatabase.ts index 3eb947e693..3494c3b794 100644 --- a/sdk/nodejs/cosmosdb/sqlDatabase.ts +++ b/sdk/nodejs/cosmosdb/sqlDatabase.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a SQL Database within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * throughput: 400, + * }); + * ``` + * * ## Import * * Cosmos SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlDedicatedGateway.ts b/sdk/nodejs/cosmosdb/sqlDedicatedGateway.ts index 06f7cc1414..972d60cb64 100644 --- a/sdk/nodejs/cosmosdb/sqlDedicatedGateway.ts +++ b/sdk/nodejs/cosmosdb/sqlDedicatedGateway.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages a SQL Dedicated Gateway within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "BoundedStaleness", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlDedicatedGateway = new azure.cosmosdb.SqlDedicatedGateway("exampleSqlDedicatedGateway", { + * cosmosdbAccountId: exampleAccount.id, + * instanceCount: 1, + * instanceSize: "Cosmos.D4s", + * }); + * ``` + * * ## Import * * CosmosDB SQL Dedicated Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlFunction.ts b/sdk/nodejs/cosmosdb/sqlFunction.ts index 645a205e0f..9cd46fecc0 100644 --- a/sdk/nodejs/cosmosdb/sqlFunction.ts +++ b/sdk/nodejs/cosmosdb/sqlFunction.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages an SQL User Defined Function. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * throughput: 400, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/id", + * }); + * const exampleSqlFunction = new azure.cosmosdb.SqlFunction("exampleSqlFunction", { + * containerId: exampleSqlContainer.id, + * body: "function trigger(){}", + * }); + * ``` + * * ## Import * * SQL User Defined Functions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlRoleAssignment.ts b/sdk/nodejs/cosmosdb/sqlRoleAssignment.ts index 55f719554b..5bb08cbcda 100644 --- a/sdk/nodejs/cosmosdb/sqlRoleAssignment.ts +++ b/sdk/nodejs/cosmosdb/sqlRoleAssignment.ts @@ -7,6 +7,45 @@ import * as utilities from "../utilities"; /** * Manages a Cosmos DB SQL Role Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlRoleDefinition = new azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * type: "CustomRole", + * assignableScopes: [exampleAccount.id], + * permissions: [{ + * dataActions: ["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"], + * }], + * }); + * const exampleSqlRoleAssignment = new azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * roleDefinitionId: exampleSqlRoleDefinition.id, + * principalId: current.then(current => current.objectId), + * scope: exampleAccount.id, + * }); + * ``` + * * ## Import * * Cosmos DB SQL Role Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlRoleDefinition.ts b/sdk/nodejs/cosmosdb/sqlRoleDefinition.ts index 659139027a..72e05c3859 100644 --- a/sdk/nodejs/cosmosdb/sqlRoleDefinition.ts +++ b/sdk/nodejs/cosmosdb/sqlRoleDefinition.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; /** * Manages a Cosmos DB SQL Role Definition. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlRoleDefinition = new azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition", { + * roleDefinitionId: "84cf3a8b-4122-4448-bce2-fa423cfe0a15", + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * assignableScopes: [pulumi.interpolate`${exampleAccount.id}/dbs/sales`], + * permissions: [{ + * dataActions: ["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"], + * }], + * }); + * ``` + * * ## Import * * Cosmos DB SQL Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlStoredProcedure.ts b/sdk/nodejs/cosmosdb/sqlStoredProcedure.ts index 7ea38335f5..ac5177d3c0 100644 --- a/sdk/nodejs/cosmosdb/sqlStoredProcedure.ts +++ b/sdk/nodejs/cosmosdb/sqlStoredProcedure.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a SQL Stored Procedure within a Cosmos DB Account SQL Database. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * throughput: 400, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/id", + * }); + * const exampleSqlStoredProcedure = new azure.cosmosdb.SqlStoredProcedure("exampleSqlStoredProcedure", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * databaseName: exampleSqlDatabase.name, + * containerName: exampleSqlContainer.name, + * body: " function () { var context = getContext(); var response = context.getResponse(); response.setBody('Hello, World'); }\n", + * }); + * ``` + * * ## Import * * CosmosDB SQL Stored Procedures can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/sqlTrigger.ts b/sdk/nodejs/cosmosdb/sqlTrigger.ts index 8e980e956a..fc61015aba 100644 --- a/sdk/nodejs/cosmosdb/sqlTrigger.ts +++ b/sdk/nodejs/cosmosdb/sqlTrigger.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages an SQL Trigger. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * throughput: 400, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/id", + * }); + * const exampleSqlTrigger = new azure.cosmosdb.SqlTrigger("exampleSqlTrigger", { + * containerId: exampleSqlContainer.id, + * body: "function trigger(){}", + * operation: "Delete", + * type: "Post", + * }); + * ``` + * * ## Import * * SQL Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/cosmosdb/table.ts b/sdk/nodejs/cosmosdb/table.ts index 9e0adb8116..30e88ebb9a 100644 --- a/sdk/nodejs/cosmosdb/table.ts +++ b/sdk/nodejs/cosmosdb/table.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a Table within a Cosmos DB Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleTable = new azure.cosmosdb.Table("exampleTable", { + * resourceGroupName: exampleAccount.then(exampleAccount => exampleAccount.resourceGroupName), + * accountName: exampleAccount.then(exampleAccount => exampleAccount.name), + * throughput: 400, + * }); + * ``` + * * ## Import * * CosmosDB Tables can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/costmanagement/anomalyAlert.ts b/sdk/nodejs/costmanagement/anomalyAlert.ts index af1dd98d6f..15c18ab4ff 100644 --- a/sdk/nodejs/costmanagement/anomalyAlert.ts +++ b/sdk/nodejs/costmanagement/anomalyAlert.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Cost Anomaly Alert. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.costmanagement.AnomalyAlert("example", { + * displayName: "Alert DisplayName", + * emailAddresses: ["example@test.net"], + * emailSubject: "My Test Anomaly Alert", + * }); + * ``` + * * ## Import * * Cost Anomaly Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/costmanagement/scheduledAction.ts b/sdk/nodejs/costmanagement/scheduledAction.ts index 31f5a7c3f9..cc86696940 100644 --- a/sdk/nodejs/costmanagement/scheduledAction.ts +++ b/sdk/nodejs/costmanagement/scheduledAction.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages an Azure Cost Management Scheduled Action. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.costmanagement.ScheduledAction("example", { + * displayName: "Report Last 6 Months", + * emailAddressSender: "platformteam@test.com", + * emailAddresses: ["example@example.com"], + * emailSubject: "Cost Management Report", + * endDate: "2023-02-02T00:00:00Z", + * frequency: "Daily", + * message: "Hi all, take a look at last 6 months spending!", + * startDate: "2023-01-02T00:00:00Z", + * viewId: "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService", + * }); + * ``` + * * ## Import * * Azure Cost Management Scheduled Actions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dashboard/azurerm_portal_dashboard.ts b/sdk/nodejs/dashboard/azurerm_portal_dashboard.ts index ee353d977a..9e2a5e793e 100644 --- a/sdk/nodejs/dashboard/azurerm_portal_dashboard.ts +++ b/sdk/nodejs/dashboard/azurerm_portal_dashboard.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.portal.getDashboard({ + * name: "existing-dashboard", + * resourceGroupName: "dashboard-rg", + * }); + * export const id = data.azurerm_dashboard.example.id; + * ``` */ /** @deprecated azure.dashboard.azurerm_portal_dashboard has been deprecated in favor of azure.portal.getDashboard */ export function azurerm_portal_dashboard(args: Azurerm_portal_dashboardArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface Azurerm_portal_dashboardResult { } /** * Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.portal.getDashboard({ + * name: "existing-dashboard", + * resourceGroupName: "dashboard-rg", + * }); + * export const id = data.azurerm_dashboard.example.id; + * ``` */ /** @deprecated azure.dashboard.azurerm_portal_dashboard has been deprecated in favor of azure.portal.getDashboard */ export function azurerm_portal_dashboardOutput(args: Azurerm_portal_dashboardOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { diff --git a/sdk/nodejs/dashboard/dashboard.ts b/sdk/nodejs/dashboard/dashboard.ts index 3706e2c6dc..b0055d506e 100644 --- a/sdk/nodejs/dashboard/dashboard.ts +++ b/sdk/nodejs/dashboard/dashboard.ts @@ -9,6 +9,138 @@ import * as utilities from "../utilities"; * * !> **Note:** The `azure.portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.portal.PortalDashboard` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const config = new pulumi.Config(); + * const mdContent = config.get("mdContent") || "# Hello all :)"; + * const videoLink = config.get("videoLink") || "https://www.youtube.com/watch?v=......"; + * const current = azure.core.getSubscription({}); + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const my_board = new azure.portal.Dashboard("my-board", { + * resourceGroupName: example.name, + * location: example.location, + * tags: { + * source: "managed", + * }, + * dashboardProperties: current.then(current => `{ + * "lenses": { + * "0": { + * "order": 0, + * "parts": { + * "0": { + * "position": { + * "x": 0, + * "y": 0, + * "rowSpan": 2, + * "colSpan": 3 + * }, + * "metadata": { + * "inputs": [], + * "type": "Extension/HubsExtension/PartType/MarkdownPart", + * "settings": { + * "content": { + * "settings": { + * "content": "${mdContent}", + * "subtitle": "", + * "title": "" + * } + * } + * } + * } + * }, + * "1": { + * "position": { + * "x": 5, + * "y": 0, + * "rowSpan": 4, + * "colSpan": 6 + * }, + * "metadata": { + * "inputs": [], + * "type": "Extension/HubsExtension/PartType/VideoPart", + * "settings": { + * "content": { + * "settings": { + * "title": "Important Information", + * "subtitle": "", + * "src": "${videoLink}", + * "autoplay": true + * } + * } + * } + * } + * }, + * "2": { + * "position": { + * "x": 0, + * "y": 4, + * "rowSpan": 4, + * "colSpan": 6 + * }, + * "metadata": { + * "inputs": [ + * { + * "name": "ComponentId", + * "value": "/subscriptions/${current.subscriptionId}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" + * } + * ], + * "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", + * "settings": {}, + * "asset": { + * "idInputName": "ComponentId", + * "type": "ApplicationInsights" + * } + * } + * } + * } + * } + * }, + * "metadata": { + * "model": { + * "timeRange": { + * "value": { + * "relative": { + * "duration": 24, + * "timeUnit": 1 + * } + * }, + * "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + * }, + * "filterLocale": { + * "value": "en-us" + * }, + * "filters": { + * "value": { + * "MsPortalFx_TimeRange": { + * "model": { + * "format": "utc", + * "granularity": "auto", + * "relative": "24h" + * }, + * "displayCache": { + * "name": "UTC Time", + * "value": "Past 24 hours" + * }, + * "filteredPartIds": [ + * "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" + * ] + * } + * } + * } + * } + * } + * } + * `), + * }); + * ``` + * + * It is recommended to follow the steps outlined + * [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + * * ## Import * * Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dashboard/grafana.ts b/sdk/nodejs/dashboard/grafana.ts index d4c0abd1fd..e91f828d7c 100644 --- a/sdk/nodejs/dashboard/grafana.ts +++ b/sdk/nodejs/dashboard/grafana.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Dashboard Grafana. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleGrafana = new azure.dashboard.Grafana("exampleGrafana", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * apiKeyEnabled: true, + * deterministicOutboundIpEnabled: true, + * publicNetworkAccessEnabled: false, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Dashboard Grafana can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/databasemigration/getProject.ts b/sdk/nodejs/databasemigration/getProject.ts index cfca5938ac..20bd423211 100644 --- a/sdk/nodejs/databasemigration/getProject.ts +++ b/sdk/nodejs/databasemigration/getProject.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Database Migration Project. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databasemigration.getProject({ + * name: "example-dbms-project", + * resourceGroupName: "example-rg", + * serviceName: "example-dbms", + * }); + * export const name = example.then(example => example.name); + * ``` */ export function getProject(args: GetProjectArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +79,20 @@ export interface GetProjectResult { } /** * Use this data source to access information about an existing Database Migration Project. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databasemigration.getProject({ + * name: "example-dbms-project", + * resourceGroupName: "example-rg", + * serviceName: "example-dbms", + * }); + * export const name = example.then(example => example.name); + * ``` */ export function getProjectOutput(args: GetProjectOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getProject(a, opts)) diff --git a/sdk/nodejs/databasemigration/getService.ts b/sdk/nodejs/databasemigration/getService.ts index 96cda1213c..ced7514152 100644 --- a/sdk/nodejs/databasemigration/getService.ts +++ b/sdk/nodejs/databasemigration/getService.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Database Migration Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databasemigration.getService({ + * name: "example-dms", + * resourceGroupName: "example-rg", + * }); + * export const azurermDmsId = example.then(example => example.id); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +72,19 @@ export interface GetServiceResult { } /** * Use this data source to access information about an existing Database Migration Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databasemigration.getService({ + * name: "example-dms", + * resourceGroupName: "example-rg", + * }); + * export const azurermDmsId = example.then(example => example.id); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/databasemigration/project.ts b/sdk/nodejs/databasemigration/project.ts index 512d44c88e..121bb31a1e 100644 --- a/sdk/nodejs/databasemigration/project.ts +++ b/sdk/nodejs/databasemigration/project.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; * * > **NOTE:** Destroying a Database Migration Project will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleService = new azure.databasemigration.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * subnetId: exampleSubnet.id, + * skuName: "Standard_1vCores", + * }); + * const exampleProject = new azure.databasemigration.Project("exampleProject", { + * serviceName: exampleService.name, + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sourcePlatform: "SQL", + * targetPlatform: "SQLDB", + * }); + * ``` + * * ## Import * * Database Migration Projects can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/databasemigration/service.ts b/sdk/nodejs/databasemigration/service.ts index b998e62c33..4f1f251fc1 100644 --- a/sdk/nodejs/databasemigration/service.ts +++ b/sdk/nodejs/databasemigration/service.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; * * > **NOTE:** Destroying a Database Migration Service will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provide. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleService = new azure.databasemigration.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * subnetId: exampleSubnet.id, + * skuName: "Standard_1vCores", + * }); + * ``` + * * ## Import * * Database Migration Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/databoxedge/device.ts b/sdk/nodejs/databoxedge/device.ts index e2a9f1c3ef..e568523e28 100644 --- a/sdk/nodejs/databoxedge/device.ts +++ b/sdk/nodejs/databoxedge/device.ts @@ -9,6 +9,20 @@ import * as utilities from "../utilities"; /** * Manages a Databox Edge Device. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDevice = new azure.databoxedge.Device("exampleDevice", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "EdgeP_Base-Standard", + * }); + * ``` + * * ## Import * * Databox Edge Devices can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/databoxedge/getDevice.ts b/sdk/nodejs/databoxedge/getDevice.ts index 7ff69b9cd3..c8cf85982d 100644 --- a/sdk/nodejs/databoxedge/getDevice.ts +++ b/sdk/nodejs/databoxedge/getDevice.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Get information about a Databox Edge Device. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databoxedge.getDevice({ + * name: "example-device", + * resourceGroupName: "example-rg", + * }); + * ``` */ export function getDevice(args: GetDeviceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +73,18 @@ export interface GetDeviceResult { } /** * Get information about a Databox Edge Device. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databoxedge.getDevice({ + * name: "example-device", + * resourceGroupName: "example-rg", + * }); + * ``` */ export function getDeviceOutput(args: GetDeviceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDevice(a, opts)) diff --git a/sdk/nodejs/databoxedge/order.ts b/sdk/nodejs/databoxedge/order.ts index ec45246270..9de94e3203 100644 --- a/sdk/nodejs/databoxedge/order.ts +++ b/sdk/nodejs/databoxedge/order.ts @@ -11,6 +11,37 @@ import * as utilities from "../utilities"; * * !> Creation of Databox Edge Order is not supported by the Azure API - as such the `azure.databoxedge.Order` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDevice = new azure.databoxedge.Device("exampleDevice", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "EdgeP_Base-Standard", + * }); + * const exampleOrder = new azure.databoxedge.Order("exampleOrder", { + * resourceGroupName: exampleResourceGroup.name, + * deviceName: exampleDevice.name, + * contact: { + * name: "TerraForm Test", + * emails: ["creator4983@FlynnsArcade.com"], + * companyName: "Flynn's Arcade", + * phoneNumber: "(800) 555-1234", + * }, + * shipmentAddress: { + * addresses: ["One Microsoft Way"], + * city: "Redmond", + * postalCode: "98052", + * state: "WA", + * country: "United States", + * }, + * }); + * ``` + * * ## Import * * Databox Edge Orders can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/databricks/accessConnector.ts b/sdk/nodejs/databricks/accessConnector.ts index 80fdc4dace..af19afcb9a 100644 --- a/sdk/nodejs/databricks/accessConnector.ts +++ b/sdk/nodejs/databricks/accessConnector.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; /** * Manages a Databricks Access Connector * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccessConnector = new azure.databricks.AccessConnector("exampleAccessConnector", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Databricks Access Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/databricks/getWorkspace.ts b/sdk/nodejs/databricks/getWorkspace.ts index d0ef2ee642..6501ce2d3d 100644 --- a/sdk/nodejs/databricks/getWorkspace.ts +++ b/sdk/nodejs/databricks/getWorkspace.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Databricks workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databricks.getWorkspace({ + * name: "example-workspace", + * resourceGroupName: "example-rg", + * }); + * export const databricksWorkspaceId = example.then(example => example.workspaceId); + * ``` */ export function getWorkspace(args: GetWorkspaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -78,6 +91,19 @@ export interface GetWorkspaceResult { } /** * Use this data source to access information about an existing Databricks workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databricks.getWorkspace({ + * name: "example-workspace", + * resourceGroupName: "example-rg", + * }); + * export const databricksWorkspaceId = example.then(example => example.workspaceId); + * ``` */ export function getWorkspaceOutput(args: GetWorkspaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWorkspace(a, opts)) diff --git a/sdk/nodejs/databricks/getWorkspacePrivateEndpointConnection.ts b/sdk/nodejs/databricks/getWorkspacePrivateEndpointConnection.ts index 39a96c084d..479169b276 100644 --- a/sdk/nodejs/databricks/getWorkspacePrivateEndpointConnection.ts +++ b/sdk/nodejs/databricks/getWorkspacePrivateEndpointConnection.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information on an existing Databricks Workspace private endpoint connection state. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databricks.getWorkspacePrivateEndpointConnection({ + * workspaceId: azurerm_databricks_workspace.example.id, + * privateEndpointId: azurerm_private_endpoint.example.id, + * }); + * export const databricksWorkspacePrivateEndpointConnectionStatus = example.then(example => example.connections?.[0]?.status); + * ``` */ export function getWorkspacePrivateEndpointConnection(args: GetWorkspacePrivateEndpointConnectionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetWorkspacePrivateEndpointConnectionResult { } /** * Use this data source to access information on an existing Databricks Workspace private endpoint connection state. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.databricks.getWorkspacePrivateEndpointConnection({ + * workspaceId: azurerm_databricks_workspace.example.id, + * privateEndpointId: azurerm_private_endpoint.example.id, + * }); + * export const databricksWorkspacePrivateEndpointConnectionStatus = example.then(example => example.connections?.[0]?.status); + * ``` */ export function getWorkspacePrivateEndpointConnectionOutput(args: GetWorkspacePrivateEndpointConnectionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWorkspacePrivateEndpointConnection(a, opts)) diff --git a/sdk/nodejs/databricks/virtualNetworkPeering.ts b/sdk/nodejs/databricks/virtualNetworkPeering.ts index df036af83d..d7335c3bab 100644 --- a/sdk/nodejs/databricks/virtualNetworkPeering.ts +++ b/sdk/nodejs/databricks/virtualNetworkPeering.ts @@ -7,6 +7,38 @@ import * as utilities from "../utilities"; /** * Manages a Databricks Virtual Network Peering * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const remoteVirtualNetwork = new azure.network.VirtualNetwork("remoteVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.1.0/24"], + * location: exampleResourceGroup.location, + * }); + * const exampleWorkspace = new azure.databricks.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "standard", + * }); + * const exampleVirtualNetworkPeering = new azure.databricks.VirtualNetworkPeering("exampleVirtualNetworkPeering", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceId: exampleWorkspace.id, + * remoteAddressSpacePrefixes: remoteVirtualNetwork.addressSpaces, + * remoteVirtualNetworkId: remoteVirtualNetwork.id, + * allowVirtualNetworkAccess: true, + * }); + * const remoteVirtualNetworkPeering = new azure.network.VirtualNetworkPeering("remoteVirtualNetworkPeering", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: remoteVirtualNetwork.name, + * remoteVirtualNetworkId: exampleVirtualNetworkPeering.virtualNetworkId, + * allowVirtualNetworkAccess: true, + * }); + * ``` + * * ## Import * * Databrick Virtual Network Peerings can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datadog/monitor.ts b/sdk/nodejs/datadog/monitor.ts index ffcf0e2ec3..99753580dc 100644 --- a/sdk/nodejs/datadog/monitor.ts +++ b/sdk/nodejs/datadog/monitor.ts @@ -10,10 +10,51 @@ import * as utilities from "../utilities"; * Manages a datadog Monitor. * * ## Example Usage + * ### Monitor creation with linking to Datadog organization + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US 2"}); + * const exampleMonitor = new azure.datadog.Monitor("exampleMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datadogOrganization: { + * apiKey: "XXXX", + * applicationKey: "XXXX", + * }, + * user: { + * name: "Example", + * email: "abc@xyz.com", + * }, + * skuName: "Linked", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` * ## Role Assignment * * To enable metrics flow, perform role assignment on the identity created above. `Monitoring reader(43d0d8ad-25c7-4714-9337-8ba259a9fe05)` role is required . * + * ### Role assignment on the monitor created + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const monitoringReader = azure.authorization.getRoleDefinition({ + * name: "Monitoring Reader", + * }); + * const example = new azure.authorization.Assignment("example", { + * scope: primary.then(primary => primary.id), + * roleDefinitionId: monitoringReader.then(monitoringReader => monitoringReader.roleDefinitionId), + * principalId: azurerm_datadog_monitor.example.identity[0].principal_id, + * }); + * ``` + * * ## Import * * Datadog Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datadog/monitorSsoConfiguration.ts b/sdk/nodejs/datadog/monitorSsoConfiguration.ts index 1f3c2c8ded..1b75c6b79e 100644 --- a/sdk/nodejs/datadog/monitorSsoConfiguration.ts +++ b/sdk/nodejs/datadog/monitorSsoConfiguration.ts @@ -8,6 +8,34 @@ import * as utilities from "../utilities"; * Manages SingleSignOn on the datadog Monitor. * * ## Example Usage + * ### Enabling SSO on monitor + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US 2"}); + * const exampleMonitor = new azure.datadog.Monitor("exampleMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datadogOrganization: { + * apiKey: "XXXX", + * applicationKey: "XXXX", + * }, + * user: { + * name: "Example", + * email: "abc@xyz.com", + * }, + * skuName: "Linked", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleMonitorSsoConfiguration = new azure.datadog.MonitorSsoConfiguration("exampleMonitorSsoConfiguration", { + * datadogMonitorId: exampleMonitor.id, + * singleSignOnEnabled: "Enable", + * enterpriseApplicationId: "XXXX", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/datadog/monitorTagRule.ts b/sdk/nodejs/datadog/monitorTagRule.ts index a47f20cc48..39a0a048f7 100644 --- a/sdk/nodejs/datadog/monitorTagRule.ts +++ b/sdk/nodejs/datadog/monitorTagRule.ts @@ -10,6 +10,42 @@ import * as utilities from "../utilities"; * Manages TagRules on the datadog Monitor. * * ## Example Usage + * ### Adding TagRules on monitor + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US 2"}); + * const exampleMonitor = new azure.datadog.Monitor("exampleMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datadogOrganization: { + * apiKey: "XXXX", + * applicationKey: "XXXX", + * }, + * user: { + * name: "Example", + * email: "abc@xyz.com", + * }, + * skuName: "Linked", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleMonitorTagRule = new azure.datadog.MonitorTagRule("exampleMonitorTagRule", { + * datadogMonitorId: exampleMonitor.id, + * logs: [{ + * subscriptionLogEnabled: true, + * }], + * metrics: [{ + * filters: [{ + * name: "Test", + * value: "Logs", + * action: "Include", + * }], + * }], + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/datafactory/customDataset.ts b/sdk/nodejs/datafactory/customDataset.ts index 0a0108d397..184cb5fe60 100644 --- a/sdk/nodejs/datafactory/customDataset.ts +++ b/sdk/nodejs/datafactory/customDataset.ts @@ -9,6 +9,96 @@ import * as utilities from "../utilities"; /** * Manages a Dataset inside an Azure Data Factory. This is a generic resource that supports all different Dataset Types. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleLinkedCustomService = new azure.datafactory.LinkedCustomService("exampleLinkedCustomService", { + * dataFactoryId: exampleFactory.id, + * type: "AzureBlobStorage", + * typePropertiesJson: pulumi.interpolate`{ + * "connectionString":"${exampleAccount.primaryConnectionString}" + * } + * `, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleCustomDataset = new azure.datafactory.CustomDataset("exampleCustomDataset", { + * dataFactoryId: exampleFactory.id, + * type: "Json", + * linkedService: { + * name: exampleLinkedCustomService.name, + * parameters: { + * key1: "value1", + * }, + * }, + * typePropertiesJson: pulumi.interpolate`{ + * "location": { + * "container":"${exampleContainer.name}", + * "fileName":"foo.txt", + * "folderPath": "foo/bar/", + * "type":"AzureBlobStorageLocation" + * }, + * "encodingName":"UTF-8" + * } + * `, + * description: "test description", + * annotations: [ + * "test1", + * "test2", + * "test3", + * ], + * folder: "testFolder", + * parameters: { + * foo: "test1", + * Bar: "Test2", + * }, + * additionalProperties: { + * foo: "test1", + * bar: "test2", + * }, + * schemaJson: `{ + * "type": "object", + * "properties": { + * "name": { + * "type": "object", + * "properties": { + * "firstName": { + * "type": "string" + * }, + * "lastName": { + * "type": "string" + * } + * } + * }, + * "age": { + * "type": "integer" + * } + * } + * } + * `, + * }); + * ``` + * * ## Import * * Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/dataFlow.ts b/sdk/nodejs/datafactory/dataFlow.ts index 26ea554edd..935a1ece02 100644 --- a/sdk/nodejs/datafactory/dataFlow.ts +++ b/sdk/nodejs/datafactory/dataFlow.ts @@ -9,6 +9,146 @@ import * as utilities from "../utilities"; /** * Manages a Data Flow inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedCustomService = new azure.datafactory.LinkedCustomService("exampleLinkedCustomService", { + * dataFactoryId: exampleFactory.id, + * type: "AzureBlobStorage", + * typePropertiesJson: pulumi.interpolate`{ + * "connectionString": "${exampleAccount.primaryConnectionString}" + * } + * `, + * }); + * const example1DatasetJson = new azure.datafactory.DatasetJson("example1DatasetJson", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedCustomService.name, + * azureBlobStorageLocation: { + * container: "container", + * path: "foo/bar/", + * filename: "foo.txt", + * }, + * encoding: "UTF-8", + * }); + * const example2DatasetJson = new azure.datafactory.DatasetJson("example2DatasetJson", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedCustomService.name, + * azureBlobStorageLocation: { + * container: "container", + * path: "foo/bar/", + * filename: "bar.txt", + * }, + * encoding: "UTF-8", + * }); + * const example1FlowletDataFlow = new azure.datafactory.FlowletDataFlow("example1FlowletDataFlow", { + * dataFactoryId: exampleFactory.id, + * sources: [{ + * name: "source1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * sinks: [{ + * name: "sink1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * script: `source( + * allowSchemaDrift: true, + * validateSchema: false, + * limit: 100, + * ignoreNoFilesFound: false, + * documentForm: 'documentPerLine') ~> source1 + * source1 sink( + * allowSchemaDrift: true, + * validateSchema: false, + * skipDuplicateMapInputs: true, + * skipDuplicateMapOutputs: true) ~> sink1 + * `, + * }); + * const example2FlowletDataFlow = new azure.datafactory.FlowletDataFlow("example2FlowletDataFlow", { + * dataFactoryId: exampleFactory.id, + * sources: [{ + * name: "source1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * sinks: [{ + * name: "sink1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * script: `source( + * allowSchemaDrift: true, + * validateSchema: false, + * limit: 100, + * ignoreNoFilesFound: false, + * documentForm: 'documentPerLine') ~> source1 + * source1 sink( + * allowSchemaDrift: true, + * validateSchema: false, + * skipDuplicateMapInputs: true, + * skipDuplicateMapOutputs: true) ~> sink1 + * `, + * }); + * const exampleDataFlow = new azure.datafactory.DataFlow("exampleDataFlow", { + * dataFactoryId: exampleFactory.id, + * sources: [{ + * name: "source1", + * flowlet: { + * name: example1FlowletDataFlow.name, + * parameters: { + * Key1: "value1", + * }, + * }, + * dataset: { + * name: example1DatasetJson.name, + * }, + * }], + * sinks: [{ + * name: "sink1", + * flowlet: { + * name: example2FlowletDataFlow.name, + * parameters: { + * Key1: "value1", + * }, + * }, + * dataset: { + * name: example2DatasetJson.name, + * }, + * }], + * script: `source( + * allowSchemaDrift: true, + * validateSchema: false, + * limit: 100, + * ignoreNoFilesFound: false, + * documentForm: 'documentPerLine') ~> source1 + * source1 sink( + * allowSchemaDrift: true, + * validateSchema: false, + * skipDuplicateMapInputs: true, + * skipDuplicateMapOutputs: true) ~> sink1 + * `, + * }); + * ``` + * * ## Import * * Data Factory Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetAzureBlob.ts b/sdk/nodejs/datafactory/datasetAzureBlob.ts index 1720ced584..be0b91081f 100644 --- a/sdk/nodejs/datafactory/datasetAzureBlob.ts +++ b/sdk/nodejs/datafactory/datasetAzureBlob.ts @@ -9,6 +9,33 @@ import * as utilities from "../utilities"; /** * Manages an Azure Blob Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = azure.storage.getAccountOutput({ + * name: "storageaccountname", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceAzureBlobStorage = new azure.datafactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", { + * dataFactoryId: exampleFactory.id, + * connectionString: exampleAccount.apply(exampleAccount => exampleAccount.primaryConnectionString), + * }); + * const exampleDatasetAzureBlob = new azure.datafactory.DatasetAzureBlob("exampleDatasetAzureBlob", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceAzureBlobStorage.name, + * path: "foo", + * filename: "bar.png", + * }); + * ``` + * * ## Import * * Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetAzureSqlTable.ts b/sdk/nodejs/datafactory/datasetAzureSqlTable.ts index b153c4f3d9..089c95e013 100644 --- a/sdk/nodejs/datafactory/datasetAzureSqlTable.ts +++ b/sdk/nodejs/datafactory/datasetAzureSqlTable.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages an Azure SQL Table Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceAzureSqlDatabase = new azure.datafactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Integrated Security=False;Data Source=test;Initial Catalog=test;Initial Catalog=test;User ID=test;Password=test", + * }); + * const exampleDatasetAzureSqlTable = new azure.datafactory.DatasetAzureSqlTable("exampleDatasetAzureSqlTable", { + * dataFactoryId: exampleFactory.id, + * linkedServiceId: exampleLinkedServiceAzureSqlDatabase.id, + * }); + * ``` + * * ## Import * * Data Factory Azure SQL Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetBinary.ts b/sdk/nodejs/datafactory/datasetBinary.ts index ab1e76a526..60d7ccc65f 100644 --- a/sdk/nodejs/datafactory/datasetBinary.ts +++ b/sdk/nodejs/datafactory/datasetBinary.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Data Factory Binary Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceSftp = new azure.datafactory.LinkedServiceSftp("exampleLinkedServiceSftp", { + * dataFactoryId: exampleFactory.id, + * authenticationType: "Basic", + * host: "http://www.bing.com", + * port: 22, + * username: "foo", + * password: "bar", + * }); + * const exampleDatasetBinary = new azure.datafactory.DatasetBinary("exampleDatasetBinary", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceSftp.name, + * sftpServerLocation: { + * path: "/test/", + * filename: "**", + * }, + * }); + * ``` + * * ## Import * * Data Factory Binary Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetCosmosDBApi.ts b/sdk/nodejs/datafactory/datasetCosmosDBApi.ts index cd462e2272..e24aa7c193 100644 --- a/sdk/nodejs/datafactory/datasetCosmosDBApi.ts +++ b/sdk/nodejs/datafactory/datasetCosmosDBApi.ts @@ -9,6 +9,33 @@ import * as utilities from "../utilities"; /** * Manages an Azure Cosmos DB SQL API Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceCosmosDb = new azure.datafactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", { + * dataFactoryId: exampleFactory.id, + * accountEndpoint: exampleAccount.then(exampleAccount => exampleAccount.endpoint), + * database: "foo", + * }); + * const exampleDatasetCosmosDBApi = new azure.datafactory.DatasetCosmosDBApi("exampleDatasetCosmosDBApi", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceCosmosDb.name, + * collectionName: "bar", + * }); + * ``` + * * ## Import * * Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetDelimitedText.ts b/sdk/nodejs/datafactory/datasetDelimitedText.ts index 60854353b5..54823486a6 100644 --- a/sdk/nodejs/datafactory/datasetDelimitedText.ts +++ b/sdk/nodejs/datafactory/datasetDelimitedText.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; /** * Manages an Azure Delimited Text Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceWeb = new azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", { + * dataFactoryId: exampleFactory.id, + * authenticationType: "Anonymous", + * url: "https://www.bing.com", + * }); + * const exampleDatasetDelimitedText = new azure.datafactory.DatasetDelimitedText("exampleDatasetDelimitedText", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceWeb.name, + * httpServerLocation: { + * relativeUrl: "http://www.bing.com", + * path: "foo/bar/", + * filename: "fizz.txt", + * }, + * columnDelimiter: ",", + * rowDelimiter: "NEW", + * encoding: "UTF-8", + * quoteCharacter: "x", + * escapeCharacter: "f", + * firstRowAsHeader: true, + * nullValue: "NULL", + * }); + * ``` + * * ## Import * * Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetHttp.ts b/sdk/nodejs/datafactory/datasetHttp.ts index 7899d4ec5e..32551c6216 100644 --- a/sdk/nodejs/datafactory/datasetHttp.ts +++ b/sdk/nodejs/datafactory/datasetHttp.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages an Azure HTTP Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceWeb = new azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", { + * dataFactoryId: exampleFactory.id, + * authenticationType: "Anonymous", + * url: "https://www.bing.com", + * }); + * const exampleDatasetHttp = new azure.datafactory.DatasetHttp("exampleDatasetHttp", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceWeb.name, + * relativeUrl: "http://www.bing.com", + * requestBody: "foo=bar", + * requestMethod: "POST", + * }); + * ``` + * * ## Import * * Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetJson.ts b/sdk/nodejs/datafactory/datasetJson.ts index cda32d5dd3..dd30c416a9 100644 --- a/sdk/nodejs/datafactory/datasetJson.ts +++ b/sdk/nodejs/datafactory/datasetJson.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages an Azure JSON Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceWeb = new azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", { + * dataFactoryId: exampleFactory.id, + * authenticationType: "Anonymous", + * url: "https://www.bing.com", + * }); + * const exampleDatasetJson = new azure.datafactory.DatasetJson("exampleDatasetJson", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceWeb.name, + * httpServerLocation: { + * relativeUrl: "/fizz/buzz/", + * path: "foo/bar/", + * filename: "foo.txt", + * }, + * encoding: "UTF-8", + * }); + * ``` + * * ## Import * * Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetMysql.ts b/sdk/nodejs/datafactory/datasetMysql.ts index 5f1d28c8b4..a04c0dbf52 100644 --- a/sdk/nodejs/datafactory/datasetMysql.ts +++ b/sdk/nodejs/datafactory/datasetMysql.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a MySQL Dataset inside a Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceMysql = new azure.datafactory.LinkedServiceMysql("exampleLinkedServiceMysql", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test", + * }); + * const exampleDatasetMysql = new azure.datafactory.DatasetMysql("exampleDatasetMysql", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceMysql.name, + * }); + * ``` + * * ## Import * * Data Factory MySQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetParquet.ts b/sdk/nodejs/datafactory/datasetParquet.ts index 136ca29ee8..e16f3b19cd 100644 --- a/sdk/nodejs/datafactory/datasetParquet.ts +++ b/sdk/nodejs/datafactory/datasetParquet.ts @@ -9,6 +9,33 @@ import * as utilities from "../utilities"; /** * Manages an Azure Parquet Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceWeb = new azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", { + * dataFactoryId: exampleFactory.id, + * authenticationType: "Anonymous", + * url: "https://www.bing.com", + * }); + * const exampleDatasetParquet = new azure.datafactory.DatasetParquet("exampleDatasetParquet", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceWeb.name, + * httpServerLocation: { + * relativeUrl: "http://www.bing.com", + * path: "foo/bar/", + * filename: "fizz.txt", + * }, + * }); + * ``` + * * ## Import * * Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetPostgresql.ts b/sdk/nodejs/datafactory/datasetPostgresql.ts index eb9dcf7ecf..c7bbeb7065 100644 --- a/sdk/nodejs/datafactory/datasetPostgresql.ts +++ b/sdk/nodejs/datafactory/datasetPostgresql.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a PostgreSQL Dataset inside a Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServicePostgresql = new azure.datafactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example", + * }); + * const exampleDatasetPostgresql = new azure.datafactory.DatasetPostgresql("exampleDatasetPostgresql", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServicePostgresql.name, + * }); + * ``` + * * ## Import * * Data Factory PostgreSQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/datasetSnowflake.ts b/sdk/nodejs/datafactory/datasetSnowflake.ts index b84e2ccd8b..76639a4a88 100644 --- a/sdk/nodejs/datafactory/datasetSnowflake.ts +++ b/sdk/nodejs/datafactory/datasetSnowflake.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages a Snowflake Dataset inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceSnowflake = new azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", { + * dataFactoryId: exampleFactory.id, + * connectionString: "jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + * }); + * const exampleDatasetSnowflake = new azure.datafactory.DatasetSnowflake("exampleDatasetSnowflake", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceSnowflake.name, + * schemaName: "foo_schema", + * tableName: "foo_table", + * }); + * ``` + * * ## Import * * Data Factory Snowflake Datasets can be imported using the `resource id`, diff --git a/sdk/nodejs/datafactory/datasetSqlServerTable.ts b/sdk/nodejs/datafactory/datasetSqlServerTable.ts index f627f5792a..f76038bc78 100644 --- a/sdk/nodejs/datafactory/datasetSqlServerTable.ts +++ b/sdk/nodejs/datafactory/datasetSqlServerTable.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a SQL Server Table Dataset inside a Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceSqlServer = new azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test", + * }); + * const exampleDatasetSqlServerTable = new azure.datafactory.DatasetSqlServerTable("exampleDatasetSqlServerTable", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedServiceSqlServer.name, + * }); + * ``` + * * ## Import * * Data Factory SQL Server Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/factory.ts b/sdk/nodejs/datafactory/factory.ts index 6d8071a31e..54b8186e97 100644 --- a/sdk/nodejs/datafactory/factory.ts +++ b/sdk/nodejs/datafactory/factory.ts @@ -9,6 +9,19 @@ import * as utilities from "../utilities"; /** * Manages an Azure Data Factory (Version 2). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * Data Factory can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/flowletDataFlow.ts b/sdk/nodejs/datafactory/flowletDataFlow.ts index 729a348a25..fb24f79f87 100644 --- a/sdk/nodejs/datafactory/flowletDataFlow.ts +++ b/sdk/nodejs/datafactory/flowletDataFlow.ts @@ -9,6 +9,140 @@ import * as utilities from "../utilities"; /** * Manages a Flowlet Data Flow inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedCustomService = new azure.datafactory.LinkedCustomService("exampleLinkedCustomService", { + * dataFactoryId: exampleFactory.id, + * type: "AzureBlobStorage", + * typePropertiesJson: pulumi.interpolate`{ + * "connectionString": "${exampleAccount.primaryConnectionString}" + * } + * `, + * }); + * const example1DatasetJson = new azure.datafactory.DatasetJson("example1DatasetJson", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedCustomService.name, + * azureBlobStorageLocation: { + * container: "container", + * path: "foo/bar/", + * filename: "foo.txt", + * }, + * encoding: "UTF-8", + * }); + * const example2DatasetJson = new azure.datafactory.DatasetJson("example2DatasetJson", { + * dataFactoryId: exampleFactory.id, + * linkedServiceName: exampleLinkedCustomService.name, + * azureBlobStorageLocation: { + * container: "container", + * path: "foo/bar/", + * filename: "bar.txt", + * }, + * encoding: "UTF-8", + * }); + * const example1FlowletDataFlow = new azure.datafactory.FlowletDataFlow("example1FlowletDataFlow", { + * dataFactoryId: exampleFactory.id, + * sources: [{ + * name: "source1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * sinks: [{ + * name: "sink1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * script: `source( + * allowSchemaDrift: true, + * validateSchema: false, + * limit: 100, + * ignoreNoFilesFound: false, + * documentForm: 'documentPerLine') ~> source1 + * source1 sink( + * allowSchemaDrift: true, + * validateSchema: false, + * skipDuplicateMapInputs: true, + * skipDuplicateMapOutputs: true) ~> sink1 + * `, + * }); + * const example2FlowletDataFlow = new azure.datafactory.FlowletDataFlow("example2FlowletDataFlow", { + * dataFactoryId: exampleFactory.id, + * sources: [{ + * name: "source1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * sinks: [{ + * name: "sink1", + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * script: `source( + * allowSchemaDrift: true, + * validateSchema: false, + * limit: 100, + * ignoreNoFilesFound: false, + * documentForm: 'documentPerLine') ~> source1 + * source1 sink( + * allowSchemaDrift: true, + * validateSchema: false, + * skipDuplicateMapInputs: true, + * skipDuplicateMapOutputs: true) ~> sink1 + * `, + * }); + * const exampleFlowletDataFlow = new azure.datafactory.FlowletDataFlow("exampleFlowletDataFlow", { + * dataFactoryId: exampleFactory.id, + * sources: [{ + * name: "source1", + * flowlet: { + * name: example1FlowletDataFlow.name, + * }, + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * sinks: [{ + * name: "sink1", + * flowlet: { + * name: example2FlowletDataFlow.name, + * }, + * linkedService: { + * name: exampleLinkedCustomService.name, + * }, + * }], + * script: `source( + * allowSchemaDrift: true, + * validateSchema: false, + * limit: 100, + * ignoreNoFilesFound: false, + * documentForm: 'documentPerLine') ~> source1 + * source1 sink( + * allowSchemaDrift: true, + * validateSchema: false, + * skipDuplicateMapInputs: true, + * skipDuplicateMapOutputs: true) ~> sink1 + * `, + * }); + * ``` + * * ## Import * * Data Factory Flowlet Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/getFactory.ts b/sdk/nodejs/datafactory/getFactory.ts index 6605000d2b..dd000f3ebd 100644 --- a/sdk/nodejs/datafactory/getFactory.ts +++ b/sdk/nodejs/datafactory/getFactory.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure Data Factory (Version 2). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datafactory.getFactory({ + * name: "existing-adf", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFactory(args: GetFactoryArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetFactoryResult { } /** * Use this data source to access information about an existing Azure Data Factory (Version 2). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datafactory.getFactory({ + * name: "existing-adf", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFactoryOutput(args: GetFactoryOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFactory(a, opts)) diff --git a/sdk/nodejs/datafactory/integrationRuntimeManaged.ts b/sdk/nodejs/datafactory/integrationRuntimeManaged.ts index 3209092c25..c5fc7989eb 100644 --- a/sdk/nodejs/datafactory/integrationRuntimeManaged.ts +++ b/sdk/nodejs/datafactory/integrationRuntimeManaged.ts @@ -11,6 +11,24 @@ import * as utilities from "../utilities"; * * > **NOTE:** The `azure.datafactory.IntegrationRuntimeManaged` resource has been superseded by the `azure.datafactory.IntegrationRuntimeSsis` resource. We recommend using the `azure.datafactory.IntegrationRuntimeSsis` resource for new deployments. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleIntegrationRuntimeManaged = new azure.datafactory.IntegrationRuntimeManaged("exampleIntegrationRuntimeManaged", { + * dataFactoryId: exampleFactory.id, + * location: exampleResourceGroup.location, + * nodeSize: "Standard_D8_v3", + * }); + * ``` + * * ## Import * * Data Factory Integration Managed Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/integrationRuntimeRule.ts b/sdk/nodejs/datafactory/integrationRuntimeRule.ts index 0089aecdb1..85136bc3bd 100644 --- a/sdk/nodejs/datafactory/integrationRuntimeRule.ts +++ b/sdk/nodejs/datafactory/integrationRuntimeRule.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Data Factory Azure Integration Runtime. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleIntegrationRuntimeRule = new azure.datafactory.IntegrationRuntimeRule("exampleIntegrationRuntimeRule", { + * dataFactoryId: exampleFactory.id, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Data Factory Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/integrationRuntimeSelfHosted.ts b/sdk/nodejs/datafactory/integrationRuntimeSelfHosted.ts index d29460109f..7196337155 100644 --- a/sdk/nodejs/datafactory/integrationRuntimeSelfHosted.ts +++ b/sdk/nodejs/datafactory/integrationRuntimeSelfHosted.ts @@ -9,6 +9,20 @@ import * as utilities from "../utilities"; /** * Manages a Data Factory Self-hosted Integration Runtime. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleIntegrationRuntimeSelfHosted = new azure.datafactory.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", {dataFactoryId: exampleFactory.id}); + * ``` + * * ## Import * * Data Factories can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/integrationRuntimeSsis.ts b/sdk/nodejs/datafactory/integrationRuntimeSsis.ts index ab8fb20f6b..a791632439 100644 --- a/sdk/nodejs/datafactory/integrationRuntimeSsis.ts +++ b/sdk/nodejs/datafactory/integrationRuntimeSsis.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages a Data Factory Azure-SSIS Integration Runtime. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleIntegrationRuntimeSsis = new azure.datafactory.IntegrationRuntimeSsis("exampleIntegrationRuntimeSsis", { + * dataFactoryId: exampleFactory.id, + * location: exampleResourceGroup.location, + * nodeSize: "Standard_D8_v3", + * }); + * ``` + * * ## Import * * Data Factory Azure-SSIS Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedCustomService.ts b/sdk/nodejs/datafactory/linkedCustomService.ts index a36962a873..ecac4c8d6a 100644 --- a/sdk/nodejs/datafactory/linkedCustomService.ts +++ b/sdk/nodejs/datafactory/linkedCustomService.ts @@ -9,6 +9,47 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between a resource and Azure Data Factory. This is a generic resource that supports all different Linked Service Types. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleLinkedCustomService = new azure.datafactory.LinkedCustomService("exampleLinkedCustomService", { + * dataFactoryId: exampleFactory.id, + * type: "AzureBlobStorage", + * description: "test description", + * typePropertiesJson: pulumi.interpolate`{ + * "connectionString":"${exampleAccount.primaryConnectionString}" + * } + * `, + * parameters: { + * foo: "bar", + * Env: "Test", + * }, + * annotations: [ + * "test1", + * "test2", + * "test3", + * ], + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceAzureBlobStorage.ts b/sdk/nodejs/datafactory/linkedServiceAzureBlobStorage.ts index 2767799f46..877bfd9553 100644 --- a/sdk/nodejs/datafactory/linkedServiceAzureBlobStorage.ts +++ b/sdk/nodejs/datafactory/linkedServiceAzureBlobStorage.ts @@ -9,6 +9,68 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between an Azure Blob Storage Account and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = azure.storage.getAccountOutput({ + * name: "storageaccountname", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceAzureBlobStorage = new azure.datafactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", { + * dataFactoryId: exampleFactory.id, + * connectionString: exampleAccount.apply(exampleAccount => exampleAccount.primaryConnectionString), + * }); + * ``` + * ### With SAS URI And SAS Token + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const current = azure.core.getClientConfig({}); + * const testFactory = new azure.datafactory.Factory("testFactory", { + * location: example.location, + * resourceGroupName: example.name, + * }); + * const testKeyVault = new azure.keyvault.KeyVault("testKeyVault", { + * location: example.location, + * resourceGroupName: example.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * }); + * const testLinkedServiceKeyVault = new azure.datafactory.LinkedServiceKeyVault("testLinkedServiceKeyVault", { + * dataFactoryId: testFactory.id, + * keyVaultId: testKeyVault.id, + * }); + * const testLinkedServiceAzureBlobStorage = new azure.datafactory.LinkedServiceAzureBlobStorage("testLinkedServiceAzureBlobStorage", { + * dataFactoryId: testFactory.id, + * sasUri: "https://example.blob.core.windows.net", + * keyVaultSasToken: { + * linkedServiceName: testLinkedServiceKeyVault.name, + * secretName: "secret", + * }, + * }); + * const testDatafactory_linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage = new azure.datafactory.LinkedServiceAzureBlobStorage("testDatafactory/linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage", { + * dataFactoryId: testFactory.id, + * serviceEndpoint: "https://example.blob.core.windows.net", + * servicePrincipalId: "00000000-0000-0000-0000-000000000000", + * tenantId: "00000000-0000-0000-0000-000000000000", + * servicePrincipalLinkedKeyVaultKey: { + * linkedServiceName: testLinkedServiceKeyVault.name, + * secretName: "secret", + * }, + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceAzureDatabricks.ts b/sdk/nodejs/datafactory/linkedServiceAzureDatabricks.ts index 442015ef2c..327b37ac01 100644 --- a/sdk/nodejs/datafactory/linkedServiceAzureDatabricks.ts +++ b/sdk/nodejs/datafactory/linkedServiceAzureDatabricks.ts @@ -10,6 +10,84 @@ import * as utilities from "../utilities"; * Manages a Linked Service (connection) between Azure Databricks and Azure Data Factory. * * ## Example Usage + * ### With Managed Identity & New Cluster + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * //Create a Linked Service using managed identity and new cluster config + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * //Create a databricks instance + * const exampleWorkspace = new azure.databricks.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "standard", + * }); + * const msiLinked = new azure.datafactory.LinkedServiceAzureDatabricks("msiLinked", { + * dataFactoryId: exampleFactory.id, + * description: "ADB Linked Service via MSI", + * adbDomain: pulumi.interpolate`https://${exampleWorkspace.workspaceUrl}`, + * msiWorkSpaceResourceId: exampleWorkspace.id, + * newClusterConfig: { + * nodeType: "Standard_NC12", + * clusterVersion: "5.5.x-gpu-scala2.11", + * minNumberOfWorkers: 1, + * maxNumberOfWorkers: 5, + * driverNodeType: "Standard_NC12", + * logDestination: "dbfs:/logs", + * customTags: { + * custom_tag1: "sct_value_1", + * custom_tag2: "sct_value_2", + * }, + * sparkConfig: { + * config1: "value1", + * config2: "value2", + * }, + * sparkEnvironmentVariables: { + * envVar1: "value1", + * envVar2: "value2", + * }, + * initScripts: [ + * "init.sh", + * "init2.sh", + * ], + * }, + * }); + * ``` + * ### With Access Token & Existing Cluster + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * //Link to an existing cluster via access token + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * //Create a databricks instance + * const exampleWorkspace = new azure.databricks.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "standard", + * }); + * const atLinked = new azure.datafactory.LinkedServiceAzureDatabricks("atLinked", { + * dataFactoryId: exampleFactory.id, + * description: "ADB Linked Service via Access Token", + * existingClusterId: "0308-201146-sly615", + * accessToken: "SomeDatabricksAccessToken", + * adbDomain: pulumi.interpolate`https://${exampleWorkspace.workspaceUrl}`, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/datafactory/linkedServiceAzureFileStorage.ts b/sdk/nodejs/datafactory/linkedServiceAzureFileStorage.ts index 1ec9c8d763..94150fdfb0 100644 --- a/sdk/nodejs/datafactory/linkedServiceAzureFileStorage.ts +++ b/sdk/nodejs/datafactory/linkedServiceAzureFileStorage.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = azure.storage.getAccountOutput({ + * name: "storageaccountname", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceAzureFileStorage = new azure.datafactory.LinkedServiceAzureFileStorage("exampleLinkedServiceAzureFileStorage", { + * dataFactoryId: exampleFactory.id, + * connectionString: exampleAccount.apply(exampleAccount => exampleAccount.primaryConnectionString), + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceAzureFunction.ts b/sdk/nodejs/datafactory/linkedServiceAzureFunction.ts index 1a90591c84..49999c6ddd 100644 --- a/sdk/nodejs/datafactory/linkedServiceAzureFunction.ts +++ b/sdk/nodejs/datafactory/linkedServiceAzureFunction.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between an Azure Function and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFunctionApp = azure.appservice.getFunctionAppOutput({ + * name: "test-azure-functions", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceAzureFunction = new azure.datafactory.LinkedServiceAzureFunction("exampleLinkedServiceAzureFunction", { + * dataFactoryId: exampleFactory.id, + * url: exampleFunctionApp.apply(exampleFunctionApp => `https://${exampleFunctionApp.defaultHostname}`), + * key: "foo", + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceAzureSqlDatabase.ts b/sdk/nodejs/datafactory/linkedServiceAzureSqlDatabase.ts index 1b72879387..163c19ac39 100644 --- a/sdk/nodejs/datafactory/linkedServiceAzureSqlDatabase.ts +++ b/sdk/nodejs/datafactory/linkedServiceAzureSqlDatabase.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between Azure SQL Database and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceAzureSqlDatabase = new azure.datafactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", { + * dataFactoryId: exampleFactory.id, + * connectionString: "data source=serverhostname;initial catalog=master;user id=testUser;Password=test;integrated security=False;encrypt=True;connection timeout=30", + * }); + * ``` + * * ## Import * * Data Factory Azure SQL Database Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceAzureTableStorage.ts b/sdk/nodejs/datafactory/linkedServiceAzureTableStorage.ts index 255fbf0315..50e8c223eb 100644 --- a/sdk/nodejs/datafactory/linkedServiceAzureTableStorage.ts +++ b/sdk/nodejs/datafactory/linkedServiceAzureTableStorage.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between an Azure Table Storage and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = azure.storage.getAccountOutput({ + * name: "storageaccountname", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceAzureTableStorage = new azure.datafactory.LinkedServiceAzureTableStorage("exampleLinkedServiceAzureTableStorage", { + * dataFactoryId: exampleFactory.id, + * connectionString: exampleAccount.apply(exampleAccount => exampleAccount.primaryConnectionString), + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceCosmosDb.ts b/sdk/nodejs/datafactory/linkedServiceCosmosDb.ts index 8df72d5efb..e28b1be35b 100644 --- a/sdk/nodejs/datafactory/linkedServiceCosmosDb.ts +++ b/sdk/nodejs/datafactory/linkedServiceCosmosDb.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between a CosmosDB and Azure Data Factory using SQL API. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = azure.cosmosdb.getAccount({ + * name: "tfex-cosmosdb-account", + * resourceGroupName: "tfex-cosmosdb-account-rg", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceCosmosDb = new azure.datafactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", { + * dataFactoryId: exampleFactory.id, + * accountEndpoint: exampleAccount.then(exampleAccount => exampleAccount.endpoint), + * accountKey: exampleAccount.then(exampleAccount => exampleAccount.primaryKey), + * database: "foo", + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceCosmosDbMongoApi.ts b/sdk/nodejs/datafactory/linkedServiceCosmosDbMongoApi.ts index 30e9919920..f3c65b9595 100644 --- a/sdk/nodejs/datafactory/linkedServiceCosmosDbMongoApi.ts +++ b/sdk/nodejs/datafactory/linkedServiceCosmosDbMongoApi.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; * * > **Note:** All arguments including the client secret will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceCosmosDbMongoApi = new azure.datafactory.LinkedServiceCosmosDbMongoApi("exampleLinkedServiceCosmosDbMongoApi", { + * dataFactoryId: exampleFactory.id, + * connectionString: "mongodb://testinstance:testkey@testinstance.documents.azure.com:10255/?ssl=true", + * database: "foo", + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceDataLakeStorageGen2.ts b/sdk/nodejs/datafactory/linkedServiceDataLakeStorageGen2.ts index 0d9f59b4bc..f51ae1f2da 100644 --- a/sdk/nodejs/datafactory/linkedServiceDataLakeStorageGen2.ts +++ b/sdk/nodejs/datafactory/linkedServiceDataLakeStorageGen2.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between Data Lake Storage Gen2 and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const current = azure.core.getClientConfig({}); + * const exampleLinkedServiceDataLakeStorageGen2 = new azure.datafactory.LinkedServiceDataLakeStorageGen2("exampleLinkedServiceDataLakeStorageGen2", { + * dataFactoryId: exampleFactory.id, + * servicePrincipalId: current.then(current => current.clientId), + * servicePrincipalKey: "exampleKey", + * tenant: "11111111-1111-1111-1111-111111111111", + * url: "https://datalakestoragegen2", + * }); + * ``` + * * ## Import * * Data Factory Data Lake Storage Gen2 Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceKeyVault.ts b/sdk/nodejs/datafactory/linkedServiceKeyVault.ts index c2f7c32c40..a73c0b9b68 100644 --- a/sdk/nodejs/datafactory/linkedServiceKeyVault.ts +++ b/sdk/nodejs/datafactory/linkedServiceKeyVault.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between Key Vault and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceKeyVault = new azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", { + * dataFactoryId: exampleFactory.id, + * keyVaultId: exampleKeyVault.id, + * }); + * ``` + * * ## Import * * Data Factory Key Vault Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceKusto.ts b/sdk/nodejs/datafactory/linkedServiceKusto.ts index 083d31cfa2..1534d7c91a 100644 --- a/sdk/nodejs/datafactory/linkedServiceKusto.ts +++ b/sdk/nodejs/datafactory/linkedServiceKusto.ts @@ -7,6 +7,50 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between a Kusto Cluster and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * }); + * const exampleLinkedServiceKusto = new azure.datafactory.LinkedServiceKusto("exampleLinkedServiceKusto", { + * dataFactoryId: exampleFactory.id, + * kustoEndpoint: exampleCluster.uri, + * kustoDatabaseName: exampleDatabase.name, + * useManagedIdentity: true, + * }); + * const exampleDatabasePrincipalAssignment = new azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", { + * resourceGroupName: exampleResourceGroup.name, + * clusterName: exampleCluster.name, + * databaseName: exampleDatabase.name, + * tenantId: exampleFactory.identity.apply(identity => identity?.tenantId), + * principalId: exampleFactory.identity.apply(identity => identity?.principalId), + * principalType: "App", + * role: "Viewer", + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceMysql.ts b/sdk/nodejs/datafactory/linkedServiceMysql.ts index 502cdc57e1..a6822c502c 100644 --- a/sdk/nodejs/datafactory/linkedServiceMysql.ts +++ b/sdk/nodejs/datafactory/linkedServiceMysql.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between MySQL and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceMysql = new azure.datafactory.LinkedServiceMysql("exampleLinkedServiceMysql", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test", + * }); + * ``` + * * ## Import * * Data Factory MySQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceOdata.ts b/sdk/nodejs/datafactory/linkedServiceOdata.ts index 5f62d93e9d..0c69a70fb4 100644 --- a/sdk/nodejs/datafactory/linkedServiceOdata.ts +++ b/sdk/nodejs/datafactory/linkedServiceOdata.ts @@ -11,6 +11,31 @@ import * as utilities from "../utilities"; * * > **Note:** All arguments including the connectionString will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const anonymous = new azure.datafactory.LinkedServiceOdata("anonymous", { + * dataFactoryId: exampleFactory.id, + * url: "https://services.odata.org/v4/TripPinServiceRW/People", + * }); + * const basicAuth = new azure.datafactory.LinkedServiceOdata("basicAuth", { + * dataFactoryId: exampleFactory.id, + * url: "https://services.odata.org/v4/TripPinServiceRW/People", + * basicAuthentication: { + * username: "emma", + * password: "Ch4ngeM3!", + * }, + * }); + * ``` + * * ## Import * * Data Factory OData Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceOdbc.ts b/sdk/nodejs/datafactory/linkedServiceOdbc.ts index 9196fd3600..cbfef3c20e 100644 --- a/sdk/nodejs/datafactory/linkedServiceOdbc.ts +++ b/sdk/nodejs/datafactory/linkedServiceOdbc.ts @@ -11,6 +11,31 @@ import * as utilities from "../utilities"; * * > **Note:** All arguments including the connectionString will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const anonymous = new azure.datafactory.LinkedServiceOdbc("anonymous", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;", + * }); + * const basicAuth = new azure.datafactory.LinkedServiceOdbc("basicAuth", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;", + * basicAuthentication: { + * username: "onrylmz", + * password: "Ch4ngeM3!", + * }, + * }); + * ``` + * * ## Import * * Data Factory ODBC Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServicePostgresql.ts b/sdk/nodejs/datafactory/linkedServicePostgresql.ts index 44b61624ef..605d0ed7ed 100644 --- a/sdk/nodejs/datafactory/linkedServicePostgresql.ts +++ b/sdk/nodejs/datafactory/linkedServicePostgresql.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between PostgreSQL and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServicePostgresql = new azure.datafactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example", + * }); + * ``` + * * ## Import * * Data Factory PostgreSQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceSftp.ts b/sdk/nodejs/datafactory/linkedServiceSftp.ts index 1de1361fa5..122b18dd43 100644 --- a/sdk/nodejs/datafactory/linkedServiceSftp.ts +++ b/sdk/nodejs/datafactory/linkedServiceSftp.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceSftp = new azure.datafactory.LinkedServiceSftp("exampleLinkedServiceSftp", { + * dataFactoryId: exampleFactory.id, + * authenticationType: "Basic", + * host: "http://www.bing.com", + * port: 22, + * username: "foo", + * password: "bar", + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceSnowflake.ts b/sdk/nodejs/datafactory/linkedServiceSnowflake.ts index c308bab864..5ab4326414 100644 --- a/sdk/nodejs/datafactory/linkedServiceSnowflake.ts +++ b/sdk/nodejs/datafactory/linkedServiceSnowflake.ts @@ -9,6 +9,54 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between Snowflake and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceSnowflake = new azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", { + * dataFactoryId: exampleFactory.id, + * connectionString: "jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + * }); + * ``` + * ### With Password In Key Vault + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceKeyVault = new azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", { + * dataFactoryId: exampleFactory.id, + * keyVaultId: exampleKeyVault.id, + * }); + * const exampleLinkedServiceSnowflake = new azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", { + * dataFactoryId: exampleFactory.id, + * connectionString: "jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + * keyVaultPassword: { + * linkedServiceName: exampleLinkedServiceKeyVault.name, + * secretName: "secret", + * }, + * }); + * ``` + * * ## Import * * Data Factory Snowflake Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceSqlServer.ts b/sdk/nodejs/datafactory/linkedServiceSqlServer.ts index 5282cd2177..8460d97503 100644 --- a/sdk/nodejs/datafactory/linkedServiceSqlServer.ts +++ b/sdk/nodejs/datafactory/linkedServiceSqlServer.ts @@ -9,6 +9,54 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between a SQL Server and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceSqlServer = new azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test", + * }); + * ``` + * ### With Password In Key Vault + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceKeyVault = new azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", { + * dataFactoryId: exampleFactory.id, + * keyVaultId: exampleKeyVault.id, + * }); + * const exampleLinkedServiceSqlServer = new azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + * keyVaultPassword: { + * linkedServiceName: exampleLinkedServiceKeyVault.name, + * secretName: "secret", + * }, + * }); + * ``` + * * ## Import * * Data Factory SQL Server Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceSynapse.ts b/sdk/nodejs/datafactory/linkedServiceSynapse.ts index 3e9687c3e7..08677bf17f 100644 --- a/sdk/nodejs/datafactory/linkedServiceSynapse.ts +++ b/sdk/nodejs/datafactory/linkedServiceSynapse.ts @@ -9,6 +9,54 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between Synapse and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceSynapse = new azure.datafactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test", + * }); + * ``` + * ### With Password In Key Vault + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * }); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceKeyVault = new azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", { + * dataFactoryId: exampleFactory.id, + * keyVaultId: exampleKeyVault.id, + * }); + * const exampleLinkedServiceSynapse = new azure.datafactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", { + * dataFactoryId: exampleFactory.id, + * connectionString: "Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + * keyVaultPassword: { + * linkedServiceName: exampleLinkedServiceKeyVault.name, + * secretName: "secret", + * }, + * }); + * ``` + * * ## Import * * Data Factory Synapse Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/linkedServiceWeb.ts b/sdk/nodejs/datafactory/linkedServiceWeb.ts index 8a9d583b84..8071e7b5c6 100644 --- a/sdk/nodejs/datafactory/linkedServiceWeb.ts +++ b/sdk/nodejs/datafactory/linkedServiceWeb.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages a Linked Service (connection) between a Web Server and Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleLinkedServiceWeb = new azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", { + * dataFactoryId: exampleFactory.id, + * authenticationType: "Anonymous", + * url: "http://www.bing.com", + * }); + * ``` + * * ## Import * * Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/managedPrivateEndpoint.ts b/sdk/nodejs/datafactory/managedPrivateEndpoint.ts index ae8d4d0527..1ff4805922 100644 --- a/sdk/nodejs/datafactory/managedPrivateEndpoint.ts +++ b/sdk/nodejs/datafactory/managedPrivateEndpoint.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages a Data Factory Managed Private Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * managedVirtualNetworkEnabled: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleManagedPrivateEndpoint = new azure.datafactory.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", { + * dataFactoryId: exampleFactory.id, + * targetResourceId: exampleAccount.id, + * subresourceName: "blob", + * }); + * ``` + * * ## Import * * Data Factory Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/pipeline.ts b/sdk/nodejs/datafactory/pipeline.ts index 63c6fb9b26..d493ee8269 100644 --- a/sdk/nodejs/datafactory/pipeline.ts +++ b/sdk/nodejs/datafactory/pipeline.ts @@ -7,6 +7,46 @@ import * as utilities from "../utilities"; /** * Manages a Pipeline inside a Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePipeline = new azure.datafactory.Pipeline("examplePipeline", {dataFactoryId: exampleFactory.id}); + * ``` + * ### With Activities + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = new azure.datafactory.Pipeline("test", { + * dataFactoryId: azurerm_data_factory.test.id, + * variables: { + * bob: "item1", + * }, + * activitiesJson: `[ + * { + * "name": "Append variable1", + * "type": "AppendVariable", + * "dependsOn": [], + * "userProperties": [], + * "typeProperties": { + * "variableName": "bob", + * "value": "something" + * } + * } + * ] + * `, + * }); + * ``` + * * ## Import * * Data Factory Pipeline's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/triggerBlobEvent.ts b/sdk/nodejs/datafactory/triggerBlobEvent.ts index 1e63dcfd39..7aee59b278 100644 --- a/sdk/nodejs/datafactory/triggerBlobEvent.ts +++ b/sdk/nodejs/datafactory/triggerBlobEvent.ts @@ -9,6 +9,53 @@ import * as utilities from "../utilities"; /** * Manages a Blob Event Trigger inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePipeline = new azure.datafactory.Pipeline("examplePipeline", {dataFactoryId: exampleFactory.id}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleTriggerBlobEvent = new azure.datafactory.TriggerBlobEvent("exampleTriggerBlobEvent", { + * dataFactoryId: exampleFactory.id, + * storageAccountId: exampleAccount.id, + * events: [ + * "Microsoft.Storage.BlobCreated", + * "Microsoft.Storage.BlobDeleted", + * ], + * blobPathEndsWith: ".txt", + * ignoreEmptyBlobs: true, + * activated: true, + * annotations: [ + * "test1", + * "test2", + * "test3", + * ], + * description: "example description", + * pipelines: [{ + * name: examplePipeline.name, + * parameters: { + * Env: "Prod", + * }, + * }], + * additionalProperties: { + * foo: "foo1", + * bar: "bar2", + * }, + * }); + * ``` + * * ## Import * * Data Factory Blob Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/triggerCustomEvent.ts b/sdk/nodejs/datafactory/triggerCustomEvent.ts index 2d7fd99726..84f4031aea 100644 --- a/sdk/nodejs/datafactory/triggerCustomEvent.ts +++ b/sdk/nodejs/datafactory/triggerCustomEvent.ts @@ -9,6 +9,50 @@ import * as utilities from "../utilities"; /** * Manages a Custom Event Trigger inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePipeline = new azure.datafactory.Pipeline("examplePipeline", {dataFactoryId: exampleFactory.id}); + * const exampleTopic = new azure.eventgrid.Topic("exampleTopic", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleTriggerCustomEvent = new azure.datafactory.TriggerCustomEvent("exampleTriggerCustomEvent", { + * dataFactoryId: exampleFactory.id, + * eventgridTopicId: exampleTopic.id, + * events: [ + * "event1", + * "event2", + * ], + * subjectBeginsWith: "abc", + * subjectEndsWith: "xyz", + * annotations: [ + * "example1", + * "example2", + * "example3", + * ], + * description: "example description", + * pipelines: [{ + * name: examplePipeline.name, + * parameters: { + * Env: "Prod", + * }, + * }], + * additionalProperties: { + * foo: "foo1", + * bar: "bar2", + * }, + * }); + * ``` + * * ## Import * * Data Factory Custom Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/triggerSchedule.ts b/sdk/nodejs/datafactory/triggerSchedule.ts index f6e659bc05..813bb9f1c1 100644 --- a/sdk/nodejs/datafactory/triggerSchedule.ts +++ b/sdk/nodejs/datafactory/triggerSchedule.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; /** * Manages a Trigger Schedule inside a Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePipeline = new azure.datafactory.Pipeline("examplePipeline", {dataFactoryId: exampleFactory.id}); + * const exampleTriggerSchedule = new azure.datafactory.TriggerSchedule("exampleTriggerSchedule", { + * dataFactoryId: exampleFactory.id, + * pipelineName: examplePipeline.name, + * interval: 5, + * frequency: "Day", + * }); + * ``` + * * ## Import * * Data Factory Schedule Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datafactory/triggerTumblingWindow.ts b/sdk/nodejs/datafactory/triggerTumblingWindow.ts index 8f4b11d394..76908c0c74 100644 --- a/sdk/nodejs/datafactory/triggerTumblingWindow.ts +++ b/sdk/nodejs/datafactory/triggerTumblingWindow.ts @@ -9,6 +9,52 @@ import * as utilities from "../utilities"; /** * Manages a Tumbling Window Trigger inside an Azure Data Factory. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFactory = new azure.datafactory.Factory("exampleFactory", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePipeline = new azure.datafactory.Pipeline("examplePipeline", {dataFactoryId: exampleFactory.id}); + * const exampleTriggerTumblingWindow = new azure.datafactory.TriggerTumblingWindow("exampleTriggerTumblingWindow", { + * dataFactoryId: exampleFactory.id, + * startTime: "2022-09-21T00:00:00Z", + * endTime: "2022-09-21T08:00:00Z", + * frequency: "Minute", + * interval: 15, + * delay: "16:00:00", + * annotations: [ + * "example1", + * "example2", + * "example3", + * ], + * description: "example description", + * retry: { + * count: 1, + * interval: 30, + * }, + * pipeline: { + * name: examplePipeline.name, + * parameters: { + * Env: "Prod", + * }, + * }, + * triggerDependencies: [{ + * size: "24:00:00", + * offset: "-24:00:00", + * }], + * additionalProperties: { + * foo: "value1", + * bar: "value2", + * }, + * }); + * ``` + * * ## Import * * Data Factory Tumbling Window Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/backupInstanceBlogStorage.ts b/sdk/nodejs/dataprotection/backupInstanceBlogStorage.ts index 5070f4baa9..9c4814f7b5 100644 --- a/sdk/nodejs/dataprotection/backupInstanceBlogStorage.ts +++ b/sdk/nodejs/dataprotection/backupInstanceBlogStorage.ts @@ -7,6 +7,47 @@ import * as utilities from "../utilities"; /** * Manages a Backup Instance Blob Storage. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleBackupVault = new azure.dataprotection.BackupVault("exampleBackupVault", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datastoreType: "VaultStore", + * redundancy: "LocallyRedundant", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleAccount.id, + * roleDefinitionName: "Storage Account Backup Contributor", + * principalId: exampleBackupVault.identity.apply(identity => identity?.principalId), + * }); + * const exampleBackupPolicyBlobStorage = new azure.dataprotection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", { + * vaultId: exampleBackupVault.id, + * retentionDuration: "P30D", + * }); + * const exampleBackupInstanceBlogStorage = new azure.dataprotection.BackupInstanceBlogStorage("exampleBackupInstanceBlogStorage", { + * vaultId: exampleBackupVault.id, + * location: exampleResourceGroup.location, + * storageAccountId: exampleAccount.id, + * backupPolicyId: exampleBackupPolicyBlobStorage.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Backup Instance Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/backupInstanceDisk.ts b/sdk/nodejs/dataprotection/backupInstanceDisk.ts index cbd03b70b4..c1400955de 100644 --- a/sdk/nodejs/dataprotection/backupInstanceDisk.ts +++ b/sdk/nodejs/dataprotection/backupInstanceDisk.ts @@ -7,6 +7,53 @@ import * as utilities from "../utilities"; /** * Manages a Backup Instance to back up Disk. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleManagedDisk = new azure.compute.ManagedDisk("exampleManagedDisk", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccountType: "Standard_LRS", + * createOption: "Empty", + * diskSizeGb: 1, + * }); + * const exampleBackupVault = new azure.dataprotection.BackupVault("exampleBackupVault", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datastoreType: "VaultStore", + * redundancy: "LocallyRedundant", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const example1 = new azure.authorization.Assignment("example1", { + * scope: exampleResourceGroup.id, + * roleDefinitionName: "Disk Snapshot Contributor", + * principalId: exampleBackupVault.identity.apply(identity => identity?.principalId), + * }); + * const example2 = new azure.authorization.Assignment("example2", { + * scope: exampleManagedDisk.id, + * roleDefinitionName: "Disk Backup Reader", + * principalId: exampleBackupVault.identity.apply(identity => identity?.principalId), + * }); + * const exampleBackupPolicyDisk = new azure.dataprotection.BackupPolicyDisk("exampleBackupPolicyDisk", { + * vaultId: exampleBackupVault.id, + * backupRepeatingTimeIntervals: ["R/2021-05-19T06:33:16+00:00/PT4H"], + * defaultRetentionDuration: "P7D", + * }); + * const exampleBackupInstanceDisk = new azure.dataprotection.BackupInstanceDisk("exampleBackupInstanceDisk", { + * location: exampleBackupVault.location, + * vaultId: exampleBackupVault.id, + * diskId: exampleManagedDisk.id, + * snapshotResourceGroupName: exampleResourceGroup.name, + * backupPolicyId: exampleBackupPolicyDisk.id, + * }); + * ``` + * * ## Import * * Backup Instance Disks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/backupInstancePostgresql.ts b/sdk/nodejs/dataprotection/backupInstancePostgresql.ts index 775605cfb9..4679e538f9 100644 --- a/sdk/nodejs/dataprotection/backupInstancePostgresql.ts +++ b/sdk/nodejs/dataprotection/backupInstancePostgresql.ts @@ -9,6 +9,111 @@ import * as utilities from "../utilities"; * * > **Note:** Before using this resource, there are some prerequisite permissions for configure backup and restore. See more details from . * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "B_Gen5_2", + * storageMb: 5120, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: false, + * autoGrowEnabled: true, + * administratorLogin: "psqladmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * version: "9.5", + * sslEnforcementEnabled: true, + * }); + * const exampleFirewallRule = new azure.postgresql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "0.0.0.0", + * endIpAddress: "0.0.0.0", + * }); + * const exampleDatabase = new azure.postgresql.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * charset: "UTF8", + * collation: "English_United States.1252", + * }); + * const exampleBackupVault = new azure.dataprotection.BackupVault("exampleBackupVault", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datastoreType: "VaultStore", + * redundancy: "LocallyRedundant", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * softDeleteRetentionDays: 7, + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * ], + * secretPermissions: [ + * "Set", + * "Get", + * "Delete", + * "Purge", + * "Recover", + * ], + * }, + * { + * tenantId: exampleBackupVault.identity.apply(identity => identity?.tenantId), + * objectId: exampleBackupVault.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Create", + * "Get", + * ], + * secretPermissions: [ + * "Set", + * "Get", + * "Delete", + * "Purge", + * "Recover", + * ], + * }, + * ], + * }); + * const exampleSecret = new azure.keyvault.Secret("exampleSecret", { + * value: pulumi.interpolate`Server=${exampleServer.name}.postgres.database.azure.com;Database=${exampleDatabase.name};Port=5432;User Id=psqladmin@${exampleServer.name};Password=H@Sh1CoR3!;Ssl Mode=Require;`, + * keyVaultId: exampleKeyVault.id, + * }); + * const exampleBackupPolicyPostgresql = new azure.dataprotection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", { + * resourceGroupName: exampleResourceGroup.name, + * vaultName: exampleBackupVault.name, + * backupRepeatingTimeIntervals: ["R/2021-05-23T02:30:00+00:00/P1W"], + * defaultRetentionDuration: "P4M", + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleServer.id, + * roleDefinitionName: "Reader", + * principalId: exampleBackupVault.identity.apply(identity => identity?.principalId), + * }); + * const exampleBackupInstancePostgresql = new azure.dataprotection.BackupInstancePostgresql("exampleBackupInstancePostgresql", { + * location: exampleResourceGroup.location, + * vaultId: exampleBackupVault.id, + * databaseId: exampleDatabase.id, + * backupPolicyId: exampleBackupPolicyPostgresql.id, + * databaseCredentialKeyVaultSecretId: exampleSecret.versionlessId, + * }); + * ``` + * * ## Import * * Backup Instance PostgreSQL can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/backupPolicyBlobStorage.ts b/sdk/nodejs/dataprotection/backupPolicyBlobStorage.ts index f52d157d64..3acbb9b4f0 100644 --- a/sdk/nodejs/dataprotection/backupPolicyBlobStorage.ts +++ b/sdk/nodejs/dataprotection/backupPolicyBlobStorage.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Backup Policy Blob Storage. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleBackupVault = new azure.dataprotection.BackupVault("exampleBackupVault", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datastoreType: "VaultStore", + * redundancy: "LocallyRedundant", + * }); + * const exampleBackupPolicyBlobStorage = new azure.dataprotection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", { + * vaultId: exampleBackupVault.id, + * retentionDuration: "P30D", + * }); + * ``` + * * ## Import * * Backup Policy Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/backupPolicyDisk.ts b/sdk/nodejs/dataprotection/backupPolicyDisk.ts index 793e1ebd2e..df0163a519 100644 --- a/sdk/nodejs/dataprotection/backupPolicyDisk.ts +++ b/sdk/nodejs/dataprotection/backupPolicyDisk.ts @@ -9,6 +9,44 @@ import * as utilities from "../utilities"; /** * Manages a Backup Policy Disk. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleBackupVault = new azure.dataprotection.BackupVault("exampleBackupVault", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datastoreType: "VaultStore", + * redundancy: "LocallyRedundant", + * }); + * const exampleBackupPolicyDisk = new azure.dataprotection.BackupPolicyDisk("exampleBackupPolicyDisk", { + * vaultId: exampleBackupVault.id, + * backupRepeatingTimeIntervals: ["R/2021-05-19T06:33:16+00:00/PT4H"], + * defaultRetentionDuration: "P7D", + * retentionRules: [ + * { + * name: "Daily", + * duration: "P7D", + * priority: 25, + * criteria: { + * absoluteCriteria: "FirstOfDay", + * }, + * }, + * { + * name: "Weekly", + * duration: "P7D", + * priority: 20, + * criteria: { + * absoluteCriteria: "FirstOfWeek", + * }, + * }, + * ], + * }); + * ``` + * * ## Import * * Backup Policy Disks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/backupPolicyPostgresql.ts b/sdk/nodejs/dataprotection/backupPolicyPostgresql.ts index 60739b3181..95b1e3661c 100644 --- a/sdk/nodejs/dataprotection/backupPolicyPostgresql.ts +++ b/sdk/nodejs/dataprotection/backupPolicyPostgresql.ts @@ -9,6 +9,59 @@ import * as utilities from "../utilities"; /** * Manages a Backup Policy to back up PostgreSQL. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleBackupVault = new azure.dataprotection.BackupVault("exampleBackupVault", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datastoreType: "VaultStore", + * redundancy: "LocallyRedundant", + * }); + * const exampleBackupPolicyPostgresql = new azure.dataprotection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", { + * resourceGroupName: exampleResourceGroup.name, + * vaultName: exampleBackupVault.name, + * backupRepeatingTimeIntervals: ["R/2021-05-23T02:30:00+00:00/P1W"], + * defaultRetentionDuration: "P4M", + * retentionRules: [ + * { + * name: "weekly", + * duration: "P6M", + * priority: 20, + * criteria: { + * absoluteCriteria: "FirstOfWeek", + * }, + * }, + * { + * name: "thursday", + * duration: "P1W", + * priority: 25, + * criteria: { + * daysOfWeeks: ["Thursday"], + * scheduledBackupTimes: ["2021-05-23T02:30:00Z"], + * }, + * }, + * { + * name: "monthly", + * duration: "P1D", + * priority: 15, + * criteria: { + * weeksOfMonths: [ + * "First", + * "Last", + * ], + * daysOfWeeks: ["Tuesday"], + * scheduledBackupTimes: ["2021-05-23T02:30:00Z"], + * }, + * }, + * ], + * }); + * ``` + * * ## Import * * Backup Policy PostgreSQL's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/backupVault.ts b/sdk/nodejs/dataprotection/backupVault.ts index e730f6e736..530fbba31f 100644 --- a/sdk/nodejs/dataprotection/backupVault.ts +++ b/sdk/nodejs/dataprotection/backupVault.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; /** * Manages a Backup Vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleBackupVault = new azure.dataprotection.BackupVault("exampleBackupVault", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * datastoreType: "VaultStore", + * redundancy: "LocallyRedundant", + * }); + * ``` + * * ## Import * * Backup Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dataprotection/getBackupVault.ts b/sdk/nodejs/dataprotection/getBackupVault.ts index 79943d4270..8af6f373b8 100644 --- a/sdk/nodejs/dataprotection/getBackupVault.ts +++ b/sdk/nodejs/dataprotection/getBackupVault.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Backup Vault. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.dataprotection.getBackupVault({ + * name: "existing-backup-vault", + * resourceGroupName: "existing-resource-group", + * }); + * export const azurermDataProtectionBackupVaultId = data.azurerm_vpn_gateway.example.id; + * export const azurermDataProtectionBackupVaultPrincipalId = example.then(example => example.identities?.[0]?.principalId); + * ``` */ export function getBackupVault(args: GetBackupVaultArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +79,20 @@ export interface GetBackupVaultResult { } /** * Use this data source to access information about an existing Backup Vault. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.dataprotection.getBackupVault({ + * name: "existing-backup-vault", + * resourceGroupName: "existing-resource-group", + * }); + * export const azurermDataProtectionBackupVaultId = data.azurerm_vpn_gateway.example.id; + * export const azurermDataProtectionBackupVaultPrincipalId = example.then(example => example.identities?.[0]?.principalId); + * ``` */ export function getBackupVaultOutput(args: GetBackupVaultOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBackupVault(a, opts)) diff --git a/sdk/nodejs/dataprotection/resourceGuard.ts b/sdk/nodejs/dataprotection/resourceGuard.ts index 1ddd32143f..b2244cd1ff 100644 --- a/sdk/nodejs/dataprotection/resourceGuard.ts +++ b/sdk/nodejs/dataprotection/resourceGuard.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Resource Guard. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleResourceGuard = new azure.dataprotection.ResourceGuard("exampleResourceGuard", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datashare/account.ts b/sdk/nodejs/datashare/account.ts index 0bead13b8b..2316ae7311 100644 --- a/sdk/nodejs/datashare/account.ts +++ b/sdk/nodejs/datashare/account.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; /** * Manages a Data Share Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.datashare.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Data Share Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datashare/datasetBlobStorage.ts b/sdk/nodejs/datashare/datasetBlobStorage.ts index a930e90003..2bb3ca60dd 100644 --- a/sdk/nodejs/datashare/datasetBlobStorage.ts +++ b/sdk/nodejs/datashare/datasetBlobStorage.ts @@ -9,6 +9,57 @@ import * as utilities from "../utilities"; /** * Manages a Data Share Blob Storage Dataset. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.datashare.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleShare = new azure.datashare.Share("exampleShare", { + * accountId: exampleAccount.id, + * kind: "CopyBased", + * }); + * const exampleStorage_accountAccount = new azure.storage.Account("exampleStorage/accountAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "RAGRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleStorage / accountAccount.name, + * containerAccessType: "container", + * }); + * const exampleServicePrincipal = azuread.getServicePrincipalOutput({ + * displayName: exampleAccount.name, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleStorage / accountAccount.id, + * roleDefinitionName: "Storage Blob Data Reader", + * principalId: exampleServicePrincipal.apply(exampleServicePrincipal => exampleServicePrincipal.objectId), + * }); + * const exampleDatasetBlobStorage = new azure.datashare.DatasetBlobStorage("exampleDatasetBlobStorage", { + * dataShareId: exampleShare.id, + * containerName: exampleContainer.name, + * storageAccount: { + * name: exampleStorage / accountAccount.name, + * resourceGroupName: exampleStorage / accountAccount.resourceGroupName, + * subscriptionId: "00000000-0000-0000-0000-000000000000", + * }, + * filePath: "myfile.txt", + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Data Share Blob Storage Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datashare/datasetDataLakeGen2.ts b/sdk/nodejs/datashare/datasetDataLakeGen2.ts index ca6b898046..c66fab463d 100644 --- a/sdk/nodejs/datashare/datasetDataLakeGen2.ts +++ b/sdk/nodejs/datashare/datasetDataLakeGen2.ts @@ -7,6 +7,51 @@ import * as utilities from "../utilities"; /** * Manages a Data Share Data Lake Gen2 Dataset. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.datashare.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleShare = new azure.datashare.Share("exampleShare", { + * accountId: exampleAccount.id, + * kind: "CopyBased", + * }); + * const exampleStorage_accountAccount = new azure.storage.Account("exampleStorage/accountAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleStorage / accountAccount.id}); + * const exampleServicePrincipal = azuread.getServicePrincipalOutput({ + * displayName: exampleAccount.name, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleStorage / accountAccount.id, + * roleDefinitionName: "Storage Blob Data Reader", + * principalId: exampleServicePrincipal.apply(exampleServicePrincipal => exampleServicePrincipal.objectId), + * }); + * const exampleDatasetDataLakeGen2 = new azure.datashare.DatasetDataLakeGen2("exampleDatasetDataLakeGen2", { + * shareId: exampleShare.id, + * storageAccountId: exampleStorage / accountAccount.id, + * fileSystemName: exampleDataLakeGen2Filesystem.name, + * filePath: "myfile.txt", + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Data Share Data Lake Gen2 Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datashare/datasetKustoCluster.ts b/sdk/nodejs/datashare/datasetKustoCluster.ts index 3165857b85..1fcd9a1240 100644 --- a/sdk/nodejs/datashare/datasetKustoCluster.ts +++ b/sdk/nodejs/datashare/datasetKustoCluster.ts @@ -7,6 +7,45 @@ import * as utilities from "../utilities"; /** * Manages a Data Share Kusto Cluster Dataset. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.datashare.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleShare = new azure.datashare.Share("exampleShare", { + * accountId: exampleAccount.id, + * kind: "InPlace", + * }); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleCluster.id, + * roleDefinitionName: "Contributor", + * principalId: exampleAccount.identity.apply(identity => identity.principalId), + * }); + * const exampleDatasetKustoCluster = new azure.datashare.DatasetKustoCluster("exampleDatasetKustoCluster", { + * shareId: exampleShare.id, + * kustoClusterId: exampleCluster.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Data Share Kusto Cluster Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datashare/datasetKustoDatabase.ts b/sdk/nodejs/datashare/datasetKustoDatabase.ts index 92172d548f..a54eb292f5 100644 --- a/sdk/nodejs/datashare/datasetKustoDatabase.ts +++ b/sdk/nodejs/datashare/datasetKustoDatabase.ts @@ -7,6 +7,50 @@ import * as utilities from "../utilities"; /** * Manages a Data Share Kusto Database Dataset. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.datashare.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleShare = new azure.datashare.Share("exampleShare", { + * accountId: exampleAccount.id, + * kind: "InPlace", + * }); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleCluster.id, + * roleDefinitionName: "Contributor", + * principalId: exampleAccount.identity.apply(identity => identity.principalId), + * }); + * const exampleDatasetKustoDatabase = new azure.datashare.DatasetKustoDatabase("exampleDatasetKustoDatabase", { + * shareId: exampleShare.id, + * kustoDatabaseId: exampleDatabase.id, + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Data Share Kusto Database Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/datashare/getAccount.ts b/sdk/nodejs/datashare/getAccount.ts index f531f5a82d..8777506894 100644 --- a/sdk/nodejs/datashare/getAccount.ts +++ b/sdk/nodejs/datashare/getAccount.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Share Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +66,19 @@ export interface GetAccountResult { } /** * Use this data source to access information about an existing Data Share Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/datashare/getDatasetBlobStorage.ts b/sdk/nodejs/datashare/getDatasetBlobStorage.ts index 8e6c5fddf9..f92b432fb0 100644 --- a/sdk/nodejs/datashare/getDatasetBlobStorage.ts +++ b/sdk/nodejs/datashare/getDatasetBlobStorage.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Share Blob Storage Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetBlobStorage({ + * name: "example-dsbsds", + * dataShareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetBlobStorage(args: GetDatasetBlobStorageArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface GetDatasetBlobStorageResult { } /** * Use this data source to access information about an existing Data Share Blob Storage Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetBlobStorage({ + * name: "example-dsbsds", + * dataShareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetBlobStorageOutput(args: GetDatasetBlobStorageOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDatasetBlobStorage(a, opts)) diff --git a/sdk/nodejs/datashare/getDatasetDataLakeGen2.ts b/sdk/nodejs/datashare/getDatasetDataLakeGen2.ts index 3582e00704..b8909505db 100644 --- a/sdk/nodejs/datashare/getDatasetDataLakeGen2.ts +++ b/sdk/nodejs/datashare/getDatasetDataLakeGen2.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Share Data Lake Gen2 Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetDataLakeGen2({ + * name: "example-dsdlg2ds", + * shareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetDataLakeGen2(args: GetDatasetDataLakeGen2Args, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +76,19 @@ export interface GetDatasetDataLakeGen2Result { } /** * Use this data source to access information about an existing Data Share Data Lake Gen2 Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetDataLakeGen2({ + * name: "example-dsdlg2ds", + * shareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetDataLakeGen2Output(args: GetDatasetDataLakeGen2OutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDatasetDataLakeGen2(a, opts)) diff --git a/sdk/nodejs/datashare/getDatasetKustoCluster.ts b/sdk/nodejs/datashare/getDatasetKustoCluster.ts index d2a3d8b2f2..f900c395ac 100644 --- a/sdk/nodejs/datashare/getDatasetKustoCluster.ts +++ b/sdk/nodejs/datashare/getDatasetKustoCluster.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Share Kusto Cluster Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetKustoCluster({ + * name: "example-dskc", + * shareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetKustoCluster(args: GetDatasetKustoClusterArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetDatasetKustoClusterResult { } /** * Use this data source to access information about an existing Data Share Kusto Cluster Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetKustoCluster({ + * name: "example-dskc", + * shareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetKustoClusterOutput(args: GetDatasetKustoClusterOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDatasetKustoCluster(a, opts)) diff --git a/sdk/nodejs/datashare/getDatasetKustoDatabase.ts b/sdk/nodejs/datashare/getDatasetKustoDatabase.ts index ee06d8ae47..94f7e8f1ef 100644 --- a/sdk/nodejs/datashare/getDatasetKustoDatabase.ts +++ b/sdk/nodejs/datashare/getDatasetKustoDatabase.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Share Kusto Database Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetKustoDatabase({ + * name: "example-dskdds", + * shareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetKustoDatabase(args: GetDatasetKustoDatabaseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetDatasetKustoDatabaseResult { } /** * Use this data source to access information about an existing Data Share Kusto Database Dataset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.datashare.getDatasetKustoDatabase({ + * name: "example-dskdds", + * shareId: "example-share-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDatasetKustoDatabaseOutput(args: GetDatasetKustoDatabaseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDatasetKustoDatabase(a, opts)) diff --git a/sdk/nodejs/datashare/getShare.ts b/sdk/nodejs/datashare/getShare.ts index f641cfb4eb..a6183ab6b0 100644 --- a/sdk/nodejs/datashare/getShare.ts +++ b/sdk/nodejs/datashare/getShare.ts @@ -8,6 +8,23 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Share. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.datashare.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resource-group", + * }); + * const exampleShare = exampleAccount.then(exampleAccount => azure.datashare.getShare({ + * name: "existing", + * accountId: exampleAccount.id, + * })); + * export const id = exampleShare.then(exampleShare => exampleShare.id); + * ``` */ export function getShare(args: GetShareArgs, opts?: pulumi.InvokeOptions): Promise { @@ -64,6 +81,23 @@ export interface GetShareResult { } /** * Use this data source to access information about an existing Data Share. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.datashare.getAccount({ + * name: "example-account", + * resourceGroupName: "example-resource-group", + * }); + * const exampleShare = exampleAccount.then(exampleAccount => azure.datashare.getShare({ + * name: "existing", + * accountId: exampleAccount.id, + * })); + * export const id = exampleShare.then(exampleShare => exampleShare.id); + * ``` */ export function getShareOutput(args: GetShareOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getShare(a, opts)) diff --git a/sdk/nodejs/datashare/share.ts b/sdk/nodejs/datashare/share.ts index 5632eed3e1..d415a24693 100644 --- a/sdk/nodejs/datashare/share.ts +++ b/sdk/nodejs/datashare/share.ts @@ -9,6 +9,36 @@ import * as utilities from "../utilities"; /** * Manages a Data Share. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.datashare.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * foo: "bar", + * }, + * }); + * const exampleShare = new azure.datashare.Share("exampleShare", { + * accountId: exampleAccount.id, + * kind: "CopyBased", + * description: "example desc", + * terms: "example terms", + * snapshotSchedule: { + * name: "example-ss", + * recurrence: "Day", + * startTime: "2020-04-17T04:47:52.9614956Z", + * }, + * }); + * ``` + * * ## Import * * Data Shares can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/desktopvirtualization/application.ts b/sdk/nodejs/desktopvirtualization/application.ts index 8f4f39174c..91627a9470 100644 --- a/sdk/nodejs/desktopvirtualization/application.ts +++ b/sdk/nodejs/desktopvirtualization/application.ts @@ -7,6 +7,47 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Desktop Application. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const pooledbreadthfirst = new azure.desktopvirtualization.HostPool("pooledbreadthfirst", { + * location: example.location, + * resourceGroupName: example.name, + * type: "Pooled", + * loadBalancerType: "BreadthFirst", + * }); + * const personalautomatic = new azure.desktopvirtualization.HostPool("personalautomatic", { + * location: example.location, + * resourceGroupName: example.name, + * type: "Personal", + * personalDesktopAssignmentType: "Automatic", + * loadBalancerType: "BreadthFirst", + * }); + * const remoteapp = new azure.desktopvirtualization.ApplicationGroup("remoteapp", { + * location: example.location, + * resourceGroupName: example.name, + * type: "RemoteApp", + * hostPoolId: pooledbreadthfirst.id, + * friendlyName: "TestAppGroup", + * description: "Acceptance Test: An application group", + * }); + * const chrome = new azure.desktopvirtualization.Application("chrome", { + * applicationGroupId: remoteapp.id, + * friendlyName: "Google Chrome", + * description: "Chromium based web browser", + * path: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + * commandLineArgumentPolicy: "DoNotAllow", + * commandLineArguments: "--incognito", + * showInPortal: false, + * iconPath: "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + * iconIndex: 0, + * }); + * ``` + * * ## Import * * Virtual Desktop Application can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/desktopvirtualization/applicationGroup.ts b/sdk/nodejs/desktopvirtualization/applicationGroup.ts index 974cc1b6d0..08b9ba0990 100644 --- a/sdk/nodejs/desktopvirtualization/applicationGroup.ts +++ b/sdk/nodejs/desktopvirtualization/applicationGroup.ts @@ -7,6 +7,44 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Desktop Application Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const pooledbreadthfirst = new azure.desktopvirtualization.HostPool("pooledbreadthfirst", { + * location: example.location, + * resourceGroupName: example.name, + * type: "Pooled", + * loadBalancerType: "BreadthFirst", + * }); + * const personalautomatic = new azure.desktopvirtualization.HostPool("personalautomatic", { + * location: example.location, + * resourceGroupName: example.name, + * type: "Personal", + * personalDesktopAssignmentType: "Automatic", + * loadBalancerType: "BreadthFirst", + * }); + * const remoteapp = new azure.desktopvirtualization.ApplicationGroup("remoteapp", { + * location: example.location, + * resourceGroupName: example.name, + * type: "RemoteApp", + * hostPoolId: pooledbreadthfirst.id, + * friendlyName: "TestAppGroup", + * description: "Acceptance Test: An application group", + * }); + * const desktopapp = new azure.desktopvirtualization.ApplicationGroup("desktopapp", { + * location: example.location, + * resourceGroupName: example.name, + * type: "Desktop", + * hostPoolId: personalautomatic.id, + * friendlyName: "TestAppGroup", + * description: "Acceptance Test: An application group", + * }); + * ``` + * * ## Import * * Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/desktopvirtualization/getHostPool.ts b/sdk/nodejs/desktopvirtualization/getHostPool.ts index bee6050619..aee2c969f2 100644 --- a/sdk/nodejs/desktopvirtualization/getHostPool.ts +++ b/sdk/nodejs/desktopvirtualization/getHostPool.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Virtual Desktop Host Pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.desktopvirtualization.getHostPool({ + * name: "example-pool", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getHostPool(args: GetHostPoolArgs, opts?: pulumi.InvokeOptions): Promise { @@ -97,6 +109,18 @@ export interface GetHostPoolResult { } /** * Use this data source to access information about an existing Virtual Desktop Host Pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.desktopvirtualization.getHostPool({ + * name: "example-pool", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getHostPoolOutput(args: GetHostPoolOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getHostPool(a, opts)) diff --git a/sdk/nodejs/desktopvirtualization/getHostPoolRegistrationInfo.ts b/sdk/nodejs/desktopvirtualization/getHostPoolRegistrationInfo.ts index ef62aeee74..598dcb11fc 100644 --- a/sdk/nodejs/desktopvirtualization/getHostPoolRegistrationInfo.ts +++ b/sdk/nodejs/desktopvirtualization/getHostPoolRegistrationInfo.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages the Registration Info for a Virtual Desktop Host Pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westeurope"}); + * const exampleHostPool = new azure.desktopvirtualization.HostPool("exampleHostPool", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * type: "Pooled", + * validateEnvironment: true, + * loadBalancerType: "BreadthFirst", + * }); + * const examplegetHostPoolRegistrationInfo = new azure.desktopvirtualization.GetHostPoolRegistrationInfo("examplegetHostPoolRegistrationInfo", { + * hostpoolId: exampleHostPool.id, + * expirationDate: "2022-01-01T23:40:52Z", + * }); + * ``` + * * ## Import * * AVD Registration Infos can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/desktopvirtualization/hostPool.ts b/sdk/nodejs/desktopvirtualization/hostPool.ts index d70940e082..409a2f2dd0 100644 --- a/sdk/nodejs/desktopvirtualization/hostPool.ts +++ b/sdk/nodejs/desktopvirtualization/hostPool.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Desktop Host Pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleHostPool = new azure.desktopvirtualization.HostPool("exampleHostPool", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * friendlyName: "pooleddepthfirst", + * validateEnvironment: true, + * startVmOnConnect: true, + * customRdpProperties: "audiocapturemode:i:1;audiomode:i:0;", + * description: "Acceptance Test: A pooled host pool - pooleddepthfirst", + * type: "Pooled", + * maximumSessionsAllowed: 50, + * loadBalancerType: "DepthFirst", + * scheduledAgentUpdates: { + * enabled: true, + * schedules: [{ + * dayOfWeek: "Saturday", + * hourOfDay: 2, + * }], + * }, + * }); + * ``` + * * ## Import * * Virtual Desktop Host Pools can be imported using the `resource id`, e.g. text diff --git a/sdk/nodejs/desktopvirtualization/scalingPlan.ts b/sdk/nodejs/desktopvirtualization/scalingPlan.ts index d4198c1e53..8ca86be5d5 100644 --- a/sdk/nodejs/desktopvirtualization/scalingPlan.ts +++ b/sdk/nodejs/desktopvirtualization/scalingPlan.ts @@ -15,6 +15,96 @@ import * as utilities from "../utilities"; * * > **Note** Scaling Plans require specific permissions to be granted to the Windows Virtual Desktop application before a 'host_pool' can be configured. [Required Permissions for Scaling Plans](https://docs.microsoft.com/azure/virtual-desktop/autoscale-scaling-plan#create-a-custom-rbac-role). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * import * as random from "@pulumi/random"; + * + * const exampleRandomUuid = new random.RandomUuid("exampleRandomUuid", {}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRoleDefinition = new azure.authorization.RoleDefinition("exampleRoleDefinition", { + * scope: exampleResourceGroup.id, + * description: "AVD AutoScale Role", + * permissions: [{ + * actions: [ + * "Microsoft.Insights/eventtypes/values/read", + * "Microsoft.Compute/virtualMachines/deallocate/action", + * "Microsoft.Compute/virtualMachines/restart/action", + * "Microsoft.Compute/virtualMachines/powerOff/action", + * "Microsoft.Compute/virtualMachines/start/action", + * "Microsoft.Compute/virtualMachines/read", + * "Microsoft.DesktopVirtualization/hostpools/read", + * "Microsoft.DesktopVirtualization/hostpools/write", + * "Microsoft.DesktopVirtualization/hostpools/sessionhosts/read", + * "Microsoft.DesktopVirtualization/hostpools/sessionhosts/write", + * "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete", + * "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + * "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action", + * "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + * ], + * notActions: [], + * }], + * assignableScopes: [exampleResourceGroup.id], + * }); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "Windows Virtual Desktop", + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * name: exampleRandomUuid.result, + * scope: exampleResourceGroup.id, + * roleDefinitionId: exampleRoleDefinition.roleDefinitionResourceId, + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.id), + * skipServicePrincipalAadCheck: true, + * }); + * const exampleHostPool = new azure.desktopvirtualization.HostPool("exampleHostPool", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * type: "Pooled", + * validateEnvironment: true, + * loadBalancerType: "BreadthFirst", + * }); + * const exampleScalingPlan = new azure.desktopvirtualization.ScalingPlan("exampleScalingPlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * friendlyName: "Scaling Plan Example", + * description: "Example Scaling Plan", + * timeZone: "GMT Standard Time", + * schedules: [{ + * name: "Weekdays", + * daysOfWeeks: [ + * "Monday", + * "Tuesday", + * "Wednesday", + * "Thursday", + * "Friday", + * ], + * rampUpStartTime: "05:00", + * rampUpLoadBalancingAlgorithm: "BreadthFirst", + * rampUpMinimumHostsPercent: 20, + * rampUpCapacityThresholdPercent: 10, + * peakStartTime: "09:00", + * peakLoadBalancingAlgorithm: "BreadthFirst", + * rampDownStartTime: "19:00", + * rampDownLoadBalancingAlgorithm: "DepthFirst", + * rampDownMinimumHostsPercent: 10, + * rampDownForceLogoffUsers: false, + * rampDownWaitTimeMinutes: 45, + * rampDownNotificationMessage: "Please log off in the next 45 minutes...", + * rampDownCapacityThresholdPercent: 5, + * rampDownStopHostsWhen: "ZeroSessions", + * offPeakStartTime: "22:00", + * offPeakLoadBalancingAlgorithm: "DepthFirst", + * }], + * hostPools: [{ + * hostpoolId: exampleHostPool.id, + * scalingPlanEnabled: true, + * }], + * }); + * ``` + * * ## Import * * Virtual Desktop Scaling Plans can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/desktopvirtualization/workspace.ts b/sdk/nodejs/desktopvirtualization/workspace.ts index 9a127e04df..76d0d7392a 100644 --- a/sdk/nodejs/desktopvirtualization/workspace.ts +++ b/sdk/nodejs/desktopvirtualization/workspace.ts @@ -7,6 +7,21 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Desktop Workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const workspace = new azure.desktopvirtualization.Workspace("workspace", { + * location: example.location, + * resourceGroupName: example.name, + * friendlyName: "FriendlyName", + * description: "A description of my workspace", + * }); + * ``` + * * ## Import * * Virtual Desktop Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/desktopvirtualization/workspaceApplicationGroupAssociation.ts b/sdk/nodejs/desktopvirtualization/workspaceApplicationGroupAssociation.ts index e13bd842a0..e86c000ba9 100644 --- a/sdk/nodejs/desktopvirtualization/workspaceApplicationGroupAssociation.ts +++ b/sdk/nodejs/desktopvirtualization/workspaceApplicationGroupAssociation.ts @@ -7,6 +7,35 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Desktop Workspace Application Group Association. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const pooledbreadthfirst = new azure.desktopvirtualization.HostPool("pooledbreadthfirst", { + * location: example.location, + * resourceGroupName: example.name, + * type: "Pooled", + * loadBalancerType: "BreadthFirst", + * }); + * const remoteapp = new azure.desktopvirtualization.ApplicationGroup("remoteapp", { + * location: example.location, + * resourceGroupName: example.name, + * type: "RemoteApp", + * hostPoolId: pooledbreadthfirst.id, + * }); + * const workspace = new azure.desktopvirtualization.Workspace("workspace", { + * location: example.location, + * resourceGroupName: example.name, + * }); + * const workspaceremoteapp = new azure.desktopvirtualization.WorkspaceApplicationGroupAssociation("workspaceremoteapp", { + * workspaceId: workspace.id, + * applicationGroupId: remoteapp.id, + * }); + * ``` + * * ## Import * * Associations between Virtual Desktop Workspaces and Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/devcenter/devCenter.ts b/sdk/nodejs/devcenter/devCenter.ts index 2427f97ec9..24186a7675 100644 --- a/sdk/nodejs/devcenter/devCenter.ts +++ b/sdk/nodejs/devcenter/devCenter.ts @@ -11,6 +11,22 @@ import * as utilities from "../utilities"; * * Manages a Dev Center. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleDevCenter = new azure.devcenter.DevCenter("exampleDevCenter", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` * ## Blocks Reference * * ### `identity` Block diff --git a/sdk/nodejs/devcenter/project.ts b/sdk/nodejs/devcenter/project.ts index ee81bc0d31..0f5c7d9600 100644 --- a/sdk/nodejs/devcenter/project.ts +++ b/sdk/nodejs/devcenter/project.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; * * Manages a Dev Center Project. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDevCenter = new azure.devcenter.DevCenter("exampleDevCenter", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * identity: { + * type: "example-value", + * }, + * }); + * const exampleProject = new azure.devcenter.Project("exampleProject", { + * devCenterId: exampleDevCenter.id, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * An existing Dev Center Project can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/nodejs/devtest/getLab.ts b/sdk/nodejs/devtest/getLab.ts index 4742e713f3..3a4aa137f2 100644 --- a/sdk/nodejs/devtest/getLab.ts +++ b/sdk/nodejs/devtest/getLab.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Dev Test Lab. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.devtest.getLab({ + * name: "example-lab", + * resourceGroupName: "example-resources", + * }); + * export const uniqueIdentifier = example.then(example => example.uniqueIdentifier); + * ``` */ export function getLab(args: GetLabArgs, opts?: pulumi.InvokeOptions): Promise { @@ -79,6 +92,19 @@ export interface GetLabResult { } /** * Use this data source to access information about an existing Dev Test Lab. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.devtest.getLab({ + * name: "example-lab", + * resourceGroupName: "example-resources", + * }); + * export const uniqueIdentifier = example.then(example => example.uniqueIdentifier); + * ``` */ export function getLabOutput(args: GetLabOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getLab(a, opts)) diff --git a/sdk/nodejs/devtest/getVirtualNetwork.ts b/sdk/nodejs/devtest/getVirtualNetwork.ts index 11e5371b24..23e39360f8 100644 --- a/sdk/nodejs/devtest/getVirtualNetwork.ts +++ b/sdk/nodejs/devtest/getVirtualNetwork.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Dev Test Lab Virtual Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.devtest.getVirtualNetwork({ + * name: "example-network", + * labName: "examplelab", + * resourceGroupName: "example-resource", + * }); + * export const labSubnetName = example.then(example => example.allowedSubnets?.[0]?.labSubnetName); + * ``` */ export function getVirtualNetwork(args: GetVirtualNetworkArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +77,20 @@ export interface GetVirtualNetworkResult { } /** * Use this data source to access information about an existing Dev Test Lab Virtual Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.devtest.getVirtualNetwork({ + * name: "example-network", + * labName: "examplelab", + * resourceGroupName: "example-resource", + * }); + * export const labSubnetName = example.then(example => example.allowedSubnets?.[0]?.labSubnetName); + * ``` */ export function getVirtualNetworkOutput(args: GetVirtualNetworkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualNetwork(a, opts)) diff --git a/sdk/nodejs/devtest/globalVMShutdownSchedule.ts b/sdk/nodejs/devtest/globalVMShutdownSchedule.ts index 5242aaf6b2..d2c326fa9a 100644 --- a/sdk/nodejs/devtest/globalVMShutdownSchedule.ts +++ b/sdk/nodejs/devtest/globalVMShutdownSchedule.ts @@ -11,6 +11,66 @@ import * as utilities from "../utilities"; * this resource applies only to standard VMs, not DevTest Lab VMs. To manage automated shutdown schedules for DevTest Lab VMs, reference the * `azure.devtest.Schedule` resource * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * networkInterfaceIds: [exampleNetworkInterface.id], + * size: "Standard_B2s", + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * osDisk: { + * name: "myosdisk-example", + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * disablePasswordAuthentication: false, + * }); + * const exampleGlobalVMShutdownSchedule = new azure.devtest.GlobalVMShutdownSchedule("exampleGlobalVMShutdownSchedule", { + * virtualMachineId: exampleLinuxVirtualMachine.id, + * location: exampleResourceGroup.location, + * enabled: true, + * dailyRecurrenceTime: "1100", + * timezone: "Pacific Standard Time", + * notificationSettings: { + * enabled: true, + * timeInMinutes: 60, + * webhookUrl: "https://sample-webhook-url.example.com", + * }, + * }); + * ``` + * * ## Import * * An existing Dev Test Global Shutdown Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/devtest/lab.ts b/sdk/nodejs/devtest/lab.ts index 14380df669..fa0e8e5310 100644 --- a/sdk/nodejs/devtest/lab.ts +++ b/sdk/nodejs/devtest/lab.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Dev Test Lab. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.devtest.Lab("exampleLab", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * Sydney: "Australia", + * }, + * }); + * ``` + * * ## Import * * Dev Test Labs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/devtest/linuxVirtualMachine.ts b/sdk/nodejs/devtest/linuxVirtualMachine.ts index 7b300c425c..3727c2f5e2 100644 --- a/sdk/nodejs/devtest/linuxVirtualMachine.ts +++ b/sdk/nodejs/devtest/linuxVirtualMachine.ts @@ -9,6 +9,49 @@ import * as utilities from "../utilities"; /** * Manages a Linux Virtual Machine within a Dev Test Lab. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.devtest.Lab("exampleLab", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * Sydney: "Australia", + * }, + * }); + * const exampleVirtualNetwork = new azure.devtest.VirtualNetwork("exampleVirtualNetwork", { + * labName: exampleLab.name, + * resourceGroupName: exampleResourceGroup.name, + * subnet: { + * usePublicIpAddress: "Allow", + * useInVirtualMachineCreation: "Allow", + * }, + * }); + * const exampleLinuxVirtualMachine = new azure.devtest.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * labName: exampleLab.name, + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_DS2", + * username: "exampleuser99", + * sshKey: fs.readFileSync("~/.ssh/id_rsa.pub"), + * labVirtualNetworkId: exampleVirtualNetwork.id, + * labSubnetName: exampleVirtualNetwork.subnet.apply(subnet => subnet.name), + * storageType: "Premium", + * notes: "Some notes about this Virtual Machine.", + * galleryImageReference: { + * offer: "UbuntuServer", + * publisher: "Canonical", + * sku: "18.04-LTS", + * version: "latest", + * }, + * }); + * ``` + * * ## Import * * Dev Test Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/devtest/policy.ts b/sdk/nodejs/devtest/policy.ts index b99bf86a0e..f3a4e35704 100644 --- a/sdk/nodejs/devtest/policy.ts +++ b/sdk/nodejs/devtest/policy.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages a Policy within a Dev Test Policy Set. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.devtest.Lab("exampleLab", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * Sydney: "Australia", + * }, + * }); + * const examplePolicy = new azure.devtest.Policy("examplePolicy", { + * policySetName: "default", + * labName: exampleLab.name, + * resourceGroupName: exampleResourceGroup.name, + * factData: "", + * threshold: "999", + * evaluatorType: "MaxValuePolicy", + * tags: { + * Acceptance: "Test", + * }, + * }); + * ``` + * * ## Import * * Dev Test Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/devtest/schedule.ts b/sdk/nodejs/devtest/schedule.ts index e8313da128..20222f6af7 100644 --- a/sdk/nodejs/devtest/schedule.ts +++ b/sdk/nodejs/devtest/schedule.ts @@ -9,6 +9,37 @@ import * as utilities from "../utilities"; /** * Manages automated startup and shutdown schedules for Azure Dev Test Lab. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.devtest.Lab("exampleLab", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSchedule = new azure.devtest.Schedule("exampleSchedule", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * labName: exampleLab.name, + * weeklyRecurrence: { + * time: "1100", + * weekDays: [ + * "Monday", + * "Tuesday", + * ], + * }, + * timeZoneId: "Pacific Standard Time", + * taskType: "LabVmsStartupTask", + * notificationSettings: {}, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * DevTest Schedule's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/devtest/virtualNetwork.ts b/sdk/nodejs/devtest/virtualNetwork.ts index 23dc94d813..e82c08ea81 100644 --- a/sdk/nodejs/devtest/virtualNetwork.ts +++ b/sdk/nodejs/devtest/virtualNetwork.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Network within a DevTest Lab. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.devtest.Lab("exampleLab", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * Sydney: "Australia", + * }, + * }); + * const exampleVirtualNetwork = new azure.devtest.VirtualNetwork("exampleVirtualNetwork", { + * labName: exampleLab.name, + * resourceGroupName: exampleResourceGroup.name, + * subnet: { + * usePublicIpAddress: "Allow", + * useInVirtualMachineCreation: "Allow", + * }, + * }); + * ``` + * * ## Import * * DevTest Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/devtest/windowsVirtualMachine.ts b/sdk/nodejs/devtest/windowsVirtualMachine.ts index e3cff1933b..f5efd56339 100644 --- a/sdk/nodejs/devtest/windowsVirtualMachine.ts +++ b/sdk/nodejs/devtest/windowsVirtualMachine.ts @@ -9,6 +9,48 @@ import * as utilities from "../utilities"; /** * Manages a Windows Virtual Machine within a Dev Test Lab. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.devtest.Lab("exampleLab", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * Sydney: "Australia", + * }, + * }); + * const exampleVirtualNetwork = new azure.devtest.VirtualNetwork("exampleVirtualNetwork", { + * labName: exampleLab.name, + * resourceGroupName: exampleResourceGroup.name, + * subnet: { + * usePublicIpAddress: "Allow", + * useInVirtualMachineCreation: "Allow", + * }, + * }); + * const exampleWindowsVirtualMachine = new azure.devtest.WindowsVirtualMachine("exampleWindowsVirtualMachine", { + * labName: exampleLab.name, + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_DS2", + * username: "exampleuser99", + * password: "Pa$w0rd1234!", + * labVirtualNetworkId: exampleVirtualNetwork.id, + * labSubnetName: exampleVirtualNetwork.subnet.apply(subnet => subnet.name), + * storageType: "Premium", + * notes: "Some notes about this Virtual Machine.", + * galleryImageReference: { + * offer: "WindowsServer", + * publisher: "MicrosoftWindowsServer", + * sku: "2019-Datacenter", + * version: "latest", + * }, + * }); + * ``` + * * ## Import * * DevTest Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/digitaltwins/endpointEventGrid.ts b/sdk/nodejs/digitaltwins/endpointEventGrid.ts index 502102a3f7..a7c2f55a28 100644 --- a/sdk/nodejs/digitaltwins/endpointEventGrid.ts +++ b/sdk/nodejs/digitaltwins/endpointEventGrid.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a Digital Twins Event Grid Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInstance = new azure.digitaltwins.Instance("exampleInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleTopic = new azure.eventgrid.Topic("exampleTopic", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleEndpointEventGrid = new azure.digitaltwins.EndpointEventGrid("exampleEndpointEventGrid", { + * digitalTwinsId: exampleInstance.id, + * eventgridTopicEndpoint: exampleTopic.endpoint, + * eventgridTopicPrimaryAccessKey: exampleTopic.primaryAccessKey, + * eventgridTopicSecondaryAccessKey: exampleTopic.secondaryAccessKey, + * }); + * ``` + * * ## Import * * Digital Twins Eventgrid Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/digitaltwins/endpointEventHub.ts b/sdk/nodejs/digitaltwins/endpointEventHub.ts index 3d0034ffea..c30bfcba06 100644 --- a/sdk/nodejs/digitaltwins/endpointEventHub.ts +++ b/sdk/nodejs/digitaltwins/endpointEventHub.ts @@ -7,6 +7,43 @@ import * as utilities from "../utilities"; /** * Manages a Digital Twins Event Hub Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInstance = new azure.digitaltwins.Instance("exampleInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * listen: false, + * send: true, + * manage: false, + * }); + * const exampleEndpointEventHub = new azure.digitaltwins.EndpointEventHub("exampleEndpointEventHub", { + * digitalTwinsId: exampleInstance.id, + * eventhubPrimaryConnectionString: exampleAuthorizationRule.primaryConnectionString, + * eventhubSecondaryConnectionString: exampleAuthorizationRule.secondaryConnectionString, + * }); + * ``` + * * ## Import * * Digital Twins Eventhub Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/digitaltwins/endpointServicebus.ts b/sdk/nodejs/digitaltwins/endpointServicebus.ts index 20f451eacc..dd77fc1183 100644 --- a/sdk/nodejs/digitaltwins/endpointServicebus.ts +++ b/sdk/nodejs/digitaltwins/endpointServicebus.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a Digital Twins Service Bus Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInstance = new azure.digitaltwins.Instance("exampleInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", {namespaceId: exampleNamespace.id}); + * const exampleTopicAuthorizationRule = new azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", { + * topicId: exampleTopic.id, + * listen: false, + * send: true, + * manage: false, + * }); + * const exampleEndpointServicebus = new azure.digitaltwins.EndpointServicebus("exampleEndpointServicebus", { + * digitalTwinsId: exampleInstance.id, + * servicebusPrimaryConnectionString: exampleTopicAuthorizationRule.primaryConnectionString, + * servicebusSecondaryConnectionString: exampleTopicAuthorizationRule.secondaryConnectionString, + * }); + * ``` + * * ## Import * * Digital Twins Service Bus Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/digitaltwins/getInstance.ts b/sdk/nodejs/digitaltwins/getInstance.ts index 74203acba4..3abfa681de 100644 --- a/sdk/nodejs/digitaltwins/getInstance.ts +++ b/sdk/nodejs/digitaltwins/getInstance.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Digital Twins instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.digitaltwins.getInstance({ + * name: "existing-digital-twins", + * resourceGroupName: "existing-resgroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getInstance(args: GetInstanceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetInstanceResult { } /** * Use this data source to access information about an existing Digital Twins instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.digitaltwins.getInstance({ + * name: "existing-digital-twins", + * resourceGroupName: "existing-resgroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getInstanceOutput(args: GetInstanceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getInstance(a, opts)) diff --git a/sdk/nodejs/digitaltwins/instance.ts b/sdk/nodejs/digitaltwins/instance.ts index db72e8ae62..add5cc1c00 100644 --- a/sdk/nodejs/digitaltwins/instance.ts +++ b/sdk/nodejs/digitaltwins/instance.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; /** * Manages a Digital Twins instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInstance = new azure.digitaltwins.Instance("exampleInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Digital Twins instances can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/digitaltwins/timeSeriesDatabaseConnection.ts b/sdk/nodejs/digitaltwins/timeSeriesDatabaseConnection.ts index 9fd7112065..ca258a2b7d 100644 --- a/sdk/nodejs/digitaltwins/timeSeriesDatabaseConnection.ts +++ b/sdk/nodejs/digitaltwins/timeSeriesDatabaseConnection.ts @@ -7,6 +7,87 @@ import * as utilities from "../utilities"; /** * Manages a Digital Twins Time Series Database Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInstance = new azure.digitaltwins.Instance("exampleInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 7, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * }); + * const databaseContributor = new azure.authorization.Assignment("databaseContributor", { + * scope: exampleDatabase.id, + * principalId: exampleInstance.identity.apply(identity => identity?.principalId), + * roleDefinitionName: "Contributor", + * }); + * const eventhubDataOwner = new azure.authorization.Assignment("eventhubDataOwner", { + * scope: exampleEventHub.id, + * principalId: exampleInstance.identity.apply(identity => identity?.principalId), + * roleDefinitionName: "Azure Event Hubs Data Owner", + * }); + * const exampleDatabasePrincipalAssignment = new azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", { + * resourceGroupName: exampleResourceGroup.name, + * clusterName: exampleCluster.name, + * databaseName: exampleDatabase.name, + * tenantId: exampleInstance.identity.apply(identity => identity?.tenantId), + * principalId: exampleInstance.identity.apply(identity => identity?.principalId), + * principalType: "App", + * role: "Admin", + * }); + * const exampleTimeSeriesDatabaseConnection = new azure.digitaltwins.TimeSeriesDatabaseConnection("exampleTimeSeriesDatabaseConnection", { + * digitalTwinsId: exampleInstance.id, + * eventhubName: exampleEventHub.name, + * eventhubNamespaceId: exampleEventHubNamespace.id, + * eventhubNamespaceEndpointUri: pulumi.interpolate`sb://${exampleEventHubNamespace.name}.servicebus.windows.net`, + * eventhubConsumerGroupName: exampleConsumerGroup.name, + * kustoClusterId: exampleCluster.id, + * kustoClusterUri: exampleCluster.uri, + * kustoDatabaseName: exampleDatabase.name, + * kustoTableName: "exampleTable", + * }, { + * dependsOn: [ + * databaseContributor, + * eventhubDataOwner, + * exampleDatabasePrincipalAssignment, + * ], + * }); + * ``` + * * ## Import * * Digital Twins Time Series Database Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/aaaaRecord.ts b/sdk/nodejs/dns/aaaaRecord.ts index 0e82ca80ed..dcc09fcc38 100644 --- a/sdk/nodejs/dns/aaaaRecord.ts +++ b/sdk/nodejs/dns/aaaaRecord.ts @@ -5,6 +5,43 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleAaaaRecord = new azure.dns.AaaaRecord("exampleAaaaRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: ["2001:db8::1:0:0:1"], + * }); + * ``` + * ### Alias Record) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Dynamic", + * ipVersion: "IPv6", + * }); + * const exampleAaaaRecord = new azure.dns.AaaaRecord("exampleAaaaRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * targetResourceId: examplePublicIp.id, + * }); + * ``` + * * ## Import * * AAAA records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/arecord.ts b/sdk/nodejs/dns/arecord.ts index 75581e77bf..728ec14e0d 100644 --- a/sdk/nodejs/dns/arecord.ts +++ b/sdk/nodejs/dns/arecord.ts @@ -5,6 +5,43 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleARecord = new azure.dns.ARecord("exampleARecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: ["10.0.180.17"], + * }); + * ``` + * ### Alias Record) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Dynamic", + * ipVersion: "IPv4", + * }); + * const exampleARecord = new azure.dns.ARecord("exampleARecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * targetResourceId: examplePublicIp.id, + * }); + * ``` + * * ## Import * * A records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/caaRecord.ts b/sdk/nodejs/dns/caaRecord.ts index d8d9fe8050..4a46e674d1 100644 --- a/sdk/nodejs/dns/caaRecord.ts +++ b/sdk/nodejs/dns/caaRecord.ts @@ -7,6 +7,46 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleCaaRecord = new azure.dns.CaaRecord("exampleCaaRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: [ + * { + * flags: 0, + * tag: "issue", + * value: "example.com", + * }, + * { + * flags: 0, + * tag: "issue", + * value: "example.net", + * }, + * { + * flags: 0, + * tag: "issuewild", + * value: ";", + * }, + * { + * flags: 0, + * tag: "iodef", + * value: "mailto:user@nonexisting.tld", + * }, + * ], + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * CAA records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/cnameRecord.ts b/sdk/nodejs/dns/cnameRecord.ts index bb5cc5fda9..1c552ebb67 100644 --- a/sdk/nodejs/dns/cnameRecord.ts +++ b/sdk/nodejs/dns/cnameRecord.ts @@ -5,6 +5,43 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleCNameRecord = new azure.dns.CNameRecord("exampleCNameRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * record: "contoso.com", + * }); + * ``` + * ### Alias Record) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const target = new azure.dns.CNameRecord("target", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * record: "contoso.com", + * }); + * const exampleCNameRecord = new azure.dns.CNameRecord("exampleCNameRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * targetResourceId: target.id, + * }); + * ``` + * * ## Import * * CNAME records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/getAAAARecord.ts b/sdk/nodejs/dns/getAAAARecord.ts index 72fee80cd1..e8308c4d8c 100644 --- a/sdk/nodejs/dns/getAAAARecord.ts +++ b/sdk/nodejs/dns/getAAAARecord.ts @@ -4,6 +4,20 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.AaaaRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsAaaaRecordId = example.id; + * ``` + */ export function getAAAARecord(args: GetAAAARecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -64,6 +78,20 @@ export interface GetAAAARecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.AaaaRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsAaaaRecordId = example.id; + * ``` + */ export function getAAAARecordOutput(args: GetAAAARecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAAAARecord(a, opts)) } diff --git a/sdk/nodejs/dns/getARecord.ts b/sdk/nodejs/dns/getARecord.ts index ac14cbbef9..3872457af3 100644 --- a/sdk/nodejs/dns/getARecord.ts +++ b/sdk/nodejs/dns/getARecord.ts @@ -4,6 +4,21 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.dns.getARecord({ + * name: "test", + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsARecordId = example.then(example => example.id); + * ``` + */ export function getARecord(args: GetARecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -64,6 +79,21 @@ export interface GetARecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.dns.getARecord({ + * name: "test", + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsARecordId = example.then(example => example.id); + * ``` + */ export function getARecordOutput(args: GetARecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getARecord(a, opts)) } diff --git a/sdk/nodejs/dns/getCAARecord.ts b/sdk/nodejs/dns/getCAARecord.ts index 6478b89cab..567ac20168 100644 --- a/sdk/nodejs/dns/getCAARecord.ts +++ b/sdk/nodejs/dns/getCAARecord.ts @@ -6,6 +6,20 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.CaaRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsCaaRecordId = example.id; + * ``` + */ export function getCAARecord(args: GetCAARecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -62,6 +76,20 @@ export interface GetCAARecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.CaaRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsCaaRecordId = example.id; + * ``` + */ export function getCAARecordOutput(args: GetCAARecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCAARecord(a, opts)) } diff --git a/sdk/nodejs/dns/getCnameRecord.ts b/sdk/nodejs/dns/getCnameRecord.ts index f7aaa2873d..73996f4551 100644 --- a/sdk/nodejs/dns/getCnameRecord.ts +++ b/sdk/nodejs/dns/getCnameRecord.ts @@ -4,6 +4,20 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.CNameRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsCnameRecordId = example.id; + * ``` + */ export function getCnameRecord(args: GetCnameRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -64,6 +78,20 @@ export interface GetCnameRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.CNameRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsCnameRecordId = example.id; + * ``` + */ export function getCnameRecordOutput(args: GetCnameRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCnameRecord(a, opts)) } diff --git a/sdk/nodejs/dns/getMxRecord.ts b/sdk/nodejs/dns/getMxRecord.ts index 7e1c6875a0..9b89768562 100644 --- a/sdk/nodejs/dns/getMxRecord.ts +++ b/sdk/nodejs/dns/getMxRecord.ts @@ -6,6 +6,20 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.MxRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsMxRecordId = example.id; + * ``` + */ export function getMxRecord(args: GetMxRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -62,6 +76,20 @@ export interface GetMxRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.MxRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsMxRecordId = example.id; + * ``` + */ export function getMxRecordOutput(args: GetMxRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMxRecord(a, opts)) } diff --git a/sdk/nodejs/dns/getNsRecord.ts b/sdk/nodejs/dns/getNsRecord.ts index eea2e66413..e7f5617e75 100644 --- a/sdk/nodejs/dns/getNsRecord.ts +++ b/sdk/nodejs/dns/getNsRecord.ts @@ -4,6 +4,20 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.NsRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsNsRecordId = example.id; + * ``` + */ export function getNsRecord(args: GetNsRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -60,6 +74,20 @@ export interface GetNsRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.NsRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsNsRecordId = example.id; + * ``` + */ export function getNsRecordOutput(args: GetNsRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNsRecord(a, opts)) } diff --git a/sdk/nodejs/dns/getPtrRecord.ts b/sdk/nodejs/dns/getPtrRecord.ts index 0624544c06..c6f5f55275 100644 --- a/sdk/nodejs/dns/getPtrRecord.ts +++ b/sdk/nodejs/dns/getPtrRecord.ts @@ -4,6 +4,20 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.PtrRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsPtrRecordId = example.id; + * ``` + */ export function getPtrRecord(args: GetPtrRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -60,6 +74,20 @@ export interface GetPtrRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.PtrRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsPtrRecordId = example.id; + * ``` + */ export function getPtrRecordOutput(args: GetPtrRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPtrRecord(a, opts)) } diff --git a/sdk/nodejs/dns/getSrvRecord.ts b/sdk/nodejs/dns/getSrvRecord.ts index e8908fbef2..efa59129be 100644 --- a/sdk/nodejs/dns/getSrvRecord.ts +++ b/sdk/nodejs/dns/getSrvRecord.ts @@ -6,6 +6,20 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.SrvRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsSrvRecordId = example.id; + * ``` + */ export function getSrvRecord(args: GetSrvRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -62,6 +76,20 @@ export interface GetSrvRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.SrvRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsSrvRecordId = example.id; + * ``` + */ export function getSrvRecordOutput(args: GetSrvRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSrvRecord(a, opts)) } diff --git a/sdk/nodejs/dns/getTxtRecord.ts b/sdk/nodejs/dns/getTxtRecord.ts index 168e6376fd..f75d15090f 100644 --- a/sdk/nodejs/dns/getTxtRecord.ts +++ b/sdk/nodejs/dns/getTxtRecord.ts @@ -6,6 +6,20 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.TxtRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsTxtRecordId = example.id; + * ``` + */ export function getTxtRecord(args: GetTxtRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -62,6 +76,20 @@ export interface GetTxtRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.dns.TxtRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const dnsTxtRecordId = example.id; + * ``` + */ export function getTxtRecordOutput(args: GetTxtRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTxtRecord(a, opts)) } diff --git a/sdk/nodejs/dns/getZone.ts b/sdk/nodejs/dns/getZone.ts index 69f78940b9..523354bc5d 100644 --- a/sdk/nodejs/dns/getZone.ts +++ b/sdk/nodejs/dns/getZone.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing DNS Zone. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.dns.getZone({ + * name: "search-eventhubns", + * resourceGroupName: "search-service", + * }); + * export const dnsZoneId = example.then(example => example.id); + * ``` */ export function getZone(args: GetZoneArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +74,19 @@ export interface GetZoneResult { } /** * Use this data source to access information about an existing DNS Zone. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.dns.getZone({ + * name: "search-eventhubns", + * resourceGroupName: "search-service", + * }); + * export const dnsZoneId = example.then(example => example.id); + * ``` */ export function getZoneOutput(args: GetZoneOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getZone(a, opts)) diff --git a/sdk/nodejs/dns/mxRecord.ts b/sdk/nodejs/dns/mxRecord.ts index 114ded5265..df879f475c 100644 --- a/sdk/nodejs/dns/mxRecord.ts +++ b/sdk/nodejs/dns/mxRecord.ts @@ -7,6 +7,34 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleMxRecord = new azure.dns.MxRecord("exampleMxRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: [ + * { + * preference: "10", + * exchange: "mail1.contoso.com", + * }, + * { + * preference: "20", + * exchange: "mail2.contoso.com", + * }, + * ], + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * MX records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/nsRecord.ts b/sdk/nodejs/dns/nsRecord.ts index 84a238c9aa..58bf64f68a 100644 --- a/sdk/nodejs/dns/nsRecord.ts +++ b/sdk/nodejs/dns/nsRecord.ts @@ -5,6 +5,28 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleNsRecord = new azure.dns.NsRecord("exampleNsRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: [ + * "ns1.contoso.com.", + * "ns2.contoso.com.", + * ], + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * NS records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/ptrRecord.ts b/sdk/nodejs/dns/ptrRecord.ts index 1011212334..3ce03b712a 100644 --- a/sdk/nodejs/dns/ptrRecord.ts +++ b/sdk/nodejs/dns/ptrRecord.ts @@ -5,6 +5,22 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const examplePtrRecord = new azure.dns.PtrRecord("examplePtrRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: ["yourdomain.com"], + * }); + * ``` + * * ## Import * * PTR records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/srvRecord.ts b/sdk/nodejs/dns/srvRecord.ts index 6434e2919d..06a762e3b4 100644 --- a/sdk/nodejs/dns/srvRecord.ts +++ b/sdk/nodejs/dns/srvRecord.ts @@ -7,6 +7,30 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleSrvRecord = new azure.dns.SrvRecord("exampleSrvRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: [{ + * priority: 1, + * weight: 5, + * port: 8080, + * target: "target1.contoso.com", + * }], + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * SRV records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/txtRecord.ts b/sdk/nodejs/dns/txtRecord.ts index 289ec7805f..32a630a3b0 100644 --- a/sdk/nodejs/dns/txtRecord.ts +++ b/sdk/nodejs/dns/txtRecord.ts @@ -7,6 +7,32 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.dns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleTxtRecord = new azure.dns.TxtRecord("exampleTxtRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: [ + * { + * value: "google-site-authenticator", + * }, + * { + * value: "more site information here", + * }, + * ], + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * TXT records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/dns/zone.ts b/sdk/nodejs/dns/zone.ts index aa15ca103d..77723e57b3 100644 --- a/sdk/nodejs/dns/zone.ts +++ b/sdk/nodejs/dns/zone.ts @@ -9,6 +9,16 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS zones within Azure DNS. These zones are hosted on Azure's name servers to which you can delegate the zone from the parent domain. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const example_public = new azure.dns.Zone("example-public", {resourceGroupName: example.name}); + * ``` + * * ## Import * * DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/domainservices/getService.ts b/sdk/nodejs/domainservices/getService.ts index 54ded30c98..3869514220 100644 --- a/sdk/nodejs/domainservices/getService.ts +++ b/sdk/nodejs/domainservices/getService.ts @@ -10,6 +10,18 @@ import * as utilities from "../utilities"; * Gets information about an Active Directory Domain Service. * * > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.domainservices.getService({ + * name: "example-aadds", + * resourceGroupName: "example-aadds-rg", + * }); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -102,6 +114,18 @@ export interface GetServiceResult { * Gets information about an Active Directory Domain Service. * * > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.domainservices.getService({ + * name: "example-aadds", + * resourceGroupName: "example-aadds-rg", + * }); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/domainservices/replicaSet.ts b/sdk/nodejs/domainservices/replicaSet.ts index 7d6fe0bba1..d9ac095475 100644 --- a/sdk/nodejs/domainservices/replicaSet.ts +++ b/sdk/nodejs/domainservices/replicaSet.ts @@ -7,6 +7,226 @@ import * as utilities from "../utilities"; /** * Manages a Replica Set for an Active Directory Domain Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const primaryResourceGroup = new azure.core.ResourceGroup("primaryResourceGroup", {location: "West Europe"}); + * const primaryVirtualNetwork = new azure.network.VirtualNetwork("primaryVirtualNetwork", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * addressSpaces: ["10.0.1.0/16"], + * }); + * const primarySubnet = new azure.network.Subnet("primarySubnet", { + * resourceGroupName: primaryResourceGroup.name, + * virtualNetworkName: primaryVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const primaryNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("primaryNetworkSecurityGroup", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * securityRules: [ + * { + * name: "AllowSyncWithAzureAD", + * priority: 101, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "443", + * sourceAddressPrefix: "AzureActiveDirectoryDomainServices", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowRD", + * priority: 201, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "3389", + * sourceAddressPrefix: "CorpNetSaw", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowPSRemoting", + * priority: 301, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "5986", + * sourceAddressPrefix: "AzureActiveDirectoryDomainServices", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowLDAPS", + * priority: 401, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "636", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * }, + * ], + * }); + * const primarySubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("primarySubnetNetworkSecurityGroupAssociation", { + * subnetId: primarySubnet.id, + * networkSecurityGroupId: primaryNetworkSecurityGroup.id, + * }); + * const dcAdmins = new azuread.Group("dcAdmins", { + * displayName: "aad-dc-administrators", + * securityEnabled: true, + * }); + * const adminUser = new azuread.User("adminUser", { + * userPrincipalName: "dc-admin@hashicorp-example.net", + * displayName: "DC Administrator", + * password: "Pa55w0Rd!!1", + * }); + * const adminGroupMember = new azuread.GroupMember("adminGroupMember", { + * groupObjectId: dcAdmins.objectId, + * memberObjectId: adminUser.objectId, + * }); + * const exampleServicePrincipal = new azuread.ServicePrincipal("exampleServicePrincipal", {applicationId: "2565bd9d-da50-47d4-8b85-4c97f669dc36"}); + * // published app for domain services + * const aadds = new azure.core.ResourceGroup("aadds", {location: "westeurope"}); + * const exampleService = new azure.domainservices.Service("exampleService", { + * location: aadds.location, + * resourceGroupName: aadds.name, + * domainName: "widgetslogin.net", + * sku: "Enterprise", + * filteredSyncEnabled: false, + * initialReplicaSet: { + * location: primaryVirtualNetwork.location, + * subnetId: primarySubnet.id, + * }, + * notifications: { + * additionalRecipients: [ + * "notifyA@example.net", + * "notifyB@example.org", + * ], + * notifyDcAdmins: true, + * notifyGlobalAdmins: true, + * }, + * security: { + * syncKerberosPasswords: true, + * syncNtlmPasswords: true, + * syncOnPremPasswords: true, + * }, + * tags: { + * Environment: "prod", + * }, + * }, { + * dependsOn: [ + * exampleServicePrincipal, + * primarySubnetNetworkSecurityGroupAssociation, + * ], + * }); + * const replicaResourceGroup = new azure.core.ResourceGroup("replicaResourceGroup", {location: "North Europe"}); + * const replicaVirtualNetwork = new azure.network.VirtualNetwork("replicaVirtualNetwork", { + * location: replicaResourceGroup.location, + * resourceGroupName: replicaResourceGroup.name, + * addressSpaces: ["10.20.0.0/16"], + * }); + * const aaddsReplicaSubnet = new azure.network.Subnet("aaddsReplicaSubnet", { + * resourceGroupName: replicaResourceGroup.name, + * virtualNetworkName: replicaVirtualNetwork.name, + * addressPrefixes: ["10.20.0.0/24"], + * }); + * const aaddsReplicaNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("aaddsReplicaNetworkSecurityGroup", { + * location: replicaResourceGroup.location, + * resourceGroupName: replicaResourceGroup.name, + * securityRules: [ + * { + * name: "AllowSyncWithAzureAD", + * priority: 101, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "443", + * sourceAddressPrefix: "AzureActiveDirectoryDomainServices", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowRD", + * priority: 201, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "3389", + * sourceAddressPrefix: "CorpNetSaw", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowPSRemoting", + * priority: 301, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "5986", + * sourceAddressPrefix: "AzureActiveDirectoryDomainServices", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowLDAPS", + * priority: 401, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "636", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * }, + * ], + * }); + * const replicaSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("replicaSubnetNetworkSecurityGroupAssociation", { + * subnetId: aaddsReplicaSubnet.id, + * networkSecurityGroupId: aaddsReplicaNetworkSecurityGroup.id, + * }); + * const primaryReplica = new azure.network.VirtualNetworkPeering("primaryReplica", { + * resourceGroupName: primaryVirtualNetwork.resourceGroupName, + * virtualNetworkName: primaryVirtualNetwork.name, + * remoteVirtualNetworkId: replicaVirtualNetwork.id, + * allowForwardedTraffic: true, + * allowGatewayTransit: false, + * allowVirtualNetworkAccess: true, + * useRemoteGateways: false, + * }); + * const replicaPrimary = new azure.network.VirtualNetworkPeering("replicaPrimary", { + * resourceGroupName: replicaVirtualNetwork.resourceGroupName, + * virtualNetworkName: replicaVirtualNetwork.name, + * remoteVirtualNetworkId: primaryVirtualNetwork.id, + * allowForwardedTraffic: true, + * allowGatewayTransit: false, + * allowVirtualNetworkAccess: true, + * useRemoteGateways: false, + * }); + * const replicaVirtualNetworkDnsServers = new azure.network.VirtualNetworkDnsServers("replicaVirtualNetworkDnsServers", { + * virtualNetworkId: replicaVirtualNetwork.id, + * dnsServers: exampleService.initialReplicaSet.apply(initialReplicaSet => initialReplicaSet.domainControllerIpAddresses), + * }); + * const replicaReplicaSet = new azure.domainservices.ReplicaSet("replicaReplicaSet", { + * domainServiceId: exampleService.id, + * location: replicaResourceGroup.location, + * subnetId: aaddsReplicaSubnet.id, + * }, { + * dependsOn: [ + * replicaSubnetNetworkSecurityGroupAssociation, + * primaryReplica, + * replicaPrimary, + * ], + * }); + * ``` + * * ## Import * * Domain Service Replica Sets can be imported using the resource ID of the parent Domain Service and the Replica Set ID, e.g. diff --git a/sdk/nodejs/domainservices/service.ts b/sdk/nodejs/domainservices/service.ts index 9711a23387..49273089a5 100644 --- a/sdk/nodejs/domainservices/service.ts +++ b/sdk/nodejs/domainservices/service.ts @@ -7,6 +7,127 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const deployResourceGroup = new azure.core.ResourceGroup("deployResourceGroup", {location: "West Europe"}); + * const deployVirtualNetwork = new azure.network.VirtualNetwork("deployVirtualNetwork", { + * location: deployResourceGroup.location, + * resourceGroupName: deployResourceGroup.name, + * addressSpaces: ["10.0.1.0/16"], + * }); + * const deploySubnet = new azure.network.Subnet("deploySubnet", { + * resourceGroupName: deployResourceGroup.name, + * virtualNetworkName: deployVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const deployNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("deployNetworkSecurityGroup", { + * location: deployResourceGroup.location, + * resourceGroupName: deployResourceGroup.name, + * securityRules: [ + * { + * name: "AllowSyncWithAzureAD", + * priority: 101, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "443", + * sourceAddressPrefix: "AzureActiveDirectoryDomainServices", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowRD", + * priority: 201, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "3389", + * sourceAddressPrefix: "CorpNetSaw", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowPSRemoting", + * priority: 301, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "5986", + * sourceAddressPrefix: "AzureActiveDirectoryDomainServices", + * destinationAddressPrefix: "*", + * }, + * { + * name: "AllowLDAPS", + * priority: 401, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "636", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * }, + * ], + * }); + * const deploySubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("deploySubnetNetworkSecurityGroupAssociation", { + * subnetId: deploySubnet.id, + * networkSecurityGroupId: deployNetworkSecurityGroup.id, + * }); + * const dcAdmins = new azuread.Group("dcAdmins", { + * displayName: "AAD DC Administrators", + * securityEnabled: true, + * }); + * const adminUser = new azuread.User("adminUser", { + * userPrincipalName: "dc-admin@hashicorp-example.com", + * displayName: "DC Administrator", + * password: "Pa55w0Rd!!1", + * }); + * const adminGroupMember = new azuread.GroupMember("adminGroupMember", { + * groupObjectId: dcAdmins.objectId, + * memberObjectId: adminUser.objectId, + * }); + * const exampleServicePrincipal = new azuread.ServicePrincipal("exampleServicePrincipal", {applicationId: "2565bd9d-da50-47d4-8b85-4c97f669dc36"}); + * // published app for domain services + * const aadds = new azure.core.ResourceGroup("aadds", {location: "westeurope"}); + * const exampleService = new azure.domainservices.Service("exampleService", { + * location: aadds.location, + * resourceGroupName: aadds.name, + * domainName: "widgetslogin.net", + * sku: "Enterprise", + * filteredSyncEnabled: false, + * initialReplicaSet: { + * subnetId: deploySubnet.id, + * }, + * notifications: { + * additionalRecipients: [ + * "notifyA@example.net", + * "notifyB@example.org", + * ], + * notifyDcAdmins: true, + * notifyGlobalAdmins: true, + * }, + * security: { + * syncKerberosPasswords: true, + * syncNtlmPasswords: true, + * syncOnPremPasswords: true, + * }, + * tags: { + * Environment: "prod", + * }, + * }, { + * dependsOn: [ + * exampleServicePrincipal, + * deploySubnetNetworkSecurityGroupAssociation, + * ], + * }); + * ``` + * * ## Import * * Domain Services can be imported using the resource ID, together with the Replica Set ID that you wish to designate as the initial replica set, e.g. diff --git a/sdk/nodejs/domainservices/serviceTrust.ts b/sdk/nodejs/domainservices/serviceTrust.ts index 9fbfb07ac9..4582eb4b08 100644 --- a/sdk/nodejs/domainservices/serviceTrust.ts +++ b/sdk/nodejs/domainservices/serviceTrust.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Active Directory Domain Service Trust. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleService = azure.domainservices.getService({ + * name: "example-ds", + * resourceGroupName: "example-rg", + * }); + * const exampleServiceTrust = new azure.domainservices.ServiceTrust("exampleServiceTrust", { + * domainServiceId: exampleService.then(exampleService => exampleService.id), + * trustedDomainFqdn: "example.com", + * trustedDomainDnsIps: [ + * "10.1.0.3", + * "10.1.0.4", + * ], + * password: "Password123", + * }); + * ``` + * * ## Import * * Active Directory Domain Service Trusts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/elasticcloud/elasticsearch.ts b/sdk/nodejs/elasticcloud/elasticsearch.ts index b11e62e7df..6e56efd8ea 100644 --- a/sdk/nodejs/elasticcloud/elasticsearch.ts +++ b/sdk/nodejs/elasticcloud/elasticsearch.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; /** * Manages an Elasticsearch in Elastic Cloud. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const testResourceGroup = new azure.core.ResourceGroup("testResourceGroup", {location: "West Europe"}); + * const testElasticsearch = new azure.elasticcloud.Elasticsearch("testElasticsearch", { + * resourceGroupName: testResourceGroup.name, + * location: testResourceGroup.location, + * skuName: "ess-monthly-consumption_Monthly", + * elasticCloudEmailAddress: "user@example.com", + * }); + * ``` + * * ## Import * * Elasticsearch's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/elasticcloud/getElasticsearch.ts b/sdk/nodejs/elasticcloud/getElasticsearch.ts index b8ea5acf79..65df1557f3 100644 --- a/sdk/nodejs/elasticcloud/getElasticsearch.ts +++ b/sdk/nodejs/elasticcloud/getElasticsearch.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Elasticsearch resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.elasticcloud.getElasticsearch({ + * name: "my-elastic-search", + * resourceGroupName: "example-resources", + * }); + * export const elasticsearchEndpoint = example.then(example => example.elasticsearchServiceUrl); + * export const kibanaEndpoint = example.then(example => example.kibanaServiceUrl); + * ``` */ export function getElasticsearch(args: GetElasticsearchArgs, opts?: pulumi.InvokeOptions): Promise { @@ -101,6 +115,20 @@ export interface GetElasticsearchResult { } /** * Use this data source to access information about an existing Elasticsearch resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.elasticcloud.getElasticsearch({ + * name: "my-elastic-search", + * resourceGroupName: "example-resources", + * }); + * export const elasticsearchEndpoint = example.then(example => example.elasticsearchServiceUrl); + * export const kibanaEndpoint = example.then(example => example.kibanaServiceUrl); + * ``` */ export function getElasticsearchOutput(args: GetElasticsearchOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getElasticsearch(a, opts)) diff --git a/sdk/nodejs/eventgrid/domain.ts b/sdk/nodejs/eventgrid/domain.ts index 6153f1d5ef..398f5d00a7 100644 --- a/sdk/nodejs/eventgrid/domain.ts +++ b/sdk/nodejs/eventgrid/domain.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; /** * Manages an EventGrid Domain * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDomain = new azure.eventgrid.Domain("exampleDomain", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventgrid/domainTopic.ts b/sdk/nodejs/eventgrid/domainTopic.ts index c56d293f28..7b0bf7ccd6 100644 --- a/sdk/nodejs/eventgrid/domainTopic.ts +++ b/sdk/nodejs/eventgrid/domainTopic.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages an EventGrid Domain Topic * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDomain = new azure.eventgrid.Domain("exampleDomain", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleDomainTopic = new azure.eventgrid.DomainTopic("exampleDomainTopic", { + * domainName: exampleDomain.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * EventGrid Domain Topics can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventgrid/eventSubscription.ts b/sdk/nodejs/eventgrid/eventSubscription.ts index 99e68e4e45..196ca767e8 100644 --- a/sdk/nodejs/eventgrid/eventSubscription.ts +++ b/sdk/nodejs/eventgrid/eventSubscription.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages an EventGrid Event Subscription * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleQueue = new azure.storage.Queue("exampleQueue", {storageAccountName: exampleAccount.name}); + * const exampleEventSubscription = new azure.eventgrid.EventSubscription("exampleEventSubscription", { + * scope: exampleResourceGroup.id, + * storageQueueEndpoint: { + * storageAccountId: exampleAccount.id, + * queueName: exampleQueue.name, + * }, + * }); + * ``` + * * ## Import * * EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventgrid/getDomain.ts b/sdk/nodejs/eventgrid/getDomain.ts index 4a6aee799a..487c1cdaf6 100644 --- a/sdk/nodejs/eventgrid/getDomain.ts +++ b/sdk/nodejs/eventgrid/getDomain.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventGrid Domain + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getDomain({ + * name: "my-eventgrid-domain", + * resourceGroupName: "example-resources", + * }); + * export const eventgridDomainMappingTopic = example.then(example => example.inputMappingFields?.[0]?.topic); + * ``` */ export function getDomain(args: GetDomainArgs, opts?: pulumi.InvokeOptions): Promise { @@ -89,6 +102,19 @@ export interface GetDomainResult { } /** * Use this data source to access information about an existing EventGrid Domain + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getDomain({ + * name: "my-eventgrid-domain", + * resourceGroupName: "example-resources", + * }); + * export const eventgridDomainMappingTopic = example.then(example => example.inputMappingFields?.[0]?.topic); + * ``` */ export function getDomainOutput(args: GetDomainOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDomain(a, opts)) diff --git a/sdk/nodejs/eventgrid/getDomainTopic.ts b/sdk/nodejs/eventgrid/getDomainTopic.ts index 4baa1ab075..6e8a1ef9af 100644 --- a/sdk/nodejs/eventgrid/getDomainTopic.ts +++ b/sdk/nodejs/eventgrid/getDomainTopic.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventGrid Domain Topic + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getDomainTopic({ + * name: "my-eventgrid-domain-topic", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getDomainTopic(args: GetDomainTopicArgs, opts?: pulumi.InvokeOptions): Promise { @@ -52,6 +64,18 @@ export interface GetDomainTopicResult { } /** * Use this data source to access information about an existing EventGrid Domain Topic + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getDomainTopic({ + * name: "my-eventgrid-domain-topic", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getDomainTopicOutput(args: GetDomainTopicOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDomainTopic(a, opts)) diff --git a/sdk/nodejs/eventgrid/getSystemTopic.ts b/sdk/nodejs/eventgrid/getSystemTopic.ts index 356eddd787..261adf413d 100644 --- a/sdk/nodejs/eventgrid/getSystemTopic.ts +++ b/sdk/nodejs/eventgrid/getSystemTopic.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventGrid System Topic + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getSystemTopic({ + * name: "eventgrid-system-topic", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSystemTopic(args: GetSystemTopicArgs, opts?: pulumi.InvokeOptions): Promise { @@ -66,6 +78,18 @@ export interface GetSystemTopicResult { } /** * Use this data source to access information about an existing EventGrid System Topic + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getSystemTopic({ + * name: "eventgrid-system-topic", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getSystemTopicOutput(args: GetSystemTopicOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSystemTopic(a, opts)) diff --git a/sdk/nodejs/eventgrid/getTopic.ts b/sdk/nodejs/eventgrid/getTopic.ts index 02f13f3cea..3667a8947c 100644 --- a/sdk/nodejs/eventgrid/getTopic.ts +++ b/sdk/nodejs/eventgrid/getTopic.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventGrid Topic + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getTopic({ + * name: "my-eventgrid-topic", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getTopic(args: GetTopicArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +69,18 @@ export interface GetTopicResult { } /** * Use this data source to access information about an existing EventGrid Topic + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventgrid.getTopic({ + * name: "my-eventgrid-topic", + * resourceGroupName: "example-resources", + * }); + * ``` */ export function getTopicOutput(args: GetTopicOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTopic(a, opts)) diff --git a/sdk/nodejs/eventgrid/systemTopic.ts b/sdk/nodejs/eventgrid/systemTopic.ts index cc2c1fb3bc..2c0c886f46 100644 --- a/sdk/nodejs/eventgrid/systemTopic.ts +++ b/sdk/nodejs/eventgrid/systemTopic.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages an Event Grid System Topic. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleSystemTopic = new azure.eventgrid.SystemTopic("exampleSystemTopic", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sourceArmResourceId: exampleAccount.id, + * topicType: "Microsoft.Storage.StorageAccounts", + * }); + * ``` + * * ## Import * * Event Grid System Topic can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventgrid/systemTopicEventSubscription.ts b/sdk/nodejs/eventgrid/systemTopicEventSubscription.ts index b4b4f6a0ee..8a33c3a82b 100644 --- a/sdk/nodejs/eventgrid/systemTopicEventSubscription.ts +++ b/sdk/nodejs/eventgrid/systemTopicEventSubscription.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages an EventGrid System Topic Event Subscription. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleQueue = new azure.storage.Queue("exampleQueue", {storageAccountName: exampleAccount.name}); + * const exampleSystemTopic = new azure.eventgrid.SystemTopic("exampleSystemTopic", { + * location: "Global", + * resourceGroupName: exampleResourceGroup.name, + * sourceArmResourceId: exampleResourceGroup.id, + * topicType: "Microsoft.Resources.ResourceGroups", + * }); + * const exampleSystemTopicEventSubscription = new azure.eventgrid.SystemTopicEventSubscription("exampleSystemTopicEventSubscription", { + * systemTopic: exampleSystemTopic.name, + * resourceGroupName: exampleResourceGroup.name, + * storageQueueEndpoint: { + * storageAccountId: exampleAccount.id, + * queueName: exampleQueue.name, + * }, + * }); + * ``` + * * ## Import * * EventGrid System Topic Event Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventgrid/topic.ts b/sdk/nodejs/eventgrid/topic.ts index 37da89e40b..ccc44c1abd 100644 --- a/sdk/nodejs/eventgrid/topic.ts +++ b/sdk/nodejs/eventgrid/topic.ts @@ -11,6 +11,22 @@ import * as utilities from "../utilities"; * * > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTopic = new azure.eventgrid.Topic("exampleTopic", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/authorizationRule.ts b/sdk/nodejs/eventhub/authorizationRule.ts index f8bfbad79a..55a0bb92d0 100644 --- a/sdk/nodejs/eventhub/authorizationRule.ts +++ b/sdk/nodejs/eventhub/authorizationRule.ts @@ -7,6 +7,38 @@ import * as utilities from "../utilities"; /** * Manages a Event Hubs authorization Rule within an Event Hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Basic", + * capacity: 2, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 2, + * }); + * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * listen: true, + * send: false, + * manage: false, + * }); + * ``` + * * ## Import * * EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/cluster.ts b/sdk/nodejs/eventhub/cluster.ts index 0fabb611d3..7ab7817589 100644 --- a/sdk/nodejs/eventhub/cluster.ts +++ b/sdk/nodejs/eventhub/cluster.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manages an EventHub Cluster * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const test = new azure.eventhub.Cluster("test", { + * resourceGroupName: example.name, + * location: example.location, + * skuName: "Dedicated_1", + * }); + * ``` + * * ## Import * * EventHub Cluster's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/consumerGroup.ts b/sdk/nodejs/eventhub/consumerGroup.ts index 9ff8352a17..38347e9348 100644 --- a/sdk/nodejs/eventhub/consumerGroup.ts +++ b/sdk/nodejs/eventhub/consumerGroup.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Basic", + * capacity: 2, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 2, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * userMetadata: "some-meta-data", + * }); + * ``` + * * ## Import * * EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/domain.ts b/sdk/nodejs/eventhub/domain.ts index d11fa76744..80bb122df2 100644 --- a/sdk/nodejs/eventhub/domain.ts +++ b/sdk/nodejs/eventhub/domain.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; /** * Manages an EventGrid Domain * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDomain = new azure.eventgrid.Domain("exampleDomain", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventGridTopic.ts b/sdk/nodejs/eventhub/eventGridTopic.ts index 601e022a9c..2b6658ace6 100644 --- a/sdk/nodejs/eventhub/eventGridTopic.ts +++ b/sdk/nodejs/eventhub/eventGridTopic.ts @@ -11,6 +11,22 @@ import * as utilities from "../utilities"; * * > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTopic = new azure.eventgrid.Topic("exampleTopic", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventHub.ts b/sdk/nodejs/eventhub/eventHub.ts index 40ef61379b..e663dca03c 100644 --- a/sdk/nodejs/eventhub/eventHub.ts +++ b/sdk/nodejs/eventhub/eventHub.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a Event Hubs as a nested resource within a Event Hubs namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 1, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * ``` + * * ## Import * * EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventHubAuthorizationRule.ts b/sdk/nodejs/eventhub/eventHubAuthorizationRule.ts index 81b995e78a..45e19d38d1 100644 --- a/sdk/nodejs/eventhub/eventHubAuthorizationRule.ts +++ b/sdk/nodejs/eventhub/eventHubAuthorizationRule.ts @@ -7,6 +7,38 @@ import * as utilities from "../utilities"; /** * Manages a Event Hubs authorization Rule within an Event Hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Basic", + * capacity: 2, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 2, + * }); + * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * listen: true, + * send: false, + * manage: false, + * }); + * ``` + * * ## Import * * EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventHubConsumerGroup.ts b/sdk/nodejs/eventhub/eventHubConsumerGroup.ts index 761f5c0bdb..4b761b0318 100644 --- a/sdk/nodejs/eventhub/eventHubConsumerGroup.ts +++ b/sdk/nodejs/eventhub/eventHubConsumerGroup.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Basic", + * capacity: 2, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 2, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * userMetadata: "some-meta-data", + * }); + * ``` + * * ## Import * * EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventHubNamespace.ts b/sdk/nodejs/eventhub/eventHubNamespace.ts index 9ee3f503e2..df7b8a8630 100644 --- a/sdk/nodejs/eventhub/eventHubNamespace.ts +++ b/sdk/nodejs/eventhub/eventHubNamespace.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages an EventHub Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 2, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * EventHub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventHubNamespaceAuthorizationRule.ts b/sdk/nodejs/eventhub/eventHubNamespaceAuthorizationRule.ts index 8b76f125f5..50c1c84728 100644 --- a/sdk/nodejs/eventhub/eventHubNamespaceAuthorizationRule.ts +++ b/sdk/nodejs/eventhub/eventHubNamespaceAuthorizationRule.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages an Authorization Rule for an Event Hub Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Basic", + * capacity: 2, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleEventHubNamespaceAuthorizationRule = new azure.eventhub.EventHubNamespaceAuthorizationRule("exampleEventHubNamespaceAuthorizationRule", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * listen: true, + * send: false, + * manage: false, + * }); + * ``` + * * ## Import * * EventHub Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventSubscription.ts b/sdk/nodejs/eventhub/eventSubscription.ts index 8ae3f5be40..c209aa2f97 100644 --- a/sdk/nodejs/eventhub/eventSubscription.ts +++ b/sdk/nodejs/eventhub/eventSubscription.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages an EventGrid Event Subscription * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleQueue = new azure.storage.Queue("exampleQueue", {storageAccountName: exampleAccount.name}); + * const exampleEventSubscription = new azure.eventgrid.EventSubscription("exampleEventSubscription", { + * scope: exampleResourceGroup.id, + * storageQueueEndpoint: { + * storageAccountId: exampleAccount.id, + * queueName: exampleQueue.name, + * }, + * }); + * ``` + * * ## Import * * EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/eventhubNamespaceDisasterRecoveryConfig.ts b/sdk/nodejs/eventhub/eventhubNamespaceDisasterRecoveryConfig.ts index 3430ced619..d914cedf50 100644 --- a/sdk/nodejs/eventhub/eventhubNamespaceDisasterRecoveryConfig.ts +++ b/sdk/nodejs/eventhub/eventhubNamespaceDisasterRecoveryConfig.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages an Disaster Recovery Config for an Event Hub Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const primary = new azure.eventhub.EventHubNamespace("primary", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const secondary = new azure.eventhub.EventHubNamespace("secondary", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleEventhubNamespaceDisasterRecoveryConfig = new azure.eventhub.EventhubNamespaceDisasterRecoveryConfig("exampleEventhubNamespaceDisasterRecoveryConfig", { + * resourceGroupName: exampleResourceGroup.name, + * namespaceName: primary.name, + * partnerNamespaceId: secondary.id, + * }); + * ``` + * * ## Import * * EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/getAuthorizationRule.ts b/sdk/nodejs/eventhub/getAuthorizationRule.ts index fe74250fbb..fa47d571b7 100644 --- a/sdk/nodejs/eventhub/getAuthorizationRule.ts +++ b/sdk/nodejs/eventhub/getAuthorizationRule.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.eventhub.getAuthorizationRule({ + * name: "test", + * namespaceName: azurerm_eventhub_namespace.test.name, + * eventhubName: azurerm_eventhub.test.name, + * resourceGroupName: azurerm_resource_group.test.name, + * }); + * ``` */ export function getAuthorizationRule(args: GetAuthorizationRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -88,6 +102,20 @@ export interface GetAuthorizationRuleResult { } /** * Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.eventhub.getAuthorizationRule({ + * name: "test", + * namespaceName: azurerm_eventhub_namespace.test.name, + * eventhubName: azurerm_eventhub.test.name, + * resourceGroupName: azurerm_resource_group.test.name, + * }); + * ``` */ export function getAuthorizationRuleOutput(args: GetAuthorizationRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAuthorizationRule(a, opts)) diff --git a/sdk/nodejs/eventhub/getCluster.ts b/sdk/nodejs/eventhub/getCluster.ts index d3c8780d63..c7dfe22ba9 100644 --- a/sdk/nodejs/eventhub/getCluster.ts +++ b/sdk/nodejs/eventhub/getCluster.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventHub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getCluster({ + * name: "search-eventhub", + * resourceGroupName: "search-service", + * }); + * export const eventhubId = example.then(example => example.id); + * ``` */ export function getCluster(args: GetClusterArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +64,19 @@ export interface GetClusterResult { } /** * Use this data source to access information about an existing EventHub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getCluster({ + * name: "search-eventhub", + * resourceGroupName: "search-service", + * }); + * export const eventhubId = example.then(example => example.id); + * ``` */ export function getClusterOutput(args: GetClusterOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCluster(a, opts)) diff --git a/sdk/nodejs/eventhub/getConsumeGroup.ts b/sdk/nodejs/eventhub/getConsumeGroup.ts index 62f8e51531..0d4100ce14 100644 --- a/sdk/nodejs/eventhub/getConsumeGroup.ts +++ b/sdk/nodejs/eventhub/getConsumeGroup.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Event Hubs Consumer Group within an Event Hub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.eventhub.getConsumeGroup({ + * name: azurerm_eventhub_consumer_group.test.name, + * namespaceName: azurerm_eventhub_namespace.test.name, + * eventhubName: azurerm_eventhub.test.name, + * resourceGroupName: azurerm_resource_group.test.name, + * }); + * ``` */ export function getConsumeGroup(args: GetConsumeGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +73,20 @@ export interface GetConsumeGroupResult { } /** * Use this data source to access information about an existing Event Hubs Consumer Group within an Event Hub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.eventhub.getConsumeGroup({ + * name: azurerm_eventhub_consumer_group.test.name, + * namespaceName: azurerm_eventhub_namespace.test.name, + * eventhubName: azurerm_eventhub.test.name, + * resourceGroupName: azurerm_resource_group.test.name, + * }); + * ``` */ export function getConsumeGroupOutput(args: GetConsumeGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getConsumeGroup(a, opts)) diff --git a/sdk/nodejs/eventhub/getEventHub.ts b/sdk/nodejs/eventhub/getEventHub.ts index 560649a08e..d21dfe2511 100644 --- a/sdk/nodejs/eventhub/getEventHub.ts +++ b/sdk/nodejs/eventhub/getEventHub.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventHub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getEventHub({ + * name: "search-eventhub", + * resourceGroupName: "search-service", + * namespaceName: "search-eventhubns", + * }); + * export const eventhubId = example.then(example => example.id); + * ``` */ export function getEventHub(args: GetEventHubArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +71,20 @@ export interface GetEventHubResult { } /** * Use this data source to access information about an existing EventHub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getEventHub({ + * name: "search-eventhub", + * resourceGroupName: "search-service", + * namespaceName: "search-eventhubns", + * }); + * export const eventhubId = example.then(example => example.id); + * ``` */ export function getEventHubOutput(args: GetEventHubOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEventHub(a, opts)) diff --git a/sdk/nodejs/eventhub/getEventhubNamespace.ts b/sdk/nodejs/eventhub/getEventhubNamespace.ts index 08c8c7ad6b..b31ee6f39f 100644 --- a/sdk/nodejs/eventhub/getEventhubNamespace.ts +++ b/sdk/nodejs/eventhub/getEventhubNamespace.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventHub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getNamespace({ + * name: "search-eventhubns", + * resourceGroupName: "search-service", + * }); + * export const eventhubNamespaceId = example.then(example => example.id); + * ``` */ /** @deprecated azure.eventhub.getEventhubNamespace has been deprecated in favor of azure.eventhub.getNamespace */ export function getEventhubNamespace(args: GetEventhubNamespaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -106,6 +119,19 @@ export interface GetEventhubNamespaceResult { } /** * Use this data source to access information about an existing EventHub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getNamespace({ + * name: "search-eventhubns", + * resourceGroupName: "search-service", + * }); + * export const eventhubNamespaceId = example.then(example => example.id); + * ``` */ /** @deprecated azure.eventhub.getEventhubNamespace has been deprecated in favor of azure.eventhub.getNamespace */ export function getEventhubNamespaceOutput(args: GetEventhubNamespaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { diff --git a/sdk/nodejs/eventhub/getNamespace.ts b/sdk/nodejs/eventhub/getNamespace.ts index 58248cbbe3..9e666dd75b 100644 --- a/sdk/nodejs/eventhub/getNamespace.ts +++ b/sdk/nodejs/eventhub/getNamespace.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing EventHub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getNamespace({ + * name: "search-eventhubns", + * resourceGroupName: "search-service", + * }); + * export const eventhubNamespaceId = example.then(example => example.id); + * ``` */ export function getNamespace(args: GetNamespaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -104,6 +117,19 @@ export interface GetNamespaceResult { } /** * Use this data source to access information about an existing EventHub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getNamespace({ + * name: "search-eventhubns", + * resourceGroupName: "search-service", + * }); + * export const eventhubNamespaceId = example.then(example => example.id); + * ``` */ export function getNamespaceOutput(args: GetNamespaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNamespace(a, opts)) diff --git a/sdk/nodejs/eventhub/getNamespaceAuthorizationRule.ts b/sdk/nodejs/eventhub/getNamespaceAuthorizationRule.ts index eab973e3e3..6421f0fa10 100644 --- a/sdk/nodejs/eventhub/getNamespaceAuthorizationRule.ts +++ b/sdk/nodejs/eventhub/getNamespaceAuthorizationRule.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an Authorization Rule for an Event Hub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getNamespaceAuthorizationRule({ + * name: "navi", + * resourceGroupName: "example-resources", + * namespaceName: "example-ns", + * }); + * export const eventhubAuthorizationRuleId = data.azurem_eventhub_namespace_authorization_rule.example.id; + * ``` */ export function getNamespaceAuthorizationRule(args: GetNamespaceAuthorizationRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -85,6 +99,20 @@ export interface GetNamespaceAuthorizationRuleResult { } /** * Use this data source to access information about an Authorization Rule for an Event Hub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.eventhub.getNamespaceAuthorizationRule({ + * name: "navi", + * resourceGroupName: "example-resources", + * namespaceName: "example-ns", + * }); + * export const eventhubAuthorizationRuleId = data.azurem_eventhub_namespace_authorization_rule.example.id; + * ``` */ export function getNamespaceAuthorizationRuleOutput(args: GetNamespaceAuthorizationRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNamespaceAuthorizationRule(a, opts)) diff --git a/sdk/nodejs/eventhub/getServiceBusNamespace.ts b/sdk/nodejs/eventhub/getServiceBusNamespace.ts index bdeb8befa6..b2930741d5 100644 --- a/sdk/nodejs/eventhub/getServiceBusNamespace.ts +++ b/sdk/nodejs/eventhub/getServiceBusNamespace.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing ServiceBus Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getNamespace({ + * name: "examplenamespace", + * resourceGroupName: "example-resources", + * }); + * export const location = example.then(example => example.location); + * ``` */ /** @deprecated azure.eventhub.getServiceBusNamespace has been deprecated in favor of azure.servicebus.getNamespace */ export function getServiceBusNamespace(args: GetServiceBusNamespaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -87,6 +100,19 @@ export interface GetServiceBusNamespaceResult { } /** * Use this data source to access information about an existing ServiceBus Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getNamespace({ + * name: "examplenamespace", + * resourceGroupName: "example-resources", + * }); + * export const location = example.then(example => example.location); + * ``` */ /** @deprecated azure.eventhub.getServiceBusNamespace has been deprecated in favor of azure.servicebus.getNamespace */ export function getServiceBusNamespaceOutput(args: GetServiceBusNamespaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { diff --git a/sdk/nodejs/eventhub/namespace.ts b/sdk/nodejs/eventhub/namespace.ts index ffdb1f2b78..dd7451602e 100644 --- a/sdk/nodejs/eventhub/namespace.ts +++ b/sdk/nodejs/eventhub/namespace.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * ``` + * * ## Import * * Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/namespaceAuthorizationRule.ts b/sdk/nodejs/eventhub/namespaceAuthorizationRule.ts index c32a076e62..d3ac23a899 100644 --- a/sdk/nodejs/eventhub/namespaceAuthorizationRule.ts +++ b/sdk/nodejs/eventhub/namespaceAuthorizationRule.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Namespace authorization Rule within a ServiceBus. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleNamespaceAuthorizationRule = new azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", { + * namespaceId: exampleNamespace.id, + * listen: true, + * send: true, + * manage: false, + * }); + * ``` + * * ## Import * * ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/namespaceCustomerManagedKey.ts b/sdk/nodejs/eventhub/namespaceCustomerManagedKey.ts index fbbf60e4d5..53404b03a1 100644 --- a/sdk/nodejs/eventhub/namespaceCustomerManagedKey.ts +++ b/sdk/nodejs/eventhub/namespaceCustomerManagedKey.ts @@ -9,6 +9,83 @@ import * as utilities from "../utilities"; * * !> **Note:** In 2.x versions of the Azure Provider during deletion this resource will **delete and recreate the parent EventHub Namespace which may involve data loss** as it's not possible to remove the Customer Managed Key from the EventHub Namespace once it's been added. Version 3.0 of the Azure Provider will change this so that the Delete operation is a noop, requiring the parent EventHub Namespace is deleted/recreated to remove the Customer Managed Key. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.eventhub.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "Dedicated_1", + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * dedicatedClusterId: exampleCluster.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const current = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("exampleAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: exampleEventHubNamespace.identity.apply(identity => identity?.tenantId), + * objectId: exampleEventHubNamespace.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "UnwrapKey", + * "WrapKey", + * ], + * }); + * const example2 = new azure.keyvault.AccessPolicy("example2", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Delete", + * "Get", + * "List", + * "Purge", + * "Recover", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * exampleAccessPolicy, + * example2, + * ], + * }); + * const exampleNamespaceCustomerManagedKey = new azure.eventhub.NamespaceCustomerManagedKey("exampleNamespaceCustomerManagedKey", { + * eventhubNamespaceId: exampleEventHubNamespace.id, + * keyVaultKeyIds: [exampleKey.id], + * }); + * ``` + * * ## Import * * Customer Managed Keys for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/namespaceSchemaGroup.ts b/sdk/nodejs/eventhub/namespaceSchemaGroup.ts index c52bd61090..8551f987e2 100644 --- a/sdk/nodejs/eventhub/namespaceSchemaGroup.ts +++ b/sdk/nodejs/eventhub/namespaceSchemaGroup.ts @@ -5,6 +5,25 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "East US"}); + * const testEventHubNamespace = new azure.eventhub.EventHubNamespace("testEventHubNamespace", { + * location: azurerm_resource_group.test.location, + * resourceGroupName: azurerm_resource_group.test.name, + * sku: "Standard", + * }); + * const testNamespaceSchemaGroup = new azure.eventhub.NamespaceSchemaGroup("testNamespaceSchemaGroup", { + * namespaceId: testEventHubNamespace.id, + * schemaCompatibility: "Forward", + * schemaType: "Avro", + * }); + * ``` + * * ## Import * * Schema Group for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/queue.ts b/sdk/nodejs/eventhub/queue.ts index b134198778..49e4fbf309 100644 --- a/sdk/nodejs/eventhub/queue.ts +++ b/sdk/nodejs/eventhub/queue.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Queue. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleQueue = new azure.servicebus.Queue("exampleQueue", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * ``` + * * ## Import * * Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/queueAuthorizationRule.ts b/sdk/nodejs/eventhub/queueAuthorizationRule.ts index 481a017ea6..9cbd6c2034 100644 --- a/sdk/nodejs/eventhub/queueAuthorizationRule.ts +++ b/sdk/nodejs/eventhub/queueAuthorizationRule.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages an Authorization Rule for a ServiceBus Queue. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleQueue = new azure.servicebus.Queue("exampleQueue", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleQueueAuthorizationRule = new azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", { + * queueId: exampleQueue.id, + * listen: true, + * send: true, + * manage: false, + * }); + * ``` + * * ## Import * * ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/subscription.ts b/sdk/nodejs/eventhub/subscription.ts index e100062b08..c1f27aca6e 100644 --- a/sdk/nodejs/eventhub/subscription.ts +++ b/sdk/nodejs/eventhub/subscription.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Subscription. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleSubscription = new azure.servicebus.Subscription("exampleSubscription", { + * topicId: exampleTopic.id, + * maxDeliveryCount: 1, + * }); + * ``` + * * ## Import * * Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/subscriptionRule.ts b/sdk/nodejs/eventhub/subscriptionRule.ts index 0d16a2bb72..fddedb59ef 100644 --- a/sdk/nodejs/eventhub/subscriptionRule.ts +++ b/sdk/nodejs/eventhub/subscriptionRule.ts @@ -10,6 +10,70 @@ import * as utilities from "../utilities"; * Manages a ServiceBus Subscription Rule. * * ## Example Usage + * ### SQL Filter) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleSubscription = new azure.servicebus.Subscription("exampleSubscription", { + * topicId: exampleTopic.id, + * maxDeliveryCount: 1, + * }); + * const exampleSubscriptionRule = new azure.servicebus.SubscriptionRule("exampleSubscriptionRule", { + * subscriptionId: exampleSubscription.id, + * filterType: "SqlFilter", + * sqlFilter: "colour = 'red'", + * }); + * ``` + * ### Correlation Filter) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleSubscription = new azure.servicebus.Subscription("exampleSubscription", { + * topicId: exampleTopic.id, + * maxDeliveryCount: 1, + * }); + * const exampleSubscriptionRule = new azure.servicebus.SubscriptionRule("exampleSubscriptionRule", { + * subscriptionId: exampleSubscription.id, + * filterType: "CorrelationFilter", + * correlationFilter: { + * correlationId: "high", + * label: "red", + * properties: { + * customProperty: "value", + * }, + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/eventhub/topic.ts b/sdk/nodejs/eventhub/topic.ts index 9819df2ce0..6b1c2b1801 100644 --- a/sdk/nodejs/eventhub/topic.ts +++ b/sdk/nodejs/eventhub/topic.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; * * **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * ``` + * * ## Import * * Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/eventhub/topicAuthorizationRule.ts b/sdk/nodejs/eventhub/topicAuthorizationRule.ts index 97bb82d2bb..54bf549e9f 100644 --- a/sdk/nodejs/eventhub/topicAuthorizationRule.ts +++ b/sdk/nodejs/eventhub/topicAuthorizationRule.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", {namespaceId: exampleNamespace.id}); + * const exampleTopicAuthorizationRule = new azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", { + * topicId: exampleTopic.id, + * listen: true, + * send: false, + * manage: false, + * }); + * ``` + * * ## Import * * ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/fluidrelay/server.ts b/sdk/nodejs/fluidrelay/server.ts index 0b0735f3a0..561e38358c 100644 --- a/sdk/nodejs/fluidrelay/server.ts +++ b/sdk/nodejs/fluidrelay/server.ts @@ -9,6 +9,19 @@ import * as utilities from "../utilities"; /** * Manages a Fluid Relay Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.fluidrelay.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Fluid Relay Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/frontdoor/firewallPolicy.ts b/sdk/nodejs/frontdoor/firewallPolicy.ts index b0ad46b150..256169021b 100644 --- a/sdk/nodejs/frontdoor/firewallPolicy.ts +++ b/sdk/nodejs/frontdoor/firewallPolicy.ts @@ -7,6 +7,113 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFirewallPolicy = new azure.frontdoor.FirewallPolicy("exampleFirewallPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * enabled: true, + * mode: "Prevention", + * redirectUrl: "https://www.contoso.com", + * customBlockResponseStatusCode: 403, + * customBlockResponseBody: "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + * customRules: [ + * { + * name: "Rule1", + * enabled: true, + * priority: 1, + * rateLimitDurationInMinutes: 1, + * rateLimitThreshold: 10, + * type: "MatchRule", + * action: "Block", + * matchConditions: [{ + * matchVariable: "RemoteAddr", + * operator: "IPMatch", + * negationCondition: false, + * matchValues: [ + * "192.168.1.0/24", + * "10.0.0.0/24", + * ], + * }], + * }, + * { + * name: "Rule2", + * enabled: true, + * priority: 2, + * rateLimitDurationInMinutes: 1, + * rateLimitThreshold: 10, + * type: "MatchRule", + * action: "Block", + * matchConditions: [ + * { + * matchVariable: "RemoteAddr", + * operator: "IPMatch", + * negationCondition: false, + * matchValues: ["192.168.1.0/24"], + * }, + * { + * matchVariable: "RequestHeader", + * selector: "UserAgent", + * operator: "Contains", + * negationCondition: false, + * matchValues: ["windows"], + * transforms: [ + * "Lowercase", + * "Trim", + * ], + * }, + * ], + * }, + * ], + * managedRules: [ + * { + * type: "DefaultRuleSet", + * version: "1.0", + * exclusions: [{ + * matchVariable: "QueryStringArgNames", + * operator: "Equals", + * selector: "not_suspicious", + * }], + * overrides: [ + * { + * ruleGroupName: "PHP", + * rules: [{ + * ruleId: "933100", + * enabled: false, + * action: "Block", + * }], + * }, + * { + * ruleGroupName: "SQLI", + * exclusions: [{ + * matchVariable: "QueryStringArgNames", + * operator: "Equals", + * selector: "really_not_suspicious", + * }], + * rules: [{ + * ruleId: "942200", + * action: "Block", + * exclusions: [{ + * matchVariable: "QueryStringArgNames", + * operator: "Equals", + * selector: "innocent", + * }], + * }], + * }, + * ], + * }, + * { + * type: "Microsoft_BotManagerRuleSet", + * version: "1.0", + * }, + * ], + * }); + * ``` + * * ## Import * * FrontDoor Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/frontdoor/frontdoor.ts b/sdk/nodejs/frontdoor/frontdoor.ts index 61e498ca36..1ec273ee34 100644 --- a/sdk/nodejs/frontdoor/frontdoor.ts +++ b/sdk/nodejs/frontdoor/frontdoor.ts @@ -19,6 +19,52 @@ import * as utilities from "../utilities"; * * Use Front Door to improve application performance with SSL offload and routing requests to the fastest available application backend. * * Use Front Door for application layer security and DDoS protection for your application. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFrontdoor = new azure.frontdoor.Frontdoor("exampleFrontdoor", { + * resourceGroupName: exampleResourceGroup.name, + * routingRules: [{ + * name: "exampleRoutingRule1", + * acceptedProtocols: [ + * "Http", + * "Https", + * ], + * patternsToMatches: ["/*"], + * frontendEndpoints: ["exampleFrontendEndpoint1"], + * forwardingConfiguration: { + * forwardingProtocol: "MatchRequest", + * backendPoolName: "exampleBackendBing", + * }, + * }], + * backendPoolLoadBalancings: [{ + * name: "exampleLoadBalancingSettings1", + * }], + * backendPoolHealthProbes: [{ + * name: "exampleHealthProbeSetting1", + * }], + * backendPools: [{ + * name: "exampleBackendBing", + * backends: [{ + * hostHeader: "www.bing.com", + * address: "www.bing.com", + * httpPort: 80, + * httpsPort: 443, + * }], + * loadBalancingName: "exampleLoadBalancingSettings1", + * healthProbeName: "exampleHealthProbeSetting1", + * }], + * frontendEndpoints: [{ + * name: "exampleFrontendEndpoint1", + * hostName: "example-FrontDoor.azurefd.net", + * }], + * }); + * ``` + * * ## Import * * Front Doors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/frontdoor/rulesEngine.ts b/sdk/nodejs/frontdoor/rulesEngine.ts index 126f4fe9db..85fe84a7ff 100644 --- a/sdk/nodejs/frontdoor/rulesEngine.ts +++ b/sdk/nodejs/frontdoor/rulesEngine.ts @@ -11,6 +11,91 @@ import * as utilities from "../utilities"; * * Manages an Azure Front Door (classic) Rules Engine configuration and rules. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFrontdoor = new azure.frontdoor.Frontdoor("exampleFrontdoor", { + * resourceGroupName: exampleResourceGroup.name, + * backendPools: [{ + * name: "exampleBackendBing", + * loadBalancingName: "exampleLoadBalancingSettings1", + * healthProbeName: "exampleHealthProbeSetting1", + * backends: [{ + * hostHeader: "www.bing.com", + * address: "www.bing.com", + * httpPort: 80, + * httpsPort: 443, + * }], + * }], + * backendPoolHealthProbes: [{ + * name: "exampleHealthProbeSetting1", + * }], + * backendPoolLoadBalancings: [{ + * name: "exampleLoadBalancingSettings1", + * }], + * frontendEndpoints: [{ + * name: "exampleFrontendEndpoint1", + * hostName: "example-FrontDoor.azurefd.net", + * }], + * routingRules: [{ + * name: "exampleRoutingRule1", + * acceptedProtocols: [ + * "Http", + * "Https", + * ], + * patternsToMatches: ["/*"], + * frontendEndpoints: ["exampleFrontendEndpoint1"], + * }], + * }); + * const exampleRulesEngine = new azure.frontdoor.RulesEngine("exampleRulesEngine", { + * frontdoorName: exampleFrontdoor.name, + * resourceGroupName: exampleFrontdoor.resourceGroupName, + * rules: [ + * { + * name: "debuggingoutput", + * priority: 1, + * action: { + * responseHeaders: [{ + * headerActionType: "Append", + * headerName: "X-TEST-HEADER", + * value: "Append Header Rule", + * }], + * }, + * }, + * { + * name: "overwriteorigin", + * priority: 2, + * matchConditions: [{ + * variable: "RequestMethod", + * operator: "Equal", + * values: [ + * "GET", + * "POST", + * ], + * }], + * action: { + * responseHeaders: [ + * { + * headerActionType: "Overwrite", + * headerName: "Access-Control-Allow-Origin", + * value: "*", + * }, + * { + * headerActionType: "Overwrite", + * headerName: "Access-Control-Allow-Credentials", + * value: "true", + * }, + * ], + * }, + * }, + * ], + * }); + * ``` + * * ## Import * * Azure Front Door Rules Engine's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/graph/account.ts b/sdk/nodejs/graph/account.ts index 35965f66ae..40c39bdb14 100644 --- a/sdk/nodejs/graph/account.ts +++ b/sdk/nodejs/graph/account.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; * * !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.graph.ServicesAccount` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleApplication = new azuread.Application("exampleApplication", {displayName: "example-app"}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.graph.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * applicationId: exampleApplication.applicationId, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/nodejs/graph/servicesAccount.ts b/sdk/nodejs/graph/servicesAccount.ts index e606c0353f..e7e3ff75f6 100644 --- a/sdk/nodejs/graph/servicesAccount.ts +++ b/sdk/nodejs/graph/servicesAccount.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft Graph Services Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleApplication = new azuread.Application("exampleApplication", {displayName: "example-app"}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicesAccount = new azure.graph.ServicesAccount("exampleServicesAccount", { + * resourceGroupName: exampleResourceGroup.name, + * applicationId: exampleApplication.applicationId, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/nodejs/hdinsight/getCluster.ts b/sdk/nodejs/hdinsight/getCluster.ts index 60ff8d88d3..f516eae9f6 100644 --- a/sdk/nodejs/hdinsight/getCluster.ts +++ b/sdk/nodejs/hdinsight/getCluster.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing HDInsight Cluster. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.hdinsight.getCluster({ + * name: "example", + * resourceGroupName: "example-resources", + * }); + * export const httpsEndpoint = example.then(example => example.httpsEndpoint); + * ``` */ export function getCluster(args: GetClusterArgs, opts?: pulumi.InvokeOptions): Promise { @@ -93,6 +106,19 @@ export interface GetClusterResult { } /** * Use this data source to access information about an existing HDInsight Cluster. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.hdinsight.getCluster({ + * name: "example", + * resourceGroupName: "example-resources", + * }); + * export const httpsEndpoint = example.then(example => example.httpsEndpoint); + * ``` */ export function getClusterOutput(args: GetClusterOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCluster(a, opts)) diff --git a/sdk/nodejs/hdinsight/hadoopCluster.ts b/sdk/nodejs/hdinsight/hadoopCluster.ts index 074baab52a..f69747af6b 100644 --- a/sdk/nodejs/hdinsight/hadoopCluster.ts +++ b/sdk/nodejs/hdinsight/hadoopCluster.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; /** * Manages a HDInsight Hadoop Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleHadoopCluster = new azure.hdinsight.HadoopCluster("exampleHadoopCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterVersion: "3.6", + * tier: "Standard", + * componentVersion: { + * hadoop: "2.7", + * }, + * gateway: { + * username: "acctestusrgw", + * password: "PAssword123!", + * }, + * storageAccounts: [{ + * storageContainerId: exampleContainer.id, + * storageAccountKey: exampleAccount.primaryAccessKey, + * isDefault: true, + * }], + * roles: { + * headNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * workerNode: { + * vmSize: "Standard_D4_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * targetInstanceCount: 3, + * }, + * zookeeperNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * }, + * }); + * ``` + * * ## Import * * HDInsight Hadoop Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hdinsight/hbaseCluster.ts b/sdk/nodejs/hdinsight/hbaseCluster.ts index 8936dfa2df..da616ffb61 100644 --- a/sdk/nodejs/hdinsight/hbaseCluster.ts +++ b/sdk/nodejs/hdinsight/hbaseCluster.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; /** * Manages a HDInsight HBase Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleHBaseCluster = new azure.hdinsight.HBaseCluster("exampleHBaseCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterVersion: "3.6", + * tier: "Standard", + * componentVersion: { + * hbase: "1.1", + * }, + * gateway: { + * username: "acctestusrgw", + * password: "Password123!", + * }, + * storageAccounts: [{ + * storageContainerId: exampleContainer.id, + * storageAccountKey: exampleAccount.primaryAccessKey, + * isDefault: true, + * }], + * roles: { + * headNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * workerNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * targetInstanceCount: 3, + * }, + * zookeeperNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * }, + * }); + * ``` + * * ## Import * * HDInsight HBase Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hdinsight/interactiveQueryCluster.ts b/sdk/nodejs/hdinsight/interactiveQueryCluster.ts index c3b751b1b2..d7940d8002 100644 --- a/sdk/nodejs/hdinsight/interactiveQueryCluster.ts +++ b/sdk/nodejs/hdinsight/interactiveQueryCluster.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; /** * Manages a HDInsight Interactive Query Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleInteractiveQueryCluster = new azure.hdinsight.InteractiveQueryCluster("exampleInteractiveQueryCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterVersion: "3.6", + * tier: "Standard", + * componentVersion: { + * interactiveHive: "2.1", + * }, + * gateway: { + * username: "acctestusrgw", + * password: "Password!", + * }, + * storageAccounts: [{ + * storageContainerId: exampleContainer.id, + * storageAccountKey: exampleAccount.primaryAccessKey, + * isDefault: true, + * }], + * roles: { + * headNode: { + * vmSize: "Standard_D13_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * workerNode: { + * vmSize: "Standard_D14_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * targetInstanceCount: 3, + * }, + * zookeeperNode: { + * vmSize: "Standard_A4_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * }, + * }); + * ``` + * * ## Import * * HDInsight Interactive Query Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hdinsight/kafkaCluster.ts b/sdk/nodejs/hdinsight/kafkaCluster.ts index c8997c1ca3..b29cf48935 100644 --- a/sdk/nodejs/hdinsight/kafkaCluster.ts +++ b/sdk/nodejs/hdinsight/kafkaCluster.ts @@ -9,6 +9,62 @@ import * as utilities from "../utilities"; /** * Manages a HDInsight Kafka Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleKafkaCluster = new azure.hdinsight.KafkaCluster("exampleKafkaCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterVersion: "4.0", + * tier: "Standard", + * componentVersion: { + * kafka: "2.1", + * }, + * gateway: { + * username: "acctestusrgw", + * password: "Password123!", + * }, + * storageAccounts: [{ + * storageContainerId: exampleContainer.id, + * storageAccountKey: exampleAccount.primaryAccessKey, + * isDefault: true, + * }], + * roles: { + * headNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * workerNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * numberOfDisksPerNode: 3, + * targetInstanceCount: 3, + * }, + * zookeeperNode: { + * vmSize: "Standard_D3_V2", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * }, + * }); + * ``` + * * ## Import * * HDInsight Kafka Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hdinsight/sparkCluster.ts b/sdk/nodejs/hdinsight/sparkCluster.ts index 1b5cebeb0c..f15db28e3a 100644 --- a/sdk/nodejs/hdinsight/sparkCluster.ts +++ b/sdk/nodejs/hdinsight/sparkCluster.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; /** * Manages a HDInsight Spark Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleSparkCluster = new azure.hdinsight.SparkCluster("exampleSparkCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterVersion: "3.6", + * tier: "Standard", + * componentVersion: { + * spark: "2.3", + * }, + * gateway: { + * username: "acctestusrgw", + * password: "Password123!", + * }, + * storageAccounts: [{ + * storageContainerId: exampleContainer.id, + * storageAccountKey: exampleAccount.primaryAccessKey, + * isDefault: true, + * }], + * roles: { + * headNode: { + * vmSize: "Standard_A3", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * workerNode: { + * vmSize: "Standard_A3", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * targetInstanceCount: 3, + * }, + * zookeeperNode: { + * vmSize: "Medium", + * username: "acctestusrvm", + * password: "AccTestvdSC4daf986!", + * }, + * }, + * }); + * ``` + * * ## Import * * HDInsight Spark Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/healthcare/dicomService.ts b/sdk/nodejs/healthcare/dicomService.ts index 1096794a93..e9462135e3 100644 --- a/sdk/nodejs/healthcare/dicomService.ts +++ b/sdk/nodejs/healthcare/dicomService.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Healthcare DICOM Service * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const testWorkspace = new azure.healthcare.Workspace("testWorkspace", { + * resourceGroupName: "tfex-resource_group", + * location: "east us", + * }); + * const testDicomService = new azure.healthcare.DicomService("testDicomService", { + * workspaceId: testWorkspace.id, + * location: "east us", + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * environment: "None", + * }, + * }); + * ``` + * * ## Import * * Healthcare DICOM Service can be imported using the resource`id`, e.g. diff --git a/sdk/nodejs/healthcare/fhirService.ts b/sdk/nodejs/healthcare/fhirService.ts index 1a6b51e97e..bbc0641878 100644 --- a/sdk/nodejs/healthcare/fhirService.ts +++ b/sdk/nodejs/healthcare/fhirService.ts @@ -9,6 +9,50 @@ import * as utilities from "../utilities"; /** * Manages a Healthcare FHIR (Fast Healthcare Interoperability Resources) Service * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getClientConfig({}); + * const exampleWorkspace = new azure.healthcare.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFhirService = new azure.healthcare.FhirService("exampleFhirService", { + * location: "east us", + * resourceGroupName: "tfex-resource_group", + * workspaceId: exampleWorkspace.id, + * kind: "fhir-R4", + * authentication: { + * authority: "https://login.microsoftonline.com/tenantId", + * audience: "https://tfexfhir.fhir.azurehealthcareapis.com", + * }, + * accessPolicyObjectIds: [current.then(current => current.objectId)], + * identity: { + * type: "SystemAssigned", + * }, + * containerRegistryLoginServerUrls: ["tfex-container_registry_login_server"], + * cors: { + * allowedOrigins: [ + * "https://tfex.com:123", + * "https://tfex1.com:3389", + * ], + * allowedHeaders: ["*"], + * allowedMethods: [ + * "GET", + * "DELETE", + * "PUT", + * ], + * maxAgeInSeconds: 3600, + * credentialsAllowed: true, + * }, + * configurationExportStorageAccountName: "storage_account_name", + * }); + * ``` + * * ## Import * * Healthcare FHIR Service can be imported using the resource`id`, e.g. diff --git a/sdk/nodejs/healthcare/getDicomService.ts b/sdk/nodejs/healthcare/getDicomService.ts index bb38fed032..44e4bc5809 100644 --- a/sdk/nodejs/healthcare/getDicomService.ts +++ b/sdk/nodejs/healthcare/getDicomService.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Healthcare DICOM Service + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getDicomService({ + * name: "example-healthcare_dicom_service", + * workspaceId: data.azurerm_healthcare_workspace.example.id, + * }); + * export const azurermHealthcareDicomService = example.then(example => example.id); + * ``` */ export function getDicomService(args: GetDicomServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +76,19 @@ export interface GetDicomServiceResult { } /** * Use this data source to access information about an existing Healthcare DICOM Service + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getDicomService({ + * name: "example-healthcare_dicom_service", + * workspaceId: data.azurerm_healthcare_workspace.example.id, + * }); + * export const azurermHealthcareDicomService = example.then(example => example.id); + * ``` */ export function getDicomServiceOutput(args: GetDicomServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDicomService(a, opts)) diff --git a/sdk/nodejs/healthcare/getMedtechService.ts b/sdk/nodejs/healthcare/getMedtechService.ts index f0d2a9ed6b..f393f9ff17 100644 --- a/sdk/nodejs/healthcare/getMedtechService.ts +++ b/sdk/nodejs/healthcare/getMedtechService.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Healthcare Med Tech Service + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getMedtechService({ + * name: "tfexmedtech", + * workspaceId: "tfexwks", + * }); + * export const azurermHealthcareMedtechServiceId = example.then(example => example.id); + * ``` */ export function getMedtechService(args: GetMedtechServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetMedtechServiceResult { } /** * Use this data source to access information about an existing Healthcare Med Tech Service + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getMedtechService({ + * name: "tfexmedtech", + * workspaceId: "tfexwks", + * }); + * export const azurermHealthcareMedtechServiceId = example.then(example => example.id); + * ``` */ export function getMedtechServiceOutput(args: GetMedtechServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMedtechService(a, opts)) diff --git a/sdk/nodejs/healthcare/getService.ts b/sdk/nodejs/healthcare/getService.ts index 830dab0b5d..cb0517156a 100644 --- a/sdk/nodejs/healthcare/getService.ts +++ b/sdk/nodejs/healthcare/getService.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Healthcare Service + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getService({ + * name: "example-healthcare_service", + * resourceGroupName: "example-resources", + * location: "westus2", + * }); + * export const healthcareServiceId = example.then(example => example.id); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -79,6 +93,20 @@ export interface GetServiceResult { } /** * Use this data source to access information about an existing Healthcare Service + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getService({ + * name: "example-healthcare_service", + * resourceGroupName: "example-resources", + * location: "westus2", + * }); + * export const healthcareServiceId = example.then(example => example.id); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/healthcare/getWorkspace.ts b/sdk/nodejs/healthcare/getWorkspace.ts index 03790e7690..aa10f9d86d 100644 --- a/sdk/nodejs/healthcare/getWorkspace.ts +++ b/sdk/nodejs/healthcare/getWorkspace.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Healthcare Workspace + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getWorkspace({ + * name: "example-healthcare_service", + * resourceGroupName: "example-resources", + * }); + * export const healthcareWorkspaceId = example.then(example => example.id); + * ``` */ export function getWorkspace(args: GetWorkspaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +64,19 @@ export interface GetWorkspaceResult { } /** * Use this data source to access information about an existing Healthcare Workspace + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.healthcare.getWorkspace({ + * name: "example-healthcare_service", + * resourceGroupName: "example-resources", + * }); + * export const healthcareWorkspaceId = example.then(example => example.id); + * ``` */ export function getWorkspaceOutput(args: GetWorkspaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWorkspace(a, opts)) diff --git a/sdk/nodejs/healthcare/medtechService.ts b/sdk/nodejs/healthcare/medtechService.ts index acab13ce7d..65a12b32e7 100644 --- a/sdk/nodejs/healthcare/medtechService.ts +++ b/sdk/nodejs/healthcare/medtechService.ts @@ -9,6 +9,46 @@ import * as utilities from "../utilities"; /** * Manages a Healthcare Med Tech Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleWorkspace = new azure.healthcare.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleMedtechService = new azure.healthcare.MedtechService("exampleMedtechService", { + * workspaceId: exampleWorkspace.id, + * location: "east us", + * identity: { + * type: "SystemAssigned", + * }, + * eventhubNamespaceName: "example-eventhub-namespace", + * eventhubName: "example-eventhub", + * eventhubConsumerGroupName: "$Default", + * deviceMappingJson: JSON.stringify({ + * templateType: "CollectionContent", + * template: [{ + * templateType: "JsonPathContent", + * template: { + * typeName: "heartrate", + * typeMatchExpression: "$..[?(@heartrate)]", + * deviceIdExpression: "$.deviceid", + * timestampExpression: "$.measurementdatetime", + * values: [{ + * required: "true", + * valueExpression: "$.heartrate", + * valueName: "hr", + * }], + * }, + * }], + * }), + * }); + * ``` + * * ## Import * * Healthcare Med Tech Service can be imported using the resource`id`, e.g. diff --git a/sdk/nodejs/healthcare/medtechServiceFhirDestination.ts b/sdk/nodejs/healthcare/medtechServiceFhirDestination.ts index 2f16f211bd..df6c59c5c2 100644 --- a/sdk/nodejs/healthcare/medtechServiceFhirDestination.ts +++ b/sdk/nodejs/healthcare/medtechServiceFhirDestination.ts @@ -7,6 +7,82 @@ import * as utilities from "../utilities"; /** * Manages a Healthcare Med Tech Service Fhir Destination. * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getClientConfig({}); + * const exampleWorkspace = new azure.healthcare.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 1, + * messageRetention: 1, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFhirService = new azure.healthcare.FhirService("exampleFhirService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * workspaceId: exampleWorkspace.id, + * kind: "fhir-R4", + * authentication: { + * authority: "https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + * audience: "https://examplefhir.fhir.azurehealthcareapis.com", + * }, + * }); + * const exampleMedtechService = new azure.healthcare.MedtechService("exampleMedtechService", { + * workspaceId: exampleWorkspace.id, + * location: exampleResourceGroup.location, + * eventhubNamespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * eventhubConsumerGroupName: exampleConsumerGroup.name, + * deviceMappingJson: JSON.stringify({ + * templateType: "CollectionContent", + * template: [], + * }), + * }); + * const exampleMedtechServiceFhirDestination = new azure.healthcare.MedtechServiceFhirDestination("exampleMedtechServiceFhirDestination", { + * location: "east us", + * medtechServiceId: exampleMedtechService.id, + * destinationFhirServiceId: exampleFhirService.id, + * destinationIdentityResolutionType: "Create", + * destinationFhirMappingJson: JSON.stringify({ + * templateType: "CollectionFhirTemplate", + * template: [{ + * templateType: "CodeValueFhir", + * template: { + * codes: [{ + * code: "8867-4", + * system: "http://loinc.org", + * display: "Heart rate", + * }], + * periodInterval: 60, + * typeName: "heartrate", + * value: { + * defaultPeriod: 5000, + * unit: "count/min", + * valueName: "hr", + * valueType: "SampledData", + * }, + * }, + * }], + * }), + * }); + * ``` + * * ## Import * * Healthcare Med Tech Service Fhir Destination can be imported using the resource`id`, e.g. diff --git a/sdk/nodejs/healthcare/service.ts b/sdk/nodejs/healthcare/service.ts index c5baad1cb6..311a36e7a8 100644 --- a/sdk/nodejs/healthcare/service.ts +++ b/sdk/nodejs/healthcare/service.ts @@ -9,6 +9,47 @@ import * as utilities from "../utilities"; /** * Manages a Healthcare Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const example = new azure.healthcare.Service("example", { + * resourceGroupName: "sample-resource-group", + * location: "westus2", + * kind: "fhir-R4", + * cosmosdbThroughput: 2000, + * accessPolicyObjectIds: current.then(current => current.objectId), + * tags: { + * environment: "testenv", + * purpose: "AcceptanceTests", + * }, + * authenticationConfiguration: { + * authority: "https://login.microsoftonline.com/$%7Bdata.azurerm_client_config.current.tenant_id%7D", + * audience: "https://azurehealthcareapis.com/", + * smartProxyEnabled: true, + * }, + * corsConfiguration: { + * allowedOrigins: [ + * "http://www.example.com", + * "http://www.example2.com", + * ], + * allowedHeaders: [ + * "x-tempo-*", + * "x-tempo2-*", + * ], + * allowedMethods: [ + * "GET", + * "PUT", + * ], + * maxAgeInSeconds: 500, + * allowCredentials: true, + * }, + * }); + * ``` + * * ## Import * * Healthcare Service can be imported using the resource`id`, e.g. diff --git a/sdk/nodejs/healthcare/workspace.ts b/sdk/nodejs/healthcare/workspace.ts index 013cf852b5..8b8ee7bcfe 100644 --- a/sdk/nodejs/healthcare/workspace.ts +++ b/sdk/nodejs/healthcare/workspace.ts @@ -9,6 +9,18 @@ import * as utilities from "../utilities"; /** * Manages a Healthcare workspace * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = new azure.healthcare.Workspace("test", { + * location: "east us", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` + * * ## Import * * Healthcare Workspaces can be imported using the resource`id`, e.g. diff --git a/sdk/nodejs/hpc/cache.ts b/sdk/nodejs/hpc/cache.ts index db6fa92b36..872498d04c 100644 --- a/sdk/nodejs/hpc/cache.ts +++ b/sdk/nodejs/hpc/cache.ts @@ -11,6 +11,32 @@ import * as utilities from "../utilities"; * * > **Note:** By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleCache = new azure.hpc.Cache("exampleCache", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * cacheSizeInGb: 3072, + * subnetId: exampleSubnet.id, + * skuName: "Standard_2G", + * }); + * ``` + * * ## Import * * HPC Caches can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hpc/cacheAccessPolicy.ts b/sdk/nodejs/hpc/cacheAccessPolicy.ts index 029f78c482..395308846a 100644 --- a/sdk/nodejs/hpc/cacheAccessPolicy.ts +++ b/sdk/nodejs/hpc/cacheAccessPolicy.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a HPC Cache Access Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleCache = new azure.hpc.Cache("exampleCache", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * cacheSizeInGb: 3072, + * subnetId: exampleSubnet.id, + * skuName: "Standard_2G", + * }); + * const exampleCacheAccessPolicy = new azure.hpc.CacheAccessPolicy("exampleCacheAccessPolicy", { + * hpcCacheId: exampleCache.id, + * accessRules: [{ + * scope: "default", + * access: "rw", + * }], + * }); + * ``` + * * ## Import * * HPC Cache Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hpc/cacheBlobTarget.ts b/sdk/nodejs/hpc/cacheBlobTarget.ts index 8e89c7956d..4c3ab9d755 100644 --- a/sdk/nodejs/hpc/cacheBlobTarget.ts +++ b/sdk/nodejs/hpc/cacheBlobTarget.ts @@ -9,6 +9,59 @@ import * as utilities from "../utilities"; * * > **NOTE:**: By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleCache = new azure.hpc.Cache("exampleCache", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * cacheSizeInGb: 3072, + * subnetId: exampleSubnet.id, + * skuName: "Standard_2G", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name}); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "HPC Cache Resource Provider", + * }); + * const exampleStorageAccountContrib = new azure.authorization.Assignment("exampleStorageAccountContrib", { + * scope: exampleAccount.id, + * roleDefinitionName: "Storage Account Contributor", + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId), + * }); + * const exampleStorageBlobDataContrib = new azure.authorization.Assignment("exampleStorageBlobDataContrib", { + * scope: exampleAccount.id, + * roleDefinitionName: "Storage Blob Data Contributor", + * principalId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId), + * }); + * const exampleCacheBlobTarget = new azure.hpc.CacheBlobTarget("exampleCacheBlobTarget", { + * resourceGroupName: exampleResourceGroup.name, + * cacheName: exampleCache.name, + * storageContainerId: exampleContainer.resourceManagerId, + * namespacePath: "/blob_storage", + * }); + * ``` + * * ## Import * * Blob Targets within an HPC Cache can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hsm/module.ts b/sdk/nodejs/hsm/module.ts index 21d6650cfd..527e5ecebe 100644 --- a/sdk/nodejs/hsm/module.ts +++ b/sdk/nodejs/hsm/module.ts @@ -13,6 +13,81 @@ import * as utilities from "../utilities"; * * > **Note:** If the quota is not enough in some region, please submit the quota request to service team. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.2.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.2.0.0/24"], + * }); + * const example2 = new azure.network.Subnet("example2", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.2.1.0/24"], + * delegations: [{ + * name: "first", + * serviceDelegation: { + * name: "Microsoft.HardwareSecurityModules/dedicatedHSMs", + * actions: [ + * "Microsoft.Network/networkinterfaces/*", + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * ], + * }, + * }], + * }); + * const example3 = new azure.network.Subnet("example3", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.2.255.0/26"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Dynamic", + * }); + * const exampleVirtualNetworkGateway = new azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * type: "ExpressRoute", + * vpnType: "PolicyBased", + * sku: "Standard", + * ipConfigurations: [{ + * publicIpAddressId: examplePublicIp.id, + * privateIpAddressAllocation: "Dynamic", + * subnetId: example3.id, + * }], + * }); + * const exampleModule = new azure.hsm.Module("exampleModule", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "payShield10K_LMK1_CPS60", + * managementNetworkProfile: { + * networkInterfacePrivateIpAddresses: ["10.2.1.7"], + * subnetId: example2.id, + * }, + * networkProfile: { + * networkInterfacePrivateIpAddresses: ["10.2.1.8"], + * subnetId: example2.id, + * }, + * stampId: "stamp2", + * tags: { + * env: "Test", + * }, + * }, { + * dependsOn: [exampleVirtualNetworkGateway], + * }); + * ``` + * * ## Import * * Dedicated Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/hybrid/getComputeMachine.ts b/sdk/nodejs/hybrid/getComputeMachine.ts index 08d06f1f23..820a8adafd 100644 --- a/sdk/nodejs/hybrid/getComputeMachine.ts +++ b/sdk/nodejs/hybrid/getComputeMachine.ts @@ -12,6 +12,19 @@ import * as utilities from "../utilities"; * ## Disclaimers * * > **Note:** The Data Source `azure.hybrid.getComputeMachine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `azure.arcmachine.get` Data Source. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.hybrid.getComputeMachine({ + * name: "existing-hcmachine", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getComputeMachine(args: GetComputeMachineArgs, opts?: pulumi.InvokeOptions): Promise { @@ -168,6 +181,19 @@ export interface GetComputeMachineResult { * ## Disclaimers * * > **Note:** The Data Source `azure.hybrid.getComputeMachine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `azure.arcmachine.get` Data Source. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.hybrid.getComputeMachine({ + * name: "existing-hcmachine", + * resourceGroupName: "existing-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getComputeMachineOutput(args: GetComputeMachineOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getComputeMachine(a, opts)) diff --git a/sdk/nodejs/iot/certificate.ts b/sdk/nodejs/iot/certificate.ts index 909e614614..cdd0c24c91 100644 --- a/sdk/nodejs/iot/certificate.ts +++ b/sdk/nodejs/iot/certificate.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages an IotHub Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "B1", + * capacity: 1, + * }, + * }); + * const exampleCertificate = new azure.iot.Certificate("exampleCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * iothubName: exampleIoTHub.name, + * isVerified: true, + * certificateContent: Buffer.from(fs.readFileSync("example.cer"), 'binary').toString('base64'), + * }); + * ``` + * * ## Import * * IoTHub Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/consumerGroup.ts b/sdk/nodejs/iot/consumerGroup.ts index 9a509513ba..e6c7127fd8 100644 --- a/sdk/nodejs/iot/consumerGroup.ts +++ b/sdk/nodejs/iot/consumerGroup.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a Consumer Group within an IotHub * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * tags: { + * purpose: "testing", + * }, + * }); + * const exampleConsumerGroup = new azure.iot.ConsumerGroup("exampleConsumerGroup", { + * iothubName: exampleIoTHub.name, + * eventhubEndpointName: "events", + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * IoTHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/dpsSharedAccessPolicy.ts b/sdk/nodejs/iot/dpsSharedAccessPolicy.ts index d37d9d7bba..18d0e72925 100644 --- a/sdk/nodejs/iot/dpsSharedAccessPolicy.ts +++ b/sdk/nodejs/iot/dpsSharedAccessPolicy.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an IotHub Device Provisioning Service Shared Access Policy * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIotHubDps = new azure.iot.IotHubDps("exampleIotHubDps", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleDpsSharedAccessPolicy = new azure.iot.DpsSharedAccessPolicy("exampleDpsSharedAccessPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * iothubDpsName: exampleIotHubDps.name, + * enrollmentWrite: true, + * enrollmentRead: true, + * }); + * ``` + * * ## Import * * IoTHub Device Provisioning Service Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/endpointCosmosdbAccount.ts b/sdk/nodejs/iot/endpointCosmosdbAccount.ts index 85442670ea..d2db3dfa32 100644 --- a/sdk/nodejs/iot/endpointCosmosdbAccount.ts +++ b/sdk/nodejs/iot/endpointCosmosdbAccount.ts @@ -9,6 +9,58 @@ import * as utilities from "../utilities"; * * > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "B1", + * capacity: 1, + * }, + * tags: { + * purpose: "example", + * }, + * }); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "Strong", + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/definition/id", + * }); + * const exampleEndpointCosmosdbAccount = new azure.iot.EndpointCosmosdbAccount("exampleEndpointCosmosdbAccount", { + * resourceGroupName: exampleResourceGroup.name, + * iothubId: exampleIoTHub.id, + * containerName: exampleSqlContainer.name, + * databaseName: exampleSqlDatabase.name, + * endpointUri: exampleAccount.endpoint, + * primaryKey: exampleAccount.primaryKey, + * secondaryKey: exampleAccount.secondaryKey, + * }); + * ``` + * * ## Import * * IoTHub Cosmos DB Account Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/endpointEventhub.ts b/sdk/nodejs/iot/endpointEventhub.ts index 2dca7a799c..e6120d3ba9 100644 --- a/sdk/nodejs/iot/endpointEventhub.ts +++ b/sdk/nodejs/iot/endpointEventhub.ts @@ -9,6 +9,50 @@ import * as utilities from "../utilities"; * * > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Basic", + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * listen: false, + * send: true, + * manage: false, + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "B1", + * capacity: 1, + * }, + * tags: { + * purpose: "example", + * }, + * }); + * const exampleEndpointEventhub = new azure.iot.EndpointEventhub("exampleEndpointEventhub", { + * resourceGroupName: exampleResourceGroup.name, + * iothubId: exampleIoTHub.id, + * connectionString: exampleAuthorizationRule.primaryConnectionString, + * }); + * ``` + * * ## Import * * IoTHub EventHub Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/endpointServicebusQueue.ts b/sdk/nodejs/iot/endpointServicebusQueue.ts index 4557b29a92..8f17b61edc 100644 --- a/sdk/nodejs/iot/endpointServicebusQueue.ts +++ b/sdk/nodejs/iot/endpointServicebusQueue.ts @@ -9,6 +9,46 @@ import * as utilities from "../utilities"; * * > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleQueue = new azure.servicebus.Queue("exampleQueue", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleQueueAuthorizationRule = new azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", { + * queueId: exampleQueue.id, + * listen: false, + * send: true, + * manage: false, + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "B1", + * capacity: 1, + * }, + * tags: { + * purpose: "example", + * }, + * }); + * const exampleEndpointServicebusQueue = new azure.iot.EndpointServicebusQueue("exampleEndpointServicebusQueue", { + * resourceGroupName: exampleResourceGroup.name, + * iothubId: exampleIoTHub.id, + * connectionString: exampleQueueAuthorizationRule.primaryConnectionString, + * }); + * ``` + * * ## Import * * IoTHub ServiceBus Queue Endpoint can be imported using the `resource id`, e.g. g diff --git a/sdk/nodejs/iot/endpointServicebusTopic.ts b/sdk/nodejs/iot/endpointServicebusTopic.ts index 20ed83ca72..f6c5dafacf 100644 --- a/sdk/nodejs/iot/endpointServicebusTopic.ts +++ b/sdk/nodejs/iot/endpointServicebusTopic.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; * * > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", {namespaceId: exampleNamespace.id}); + * const exampleTopicAuthorizationRule = new azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", { + * topicId: exampleTopic.id, + * listen: false, + * send: true, + * manage: false, + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "B1", + * capacity: 1, + * }, + * tags: { + * purpose: "example", + * }, + * }); + * const exampleEndpointServicebusTopic = new azure.iot.EndpointServicebusTopic("exampleEndpointServicebusTopic", { + * resourceGroupName: exampleResourceGroup.name, + * iothubId: exampleIoTHub.id, + * connectionString: exampleTopicAuthorizationRule.primaryConnectionString, + * }); + * ``` + * * ## Import * * IoTHub ServiceBus Topic Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/endpointStorageContainer.ts b/sdk/nodejs/iot/endpointStorageContainer.ts index e226d9591f..50eee66e7c 100644 --- a/sdk/nodejs/iot/endpointStorageContainer.ts +++ b/sdk/nodejs/iot/endpointStorageContainer.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; * * > **NOTE:** Endpoints can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `azure.iot.IoTHub` resource is not supported. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleEndpointStorageContainer = new azure.iot.EndpointStorageContainer("exampleEndpointStorageContainer", { + * resourceGroupName: exampleResourceGroup.name, + * iothubId: exampleIoTHub.id, + * containerName: "acctestcont", + * connectionString: exampleAccount.primaryBlobConnectionString, + * fileNameFormat: "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + * batchFrequencyInSeconds: 60, + * maxChunkSizeInBytes: 10485760, + * encoding: "JSON", + * }); + * ``` + * * ## Import * * IoTHub Storage Container Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/fileUpload.ts b/sdk/nodejs/iot/fileUpload.ts index 64e2aa5db9..f43ffa194a 100644 --- a/sdk/nodejs/iot/fileUpload.ts +++ b/sdk/nodejs/iot/fileUpload.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; * * > **NOTE:** File upload can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleFileUpload = new azure.iot.FileUpload("exampleFileUpload", { + * iothubId: exampleIoTHub.id, + * connectionString: exampleAccount.primaryBlobConnectionString, + * containerName: exampleContainer.name, + * }); + * ``` + * * ## Import * * IoT Hub File Uploads can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/getDps.ts b/sdk/nodejs/iot/getDps.ts index a46cba6bcf..979c18d0ca 100644 --- a/sdk/nodejs/iot/getDps.ts +++ b/sdk/nodejs/iot/getDps.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing IotHub Device Provisioning Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getDps({ + * name: "iot_hub_dps_test", + * resourceGroupName: "iothub_dps_rg", + * }); + * ``` */ export function getDps(args: GetDpsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -66,6 +78,18 @@ export interface GetDpsResult { } /** * Use this data source to access information about an existing IotHub Device Provisioning Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getDps({ + * name: "iot_hub_dps_test", + * resourceGroupName: "iothub_dps_rg", + * }); + * ``` */ export function getDpsOutput(args: GetDpsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDps(a, opts)) diff --git a/sdk/nodejs/iot/getDpsSharedAccessPolicy.ts b/sdk/nodejs/iot/getDpsSharedAccessPolicy.ts index 071fa710ff..9fba23fdcc 100644 --- a/sdk/nodejs/iot/getDpsSharedAccessPolicy.ts +++ b/sdk/nodejs/iot/getDpsSharedAccessPolicy.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getDpsSharedAccessPolicy({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * iothubDpsName: azurerm_iothub_dps.example.name, + * }); + * ``` */ export function getDpsSharedAccessPolicy(args: GetDpsSharedAccessPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetDpsSharedAccessPolicyResult { } /** * Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getDpsSharedAccessPolicy({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * iothubDpsName: azurerm_iothub_dps.example.name, + * }); + * ``` */ export function getDpsSharedAccessPolicyOutput(args: GetDpsSharedAccessPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDpsSharedAccessPolicy(a, opts)) diff --git a/sdk/nodejs/iot/getIotHub.ts b/sdk/nodejs/iot/getIotHub.ts index c21e4a504c..53bba7245d 100644 --- a/sdk/nodejs/iot/getIotHub.ts +++ b/sdk/nodejs/iot/getIotHub.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing IoTHub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getIotHub({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getIotHub(args: GetIotHubArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +72,19 @@ export interface GetIotHubResult { } /** * Use this data source to access information about an existing IoTHub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getIotHub({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getIotHubOutput(args: GetIotHubOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getIotHub(a, opts)) diff --git a/sdk/nodejs/iot/getSharedAccessPolicy.ts b/sdk/nodejs/iot/getSharedAccessPolicy.ts index 6c61480268..5dd6dfdc80 100644 --- a/sdk/nodejs/iot/getSharedAccessPolicy.ts +++ b/sdk/nodejs/iot/getSharedAccessPolicy.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing IotHub Shared Access Policy + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getSharedAccessPolicy({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * iothubName: azurerm_iothub.example.name, + * }); + * ``` */ export function getSharedAccessPolicy(args: GetSharedAccessPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetSharedAccessPolicyResult { } /** * Use this data source to access information about an existing IotHub Shared Access Policy + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.iot.getSharedAccessPolicy({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * iothubName: azurerm_iothub.example.name, + * }); + * ``` */ export function getSharedAccessPolicyOutput(args: GetSharedAccessPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSharedAccessPolicy(a, opts)) diff --git a/sdk/nodejs/iot/ioTHub.ts b/sdk/nodejs/iot/ioTHub.ts index c6d56d22b6..fe600f3a5a 100644 --- a/sdk/nodejs/iot/ioTHub.ts +++ b/sdk/nodejs/iot/ioTHub.ts @@ -19,6 +19,104 @@ import * as utilities from "../utilities"; * * > **NOTE:** File upload can be defined either directly on the `azure.iot.IoTHub` resource, or using the `azure.iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Basic", + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * resourceGroupName: exampleResourceGroup.name, + * namespaceName: exampleEventHubNamespace.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", { + * resourceGroupName: exampleResourceGroup.name, + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * send: true, + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * localAuthenticationEnabled: false, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * endpoints: [ + * { + * type: "AzureIotHub.StorageContainer", + * connectionString: exampleAccount.primaryBlobConnectionString, + * name: "export", + * batchFrequencyInSeconds: 60, + * maxChunkSizeInBytes: 10485760, + * containerName: exampleContainer.name, + * encoding: "Avro", + * fileNameFormat: "{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + * }, + * { + * type: "AzureIotHub.EventHub", + * connectionString: exampleAuthorizationRule.primaryConnectionString, + * name: "export2", + * }, + * ], + * routes: [ + * { + * name: "export", + * source: "DeviceMessages", + * condition: "true", + * endpointNames: ["export"], + * enabled: true, + * }, + * { + * name: "export2", + * source: "DeviceMessages", + * condition: "true", + * endpointNames: ["export2"], + * enabled: true, + * }, + * ], + * enrichments: [{ + * key: "tenant", + * value: "$twin.tags.Tenant", + * endpointNames: [ + * "export", + * "export2", + * ], + * }], + * cloudToDevice: { + * maxDeliveryCount: 30, + * defaultTtl: "PT1H", + * feedbacks: [{ + * timeToLive: "PT1H10M", + * maxDeliveryCount: 15, + * lockDuration: "PT30S", + * }], + * }, + * tags: { + * purpose: "testing", + * }, + * }); + * ``` + * * ## Import * * IoTHubs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/iotHubCertificate.ts b/sdk/nodejs/iot/iotHubCertificate.ts index 784f979a6d..0d745ce72e 100644 --- a/sdk/nodejs/iot/iotHubCertificate.ts +++ b/sdk/nodejs/iot/iotHubCertificate.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an IotHub Device Provisioning Service Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIotHubDps = new azure.iot.IotHubDps("exampleIotHubDps", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleIotHubCertificate = new azure.iot.IotHubCertificate("exampleIotHubCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * iotDpsName: exampleIotHubDps.name, + * certificateContent: Buffer.from(fs.readFileSync("example.cer"), 'binary').toString('base64'), + * }); + * ``` + * * ## Import * * IoTHub Device Provisioning Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/iotHubDeviceUpdateAccount.ts b/sdk/nodejs/iot/iotHubDeviceUpdateAccount.ts index 5a267d95b6..f448a7ed6e 100644 --- a/sdk/nodejs/iot/iotHubDeviceUpdateAccount.ts +++ b/sdk/nodejs/iot/iotHubDeviceUpdateAccount.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; /** * Manages an IoT Hub Device Update Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleIotHubDeviceUpdateAccount = new azure.iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * IoT Hub Device Update Account can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/iotHubDeviceUpdateInstance.ts b/sdk/nodejs/iot/iotHubDeviceUpdateInstance.ts index 27c7c6e44e..879f9cdfce 100644 --- a/sdk/nodejs/iot/iotHubDeviceUpdateInstance.ts +++ b/sdk/nodejs/iot/iotHubDeviceUpdateInstance.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages an IoT Hub Device Update Instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleIotHubDeviceUpdateAccount = new azure.iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleIotHubDeviceUpdateInstance = new azure.iot.IotHubDeviceUpdateInstance("exampleIotHubDeviceUpdateInstance", { + * deviceUpdateAccountId: exampleIotHubDeviceUpdateAccount.id, + * iothubId: exampleIoTHub.id, + * diagnosticEnabled: true, + * diagnosticStorageAccount: { + * connectionString: exampleAccount.primaryConnectionString, + * id: exampleAccount.id, + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * IoT Hub Device Update Instance can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/iotHubDps.ts b/sdk/nodejs/iot/iotHubDps.ts index 518817fc60..898ea875eb 100644 --- a/sdk/nodejs/iot/iotHubDps.ts +++ b/sdk/nodejs/iot/iotHubDps.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages an IotHub Device Provisioning Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIotHubDps = new azure.iot.IotHubDps("exampleIotHubDps", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allocationPolicy: "Hashed", + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * ``` + * * ## Import * * IoT Device Provisioning Service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/securityDeviceGroup.ts b/sdk/nodejs/iot/securityDeviceGroup.ts index 074bd204b9..4ad0446e59 100644 --- a/sdk/nodejs/iot/securityDeviceGroup.ts +++ b/sdk/nodejs/iot/securityDeviceGroup.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; /** * Manages a Iot Security Device Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleSecuritySolution = new azure.iot.SecuritySolution("exampleSecuritySolution", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * displayName: "Iot Security Solution", + * iothubIds: [exampleIoTHub.id], + * }); + * const exampleSecurityDeviceGroup = new azure.iot.SecurityDeviceGroup("exampleSecurityDeviceGroup", { + * iothubId: exampleIoTHub.id, + * allowRule: { + * connectionToIpsNotAlloweds: ["10.0.0.0/24"], + * }, + * rangeRules: [{ + * type: "ActiveConnectionsNotInAllowedRange", + * min: 0, + * max: 30, + * duration: "PT5M", + * }], + * }, { + * dependsOn: [exampleSecuritySolution], + * }); + * ``` + * * ## Import * * Iot Security Device Group can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/securitySolution.ts b/sdk/nodejs/iot/securitySolution.ts index b3d700a57d..96b841c297 100644 --- a/sdk/nodejs/iot/securitySolution.ts +++ b/sdk/nodejs/iot/securitySolution.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages an iot security solution. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleSecuritySolution = new azure.iot.SecuritySolution("exampleSecuritySolution", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * displayName: "Iot Security Solution", + * iothubIds: [exampleIoTHub.id], + * }); + * ``` + * * ## Import * * Iot Security Solution can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/sharedAccessPolicy.ts b/sdk/nodejs/iot/sharedAccessPolicy.ts index 12c9f0c46c..0d1872e08f 100644 --- a/sdk/nodejs/iot/sharedAccessPolicy.ts +++ b/sdk/nodejs/iot/sharedAccessPolicy.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an IotHub Shared Access Policy * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleSharedAccessPolicy = new azure.iot.SharedAccessPolicy("exampleSharedAccessPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * iothubName: exampleIoTHub.name, + * registryRead: true, + * registryWrite: true, + * }); + * ``` + * * ## Import * * IoTHub Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/timeSeriesInsightsAccessPolicy.ts b/sdk/nodejs/iot/timeSeriesInsightsAccessPolicy.ts index 5d3c6fa96b..8a64233c02 100644 --- a/sdk/nodejs/iot/timeSeriesInsightsAccessPolicy.ts +++ b/sdk/nodejs/iot/timeSeriesInsightsAccessPolicy.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages an Azure IoT Time Series Insights Access Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTimeSeriesInsightsStandardEnvironment = new azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "S1_1", + * dataRetentionTime: "P30D", + * }); + * const exampleTimeSeriesInsightsAccessPolicy = new azure.iot.TimeSeriesInsightsAccessPolicy("exampleTimeSeriesInsightsAccessPolicy", { + * timeSeriesInsightsEnvironmentId: exampleTimeSeriesInsightsStandardEnvironment.name, + * principalObjectId: "aGUID", + * roles: ["Reader"], + * }); + * ``` + * * ## Import * * Azure IoT Time Series Insights Access Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/timeSeriesInsightsEventSourceEventhub.ts b/sdk/nodejs/iot/timeSeriesInsightsEventSourceEventhub.ts index e8cd680106..974b20b7af 100644 --- a/sdk/nodejs/iot/timeSeriesInsightsEventSourceEventhub.ts +++ b/sdk/nodejs/iot/timeSeriesInsightsEventSourceEventhub.ts @@ -7,6 +7,65 @@ import * as utilities from "../utilities"; /** * Manages an Azure IoT Time Series Insights EventHub Event Source. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 7, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * listen: true, + * send: false, + * manage: false, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleTimeSeriesInsightsGen2Environment = new azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "L1", + * idProperties: ["id"], + * storage: { + * name: exampleAccount.name, + * key: exampleAccount.primaryAccessKey, + * }, + * }); + * const exampleTimeSeriesInsightsEventSourceEventhub = new azure.iot.TimeSeriesInsightsEventSourceEventhub("exampleTimeSeriesInsightsEventSourceEventhub", { + * location: exampleResourceGroup.location, + * environmentId: exampleTimeSeriesInsightsGen2Environment.id, + * eventhubName: exampleEventHub.name, + * namespaceName: exampleEventHubNamespace.name, + * sharedAccessKey: exampleAuthorizationRule.primaryKey, + * sharedAccessKeyName: exampleAuthorizationRule.name, + * consumerGroupName: exampleConsumerGroup.name, + * eventSourceResourceId: exampleEventHub.id, + * }); + * ``` + * * ## Import * * Azure IoT Time Series Insights EventHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/timeSeriesInsightsEventSourceIothub.ts b/sdk/nodejs/iot/timeSeriesInsightsEventSourceIothub.ts index 880e81177d..588466a8cd 100644 --- a/sdk/nodejs/iot/timeSeriesInsightsEventSourceIothub.ts +++ b/sdk/nodejs/iot/timeSeriesInsightsEventSourceIothub.ts @@ -7,6 +7,53 @@ import * as utilities from "../utilities"; /** * Manages an Azure IoT Time Series Insights IoTHub Event Source. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "B1", + * capacity: 1, + * }, + * }); + * const exampleConsumerGroup = new azure.iot.ConsumerGroup("exampleConsumerGroup", { + * iothubName: exampleIoTHub.name, + * eventhubEndpointName: "events", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const storage = new azure.storage.Account("storage", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleTimeSeriesInsightsGen2Environment = new azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "L1", + * idProperties: ["id"], + * storage: { + * name: storage.name, + * key: storage.primaryAccessKey, + * }, + * }); + * const exampleTimeSeriesInsightsEventSourceIothub = new azure.iot.TimeSeriesInsightsEventSourceIothub("exampleTimeSeriesInsightsEventSourceIothub", { + * location: exampleResourceGroup.location, + * environmentId: exampleTimeSeriesInsightsGen2Environment.id, + * iothubName: exampleIoTHub.name, + * sharedAccessKey: exampleIoTHub.sharedAccessPolicies.apply(sharedAccessPolicies => sharedAccessPolicies[0].primaryKey), + * sharedAccessKeyName: exampleIoTHub.sharedAccessPolicies.apply(sharedAccessPolicies => sharedAccessPolicies[0].keyName), + * consumerGroupName: exampleConsumerGroup.name, + * eventSourceResourceId: exampleIoTHub.id, + * }); + * ``` + * * ## Import * * Azure IoT Time Series Insights IoTHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/timeSeriesInsightsGen2Environment.ts b/sdk/nodejs/iot/timeSeriesInsightsGen2Environment.ts index 64124180ea..f25a180a1a 100644 --- a/sdk/nodejs/iot/timeSeriesInsightsGen2Environment.ts +++ b/sdk/nodejs/iot/timeSeriesInsightsGen2Environment.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages an Azure IoT Time Series Insights Gen2 Environment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const storage = new azure.storage.Account("storage", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleTimeSeriesInsightsGen2Environment = new azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "L1", + * warmStoreDataRetentionTime: "P30D", + * idProperties: ["id"], + * storage: { + * name: storage.name, + * key: storage.primaryAccessKey, + * }, + * }); + * ``` + * * ## Import * * Azure IoT Time Series Insights Gen2 Environment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/timeSeriesInsightsReferenceDataSet.ts b/sdk/nodejs/iot/timeSeriesInsightsReferenceDataSet.ts index c9c05f8b56..ed60b395cf 100644 --- a/sdk/nodejs/iot/timeSeriesInsightsReferenceDataSet.ts +++ b/sdk/nodejs/iot/timeSeriesInsightsReferenceDataSet.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages an Azure IoT Time Series Insights Reference Data Set. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTimeSeriesInsightsStandardEnvironment = new azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "S1_1", + * dataRetentionTime: "P30D", + * }); + * const exampleTimeSeriesInsightsReferenceDataSet = new azure.iot.TimeSeriesInsightsReferenceDataSet("exampleTimeSeriesInsightsReferenceDataSet", { + * timeSeriesInsightsEnvironmentId: exampleTimeSeriesInsightsStandardEnvironment.id, + * location: exampleResourceGroup.location, + * keyProperties: [{ + * name: "keyProperty1", + * type: "String", + * }], + * }); + * ``` + * * ## Import * * Azure IoT Time Series Insights Reference Data Set can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iot/timeSeriesInsightsStandardEnvironment.ts b/sdk/nodejs/iot/timeSeriesInsightsStandardEnvironment.ts index 90e3d16970..1959ea619d 100644 --- a/sdk/nodejs/iot/timeSeriesInsightsStandardEnvironment.ts +++ b/sdk/nodejs/iot/timeSeriesInsightsStandardEnvironment.ts @@ -7,6 +7,21 @@ import * as utilities from "../utilities"; /** * Manages an Azure IoT Time Series Insights Standard Environment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTimeSeriesInsightsStandardEnvironment = new azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "S1_1", + * dataRetentionTime: "P30D", + * }); + * ``` + * * ## Import * * Azure IoT Time Series Insights Standard Environment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iotcentral/application.ts b/sdk/nodejs/iotcentral/application.ts index 0a004a5afb..80cfddd8f2 100644 --- a/sdk/nodejs/iotcentral/application.ts +++ b/sdk/nodejs/iotcentral/application.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; /** * Manages an IoT Central Application * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleApplication = new azure.iotcentral.Application("exampleApplication", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subDomain: "example-iotcentral-app-subdomain", + * displayName: "example-iotcentral-app-display-name", + * sku: "ST1", + * template: "iotc-default@1.0.0", + * tags: { + * Foo: "Bar", + * }, + * }); + * ``` + * * ## Import * * The IoT Central Application can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/iotcentral/applicationNetworkRuleSet.ts b/sdk/nodejs/iotcentral/applicationNetworkRuleSet.ts index 99183738c8..2cc18a507a 100644 --- a/sdk/nodejs/iotcentral/applicationNetworkRuleSet.ts +++ b/sdk/nodejs/iotcentral/applicationNetworkRuleSet.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; /** * Manages an IoT Central Application Network Rule Set. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleApplication = new azure.iotcentral.Application("exampleApplication", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subDomain: "example-iotcentral-app-subdomain", + * displayName: "example-iotcentral-app-display-name", + * sku: "ST1", + * tags: { + * Foo: "Bar", + * }, + * }); + * const exampleApplicationNetworkRuleSet = new azure.iotcentral.ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet", { + * iotcentralApplicationId: exampleApplication.id, + * ipRules: [ + * { + * name: "rule1", + * ipMask: "10.0.1.0/24", + * }, + * { + * name: "rule2", + * ipMask: "10.1.1.0/24", + * }, + * ], + * }); + * ``` + * * ## Import * * IoT Central Application Network Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/keyvault/accessPolicy.ts b/sdk/nodejs/keyvault/accessPolicy.ts index 8967264805..96c6c6f429 100644 --- a/sdk/nodejs/keyvault/accessPolicy.ts +++ b/sdk/nodejs/keyvault/accessPolicy.ts @@ -11,6 +11,44 @@ import * as utilities from "../utilities"; * * > **NOTE:** Azure permits a maximum of 1024 Access Policies per Key Vault - [more information can be found in this document](https://docs.microsoft.com/azure/key-vault/key-vault-secure-your-key-vault#data-plane-access-control). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * }); + * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("exampleAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: ["Get"], + * secretPermissions: ["Get"], + * }); + * const exampleServicePrincipal = azuread.getServicePrincipal({ + * displayName: "example-app", + * }); + * const example_principal = new azure.keyvault.AccessPolicy("example-principal", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId), + * keyPermissions: [ + * "Get", + * "List", + * "Encrypt", + * "Decrypt", + * ], + * }); + * ``` + * * ## Import * * Key Vault Access Policies can be imported using the Resource ID of the Key Vault, plus some additional metadata. If both an `object_id` and `application_id` are specified, then the Access Policy can be imported using the following code diff --git a/sdk/nodejs/keyvault/certifiate.ts b/sdk/nodejs/keyvault/certifiate.ts index 277959fad4..be1fcecacd 100644 --- a/sdk/nodejs/keyvault/certifiate.ts +++ b/sdk/nodejs/keyvault/certifiate.ts @@ -15,6 +15,184 @@ import * as utilities from "../utilities"; * ======= * > > > > > > > 8d78c87098 (Update-documentation) * ## Example Usage + * ### Importing A PFX) + * + * > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Create", + * "Delete", + * "DeleteIssuers", + * "Get", + * "GetIssuers", + * "Import", + * "List", + * "ListIssuers", + * "ManageContacts", + * "ManageIssuers", + * "SetIssuers", + * "Update", + * ], + * keyPermissions: [ + * "Backup", + * "Create", + * "Decrypt", + * "Delete", + * "Encrypt", + * "Get", + * "Import", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Sign", + * "UnwrapKey", + * "Update", + * "Verify", + * "WrapKey", + * ], + * secretPermissions: [ + * "Backup", + * "Delete", + * "Get", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Set", + * ], + * }], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificate: { + * contents: Buffer.from(fs.readFileSync("certificate-to-import.pfx"), 'binary').toString('base64'), + * password: "", + * }, + * }); + * ``` + * ### Generating a new certificate + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * softDeleteRetentionDays: 7, + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Create", + * "Delete", + * "DeleteIssuers", + * "Get", + * "GetIssuers", + * "Import", + * "List", + * "ListIssuers", + * "ManageContacts", + * "ManageIssuers", + * "Purge", + * "SetIssuers", + * "Update", + * ], + * keyPermissions: [ + * "Backup", + * "Create", + * "Decrypt", + * "Delete", + * "Encrypt", + * "Get", + * "Import", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Sign", + * "UnwrapKey", + * "Update", + * "Verify", + * "WrapKey", + * ], + * secretPermissions: [ + * "Backup", + * "Delete", + * "Get", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Set", + * ], + * }], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificatePolicy: { + * issuerParameters: { + * name: "Self", + * }, + * keyProperties: { + * exportable: true, + * keySize: 2048, + * keyType: "RSA", + * reuseKey: true, + * }, + * lifetimeActions: [{ + * action: { + * actionType: "AutoRenew", + * }, + * trigger: { + * daysBeforeExpiry: 30, + * }, + * }], + * secretProperties: { + * contentType: "application/x-pkcs12", + * }, + * x509CertificateProperties: { + * extendedKeyUsages: ["1.3.6.1.5.5.7.3.1"], + * keyUsages: [ + * "cRLSign", + * "dataEncipherment", + * "digitalSignature", + * "keyAgreement", + * "keyCertSign", + * "keyEncipherment", + * ], + * subjectAlternativeNames: { + * dnsNames: [ + * "internal.contoso.com", + * "domain.hello.world", + * ], + * }, + * subject: "CN=hello-world", + * validityInMonths: 12, + * }, + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/keyvault/certificate.ts b/sdk/nodejs/keyvault/certificate.ts index e05cbb745c..f51ca6297f 100644 --- a/sdk/nodejs/keyvault/certificate.ts +++ b/sdk/nodejs/keyvault/certificate.ts @@ -15,6 +15,184 @@ import * as utilities from "../utilities"; * ======= * > > > > > > > 8d78c87098 (Update-documentation) * ## Example Usage + * ### Importing A PFX) + * + * > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Create", + * "Delete", + * "DeleteIssuers", + * "Get", + * "GetIssuers", + * "Import", + * "List", + * "ListIssuers", + * "ManageContacts", + * "ManageIssuers", + * "SetIssuers", + * "Update", + * ], + * keyPermissions: [ + * "Backup", + * "Create", + * "Decrypt", + * "Delete", + * "Encrypt", + * "Get", + * "Import", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Sign", + * "UnwrapKey", + * "Update", + * "Verify", + * "WrapKey", + * ], + * secretPermissions: [ + * "Backup", + * "Delete", + * "Get", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Set", + * ], + * }], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificate: { + * contents: Buffer.from(fs.readFileSync("certificate-to-import.pfx"), 'binary').toString('base64'), + * password: "", + * }, + * }); + * ``` + * ### Generating a new certificate + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * softDeleteRetentionDays: 7, + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Create", + * "Delete", + * "DeleteIssuers", + * "Get", + * "GetIssuers", + * "Import", + * "List", + * "ListIssuers", + * "ManageContacts", + * "ManageIssuers", + * "Purge", + * "SetIssuers", + * "Update", + * ], + * keyPermissions: [ + * "Backup", + * "Create", + * "Decrypt", + * "Delete", + * "Encrypt", + * "Get", + * "Import", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Sign", + * "UnwrapKey", + * "Update", + * "Verify", + * "WrapKey", + * ], + * secretPermissions: [ + * "Backup", + * "Delete", + * "Get", + * "List", + * "Purge", + * "Recover", + * "Restore", + * "Set", + * ], + * }], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificatePolicy: { + * issuerParameters: { + * name: "Self", + * }, + * keyProperties: { + * exportable: true, + * keySize: 2048, + * keyType: "RSA", + * reuseKey: true, + * }, + * lifetimeActions: [{ + * action: { + * actionType: "AutoRenew", + * }, + * trigger: { + * daysBeforeExpiry: 30, + * }, + * }], + * secretProperties: { + * contentType: "application/x-pkcs12", + * }, + * x509CertificateProperties: { + * extendedKeyUsages: ["1.3.6.1.5.5.7.3.1"], + * keyUsages: [ + * "cRLSign", + * "dataEncipherment", + * "digitalSignature", + * "keyAgreement", + * "keyCertSign", + * "keyEncipherment", + * ], + * subjectAlternativeNames: { + * dnsNames: [ + * "internal.contoso.com", + * "domain.hello.world", + * ], + * }, + * subject: "CN=hello-world", + * validityInMonths: 12, + * }, + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/keyvault/certificateContacts.ts b/sdk/nodejs/keyvault/certificateContacts.ts index d7b7eac410..0a4d908d32 100644 --- a/sdk/nodejs/keyvault/certificateContacts.ts +++ b/sdk/nodejs/keyvault/certificateContacts.ts @@ -13,6 +13,45 @@ import * as utilities from "../utilities"; * * > **Note:** It's possible to define Key Vault Certificate Contacts both within the `azure.keyvault.KeyVault` resource via the `contact` block and by using the `azure.keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * }); + * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("exampleAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: ["ManageContacts"], + * keyPermissions: ["Create"], + * secretPermissions: ["Set"], + * }); + * const exampleCertificateContacts = new azure.keyvault.CertificateContacts("exampleCertificateContacts", { + * keyVaultId: exampleKeyVault.id, + * contacts: [ + * { + * email: "example@example.com", + * name: "example", + * phone: "01234567890", + * }, + * { + * email: "example2@example.com", + * }, + * ], + * }, { + * dependsOn: [exampleAccessPolicy], + * }); + * ``` + * * ## Import * * Key Vault Certificate Contacts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/keyvault/certificateIssuer.ts b/sdk/nodejs/keyvault/certificateIssuer.ts index 8b09043c86..53cc3a7139 100644 --- a/sdk/nodejs/keyvault/certificateIssuer.ts +++ b/sdk/nodejs/keyvault/certificateIssuer.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages a Key Vault Certificate Issuer. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "standard", + * tenantId: current.then(current => current.tenantId), + * }); + * const exampleCertificateIssuer = new azure.keyvault.CertificateIssuer("exampleCertificateIssuer", { + * orgId: "ExampleOrgName", + * keyVaultId: exampleKeyVault.id, + * providerName: "DigiCert", + * accountId: "0000", + * password: "example-password", + * }); + * ``` + * * ## Import * * Key Vault Certificate Issuers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/keyvault/getAccessPolicy.ts b/sdk/nodejs/keyvault/getAccessPolicy.ts index b72271bbc2..f00459c30f 100644 --- a/sdk/nodejs/keyvault/getAccessPolicy.ts +++ b/sdk/nodejs/keyvault/getAccessPolicy.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about the permissions from the Management Key Vault Templates. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const contributor = azure.keyvault.getAccessPolicy({ + * name: "Key Management", + * }); + * export const accessPolicyKeyPermissions = contributor.then(contributor => contributor.keyPermissions); + * ``` */ export function getAccessPolicy(args: GetAccessPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +63,18 @@ export interface GetAccessPolicyResult { } /** * Use this data source to access information about the permissions from the Management Key Vault Templates. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const contributor = azure.keyvault.getAccessPolicy({ + * name: "Key Management", + * }); + * export const accessPolicyKeyPermissions = contributor.then(contributor => contributor.keyPermissions); + * ``` */ export function getAccessPolicyOutput(args: GetAccessPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccessPolicy(a, opts)) diff --git a/sdk/nodejs/keyvault/getCertificate.ts b/sdk/nodejs/keyvault/getCertificate.ts index 5ff922a892..97d02767cb 100644 --- a/sdk/nodejs/keyvault/getCertificate.ts +++ b/sdk/nodejs/keyvault/getCertificate.ts @@ -8,6 +8,23 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Key Vault Certificate. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "examplekv", + * resourceGroupName: "some-resource-group", + * }); + * const exampleCertificate = exampleKeyVault.then(exampleKeyVault => azure.keyvault.getCertificate({ + * name: "secret-sauce", + * keyVaultId: exampleKeyVault.id, + * })); + * export const certificateThumbprint = exampleCertificate.then(exampleCertificate => exampleCertificate.thumbprint); + * ``` */ export function getCertificate(args: GetCertificateArgs, opts?: pulumi.InvokeOptions): Promise { @@ -107,6 +124,23 @@ export interface GetCertificateResult { } /** * Use this data source to access information about an existing Key Vault Certificate. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "examplekv", + * resourceGroupName: "some-resource-group", + * }); + * const exampleCertificate = exampleKeyVault.then(exampleKeyVault => azure.keyvault.getCertificate({ + * name: "secret-sauce", + * keyVaultId: exampleKeyVault.id, + * })); + * export const certificateThumbprint = exampleCertificate.then(exampleCertificate => exampleCertificate.thumbprint); + * ``` */ export function getCertificateOutput(args: GetCertificateOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCertificate(a, opts)) diff --git a/sdk/nodejs/keyvault/getCertificateData.ts b/sdk/nodejs/keyvault/getCertificateData.ts index bf3d0e2498..240abea8e2 100644 --- a/sdk/nodejs/keyvault/getCertificateData.ts +++ b/sdk/nodejs/keyvault/getCertificateData.ts @@ -8,6 +8,23 @@ import * as utilities from "../utilities"; * Use this data source to access data stored in an existing Key Vault Certificate. * * > **Note:** This data source uses the `GetSecret` function of the Azure API, to get the key of the certificate. Therefore you need secret/get permission + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "examplekv", + * resourceGroupName: "some-resource-group", + * }); + * const exampleCertificateData = exampleKeyVault.then(exampleKeyVault => azure.keyvault.getCertificateData({ + * name: "secret-sauce", + * keyVaultId: exampleKeyVault.id, + * })); + * export const examplePem = exampleCertificateData.then(exampleCertificateData => exampleCertificateData.pem); + * ``` */ export function getCertificateData(args: GetCertificateDataArgs, opts?: pulumi.InvokeOptions): Promise { @@ -83,6 +100,23 @@ export interface GetCertificateDataResult { * Use this data source to access data stored in an existing Key Vault Certificate. * * > **Note:** This data source uses the `GetSecret` function of the Azure API, to get the key of the certificate. Therefore you need secret/get permission + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "examplekv", + * resourceGroupName: "some-resource-group", + * }); + * const exampleCertificateData = exampleKeyVault.then(exampleKeyVault => azure.keyvault.getCertificateData({ + * name: "secret-sauce", + * keyVaultId: exampleKeyVault.id, + * })); + * export const examplePem = exampleCertificateData.then(exampleCertificateData => exampleCertificateData.pem); + * ``` */ export function getCertificateDataOutput(args: GetCertificateDataOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCertificateData(a, opts)) diff --git a/sdk/nodejs/keyvault/getCertificateIssuer.ts b/sdk/nodejs/keyvault/getCertificateIssuer.ts index f8327912d2..3d7dd16822 100644 --- a/sdk/nodejs/keyvault/getCertificateIssuer.ts +++ b/sdk/nodejs/keyvault/getCertificateIssuer.ts @@ -8,6 +8,23 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Key Vault Certificate Issuer. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "mykeyvault", + * resourceGroupName: "some-resource-group", + * }); + * const exampleCertificateIssuer = exampleKeyVault.then(exampleKeyVault => azure.keyvault.getCertificateIssuer({ + * name: "existing", + * keyVaultId: exampleKeyVault.id, + * })); + * export const id = exampleCertificateIssuer.then(exampleCertificateIssuer => exampleCertificateIssuer.id); + * ``` */ export function getCertificateIssuer(args: GetCertificateIssuerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +78,23 @@ export interface GetCertificateIssuerResult { } /** * Use this data source to access information about an existing Key Vault Certificate Issuer. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "mykeyvault", + * resourceGroupName: "some-resource-group", + * }); + * const exampleCertificateIssuer = exampleKeyVault.then(exampleKeyVault => azure.keyvault.getCertificateIssuer({ + * name: "existing", + * keyVaultId: exampleKeyVault.id, + * })); + * export const id = exampleCertificateIssuer.then(exampleCertificateIssuer => exampleCertificateIssuer.id); + * ``` */ export function getCertificateIssuerOutput(args: GetCertificateIssuerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCertificateIssuer(a, opts)) diff --git a/sdk/nodejs/keyvault/getKey.ts b/sdk/nodejs/keyvault/getKey.ts index 92dbea7d23..ddfeb94a74 100644 --- a/sdk/nodejs/keyvault/getKey.ts +++ b/sdk/nodejs/keyvault/getKey.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Key Vault Key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getKey({ + * name: "secret-sauce", + * keyVaultId: data.azurerm_key_vault.existing.id, + * }); + * export const keyType = example.then(example => example.keyType); + * ``` */ export function getKey(args: GetKeyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -105,6 +118,19 @@ export interface GetKeyResult { } /** * Use this data source to access information about an existing Key Vault Key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getKey({ + * name: "secret-sauce", + * keyVaultId: data.azurerm_key_vault.existing.id, + * }); + * export const keyType = example.then(example => example.keyType); + * ``` */ export function getKeyOutput(args: GetKeyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getKey(a, opts)) diff --git a/sdk/nodejs/keyvault/getKeyVault.ts b/sdk/nodejs/keyvault/getKeyVault.ts index 93bbd120cd..151f66da11 100644 --- a/sdk/nodejs/keyvault/getKeyVault.ts +++ b/sdk/nodejs/keyvault/getKeyVault.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Key Vault. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getKeyVault({ + * name: "mykeyvault", + * resourceGroupName: "some-resource-group", + * }); + * export const vaultUri = example.then(example => example.vaultUri); + * ``` */ export function getKeyVault(args: GetKeyVaultArgs, opts?: pulumi.InvokeOptions): Promise { @@ -94,6 +107,19 @@ export interface GetKeyVaultResult { } /** * Use this data source to access information about an existing Key Vault. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getKeyVault({ + * name: "mykeyvault", + * resourceGroupName: "some-resource-group", + * }); + * export const vaultUri = example.then(example => example.vaultUri); + * ``` */ export function getKeyVaultOutput(args: GetKeyVaultOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getKeyVault(a, opts)) diff --git a/sdk/nodejs/keyvault/getManagedHardwareSecurityModule.ts b/sdk/nodejs/keyvault/getManagedHardwareSecurityModule.ts index e10b115e34..35293c850b 100644 --- a/sdk/nodejs/keyvault/getManagedHardwareSecurityModule.ts +++ b/sdk/nodejs/keyvault/getManagedHardwareSecurityModule.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Key Vault Managed Hardware Security Module. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getManagedHardwareSecurityModule({ + * name: "mykeyvaultHsm", + * resourceGroupName: "some-resource-group", + * }); + * export const hsmUri = example.then(example => example.hsmUri); + * ``` */ export function getManagedHardwareSecurityModule(args: GetManagedHardwareSecurityModuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -75,6 +88,19 @@ export interface GetManagedHardwareSecurityModuleResult { } /** * Use this data source to access information about an existing Key Vault Managed Hardware Security Module. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getManagedHardwareSecurityModule({ + * name: "mykeyvaultHsm", + * resourceGroupName: "some-resource-group", + * }); + * export const hsmUri = example.then(example => example.hsmUri); + * ``` */ export function getManagedHardwareSecurityModuleOutput(args: GetManagedHardwareSecurityModuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getManagedHardwareSecurityModule(a, opts)) diff --git a/sdk/nodejs/keyvault/getSecret.ts b/sdk/nodejs/keyvault/getSecret.ts index ab23130ea6..c40d6a555a 100644 --- a/sdk/nodejs/keyvault/getSecret.ts +++ b/sdk/nodejs/keyvault/getSecret.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Key Vault Secret. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getSecret({ + * name: "secret-sauce", + * keyVaultId: data.azurerm_key_vault.existing.id, + * }); + * export const secretValue = example.then(example => example.value); + * ``` */ export function getSecret(args: GetSecretArgs, opts?: pulumi.InvokeOptions): Promise { @@ -83,6 +96,19 @@ export interface GetSecretResult { } /** * Use this data source to access information about an existing Key Vault Secret. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.keyvault.getSecret({ + * name: "secret-sauce", + * keyVaultId: data.azurerm_key_vault.existing.id, + * }); + * export const secretValue = example.then(example => example.value); + * ``` */ export function getSecretOutput(args: GetSecretOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSecret(a, opts)) diff --git a/sdk/nodejs/keyvault/key.ts b/sdk/nodejs/keyvault/key.ts index 982ac098bd..c10f605a02 100644 --- a/sdk/nodejs/keyvault/key.ts +++ b/sdk/nodejs/keyvault/key.ts @@ -14,6 +14,57 @@ import * as utilities from "../utilities"; * > **Note:** To use this resource, your client should have RBAC roles with permissions like `Key Vault Crypto Officer` or `Key Vault Administrator` or an assigned Key Vault Access Policy with permissions `Create`,`Delete`,`Get`,`Purge`,`Recover`,`Update` and `GetRotationPolicy` for keys without Rotation Policy. Include `SetRotationPolicy` for keys with Rotation Policy. * * > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Key resource on destroy, rather than the default soft-delete. See `purgeSoftDeletedKeysOnDestroy` for more information. + * ### Additional Examples + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * softDeleteRetentionDays: 7, + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Delete", + * "Get", + * "Purge", + * "Recover", + * "Update", + * "GetRotationPolicy", + * "SetRotationPolicy", + * ], + * secretPermissions: ["Set"], + * }], + * }); + * const generated = new azure.keyvault.Key("generated", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * rotationPolicy: { + * automatic: { + * timeBeforeExpiry: "P30D", + * }, + * expireAfter: "P90D", + * notifyBeforeExpiry: "P29D", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/keyvault/keyVault.ts b/sdk/nodejs/keyvault/keyVault.ts index a599b0fac0..eb3eabffba 100644 --- a/sdk/nodejs/keyvault/keyVault.ts +++ b/sdk/nodejs/keyvault/keyVault.ts @@ -15,6 +15,32 @@ import * as utilities from "../utilities"; * * > **Note:** It's possible to define Key Vault Certificate Contacts both within the `azure.keyvault.KeyVault` resource via the `contact` block and by using the `azure.keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * enabledForDiskEncryption: true, + * tenantId: current.then(current => current.tenantId), + * softDeleteRetentionDays: 7, + * purgeProtectionEnabled: false, + * skuName: "standard", + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: ["Get"], + * secretPermissions: ["Get"], + * storagePermissions: ["Get"], + * }], + * }); + * ``` + * * ## Import * * Key Vault's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/keyvault/managedHardwareSecurityModule.ts b/sdk/nodejs/keyvault/managedHardwareSecurityModule.ts index c3c9b87c0b..a16f51c4e6 100644 --- a/sdk/nodejs/keyvault/managedHardwareSecurityModule.ts +++ b/sdk/nodejs/keyvault/managedHardwareSecurityModule.ts @@ -11,6 +11,28 @@ import * as utilities from "../utilities"; * * > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Managed Hardware Security Module resource on destroy, rather than the default soft-delete. See `purgeSoftDeletedHardwareSecurityModulesOnDestroy` for more information. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleManagedHardwareSecurityModule = new azure.keyvault.ManagedHardwareSecurityModule("exampleManagedHardwareSecurityModule", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "Standard_B1", + * purgeProtectionEnabled: false, + * softDeleteRetentionDays: 90, + * tenantId: current.then(current => current.tenantId), + * adminObjectIds: [current.then(current => current.objectId)], + * tags: { + * Env: "Test", + * }, + * }); + * ``` + * * ## Import * * Key Vault Managed Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/keyvault/managedStorageAccount.ts b/sdk/nodejs/keyvault/managedStorageAccount.ts index cee4ea8d59..2cdcf9a250 100644 --- a/sdk/nodejs/keyvault/managedStorageAccount.ts +++ b/sdk/nodejs/keyvault/managedStorageAccount.ts @@ -7,6 +7,110 @@ import * as utilities from "../utilities"; /** * Manages a Key Vault Managed Storage Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * secretPermissions: [ + * "Get", + * "Delete", + * ], + * storagePermissions: [ + * "Get", + * "List", + * "Set", + * "SetSAS", + * "GetSAS", + * "DeleteSAS", + * "Update", + * "RegenerateKey", + * ], + * }], + * }); + * const exampleManagedStorageAccount = new azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", { + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * storageAccountKey: "key1", + * regenerateKeyAutomatically: false, + * regenerationPeriod: "P1D", + * }); + * ``` + * ### Automatically Regenerate Storage Account Access Key) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const current = azure.core.getClientConfig({}); + * const test = azuread.getServicePrincipal({ + * applicationId: "cfa8b339-82a2-471a-a3c9-0fc0be7a4093", + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * secretPermissions: [ + * "Get", + * "Delete", + * ], + * storagePermissions: [ + * "Get", + * "List", + * "Set", + * "SetSAS", + * "GetSAS", + * "DeleteSAS", + * "Update", + * "RegenerateKey", + * ], + * }], + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleAccount.id, + * roleDefinitionName: "Storage Account Key Operator Service Role", + * principalId: test.then(test => test.id), + * }); + * const exampleManagedStorageAccount = new azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", { + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * storageAccountKey: "key1", + * regenerateKeyAutomatically: true, + * regenerationPeriod: "P1D", + * }, { + * dependsOn: [exampleAssignment], + * }); + * ``` + * * ## Import * * Key Vault Managed Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/keyvault/managedStorageAccountSasTokenDefinition.ts b/sdk/nodejs/keyvault/managedStorageAccountSasTokenDefinition.ts index 79c5aab834..a18bfaadfa 100644 --- a/sdk/nodejs/keyvault/managedStorageAccountSasTokenDefinition.ts +++ b/sdk/nodejs/keyvault/managedStorageAccountSasTokenDefinition.ts @@ -7,6 +7,88 @@ import * as utilities from "../utilities"; /** * Manages a Key Vault Managed Storage Account SAS Definition. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleAccountSAS = azure.storage.getAccountSASOutput({ + * connectionString: exampleAccount.primaryConnectionString, + * httpsOnly: true, + * resourceTypes: { + * service: true, + * container: false, + * object: false, + * }, + * services: { + * blob: true, + * queue: false, + * table: false, + * file: false, + * }, + * start: "2021-04-30T00:00:00Z", + * expiry: "2023-04-30T00:00:00Z", + * permissions: { + * read: true, + * write: true, + * "delete": false, + * list: false, + * add: true, + * create: true, + * update: false, + * process: false, + * tag: false, + * filter: false, + * }, + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.tenantId), + * skuName: "standard", + * accessPolicies: [{ + * tenantId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.tenantId), + * objectId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * secretPermissions: [ + * "Get", + * "Delete", + * ], + * storagePermissions: [ + * "Get", + * "List", + * "Set", + * "SetSAS", + * "GetSAS", + * "DeleteSAS", + * "Update", + * "RegenerateKey", + * ], + * }], + * }); + * const exampleManagedStorageAccount = new azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", { + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * storageAccountKey: "key1", + * regenerateKeyAutomatically: false, + * regenerationPeriod: "P1D", + * }); + * const exampleManagedStorageAccountSasTokenDefinition = new azure.keyvault.ManagedStorageAccountSasTokenDefinition("exampleManagedStorageAccountSasTokenDefinition", { + * validityPeriod: "P1D", + * managedStorageAccountId: exampleManagedStorageAccount.id, + * sasTemplateUri: exampleAccountSAS.apply(exampleAccountSAS => exampleAccountSAS.sas), + * sasType: "account", + * }); + * ``` + * * ## Import * * Key Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/keyvault/secret.ts b/sdk/nodejs/keyvault/secret.ts index 105254c078..7517be13b5 100644 --- a/sdk/nodejs/keyvault/secret.ts +++ b/sdk/nodejs/keyvault/secret.ts @@ -15,6 +15,41 @@ import * as utilities from "../utilities"; * * ======= * > > > > > > > 8d78c87098 (Update-documentation) + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * softDeleteRetentionDays: 7, + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * ], + * secretPermissions: [ + * "Set", + * "Get", + * "Delete", + * "Purge", + * "Recover", + * ], + * }], + * }); + * const exampleSecret = new azure.keyvault.Secret("exampleSecret", { + * value: "szechuan", + * keyVaultId: exampleKeyVault.id, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/kusto/attachedDatabaseConfiguration.ts b/sdk/nodejs/kusto/attachedDatabaseConfiguration.ts index 64c47c4238..a6e0a2694d 100644 --- a/sdk/nodejs/kusto/attachedDatabaseConfiguration.ts +++ b/sdk/nodejs/kusto/attachedDatabaseConfiguration.ts @@ -9,6 +9,56 @@ import * as utilities from "../utilities"; /** * Manages a Kusto (also known as Azure Data Explorer) Attached Database Configuration * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const followerCluster = new azure.kusto.Cluster("followerCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * }); + * const followedCluster = new azure.kusto.Cluster("followedCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * }); + * const followedDatabase = new azure.kusto.Database("followedDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: followerCluster.name, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: followerCluster.name, + * }); + * const exampleAttachedDatabaseConfiguration = new azure.kusto.AttachedDatabaseConfiguration("exampleAttachedDatabaseConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: followerCluster.name, + * clusterResourceId: followedCluster.id, + * databaseName: exampleDatabase.name, + * sharing: { + * externalTablesToExcludes: ["ExternalTable2"], + * externalTablesToIncludes: ["ExternalTable1"], + * materializedViewsToExcludes: ["MaterializedViewTable2"], + * materializedViewsToIncludes: ["MaterializedViewTable1"], + * tablesToExcludes: ["Table2"], + * tablesToIncludes: ["Table1"], + * }, + * }); + * ``` + * * ## Import * * Kusto Attached Database Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/cluster.ts b/sdk/nodejs/kusto/cluster.ts index 3749f227e2..b7058a81de 100644 --- a/sdk/nodejs/kusto/cluster.ts +++ b/sdk/nodejs/kusto/cluster.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; /** * Manages a Kusto (also known as Azure Data Explorer) Cluster * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/clusterCustomerManagedKey.ts b/sdk/nodejs/kusto/clusterCustomerManagedKey.ts index 16ac203150..af899ba287 100644 --- a/sdk/nodejs/kusto/clusterCustomerManagedKey.ts +++ b/sdk/nodejs/kusto/clusterCustomerManagedKey.ts @@ -7,6 +7,81 @@ import * as utilities from "../utilities"; /** * Manages a Customer Managed Key for a Kusto Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const cluster = new azure.keyvault.AccessPolicy("cluster", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleCluster.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "UnwrapKey", + * "WrapKey", + * ], + * }); + * const client = new azure.keyvault.AccessPolicy("client", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "List", + * "Create", + * "Delete", + * "Recover", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * client, + * cluster, + * ], + * }); + * const exampleClusterCustomerManagedKey = new azure.kusto.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", { + * clusterId: exampleCluster.id, + * keyVaultId: exampleKeyVault.id, + * keyName: exampleKey.name, + * keyVersion: exampleKey.version, + * }); + * ``` + * * ## Import * * Customer Managed Keys for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/clusterManagedPrivateEndpoint.ts b/sdk/nodejs/kusto/clusterManagedPrivateEndpoint.ts index 23f81b6202..f99ee3a904 100644 --- a/sdk/nodejs/kusto/clusterManagedPrivateEndpoint.ts +++ b/sdk/nodejs/kusto/clusterManagedPrivateEndpoint.ts @@ -7,6 +7,38 @@ import * as utilities from "../utilities"; /** * Manages a Managed Private Endpoint for a Kusto Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleClusterManagedPrivateEndpoint = new azure.kusto.ClusterManagedPrivateEndpoint("exampleClusterManagedPrivateEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * clusterName: exampleCluster.name, + * privateLinkResourceId: exampleAccount.id, + * privateLinkResourceRegion: exampleAccount.location, + * groupId: "blob", + * requestMessage: "Please Approve", + * }); + * ``` + * * ## Import * * Managed Private Endpoint for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/clusterPrincipalAssignment.ts b/sdk/nodejs/kusto/clusterPrincipalAssignment.ts index 18bb579bdc..b4c7ebc22b 100644 --- a/sdk/nodejs/kusto/clusterPrincipalAssignment.ts +++ b/sdk/nodejs/kusto/clusterPrincipalAssignment.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages a Kusto Cluster Principal Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * }); + * const exampleClusterPrincipalAssignment = new azure.kusto.ClusterPrincipalAssignment("exampleClusterPrincipalAssignment", { + * resourceGroupName: exampleResourceGroup.name, + * clusterName: exampleCluster.name, + * tenantId: current.then(current => current.tenantId), + * principalId: current.then(current => current.clientId), + * principalType: "App", + * role: "AllDatabasesAdmin", + * }); + * ``` + * * ## Import * * Data Explorer Cluster Principal Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/cosmosdbDataConnection.ts b/sdk/nodejs/kusto/cosmosdbDataConnection.ts index a75106d508..a13b07580e 100644 --- a/sdk/nodejs/kusto/cosmosdbDataConnection.ts +++ b/sdk/nodejs/kusto/cosmosdbDataConnection.ts @@ -7,6 +7,100 @@ import * as utilities from "../utilities"; /** * Manages a Kusto / Cosmos Database Data Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const builtin = azure.authorization.getRoleDefinition({ + * roleDefinitionId: "fbdf93bf-df7d-467e-a4d2-9458aa1360c8", + * }); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: exampleResourceGroup.id, + * roleDefinitionName: builtin.then(builtin => builtin.name), + * principalId: exampleCluster.identity.apply(identity => identity?.principalId), + * }); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "Session", + * maxIntervalInSeconds: 5, + * maxStalenessPrefix: 100, + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "/part", + * throughput: 400, + * }); + * const exampleSqlRoleDefinition = azure.cosmosdb.getSqlRoleDefinitionOutput({ + * roleDefinitionId: "00000000-0000-0000-0000-000000000001", + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * }); + * const exampleSqlRoleAssignment = new azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment", { + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * roleDefinitionId: exampleSqlRoleDefinition.apply(exampleSqlRoleDefinition => exampleSqlRoleDefinition.id), + * principalId: exampleCluster.identity.apply(identity => identity?.principalId), + * scope: exampleAccount.id, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * }); + * const exampleScript = new azure.kusto.Script("exampleScript", { + * databaseId: exampleDatabase.id, + * scriptContent: `.create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime) + * .create table TestTable ingestion json mapping "TestMapping" + * '[' + * ' {"column":"Id","path":"$.id"},' + * ' {"column":"Name","path":"$.name"},' + * ' {"column":"_ts","path":"$._ts"},' + * ' {"column":"_timestamp","path":"$._ts", "transform":"DateTimeFromUnixSeconds"}' + * ']' + * .alter table TestTable policy ingestionbatching "{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}" + * `, + * }); + * const exampleCosmosdbDataConnection = new azure.kusto.CosmosdbDataConnection("exampleCosmosdbDataConnection", { + * location: exampleResourceGroup.location, + * cosmosdbContainerId: exampleSqlContainer.id, + * kustoDatabaseId: exampleDatabase.id, + * managedIdentityId: exampleCluster.id, + * tableName: "TestTable", + * mappingRuleName: "TestMapping", + * retrievalStartDate: "2023-06-26T12:00:00.6554616Z", + * }); + * ``` + * * ## Import * * Kusto / Cosmos Database Data Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/database.ts b/sdk/nodejs/kusto/database.ts index dc63d1b880..a7e19485e4 100644 --- a/sdk/nodejs/kusto/database.ts +++ b/sdk/nodejs/kusto/database.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a Kusto (also known as Azure Data Explorer) Database * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const cluster = new azure.kusto.Cluster("cluster", { + * location: example.location, + * resourceGroupName: example.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * }); + * const database = new azure.kusto.Database("database", { + * resourceGroupName: example.name, + * location: example.location, + * clusterName: cluster.name, + * hotCachePeriod: "P7D", + * softDeletePeriod: "P31D", + * }); + * ``` + * * ## Import * * Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/databasePrincipalAssignment.ts b/sdk/nodejs/kusto/databasePrincipalAssignment.ts index c42a99fc79..4530dbf226 100644 --- a/sdk/nodejs/kusto/databasePrincipalAssignment.ts +++ b/sdk/nodejs/kusto/databasePrincipalAssignment.ts @@ -7,6 +7,40 @@ import * as utilities from "../utilities"; /** * Manages a Kusto (also known as Azure Data Explorer) Database Principal Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * hotCachePeriod: "P7D", + * softDeletePeriod: "P31D", + * }); + * const exampleDatabasePrincipalAssignment = new azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", { + * resourceGroupName: exampleResourceGroup.name, + * clusterName: exampleCluster.name, + * databaseName: exampleDatabase.name, + * tenantId: current.then(current => current.tenantId), + * principalId: current.then(current => current.clientId), + * principalType: "App", + * role: "Viewer", + * }); + * ``` + * * ## Import * * Kusto Database Principal Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/eventGridDataConnection.ts b/sdk/nodejs/kusto/eventGridDataConnection.ts index fe5352bccb..2c8eeb7464 100644 --- a/sdk/nodejs/kusto/eventGridDataConnection.ts +++ b/sdk/nodejs/kusto/eventGridDataConnection.ts @@ -7,6 +7,79 @@ import * as utilities from "../utilities"; /** * Manages a Kusto (also known as Azure Data Explorer) Event Grid Data Connection * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * hotCachePeriod: "P7D", + * softDeletePeriod: "P31D", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 1, + * messageRetention: 1, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleEventSubscription = new azure.eventgrid.EventSubscription("exampleEventSubscription", { + * scope: exampleAccount.id, + * eventhubEndpointId: exampleEventHub.id, + * eventDeliverySchema: "EventGridSchema", + * includedEventTypes: [ + * "Microsoft.Storage.BlobCreated", + * "Microsoft.Storage.BlobRenamed", + * ], + * retryPolicy: { + * eventTimeToLive: 144, + * maxDeliveryAttempts: 10, + * }, + * }); + * const exampleEventGridDataConnection = new azure.kusto.EventGridDataConnection("exampleEventGridDataConnection", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * databaseName: exampleDatabase.name, + * storageAccountId: exampleAccount.id, + * eventhubId: exampleEventHub.id, + * eventhubConsumerGroupName: exampleConsumerGroup.name, + * tableName: "my-table", + * mappingRuleName: "my-table-mapping", + * dataFormat: "JSON", + * }, { + * dependsOn: [exampleEventSubscription], + * }); + * ``` + * * ## Import * * Kusto Event Grid Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/eventhubDataConnection.ts b/sdk/nodejs/kusto/eventhubDataConnection.ts index de3cd7eb6d..769c369dbd 100644 --- a/sdk/nodejs/kusto/eventhubDataConnection.ts +++ b/sdk/nodejs/kusto/eventhubDataConnection.ts @@ -7,6 +7,58 @@ import * as utilities from "../utilities"; /** * Manages a Kusto (also known as Azure Data Explorer) EventHub Data Connection * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const cluster = new azure.kusto.Cluster("cluster", { + * location: example.location, + * resourceGroupName: example.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * }); + * const database = new azure.kusto.Database("database", { + * resourceGroupName: example.name, + * location: example.location, + * clusterName: cluster.name, + * hotCachePeriod: "P7D", + * softDeletePeriod: "P31D", + * }); + * const eventhubNs = new azure.eventhub.EventHubNamespace("eventhubNs", { + * location: example.location, + * resourceGroupName: example.name, + * sku: "Standard", + * }); + * const eventhub = new azure.eventhub.EventHub("eventhub", { + * namespaceName: eventhubNs.name, + * resourceGroupName: example.name, + * partitionCount: 1, + * messageRetention: 1, + * }); + * const consumerGroup = new azure.eventhub.ConsumerGroup("consumerGroup", { + * namespaceName: eventhubNs.name, + * eventhubName: eventhub.name, + * resourceGroupName: example.name, + * }); + * const eventhubConnection = new azure.kusto.EventhubDataConnection("eventhubConnection", { + * resourceGroupName: example.name, + * location: example.location, + * clusterName: cluster.name, + * databaseName: database.name, + * eventhubId: eventhub.id, + * consumerGroup: consumerGroup.name, + * tableName: "my-table", + * mappingRuleName: "my-table-mapping", + * dataFormat: "JSON", + * }); + * //(Optional) + * ``` + * * ## Import * * Kusto EventHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/getCluster.ts b/sdk/nodejs/kusto/getCluster.ts index b91d08a919..848cf4ce74 100644 --- a/sdk/nodejs/kusto/getCluster.ts +++ b/sdk/nodejs/kusto/getCluster.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Kusto (also known as Azure Data Explorer) Cluster + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.kusto.getCluster({ + * name: "kustocluster", + * resourceGroupName: "test_resource_group", + * }); + * ``` */ export function getCluster(args: GetClusterArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +65,18 @@ export interface GetClusterResult { } /** * Use this data source to access information about an existing Kusto (also known as Azure Data Explorer) Cluster + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.kusto.getCluster({ + * name: "kustocluster", + * resourceGroupName: "test_resource_group", + * }); + * ``` */ export function getClusterOutput(args: GetClusterOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCluster(a, opts)) diff --git a/sdk/nodejs/kusto/getDatabase.ts b/sdk/nodejs/kusto/getDatabase.ts index 96f0039594..e63ca42436 100644 --- a/sdk/nodejs/kusto/getDatabase.ts +++ b/sdk/nodejs/kusto/getDatabase.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Kusto Database + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.kusto.getDatabase({ + * clusterName: "test_cluster", + * name: "my-kusto-database", + * resourceGroupName: "test_resource_group", + * }); + * ``` */ export function getDatabase(args: GetDatabaseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetDatabaseResult { } /** * Use this data source to access information about an existing Kusto Database + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.kusto.getDatabase({ + * clusterName: "test_cluster", + * name: "my-kusto-database", + * resourceGroupName: "test_resource_group", + * }); + * ``` */ export function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDatabase(a, opts)) diff --git a/sdk/nodejs/kusto/iotHubDataConnection.ts b/sdk/nodejs/kusto/iotHubDataConnection.ts index 09d84ce0ac..0d7fb66978 100644 --- a/sdk/nodejs/kusto/iotHubDataConnection.ts +++ b/sdk/nodejs/kusto/iotHubDataConnection.ts @@ -7,6 +7,65 @@ import * as utilities from "../utilities"; /** * Manages a Kusto (also known as Azure Data Explorer) IotHub Data Connection * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_D13_v2", + * capacity: 2, + * }, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * hotCachePeriod: "P7D", + * softDeletePeriod: "P31D", + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "B1", + * capacity: 1, + * }, + * }); + * const exampleSharedAccessPolicy = new azure.iot.SharedAccessPolicy("exampleSharedAccessPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * iothubName: exampleIoTHub.name, + * registryRead: true, + * }); + * const exampleConsumerGroup = new azure.iot.ConsumerGroup("exampleConsumerGroup", { + * resourceGroupName: exampleResourceGroup.name, + * iothubName: exampleIoTHub.name, + * eventhubEndpointName: "events", + * }); + * const exampleIotHubDataConnection = new azure.kusto.IotHubDataConnection("exampleIotHubDataConnection", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * databaseName: exampleDatabase.name, + * iothubId: exampleIoTHub.id, + * consumerGroup: exampleConsumerGroup.name, + * sharedAccessPolicyName: exampleSharedAccessPolicy.name, + * eventSystemProperties: [ + * "message-id", + * "sequence-number", + * "to", + * ], + * tableName: "my-table", + * mappingRuleName: "my-table-mapping", + * dataFormat: "JSON", + * }); + * ``` + * * ## Import * * Kusto IotHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/kusto/script.ts b/sdk/nodejs/kusto/script.ts index 6eb1babf49..881944f6fe 100644 --- a/sdk/nodejs/kusto/script.ts +++ b/sdk/nodejs/kusto/script.ts @@ -7,6 +7,66 @@ import * as utilities from "../utilities"; /** * Manages a Kusto Script. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.kusto.Cluster("exampleCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Dev(No SLA)_Standard_D11_v2", + * capacity: 1, + * }, + * }); + * const exampleDatabase = new azure.kusto.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clusterName: exampleCluster.name, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleBlob = new azure.storage.Blob("exampleBlob", { + * storageAccountName: exampleAccount.name, + * storageContainerName: exampleContainer.name, + * type: "Block", + * sourceContent: ".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)", + * }); + * const exampleAccountBlobContainerSAS = azure.storage.getAccountBlobContainerSASOutput({ + * connectionString: exampleAccount.primaryConnectionString, + * containerName: exampleContainer.name, + * httpsOnly: true, + * start: "2017-03-21", + * expiry: "2022-03-21", + * permissions: { + * read: true, + * add: false, + * create: false, + * write: true, + * "delete": false, + * list: true, + * }, + * }); + * const exampleScript = new azure.kusto.Script("exampleScript", { + * databaseId: exampleDatabase.id, + * url: exampleBlob.id, + * sasToken: exampleAccountBlobContainerSAS.apply(exampleAccountBlobContainerSAS => exampleAccountBlobContainerSAS.sas), + * continueOnErrorsEnabled: true, + * forceAnUpdateWhenValueChanged: "first", + * }); + * ``` + * * ## Import * * Kusto Scripts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lab/lab.ts b/sdk/nodejs/lab/lab.ts index 561dfcc8f6..705366d538 100644 --- a/sdk/nodejs/lab/lab.ts +++ b/sdk/nodejs/lab/lab.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a Lab Service Lab. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.lab.Lab("exampleLab", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * title: "Test Title", + * security: { + * openAccessEnabled: false, + * }, + * virtualMachine: { + * adminUser: { + * username: "testadmin", + * password: "Password1234!", + * }, + * imageReference: { + * offer: "0001-com-ubuntu-server-focal", + * publisher: "canonical", + * sku: "20_04-lts", + * version: "latest", + * }, + * sku: { + * name: "Classic_Fsv2_2_4GB_128_S_SSD", + * capacity: 0, + * }, + * }, + * }); + * ``` + * * ## Import * * Lab Service Labs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lab/schedule.ts b/sdk/nodejs/lab/schedule.ts index f60152a4a5..6101b3be68 100644 --- a/sdk/nodejs/lab/schedule.ts +++ b/sdk/nodejs/lab/schedule.ts @@ -9,6 +9,44 @@ import * as utilities from "../utilities"; /** * Manages a Lab Service Schedule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.lab.Lab("exampleLab", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * title: "Test Title", + * security: { + * openAccessEnabled: false, + * }, + * virtualMachine: { + * adminUser: { + * username: "testadmin", + * password: "Password1234!", + * }, + * imageReference: { + * offer: "0001-com-ubuntu-server-focal", + * publisher: "canonical", + * sku: "20_04-lts", + * version: "latest", + * }, + * sku: { + * name: "Classic_Fsv2_2_4GB_128_S_SSD", + * capacity: 1, + * }, + * }, + * }); + * const exampleSchedule = new azure.lab.Schedule("exampleSchedule", { + * labId: exampleLab.id, + * stopTime: "2022-11-28T00:00:00Z", + * timeZone: "America/Los_Angeles", + * }); + * ``` + * * ## Import * * Lab Service Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lab/servicePlan.ts b/sdk/nodejs/lab/servicePlan.ts index ab890e995f..bc7b636676 100644 --- a/sdk/nodejs/lab/servicePlan.ts +++ b/sdk/nodejs/lab/servicePlan.ts @@ -11,6 +11,20 @@ import * as utilities from "../utilities"; * * > **Note:** Before using this resource, it's required to submit the request of registering the provider with Azure CLI `az provider register --namespace Microsoft.LabServices`. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicePlan = new azure.lab.ServicePlan("exampleServicePlan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allowedRegions: [exampleResourceGroup.location], + * }); + * ``` + * * ## Import * * Lab Service Plans can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lab/user.ts b/sdk/nodejs/lab/user.ts index 2adba45f7f..1fcb51fa58 100644 --- a/sdk/nodejs/lab/user.ts +++ b/sdk/nodejs/lab/user.ts @@ -7,6 +7,43 @@ import * as utilities from "../utilities"; /** * Manages a Lab Service User. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLab = new azure.lab.Lab("exampleLab", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * title: "Test Title", + * security: { + * openAccessEnabled: false, + * }, + * virtualMachine: { + * adminUser: { + * username: "testadmin", + * password: "Password1234!", + * }, + * imageReference: { + * offer: "0001-com-ubuntu-server-focal", + * publisher: "canonical", + * sku: "20_04-lts", + * version: "latest", + * }, + * sku: { + * name: "Classic_Fsv2_2_4GB_128_S_SSD", + * capacity: 1, + * }, + * }, + * }); + * const exampleUser = new azure.lab.User("exampleUser", { + * labId: exampleLab.id, + * email: "terraform-acctest@hashicorp.com", + * }); + * ``` + * * ## Import * * Lab Service Users can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lb/backendAddressPool.ts b/sdk/nodejs/lb/backendAddressPool.ts index a28ff059a8..37a739d561 100644 --- a/sdk/nodejs/lb/backendAddressPool.ts +++ b/sdk/nodejs/lb/backendAddressPool.ts @@ -11,6 +11,29 @@ import * as utilities from "../utilities"; * * > **NOTE:** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleBackendAddressPool = new azure.lb.BackendAddressPool("exampleBackendAddressPool", {loadbalancerId: exampleLoadBalancer.id}); + * ``` + * * ## Import * * Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lb/backendAddressPoolAddress.ts b/sdk/nodejs/lb/backendAddressPoolAddress.ts index 99af27b8da..3edc59d144 100644 --- a/sdk/nodejs/lb/backendAddressPoolAddress.ts +++ b/sdk/nodejs/lb/backendAddressPoolAddress.ts @@ -11,6 +11,43 @@ import * as utilities from "../utilities"; * * > **Note:** Backend Addresses can only be added to a `Standard` SKU Load Balancer. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleVirtualNetwork = azure.network.getVirtualNetwork({ + * name: "example-network", + * resourceGroupName: "example-resources", + * }); + * const exampleLB = azure.lb.getLB({ + * name: "example-lb", + * resourceGroupName: "example-resources", + * }); + * const exampleBackendAddressPool = exampleLB.then(exampleLB => azure.lb.getBackendAddressPool({ + * name: "first", + * loadbalancerId: exampleLB.id, + * })); + * const exampleBackendAddressPoolAddress = new azure.lb.BackendAddressPoolAddress("exampleBackendAddressPoolAddress", { + * backendAddressPoolId: exampleBackendAddressPool.then(exampleBackendAddressPool => exampleBackendAddressPool.id), + * virtualNetworkId: exampleVirtualNetwork.then(exampleVirtualNetwork => exampleVirtualNetwork.id), + * ipAddress: "10.0.0.1", + * }); + * const backend-pool-cr = exampleLB.then(exampleLB => azure.lb.getBackendAddressPool({ + * name: "globalLBBackendPool", + * loadbalancerId: exampleLB.id, + * })); + * const example_1 = new azure.lb.BackendAddressPoolAddress("example-1", { + * backendAddressPoolId: backend_pool_cr.then(backend_pool_cr => backend_pool_cr.id), + * backendAddressIpConfigurationId: azurerm_lb["backend-lb-R1"].frontend_ip_configuration[0].id, + * }); + * const example_2 = new azure.lb.BackendAddressPoolAddress("example-2", { + * backendAddressPoolId: backend_pool_cr.then(backend_pool_cr => backend_pool_cr.id), + * backendAddressIpConfigurationId: azurerm_lb["backend-lb-R2"].frontend_ip_configuration[0].id, + * }); + * ``` + * * ## Import * * Backend Address Pool Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lb/getBackendAddressPool.ts b/sdk/nodejs/lb/getBackendAddressPool.ts index e85fe4dd37..507488e1ae 100644 --- a/sdk/nodejs/lb/getBackendAddressPool.ts +++ b/sdk/nodejs/lb/getBackendAddressPool.ts @@ -8,6 +8,24 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Load Balancer's Backend Address Pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleLB = azure.lb.getLB({ + * name: "example-lb", + * resourceGroupName: "example-resources", + * }); + * const exampleBackendAddressPool = exampleLB.then(exampleLB => azure.lb.getBackendAddressPool({ + * name: "first", + * loadbalancerId: exampleLB.id, + * })); + * export const backendAddressPoolId = exampleBackendAddressPool.then(exampleBackendAddressPool => exampleBackendAddressPool.id); + * export const backendIpConfigurationIds = data.azurerm_lb_backend_address_pool.beap.backend_ip_configurations.map(__item => __item.id); + * ``` */ export function getBackendAddressPool(args: GetBackendAddressPoolArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +86,24 @@ export interface GetBackendAddressPoolResult { } /** * Use this data source to access information about an existing Load Balancer's Backend Address Pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleLB = azure.lb.getLB({ + * name: "example-lb", + * resourceGroupName: "example-resources", + * }); + * const exampleBackendAddressPool = exampleLB.then(exampleLB => azure.lb.getBackendAddressPool({ + * name: "first", + * loadbalancerId: exampleLB.id, + * })); + * export const backendAddressPoolId = exampleBackendAddressPool.then(exampleBackendAddressPool => exampleBackendAddressPool.id); + * export const backendIpConfigurationIds = data.azurerm_lb_backend_address_pool.beap.backend_ip_configurations.map(__item => __item.id); + * ``` */ export function getBackendAddressPoolOutput(args: GetBackendAddressPoolOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBackendAddressPool(a, opts)) diff --git a/sdk/nodejs/lb/getLB.ts b/sdk/nodejs/lb/getLB.ts index d796ae6e5e..3b94aa593f 100644 --- a/sdk/nodejs/lb/getLB.ts +++ b/sdk/nodejs/lb/getLB.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Load Balancer + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.lb.getLB({ + * name: "example-lb", + * resourceGroupName: "example-resources", + * }); + * export const loadbalancerId = example.then(example => example.id); + * ``` */ export function getLB(args: GetLBArgs, opts?: pulumi.InvokeOptions): Promise { @@ -72,6 +85,19 @@ export interface GetLBResult { } /** * Use this data source to access information about an existing Load Balancer + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.lb.getLB({ + * name: "example-lb", + * resourceGroupName: "example-resources", + * }); + * export const loadbalancerId = example.then(example => example.id); + * ``` */ export function getLBOutput(args: GetLBOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getLB(a, opts)) diff --git a/sdk/nodejs/lb/getLBOutboundRule.ts b/sdk/nodejs/lb/getLBOutboundRule.ts index b7be5ada62..bfea383694 100644 --- a/sdk/nodejs/lb/getLBOutboundRule.ts +++ b/sdk/nodejs/lb/getLBOutboundRule.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Load Balancer Outbound Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.lb.getLBOutboundRule({ + * name: "existing_lb_outbound_rule", + * loadbalancerId: "existing_load_balancer_id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLBOutboundRule(args: GetLBOutboundRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -72,6 +85,19 @@ export interface GetLBOutboundRuleResult { } /** * Use this data source to access information about an existing Load Balancer Outbound Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.lb.getLBOutboundRule({ + * name: "existing_lb_outbound_rule", + * loadbalancerId: "existing_load_balancer_id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLBOutboundRuleOutput(args: GetLBOutboundRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getLBOutboundRule(a, opts)) diff --git a/sdk/nodejs/lb/loadBalancer.ts b/sdk/nodejs/lb/loadBalancer.ts index f3aab978d0..048e6975a1 100644 --- a/sdk/nodejs/lb/loadBalancer.ts +++ b/sdk/nodejs/lb/loadBalancer.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Load Balancer Resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * ``` + * * ## Import * * Load Balancers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lb/natPool.ts b/sdk/nodejs/lb/natPool.ts index bf96a925e3..4737afc61f 100644 --- a/sdk/nodejs/lb/natPool.ts +++ b/sdk/nodejs/lb/natPool.ts @@ -11,6 +11,37 @@ import * as utilities from "../utilities"; * * > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleNatPool = new azure.lb.NatPool("exampleNatPool", { + * resourceGroupName: exampleResourceGroup.name, + * loadbalancerId: exampleLoadBalancer.id, + * protocol: "Tcp", + * frontendPortStart: 80, + * frontendPortEnd: 81, + * backendPort: 8080, + * frontendIpConfigurationName: "PublicIPAddress", + * }); + * ``` + * * ## Import * * Load Balancer NAT Pools can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lb/outboundRule.ts b/sdk/nodejs/lb/outboundRule.ts index 226cbee336..2a9234fcc2 100644 --- a/sdk/nodejs/lb/outboundRule.ts +++ b/sdk/nodejs/lb/outboundRule.ts @@ -11,6 +11,37 @@ import * as utilities from "../utilities"; * * > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration and a Backend Address Pool Attached. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleBackendAddressPool = new azure.lb.BackendAddressPool("exampleBackendAddressPool", {loadbalancerId: exampleLoadBalancer.id}); + * const exampleOutboundRule = new azure.lb.OutboundRule("exampleOutboundRule", { + * loadbalancerId: exampleLoadBalancer.id, + * protocol: "Tcp", + * backendAddressPoolId: exampleBackendAddressPool.id, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * }], + * }); + * ``` + * * ## Import * * Load Balancer Outbound Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lb/probe.ts b/sdk/nodejs/lb/probe.ts index 5b5eceed97..e847fa434b 100644 --- a/sdk/nodejs/lb/probe.ts +++ b/sdk/nodejs/lb/probe.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; * * > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleProbe = new azure.lb.Probe("exampleProbe", { + * loadbalancerId: exampleLoadBalancer.id, + * port: 22, + * }); + * ``` + * * ## Import * * Load Balancer Probes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lb/rule.ts b/sdk/nodejs/lb/rule.ts index d9bed31f28..63cbaba23d 100644 --- a/sdk/nodejs/lb/rule.ts +++ b/sdk/nodejs/lb/rule.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; * * > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: "West US", + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: "West US", + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "PublicIPAddress", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleRule = new azure.lb.Rule("exampleRule", { + * loadbalancerId: exampleLoadBalancer.id, + * protocol: "Tcp", + * frontendPort: 3389, + * backendPort: 3389, + * frontendIpConfigurationName: "PublicIPAddress", + * }); + * ``` + * * ## Import * * Load Balancer Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lighthouse/assignment.ts b/sdk/nodejs/lighthouse/assignment.ts index 10a47cb7a6..9434571ae3 100644 --- a/sdk/nodejs/lighthouse/assignment.ts +++ b/sdk/nodejs/lighthouse/assignment.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Assignment to a subscription, or to a resource group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const example = new azure.lighthouse.Assignment("example", { + * scope: primary.then(primary => primary.id), + * lighthouseDefinitionId: "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000", + * }); + * ``` + * * ## Import * * Lighthouse Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/lighthouse/definition.ts b/sdk/nodejs/lighthouse/definition.ts index 01e4f15814..7da379c2a8 100644 --- a/sdk/nodejs/lighthouse/definition.ts +++ b/sdk/nodejs/lighthouse/definition.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; /** * Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Definition. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const contributor = azure.authorization.getRoleDefinition({ + * roleDefinitionId: "b24988ac-6180-42a0-ab88-20f7382dd24c", + * }); + * const example = new azure.lighthouse.Definition("example", { + * description: "This is a lighthouse definition created IaC", + * managingTenantId: "00000000-0000-0000-0000-000000000000", + * scope: "/subscriptions/00000000-0000-0000-0000-000000000000", + * authorizations: [{ + * principalId: "00000000-0000-0000-0000-000000000000", + * roleDefinitionId: contributor.then(contributor => contributor.roleDefinitionId), + * principalDisplayName: "Tier 1 Support", + * }], + * }); + * ``` + * * ## Import * * Lighthouse Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loadtest/loadTest.ts b/sdk/nodejs/loadtest/loadTest.ts index 3c0186e748..23ce8b3d7e 100644 --- a/sdk/nodejs/loadtest/loadTest.ts +++ b/sdk/nodejs/loadtest/loadTest.ts @@ -11,6 +11,22 @@ import * as utilities from "../utilities"; * * Manages a Load Test Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleLoadTest = new azure.loadtest.LoadTest("exampleLoadTest", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` * ## Blocks Reference * * ### `identity` Block diff --git a/sdk/nodejs/loganalytics/cluster.ts b/sdk/nodejs/loganalytics/cluster.ts index 70dd43218f..4687dfd551 100644 --- a/sdk/nodejs/loganalytics/cluster.ts +++ b/sdk/nodejs/loganalytics/cluster.ts @@ -11,6 +11,22 @@ import * as utilities from "../utilities"; * * Manages a Log Analytics Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.loganalytics.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` + * * ## Import * * Log Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/clusterCustomerManagedKey.ts b/sdk/nodejs/loganalytics/clusterCustomerManagedKey.ts index 7d824458b6..e42d9c199c 100644 --- a/sdk/nodejs/loganalytics/clusterCustomerManagedKey.ts +++ b/sdk/nodejs/loganalytics/clusterCustomerManagedKey.ts @@ -7,6 +7,70 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Cluster Customer Managed Key. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getClientConfig({}); + * const exampleCluster = new azure.loganalytics.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * "GetRotationPolicy", + * ], + * secretPermissions: ["Set"], + * }, + * { + * tenantId: exampleCluster.identity.apply(identity => identity.tenantId), + * objectId: exampleCluster.identity.apply(identity => identity.principalId), + * keyPermissions: [ + * "Get", + * "Unwrapkey", + * "Wrapkey", + * ], + * }, + * ], + * tags: { + * environment: "Production", + * }, + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }); + * const exampleClusterCustomerManagedKey = new azure.loganalytics.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", { + * logAnalyticsClusterId: exampleCluster.id, + * keyVaultKeyId: exampleKey.id, + * }); + * ``` + * * ## Import * * Log Analytics Cluster Customer Managed Keys can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/dataExportRule.ts b/sdk/nodejs/loganalytics/dataExportRule.ts index bbf0e7966d..0a4087851c 100644 --- a/sdk/nodejs/loganalytics/dataExportRule.ts +++ b/sdk/nodejs/loganalytics/dataExportRule.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Data Export Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDataExportRule = new azure.loganalytics.DataExportRule("exampleDataExportRule", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * destinationResourceId: exampleAccount.id, + * tableNames: ["Heartbeat"], + * enabled: true, + * }); + * ``` + * * ## Import * * Log Analytics Data Export Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/dataSourceWindowsEvent.ts b/sdk/nodejs/loganalytics/dataSourceWindowsEvent.ts index 2a4d15e4eb..790ef89c7a 100644 --- a/sdk/nodejs/loganalytics/dataSourceWindowsEvent.ts +++ b/sdk/nodejs/loganalytics/dataSourceWindowsEvent.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Windows Event DataSource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleDataSourceWindowsEvent = new azure.loganalytics.DataSourceWindowsEvent("exampleDataSourceWindowsEvent", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceName: exampleAnalyticsWorkspace.name, + * eventLogName: "Application", + * eventTypes: ["Error"], + * }); + * ``` + * * ## Import * * Log Analytics Windows Event DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/dataSourceWindowsPerformanceCounter.ts b/sdk/nodejs/loganalytics/dataSourceWindowsPerformanceCounter.ts index 5344362891..2a4aac7360 100644 --- a/sdk/nodejs/loganalytics/dataSourceWindowsPerformanceCounter.ts +++ b/sdk/nodejs/loganalytics/dataSourceWindowsPerformanceCounter.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics (formally Operational Insights) Windows Performance Counter DataSource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleDataSourceWindowsPerformanceCounter = new azure.loganalytics.DataSourceWindowsPerformanceCounter("exampleDataSourceWindowsPerformanceCounter", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceName: exampleAnalyticsWorkspace.name, + * objectName: "CPU", + * instanceName: "*", + * counterName: "CPU", + * intervalSeconds: 10, + * }); + * ``` + * * ## Import * * Log Analytics Windows Performance Counter DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/linkedService.ts b/sdk/nodejs/loganalytics/linkedService.ts index 26e728315a..d3b7bb58aa 100644 --- a/sdk/nodejs/loganalytics/linkedService.ts +++ b/sdk/nodejs/loganalytics/linkedService.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Linked Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.automation.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * tags: { + * environment: "development", + * }, + * }); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleLinkedService = new azure.loganalytics.LinkedService("exampleLinkedService", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceId: exampleAnalyticsWorkspace.id, + * readAccessId: exampleAccount.id, + * }); + * ``` + * * ## Import * * Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/linkedStorageAccount.ts b/sdk/nodejs/loganalytics/linkedStorageAccount.ts index 03655eab5b..185f58362d 100644 --- a/sdk/nodejs/loganalytics/linkedStorageAccount.ts +++ b/sdk/nodejs/loganalytics/linkedStorageAccount.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Linked Storage Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLinkedStorageAccount = new azure.loganalytics.LinkedStorageAccount("exampleLinkedStorageAccount", { + * dataSourceType: "CustomLogs", + * resourceGroupName: exampleResourceGroup.name, + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * storageAccountIds: [exampleAccount.id], + * }); + * ``` + * * ## Import * * Log Analytics Linked Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/queryPack.ts b/sdk/nodejs/loganalytics/queryPack.ts index 65e91b5858..7b8d0f09b4 100644 --- a/sdk/nodejs/loganalytics/queryPack.ts +++ b/sdk/nodejs/loganalytics/queryPack.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Query Pack. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleQueryPack = new azure.loganalytics.QueryPack("exampleQueryPack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Log Analytics Query Packs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/savedSearch.ts b/sdk/nodejs/loganalytics/savedSearch.ts index 8d0ef3e8cb..2518c76d52 100644 --- a/sdk/nodejs/loganalytics/savedSearch.ts +++ b/sdk/nodejs/loganalytics/savedSearch.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics (formally Operational Insights) Saved Search. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleSavedSearch = new azure.loganalytics.SavedSearch("exampleSavedSearch", { + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * category: "exampleCategory", + * displayName: "exampleDisplayName", + * query: "exampleQuery", + * }); + * ``` + * * ## Import * * Log Analytics Saved Searches can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/loganalytics/storageInsights.ts b/sdk/nodejs/loganalytics/storageInsights.ts index 90125284f1..08a7c75d44 100644 --- a/sdk/nodejs/loganalytics/storageInsights.ts +++ b/sdk/nodejs/loganalytics/storageInsights.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Storage Insights resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleStorageInsights = new azure.loganalytics.StorageInsights("exampleStorageInsights", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceId: exampleAnalyticsWorkspace.id, + * storageAccountId: exampleAccount.id, + * storageAccountKey: exampleAccount.primaryAccessKey, + * }); + * ``` + * * ## Import * * Log Analytics Storage Insight Configs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/actionCustom.ts b/sdk/nodejs/logicapps/actionCustom.ts index 9ecd00d8e5..fda3d0f170 100644 --- a/sdk/nodejs/logicapps/actionCustom.ts +++ b/sdk/nodejs/logicapps/actionCustom.ts @@ -7,6 +7,37 @@ import * as utilities from "../utilities"; /** * Manages a Custom Action within a Logic App Workflow * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkflow = new azure.logicapps.Workflow("exampleWorkflow", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleActionCustom = new azure.logicapps.ActionCustom("exampleActionCustom", { + * logicAppId: exampleWorkflow.id, + * body: `{ + * "description": "A variable to configure the auto expiration age in days. Configured in negative number. Default is -30 (30 days old).", + * "inputs": { + * "variables": [ + * { + * "name": "ExpirationAgeInDays", + * "type": "Integer", + * "value": -30 + * } + * ] + * }, + * "runAfter": {}, + * "type": "InitializeVariable" + * } + * `, + * }); + * ``` + * * ## Import * * Logic App Custom Actions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/actionHttp.ts b/sdk/nodejs/logicapps/actionHttp.ts index 5a5ef6a519..943ebe2d5b 100644 --- a/sdk/nodejs/logicapps/actionHttp.ts +++ b/sdk/nodejs/logicapps/actionHttp.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages an HTTP Action within a Logic App Workflow * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkflow = new azure.logicapps.Workflow("exampleWorkflow", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleActionHttp = new azure.logicapps.ActionHttp("exampleActionHttp", { + * logicAppId: exampleWorkflow.id, + * method: "GET", + * uri: "http://example.com/some-webhook", + * }); + * ``` + * * ## Import * * Logic App HTTP Actions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/getIntegrationAccount.ts b/sdk/nodejs/logicapps/getIntegrationAccount.ts index ce744f0d86..f0851afcef 100644 --- a/sdk/nodejs/logicapps/getIntegrationAccount.ts +++ b/sdk/nodejs/logicapps/getIntegrationAccount.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Logic App Integration Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.logicapps.getIntegrationAccount({ + * name: "example-account", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getIntegrationAccount(args: GetIntegrationAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetIntegrationAccountResult { } /** * Use this data source to access information about an existing Logic App Integration Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.logicapps.getIntegrationAccount({ + * name: "example-account", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getIntegrationAccountOutput(args: GetIntegrationAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getIntegrationAccount(a, opts)) diff --git a/sdk/nodejs/logicapps/getStandard.ts b/sdk/nodejs/logicapps/getStandard.ts index e930660d7c..7388d662fc 100644 --- a/sdk/nodejs/logicapps/getStandard.ts +++ b/sdk/nodejs/logicapps/getStandard.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Logic App Standard instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.logicapps.getStandard({ + * name: "logicappstd", + * resourceGroupName: "example-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getStandard(args: GetStandardArgs, opts?: pulumi.InvokeOptions): Promise { @@ -79,6 +92,19 @@ export interface GetStandardResult { } /** * Use this data source to access information about an existing Logic App Standard instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.logicapps.getStandard({ + * name: "logicappstd", + * resourceGroupName: "example-rg", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getStandardOutput(args: GetStandardOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getStandard(a, opts)) diff --git a/sdk/nodejs/logicapps/getWorkflow.ts b/sdk/nodejs/logicapps/getWorkflow.ts index b4e8e64e35..73ce9dbacd 100644 --- a/sdk/nodejs/logicapps/getWorkflow.ts +++ b/sdk/nodejs/logicapps/getWorkflow.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Logic App Workflow. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.logicapps.getWorkflow({ + * name: "workflow1", + * resourceGroupName: "my-resource-group", + * }); + * export const accessEndpoint = example.then(example => example.accessEndpoint); + * ``` */ export function getWorkflow(args: GetWorkflowArgs, opts?: pulumi.InvokeOptions): Promise { @@ -93,6 +106,19 @@ export interface GetWorkflowResult { } /** * Use this data source to access information about an existing Logic App Workflow. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.logicapps.getWorkflow({ + * name: "workflow1", + * resourceGroupName: "my-resource-group", + * }); + * export const accessEndpoint = example.then(example => example.accessEndpoint); + * ``` */ export function getWorkflowOutput(args: GetWorkflowOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWorkflow(a, opts)) diff --git a/sdk/nodejs/logicapps/integrationAccount.ts b/sdk/nodejs/logicapps/integrationAccount.ts index f99b4fe44e..0f8a449792 100644 --- a/sdk/nodejs/logicapps/integrationAccount.ts +++ b/sdk/nodejs/logicapps/integrationAccount.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "Standard", + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Logic App Integration Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountAgreement.ts b/sdk/nodejs/logicapps/integrationAccountAgreement.ts index 2418caed86..731c955fbe 100644 --- a/sdk/nodejs/logicapps/integrationAccountAgreement.ts +++ b/sdk/nodejs/logicapps/integrationAccountAgreement.ts @@ -9,6 +9,53 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Agreement. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const testIntegrationAccount = new azure.logicapps.IntegrationAccount("testIntegrationAccount", { + * location: example.location, + * resourceGroupName: example.name, + * skuName: "Standard", + * }); + * const host = new azure.logicapps.IntegrationAccountPartner("host", { + * resourceGroupName: example.name, + * integrationAccountName: testIntegrationAccount.name, + * businessIdentities: [{ + * qualifier: "AS2Identity", + * value: "FabrikamNY", + * }], + * }); + * const guest = new azure.logicapps.IntegrationAccountPartner("guest", { + * resourceGroupName: example.name, + * integrationAccountName: testIntegrationAccount.name, + * businessIdentities: [{ + * qualifier: "AS2Identity", + * value: "FabrikamDC", + * }], + * }); + * const testIntegrationAccountAgreement = new azure.logicapps.IntegrationAccountAgreement("testIntegrationAccountAgreement", { + * resourceGroupName: example.name, + * integrationAccountName: testIntegrationAccount.name, + * agreementType: "AS2", + * hostPartnerName: host.name, + * guestPartnerName: guest.name, + * content: fs.readFileSync("testdata/integration_account_agreement_content_as2.json"), + * hostIdentity: { + * qualifier: "AS2Identity", + * value: "FabrikamNY", + * }, + * guestIdentity: { + * qualifier: "AS2Identity", + * value: "FabrikamDC", + * }, + * }); + * ``` + * * ## Import * * Logic App Integration Account Agreements can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountAssembly.ts b/sdk/nodejs/logicapps/integrationAccountAssembly.ts index e7bb17f291..23d42cea70 100644 --- a/sdk/nodejs/logicapps/integrationAccountAssembly.ts +++ b/sdk/nodejs/logicapps/integrationAccountAssembly.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Assembly. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleIntegrationAccountAssembly = new azure.logicapps.IntegrationAccountAssembly("exampleIntegrationAccountAssembly", { + * resourceGroupName: exampleResourceGroup.name, + * integrationAccountName: exampleIntegrationAccount.name, + * assemblyName: "TestAssembly", + * content: Buffer.from(fs.readFileSync("testdata/log4net.dll"), 'binary').toString('base64'), + * }); + * ``` + * * ## Import * * Logic App Integration Account Assemblies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountBatchConfiguration.ts b/sdk/nodejs/logicapps/integrationAccountBatchConfiguration.ts index 246983121c..e2119276aa 100644 --- a/sdk/nodejs/logicapps/integrationAccountBatchConfiguration.ts +++ b/sdk/nodejs/logicapps/integrationAccountBatchConfiguration.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Batch Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleIntegrationAccountBatchConfiguration = new azure.logicapps.IntegrationAccountBatchConfiguration("exampleIntegrationAccountBatchConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * integrationAccountName: exampleIntegrationAccount.name, + * batchGroupName: "TestBatchGroup", + * releaseCriteria: { + * messageCount: 80, + * }, + * }); + * ``` + * * ## Import * * Logic App Integration Account Batch Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountCertificate.ts b/sdk/nodejs/logicapps/integrationAccountCertificate.ts index 8fa8c2d579..c418eadcbd 100644 --- a/sdk/nodejs/logicapps/integrationAccountCertificate.ts +++ b/sdk/nodejs/logicapps/integrationAccountCertificate.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleIntegrationAccountCertificate = new azure.logicapps.IntegrationAccountCertificate("exampleIntegrationAccountCertificate", { + * resourceGroupName: exampleResourceGroup.name, + * integrationAccountName: exampleIntegrationAccount.name, + * publicCertificate: "MIIDbzCCAlegAwIBAgIJAIzjRD36sIbbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAl0ZXJyYWZvcm0xFTATBgNVBAMMDHRlcnJhZm9ybS5pbzAgFw0xNzA0MjEyMDA1MjdaGA8yMTE3MDMyODIwMDUyN1owTTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAoMCXRlcnJhZm9ybTEVMBMGA1UEAwwMdGVycmFmb3JtLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3L9L5szT4+FLykTFNyyPjy/k3BQTYAfRQzP2dhnsuUKm3cdPC0NyZ+wEXIUGhoDO2YG6EYChOl8fsDqDOjloSUGKqYw++nlpHIuUgJx8IxxG2XkALCjFU7EmF+w7kn76d0ezpEIYxnLP+KG2DVornoEt1aLhv1MLmpgEZZPhDbMSLhSYWeTVRMayXLwqtfgnDumQSB+8d/1JuJqrSI4pD12JozVThzb6hsjfb6RMX4epPmrGn0PbTPEEA6awmsxBCXB0s13nNQt/O0hLM2agwvAyozilQV+s616Ckgk6DJoUkqZhDy7vPYMIRSr98fBws6zkrV6tTLjmD8xAvobePQIDAQABo1AwTjAdBgNVHQ4EFgQUXIqO421zMMmbcRRX9wctZFCQuPIwHwYDVR0jBBgwFoAUXIqO421zMMmbcRRX9wctZFCQuPIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAr82NeT3BYJOKLlUL6Om5LjUF66ewcJjG9ltdvyQwVneMcq7t5UAPxgChzqNRVk4da8PzkXpjBJyWezHupdJNX3XqeUk2kSxqQ6/gmhqvfI3y7djrwoO6jvMEY26WqtkTNORWDP3THJJVimC3zV+KMU5UBVrEzhOVhHSU709lBP75o0BBn3xGsPqSq9k8IotIFfyAc6a+XP3+ZMpvh7wqAUml7vWa5wlcXExCx39h1balfDSLGNC4swWPCp9AMnQR0p+vMay9hNP1Eh+9QYUai14d5KS3cFV+KxE1cJR5HD/iLltnnOEbpMsB0eVOZWkFvE7Y5lW0oVSAfin5TwTJMQ==", + * }); + * ``` + * * ## Import * * Logic App Integration Account Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountMap.ts b/sdk/nodejs/logicapps/integrationAccountMap.ts index b7c06b82b3..1651b9354f 100644 --- a/sdk/nodejs/logicapps/integrationAccountMap.ts +++ b/sdk/nodejs/logicapps/integrationAccountMap.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Map. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleIntegrationAccountMap = new azure.logicapps.IntegrationAccountMap("exampleIntegrationAccountMap", { + * resourceGroupName: exampleResourceGroup.name, + * integrationAccountName: exampleIntegrationAccount.name, + * mapType: "Xslt", + * content: fs.readFileSync("testdata/integration_account_map_content.xsd"), + * }); + * ``` + * * ## Import * * Logic App Integration Account Maps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountPartner.ts b/sdk/nodejs/logicapps/integrationAccountPartner.ts index 9a05f5a55e..de3f250d54 100644 --- a/sdk/nodejs/logicapps/integrationAccountPartner.ts +++ b/sdk/nodejs/logicapps/integrationAccountPartner.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Partner. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleIntegrationAccountPartner = new azure.logicapps.IntegrationAccountPartner("exampleIntegrationAccountPartner", { + * resourceGroupName: exampleResourceGroup.name, + * integrationAccountName: exampleIntegrationAccount.name, + * businessIdentities: [{ + * qualifier: "ZZ", + * value: "AA", + * }], + * }); + * ``` + * * ## Import * * Logic App Integration Account Partners can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountSchema.ts b/sdk/nodejs/logicapps/integrationAccountSchema.ts index b887d26757..9a27ef97c4 100644 --- a/sdk/nodejs/logicapps/integrationAccountSchema.ts +++ b/sdk/nodejs/logicapps/integrationAccountSchema.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Schema. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleIntegrationAccountSchema = new azure.logicapps.IntegrationAccountSchema("exampleIntegrationAccountSchema", { + * resourceGroupName: exampleResourceGroup.name, + * integrationAccountName: exampleIntegrationAccount.name, + * content: fs.readFileSync("testdata/integration_account_schema_content.xsd"), + * }); + * ``` + * * ## Import * * Logic App Integration Account Schemas can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/integrationAccountSession.ts b/sdk/nodejs/logicapps/integrationAccountSession.ts index c420cb2b1b..e8fb12a991 100644 --- a/sdk/nodejs/logicapps/integrationAccountSession.ts +++ b/sdk/nodejs/logicapps/integrationAccountSession.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Integration Account Session. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIntegrationAccount = new azure.logicapps.IntegrationAccount("exampleIntegrationAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Basic", + * }); + * const exampleIntegrationAccountSession = new azure.logicapps.IntegrationAccountSession("exampleIntegrationAccountSession", { + * resourceGroupName: exampleResourceGroup.name, + * integrationAccountName: exampleIntegrationAccount.name, + * content: ` { + * "controlNumber": "1234" + * } + * `, + * }); + * ``` + * * ## Import * * Logic App Integration Account Sessions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/interationServiceEnvironment.ts b/sdk/nodejs/logicapps/interationServiceEnvironment.ts index b8589af7f6..be07de31c5 100644 --- a/sdk/nodejs/logicapps/interationServiceEnvironment.ts +++ b/sdk/nodejs/logicapps/interationServiceEnvironment.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; * * !> **NOTE:** The `azure.logicapps.InterationServiceEnvironment` resource is deprecated and will be removed in v4.0 of the Azure Provider. The underlying Azure Service is being retired on 2024-08-31 and new instances cannot be provisioned by default after 2022-11-01. More information on the retirement and how to migrate to Logic Apps Standard [can be found here](https://aka.ms/isedeprecation). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/22"], + * }); + * const isesubnet1 = new azure.network.Subnet("isesubnet1", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/27"], + * delegations: [{ + * name: "integrationServiceEnvironments", + * serviceDelegation: { + * name: "Microsoft.Logic/integrationServiceEnvironments", + * }, + * }], + * }); + * const isesubnet2 = new azure.network.Subnet("isesubnet2", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.32/27"], + * }); + * const isesubnet3 = new azure.network.Subnet("isesubnet3", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.64/27"], + * }); + * const isesubnet4 = new azure.network.Subnet("isesubnet4", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.96/27"], + * }); + * const exampleInterationServiceEnvironment = new azure.logicapps.InterationServiceEnvironment("exampleInterationServiceEnvironment", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Developer_0", + * accessEndpointType: "Internal", + * virtualNetworkSubnetIds: [ + * isesubnet1.id, + * isesubnet2.id, + * isesubnet3.id, + * isesubnet4.id, + * ], + * tags: { + * environment: "development", + * }, + * }); + * ``` + * * ## Import * * Integration Service Environments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/standard.ts b/sdk/nodejs/logicapps/standard.ts index a11683a4fa..90fb53fb27 100644 --- a/sdk/nodejs/logicapps/standard.ts +++ b/sdk/nodejs/logicapps/standard.ts @@ -10,6 +10,81 @@ import * as utilities from "../utilities"; * Manages a Logic App (Standard / Single Tenant) * * ## Example Usage + * ### With App Service Plan) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "elastic", + * sku: { + * tier: "WorkflowStandard", + * size: "WS1", + * }, + * }); + * const exampleStandard = new azure.logicapps.Standard("exampleStandard", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * appSettings: { + * FUNCTIONS_WORKER_RUNTIME: "node", + * WEBSITE_NODE_DEFAULT_VERSION: "~18", + * }, + * }); + * ``` + * ### For Container Mode) + * + * > **Note:** You must set `azure.appservice.Plan` `kind` to `Linux` and `reserved` to `true` when used with `linuxFxVersion` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "Linux", + * reserved: true, + * sku: { + * tier: "WorkflowStandard", + * size: "WS1", + * }, + * }); + * const exampleStandard = new azure.logicapps.Standard("exampleStandard", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * siteConfig: { + * linuxFxVersion: "DOCKER|mcr.microsoft.com/azure-functions/dotnet:3.0-appservice", + * }, + * appSettings: { + * DOCKER_REGISTRY_SERVER_URL: "https://.azurecr.io", + * DOCKER_REGISTRY_SERVER_USERNAME: "username", + * DOCKER_REGISTRY_SERVER_PASSWORD: "password", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/logicapps/triggerCustom.ts b/sdk/nodejs/logicapps/triggerCustom.ts index 606bf86f38..efde0df567 100644 --- a/sdk/nodejs/logicapps/triggerCustom.ts +++ b/sdk/nodejs/logicapps/triggerCustom.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a Custom Trigger within a Logic App Workflow * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkflow = new azure.logicapps.Workflow("exampleWorkflow", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleTriggerCustom = new azure.logicapps.TriggerCustom("exampleTriggerCustom", { + * logicAppId: exampleWorkflow.id, + * body: `{ + * "recurrence": { + * "frequency": "Day", + * "interval": 1 + * }, + * "type": "Recurrence" + * } + * `, + * }); + * ``` + * * ## Import * * Logic App Custom Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/triggerHttpRequest.ts b/sdk/nodejs/logicapps/triggerHttpRequest.ts index fe48dbaaf8..8cca8d2d77 100644 --- a/sdk/nodejs/logicapps/triggerHttpRequest.ts +++ b/sdk/nodejs/logicapps/triggerHttpRequest.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a HTTP Request Trigger within a Logic App Workflow * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkflow = new azure.logicapps.Workflow("exampleWorkflow", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleTriggerHttpRequest = new azure.logicapps.TriggerHttpRequest("exampleTriggerHttpRequest", { + * logicAppId: exampleWorkflow.id, + * schema: `{ + * "type": "object", + * "properties": { + * "hello": { + * "type": "string" + * } + * } + * } + * `, + * }); + * ``` + * * ## Import * * Logic App HTTP Request Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/triggerRecurrence.ts b/sdk/nodejs/logicapps/triggerRecurrence.ts index aff776a6d4..114a31455f 100644 --- a/sdk/nodejs/logicapps/triggerRecurrence.ts +++ b/sdk/nodejs/logicapps/triggerRecurrence.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages a Recurrence Trigger within a Logic App Workflow * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkflow = new azure.logicapps.Workflow("exampleWorkflow", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleTriggerRecurrence = new azure.logicapps.TriggerRecurrence("exampleTriggerRecurrence", { + * logicAppId: exampleWorkflow.id, + * frequency: "Day", + * interval: 1, + * }); + * ``` + * * ## Import * * Logic App Recurrence Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/logicapps/workflow.ts b/sdk/nodejs/logicapps/workflow.ts index 141565f9c6..ffbcd5cd49 100644 --- a/sdk/nodejs/logicapps/workflow.ts +++ b/sdk/nodejs/logicapps/workflow.ts @@ -9,6 +9,19 @@ import * as utilities from "../utilities"; /** * Manages a Logic App Workflow. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkflow = new azure.logicapps.Workflow("exampleWorkflow", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * Logic App Workflows can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/machinelearning/computeCluster.ts b/sdk/nodejs/machinelearning/computeCluster.ts index 4acb6668c1..943b9b78f0 100644 --- a/sdk/nodejs/machinelearning/computeCluster.ts +++ b/sdk/nodejs/machinelearning/computeCluster.ts @@ -10,6 +10,74 @@ import * as utilities from "../utilities"; * Manages a Machine Learning Compute Cluster. * **NOTE:** At this point in time the resource cannot be updated (not supported by the backend Azure Go SDK). Therefore it can only be created and deleted, not updated. At the moment, there is also no possibility to specify ssh User Account Credentials to ssh into the compute cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", { + * location: "west europe", + * tags: { + * stage: "example", + * }, + * }); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.1.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.1.0.0/24"], + * }); + * const test = new azure.machinelearning.ComputeCluster("test", { + * location: exampleResourceGroup.location, + * vmPriority: "LowPriority", + * vmSize: "Standard_DS2_v2", + * machineLearningWorkspaceId: exampleWorkspace.id, + * subnetResourceId: exampleSubnet.id, + * scaleSettings: { + * minNodeCount: 0, + * maxNodeCount: 1, + * scaleDownNodesAfterIdleDuration: "PT30S", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` + * * ## Import * * Machine Learning Compute Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/machinelearning/computeInstance.ts b/sdk/nodejs/machinelearning/computeInstance.ts index ef89e71d8a..eb44822a67 100644 --- a/sdk/nodejs/machinelearning/computeInstance.ts +++ b/sdk/nodejs/machinelearning/computeInstance.ts @@ -9,6 +9,75 @@ import * as utilities from "../utilities"; /** * Manages a Machine Learning Compute Instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", { + * location: "west europe", + * tags: { + * stage: "example", + * }, + * }); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.1.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.1.0.0/24"], + * }); + * const config = new pulumi.Config(); + * const sshKey = config.get("sshKey") || "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld"; + * const exampleComputeInstance = new azure.machinelearning.ComputeInstance("exampleComputeInstance", { + * location: exampleResourceGroup.location, + * machineLearningWorkspaceId: exampleWorkspace.id, + * virtualMachineSize: "STANDARD_DS2_V2", + * authorizationType: "personal", + * ssh: { + * publicKey: sshKey, + * }, + * subnetResourceId: exampleSubnet.id, + * description: "foo", + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Machine Learning Compute Instances can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/machinelearning/datastoreBlobstorage.ts b/sdk/nodejs/machinelearning/datastoreBlobstorage.ts index 27a2078bb7..df55b8bee3 100644 --- a/sdk/nodejs/machinelearning/datastoreBlobstorage.ts +++ b/sdk/nodejs/machinelearning/datastoreBlobstorage.ts @@ -8,6 +8,51 @@ import * as utilities from "../utilities"; * Manages a Machine Learning Blob Storage DataStore. * * ## Example Usage + * ### With Azure Blob + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleDatastoreBlobstorage = new azure.machinelearning.DatastoreBlobstorage("exampleDatastoreBlobstorage", { + * workspaceId: exampleWorkspace.id, + * storageContainerId: exampleContainer.resourceManagerId, + * accountKey: exampleAccount.primaryAccessKey, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/machinelearning/datastoreDatalakeGen2.ts b/sdk/nodejs/machinelearning/datastoreDatalakeGen2.ts index ae5b7039aa..c6276dd256 100644 --- a/sdk/nodejs/machinelearning/datastoreDatalakeGen2.ts +++ b/sdk/nodejs/machinelearning/datastoreDatalakeGen2.ts @@ -7,6 +7,51 @@ import * as utilities from "../utilities"; /** * Manages a Machine Learning Data Lake Gen2 DataStore. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleDatastoreDatalakeGen2 = new azure.machinelearning.DatastoreDatalakeGen2("exampleDatastoreDatalakeGen2", { + * workspaceId: exampleWorkspace.id, + * storageContainerId: exampleContainer.resourceManagerId, + * }); + * ``` + * * ## Import * * Machine Learning DataStores can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/machinelearning/getWorkspace.ts b/sdk/nodejs/machinelearning/getWorkspace.ts index 264ff16ab5..a039745025 100644 --- a/sdk/nodejs/machinelearning/getWorkspace.ts +++ b/sdk/nodejs/machinelearning/getWorkspace.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Machine Learning Workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.machinelearning.getWorkspace({ + * name: "example-workspace", + * resourceGroupName: "example-resources", + * }); + * export const id = azurerm_machine_learning_workspace.existing.id; + * ``` */ export function getWorkspace(args: GetWorkspaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +70,19 @@ export interface GetWorkspaceResult { } /** * Use this data source to access information about an existing Machine Learning Workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.machinelearning.getWorkspace({ + * name: "example-workspace", + * resourceGroupName: "example-resources", + * }); + * export const id = azurerm_machine_learning_workspace.existing.id; + * ``` */ export function getWorkspaceOutput(args: GetWorkspaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWorkspace(a, opts)) diff --git a/sdk/nodejs/machinelearning/inferenceCluster.ts b/sdk/nodejs/machinelearning/inferenceCluster.ts index 86ae77b63b..8ee76fc8ee 100644 --- a/sdk/nodejs/machinelearning/inferenceCluster.ts +++ b/sdk/nodejs/machinelearning/inferenceCluster.ts @@ -11,6 +11,83 @@ import * as utilities from "../utilities"; * * > **NOTE:** The Machine Learning Inference Cluster resource is used to attach an existing AKS cluster to the Machine Learning Workspace, it doesn't create the AKS cluster itself. Therefore it can only be created and deleted, not updated. Any change to the configuration will recreate the resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", { + * location: "west europe", + * tags: { + * stage: "example", + * }, + * }); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.1.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.1.0.0/24"], + * }); + * const exampleKubernetesCluster = new azure.containerservice.KubernetesCluster("exampleKubernetesCluster", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * dnsPrefixPrivateCluster: "prefix", + * defaultNodePool: { + * name: "default", + * nodeCount: 3, + * vmSize: "Standard_D3_v2", + * vnetSubnetId: exampleSubnet.id, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleInferenceCluster = new azure.machinelearning.InferenceCluster("exampleInferenceCluster", { + * location: exampleResourceGroup.location, + * clusterPurpose: "FastProd", + * kubernetesClusterId: exampleKubernetesCluster.id, + * description: "This is an example cluster used with Terraform", + * machineLearningWorkspaceId: exampleWorkspace.id, + * tags: { + * stage: "example", + * }, + * }); + * ``` + * * ## Import * * Machine Learning Inference Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/machinelearning/synapseSpark.ts b/sdk/nodejs/machinelearning/synapseSpark.ts index fb02eb9e1a..6d1600fa04 100644 --- a/sdk/nodejs/machinelearning/synapseSpark.ts +++ b/sdk/nodejs/machinelearning/synapseSpark.ts @@ -9,6 +9,74 @@ import * as utilities from "../utilities"; /** * Manages the linked service to link an Azure Machine learning workspace to an Azure Synapse workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", { + * location: "west europe", + * tags: { + * stage: "example", + * }, + * }); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleSynapse_workspaceWorkspace = new azure.synapse.Workspace("exampleSynapse/workspaceWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSparkPool = new azure.synapse.SparkPool("exampleSparkPool", { + * synapseWorkspaceId: exampleSynapse / workspaceWorkspace.id, + * nodeSizeFamily: "MemoryOptimized", + * nodeSize: "Small", + * nodeCount: 3, + * }); + * const exampleSynapseSpark = new azure.machinelearning.SynapseSpark("exampleSynapseSpark", { + * machineLearningWorkspaceId: exampleWorkspace.id, + * location: exampleResourceGroup.location, + * synapseSparkPoolId: exampleSparkPool.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` + * * ## Import * * Machine Learning Synapse Sparks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/machinelearning/workspace.ts b/sdk/nodejs/machinelearning/workspace.ts index 835eb21076..48db1c6eec 100644 --- a/sdk/nodejs/machinelearning/workspace.ts +++ b/sdk/nodejs/machinelearning/workspace.ts @@ -7,6 +7,266 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` + * ### With Data Encryption + * + * > **NOTE:** The Key Vault must enable purge protection. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * purgeProtectionEnabled: true, + * }); + * const exampleAccessPolicy = new azure.keyvault.AccessPolicy("exampleAccessPolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * "Delete", + * "Purge", + * "GetRotationPolicy", + * ], + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * exampleKeyVault, + * exampleAccessPolicy, + * ], + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * identity: { + * type: "SystemAssigned", + * }, + * encryption: { + * keyVaultId: exampleKeyVault.id, + * keyId: exampleKey.id, + * }, + * }); + * ``` + * ### With User Assigned Identity And Data Encryption + * + * > **NOTE:** The Key Vault must enable purge protection. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * purgeProtectionEnabled: true, + * }); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const example_identity = new azure.keyvault.AccessPolicy("example-identity", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleUserAssignedIdentity.principalId, + * keyPermissions: [ + * "WrapKey", + * "UnwrapKey", + * "Get", + * "Recover", + * ], + * secretPermissions: [ + * "Get", + * "List", + * "Set", + * "Delete", + * "Recover", + * "Backup", + * "Restore", + * ], + * }); + * const example_sp = new azure.keyvault.AccessPolicy("example-sp", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "Create", + * "Recover", + * "Delete", + * "Purge", + * "GetRotationPolicy", + * ], + * }); + * const test = azuread.getServicePrincipal({ + * displayName: "Azure Cosmos DB", + * }); + * const example_cosmosdb = new azure.keyvault.AccessPolicy("example-cosmosdb", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: test.then(test => test.objectId), + * keyPermissions: [ + * "Get", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * ], + * }, { + * dependsOn: [ + * test, + * current, + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * exampleKeyVault, + * example_sp, + * ], + * }); + * const example_role1 = new azure.authorization.Assignment("example-role1", { + * scope: exampleKeyVault.id, + * roleDefinitionName: "Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const example_role2 = new azure.authorization.Assignment("example-role2", { + * scope: exampleAccount.id, + * roleDefinitionName: "Storage Blob Data Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const example_role3 = new azure.authorization.Assignment("example-role3", { + * scope: exampleAccount.id, + * roleDefinitionName: "Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const example_role4 = new azure.authorization.Assignment("example-role4", { + * scope: exampleInsights.id, + * roleDefinitionName: "Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const exampleWorkspace = new azure.machinelearning.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationInsightsId: exampleInsights.id, + * keyVaultId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * highBusinessImpact: true, + * primaryUserAssignedIdentity: exampleUserAssignedIdentity.id, + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * encryption: { + * userAssignedIdentityId: exampleUserAssignedIdentity.id, + * keyVaultId: exampleKeyVault.id, + * keyId: exampleKey.id, + * }, + * }, { + * dependsOn: [ + * example_role1, + * example_role2, + * example_role3, + * example_role4, + * example_cosmosdb, + * ], + * }); + * ``` + * * ## Import * * Machine Learning Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/maintenance/assignmentDedicatedHost.ts b/sdk/nodejs/maintenance/assignmentDedicatedHost.ts index 4412d85777..d46c4a9033 100644 --- a/sdk/nodejs/maintenance/assignmentDedicatedHost.ts +++ b/sdk/nodejs/maintenance/assignmentDedicatedHost.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a maintenance assignment to Dedicated Host. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDedicatedHostGroup = new azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * platformFaultDomainCount: 2, + * }); + * const exampleDedicatedHost = new azure.compute.DedicatedHost("exampleDedicatedHost", { + * location: exampleResourceGroup.location, + * dedicatedHostGroupId: exampleDedicatedHostGroup.id, + * skuName: "DSv3-Type1", + * platformFaultDomain: 1, + * }); + * const exampleConfiguration = new azure.maintenance.Configuration("exampleConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * scope: "Host", + * }); + * const exampleAssignmentDedicatedHost = new azure.maintenance.AssignmentDedicatedHost("exampleAssignmentDedicatedHost", { + * location: exampleResourceGroup.location, + * maintenanceConfigurationId: exampleConfiguration.id, + * dedicatedHostId: exampleDedicatedHost.id, + * }); + * ``` + * * ## Import * * Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/maintenance/assignmentVirtualMachine.ts b/sdk/nodejs/maintenance/assignmentVirtualMachine.ts index 96da348ed8..d4034c67cc 100644 --- a/sdk/nodejs/maintenance/assignmentVirtualMachine.ts +++ b/sdk/nodejs/maintenance/assignmentVirtualMachine.ts @@ -7,6 +7,66 @@ import * as utilities from "../utilities"; /** * Manages a maintenance assignment to virtual machine. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "internal", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_F2", + * adminUsername: "adminuser", + * networkInterfaceIds: [exampleNetworkInterface.id], + * adminSshKeys: [{ + * username: "adminuser", + * publicKey: fs.readFileSync("~/.ssh/id_rsa.pub"), + * }], + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * }); + * const exampleConfiguration = new azure.maintenance.Configuration("exampleConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * scope: "All", + * }); + * const exampleAssignmentVirtualMachine = new azure.maintenance.AssignmentVirtualMachine("exampleAssignmentVirtualMachine", { + * location: exampleResourceGroup.location, + * maintenanceConfigurationId: exampleConfiguration.id, + * virtualMachineId: exampleLinuxVirtualMachine.id, + * }); + * ``` + * * ## Import * * Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/maintenance/assignmentVirtualMachineScaleSet.ts b/sdk/nodejs/maintenance/assignmentVirtualMachineScaleSet.ts index 5c087199c5..013b316fba 100644 --- a/sdk/nodejs/maintenance/assignmentVirtualMachineScaleSet.ts +++ b/sdk/nodejs/maintenance/assignmentVirtualMachineScaleSet.ts @@ -7,6 +7,132 @@ import * as utilities from "../utilities"; /** * Manages a maintenance assignment to a virtual machine scale set. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "internal", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleBackendAddressPool = new azure.lb.BackendAddressPool("exampleBackendAddressPool", {loadbalancerId: exampleLoadBalancer.id}); + * const exampleProbe = new azure.lb.Probe("exampleProbe", { + * loadbalancerId: exampleLoadBalancer.id, + * port: 22, + * protocol: "Tcp", + * }); + * const exampleRule = new azure.lb.Rule("exampleRule", { + * loadbalancerId: exampleLoadBalancer.id, + * probeId: exampleProbe.id, + * frontendIpConfigurationName: "internal", + * protocol: "Tcp", + * frontendPort: 22, + * backendPort: 22, + * }); + * const exampleConfiguration = new azure.maintenance.Configuration("exampleConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * scope: "OSImage", + * visibility: "Custom", + * window: { + * startDateTime: "2021-12-31 00:00", + * expirationDateTime: "9999-12-31 00:00", + * duration: "06:00", + * timeZone: "Pacific Standard Time", + * recurEvery: "1Days", + * }, + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_F2", + * adminUsername: "adminuser", + * networkInterfaceIds: [exampleNetworkInterface.id], + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * }); + * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard_F2", + * instances: 1, + * adminUsername: "adminuser", + * adminPassword: "P@ssword1234!", + * upgradeMode: "Automatic", + * healthProbeId: exampleProbe.id, + * disablePasswordAuthentication: false, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * osDisk: { + * storageAccountType: "Standard_LRS", + * caching: "ReadWrite", + * }, + * networkInterfaces: [{ + * name: "example", + * primary: true, + * ipConfigurations: [{ + * name: "internal", + * primary: true, + * subnetId: exampleSubnet.id, + * loadBalancerBackendAddressPoolIds: [exampleBackendAddressPool.id], + * }], + * }], + * automaticOsUpgradePolicy: { + * disableAutomaticRollback: true, + * enableAutomaticOsUpgrade: true, + * }, + * rollingUpgradePolicy: { + * maxBatchInstancePercent: 20, + * maxUnhealthyInstancePercent: 20, + * maxUnhealthyUpgradedInstancePercent: 20, + * pauseTimeBetweenBatches: "PT0S", + * }, + * }, { + * dependsOn: ["azurerm_lb_rule.example"], + * }); + * const exampleAssignmentVirtualMachineScaleSet = new azure.maintenance.AssignmentVirtualMachineScaleSet("exampleAssignmentVirtualMachineScaleSet", { + * location: exampleResourceGroup.location, + * maintenanceConfigurationId: exampleConfiguration.id, + * virtualMachineScaleSetId: exampleLinuxVirtualMachine.id, + * }); + * ``` + * * ## Import * * Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/maintenance/configuration.ts b/sdk/nodejs/maintenance/configuration.ts index 2e2ce20c51..274ec1b904 100644 --- a/sdk/nodejs/maintenance/configuration.ts +++ b/sdk/nodejs/maintenance/configuration.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a maintenance configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleConfiguration = new azure.maintenance.Configuration("exampleConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * scope: "SQLDB", + * tags: { + * Env: "prod", + * }, + * }); + * ``` + * * ## Import * * Maintenance Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/maintenance/getConfiguration.ts b/sdk/nodejs/maintenance/getConfiguration.ts index 59015e7950..282405d025 100644 --- a/sdk/nodejs/maintenance/getConfiguration.ts +++ b/sdk/nodejs/maintenance/getConfiguration.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Maintenance Configuration. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.maintenance.getConfiguration({ + * name: "example-mc", + * resourceGroupName: "example-resources", + * }); + * export const id = azurerm_maintenance_configuration.existing.id; + * ``` */ export function getConfiguration(args: GetConfigurationArgs, opts?: pulumi.InvokeOptions): Promise { @@ -77,6 +90,19 @@ export interface GetConfigurationResult { } /** * Use this data source to access information about an existing Maintenance Configuration. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.maintenance.getConfiguration({ + * name: "example-mc", + * resourceGroupName: "example-resources", + * }); + * export const id = azurerm_maintenance_configuration.existing.id; + * ``` */ export function getConfigurationOutput(args: GetConfigurationOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getConfiguration(a, opts)) diff --git a/sdk/nodejs/maintenance/getPublicConfigurations.ts b/sdk/nodejs/maintenance/getPublicConfigurations.ts index 0b209720e5..62516f116b 100644 --- a/sdk/nodejs/maintenance/getPublicConfigurations.ts +++ b/sdk/nodejs/maintenance/getPublicConfigurations.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about existing Public Maintenance Configurations. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.maintenance.getPublicConfigurations({ + * location: "West Europe", + * scope: "SQLManagedInstance", + * recurEvery: "Monday-Thursday", + * }); + * export const name = existing.then(existing => existing.configs?.[0]?.name); + * ``` */ export function getPublicConfigurations(args?: GetPublicConfigurationsArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -62,6 +76,20 @@ export interface GetPublicConfigurationsResult { } /** * Use this data source to access information about existing Public Maintenance Configurations. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const existing = azure.maintenance.getPublicConfigurations({ + * location: "West Europe", + * scope: "SQLManagedInstance", + * recurEvery: "Monday-Thursday", + * }); + * export const name = existing.then(existing => existing.configs?.[0]?.name); + * ``` */ export function getPublicConfigurationsOutput(args?: GetPublicConfigurationsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPublicConfigurations(a, opts)) diff --git a/sdk/nodejs/managedapplication/application.ts b/sdk/nodejs/managedapplication/application.ts index 91eed7df52..5672c8e08a 100644 --- a/sdk/nodejs/managedapplication/application.ts +++ b/sdk/nodejs/managedapplication/application.ts @@ -9,6 +9,49 @@ import * as utilities from "../utilities"; /** * Manages a Managed Application. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const builtin = azure.authorization.getRoleDefinition({ + * name: "Contributor", + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDefinition = new azure.managedapplication.Definition("exampleDefinition", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * lockLevel: "ReadOnly", + * packageFileUri: "https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + * displayName: "TestManagedAppDefinition", + * description: "Test Managed App Definition", + * authorizations: [{ + * servicePrincipalId: current.then(current => current.objectId), + * roleDefinitionId: Promise.all([builtin.then(builtin => builtin.id.split("/")), builtin.then(builtin => builtin.id.split("/")).length]).then(([split, length]) => split[length - 1]), + * }], + * }); + * const exampleApplication = new azure.managedapplication.Application("exampleApplication", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "ServiceCatalog", + * managedResourceGroupName: "infrastructureGroup", + * applicationDefinitionId: exampleDefinition.id, + * parameterValues: exampleResourceGroup.location.apply(location => JSON.stringify({ + * location: { + * value: location, + * }, + * storageAccountNamePrefix: { + * value: "storeNamePrefix", + * }, + * storageAccountType: { + * value: "Standard_LRS", + * }, + * })), + * }); + * ``` + * * ## Import * * Managed Application can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/managedapplication/definition.ts b/sdk/nodejs/managedapplication/definition.ts index cde60d1420..cf55138bf3 100644 --- a/sdk/nodejs/managedapplication/definition.ts +++ b/sdk/nodejs/managedapplication/definition.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages a Managed Application Definition. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDefinition = new azure.managedapplication.Definition("exampleDefinition", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * lockLevel: "ReadOnly", + * packageFileUri: "https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + * displayName: "TestManagedApplicationDefinition", + * description: "Test Managed Application Definition", + * authorizations: [{ + * servicePrincipalId: current.then(current => current.objectId), + * roleDefinitionId: "a094b430-dad3-424d-ae58-13f72fd72591", + * }], + * }); + * ``` + * * ## Import * * Managed Application Definition can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/managedapplication/getDefinition.ts b/sdk/nodejs/managedapplication/getDefinition.ts index a60337fc64..790a44e396 100644 --- a/sdk/nodejs/managedapplication/getDefinition.ts +++ b/sdk/nodejs/managedapplication/getDefinition.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing Managed Application Definition. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.managedapplication.getDefinition({ + * name: "examplemanagedappdef", + * resourceGroupName: "exampleresources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDefinition(args: GetDefinitionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -44,6 +57,19 @@ export interface GetDefinitionResult { } /** * Uses this data source to access information about an existing Managed Application Definition. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.managedapplication.getDefinition({ + * name: "examplemanagedappdef", + * resourceGroupName: "exampleresources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getDefinitionOutput(args: GetDefinitionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDefinition(a, opts)) diff --git a/sdk/nodejs/management/getGroup.ts b/sdk/nodejs/management/getGroup.ts index 8850d60f87..4cbc8f0cea 100644 --- a/sdk/nodejs/management/getGroup.ts +++ b/sdk/nodejs/management/getGroup.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Management Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * export const displayName = example.then(example => example.displayName); + * ``` */ export function getGroup(args?: GetGroupArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -66,6 +78,18 @@ export interface GetGroupResult { } /** * Use this data source to access information about an existing Management Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * export const displayName = example.then(example => example.displayName); + * ``` */ export function getGroupOutput(args?: GetGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getGroup(a, opts)) diff --git a/sdk/nodejs/management/group.ts b/sdk/nodejs/management/group.ts index b5970341fa..f7e327f99c 100644 --- a/sdk/nodejs/management/group.ts +++ b/sdk/nodejs/management/group.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; * * !> **Note:** Configuring `subscriptionIds` is not supported when using the `azure.management.GroupSubscriptionAssociation` resource, results will be unpredictable. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const exampleParent = new azure.management.Group("exampleParent", { + * displayName: "ParentGroup", + * subscriptionIds: [current.then(current => current.subscriptionId)], + * }); + * const exampleChild = new azure.management.Group("exampleChild", { + * displayName: "ChildGroup", + * parentManagementGroupId: exampleParent.id, + * subscriptionIds: [current.then(current => current.subscriptionId)], + * }); + * // other subscription IDs can go here + * ``` + * * ## Import * * Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/nodejs/management/groupPolicyAssignment.ts b/sdk/nodejs/management/groupPolicyAssignment.ts index a60884dde1..542f7fcb75 100644 --- a/sdk/nodejs/management/groupPolicyAssignment.ts +++ b/sdk/nodejs/management/groupPolicyAssignment.ts @@ -9,6 +9,37 @@ import * as utilities from "../utilities"; /** * Manages a Policy Assignment to a Management Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleGroup = new azure.management.Group("exampleGroup", {displayName: "Some Management Group"}); + * const exampleDefinition = new azure.policy.Definition("exampleDefinition", { + * policyType: "Custom", + * mode: "All", + * displayName: "my-policy-definition", + * managementGroupId: exampleGroup.id, + * policyRule: ` { + * "if": { + * "not": { + * "field": "location", + * "equals": "westeurope" + * } + * }, + * "then": { + * "effect": "Deny" + * } + * } + * `, + * }); + * const exampleGroupPolicyAssignment = new azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment", { + * policyDefinitionId: exampleDefinition.id, + * managementGroupId: exampleGroup.id, + * }); + * ``` + * * ## Import * * Management Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/management/groupPolicyExemption.ts b/sdk/nodejs/management/groupPolicyExemption.ts index e6d983090f..7b5568556f 100644 --- a/sdk/nodejs/management/groupPolicyExemption.ts +++ b/sdk/nodejs/management/groupPolicyExemption.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a Management Group Policy Exemption. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleGroup = new azure.management.Group("exampleGroup", {displayName: "Example MgmtGroup"}); + * const examplePolicySetDefinition = azure.policy.getPolicySetDefinition({ + * displayName: "Audit machines with insecure password security settings", + * }); + * const exampleGroupPolicyAssignment = new azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment", { + * managementGroupId: exampleGroup.id, + * policyDefinitionId: examplePolicySetDefinition.then(examplePolicySetDefinition => examplePolicySetDefinition.id), + * location: "westus", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleGroupPolicyExemption = new azure.management.GroupPolicyExemption("exampleGroupPolicyExemption", { + * managementGroupId: exampleGroup.id, + * policyAssignmentId: exampleGroupPolicyAssignment.id, + * exemptionCategory: "Mitigated", + * }); + * ``` + * * ## Import * * Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/management/groupSubscriptionAssociation.ts b/sdk/nodejs/management/groupSubscriptionAssociation.ts index 6e265de7b6..52610e84c2 100644 --- a/sdk/nodejs/management/groupSubscriptionAssociation.ts +++ b/sdk/nodejs/management/groupSubscriptionAssociation.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; * * !> **Note:** When using this resource, configuring `subscriptionIds` on the `azure.management.Group` resource is not supported. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleGroup = azure.management.getGroup({ + * name: "exampleManagementGroup", + * }); + * const exampleSubscription = azure.core.getSubscription({ + * subscriptionId: "12345678-1234-1234-1234-123456789012", + * }); + * const exampleGroupSubscriptionAssociation = new azure.management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", { + * managementGroupId: exampleGroup.then(exampleGroup => exampleGroup.id), + * subscriptionId: exampleSubscription.then(exampleSubscription => exampleSubscription.id), + * }); + * ``` + * * ## Import * * Managements can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/management/groupTemplateDeployment.ts b/sdk/nodejs/management/groupTemplateDeployment.ts index 82a7f8560b..d417a9617e 100644 --- a/sdk/nodejs/management/groupTemplateDeployment.ts +++ b/sdk/nodejs/management/groupTemplateDeployment.ts @@ -11,6 +11,97 @@ import * as utilities from "../utilities"; * * > **Note:** Deployments to a Management Group are always Incrementally applied. Existing resources that are not part of the template will not be removed. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleGroup = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * const exampleGroupTemplateDeployment = new azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", { + * location: "West Europe", + * managementGroupId: exampleGroup.then(exampleGroup => exampleGroup.id), + * templateContent: `{ + * "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + * "contentVersion": "1.0.0.0", + * "parameters": { + * "policyAssignmentName": { + * "type": "string", + * "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]", + * "metadata": { + * "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides." + * } + * }, + * "policyDefinitionID": { + * "type": "string", + * "metadata": { + * "description": "Specifies the ID of the policy definition or policy set definition being assigned." + * } + * } + * }, + * "resources": [ + * { + * "type": "Microsoft.Authorization/policyAssignments", + * "name": "[parameters('policyAssignmentName')]", + * "apiVersion": "2019-09-01", + * "properties": { + * "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]", + * "policyDefinitionId": "[parameters('policyDefinitionID')]" + * } + * } + * ] + * } + * `, + * parametersContent: `{ + * "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + * "contentVersion": "1.0.0.0", + * "parameters": { + * "policyDefinitionID": { + * "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a" + * } + * } + * } + * `, + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleGroup = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * const exampleGroupTemplateDeployment = new azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", { + * location: "West Europe", + * managementGroupId: exampleGroup.then(exampleGroup => exampleGroup.id), + * templateContent: fs.readFileSync("templates/example-deploy-template.json"), + * parametersContent: fs.readFileSync("templates/example-deploy-params.json"), + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleGroup = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * const exampleTemplateSpecVersion = azure.core.getTemplateSpecVersion({ + * name: "exampleTemplateForManagementGroup", + * resourceGroupName: "exampleResourceGroup", + * version: "v1.0.9", + * }); + * const exampleGroupTemplateDeployment = new azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", { + * location: "West Europe", + * managementGroupId: exampleGroup.then(exampleGroup => exampleGroup.id), + * templateSpecVersionId: exampleTemplateSpecVersion.then(exampleTemplateSpecVersion => exampleTemplateSpecVersion.id), + * }); + * ``` + * * ## Import * * Management Group Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/management/lock.ts b/sdk/nodejs/management/lock.ts index 9f93e61ba5..9dde24c737 100644 --- a/sdk/nodejs/management/lock.ts +++ b/sdk/nodejs/management/lock.ts @@ -8,6 +8,51 @@ import * as utilities from "../utilities"; * Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. * * ## Example Usage + * ### Subscription Level Lock) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const subscription_level = new azure.management.Lock("subscription-level", { + * scope: current.then(current => current.id), + * lockLevel: "CanNotDelete", + * notes: "Items can't be deleted in this subscription!", + * }); + * ``` + * ### Resource Group Level Lock) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const resource_group_level = new azure.management.Lock("resource-group-level", { + * scope: example.id, + * lockLevel: "ReadOnly", + * notes: "This Resource Group is Read-Only", + * }); + * ``` + * ### Resource Level Lock) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * idleTimeoutInMinutes: 30, + * }); + * const public_ip = new azure.management.Lock("public-ip", { + * scope: examplePublicIp.id, + * lockLevel: "CanNotDelete", + * notes: "Locked because it's needed by a third-party", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/management/privateLink.ts b/sdk/nodejs/management/privateLink.ts index 91781c90cd..8733769cef 100644 --- a/sdk/nodejs/management/privateLink.ts +++ b/sdk/nodejs/management/privateLink.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Resource Management Private Link to restrict access for managing resources in the tenant. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePrivateLink = new azure.management.PrivateLink("examplePrivateLink", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * An existing Resource Management Private Link can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/nodejs/managementgroups/getManagementGroup.ts b/sdk/nodejs/managementgroups/getManagementGroup.ts index 3fe3c8bd60..4eae959f1b 100644 --- a/sdk/nodejs/managementgroups/getManagementGroup.ts +++ b/sdk/nodejs/managementgroups/getManagementGroup.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Management Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * export const displayName = example.then(example => example.displayName); + * ``` */ /** @deprecated azure.managementgroups.getManagementGroup has been deprecated in favor of azure.management.getGroup */ export function getManagementGroup(args?: GetManagementGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +80,18 @@ export interface GetManagementGroupResult { } /** * Use this data source to access information about an existing Management Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * export const displayName = example.then(example => example.displayName); + * ``` */ /** @deprecated azure.managementgroups.getManagementGroup has been deprecated in favor of azure.management.getGroup */ export function getManagementGroupOutput(args?: GetManagementGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { diff --git a/sdk/nodejs/managementgroups/managementGroup.ts b/sdk/nodejs/managementgroups/managementGroup.ts index bd86092e41..93978a51a0 100644 --- a/sdk/nodejs/managementgroups/managementGroup.ts +++ b/sdk/nodejs/managementgroups/managementGroup.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; * * !> **Note:** Configuring `subscriptionIds` is not supported when using the `azure.management.GroupSubscriptionAssociation` resource, results will be unpredictable. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const exampleParent = new azure.management.Group("exampleParent", { + * displayName: "ParentGroup", + * subscriptionIds: [current.then(current => current.subscriptionId)], + * }); + * const exampleChild = new azure.management.Group("exampleChild", { + * displayName: "ChildGroup", + * parentManagementGroupId: exampleParent.id, + * subscriptionIds: [current.then(current => current.subscriptionId)], + * }); + * // other subscription IDs can go here + * ``` + * * ## Import * * Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/nodejs/managementresource/manangementLock.ts b/sdk/nodejs/managementresource/manangementLock.ts index 6d0121d787..3d542566d5 100644 --- a/sdk/nodejs/managementresource/manangementLock.ts +++ b/sdk/nodejs/managementresource/manangementLock.ts @@ -8,6 +8,51 @@ import * as utilities from "../utilities"; * Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. * * ## Example Usage + * ### Subscription Level Lock) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const subscription_level = new azure.management.Lock("subscription-level", { + * scope: current.then(current => current.id), + * lockLevel: "CanNotDelete", + * notes: "Items can't be deleted in this subscription!", + * }); + * ``` + * ### Resource Group Level Lock) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const resource_group_level = new azure.management.Lock("resource-group-level", { + * scope: example.id, + * lockLevel: "ReadOnly", + * notes: "This Resource Group is Read-Only", + * }); + * ``` + * ### Resource Level Lock) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * idleTimeoutInMinutes: 30, + * }); + * const public_ip = new azure.management.Lock("public-ip", { + * scope: examplePublicIp.id, + * lockLevel: "CanNotDelete", + * notes: "Locked because it's needed by a third-party", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/maps/account.ts b/sdk/nodejs/maps/account.ts index f07c5810e3..6a83fad5b1 100644 --- a/sdk/nodejs/maps/account.ts +++ b/sdk/nodejs/maps/account.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages an Azure Maps Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.maps.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "S1", + * localAuthenticationEnabled: true, + * tags: { + * environment: "Test", + * }, + * }); + * ``` + * * ## Import * * A Maps Account can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/maps/creator.ts b/sdk/nodejs/maps/creator.ts index da1a2ffded..fbc15f3816 100644 --- a/sdk/nodejs/maps/creator.ts +++ b/sdk/nodejs/maps/creator.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages an Azure Maps Creator. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.maps.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * skuName: "G2", + * tags: { + * environment: "Test", + * }, + * }); + * const exampleCreator = new azure.maps.Creator("exampleCreator", { + * mapsAccountId: exampleAccount.id, + * location: exampleResourceGroup.location, + * storageUnits: 1, + * tags: { + * environment: "Test", + * }, + * }); + * ``` + * * ## Import * * An Azure Maps Creators can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/maps/getAccount.ts b/sdk/nodejs/maps/getAccount.ts index 481012f407..f8f1bc9104 100644 --- a/sdk/nodejs/maps/getAccount.ts +++ b/sdk/nodejs/maps/getAccount.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure Maps Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.maps.getAccount({ + * name: "production", + * resourceGroupName: "maps", + * }); + * export const mapsAccountId = example.then(example => example.id); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -62,6 +75,19 @@ export interface GetAccountResult { } /** * Use this data source to access information about an existing Azure Maps Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.maps.getAccount({ + * name: "production", + * resourceGroupName: "maps", + * }); + * export const mapsAccountId = example.then(example => example.id); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/mariadb/configuration.ts b/sdk/nodejs/mariadb/configuration.ts index 25c835673b..249e4cdda8 100644 --- a/sdk/nodejs/mariadb/configuration.ts +++ b/sdk/nodejs/mariadb/configuration.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Sets a MariaDB Configuration value on a MariaDB Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mariadb.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "B_Gen5_2", + * sslEnforcementEnabled: true, + * administratorLogin: "mariadbadmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * version: "10.2", + * }); + * const exampleConfiguration = new azure.mariadb.Configuration("exampleConfiguration", { + * name: "interactive_timeout", + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * value: "600", + * }); + * ``` + * * ## Import * * MariaDB Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mariadb/database.ts b/sdk/nodejs/mariadb/database.ts index a64530b6d3..8aef1ec084 100644 --- a/sdk/nodejs/mariadb/database.ts +++ b/sdk/nodejs/mariadb/database.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages a MariaDB Database within a MariaDB Server * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mariadb.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "B_Gen5_2", + * storageMb: 51200, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: false, + * administratorLogin: "acctestun", + * administratorLoginPassword: "H@Sh1CoR3!", + * version: "10.2", + * sslEnforcementEnabled: true, + * }); + * const exampleDatabase = new azure.mariadb.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * charset: "utf8mb4", + * collation: "utf8mb4_unicode_520_ci", + * }); + * ``` + * * ## Import * * MariaDB Database's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mariadb/firewallRule.ts b/sdk/nodejs/mariadb/firewallRule.ts index c7a19e99c2..72757b577b 100644 --- a/sdk/nodejs/mariadb/firewallRule.ts +++ b/sdk/nodejs/mariadb/firewallRule.ts @@ -8,6 +8,32 @@ import * as utilities from "../utilities"; * Manages a Firewall Rule for a MariaDB Server * * ## Example Usage + * ### Single IP Address) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.mariadb.FirewallRule("example", { + * endIpAddress: "40.112.8.12", + * resourceGroupName: "test-rg", + * serverName: "test-server", + * startIpAddress: "40.112.8.12", + * }); + * ``` + * ### IP Range) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.mariadb.FirewallRule("example", { + * endIpAddress: "40.112.255.255", + * resourceGroupName: "test-rg", + * serverName: "test-server", + * startIpAddress: "40.112.0.0", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/mariadb/getMariaDbServer.ts b/sdk/nodejs/mariadb/getMariaDbServer.ts index 7ef1a59f21..eb0176bf31 100644 --- a/sdk/nodejs/mariadb/getMariaDbServer.ts +++ b/sdk/nodejs/mariadb/getMariaDbServer.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing MariaDB Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const dbServer = azure.mariadb.getMariaDbServer({ + * name: "mariadb-server", + * resourceGroupName: azurerm_mariadb_server.example.resource_group_name, + * }); + * export const mariadbServerId = data.azurerm_mariadb_server.example.id; + * ``` */ export function getMariaDbServer(args: GetMariaDbServerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -77,6 +90,19 @@ export interface GetMariaDbServerResult { } /** * Use this data source to access information about an existing MariaDB Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const dbServer = azure.mariadb.getMariaDbServer({ + * name: "mariadb-server", + * resourceGroupName: azurerm_mariadb_server.example.resource_group_name, + * }); + * export const mariadbServerId = data.azurerm_mariadb_server.example.id; + * ``` */ export function getMariaDbServerOutput(args: GetMariaDbServerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMariaDbServer(a, opts)) diff --git a/sdk/nodejs/mariadb/server.ts b/sdk/nodejs/mariadb/server.ts index a0800b88e3..947ee1aceb 100644 --- a/sdk/nodejs/mariadb/server.ts +++ b/sdk/nodejs/mariadb/server.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a MariaDB Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mariadb.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mariadbadmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "B_Gen5_2", + * storageMb: 5120, + * version: "10.2", + * autoGrowEnabled: true, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: false, + * publicNetworkAccessEnabled: false, + * sslEnforcementEnabled: true, + * sslMinimalTlsVersionEnforced: "TLS1_2", + * }); + * ``` + * * ## Import * * MariaDB Server's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mariadb/virtualNetworkRule.ts b/sdk/nodejs/mariadb/virtualNetworkRule.ts index adc09494bf..00a1b29aeb 100644 --- a/sdk/nodejs/mariadb/virtualNetworkRule.ts +++ b/sdk/nodejs/mariadb/virtualNetworkRule.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; * * > **NOTE:** MariaDB Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mariadb/concepts-data-access-security-vnet) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.7.29.0/29"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.7.29.0/29"], + * serviceEndpoints: ["Microsoft.Sql"], + * }); + * const exampleServer = new azure.mariadb.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mariadbadminun", + * administratorLoginPassword: "H@Sh1CoR3!", + * version: "10.2", + * sslEnforcementEnabled: true, + * skuName: "GP_Gen5_2", + * }); + * const exampleVirtualNetworkRule = new azure.mariadb.VirtualNetworkRule("exampleVirtualNetworkRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * subnetId: internal.id, + * }); + * ``` + * * ## Import * * MariaDB Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/marketplace/agreement.ts b/sdk/nodejs/marketplace/agreement.ts index 7827483fe0..1809082980 100644 --- a/sdk/nodejs/marketplace/agreement.ts +++ b/sdk/nodejs/marketplace/agreement.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Allows accepting the Legal Terms for a Marketplace Image. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const barracuda = new azure.marketplace.Agreement("barracuda", { + * offer: "waf", + * plan: "hourly", + * publisher: "barracudanetworks", + * }); + * ``` + * * ## Import * * Marketplace Agreement can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/marketplace/getAgreement.ts b/sdk/nodejs/marketplace/getAgreement.ts index 78a90fe1b4..ffab6a181b 100644 --- a/sdk/nodejs/marketplace/getAgreement.ts +++ b/sdk/nodejs/marketplace/getAgreement.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing Marketplace Agreement. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const barracuda = azure.marketplace.getAgreement({ + * publisher: "barracudanetworks", + * offer: "waf", + * plan: "hourly", + * }); + * export const azurermMarketplaceAgreementId = data.azurerm_marketplace_agreement.id; + * ``` */ export function getAgreement(args: GetAgreementArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +65,20 @@ export interface GetAgreementResult { } /** * Uses this data source to access information about an existing Marketplace Agreement. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const barracuda = azure.marketplace.getAgreement({ + * publisher: "barracudanetworks", + * offer: "waf", + * plan: "hourly", + * }); + * export const azurermMarketplaceAgreementId = data.azurerm_marketplace_agreement.id; + * ``` */ export function getAgreementOutput(args: GetAgreementOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAgreement(a, opts)) diff --git a/sdk/nodejs/media/accountFilter.ts b/sdk/nodejs/media/accountFilter.ts index 0b8ca9e2dc..025c94c062 100644 --- a/sdk/nodejs/media/accountFilter.ts +++ b/sdk/nodejs/media/accountFilter.ts @@ -9,6 +9,77 @@ import * as utilities from "../utilities"; /** * Manages a Media Services Account Filter. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleAccountFilter = new azure.media.AccountFilter("exampleAccountFilter", { + * resourceGroupName: azurerm_resource_group.test.name, + * mediaServicesAccountName: azurerm_media_services_account.test.name, + * firstQualityBitrate: 128000, + * presentationTimeRange: { + * startInUnits: 0, + * endInUnits: 15, + * presentationWindowInUnits: 90, + * liveBackoffInUnits: 0, + * unitTimescaleInMilliseconds: 1000, + * forceEnd: false, + * }, + * trackSelections: [ + * { + * conditions: [ + * { + * property: "Type", + * operation: "Equal", + * value: "Audio", + * }, + * { + * property: "Language", + * operation: "NotEqual", + * value: "en", + * }, + * { + * property: "FourCC", + * operation: "NotEqual", + * value: "EC-3", + * }, + * ], + * }, + * { + * conditions: [ + * { + * property: "Type", + * operation: "Equal", + * value: "Video", + * }, + * { + * property: "Bitrate", + * operation: "Equal", + * value: "3000000-5000000", + * }, + * ], + * }, + * ], + * }); + * ``` + * * ## Import * * Account Filters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/asset.ts b/sdk/nodejs/media/asset.ts index eef8b2cfc5..2d20c92f17 100644 --- a/sdk/nodejs/media/asset.ts +++ b/sdk/nodejs/media/asset.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a Media Asset. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleAsset = new azure.media.Asset("exampleAsset", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "Asset description", + * }); + * ``` + * * ## Import * * Media Assets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/assetFilter.ts b/sdk/nodejs/media/assetFilter.ts index 7883c7fa21..e0a388ff14 100644 --- a/sdk/nodejs/media/assetFilter.ts +++ b/sdk/nodejs/media/assetFilter.ts @@ -9,6 +9,81 @@ import * as utilities from "../utilities"; /** * Manages an Azure Media Asset Filter. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleAsset = new azure.media.Asset("exampleAsset", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "Asset description", + * }); + * const exampleAssetFilter = new azure.media.AssetFilter("exampleAssetFilter", { + * assetId: exampleAsset.id, + * firstQualityBitrate: 128000, + * presentationTimeRange: { + * startInUnits: 0, + * endInUnits: 15, + * presentationWindowInUnits: 90, + * liveBackoffInUnits: 0, + * unitTimescaleInMiliseconds: 1000, + * forceEnd: false, + * }, + * trackSelections: [ + * { + * conditions: [ + * { + * property: "Type", + * operation: "Equal", + * value: "Audio", + * }, + * { + * property: "Language", + * operation: "NotEqual", + * value: "en", + * }, + * { + * property: "FourCC", + * operation: "NotEqual", + * value: "EC-3", + * }, + * ], + * }, + * { + * conditions: [ + * { + * property: "Type", + * operation: "Equal", + * value: "Video", + * }, + * { + * property: "Bitrate", + * operation: "Equal", + * value: "3000000-5000000", + * }, + * ], + * }, + * ], + * }); + * ``` + * * ## Import * * Asset Filters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/contentKeyPolicy.ts b/sdk/nodejs/media/contentKeyPolicy.ts index 697aa6b81b..7d409da41e 100644 --- a/sdk/nodejs/media/contentKeyPolicy.ts +++ b/sdk/nodejs/media/contentKeyPolicy.ts @@ -9,6 +9,112 @@ import * as utilities from "../utilities"; /** * Manages a Content Key Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleContentKeyPolicy = new azure.media.ContentKeyPolicy("exampleContentKeyPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * policyOptions: [ + * { + * name: "fairPlay", + * fairplayConfiguration: { + * ask: "bb566284cc124a21c435a92cd3c108c4", + * pfx: "MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + * pfxPassword: "password", + * rentalDurationSeconds: 2249, + * rentalAndLeaseKeyType: "PersistentUnlimited", + * }, + * openRestrictionEnabled: true, + * }, + * { + * name: "playReady", + * playreadyConfigurationLicenses: [{ + * allowTestDevices: true, + * beginDate: "2017-10-16T18:22:53Z", + * securityLevel: "SL150", + * playRight: { + * scmsRestriction: 2, + * digitalVideoOnlyContentRestriction: false, + * imageConstraintForAnalogComponentVideoRestriction: false, + * imageConstraintForAnalogComputerMonitorRestriction: false, + * allowPassingVideoContentToUnknownOutput: "NotAllowed", + * uncompressedDigitalVideoOpl: 100, + * uncompressedDigitalAudioOpl: 100, + * analogVideoOpl: 150, + * compressedDigitalAudioOpl: 250, + * compressedDigitalVideoOpl: 400, + * explicitAnalogTelevisionOutputRestriction: { + * bestEffortEnforced: true, + * controlBits: 3, + * }, + * }, + * licenseType: "Persistent", + * contentType: "UltraVioletDownload", + * contentKeyLocationFromHeaderEnabled: true, + * }], + * openRestrictionEnabled: true, + * }, + * { + * name: "clearKey", + * clearKeyConfigurationEnabled: true, + * tokenRestriction: { + * issuer: "urn:issuer", + * audience: "urn:audience", + * tokenType: "Swt", + * primarySymmetricTokenKey: "AAAAAAAAAAAAAAAAAAAAAA==", + * alternateKeys: [ + * { + * rsaTokenKeyExponent: "AQAB", + * rsaTokenKeyModulus: "AQAD", + * }, + * { + * symmetricTokenKey: "BBAAAAAAAAAAAAAAAAAAAA==", + * }, + * ], + * }, + * }, + * { + * name: "widevine", + * widevineConfigurationTemplate: JSON.stringify({ + * allowed_track_types: "SD_HD", + * content_key_specs: [{ + * track_type: "SD", + * security_level: 1, + * required_output_protection: { + * hdcp: "HDCP_V2", + * }, + * }], + * policy_overrides: { + * can_play: true, + * can_persist: true, + * can_renew: false, + * }, + * }), + * openRestrictionEnabled: true, + * }, + * ], + * }); + * ``` + * * ## Import * * Content Key Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/job.ts b/sdk/nodejs/media/job.ts index dd75c9f744..ae0ee08020 100644 --- a/sdk/nodejs/media/job.ts +++ b/sdk/nodejs/media/job.ts @@ -9,6 +9,64 @@ import * as utilities from "../utilities"; /** * Manages a Media Job. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleTransform = new azure.media.Transform("exampleTransform", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "My transform description", + * outputs: [{ + * relativePriority: "Normal", + * onErrorAction: "ContinueJob", + * builtinPreset: { + * presetName: "AACGoodQualityAudio", + * }, + * }], + * }); + * const input = new azure.media.Asset("input", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "Input Asset description", + * }); + * const output = new azure.media.Asset("output", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "Output Asset description", + * }); + * const exampleJob = new azure.media.Job("exampleJob", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * transformName: exampleTransform.name, + * description: "My Job description", + * priority: "Normal", + * inputAsset: { + * name: input.name, + * }, + * outputAssets: [{ + * name: output.name, + * }], + * }); + * ``` + * * ## Import * * Media Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/liveEvent.ts b/sdk/nodejs/media/liveEvent.ts index 07a7de11f7..14bdaa38da 100644 --- a/sdk/nodejs/media/liveEvent.ts +++ b/sdk/nodejs/media/liveEvent.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; /** * Manages a Live Event. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleLiveEvent = new azure.media.LiveEvent("exampleLiveEvent", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "My Event Description", + * input: { + * streamingProtocol: "RTMP", + * ipAccessControlAllows: [{ + * name: "AllowAll", + * address: "0.0.0.0", + * subnetPrefixLength: 0, + * }], + * }, + * encoding: { + * type: "Standard", + * presetName: "Default720p", + * stretchMode: "AutoFit", + * keyFrameInterval: "PT2S", + * }, + * preview: { + * ipAccessControlAllows: [{ + * name: "AllowAll", + * address: "0.0.0.0", + * subnetPrefixLength: 0, + * }], + * }, + * streamOptions: ["LowLatency"], + * useStaticHostname: true, + * hostnamePrefix: "special-event", + * transcriptionLanguages: ["en-US"], + * }); + * ``` + * * ## Import * * Live Events can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/liveEventOutput.ts b/sdk/nodejs/media/liveEventOutput.ts index fa1123a5fe..89acb4d4c3 100644 --- a/sdk/nodejs/media/liveEventOutput.ts +++ b/sdk/nodejs/media/liveEventOutput.ts @@ -7,6 +7,58 @@ import * as utilities from "../utilities"; /** * Manages a Azure Media Live Event Output. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleAsset = new azure.media.Asset("exampleAsset", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * }); + * const exampleLiveEvent = new azure.media.LiveEvent("exampleLiveEvent", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "My Event Description", + * input: { + * streamingProtocol: "RTMP", + * keyFrameIntervalDuration: "PT6S", + * ipAccessControlAllows: [{ + * name: "AllowAll", + * address: "0.0.0.0", + * subnetPrefixLength: 0, + * }], + * }, + * }); + * const exampleLiveEventOutput = new azure.media.LiveEventOutput("exampleLiveEventOutput", { + * liveEventId: exampleLiveEvent.id, + * archiveWindowDuration: "PT5M", + * assetName: exampleAsset.name, + * description: "Test live output 1", + * manifestName: "testmanifest", + * outputSnapTimeInSeconds: 0, + * hlsFragmentsPerTsSegment: 5, + * rewindWindowDuration: "PT5M", + * }); + * ``` + * * ## Import * * Live Outputs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/serviceAccount.ts b/sdk/nodejs/media/serviceAccount.ts index 285a3c09a5..b47e617448 100644 --- a/sdk/nodejs/media/serviceAccount.ts +++ b/sdk/nodejs/media/serviceAccount.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages a Media Services Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * ``` + * * ## Import * * Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/streamingEndpoint.ts b/sdk/nodejs/media/streamingEndpoint.ts index 0c7b39598b..457c0f89b1 100644 --- a/sdk/nodejs/media/streamingEndpoint.ts +++ b/sdk/nodejs/media/streamingEndpoint.ts @@ -9,6 +9,87 @@ import * as utilities from "../utilities"; /** * Manages a Streaming Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleStreamingEndpoint = new azure.media.StreamingEndpoint("exampleStreamingEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * mediaServicesAccountName: exampleServiceAccount.name, + * scaleUnits: 2, + * }); + * ``` + * ### With Access Control + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleStreamingEndpoint = new azure.media.StreamingEndpoint("exampleStreamingEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * mediaServicesAccountName: exampleServiceAccount.name, + * scaleUnits: 2, + * accessControl: { + * ipAllows: [ + * { + * name: "AllowedIP", + * address: "192.168.1.1", + * }, + * { + * name: "AnotherIp", + * address: "192.168.1.2", + * }, + * ], + * akamaiSignatureHeaderAuthenticationKeys: [ + * { + * identifier: "id1", + * expiration: "2030-12-31T16:00:00Z", + * base64Key: "dGVzdGlkMQ==", + * }, + * { + * identifier: "id2", + * expiration: "2032-01-28T16:00:00Z", + * base64Key: "dGVzdGlkMQ==", + * }, + * ], + * }, + * }); + * ``` + * * ## Import * * Streaming Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/streamingLocator.ts b/sdk/nodejs/media/streamingLocator.ts index 73b1f598e3..fe0e8bbfc6 100644 --- a/sdk/nodejs/media/streamingLocator.ts +++ b/sdk/nodejs/media/streamingLocator.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages a Media Streaming Locator. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleAccountFilter = new azure.media.AccountFilter("exampleAccountFilter", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * }); + * const exampleAsset = new azure.media.Asset("exampleAsset", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "Asset description", + * }); + * const exampleStreamingLocator = new azure.media.StreamingLocator("exampleStreamingLocator", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * assetName: exampleAsset.name, + * streamingPolicyName: "Predefined_ClearStreamingOnly", + * filterNames: [exampleAccountFilter.name], + * }); + * ``` + * * ## Import * * Streaming Locators can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/streamingPolicy.ts b/sdk/nodejs/media/streamingPolicy.ts index 798f8ffb39..a5b29dab5f 100644 --- a/sdk/nodejs/media/streamingPolicy.ts +++ b/sdk/nodejs/media/streamingPolicy.ts @@ -9,6 +9,84 @@ import * as utilities from "../utilities"; /** * Manages a Streaming Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleContentKeyPolicy = new azure.media.ContentKeyPolicy("exampleContentKeyPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * policyOptions: [{ + * name: "fairPlay", + * fairplayConfiguration: { + * ask: "bb566284cc124a21c435a92cd3c108c4", + * pfx: "MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + * pfxPassword: "password", + * rentalDurationSeconds: 2249, + * rentalAndLeaseKeyType: "PersistentUnlimited", + * }, + * openRestrictionEnabled: true, + * }], + * }); + * const exampleStreamingPolicy = new azure.media.StreamingPolicy("exampleStreamingPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * commonEncryptionCenc: { + * clearTracks: [{ + * conditions: [{ + * property: "FourCC", + * operation: "Equal", + * value: "hev2", + * }], + * }], + * enabledProtocols: { + * download: false, + * dash: true, + * hls: false, + * smoothStreaming: false, + * }, + * defaultContentKey: { + * label: "aesDefaultKey", + * policyName: exampleContentKeyPolicy.name, + * }, + * drmPlayready: { + * customLicenseAcquisitionUrlTemplate: "https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}", + * customAttributes: "PlayReady CustomAttributes", + * }, + * drmWidevineCustomLicenseAcquisitionUrlTemplate: "https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId}", + * }, + * commonEncryptionCbcs: { + * enabledProtocols: { + * download: false, + * dash: true, + * hls: false, + * smoothStreaming: false, + * }, + * drmFairplay: { + * customLicenseAcquisitionUrlTemplate: "https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}", + * allowPersistentLicense: true, + * }, + * }, + * }); + * ``` + * * ## Import * * Streaming Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/media/transform.ts b/sdk/nodejs/media/transform.ts index 98d9665f12..8f6fa0ea3b 100644 --- a/sdk/nodejs/media/transform.ts +++ b/sdk/nodejs/media/transform.ts @@ -9,6 +9,335 @@ import * as utilities from "../utilities"; /** * Manages a Transform. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleTransform = new azure.media.Transform("exampleTransform", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "My transform description", + * outputs: [{ + * relativePriority: "Normal", + * onErrorAction: "ContinueJob", + * builtinPreset: { + * presetName: "AACGoodQualityAudio", + * }, + * }], + * }); + * ``` + * ### With Multiple Outputs + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * const exampleTransform = new azure.media.Transform("exampleTransform", { + * resourceGroupName: exampleResourceGroup.name, + * mediaServicesAccountName: exampleServiceAccount.name, + * description: "My transform description", + * outputs: [ + * { + * relativePriority: "Normal", + * onErrorAction: "ContinueJob", + * builtinPreset: { + * presetName: "AACGoodQualityAudio", + * presetConfiguration: { + * complexity: "Balanced", + * interleaveOutput: "NonInterleavedOutput", + * keyFrameIntervalInSeconds: 123122.5, + * maxBitrateBps: 300000, + * maxHeight: 480, + * maxLayers: 14, + * minBitrateBps: 200000, + * minHeight: 360, + * }, + * }, + * }, + * { + * relativePriority: "Low", + * onErrorAction: "ContinueJob", + * audioAnalyzerPreset: { + * audioLanguage: "en-US", + * audioAnalysisMode: "Basic", + * experimentalOptions: { + * env: "test", + * }, + * }, + * }, + * { + * relativePriority: "Low", + * onErrorAction: "StopProcessingJob", + * faceDetectorPreset: { + * analysisResolution: "StandardDefinition", + * blurType: "Med", + * faceRedactorMode: "Combined", + * experimentalOptions: { + * env: "test", + * }, + * }, + * }, + * { + * relativePriority: "Normal", + * onErrorAction: "StopProcessingJob", + * videoAnalyzerPreset: { + * audioLanguage: "en-US", + * audioAnalysisMode: "Basic", + * insightsType: "AllInsights", + * experimentalOptions: { + * env: "test", + * }, + * }, + * }, + * { + * relativePriority: "Low", + * onErrorAction: "ContinueJob", + * customPreset: { + * codecs: [ + * { + * aacAudio: { + * bitrate: 128000, + * channels: 2, + * samplingRate: 48000, + * profile: "AacLc", + * }, + * }, + * { + * copyAudio: { + * label: "test", + * }, + * }, + * { + * copyVideo: { + * label: "test", + * }, + * }, + * { + * h264Video: { + * keyFrameInterval: "PT1S", + * stretchMode: "AutoSize", + * syncMode: "Auto", + * sceneChangeDetectionEnabled: false, + * rateControlMode: "ABR", + * complexity: "Quality", + * layers: [ + * { + * width: "64", + * height: "64", + * bitrate: 1045000, + * maxBitrate: 1045000, + * bFrames: 3, + * slices: 0, + * adaptiveBFrameEnabled: true, + * profile: "Auto", + * level: "auto", + * bufferWindow: "PT5S", + * referenceFrames: 4, + * crf: 23, + * entropyMode: "Cabac", + * }, + * { + * width: "64", + * height: "64", + * bitrate: 1000, + * maxBitrate: 1000, + * bFrames: 3, + * frameRate: "32", + * slices: 1, + * adaptiveBFrameEnabled: true, + * profile: "High444", + * level: "auto", + * bufferWindow: "PT5S", + * referenceFrames: 4, + * crf: 23, + * entropyMode: "Cavlc", + * }, + * ], + * }, + * }, + * { + * h265Video: { + * keyFrameInterval: "PT2S", + * stretchMode: "AutoSize", + * syncMode: "Auto", + * sceneChangeDetectionEnabled: false, + * complexity: "Speed", + * layers: [{ + * width: "64", + * height: "64", + * bitrate: 1045000, + * maxBitrate: 1045000, + * bFrames: 3, + * slices: 5, + * adaptiveBFrameEnabled: true, + * profile: "Auto", + * label: "test", + * level: "auto", + * bufferWindow: "PT5S", + * frameRate: "32", + * referenceFrames: 4, + * crf: 23, + * }], + * }, + * }, + * { + * jpgImage: { + * stretchMode: "AutoSize", + * syncMode: "Auto", + * start: "10", + * range: "100%%", + * spriteColumn: 1, + * step: "10", + * layers: [{ + * quality: 70, + * height: "180", + * label: "test", + * width: "120", + * }], + * }, + * }, + * { + * pngImage: { + * stretchMode: "AutoSize", + * syncMode: "Auto", + * start: "{Best}", + * range: "80", + * step: "10", + * layers: [{ + * height: "180", + * label: "test", + * width: "120", + * }], + * }, + * }, + * ], + * formats: [ + * { + * jpg: { + * filenamePattern: "test{Basename}", + * }, + * }, + * { + * mp4: { + * filenamePattern: "test{Bitrate}", + * outputFiles: [{ + * labels: [ + * "test", + * "ppe", + * ], + * }], + * }, + * }, + * { + * png: { + * filenamePattern: "test{Basename}", + * }, + * }, + * { + * transportStream: { + * filenamePattern: "test{Bitrate}", + * outputFiles: [{ + * labels: ["prod"], + * }], + * }, + * }, + * ], + * filter: { + * cropRectangle: { + * height: "240", + * left: "30", + * top: "360", + * width: "70", + * }, + * deinterlace: { + * parity: "TopFieldFirst", + * mode: "AutoPixelAdaptive", + * }, + * fadeIn: { + * duration: "PT5S", + * fadeColor: "0xFF0000", + * start: "10", + * }, + * fadeOut: { + * duration: "90%%", + * fadeColor: "#FF0C7B", + * start: "10%%", + * }, + * rotation: "Auto", + * overlays: [ + * { + * audio: { + * inputLabel: "label.jpg", + * start: "PT5S", + * end: "PT30S", + * fadeInDuration: "PT1S", + * fadeOutDuration: "PT2S", + * audioGainLevel: 1, + * }, + * }, + * { + * video: { + * inputLabel: "label.jpg", + * start: "PT5S", + * end: "PT30S", + * fadeInDuration: "PT1S", + * fadeOutDuration: "PT2S", + * audioGainLevel: 1, + * opacity: 1, + * position: { + * height: "180", + * left: "20", + * top: "240", + * width: "140", + * }, + * cropRectangle: { + * height: "240", + * left: "30", + * top: "360", + * width: "70", + * }, + * }, + * }, + * ], + * }, + * }, + * }, + * ], + * }); + * ``` + * * ## Import * * Transforms can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mediaservices/account.ts b/sdk/nodejs/mediaservices/account.ts index 78e2f54ae8..a4e8878a1b 100644 --- a/sdk/nodejs/mediaservices/account.ts +++ b/sdk/nodejs/mediaservices/account.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages a Media Services Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServiceAccount = new azure.media.ServiceAccount("exampleServiceAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccounts: [{ + * id: exampleAccount.id, + * isPrimary: true, + * }], + * }); + * ``` + * * ## Import * * Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mixedreality/getSpatialAnchorsAccount.ts b/sdk/nodejs/mixedreality/getSpatialAnchorsAccount.ts index cd2824129e..4555821700 100644 --- a/sdk/nodejs/mixedreality/getSpatialAnchorsAccount.ts +++ b/sdk/nodejs/mixedreality/getSpatialAnchorsAccount.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Get information about an Azure Spatial Anchors Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mixedreality.getSpatialAnchorsAccount({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const accountDomain = data.azurerm_spatial_anchors_account.account_domain; + * ``` */ export function getSpatialAnchorsAccount(args: GetSpatialAnchorsAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -56,6 +69,19 @@ export interface GetSpatialAnchorsAccountResult { } /** * Get information about an Azure Spatial Anchors Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mixedreality.getSpatialAnchorsAccount({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const accountDomain = data.azurerm_spatial_anchors_account.account_domain; + * ``` */ export function getSpatialAnchorsAccountOutput(args: GetSpatialAnchorsAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSpatialAnchorsAccount(a, opts)) diff --git a/sdk/nodejs/mixedreality/spatialAnchorsAccount.ts b/sdk/nodejs/mixedreality/spatialAnchorsAccount.ts index d9ceb58d5b..0b7475712c 100644 --- a/sdk/nodejs/mixedreality/spatialAnchorsAccount.ts +++ b/sdk/nodejs/mixedreality/spatialAnchorsAccount.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages an Azure Spatial Anchors Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpatialAnchorsAccount = new azure.mixedreality.SpatialAnchorsAccount("exampleSpatialAnchorsAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * Spatial Anchors Account can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/getNetwork.ts b/sdk/nodejs/mobile/getNetwork.ts index 08c29d7aa6..ab82cc9699 100644 --- a/sdk/nodejs/mobile/getNetwork.ts +++ b/sdk/nodejs/mobile/getNetwork.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Get information about an Azure Mobile Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getNetwork(args: GetNetworkArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +75,18 @@ export interface GetNetworkResult { } /** * Get information about an Azure Mobile Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getNetworkOutput(args: GetNetworkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetwork(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkAttachedDataNetwork.ts b/sdk/nodejs/mobile/getNetworkAttachedDataNetwork.ts index 1cab28e293..920864cbd0 100644 --- a/sdk/nodejs/mobile/getNetworkAttachedDataNetwork.ts +++ b/sdk/nodejs/mobile/getNetworkAttachedDataNetwork.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Mobile Network Attached Data Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetworkPacketCoreControlPlane = azure.mobile.getNetworkPacketCoreControlPlane({ + * name: "example-mnpccp", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkAttachedDataNetwork = Promise.all([exampleNetworkPacketCoreControlPlane, exampleNetworkPacketCoreControlPlane]).then(([exampleNetworkPacketCoreControlPlane, exampleNetworkPacketCoreControlPlane1]) => azure.mobile.getNetworkAttachedDataNetwork({ + * mobileNetworkDataNetworkName: exampleNetworkPacketCoreControlPlane.name, + * mobileNetworkPacketCoreDataPlaneId: exampleNetworkPacketCoreControlPlane1.id, + * })); + * ``` */ export function getNetworkAttachedDataNetwork(args: GetNetworkAttachedDataNetworkArgs, opts?: pulumi.InvokeOptions): Promise { @@ -79,6 +95,22 @@ export interface GetNetworkAttachedDataNetworkResult { } /** * Use this data source to access information about an existing Mobile Network Attached Data Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetworkPacketCoreControlPlane = azure.mobile.getNetworkPacketCoreControlPlane({ + * name: "example-mnpccp", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkAttachedDataNetwork = Promise.all([exampleNetworkPacketCoreControlPlane, exampleNetworkPacketCoreControlPlane]).then(([exampleNetworkPacketCoreControlPlane, exampleNetworkPacketCoreControlPlane1]) => azure.mobile.getNetworkAttachedDataNetwork({ + * mobileNetworkDataNetworkName: exampleNetworkPacketCoreControlPlane.name, + * mobileNetworkPacketCoreDataPlaneId: exampleNetworkPacketCoreControlPlane1.id, + * })); + * ``` */ export function getNetworkAttachedDataNetworkOutput(args: GetNetworkAttachedDataNetworkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkAttachedDataNetwork(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkDataNetwork.ts b/sdk/nodejs/mobile/getNetworkDataNetwork.ts index 6601d9f3c4..196e6e99b6 100644 --- a/sdk/nodejs/mobile/getNetworkDataNetwork.ts +++ b/sdk/nodejs/mobile/getNetworkDataNetwork.ts @@ -6,6 +6,22 @@ import * as utilities from "../utilities"; /** * Get information about a Mobile Network Data Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkDataNetwork = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkDataNetwork({ + * name: "example-mndn", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkDataNetwork(args: GetNetworkDataNetworkArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +71,22 @@ export interface GetNetworkDataNetworkResult { } /** * Get information about a Mobile Network Data Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkDataNetwork = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkDataNetwork({ + * name: "example-mndn", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkDataNetworkOutput(args: GetNetworkDataNetworkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkDataNetwork(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkPacketCoreControlPlane.ts b/sdk/nodejs/mobile/getNetworkPacketCoreControlPlane.ts index 3b2ef1040e..e11b4338f0 100644 --- a/sdk/nodejs/mobile/getNetworkPacketCoreControlPlane.ts +++ b/sdk/nodejs/mobile/getNetworkPacketCoreControlPlane.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Get information about a Mobile Network Packet Core Control Plane. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mobile.getNetworkPacketCoreControlPlane({ + * name: "example-mnpccp", + * resourceGroupName: "example-rg", + * }); + * ``` */ export function getNetworkPacketCoreControlPlane(args: GetNetworkPacketCoreControlPlaneArgs, opts?: pulumi.InvokeOptions): Promise { @@ -96,6 +108,18 @@ export interface GetNetworkPacketCoreControlPlaneResult { } /** * Get information about a Mobile Network Packet Core Control Plane. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mobile.getNetworkPacketCoreControlPlane({ + * name: "example-mnpccp", + * resourceGroupName: "example-rg", + * }); + * ``` */ export function getNetworkPacketCoreControlPlaneOutput(args: GetNetworkPacketCoreControlPlaneOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkPacketCoreControlPlane(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkPacketCoreDataPlane.ts b/sdk/nodejs/mobile/getNetworkPacketCoreDataPlane.ts index 7a3e062bae..a68f8a595c 100644 --- a/sdk/nodejs/mobile/getNetworkPacketCoreDataPlane.ts +++ b/sdk/nodejs/mobile/getNetworkPacketCoreDataPlane.ts @@ -6,6 +6,22 @@ import * as utilities from "../utilities"; /** * Get information a Mobile Network Packet Core Data Plane. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetworkPacketCoreControlPlane = azure.mobile.getNetworkPacketCoreControlPlane({ + * name: "example-mnpccp", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkPacketCoreDataPlane = exampleNetworkPacketCoreControlPlane.then(exampleNetworkPacketCoreControlPlane => azure.mobile.getNetworkPacketCoreDataPlane({ + * name: "example-mnpcdp", + * mobileNetworkPacketCoreControlPlaneId: exampleNetworkPacketCoreControlPlane.id, + * })); + * ``` */ export function getNetworkPacketCoreDataPlane(args: GetNetworkPacketCoreDataPlaneArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +83,22 @@ export interface GetNetworkPacketCoreDataPlaneResult { } /** * Get information a Mobile Network Packet Core Data Plane. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetworkPacketCoreControlPlane = azure.mobile.getNetworkPacketCoreControlPlane({ + * name: "example-mnpccp", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkPacketCoreDataPlane = exampleNetworkPacketCoreControlPlane.then(exampleNetworkPacketCoreControlPlane => azure.mobile.getNetworkPacketCoreDataPlane({ + * name: "example-mnpcdp", + * mobileNetworkPacketCoreControlPlaneId: exampleNetworkPacketCoreControlPlane.id, + * })); + * ``` */ export function getNetworkPacketCoreDataPlaneOutput(args: GetNetworkPacketCoreDataPlaneOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkPacketCoreDataPlane(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkService.ts b/sdk/nodejs/mobile/getNetworkService.ts index f7854dd4ca..44a81b26fd 100644 --- a/sdk/nodejs/mobile/getNetworkService.ts +++ b/sdk/nodejs/mobile/getNetworkService.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Get information about a Mobile Network Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkService = new azure.mobile.NetworkService("exampleNetworkService", {mobileNetworkId: exampleNetwork.then(exampleNetwork => exampleNetwork.id)}); + * ``` */ export function getNetworkService(args: GetNetworkServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface GetNetworkServiceResult { } /** * Get information about a Mobile Network Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkService = new azure.mobile.NetworkService("exampleNetworkService", {mobileNetworkId: exampleNetwork.then(exampleNetwork => exampleNetwork.id)}); + * ``` */ export function getNetworkServiceOutput(args: GetNetworkServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkService(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkSimGroup.ts b/sdk/nodejs/mobile/getNetworkSimGroup.ts index 90fe9d61b4..4c02b42029 100644 --- a/sdk/nodejs/mobile/getNetworkSimGroup.ts +++ b/sdk/nodejs/mobile/getNetworkSimGroup.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Get information about a Mobile Network Sim Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * const exampleNetworkSimGroup = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkSimGroup({ + * name: "example-mnsg", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkSimGroup(args: GetNetworkSimGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +77,22 @@ export interface GetNetworkSimGroupResult { } /** * Get information about a Mobile Network Sim Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * const exampleNetworkSimGroup = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkSimGroup({ + * name: "example-mnsg", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkSimGroupOutput(args: GetNetworkSimGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkSimGroup(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkSimPolicy.ts b/sdk/nodejs/mobile/getNetworkSimPolicy.ts index 6794104fcf..3f826d2939 100644 --- a/sdk/nodejs/mobile/getNetworkSimPolicy.ts +++ b/sdk/nodejs/mobile/getNetworkSimPolicy.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Get information about a Mobile Network Sim Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkSimPolicy = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkSimPolicy({ + * name: "example-mnsp", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkSimPolicy(args: GetNetworkSimPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -73,6 +89,22 @@ export interface GetNetworkSimPolicyResult { } /** * Get information about a Mobile Network Sim Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkSimPolicy = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkSimPolicy({ + * name: "example-mnsp", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkSimPolicyOutput(args: GetNetworkSimPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkSimPolicy(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkSite.ts b/sdk/nodejs/mobile/getNetworkSite.ts index d6e8230bc4..e660e14194 100644 --- a/sdk/nodejs/mobile/getNetworkSite.ts +++ b/sdk/nodejs/mobile/getNetworkSite.ts @@ -6,6 +6,22 @@ import * as utilities from "../utilities"; /** * Get information about a Mobile Network Site. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkSite = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkSite({ + * name: "example-mns", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkSite(args: GetNetworkSiteArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +71,22 @@ export interface GetNetworkSiteResult { } /** * Get information about a Mobile Network Site. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkSite = exampleNetwork.then(exampleNetwork => azure.mobile.getNetworkSite({ + * name: "example-mns", + * mobileNetworkId: exampleNetwork.id, + * })); + * ``` */ export function getNetworkSiteOutput(args: GetNetworkSiteOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkSite(a, opts)) diff --git a/sdk/nodejs/mobile/getNetworkSlice.ts b/sdk/nodejs/mobile/getNetworkSlice.ts index 3d084b1cb4..7e676a03d2 100644 --- a/sdk/nodejs/mobile/getNetworkSlice.ts +++ b/sdk/nodejs/mobile/getNetworkSlice.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Get information about a Mobile Network Slice. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkSlice = azure.mobile.getNetworkSlice({ + * name: "example-mns", + * mobileNetworkId: data.azurerm_mobile_network.test.id, + * }); + * ``` */ export function getNetworkSlice(args: GetNetworkSliceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +77,22 @@ export interface GetNetworkSliceResult { } /** * Get information about a Mobile Network Slice. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleNetwork = azure.mobile.getNetwork({ + * name: "example-mn", + * resourceGroupName: "example-rg", + * }); + * const exampleNetworkSlice = azure.mobile.getNetworkSlice({ + * name: "example-mns", + * mobileNetworkId: data.azurerm_mobile_network.test.id, + * }); + * ``` */ export function getNetworkSliceOutput(args: GetNetworkSliceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkSlice(a, opts)) diff --git a/sdk/nodejs/mobile/network.ts b/sdk/nodejs/mobile/network.ts index 8873f11853..df714d114d 100644 --- a/sdk/nodejs/mobile/network.ts +++ b/sdk/nodejs/mobile/network.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkDataNetwork.ts b/sdk/nodejs/mobile/networkDataNetwork.ts index 9f9a6e05aa..4c57c9eb4d 100644 --- a/sdk/nodejs/mobile/networkDataNetwork.ts +++ b/sdk/nodejs/mobile/networkDataNetwork.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Data Network. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East Us"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleNetworkDataNetwork = new azure.mobile.NetworkDataNetwork("exampleNetworkDataNetwork", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * description: "example description", + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network Data Network can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkPacketCoreControlPlane.ts b/sdk/nodejs/mobile/networkPacketCoreControlPlane.ts index 1a6e74ca8e..9ceebc3ba9 100644 --- a/sdk/nodejs/mobile/networkPacketCoreControlPlane.ts +++ b/sdk/nodejs/mobile/networkPacketCoreControlPlane.ts @@ -9,6 +9,53 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Packet Core Control Plane. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleNetworkSite = new azure.mobile.NetworkSite("exampleNetworkSite", { + * mobileNetworkId: azurerm_mobile_network.test.id, + * location: exampleResourceGroup.location, + * }); + * const exampleDevice = new azure.databoxedge.Device("exampleDevice", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "EdgeP_Base-Standard", + * }); + * const exampleNetworkPacketCoreControlPlane = new azure.mobile.NetworkPacketCoreControlPlane("exampleNetworkPacketCoreControlPlane", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "G0", + * controlPlaneAccessName: "default-interface", + * controlPlaneAccessIpv4Address: "192.168.1.199", + * controlPlaneAccessIpv4Gateway: "192.168.1.1", + * controlPlaneAccessIpv4Subnet: "192.168.1.0/25", + * siteIds: [exampleNetworkSite.id], + * localDiagnosticsAccess: { + * authenticationType: "AAD", + * }, + * platform: { + * type: "AKS-HCI", + * edgeDeviceId: exampleDevice.id, + * }, + * interoperabilitySettingsJson: JSON.stringify({ + * key: "value", + * }), + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network Packet Core Control Plane can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkService.ts b/sdk/nodejs/mobile/networkService.ts index 52b8fc72da..edf690142a 100644 --- a/sdk/nodejs/mobile/networkService.ts +++ b/sdk/nodejs/mobile/networkService.ts @@ -9,6 +9,65 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleNetworkService = new azure.mobile.NetworkService("exampleNetworkService", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * servicePrecedence: 0, + * pccRules: [{ + * name: "default-rule", + * precedence: 1, + * trafficControlEnabled: true, + * qosPolicy: { + * allocationAndRetentionPriorityLevel: 9, + * qosIndicator: 9, + * preemptionCapability: "NotPreempt", + * preemptionVulnerability: "Preemptable", + * guaranteedBitRate: { + * downlink: "100 Mbps", + * uplink: "10 Mbps", + * }, + * maximumBitRate: { + * downlink: "1 Gbps", + * uplink: "100 Mbps", + * }, + * }, + * serviceDataFlowTemplates: [{ + * direction: "Uplink", + * name: "IP-to-server", + * ports: [], + * protocols: ["ip"], + * remoteIpLists: ["10.3.4.0/24"], + * }], + * }], + * serviceQosPolicy: { + * allocationAndRetentionPriorityLevel: 9, + * qosIndicator: 9, + * preemptionCapability: "NotPreempt", + * preemptionVulnerability: "Preemptable", + * maximumBitRate: { + * downlink: "1 Gbps", + * uplink: "100 Mbps", + * }, + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network Service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkSim.ts b/sdk/nodejs/mobile/networkSim.ts index f392a3ae9e..7cf3ac1471 100644 --- a/sdk/nodejs/mobile/networkSim.ts +++ b/sdk/nodejs/mobile/networkSim.ts @@ -9,6 +9,56 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Sim. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleNetworkSimGroup = new azure.mobile.NetworkSimGroup("exampleNetworkSimGroup", { + * location: exampleResourceGroup.location, + * mobileNetworkId: exampleNetwork.id, + * }); + * const exampleNetworkSlice = new azure.mobile.NetworkSlice("exampleNetworkSlice", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * singleNetworkSliceSelectionAssistanceInformation: { + * sliceServiceType: 1, + * }, + * }); + * const exampleNetworkAttachedDataNetwork = new azure.mobile.NetworkAttachedDataNetwork("exampleNetworkAttachedDataNetwork", { + * mobileNetworkDataNetworkName: azurerm_mobile_network_data_network.example.name, + * mobileNetworkPacketCoreDataPlaneId: azurerm_mobile_network_packet_core_data_plane.example.id, + * location: exampleResourceGroup.location, + * dnsAddresses: ["1.1.1.1"], + * userEquipmentAddressPoolPrefixes: ["2.4.0.0/24"], + * userEquipmentStaticAddressPoolPrefixes: ["2.4.1.0/24"], + * userPlaneAccessName: "test", + * userPlaneAccessIpv4Address: "10.204.141.4", + * userPlaneAccessIpv4Gateway: "10.204.141.1", + * userPlaneAccessIpv4Subnet: "10.204.141.0/24", + * }); + * const exampleNetworkSim = new azure.mobile.NetworkSim("exampleNetworkSim", { + * mobileNetworkSimGroupId: exampleNetworkSimGroup.id, + * authenticationKey: "00000000000000000000000000000000", + * integratedCircuitCardIdentifier: "8900000000000000000", + * internationalMobileSubscriberIdentity: "000000000000000", + * operatorKeyCode: "00000000000000000000000000000000", + * staticIpConfigurations: [{ + * attachedDataNetworkId: data.azurerm_mobile_network_attached_data_network.test.id, + * sliceId: azurerm_mobile_network_slice.test.id, + * staticIpv4Address: "2.4.0.1", + * }], + * }); + * ``` + * * ## Import * * Mobile Network Sim can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkSimGroup.ts b/sdk/nodejs/mobile/networkSimGroup.ts index 9307cffee3..42b5edf942 100644 --- a/sdk/nodejs/mobile/networkSimGroup.ts +++ b/sdk/nodejs/mobile/networkSimGroup.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Sim Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleUserAssignedIdentity = azure.authorization.getUserAssignedIdentity({ + * name: "name_of_user_assigned_identity", + * resourceGroupName: "name_of_resource_group", + * }); + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: "example-kv", + * resourceGroupName: "some-resource-group", + * }); + * const exampleKey = exampleKeyVault.then(exampleKeyVault => azure.keyvault.getKey({ + * name: "example-key", + * keyVaultId: exampleKeyVault.id, + * })); + * const exampleNetworkSimGroup = new azure.mobile.NetworkSimGroup("exampleNetworkSimGroup", { + * location: exampleResourceGroup.location, + * mobileNetworkId: exampleNetwork.id, + * encryptionKeyUrl: exampleKey.then(exampleKey => exampleKey.id), + * identity: { + * type: "SystemAssigned, UserAssigned", + * identityIds: [exampleUserAssignedIdentity.then(exampleUserAssignedIdentity => exampleUserAssignedIdentity.id)], + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network Sim Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkSimPolicy.ts b/sdk/nodejs/mobile/networkSimPolicy.ts index b8858cd2db..58ec248e47 100644 --- a/sdk/nodejs/mobile/networkSimPolicy.ts +++ b/sdk/nodejs/mobile/networkSimPolicy.ts @@ -9,6 +9,79 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Sim Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleNetworkDataNetwork = new azure.mobile.NetworkDataNetwork("exampleNetworkDataNetwork", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * }); + * const exampleNetworkService = new azure.mobile.NetworkService("exampleNetworkService", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * servicePrecedence: 0, + * pccRules: [{ + * name: "default-rule", + * precedence: 1, + * trafficControlEnabled: true, + * serviceDataFlowTemplates: [{ + * direction: "Uplink", + * name: "IP-to-server", + * ports: [], + * protocols: ["ip"], + * remoteIpLists: ["10.3.4.0/24"], + * }], + * }], + * }); + * const exampleNetworkSlice = new azure.mobile.NetworkSlice("exampleNetworkSlice", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * singleNetworkSliceSelectionAssistanceInformation: { + * sliceServiceType: 1, + * }, + * }); + * const exampleNetworkSimPolicy = new azure.mobile.NetworkSimPolicy("exampleNetworkSimPolicy", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * registrationTimerInSeconds: 3240, + * defaultSliceId: exampleNetworkSlice.id, + * slices: [{ + * defaultDataNetworkId: exampleNetworkDataNetwork.id, + * sliceId: exampleNetworkSlice.id, + * dataNetworks: [{ + * dataNetworkId: exampleNetworkDataNetwork.id, + * allocationAndRetentionPriorityLevel: 9, + * defaultSessionType: "IPv4", + * qosIndicator: 9, + * preemptionCapability: "NotPreempt", + * preemptionVulnerability: "Preemptable", + * allowedServicesIds: [exampleNetworkService.id], + * sessionAggregateMaximumBitRate: { + * downlink: "1 Gbps", + * uplink: "500 Mbps", + * }, + * }], + * }], + * userEquipmentAggregateMaximumBitRate: { + * downlink: "1 Gbps", + * uplink: "500 Mbps", + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network Sim Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkSite.ts b/sdk/nodejs/mobile/networkSite.ts index d311b4a187..6576fac7f5 100644 --- a/sdk/nodejs/mobile/networkSite.ts +++ b/sdk/nodejs/mobile/networkSite.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Site. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDevice = new azure.databoxedge.Device("exampleDevice", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "EdgeP_Base-Standard", + * }); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleNetworkSite = new azure.mobile.NetworkSite("exampleNetworkSite", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network Site can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mobile/networkSlice.ts b/sdk/nodejs/mobile/networkSlice.ts index d8d3f327d3..5864fa8d53 100644 --- a/sdk/nodejs/mobile/networkSlice.ts +++ b/sdk/nodejs/mobile/networkSlice.ts @@ -9,6 +9,32 @@ import * as utilities from "../utilities"; /** * Manages a Mobile Network Slice. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetwork = new azure.mobile.Network("exampleNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * mobileCountryCode: "001", + * mobileNetworkCode: "01", + * }); + * const exampleNetworkSlice = new azure.mobile.NetworkSlice("exampleNetworkSlice", { + * mobileNetworkId: exampleNetwork.id, + * location: exampleResourceGroup.location, + * description: "an example slice", + * singleNetworkSliceSelectionAssistanceInformation: { + * sliceServiceType: 1, + * }, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Mobile Network Slice can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/aadDiagnosticSetting.ts b/sdk/nodejs/monitoring/aadDiagnosticSetting.ts index b22648c503..c4f99c7eaa 100644 --- a/sdk/nodejs/monitoring/aadDiagnosticSetting.ts +++ b/sdk/nodejs/monitoring/aadDiagnosticSetting.ts @@ -11,6 +11,55 @@ import * as utilities from "../utilities"; * * !> **Authentication** The API for this resource does not support service principal authentication. This resource can only be used with Azure CLI authentication. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountKind: "StorageV2", + * accountReplicationType: "LRS", + * }); + * const exampleAadDiagnosticSetting = new azure.monitoring.AadDiagnosticSetting("exampleAadDiagnosticSetting", { + * storageAccountId: exampleAccount.id, + * enabledLogs: [ + * { + * category: "SignInLogs", + * retentionPolicy: { + * enabled: true, + * days: 1, + * }, + * }, + * { + * category: "AuditLogs", + * retentionPolicy: { + * enabled: true, + * days: 1, + * }, + * }, + * { + * category: "NonInteractiveUserSignInLogs", + * retentionPolicy: { + * enabled: true, + * days: 1, + * }, + * }, + * { + * category: "ServicePrincipalSignInLogs", + * retentionPolicy: { + * enabled: true, + * days: 1, + * }, + * }, + * ], + * }); + * ``` + * * ## Import * * Monitor Azure Active Directory Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/actionGroup.ts b/sdk/nodejs/monitoring/actionGroup.ts index 992032c023..eb2e01a353 100644 --- a/sdk/nodejs/monitoring/actionGroup.ts +++ b/sdk/nodejs/monitoring/actionGroup.ts @@ -9,6 +9,95 @@ import * as utilities from "../utilities"; /** * Manages an Action Group within Azure Monitor. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getClientConfig({}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "p0action", + * armRoleReceivers: [{ + * name: "armroleaction", + * roleId: "de139f84-1756-47ae-9be6-808fbbe84772", + * useCommonAlertSchema: true, + * }], + * automationRunbookReceivers: [{ + * name: "action_name_1", + * automationAccountId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001", + * runbookName: "my runbook", + * webhookResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001/webHooks/webhook_alert", + * isGlobalRunbook: true, + * serviceUri: "https://s13events.azure-automation.net/webhooks?token=randomtoken", + * useCommonAlertSchema: true, + * }], + * azureAppPushReceivers: [{ + * name: "pushtoadmin", + * emailAddress: "admin@contoso.com", + * }], + * azureFunctionReceivers: [{ + * name: "funcaction", + * functionAppResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-funcapp/providers/Microsoft.Web/sites/funcapp", + * functionName: "myfunc", + * httpTriggerUrl: "https://example.com/trigger", + * useCommonAlertSchema: true, + * }], + * emailReceivers: [ + * { + * name: "sendtoadmin", + * emailAddress: "admin@contoso.com", + * }, + * { + * name: "sendtodevops", + * emailAddress: "devops@contoso.com", + * useCommonAlertSchema: true, + * }, + * ], + * eventHubReceivers: [{ + * name: "sendtoeventhub", + * eventHubNamespace: "eventhubnamespace", + * eventHubName: "eventhub1", + * subscriptionId: "00000000-0000-0000-0000-000000000000", + * useCommonAlertSchema: false, + * }], + * itsmReceivers: [{ + * name: "createorupdateticket", + * workspaceId: pulumi.all([current, exampleAnalyticsWorkspace.workspaceId]).apply(([current, workspaceId]) => `${current.subscriptionId}|${workspaceId}`), + * connectionId: "53de6956-42b4-41ba-be3c-b154cdf17b13", + * ticketConfiguration: "{\"PayloadRevision\":0,\"WorkItemType\":\"Incident\",\"UseTemplate\":false,\"WorkItemData\":\"{}\",\"CreateOneWIPerCI\":false}", + * region: "southcentralus", + * }], + * logicAppReceivers: [{ + * name: "logicappaction", + * resourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-logicapp/providers/Microsoft.Logic/workflows/logicapp", + * callbackUrl: "https://logicapptriggerurl/...", + * useCommonAlertSchema: true, + * }], + * smsReceivers: [{ + * name: "oncallmsg", + * countryCode: "1", + * phoneNumber: "1231231234", + * }], + * voiceReceivers: [{ + * name: "remotesupport", + * countryCode: "86", + * phoneNumber: "13888888888", + * }], + * webhookReceivers: [{ + * name: "callmyapiaswell", + * serviceUri: "http://example.com/alert", + * useCommonAlertSchema: true, + * }], + * }); + * ``` + * * ## Import * * Action Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/actionRuleActionGroup.ts b/sdk/nodejs/monitoring/actionRuleActionGroup.ts index 816c73b095..d6499daa1e 100644 --- a/sdk/nodejs/monitoring/actionRuleActionGroup.ts +++ b/sdk/nodejs/monitoring/actionRuleActionGroup.ts @@ -11,6 +11,30 @@ import * as utilities from "../utilities"; * * !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.monitoring.AlertProcessingRuleActionGroup` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "example", + * }); + * const exampleActionRuleActionGroup = new azure.monitoring.ActionRuleActionGroup("exampleActionRuleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * actionGroupId: exampleActionGroup.id, + * scope: { + * type: "ResourceGroup", + * resourceIds: [exampleResourceGroup.id], + * }, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/actionRuleSuppression.ts b/sdk/nodejs/monitoring/actionRuleSuppression.ts index 0ecf6b8ac4..e6df8af459 100644 --- a/sdk/nodejs/monitoring/actionRuleSuppression.ts +++ b/sdk/nodejs/monitoring/actionRuleSuppression.ts @@ -11,6 +11,38 @@ import * as utilities from "../utilities"; * * !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `azure.monitoring.AlertProcessingRuleSuppression` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleActionRuleSuppression = new azure.monitoring.ActionRuleSuppression("exampleActionRuleSuppression", { + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * type: "ResourceGroup", + * resourceIds: [exampleResourceGroup.id], + * }, + * suppression: { + * recurrenceType: "Weekly", + * schedule: { + * startDateUtc: "2019-01-01T01:02:03Z", + * endDateUtc: "2019-01-03T15:02:07Z", + * recurrenceWeeklies: [ + * "Sunday", + * "Monday", + * "Friday", + * "Saturday", + * ], + * }, + * }, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/activityLogAlert.ts b/sdk/nodejs/monitoring/activityLogAlert.ts index de1a3402f2..a8244694b6 100644 --- a/sdk/nodejs/monitoring/activityLogAlert.ts +++ b/sdk/nodejs/monitoring/activityLogAlert.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages an Activity Log Alert within Azure Monitor. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const mainActionGroup = new azure.monitoring.ActionGroup("mainActionGroup", { + * resourceGroupName: example.name, + * shortName: "p0action", + * webhookReceivers: [{ + * name: "callmyapi", + * serviceUri: "http://example.com/alert", + * }], + * }); + * const toMonitor = new azure.storage.Account("toMonitor", { + * resourceGroupName: example.name, + * location: example.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const mainActivityLogAlert = new azure.monitoring.ActivityLogAlert("mainActivityLogAlert", { + * resourceGroupName: example.name, + * scopes: [example.id], + * description: "This alert will monitor a specific storage account updates.", + * criteria: { + * resourceId: toMonitor.id, + * operationName: "Microsoft.Storage/storageAccounts/write", + * category: "Recommendation", + * }, + * actions: [{ + * actionGroupId: mainActionGroup.id, + * webhookProperties: { + * from: "source", + * }, + * }], + * }); + * ``` + * * ## Import * * Activity log alerts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/alertProcessingRuleActionGroup.ts b/sdk/nodejs/monitoring/alertProcessingRuleActionGroup.ts index 8da00997d1..be868aa3d1 100644 --- a/sdk/nodejs/monitoring/alertProcessingRuleActionGroup.ts +++ b/sdk/nodejs/monitoring/alertProcessingRuleActionGroup.ts @@ -9,6 +9,58 @@ import * as utilities from "../utilities"; /** * Manages an Alert Processing Rule which apply action group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "action", + * }); + * const exampleAlertProcessingRuleActionGroup = new azure.monitoring.AlertProcessingRuleActionGroup("exampleAlertProcessingRuleActionGroup", { + * resourceGroupName: "example", + * scopes: [exampleResourceGroup.id], + * addActionGroupIds: [exampleActionGroup.id], + * condition: { + * targetResourceType: { + * operator: "Equals", + * values: ["Microsoft.Compute/VirtualMachines"], + * }, + * severity: { + * operator: "Equals", + * values: [ + * "Sev0", + * "Sev1", + * "Sev2", + * ], + * }, + * }, + * schedule: { + * effectiveFrom: "2022-01-01T01:02:03", + * effectiveUntil: "2022-02-02T01:02:03", + * timeZone: "Pacific Standard Time", + * recurrence: { + * dailies: [{ + * startTime: "17:00:00", + * endTime: "09:00:00", + * }], + * weeklies: [{ + * daysOfWeeks: [ + * "Saturday", + * "Sunday", + * ], + * }], + * }, + * }, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/alertProcessingRuleSuppression.ts b/sdk/nodejs/monitoring/alertProcessingRuleSuppression.ts index 13a94b79a1..8044e68231 100644 --- a/sdk/nodejs/monitoring/alertProcessingRuleSuppression.ts +++ b/sdk/nodejs/monitoring/alertProcessingRuleSuppression.ts @@ -9,6 +9,53 @@ import * as utilities from "../utilities"; /** * Manages an Alert Processing Rule which suppress notifications. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAlertProcessingRuleSuppression = new azure.monitoring.AlertProcessingRuleSuppression("exampleAlertProcessingRuleSuppression", { + * resourceGroupName: "example", + * scopes: [exampleResourceGroup.id], + * condition: { + * targetResourceType: { + * operator: "Equals", + * values: ["Microsoft.Compute/VirtualMachines"], + * }, + * severity: { + * operator: "Equals", + * values: [ + * "Sev0", + * "Sev1", + * "Sev2", + * ], + * }, + * }, + * schedule: { + * effectiveFrom: "2022-01-01T01:02:03", + * effectiveUntil: "2022-02-02T01:02:03", + * timeZone: "Pacific Standard Time", + * recurrence: { + * dailies: [{ + * startTime: "17:00:00", + * endTime: "09:00:00", + * }], + * weeklies: [{ + * daysOfWeeks: [ + * "Saturday", + * "Sunday", + * ], + * }], + * }, + * }, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/autoscaleSetting.ts b/sdk/nodejs/monitoring/autoscaleSetting.ts index c2a5c1aac9..acc55994f7 100644 --- a/sdk/nodejs/monitoring/autoscaleSetting.ts +++ b/sdk/nodejs/monitoring/autoscaleSetting.ts @@ -9,6 +9,237 @@ import * as utilities from "../utilities"; /** * Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * upgradeMode: "Manual", + * sku: "Standard_F2", + * instances: 2, + * adminUsername: "myadmin", + * adminSshKeys: [{ + * username: "myadmin", + * publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + * }], + * networkInterfaces: [{ + * name: "TestNetworkProfile", + * primary: true, + * ipConfigurations: [{ + * name: "TestIPConfiguration", + * primary: true, + * subnetId: exampleSubnet.id, + * }], + * }], + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "StandardSSD_LRS", + * }, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * }); + * const exampleAutoscaleSetting = new azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * targetResourceId: exampleLinuxVirtualMachineScaleSet.id, + * profiles: [{ + * name: "defaultProfile", + * capacity: { + * "default": 1, + * minimum: 1, + * maximum: 10, + * }, + * rules: [ + * { + * metricTrigger: { + * metricName: "Percentage CPU", + * metricResourceId: exampleLinuxVirtualMachineScaleSet.id, + * timeGrain: "PT1M", + * statistic: "Average", + * timeWindow: "PT5M", + * timeAggregation: "Average", + * operator: "GreaterThan", + * threshold: 75, + * metricNamespace: "microsoft.compute/virtualmachinescalesets", + * dimensions: [{ + * name: "AppName", + * operator: "Equals", + * values: ["App1"], + * }], + * }, + * scaleAction: { + * direction: "Increase", + * type: "ChangeCount", + * value: 1, + * cooldown: "PT1M", + * }, + * }, + * { + * metricTrigger: { + * metricName: "Percentage CPU", + * metricResourceId: exampleLinuxVirtualMachineScaleSet.id, + * timeGrain: "PT1M", + * statistic: "Average", + * timeWindow: "PT5M", + * timeAggregation: "Average", + * operator: "LessThan", + * threshold: 25, + * }, + * scaleAction: { + * direction: "Decrease", + * type: "ChangeCount", + * value: 1, + * cooldown: "PT1M", + * }, + * }, + * ], + * }], + * predictive: { + * scaleMode: "Enabled", + * lookAheadTime: "PT5M", + * }, + * notification: { + * email: { + * sendToSubscriptionAdministrator: true, + * sendToSubscriptionCoAdministrator: true, + * customEmails: ["admin@contoso.com"], + * }, + * }, + * }); + * ``` + * ### For Fixed Dates) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * upgradeMode: "Manual", + * sku: "Standard_F2", + * instances: 2, + * adminUsername: "myadmin", + * adminSshKeys: [{ + * username: "myadmin", + * publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + * }], + * networkInterfaces: [{ + * name: "TestNetworkProfile", + * primary: true, + * ipConfigurations: [{ + * name: "TestIPConfiguration", + * primary: true, + * subnetId: exampleSubnet.id, + * }], + * }], + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "StandardSSD_LRS", + * }, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * }); + * const exampleAutoscaleSetting = new azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", { + * enabled: true, + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * targetResourceId: exampleLinuxVirtualMachineScaleSet.id, + * profiles: [{ + * name: "forJuly", + * capacity: { + * "default": 1, + * minimum: 1, + * maximum: 10, + * }, + * rules: [ + * { + * metricTrigger: { + * metricName: "Percentage CPU", + * metricResourceId: exampleLinuxVirtualMachineScaleSet.id, + * timeGrain: "PT1M", + * statistic: "Average", + * timeWindow: "PT5M", + * timeAggregation: "Average", + * operator: "GreaterThan", + * threshold: 90, + * }, + * scaleAction: { + * direction: "Increase", + * type: "ChangeCount", + * value: 2, + * cooldown: "PT1M", + * }, + * }, + * { + * metricTrigger: { + * metricName: "Percentage CPU", + * metricResourceId: exampleLinuxVirtualMachineScaleSet.id, + * timeGrain: "PT1M", + * statistic: "Average", + * timeWindow: "PT5M", + * timeAggregation: "Average", + * operator: "LessThan", + * threshold: 10, + * }, + * scaleAction: { + * direction: "Decrease", + * type: "ChangeCount", + * value: 2, + * cooldown: "PT1M", + * }, + * }, + * ], + * fixedDate: { + * timezone: "Pacific Standard Time", + * start: "2020-07-01T00:00:00Z", + * end: "2020-07-31T23:59:59Z", + * }, + * }], + * notification: { + * email: { + * sendToSubscriptionAdministrator: true, + * sendToSubscriptionCoAdministrator: true, + * customEmails: ["admin@contoso.com"], + * }, + * }, + * }); + * ``` + * * ## Import * * AutoScale Setting can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/dataCollectionEndpoint.ts b/sdk/nodejs/monitoring/dataCollectionEndpoint.ts index 7996e77e48..203635f0cb 100644 --- a/sdk/nodejs/monitoring/dataCollectionEndpoint.ts +++ b/sdk/nodejs/monitoring/dataCollectionEndpoint.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Data Collection Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDataCollectionEndpoint = new azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * kind: "Windows", + * publicNetworkAccessEnabled: true, + * description: "monitor_data_collection_endpoint example", + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Data Collection Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/dataCollectionRule.ts b/sdk/nodejs/monitoring/dataCollectionRule.ts index b17bbc1158..3a115453ce 100644 --- a/sdk/nodejs/monitoring/dataCollectionRule.ts +++ b/sdk/nodejs/monitoring/dataCollectionRule.ts @@ -9,6 +9,178 @@ import * as utilities from "../utilities"; /** * Manages a Data Collection Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleAnalyticsSolution = new azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", { + * solutionName: "WindowsEventForwarding", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * workspaceName: exampleAnalyticsWorkspace.name, + * plan: { + * publisher: "Microsoft", + * product: "OMSGallery/WindowsEventForwarding", + * }, + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 1, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleDataCollectionEndpoint = new azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleDataCollectionRule = new azure.monitoring.DataCollectionRule("exampleDataCollectionRule", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * dataCollectionEndpointId: exampleDataCollectionEndpoint.id, + * destinations: { + * logAnalytics: [{ + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * name: "example-destination-log", + * }], + * eventHub: { + * eventHubId: exampleEventHub.id, + * name: "example-destination-eventhub", + * }, + * storageBlobs: [{ + * storageAccountId: exampleAccount.id, + * containerName: exampleContainer.name, + * name: "example-destination-storage", + * }], + * azureMonitorMetrics: { + * name: "example-destination-metrics", + * }, + * }, + * dataFlows: [ + * { + * streams: ["Microsoft-InsightsMetrics"], + * destinations: ["example-destination-metrics"], + * }, + * { + * streams: [ + * "Microsoft-InsightsMetrics", + * "Microsoft-Syslog", + * "Microsoft-Perf", + * ], + * destinations: ["example-destination-log"], + * }, + * { + * streams: ["Custom-MyTableRawData"], + * destinations: ["example-destination-log"], + * outputStream: "Microsoft-Syslog", + * transformKql: "source | project TimeGenerated = Time, Computer, Message = AdditionalContext", + * }, + * ], + * dataSources: { + * syslogs: [{ + * facilityNames: ["*"], + * logLevels: ["*"], + * name: "example-datasource-syslog", + * streams: ["Microsoft-Syslog"], + * }], + * iisLogs: [{ + * streams: ["Microsoft-W3CIISLog"], + * name: "example-datasource-iis", + * logDirectories: ["C:\\Logs\\W3SVC1"], + * }], + * logFiles: [{ + * name: "example-datasource-logfile", + * format: "text", + * streams: ["Custom-MyTableRawData"], + * filePatterns: ["C:\\JavaLogs\\*.log"], + * settings: { + * text: { + * recordStartTimestampFormat: "ISO 8601", + * }, + * }, + * }], + * performanceCounters: [{ + * streams: [ + * "Microsoft-Perf", + * "Microsoft-InsightsMetrics", + * ], + * samplingFrequencyInSeconds: 60, + * counterSpecifiers: ["Processor(*)\\% Processor Time"], + * name: "example-datasource-perfcounter", + * }], + * windowsEventLogs: [{ + * streams: ["Microsoft-WindowsEvent"], + * xPathQueries: ["*![System/Level=1]"], + * name: "example-datasource-wineventlog", + * }], + * extensions: [{ + * streams: ["Microsoft-WindowsEvent"], + * inputDataSources: ["example-datasource-wineventlog"], + * extensionName: "example-extension-name", + * extensionJson: JSON.stringify({ + * a: 1, + * b: "hello", + * }), + * name: "example-datasource-extension", + * }], + * }, + * streamDeclarations: [{ + * streamName: "Custom-MyTableRawData", + * columns: [ + * { + * name: "Time", + * type: "datetime", + * }, + * { + * name: "Computer", + * type: "string", + * }, + * { + * name: "AdditionalContext", + * type: "string", + * }, + * ], + * }], + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * description: "data collection rule example", + * tags: { + * foo: "bar", + * }, + * }, { + * dependsOn: [exampleAnalyticsSolution], + * }); + * ``` + * * ## Import * * Data Collection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/dataCollectionRuleAssociation.ts b/sdk/nodejs/monitoring/dataCollectionRuleAssociation.ts index a4ce090f0c..21d7e7b08a 100644 --- a/sdk/nodejs/monitoring/dataCollectionRuleAssociation.ts +++ b/sdk/nodejs/monitoring/dataCollectionRuleAssociation.ts @@ -7,6 +7,82 @@ import * as utilities from "../utilities"; /** * Manages a Data Collection Rule Association. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "internal", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_B1ls", + * adminUsername: "adminuser", + * networkInterfaceIds: [exampleNetworkInterface.id], + * adminPassword: "example-Password@7890", + * disablePasswordAuthentication: false, + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * }); + * const exampleDataCollectionRule = new azure.monitoring.DataCollectionRule("exampleDataCollectionRule", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * destinations: { + * azureMonitorMetrics: { + * name: "example-destination-metrics", + * }, + * }, + * dataFlows: [{ + * streams: ["Microsoft-InsightsMetrics"], + * destinations: ["example-destination-metrics"], + * }], + * }); + * const exampleDataCollectionEndpoint = new azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * // associate to a Data Collection Rule + * const example1 = new azure.monitoring.DataCollectionRuleAssociation("example1", { + * targetResourceId: exampleLinuxVirtualMachine.id, + * dataCollectionRuleId: exampleDataCollectionRule.id, + * description: "example", + * }); + * // associate to a Data Collection Endpoint + * const example2 = new azure.monitoring.DataCollectionRuleAssociation("example2", { + * targetResourceId: exampleLinuxVirtualMachine.id, + * dataCollectionEndpointId: exampleDataCollectionEndpoint.id, + * description: "example", + * }); + * ``` + * * ## Import * * Data Collection Rules Association can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/diagnosticSetting.ts b/sdk/nodejs/monitoring/diagnosticSetting.ts index 107d88d051..e81902b48b 100644 --- a/sdk/nodejs/monitoring/diagnosticSetting.ts +++ b/sdk/nodejs/monitoring/diagnosticSetting.ts @@ -9,6 +9,46 @@ import * as utilities from "../utilities"; /** * Manages a Diagnostic Setting for an existing Resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const current = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * softDeleteRetentionDays: 7, + * purgeProtectionEnabled: false, + * skuName: "standard", + * }); + * const exampleDiagnosticSetting = new azure.monitoring.DiagnosticSetting("exampleDiagnosticSetting", { + * targetResourceId: exampleKeyVault.id, + * storageAccountId: exampleAccount.id, + * enabledLogs: [{ + * category: "AuditEvent", + * retentionPolicy: { + * enabled: false, + * }, + * }], + * metrics: [{ + * category: "AllMetrics", + * retentionPolicy: { + * enabled: false, + * }, + * }], + * }); + * ``` + * * ## Import * * Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/getActionGroup.ts b/sdk/nodejs/monitoring/getActionGroup.ts index f63a7418ea..0946e8b0ae 100644 --- a/sdk/nodejs/monitoring/getActionGroup.ts +++ b/sdk/nodejs/monitoring/getActionGroup.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access the properties of an Action Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getActionGroup({ + * resourceGroupName: "example-rg", + * name: "tfex-actiongroup", + * }); + * export const actionGroupId = example.then(example => example.id); + * ``` */ export function getActionGroup(args: GetActionGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -100,6 +113,19 @@ export interface GetActionGroupResult { } /** * Use this data source to access the properties of an Action Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getActionGroup({ + * resourceGroupName: "example-rg", + * name: "tfex-actiongroup", + * }); + * export const actionGroupId = example.then(example => example.id); + * ``` */ export function getActionGroupOutput(args: GetActionGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getActionGroup(a, opts)) diff --git a/sdk/nodejs/monitoring/getDataCollectionEndpoint.ts b/sdk/nodejs/monitoring/getDataCollectionEndpoint.ts index ec4163a149..f3590f66ef 100644 --- a/sdk/nodejs/monitoring/getDataCollectionEndpoint.ts +++ b/sdk/nodejs/monitoring/getDataCollectionEndpoint.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Collection Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getDataCollectionEndpoint({ + * name: "example-mdce", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const endpointId = example.then(example => example.id); + * ``` */ export function getDataCollectionEndpoint(args: GetDataCollectionEndpointArgs, opts?: pulumi.InvokeOptions): Promise { @@ -71,6 +84,19 @@ export interface GetDataCollectionEndpointResult { } /** * Use this data source to access information about an existing Data Collection Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getDataCollectionEndpoint({ + * name: "example-mdce", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const endpointId = example.then(example => example.id); + * ``` */ export function getDataCollectionEndpointOutput(args: GetDataCollectionEndpointOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDataCollectionEndpoint(a, opts)) diff --git a/sdk/nodejs/monitoring/getDataCollectionRule.ts b/sdk/nodejs/monitoring/getDataCollectionRule.ts index 66067a5706..61c82f8fc1 100644 --- a/sdk/nodejs/monitoring/getDataCollectionRule.ts +++ b/sdk/nodejs/monitoring/getDataCollectionRule.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Data Collection Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getDataCollectionRule({ + * name: "example-rule", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const ruleId = example.then(example => example.id); + * ``` */ export function getDataCollectionRule(args: GetDataCollectionRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -89,6 +102,19 @@ export interface GetDataCollectionRuleResult { } /** * Use this data source to access information about an existing Data Collection Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getDataCollectionRule({ + * name: "example-rule", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const ruleId = example.then(example => example.id); + * ``` */ export function getDataCollectionRuleOutput(args: GetDataCollectionRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDataCollectionRule(a, opts)) diff --git a/sdk/nodejs/monitoring/getDiagnosticCategories.ts b/sdk/nodejs/monitoring/getDiagnosticCategories.ts index 6724eb6749..e8a827bfbd 100644 --- a/sdk/nodejs/monitoring/getDiagnosticCategories.ts +++ b/sdk/nodejs/monitoring/getDiagnosticCategories.ts @@ -6,6 +6,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: azurerm_key_vault.example.name, + * resourceGroupName: azurerm_key_vault.example.resource_group_name, + * }); + * const exampleDiagnosticCategories = exampleKeyVault.then(exampleKeyVault => azure.monitoring.getDiagnosticCategories({ + * resourceId: exampleKeyVault.id, + * })); + * ``` */ export function getDiagnosticCategories(args: GetDiagnosticCategoriesArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +70,21 @@ export interface GetDiagnosticCategoriesResult { } /** * Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleKeyVault = azure.keyvault.getKeyVault({ + * name: azurerm_key_vault.example.name, + * resourceGroupName: azurerm_key_vault.example.resource_group_name, + * }); + * const exampleDiagnosticCategories = exampleKeyVault.then(exampleKeyVault => azure.monitoring.getDiagnosticCategories({ + * resourceId: exampleKeyVault.id, + * })); + * ``` */ export function getDiagnosticCategoriesOutput(args: GetDiagnosticCategoriesOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDiagnosticCategories(a, opts)) diff --git a/sdk/nodejs/monitoring/getLogProfile.ts b/sdk/nodejs/monitoring/getLogProfile.ts index 209825d9cc..67a6233c73 100644 --- a/sdk/nodejs/monitoring/getLogProfile.ts +++ b/sdk/nodejs/monitoring/getLogProfile.ts @@ -10,6 +10,18 @@ import * as utilities from "../utilities"; * Use this data source to access the properties of a Log Profile. * * !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getLogProfile({ + * name: "test-logprofile", + * }); + * export const logProfileStorageAccountId = example.then(example => example.storageAccountId); + * ``` */ export function getLogProfile(args: GetLogProfileArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +75,18 @@ export interface GetLogProfileResult { * Use this data source to access the properties of a Log Profile. * * !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getLogProfile({ + * name: "test-logprofile", + * }); + * export const logProfileStorageAccountId = example.then(example => example.storageAccountId); + * ``` */ export function getLogProfileOutput(args: GetLogProfileOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getLogProfile(a, opts)) diff --git a/sdk/nodejs/monitoring/getScheduledQueryRulesAlert.ts b/sdk/nodejs/monitoring/getScheduledQueryRulesAlert.ts index 6c96b5e30b..e2463efe6e 100644 --- a/sdk/nodejs/monitoring/getScheduledQueryRulesAlert.ts +++ b/sdk/nodejs/monitoring/getScheduledQueryRulesAlert.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access the properties of an AlertingAction scheduled query rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getScheduledQueryRulesAlert({ + * resourceGroupName: "example-rg", + * name: "tfex-queryrule", + * }); + * export const queryRuleId = example.then(example => example.id); + * ``` */ export function getScheduledQueryRulesAlert(args: GetScheduledQueryRulesAlertArgs, opts?: pulumi.InvokeOptions): Promise { @@ -98,6 +111,19 @@ export interface GetScheduledQueryRulesAlertResult { } /** * Use this data source to access the properties of an AlertingAction scheduled query rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getScheduledQueryRulesAlert({ + * resourceGroupName: "example-rg", + * name: "tfex-queryrule", + * }); + * export const queryRuleId = example.then(example => example.id); + * ``` */ export function getScheduledQueryRulesAlertOutput(args: GetScheduledQueryRulesAlertOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getScheduledQueryRulesAlert(a, opts)) diff --git a/sdk/nodejs/monitoring/getScheduledQueryRulesLog.ts b/sdk/nodejs/monitoring/getScheduledQueryRulesLog.ts index 775d15e02c..f55678ffb6 100644 --- a/sdk/nodejs/monitoring/getScheduledQueryRulesLog.ts +++ b/sdk/nodejs/monitoring/getScheduledQueryRulesLog.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access the properties of a LogToMetricAction scheduled query rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getScheduledQueryRulesLog({ + * resourceGroupName: "example-rg", + * name: "tfex-queryrule", + * }); + * export const queryRuleId = example.then(example => example.id); + * ``` */ export function getScheduledQueryRulesLog(args: GetScheduledQueryRulesLogArgs, opts?: pulumi.InvokeOptions): Promise { @@ -73,6 +86,19 @@ export interface GetScheduledQueryRulesLogResult { } /** * Use this data source to access the properties of a LogToMetricAction scheduled query rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.monitoring.getScheduledQueryRulesLog({ + * resourceGroupName: "example-rg", + * name: "tfex-queryrule", + * }); + * export const queryRuleId = example.then(example => example.id); + * ``` */ export function getScheduledQueryRulesLogOutput(args: GetScheduledQueryRulesLogOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getScheduledQueryRulesLog(a, opts)) diff --git a/sdk/nodejs/monitoring/logProfile.ts b/sdk/nodejs/monitoring/logProfile.ts index 0b15773afc..4360317721 100644 --- a/sdk/nodejs/monitoring/logProfile.ts +++ b/sdk/nodejs/monitoring/logProfile.ts @@ -13,6 +13,44 @@ import * as utilities from "../utilities"; * * !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 2, + * }); + * const exampleLogProfile = new azure.monitoring.LogProfile("exampleLogProfile", { + * categories: [ + * "Action", + * "Delete", + * "Write", + * ], + * locations: [ + * "westus", + * "global", + * ], + * servicebusRuleId: pulumi.interpolate`${exampleEventHubNamespace.id}/authorizationrules/RootManageSharedAccessKey`, + * storageAccountId: exampleAccount.id, + * retentionPolicy: { + * enabled: true, + * days: 7, + * }, + * }); + * ``` + * * ## Import * * A Log Profile can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/logzMonitor.ts b/sdk/nodejs/monitoring/logzMonitor.ts index 127812643a..d6e7fc0aa0 100644 --- a/sdk/nodejs/monitoring/logzMonitor.ts +++ b/sdk/nodejs/monitoring/logzMonitor.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a logz Monitor. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLogzMonitor = new azure.monitoring.LogzMonitor("exampleLogzMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * plan: { + * billingCycle: "MONTHLY", + * effectiveDate: "2022-06-06T00:00:00Z", + * usageType: "COMMITTED", + * }, + * user: { + * email: "user@example.com", + * firstName: "Example", + * lastName: "User", + * phoneNumber: "+12313803556", + * }, + * }); + * ``` + * * ## Import * * logz Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/logzSubAccount.ts b/sdk/nodejs/monitoring/logzSubAccount.ts index a7e44bf95c..cc3c32af6c 100644 --- a/sdk/nodejs/monitoring/logzSubAccount.ts +++ b/sdk/nodejs/monitoring/logzSubAccount.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a logz Sub Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLogzMonitor = new azure.monitoring.LogzMonitor("exampleLogzMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * plan: { + * billingCycle: "MONTHLY", + * effectiveDate: "2022-06-06T00:00:00Z", + * usageType: "COMMITTED", + * }, + * user: { + * email: "user@example.com", + * firstName: "Example", + * lastName: "User", + * phoneNumber: "+12313803556", + * }, + * }); + * const exampleLogzSubAccount = new azure.monitoring.LogzSubAccount("exampleLogzSubAccount", { + * logzMonitorId: exampleLogzMonitor.id, + * user: { + * email: exampleLogzMonitor.user.apply(user => user.email), + * firstName: exampleLogzMonitor.user.apply(user => user.firstName), + * lastName: exampleLogzMonitor.user.apply(user => user.lastName), + * phoneNumber: exampleLogzMonitor.user.apply(user => user.phoneNumber), + * }, + * }); + * ``` + * * ## Import * * logz SubAccounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/logzSubAccountTagRule.ts b/sdk/nodejs/monitoring/logzSubAccountTagRule.ts index 44de78fba8..56d099922f 100644 --- a/sdk/nodejs/monitoring/logzSubAccountTagRule.ts +++ b/sdk/nodejs/monitoring/logzSubAccountTagRule.ts @@ -9,6 +9,57 @@ import * as utilities from "../utilities"; /** * Manages a Logz Sub Account Tag Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLogzMonitor = new azure.monitoring.LogzMonitor("exampleLogzMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * plan: { + * billingCycle: "MONTHLY", + * effectiveDate: "2022-06-06T00:00:00Z", + * usageType: "COMMITTED", + * }, + * user: { + * email: "user@example.com", + * firstName: "Example", + * lastName: "User", + * phoneNumber: "+12313803556", + * }, + * }); + * const exampleLogzSubAccount = new azure.monitoring.LogzSubAccount("exampleLogzSubAccount", { + * logzMonitorId: exampleLogzMonitor.id, + * user: { + * email: exampleLogzMonitor.user.apply(user => user.email), + * firstName: exampleLogzMonitor.user.apply(user => user.firstName), + * lastName: exampleLogzMonitor.user.apply(user => user.lastName), + * phoneNumber: exampleLogzMonitor.user.apply(user => user.phoneNumber), + * }, + * }); + * const exampleLogzSubAccountTagRule = new azure.monitoring.LogzSubAccountTagRule("exampleLogzSubAccountTagRule", { + * logzSubAccountId: exampleLogzSubAccount.id, + * sendAadLogs: true, + * sendActivityLogs: true, + * sendSubscriptionLogs: true, + * tagFilters: [ + * { + * name: "name1", + * action: "Include", + * value: "value1", + * }, + * { + * name: "name2", + * action: "Exclude", + * value: "value2", + * }, + * ], + * }); + * ``` + * * ## Import * * Logz Sub Account Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/logzTagRule.ts b/sdk/nodejs/monitoring/logzTagRule.ts index cabadc09dc..e1a7cb43f4 100644 --- a/sdk/nodejs/monitoring/logzTagRule.ts +++ b/sdk/nodejs/monitoring/logzTagRule.ts @@ -9,6 +9,48 @@ import * as utilities from "../utilities"; /** * Manages a logz Tag Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLogzMonitor = new azure.monitoring.LogzMonitor("exampleLogzMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * plan: { + * billingCycle: "MONTHLY", + * effectiveDate: "2022-06-06T00:00:00Z", + * usageType: "COMMITTED", + * }, + * user: { + * email: "user@example.com", + * firstName: "Example", + * lastName: "User", + * phoneNumber: "+12313803556", + * }, + * }); + * const exampleLogzTagRule = new azure.monitoring.LogzTagRule("exampleLogzTagRule", { + * logzMonitorId: exampleLogzMonitor.id, + * tagFilters: [ + * { + * name: "name1", + * action: "Include", + * value: "value1", + * }, + * { + * name: "name2", + * action: "Exclude", + * value: "value2", + * }, + * ], + * sendAadLogs: true, + * sendActivityLogs: true, + * sendSubscriptionLogs: true, + * }); + * ``` + * * ## Import * * logz Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/metricAlert.ts b/sdk/nodejs/monitoring/metricAlert.ts index 68c56d80a2..4916765a93 100644 --- a/sdk/nodejs/monitoring/metricAlert.ts +++ b/sdk/nodejs/monitoring/metricAlert.ts @@ -9,6 +9,49 @@ import * as utilities from "../utilities"; /** * Manages a Metric Alert within Azure Monitor. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const toMonitor = new azure.storage.Account("toMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const main = new azure.monitoring.ActionGroup("main", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "exampleact", + * webhookReceivers: [{ + * name: "callmyapi", + * serviceUri: "http://example.com/alert", + * }], + * }); + * const exampleMetricAlert = new azure.monitoring.MetricAlert("exampleMetricAlert", { + * resourceGroupName: exampleResourceGroup.name, + * scopes: [toMonitor.id], + * description: "Action will be triggered when Transactions count is greater than 50.", + * criterias: [{ + * metricNamespace: "Microsoft.Storage/storageAccounts", + * metricName: "Transactions", + * aggregation: "Total", + * operator: "GreaterThan", + * threshold: 50, + * dimensions: [{ + * name: "ApiName", + * operator: "Include", + * values: ["*"], + * }], + * }], + * actions: [{ + * actionGroupId: main.id, + * }], + * }); + * ``` + * * ## Import * * Metric Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/privateLinkScope.ts b/sdk/nodejs/monitoring/privateLinkScope.ts index 372e0d2e66..b1bf4ff0a3 100644 --- a/sdk/nodejs/monitoring/privateLinkScope.ts +++ b/sdk/nodejs/monitoring/privateLinkScope.ts @@ -7,6 +7,16 @@ import * as utilities from "../utilities"; /** * Manages an Azure Monitor Private Link Scope. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePrivateLinkScope = new azure.monitoring.PrivateLinkScope("examplePrivateLinkScope", {resourceGroupName: exampleResourceGroup.name}); + * ``` + * * ## Import * * Azure Monitor Private Link Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/privateLinkScopedService.ts b/sdk/nodejs/monitoring/privateLinkScopedService.ts index 5914e9d94b..85726d2fbb 100644 --- a/sdk/nodejs/monitoring/privateLinkScopedService.ts +++ b/sdk/nodejs/monitoring/privateLinkScopedService.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages an Azure Monitor Private Link Scoped Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const examplePrivateLinkScope = new azure.monitoring.PrivateLinkScope("examplePrivateLinkScope", {resourceGroupName: exampleResourceGroup.name}); + * const examplePrivateLinkScopedService = new azure.monitoring.PrivateLinkScopedService("examplePrivateLinkScopedService", { + * resourceGroupName: exampleResourceGroup.name, + * scopeName: examplePrivateLinkScope.name, + * linkedResourceId: exampleInsights.id, + * }); + * ``` + * * ## Import * * Azure Monitor Private Link Scoped Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/scheduledQueryRulesLog.ts b/sdk/nodejs/monitoring/scheduledQueryRulesLog.ts index 744b0ce4d6..5a317a6da2 100644 --- a/sdk/nodejs/monitoring/scheduledQueryRulesLog.ts +++ b/sdk/nodejs/monitoring/scheduledQueryRulesLog.ts @@ -9,6 +9,66 @@ import * as utilities from "../utilities"; /** * Manages a LogToMetricAction Scheduled Query Rules resource within Azure Monitor. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "exampleact", + * webhookReceivers: [{ + * name: "callmyapi", + * serviceUri: "http://example.com/alert", + * }], + * }); + * // Example: Creates alert using the new Scheduled Query Rules metric + * const exampleMetricAlert = new azure.monitoring.MetricAlert("exampleMetricAlert", { + * resourceGroupName: exampleResourceGroup.name, + * scopes: [exampleAnalyticsWorkspace.id], + * description: "Action will be triggered when Average_% Idle Time metric is less than 10.", + * frequency: "PT1M", + * windowSize: "PT5M", + * criterias: [{ + * metricNamespace: "Microsoft.OperationalInsights/workspaces", + * metricName: "UsedCapacity", + * aggregation: "Average", + * operator: "LessThan", + * threshold: 10, + * }], + * actions: [{ + * actionGroupId: exampleActionGroup.id, + * }], + * }); + * // Example: LogToMetric Action for the named Computer + * const exampleScheduledQueryRulesLog = new azure.monitoring.ScheduledQueryRulesLog("exampleScheduledQueryRulesLog", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * criteria: { + * metricName: "Average_% Idle Time", + * dimensions: [{ + * name: "Computer", + * operator: "Include", + * values: ["targetVM"], + * }], + * }, + * dataSourceId: exampleAnalyticsWorkspace.id, + * description: "Scheduled query rule LogToMetric example", + * enabled: true, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Scheduled Query Rule Log can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/smartDetectorAlertRule.ts b/sdk/nodejs/monitoring/smartDetectorAlertRule.ts index 8fd7283b02..faad988685 100644 --- a/sdk/nodejs/monitoring/smartDetectorAlertRule.ts +++ b/sdk/nodejs/monitoring/smartDetectorAlertRule.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages an Monitor Smart Detector Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleInsights = new azure.appinsights.Insights("exampleInsights", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * applicationType: "web", + * }); + * const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", { + * resourceGroupName: exampleResourceGroup.name, + * shortName: "example", + * }); + * const exampleSmartDetectorAlertRule = new azure.monitoring.SmartDetectorAlertRule("exampleSmartDetectorAlertRule", { + * resourceGroupName: exampleResourceGroup.name, + * severity: "Sev0", + * scopeResourceIds: [exampleInsights.id], + * frequency: "PT1M", + * detectorType: "FailureAnomaliesDetector", + * actionGroup: { + * ids: [exampleActionGroup.id], + * }, + * }); + * ``` + * * ## Import * * Monitor Smart Detector Alert Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/monitoring/workspace.ts b/sdk/nodejs/monitoring/workspace.ts index 478356c97c..53ef22e25e 100644 --- a/sdk/nodejs/monitoring/workspace.ts +++ b/sdk/nodejs/monitoring/workspace.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an Azure Monitor Workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleWorkspace = new azure.monitoring.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Azure Monitor Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/msi/userAssignedIdentity.ts b/sdk/nodejs/msi/userAssignedIdentity.ts index 251b3c4729..07b330ecc1 100644 --- a/sdk/nodejs/msi/userAssignedIdentity.ts +++ b/sdk/nodejs/msi/userAssignedIdentity.ts @@ -9,6 +9,19 @@ import * as utilities from "../utilities"; * * Manages a User Assigned Identity. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/database.ts b/sdk/nodejs/mssql/database.ts index c3fa47134f..2680c1e1a1 100644 --- a/sdk/nodejs/mssql/database.ts +++ b/sdk/nodejs/mssql/database.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; /** * Manages a MS SQL Database. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const test = new azure.mssql.Database("test", { + * serverId: exampleServer.id, + * collation: "SQL_Latin1_General_CP1_CI_AS", + * licenseType: "LicenseIncluded", + * maxSizeGb: 4, + * readScale: true, + * skuName: "S0", + * zoneRedundant: true, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/databaseExtendedAuditingPolicy.ts b/sdk/nodejs/mssql/databaseExtendedAuditingPolicy.ts index acfe290242..9e14d391b4 100644 --- a/sdk/nodejs/mssql/databaseExtendedAuditingPolicy.ts +++ b/sdk/nodejs/mssql/databaseExtendedAuditingPolicy.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a MS SQL Database Extended Auditing Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "AdminPassword123!", + * }); + * const exampleDatabase = new azure.mssql.Database("exampleDatabase", {serverId: exampleServer.id}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDatabaseExtendedAuditingPolicy = new azure.mssql.DatabaseExtendedAuditingPolicy("exampleDatabaseExtendedAuditingPolicy", { + * databaseId: exampleDatabase.id, + * storageEndpoint: exampleAccount.primaryBlobEndpoint, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * storageAccountAccessKeyIsSecondary: false, + * retentionInDays: 6, + * }); + * ``` + * * ## Import * * MS SQL Database Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/databaseVulnerabilityAssessmentRuleBaseline.ts b/sdk/nodejs/mssql/databaseVulnerabilityAssessmentRuleBaseline.ts index 5be11b774f..b37eca157a 100644 --- a/sdk/nodejs/mssql/databaseVulnerabilityAssessmentRuleBaseline.ts +++ b/sdk/nodejs/mssql/databaseVulnerabilityAssessmentRuleBaseline.ts @@ -11,6 +11,70 @@ import * as utilities from "../utilities"; * * > **NOTE** Database Vulnerability Assessment is currently only available for MS SQL databases. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleServerSecurityAlertPolicy = new azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleSqlServer.name, + * state: "Enabled", + * }); + * const exampleDatabase = new azure.sql.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleSqlServer.name, + * location: exampleResourceGroup.location, + * edition: "Standard", + * }); + * const exampleServerVulnerabilityAssessment = new azure.mssql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", { + * serverSecurityAlertPolicyId: exampleServerSecurityAlertPolicy.id, + * storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * const exampleDatabaseVulnerabilityAssessmentRuleBaseline = new azure.mssql.DatabaseVulnerabilityAssessmentRuleBaseline("exampleDatabaseVulnerabilityAssessmentRuleBaseline", { + * serverVulnerabilityAssessmentId: exampleServerVulnerabilityAssessment.id, + * databaseName: exampleDatabase.name, + * ruleId: "VA2065", + * baselineName: "master", + * baselineResults: [ + * { + * results: [ + * "allowedip1", + * "123.123.123.123", + * "123.123.123.123", + * ], + * }, + * { + * results: [ + * "allowedip2", + * "255.255.255.255", + * "255.255.255.255", + * ], + * }, + * ], + * }); + * ``` + * * ## Import * * Database Vulnerability Assessment Rule Baseline can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/elasticPool.ts b/sdk/nodejs/mssql/elasticPool.ts index a083762a69..30b0f43e06 100644 --- a/sdk/nodejs/mssql/elasticPool.ts +++ b/sdk/nodejs/mssql/elasticPool.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Allows you to manage an Azure SQL Elastic Pool via the `v3.0` API which allows for `vCore` and `DTU` based configurations. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleElasticPool = new azure.mssql.ElasticPool("exampleElasticPool", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serverName: exampleServer.name, + * licenseType: "LicenseIncluded", + * maxSizeGb: 756, + * sku: { + * name: "BasicPool", + * tier: "Basic", + * family: "Gen4", + * capacity: 4, + * }, + * perDatabaseSettings: { + * minCapacity: 0.25, + * maxCapacity: 4, + * }, + * }); + * ``` + * * ## Import * * SQL Elastic Pool can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/failoverGroup.ts b/sdk/nodejs/mssql/failoverGroup.ts index af78afd858..3e0de13090 100644 --- a/sdk/nodejs/mssql/failoverGroup.ts +++ b/sdk/nodejs/mssql/failoverGroup.ts @@ -9,6 +9,50 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft Azure SQL Failover Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const primary = new azure.mssql.Server("primary", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "thisIsKat11", + * }); + * const secondary = new azure.mssql.Server("secondary", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "thisIsKat12", + * }); + * const exampleDatabase = new azure.mssql.Database("exampleDatabase", { + * serverId: primary.id, + * skuName: "S1", + * collation: "SQL_Latin1_General_CP1_CI_AS", + * maxSizeGb: 200, + * }); + * const exampleFailoverGroup = new azure.mssql.FailoverGroup("exampleFailoverGroup", { + * serverId: primary.id, + * databases: [exampleDatabase.id], + * partnerServers: [{ + * id: secondary.id, + * }], + * readWriteEndpointFailoverPolicy: { + * mode: "Automatic", + * graceMinutes: 80, + * }, + * tags: { + * environment: "prod", + * database: "example", + * }, + * }); + * ``` + * * ## Import * * Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/firewallRule.ts b/sdk/nodejs/mssql/firewallRule.ts index 34287914c7..65a1c42b6d 100644 --- a/sdk/nodejs/mssql/firewallRule.ts +++ b/sdk/nodejs/mssql/firewallRule.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Allows you to manage an Azure SQL Firewall Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleFirewallRule = new azure.mssql.FirewallRule("exampleFirewallRule", { + * serverId: exampleServer.id, + * startIpAddress: "10.0.17.62", + * endIpAddress: "10.0.17.62", + * }); + * ``` + * * ## Import * * SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/getDatabase.ts b/sdk/nodejs/mssql/getDatabase.ts index 802ac114b5..8db8ad3cbd 100644 --- a/sdk/nodejs/mssql/getDatabase.ts +++ b/sdk/nodejs/mssql/getDatabase.ts @@ -6,6 +6,27 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing SQL database. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleDatabase = azure.mssql.getDatabaseOutput({ + * name: "example-mssql-db", + * serverId: exampleServer.id, + * }); + * export const databaseId = exampleDatabase.apply(exampleDatabase => exampleDatabase.id); + * ``` */ export function getDatabase(args: GetDatabaseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -83,6 +104,27 @@ export interface GetDatabaseResult { } /** * Use this data source to access information about an existing SQL database. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleDatabase = azure.mssql.getDatabaseOutput({ + * name: "example-mssql-db", + * serverId: exampleServer.id, + * }); + * export const databaseId = exampleDatabase.apply(exampleDatabase => exampleDatabase.id); + * ``` */ export function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDatabase(a, opts)) diff --git a/sdk/nodejs/mssql/getElasticPool.ts b/sdk/nodejs/mssql/getElasticPool.ts index 39cfa3aa29..2bc5674b7d 100644 --- a/sdk/nodejs/mssql/getElasticPool.ts +++ b/sdk/nodejs/mssql/getElasticPool.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing SQL elastic pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mssql.getElasticPool({ + * name: "mssqlelasticpoolname", + * resourceGroupName: "example-resources", + * serverName: "example-sql-server", + * }); + * export const elasticpoolId = example.then(example => example.id); + * ``` */ export function getElasticPool(args: GetElasticPoolArgs, opts?: pulumi.InvokeOptions): Promise { @@ -90,6 +104,20 @@ export interface GetElasticPoolResult { } /** * Use this data source to access information about an existing SQL elastic pool. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mssql.getElasticPool({ + * name: "mssqlelasticpoolname", + * resourceGroupName: "example-resources", + * serverName: "example-sql-server", + * }); + * export const elasticpoolId = example.then(example => example.id); + * ``` */ export function getElasticPoolOutput(args: GetElasticPoolOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getElasticPool(a, opts)) diff --git a/sdk/nodejs/mssql/getManagedInstance.ts b/sdk/nodejs/mssql/getManagedInstance.ts index caf9341aa6..2d80d39da1 100644 --- a/sdk/nodejs/mssql/getManagedInstance.ts +++ b/sdk/nodejs/mssql/getManagedInstance.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Microsoft SQL Azure Managed Instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mssql.getManagedInstance({ + * name: "managedsqlinstance", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getManagedInstance(args: GetManagedInstanceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -114,6 +126,18 @@ export interface GetManagedInstanceResult { } /** * Use this data source to access information about an existing Microsoft SQL Azure Managed Instance. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mssql.getManagedInstance({ + * name: "managedsqlinstance", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * ``` */ export function getManagedInstanceOutput(args: GetManagedInstanceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getManagedInstance(a, opts)) diff --git a/sdk/nodejs/mssql/getServer.ts b/sdk/nodejs/mssql/getServer.ts index 601eb3a963..a5723e54ca 100644 --- a/sdk/nodejs/mssql/getServer.ts +++ b/sdk/nodejs/mssql/getServer.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Microsoft SQL Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mssql.getServer({ + * name: "existingMsSqlServer", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getServer(args: GetServerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -73,6 +86,19 @@ export interface GetServerResult { } /** * Use this data source to access information about an existing Microsoft SQL Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mssql.getServer({ + * name: "existingMsSqlServer", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getServerOutput(args: GetServerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getServer(a, opts)) diff --git a/sdk/nodejs/mssql/jobAgent.ts b/sdk/nodejs/mssql/jobAgent.ts index 282ab65872..4b904a0091 100644 --- a/sdk/nodejs/mssql/jobAgent.ts +++ b/sdk/nodejs/mssql/jobAgent.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages an Elastic Job Agent. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "northeurope"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleDatabase = new azure.mssql.Database("exampleDatabase", { + * serverId: exampleServer.id, + * collation: "SQL_Latin1_General_CP1_CI_AS", + * skuName: "S1", + * }); + * const exampleJobAgent = new azure.mssql.JobAgent("exampleJobAgent", { + * location: exampleResourceGroup.location, + * databaseId: exampleDatabase.id, + * }); + * ``` + * * ## Import * * Elastic Job Agents can be imported using the `id`, e.g. diff --git a/sdk/nodejs/mssql/jobCredential.ts b/sdk/nodejs/mssql/jobCredential.ts index 133e4c6eba..38487c075a 100644 --- a/sdk/nodejs/mssql/jobCredential.ts +++ b/sdk/nodejs/mssql/jobCredential.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages an Elastic Job Credential. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "northeurope"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleDatabase = new azure.mssql.Database("exampleDatabase", { + * serverId: exampleServer.id, + * collation: "SQL_Latin1_General_CP1_CI_AS", + * skuName: "S1", + * }); + * const exampleJobAgent = new azure.mssql.JobAgent("exampleJobAgent", { + * location: exampleResourceGroup.location, + * databaseId: exampleDatabase.id, + * }); + * const exampleJobCredential = new azure.mssql.JobCredential("exampleJobCredential", { + * jobAgentId: exampleJobAgent.id, + * username: "my-username", + * password: "MyP4ssw0rd!!!", + * }); + * ``` + * * ## Import * * Elastic Job Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/managedDatabase.ts b/sdk/nodejs/mssql/managedDatabase.ts index 6f9243203c..c728c16e4d 100644 --- a/sdk/nodejs/mssql/managedDatabase.ts +++ b/sdk/nodejs/mssql/managedDatabase.ts @@ -9,6 +9,37 @@ import * as utilities from "../utilities"; /** * Manages an Azure SQL Azure Managed Database for a SQL Managed Instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * licenseType: "BasePrice", + * skuName: "GP_Gen5", + * storageSizeInGb: 32, + * subnetId: exampleSubnet.id, + * vcores: 4, + * administratorLogin: "msadministrator", + * administratorLoginPassword: "thisIsDog11", + * }); + * const exampleManagedDatabase = new azure.mssql.ManagedDatabase("exampleManagedDatabase", {managedInstanceId: exampleManagedInstance.id}); + * ``` + * * ## Import * * SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/managedInstance.ts b/sdk/nodejs/mssql/managedInstance.ts index 51a64194f6..4126fefa61 100644 --- a/sdk/nodejs/mssql/managedInstance.ts +++ b/sdk/nodejs/mssql/managedInstance.ts @@ -11,6 +11,177 @@ import * as utilities from "../utilities"; * * > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const allowManagementInbound = new azure.network.NetworkSecurityRule("allowManagementInbound", { + * priority: 106, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRanges: [ + * "9000", + * "9003", + * "1438", + * "1440", + * "1452", + * ], + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowMisubnetInbound = new azure.network.NetworkSecurityRule("allowMisubnetInbound", { + * priority: 200, + * direction: "Inbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "10.0.0.0/24", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowHealthProbeInbound = new azure.network.NetworkSecurityRule("allowHealthProbeInbound", { + * priority: 300, + * direction: "Inbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "AzureLoadBalancer", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowTdsInbound = new azure.network.NetworkSecurityRule("allowTdsInbound", { + * priority: 1000, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "1433", + * sourceAddressPrefix: "VirtualNetwork", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const denyAllInbound = new azure.network.NetworkSecurityRule("denyAllInbound", { + * priority: 4096, + * direction: "Inbound", + * access: "Deny", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowManagementOutbound = new azure.network.NetworkSecurityRule("allowManagementOutbound", { + * priority: 102, + * direction: "Outbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRanges: [ + * "80", + * "443", + * "12000", + * ], + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowMisubnetOutbound = new azure.network.NetworkSecurityRule("allowMisubnetOutbound", { + * priority: 200, + * direction: "Outbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "10.0.0.0/24", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const denyAllOutbound = new azure.network.NetworkSecurityRule("denyAllOutbound", { + * priority: 4096, + * direction: "Outbound", + * access: "Deny", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "managedinstancedelegation", + * serviceDelegation: { + * name: "Microsoft.Sql/managedInstances", + * actions: [ + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + * "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + * ], + * }, + * }], + * }); + * const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", { + * subnetId: exampleSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * disableBgpRoutePropagation: false, + * }, { + * dependsOn: [exampleSubnet], + * }); + * const exampleSubnetRouteTableAssociation = new azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", { + * subnetId: exampleSubnet.id, + * routeTableId: exampleRouteTable.id, + * }); + * const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * licenseType: "BasePrice", + * skuName: "GP_Gen5", + * storageSizeInGb: 32, + * subnetId: exampleSubnet.id, + * vcores: 4, + * administratorLogin: "mradministrator", + * administratorLoginPassword: "thisIsDog11", + * }, { + * dependsOn: [ + * exampleSubnetNetworkSecurityGroupAssociation, + * exampleSubnetRouteTableAssociation, + * ], + * }); + * ``` + * * ## Import * * Microsoft SQL Managed Instances can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/managedInstanceActiveDirectoryAdministrator.ts b/sdk/nodejs/mssql/managedInstanceActiveDirectoryAdministrator.ts index b03973dfb9..3a2af81e6b 100644 --- a/sdk/nodejs/mssql/managedInstanceActiveDirectoryAdministrator.ts +++ b/sdk/nodejs/mssql/managedInstanceActiveDirectoryAdministrator.ts @@ -7,6 +7,58 @@ import * as utilities from "../utilities"; /** * Allows you to set a user, group or service principal as the AAD Administrator for an Azure SQL Managed Instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getClientConfig({}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * licenseType: "BasePrice", + * skuName: "GP_Gen5", + * storageSizeInGb: 32, + * subnetId: exampleSubnet.id, + * vcores: 4, + * administratorLogin: "msadministrator", + * administratorLoginPassword: "thisIsDog11", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const reader = new azuread.DirectoryRole("reader", {displayName: "Directory Readers"}); + * const exampleDirectoryRoleMember = new azuread.DirectoryRoleMember("exampleDirectoryRoleMember", { + * roleObjectId: reader.objectId, + * memberObjectId: exampleManagedInstance.identity.apply(identity => identity?.principalId), + * }); + * const admin = new azuread.User("admin", { + * userPrincipalName: "ms.admin@hashicorp.com", + * displayName: "Ms Admin", + * mailNickname: "ms.admin", + * password: "SecretP@sswd99!", + * }); + * const exampleManagedInstanceActiveDirectoryAdministrator = new azure.mssql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", { + * managedInstanceId: exampleManagedInstance.id, + * loginUsername: "msadmin", + * objectId: admin.objectId, + * tenantId: current.then(current => current.tenantId), + * }); + * ``` + * * ## Import * * An Azure SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/managedInstanceSecurityAlertPolicy.ts b/sdk/nodejs/mssql/managedInstanceSecurityAlertPolicy.ts index ddca792ec6..c6fdc698ac 100644 --- a/sdk/nodejs/mssql/managedInstanceSecurityAlertPolicy.ts +++ b/sdk/nodejs/mssql/managedInstanceSecurityAlertPolicy.ts @@ -7,6 +7,189 @@ import * as utilities from "../utilities"; /** * Manages a Security Alert Policy for an MS SQL Managed Instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const allowManagementInbound = new azure.network.NetworkSecurityRule("allowManagementInbound", { + * priority: 106, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRanges: [ + * "9000", + * "9003", + * "1438", + * "1440", + * "1452", + * ], + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowMisubnetInbound = new azure.network.NetworkSecurityRule("allowMisubnetInbound", { + * priority: 200, + * direction: "Inbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "10.0.0.0/24", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowHealthProbeInbound = new azure.network.NetworkSecurityRule("allowHealthProbeInbound", { + * priority: 300, + * direction: "Inbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "AzureLoadBalancer", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowTdsInbound = new azure.network.NetworkSecurityRule("allowTdsInbound", { + * priority: 1000, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "1433", + * sourceAddressPrefix: "VirtualNetwork", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const denyAllInbound = new azure.network.NetworkSecurityRule("denyAllInbound", { + * priority: 4096, + * direction: "Inbound", + * access: "Deny", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowManagementOutbound = new azure.network.NetworkSecurityRule("allowManagementOutbound", { + * priority: 102, + * direction: "Outbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRanges: [ + * "80", + * "443", + * "12000", + * ], + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowMisubnetOutbound = new azure.network.NetworkSecurityRule("allowMisubnetOutbound", { + * priority: 200, + * direction: "Outbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "10.0.0.0/24", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const denyAllOutbound = new azure.network.NetworkSecurityRule("denyAllOutbound", { + * priority: 4096, + * direction: "Outbound", + * access: "Deny", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "managedinstancedelegation", + * serviceDelegation: { + * name: "Microsoft.Sql/managedInstances", + * actions: [ + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + * "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + * ], + * }, + * }], + * }); + * const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", { + * subnetId: exampleSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * disableBgpRoutePropagation: false, + * }, { + * dependsOn: [exampleSubnet], + * }); + * const exampleSubnetRouteTableAssociation = new azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", { + * subnetId: exampleSubnet.id, + * routeTableId: exampleRouteTable.id, + * }); + * const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * licenseType: "BasePrice", + * skuName: "GP_Gen5", + * storageSizeInGb: 32, + * subnetId: exampleSubnet.id, + * vcores: 4, + * administratorLogin: "mradministrator", + * administratorLoginPassword: "thisIsDog11", + * }, { + * dependsOn: [ + * exampleSubnetNetworkSecurityGroupAssociation, + * exampleSubnetRouteTableAssociation, + * ], + * }); + * const exampleManagedInstanceSecurityAlertPolicy = new azure.mssql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * managedInstanceName: exampleManagedInstance.name, + * enabled: true, + * storageEndpoint: azurerm_storage_account.example.primary_blob_endpoint, + * storageAccountAccessKey: azurerm_storage_account.example.primary_access_key, + * disabledAlerts: [ + * "Sql_Injection", + * "Data_Exfiltration", + * ], + * retentionDays: 20, + * }); + * ``` + * * ## Import * * MS SQL Managed Instance Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/managedInstanceTransparentDataEncryption.ts b/sdk/nodejs/mssql/managedInstanceTransparentDataEncryption.ts index ecf2c4c0d8..f17e6e85ba 100644 --- a/sdk/nodejs/mssql/managedInstanceTransparentDataEncryption.ts +++ b/sdk/nodejs/mssql/managedInstanceTransparentDataEncryption.ts @@ -12,6 +12,144 @@ import * as utilities from "../utilities"; * > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. * * ## Example Usage + * ### With Service Managed Key + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "EastUs"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * location: azurerm_resource_group.test.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "managedinstancedelegation", + * serviceDelegation: { + * name: "Microsoft.Sql/managedInstances", + * actions: [ + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + * "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + * ], + * }, + * }], + * }); + * const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * licenseType: "BasePrice", + * skuName: "GP_Gen5", + * storageSizeInGb: 32, + * subnetId: exampleSubnet.id, + * vcores: 4, + * administratorLogin: "missadministrator", + * administratorLoginPassword: "NCC-1701-D", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleManagedInstanceTransparentDataEncryption = new azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", {managedInstanceId: exampleManagedInstance.id}); + * ``` + * ### With Customer Managed Key + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "EastUs"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * location: azurerm_resource_group.test.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "managedinstancedelegation", + * serviceDelegation: { + * name: "Microsoft.Sql/managedInstances", + * actions: [ + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + * "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + * ], + * }, + * }], + * }); + * const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * licenseType: "BasePrice", + * skuName: "GP_Gen5", + * storageSizeInGb: 32, + * subnetId: exampleSubnet.id, + * vcores: 4, + * administratorLogin: "missadministrator", + * administratorLoginPassword: "NCC-1701-D", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * // Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * enabledForDiskEncryption: true, + * tenantId: current.then(current => current.tenantId), + * softDeleteRetentionDays: 7, + * purgeProtectionEnabled: false, + * skuName: "standard", + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "List", + * "Create", + * "Delete", + * "Update", + * "Recover", + * "Purge", + * "GetRotationPolicy", + * ], + * }, + * { + * tenantId: exampleManagedInstance.identity.apply(identity => identity?.tenantId), + * objectId: exampleManagedInstance.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "WrapKey", + * "UnwrapKey", + * ], + * }, + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "unwrapKey", + * "wrapKey", + * ], + * }, { + * dependsOn: [exampleKeyVault], + * }); + * const exampleManagedInstanceTransparentDataEncryption = new azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", { + * managedInstanceId: exampleManagedInstance.id, + * keyVaultKeyId: exampleKey.id, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/mssql/managedInstanceVulnerabilityAssessment.ts b/sdk/nodejs/mssql/managedInstanceVulnerabilityAssessment.ts index dbd7a31bad..0026e7bf86 100644 --- a/sdk/nodejs/mssql/managedInstanceVulnerabilityAssessment.ts +++ b/sdk/nodejs/mssql/managedInstanceVulnerabilityAssessment.ts @@ -9,6 +9,69 @@ import * as utilities from "../utilities"; /** * Manages the Vulnerability Assessment for an MS Managed Instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleManagedInstance = new azure.mssql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * licenseType: "BasePrice", + * skuName: "GP_Gen5", + * storageSizeInGb: 32, + * subnetId: exampleSubnet.id, + * vcores: 4, + * administratorLogin: "missadministrator", + * administratorLoginPassword: "NCC-1701-D", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleManagedInstanceSecurityAlertPolicy = new azure.mssql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", { + * resourceGroupName: azurerm_resource_group.test.name, + * managedInstanceName: azurerm_mssql_managed_instance.test.name, + * enabled: true, + * storageEndpoint: azurerm_storage_account.test.primary_blob_endpoint, + * storageAccountAccessKey: azurerm_storage_account.test.primary_access_key, + * retentionDays: 30, + * }); + * const exampleManagedInstanceVulnerabilityAssessment = new azure.mssql.ManagedInstanceVulnerabilityAssessment("exampleManagedInstanceVulnerabilityAssessment", { + * managedInstanceId: exampleManagedInstance.id, + * storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * recurringScans: { + * enabled: true, + * emailSubscriptionAdmins: true, + * emails: [ + * "email@example1.com", + * "email@example2.com", + * ], + * }, + * }, { + * dependsOn: [exampleManagedInstanceSecurityAlertPolicy], + * }); + * ``` + * * ## Import * * The Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/outboundFirewallRule.ts b/sdk/nodejs/mssql/outboundFirewallRule.ts index d4e2fe6623..da4f874be8 100644 --- a/sdk/nodejs/mssql/outboundFirewallRule.ts +++ b/sdk/nodejs/mssql/outboundFirewallRule.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Allows you to manage an Azure SQL Outbound Firewall Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * outboundNetworkRestrictionEnabled: true, + * }); + * const exampleOutboundFirewallRule = new azure.mssql.OutboundFirewallRule("exampleOutboundFirewallRule", {serverId: exampleServer.id}); + * ``` + * * ## Import * * SQL Outbound Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/server.ts b/sdk/nodejs/mssql/server.ts index 8011e27427..7f767dcacd 100644 --- a/sdk/nodejs/mssql/server.ts +++ b/sdk/nodejs/mssql/server.ts @@ -9,6 +9,107 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft SQL Azure Database Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "thisIsKat11", + * minimumTlsVersion: "1.2", + * azureadAdministrator: { + * loginUsername: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * }, + * tags: { + * environment: "production", + * }, + * }); + * ``` + * ### Transparent Data Encryption(TDE) With A Customer Managed Key(CMK) During Create + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * // Create a key vault with access policies which allow for the current user to get, list, create, delete, update, recover, purge and getRotationPolicy for the key vault key and also add a key vault access policy for the Microsoft Sql Server instance User Managed Identity to get, wrap, and unwrap key(s) + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * enabledForDiskEncryption: true, + * tenantId: exampleUserAssignedIdentity.tenantId, + * softDeleteRetentionDays: 7, + * purgeProtectionEnabled: true, + * skuName: "standard", + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "List", + * "Create", + * "Delete", + * "Update", + * "Recover", + * "Purge", + * "GetRotationPolicy", + * ], + * }, + * { + * tenantId: exampleUserAssignedIdentity.tenantId, + * objectId: exampleUserAssignedIdentity.principalId, + * keyPermissions: [ + * "Get", + * "WrapKey", + * "UnwrapKey", + * ], + * }, + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "unwrapKey", + * "wrapKey", + * ], + * }, { + * dependsOn: [exampleKeyVault], + * }); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "Example-Administrator", + * administratorLoginPassword: "Example_Password!", + * minimumTlsVersion: "1.2", + * azureadAdministrator: { + * loginUsername: exampleUserAssignedIdentity.name, + * objectId: exampleUserAssignedIdentity.principalId, + * }, + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * primaryUserAssignedIdentityId: exampleUserAssignedIdentity.id, + * transparentDataEncryptionKeyVaultKeyId: exampleKey.id, + * }); + * ``` + * * ## Import * * SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/serverDnsAlias.ts b/sdk/nodejs/mssql/serverDnsAlias.ts index 08730b8b24..aa1538aa0a 100644 --- a/sdk/nodejs/mssql/serverDnsAlias.ts +++ b/sdk/nodejs/mssql/serverDnsAlias.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a MS SQL Server DNS Alias. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "AdminPassword123!", + * }); + * const exampleServerDnsAlias = new azure.mssql.ServerDnsAlias("exampleServerDnsAlias", {mssqlServerId: exampleServer.id}); + * ``` + * * ## Import * * MSSQL Server DNS Aliass can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/serverExtendedAuditingPolicy.ts b/sdk/nodejs/mssql/serverExtendedAuditingPolicy.ts index 71300900c4..26913cd481 100644 --- a/sdk/nodejs/mssql/serverExtendedAuditingPolicy.ts +++ b/sdk/nodejs/mssql/serverExtendedAuditingPolicy.ts @@ -7,6 +7,116 @@ import * as utilities from "../utilities"; /** * Manages a MS SQL Server Extended Auditing Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "AdminPassword123!", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServerExtendedAuditingPolicy = new azure.mssql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", { + * serverId: exampleServer.id, + * storageEndpoint: exampleAccount.primaryBlobEndpoint, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * storageAccountAccessKeyIsSecondary: false, + * retentionInDays: 6, + * }); + * ``` + * ### With Storage Account Behind VNet And Firewall + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * serviceEndpoints: [ + * "Microsoft.Sql", + * "Microsoft.Storage", + * ], + * enforcePrivateLinkEndpointNetworkPolicies: true, + * }); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "AdminPassword123!", + * minimumTlsVersion: "1.2", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: primary.then(primary => primary.id), + * roleDefinitionName: "Storage Blob Data Contributor", + * principalId: exampleServer.identity.apply(identity => identity?.principalId), + * }); + * const sqlvnetrule = new azure.sql.VirtualNetworkRule("sqlvnetrule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * subnetId: exampleSubnet.id, + * }); + * const exampleFirewallRule = new azure.sql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "0.0.0.0", + * endIpAddress: "0.0.0.0", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * allowNestedItemsToBePublic: false, + * networkRules: { + * defaultAction: "Deny", + * ipRules: ["127.0.0.1"], + * virtualNetworkSubnetIds: [exampleSubnet.id], + * bypasses: ["AzureServices"], + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleServerExtendedAuditingPolicy = new azure.mssql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", { + * storageEndpoint: exampleAccount.primaryBlobEndpoint, + * serverId: exampleServer.id, + * retentionInDays: 6, + * logMonitoringEnabled: false, + * storageAccountSubscriptionId: azurerm_subscription.primary.subscription_id, + * }, { + * dependsOn: [ + * exampleAssignment, + * exampleAccount, + * ], + * }); + * ``` + * * ## Import * * MS SQL Server Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/serverMicrosoftSupportAuditingPolicy.ts b/sdk/nodejs/mssql/serverMicrosoftSupportAuditingPolicy.ts index 0b4befe45d..ae3e009452 100644 --- a/sdk/nodejs/mssql/serverMicrosoftSupportAuditingPolicy.ts +++ b/sdk/nodejs/mssql/serverMicrosoftSupportAuditingPolicy.ts @@ -7,6 +7,112 @@ import * as utilities from "../utilities"; /** * Manages a MS SQL Server Microsoft Support Auditing Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "AdminPassword123!", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleServerMicrosoftSupportAuditingPolicy = new azure.mssql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", { + * serverId: exampleServer.id, + * blobStorageEndpoint: exampleAccount.primaryBlobEndpoint, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * ``` + * ### With Storage Account Behind VNet And Firewall + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * serviceEndpoints: [ + * "Microsoft.Sql", + * "Microsoft.Storage", + * ], + * enforcePrivateLinkEndpointNetworkPolicies: true, + * }); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "AdminPassword123!", + * minimumTlsVersion: "1.2", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: primary.then(primary => primary.id), + * roleDefinitionName: "Storage Blob Data Contributor", + * principalId: exampleServer.identity.apply(identity => identity?.principalId), + * }); + * const sqlvnetrule = new azure.sql.VirtualNetworkRule("sqlvnetrule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * subnetId: exampleSubnet.id, + * }); + * const exampleFirewallRule = new azure.sql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "0.0.0.0", + * endIpAddress: "0.0.0.0", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * allowNestedItemsToBePublic: false, + * networkRules: { + * defaultAction: "Deny", + * ipRules: ["127.0.0.1"], + * virtualNetworkSubnetIds: [exampleSubnet.id], + * bypasses: ["AzureServices"], + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleServerMicrosoftSupportAuditingPolicy = new azure.mssql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", { + * blobStorageEndpoint: exampleAccount.primaryBlobEndpoint, + * serverId: exampleServer.id, + * logMonitoringEnabled: false, + * storageAccountSubscriptionId: azurerm_subscription.primary.subscription_id, + * }, { + * dependsOn: [ + * exampleAssignment, + * exampleAccount, + * ], + * }); + * ``` + * * ## Import * * MS SQL Server Microsoft Support Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/serverSecurityAlertPolicy.ts b/sdk/nodejs/mssql/serverSecurityAlertPolicy.ts index 567cb3cbf8..c0d4fc7cfe 100644 --- a/sdk/nodejs/mssql/serverSecurityAlertPolicy.ts +++ b/sdk/nodejs/mssql/serverSecurityAlertPolicy.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; * * > **NOTE** Security Alert Policy is currently only available for MS SQL databases. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleServerSecurityAlertPolicy = new azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleSqlServer.name, + * state: "Enabled", + * storageEndpoint: exampleAccount.primaryBlobEndpoint, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * disabledAlerts: [ + * "Sql_Injection", + * "Data_Exfiltration", + * ], + * retentionDays: 20, + * }); + * ``` + * * ## Import * * MS SQL Server Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/serverTransparentDataEncryption.ts b/sdk/nodejs/mssql/serverTransparentDataEncryption.ts index 400c0014b9..05fd4ed689 100644 --- a/sdk/nodejs/mssql/serverTransparentDataEncryption.ts +++ b/sdk/nodejs/mssql/serverTransparentDataEncryption.ts @@ -14,6 +14,107 @@ import * as utilities from "../utilities"; * > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. * * ## Example Usage + * ### With Service Managed Key + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "EastUs"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "thisIsKat11", + * minimumTlsVersion: "1.2", + * azureadAdministrator: { + * loginUsername: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * }, + * tags: { + * environment: "production", + * }, + * }); + * const exampleServerTransparentDataEncryption = new azure.mssql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", {serverId: exampleServer.id}); + * ``` + * ### With Customer Managed Key + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "EastUs"}); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "missadministrator", + * administratorLoginPassword: "thisIsKat11", + * minimumTlsVersion: "1.2", + * azureadAdministrator: { + * loginUsername: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * }, + * tags: { + * environment: "production", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * // Create a key vault with policies for the deployer to create a key & SQL Server to wrap/unwrap/get key + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * enabledForDiskEncryption: true, + * tenantId: current.then(current => current.tenantId), + * softDeleteRetentionDays: 7, + * purgeProtectionEnabled: false, + * skuName: "standard", + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "List", + * "Create", + * "Delete", + * "Update", + * "Recover", + * "Purge", + * "GetRotationPolicy", + * ], + * }, + * { + * tenantId: exampleServer.identity.apply(identity => identity?.tenantId), + * objectId: exampleServer.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "WrapKey", + * "UnwrapKey", + * ], + * }, + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "unwrapKey", + * "wrapKey", + * ], + * }, { + * dependsOn: [exampleKeyVault], + * }); + * const exampleServerTransparentDataEncryption = new azure.mssql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", { + * serverId: exampleServer.id, + * keyVaultKeyId: exampleKey.id, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/mssql/serverVulnerabilityAssessment.ts b/sdk/nodejs/mssql/serverVulnerabilityAssessment.ts index a771db3c03..e53118e3b1 100644 --- a/sdk/nodejs/mssql/serverVulnerabilityAssessment.ts +++ b/sdk/nodejs/mssql/serverVulnerabilityAssessment.ts @@ -11,6 +11,50 @@ import * as utilities from "../utilities"; * * > **NOTE** Vulnerability Assessment is currently only available for MS SQL databases. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleServerSecurityAlertPolicy = new azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleSqlServer.name, + * state: "Enabled", + * }); + * const exampleServerVulnerabilityAssessment = new azure.mssql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", { + * serverSecurityAlertPolicyId: exampleServerSecurityAlertPolicy.id, + * storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * recurringScans: { + * enabled: true, + * emailSubscriptionAdmins: true, + * emails: [ + * "email@example1.com", + * "email@example2.com", + * ], + * }, + * }); + * ``` + * * ## Import * * MS SQL Server Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/virtualMachine.ts b/sdk/nodejs/mssql/virtualMachine.ts index 8c959a8dfa..a77f9f51a4 100644 --- a/sdk/nodejs/mssql/virtualMachine.ts +++ b/sdk/nodejs/mssql/virtualMachine.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft SQL Virtual Machine * + * ## Example Usage + * + * This example provisions a brief Managed Microsoft SQL Virtual Machine. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleVirtualMachine = azure.compute.getVirtualMachine({ + * name: "example-vm", + * resourceGroupName: "example-resources", + * }); + * const exampleMssql_virtualMachineVirtualMachine = new azure.mssql.VirtualMachine("exampleMssql/virtualMachineVirtualMachine", { + * virtualMachineId: exampleVirtualMachine.then(exampleVirtualMachine => exampleVirtualMachine.id), + * sqlLicenseType: "PAYG", + * rServicesEnabled: true, + * sqlConnectivityPort: 1433, + * sqlConnectivityType: "PRIVATE", + * sqlConnectivityUpdatePassword: "Password1234!", + * sqlConnectivityUpdateUsername: "sqllogin", + * autoPatching: { + * dayOfWeek: "Sunday", + * maintenanceWindowDurationInMinutes: 60, + * maintenanceWindowStartingHour: 2, + * }, + * }); + * ``` + * * ## Import * * Microsoft SQL Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/virtualMachineGroup.ts b/sdk/nodejs/mssql/virtualMachineGroup.ts index 2b2607d226..09df38bbd7 100644 --- a/sdk/nodejs/mssql/virtualMachineGroup.ts +++ b/sdk/nodejs/mssql/virtualMachineGroup.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft SQL Virtual Machine Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualMachineGroup = new azure.mssql.VirtualMachineGroup("exampleVirtualMachineGroup", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sqlImageOffer: "SQL2017-WS2016", + * sqlImageSku: "Developer", + * wsfcDomainProfile: { + * fqdn: "testdomain.com", + * clusterSubnetType: "SingleSubnet", + * }, + * }); + * ``` + * * ## Import * * Microsoft SQL Virtual Machine Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mssql/virtualNetworkRule.ts b/sdk/nodejs/mssql/virtualNetworkRule.ts index d0e9b6c90d..af2b84257c 100644 --- a/sdk/nodejs/mssql/virtualNetworkRule.ts +++ b/sdk/nodejs/mssql/virtualNetworkRule.ts @@ -7,6 +7,37 @@ import * as utilities from "../utilities"; /** * Allows you to manage rules for allowing traffic between an Azure SQL server and a subnet of a virtual network. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.7.29.0/29"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.7.29.0/29"], + * serviceEndpoints: ["Microsoft.Sql"], + * }); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleVirtualNetworkRule = new azure.mssql.VirtualNetworkRule("exampleVirtualNetworkRule", { + * serverId: exampleServer.id, + * subnetId: exampleSubnet.id, + * }); + * ``` + * * ## Import * * SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/activeDirectoryAdministrator.ts b/sdk/nodejs/mysql/activeDirectoryAdministrator.ts index adcdd7a57c..704d2198a7 100644 --- a/sdk/nodejs/mysql/activeDirectoryAdministrator.ts +++ b/sdk/nodejs/mysql/activeDirectoryAdministrator.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Allows you to set a user or group as the AD administrator for an MySQL server in Azure * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mysqladminun", + * administratorLoginPassword: "H@Sh1CoR3!", + * sslEnforcementEnabled: true, + * skuName: "B_Gen5_2", + * storageMb: 5120, + * version: "5.7", + * }); + * const exampleActiveDirectoryAdministrator = new azure.mysql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", { + * serverName: exampleServer.name, + * resourceGroupName: exampleResourceGroup.name, + * login: "sqladmin", + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * }); + * ``` + * * ## Import * * A MySQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/configuration.ts b/sdk/nodejs/mysql/configuration.ts index 5d41e6a29c..8ec3eaacd0 100644 --- a/sdk/nodejs/mysql/configuration.ts +++ b/sdk/nodejs/mysql/configuration.ts @@ -11,6 +11,37 @@ import * as utilities from "../utilities"; * * > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mysqladminun", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "B_Gen5_2", + * storageMb: 5120, + * version: "5.7", + * autoGrowEnabled: true, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: true, + * infrastructureEncryptionEnabled: true, + * publicNetworkAccessEnabled: false, + * sslEnforcementEnabled: true, + * sslMinimalTlsVersionEnforced: "TLS1_2", + * }); + * const exampleConfiguration = new azure.mysql.Configuration("exampleConfiguration", { + * name: "interactive_timeout", + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * value: "600", + * }); + * ``` + * * ## Import * * MySQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/database.ts b/sdk/nodejs/mysql/database.ts index 656ee18a6d..5857d9a6e5 100644 --- a/sdk/nodejs/mysql/database.ts +++ b/sdk/nodejs/mysql/database.ts @@ -7,6 +7,37 @@ import * as utilities from "../utilities"; /** * Manages a MySQL Database within a MySQL Server * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mysqladminun", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "GP_Gen5_2", + * storageMb: 5120, + * version: "5.7", + * autoGrowEnabled: true, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: true, + * infrastructureEncryptionEnabled: true, + * publicNetworkAccessEnabled: false, + * sslEnforcementEnabled: true, + * sslMinimalTlsVersionEnforced: "TLS1_2", + * }); + * const exampleDatabase = new azure.mysql.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * charset: "utf8", + * collation: "utf8_unicode_ci", + * }); + * ``` + * * ## Import * * MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/firewallRule.ts b/sdk/nodejs/mysql/firewallRule.ts index 233badda23..b06e1c57e0 100644 --- a/sdk/nodejs/mysql/firewallRule.ts +++ b/sdk/nodejs/mysql/firewallRule.ts @@ -8,6 +8,59 @@ import * as utilities from "../utilities"; * Manages a Firewall Rule for a MySQL Server. * * ## Example Usage + * ### Single IP Address) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * version: "5.7", + * skuName: "GP_Gen5_2", + * sslEnforcementEnabled: true, + * }); + * const exampleFirewallRule = new azure.mysql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "40.112.8.12", + * endIpAddress: "40.112.8.12", + * }); + * ``` + * ### IP Range) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mysql.Server("exampleServer", {}); + * // ... + * const exampleFirewallRule = new azure.mysql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "40.112.0.0", + * endIpAddress: "40.112.255.255", + * }); + * ``` + * ### Allow Access To Azure Services) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mysql.Server("exampleServer", {}); + * // ... + * const exampleFirewallRule = new azure.mysql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "0.0.0.0", + * endIpAddress: "0.0.0.0", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/mysql/flexibleDatabase.ts b/sdk/nodejs/mysql/flexibleDatabase.ts index 3bfdfd629f..387405cdf4 100644 --- a/sdk/nodejs/mysql/flexibleDatabase.ts +++ b/sdk/nodejs/mysql/flexibleDatabase.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages a MySQL Database within a MySQL Flexible Server * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.mysql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLogin: "mysqladminun", + * administratorPassword: "H@Sh1CoR3!", + * skuName: "B_Standard_B1s", + * }); + * const exampleFlexibleDatabase = new azure.mysql.FlexibleDatabase("exampleFlexibleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleFlexibleServer.name, + * charset: "utf8", + * collation: "utf8_unicode_ci", + * }); + * ``` + * * ## Import * * MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/flexibleServer.ts b/sdk/nodejs/mysql/flexibleServer.ts index f6d7d5eb73..961085e8d5 100644 --- a/sdk/nodejs/mysql/flexibleServer.ts +++ b/sdk/nodejs/mysql/flexibleServer.ts @@ -9,6 +9,51 @@ import * as utilities from "../utilities"; /** * Manages a MySQL Flexible Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * serviceEndpoints: ["Microsoft.Storage"], + * delegations: [{ + * name: "fs", + * serviceDelegation: { + * name: "Microsoft.DBforMySQL/flexibleServers", + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * }, + * }], + * }); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleZoneVirtualNetworkLink = new azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", { + * privateDnsZoneName: exampleZone.name, + * virtualNetworkId: exampleVirtualNetwork.id, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFlexibleServer = new azure.mysql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLogin: "psqladmin", + * administratorPassword: "H@Sh1CoR3!", + * backupRetentionDays: 7, + * delegatedSubnetId: exampleSubnet.id, + * privateDnsZoneId: exampleZone.id, + * skuName: "GP_Standard_D2ds_v4", + * }, { + * dependsOn: [exampleZoneVirtualNetworkLink], + * }); + * ``` + * * ## Import * * MySQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/flexibleServerConfiguration.ts b/sdk/nodejs/mysql/flexibleServerConfiguration.ts index 501536deba..af7f9e217b 100644 --- a/sdk/nodejs/mysql/flexibleServerConfiguration.ts +++ b/sdk/nodejs/mysql/flexibleServerConfiguration.ts @@ -11,6 +11,27 @@ import * as utilities from "../utilities"; * * > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.mysql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLogin: "adminTerraform", + * administratorPassword: "H@Sh1CoR3!", + * skuName: "GP_Standard_D2ds_v4", + * }); + * const exampleFlexibleServerConfiguration = new azure.mysql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleFlexibleServer.name, + * value: "600", + * }); + * ``` + * * ## Import * * MySQL Flexible Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/flexibleServerFirewallRule.ts b/sdk/nodejs/mysql/flexibleServerFirewallRule.ts index 29496c0abe..3612564313 100644 --- a/sdk/nodejs/mysql/flexibleServerFirewallRule.ts +++ b/sdk/nodejs/mysql/flexibleServerFirewallRule.ts @@ -8,6 +8,60 @@ import * as utilities from "../utilities"; * Manages a Firewall Rule for a MySQL Flexible Server. * * ## Example Usage + * ### Single IP Address) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.mysql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleFlexibleServerFirewallRule = new azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleFlexibleServer.name, + * startIpAddress: "40.112.8.12", + * endIpAddress: "40.112.8.12", + * }); + * ``` + * ### IP Range) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.mysql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleFlexibleServerFirewallRule = new azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleFlexibleServer.name, + * startIpAddress: "40.112.0.0", + * endIpAddress: "40.112.255.255", + * }); + * ``` + * ### Allow Access To Azure Services) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.mysql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleFlexibleServerFirewallRule = new azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleFlexibleServer.name, + * startIpAddress: "0.0.0.0", + * endIpAddress: "0.0.0.0", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/mysql/getFlexibleServer.ts b/sdk/nodejs/mysql/getFlexibleServer.ts index 1e1c115325..902626b2ec 100644 --- a/sdk/nodejs/mysql/getFlexibleServer.ts +++ b/sdk/nodejs/mysql/getFlexibleServer.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing MySQL Flexible Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mysql.getFlexibleServer({ + * name: "existingMySqlFlexibleServer", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFlexibleServer(args: GetFlexibleServerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -114,6 +127,19 @@ export interface GetFlexibleServerResult { } /** * Use this data source to access information about an existing MySQL Flexible Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mysql.getFlexibleServer({ + * name: "existingMySqlFlexibleServer", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFlexibleServerOutput(args: GetFlexibleServerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFlexibleServer(a, opts)) diff --git a/sdk/nodejs/mysql/getServer.ts b/sdk/nodejs/mysql/getServer.ts index b72fdc310f..04e895d27a 100644 --- a/sdk/nodejs/mysql/getServer.ts +++ b/sdk/nodejs/mysql/getServer.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing MySQL Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mysql.getServer({ + * name: "existingMySqlServer", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getServer(args: GetServerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -110,6 +123,19 @@ export interface GetServerResult { } /** * Use this data source to access information about an existing MySQL Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.mysql.getServer({ + * name: "existingMySqlServer", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getServerOutput(args: GetServerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getServer(a, opts)) diff --git a/sdk/nodejs/mysql/server.ts b/sdk/nodejs/mysql/server.ts index ea7f83fc9c..d6d73a4510 100644 --- a/sdk/nodejs/mysql/server.ts +++ b/sdk/nodejs/mysql/server.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a MySQL Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mysqladminun", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "B_Gen5_2", + * storageMb: 5120, + * version: "5.7", + * autoGrowEnabled: true, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: false, + * infrastructureEncryptionEnabled: false, + * publicNetworkAccessEnabled: true, + * sslEnforcementEnabled: true, + * sslMinimalTlsVersionEnforced: "TLS1_2", + * }); + * ``` + * * ## Import * * MySQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/mysql/serverKey.ts b/sdk/nodejs/mysql/serverKey.ts index 0de6e5c11d..1ffd0ab48f 100644 --- a/sdk/nodejs/mysql/serverKey.ts +++ b/sdk/nodejs/mysql/serverKey.ts @@ -7,6 +7,92 @@ import * as utilities from "../utilities"; /** * Manages a Customer Managed Key for a MySQL Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * purgeProtectionEnabled: true, + * }); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "GP_Gen5_2", + * administratorLogin: "acctestun", + * administratorLoginPassword: "H@Sh1CoR3!", + * sslEnforcementEnabled: true, + * sslMinimalTlsVersionEnforced: "TLS1_1", + * storageMb: 51200, + * version: "5.7", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const server = new azure.keyvault.AccessPolicy("server", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleServer.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "UnwrapKey", + * "WrapKey", + * ], + * secretPermissions: ["Get"], + * }); + * const client = new azure.keyvault.AccessPolicy("client", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "Create", + * "Delete", + * "List", + * "Restore", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * "Purge", + * "Encrypt", + * "Decrypt", + * "Sign", + * "Verify", + * "GetRotationPolicy", + * ], + * secretPermissions: ["Get"], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * client, + * server, + * ], + * }); + * const exampleServerKey = new azure.mysql.ServerKey("exampleServerKey", { + * serverId: exampleServer.id, + * keyVaultKeyId: exampleKey.id, + * }); + * ``` + * * ## Import * * A MySQL Server Key can be imported using the `resource id` of the MySQL Server Key, e.g. diff --git a/sdk/nodejs/mysql/virtualNetworkRule.ts b/sdk/nodejs/mysql/virtualNetworkRule.ts index 920f2c486b..08a098cb18 100644 --- a/sdk/nodejs/mysql/virtualNetworkRule.ts +++ b/sdk/nodejs/mysql/virtualNetworkRule.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; * * > **NOTE:** MySQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mysql/concepts-data-access-and-security-vnet) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.7.29.0/29"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.7.29.0/29"], + * serviceEndpoints: ["Microsoft.Sql"], + * }); + * const exampleServer = new azure.mysql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "mysqladminun", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "GP_Gen5_2", + * storageMb: 5120, + * version: "5.7", + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: false, + * sslEnforcementEnabled: true, + * }); + * const exampleVirtualNetworkRule = new azure.mysql.VirtualNetworkRule("exampleVirtualNetworkRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * subnetId: internal.id, + * }); + * ``` + * * ## Import * * MySQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/netapp/account.ts b/sdk/nodejs/netapp/account.ts index 78e712bed9..5919b217d3 100644 --- a/sdk/nodejs/netapp/account.ts +++ b/sdk/nodejs/netapp/account.ts @@ -11,6 +11,27 @@ import * as utilities from "../utilities"; * * > **NOTE:** Azure allows only one active directory can be joined to a single subscription at a time for NetApp Account. * + * ## NetApp Account Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.netapp.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * activeDirectory: { + * username: "aduser", + * password: "aduserpwd", + * smbServerName: "SMBSERVER", + * dnsServers: ["1.2.3.4"], + * domain: "westcentralus.com", + * organizationalUnit: "OU=FirstLevel", + * }, + * }); + * ``` + * * ## Import * * NetApp Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/netapp/getAccount.ts b/sdk/nodejs/netapp/getAccount.ts index 0950a7b5ea..80cce25adb 100644 --- a/sdk/nodejs/netapp/getAccount.ts +++ b/sdk/nodejs/netapp/getAccount.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing NetApp Account. + * + * ## NetApp Account Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getAccount({ + * resourceGroupName: "acctestRG", + * name: "acctestnetappaccount", + * }); + * export const netappAccountId = example.then(example => example.id); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -47,6 +60,19 @@ export interface GetAccountResult { } /** * Uses this data source to access information about an existing NetApp Account. + * + * ## NetApp Account Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getAccount({ + * resourceGroupName: "acctestRG", + * name: "acctestnetappaccount", + * }); + * export const netappAccountId = example.then(example => example.id); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/netapp/getPool.ts b/sdk/nodejs/netapp/getPool.ts index d04818bdd9..56ff6188f4 100644 --- a/sdk/nodejs/netapp/getPool.ts +++ b/sdk/nodejs/netapp/getPool.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing NetApp Pool. + * + * ## NetApp Pool Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getPool({ + * resourceGroupName: "acctestRG", + * accountName: "acctestnetappaccount", + * name: "acctestnetapppool", + * }); + * export const netappPoolId = example.then(example => example.id); + * ``` */ export function getPool(args: GetPoolArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +75,20 @@ export interface GetPoolResult { } /** * Uses this data source to access information about an existing NetApp Pool. + * + * ## NetApp Pool Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getPool({ + * resourceGroupName: "acctestRG", + * accountName: "acctestnetappaccount", + * name: "acctestnetapppool", + * }); + * export const netappPoolId = example.then(example => example.id); + * ``` */ export function getPoolOutput(args: GetPoolOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPool(a, opts)) diff --git a/sdk/nodejs/netapp/getSnapshot.ts b/sdk/nodejs/netapp/getSnapshot.ts index cdac792e3b..85e0bb8669 100644 --- a/sdk/nodejs/netapp/getSnapshot.ts +++ b/sdk/nodejs/netapp/getSnapshot.ts @@ -6,6 +6,22 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing NetApp Snapshot. + * + * ## NetApp Snapshot Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.netapp.getSnapshot({ + * resourceGroupName: "acctestRG", + * name: "acctestnetappsnapshot", + * accountName: "acctestnetappaccount", + * poolName: "acctestnetapppool", + * volumeName: "acctestnetappvolume", + * }); + * export const netappSnapshotId = data.azurerm_netapp_snapshot.example.id; + * ``` */ export function getSnapshot(args: GetSnapshotArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +81,22 @@ export interface GetSnapshotResult { } /** * Uses this data source to access information about an existing NetApp Snapshot. + * + * ## NetApp Snapshot Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.netapp.getSnapshot({ + * resourceGroupName: "acctestRG", + * name: "acctestnetappsnapshot", + * accountName: "acctestnetappaccount", + * poolName: "acctestnetapppool", + * volumeName: "acctestnetappvolume", + * }); + * export const netappSnapshotId = data.azurerm_netapp_snapshot.example.id; + * ``` */ export function getSnapshotOutput(args: GetSnapshotOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSnapshot(a, opts)) diff --git a/sdk/nodejs/netapp/getSnapshotPolicy.ts b/sdk/nodejs/netapp/getSnapshotPolicy.ts index 45456b8655..9b557670bc 100644 --- a/sdk/nodejs/netapp/getSnapshotPolicy.ts +++ b/sdk/nodejs/netapp/getSnapshotPolicy.ts @@ -8,6 +8,26 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing NetApp Snapshot Policy. + * + * ## NetApp Snapshot Policy Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getSnapshotPolicy({ + * resourceGroupName: "acctestRG", + * accountName: "acctestnetappaccount", + * name: "example-snapshot-policy", + * }); + * export const id = example.then(example => example.id); + * export const name = example.then(example => example.name); + * export const enabled = example.then(example => example.enabled); + * export const hourlySchedule = example.then(example => example.hourlySchedules); + * export const dailySchedule = example.then(example => example.dailySchedules); + * export const weeklySchedule = example.then(example => example.weeklySchedules); + * export const monthlySchedule = example.then(example => example.monthlySchedules); + * ``` */ export function getSnapshotPolicy(args: GetSnapshotPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -85,6 +105,26 @@ export interface GetSnapshotPolicyResult { } /** * Uses this data source to access information about an existing NetApp Snapshot Policy. + * + * ## NetApp Snapshot Policy Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getSnapshotPolicy({ + * resourceGroupName: "acctestRG", + * accountName: "acctestnetappaccount", + * name: "example-snapshot-policy", + * }); + * export const id = example.then(example => example.id); + * export const name = example.then(example => example.name); + * export const enabled = example.then(example => example.enabled); + * export const hourlySchedule = example.then(example => example.hourlySchedules); + * export const dailySchedule = example.then(example => example.dailySchedules); + * export const weeklySchedule = example.then(example => example.weeklySchedules); + * export const monthlySchedule = example.then(example => example.monthlySchedules); + * ``` */ export function getSnapshotPolicyOutput(args: GetSnapshotPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSnapshotPolicy(a, opts)) diff --git a/sdk/nodejs/netapp/getVolume.ts b/sdk/nodejs/netapp/getVolume.ts index 3f9946a9e3..0dce572d06 100644 --- a/sdk/nodejs/netapp/getVolume.ts +++ b/sdk/nodejs/netapp/getVolume.ts @@ -8,6 +8,21 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing NetApp Volume. + * + * ## NetApp Volume Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getVolume({ + * resourceGroupName: "acctestRG", + * accountName: "acctestnetappaccount", + * poolName: "acctestnetapppool", + * name: "example-volume", + * }); + * export const netappVolumeId = example.then(example => example.id); + * ``` */ export function getVolume(args: GetVolumeArgs, opts?: pulumi.InvokeOptions): Promise { @@ -106,6 +121,21 @@ export interface GetVolumeResult { } /** * Uses this data source to access information about an existing NetApp Volume. + * + * ## NetApp Volume Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getVolume({ + * resourceGroupName: "acctestRG", + * accountName: "acctestnetappaccount", + * poolName: "acctestnetapppool", + * name: "example-volume", + * }); + * export const netappVolumeId = example.then(example => example.id); + * ``` */ export function getVolumeOutput(args: GetVolumeOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVolume(a, opts)) diff --git a/sdk/nodejs/netapp/getVolumeGroupSapHana.ts b/sdk/nodejs/netapp/getVolumeGroupSapHana.ts index 25d304d728..5337adef6d 100644 --- a/sdk/nodejs/netapp/getVolumeGroupSapHana.ts +++ b/sdk/nodejs/netapp/getVolumeGroupSapHana.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Application Volume Group for SAP HANA application. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getVolumeGroupSapHana({ + * name: "existing application volume group name", + * resourceGroupName: "resource group name where the account and volume group belong to", + * accountName: "existing account where the application volume group belong to", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getVolumeGroupSapHana(args: GetVolumeGroupSapHanaArgs, opts?: pulumi.InvokeOptions): Promise { @@ -70,6 +84,20 @@ export interface GetVolumeGroupSapHanaResult { } /** * Use this data source to access information about an existing Application Volume Group for SAP HANA application. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getVolumeGroupSapHana({ + * name: "existing application volume group name", + * resourceGroupName: "resource group name where the account and volume group belong to", + * accountName: "existing account where the application volume group belong to", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getVolumeGroupSapHanaOutput(args: GetVolumeGroupSapHanaOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVolumeGroupSapHana(a, opts)) diff --git a/sdk/nodejs/netapp/getVolumeQuotaRule.ts b/sdk/nodejs/netapp/getVolumeQuotaRule.ts index 45ab1c3ad1..4eb2a123c8 100644 --- a/sdk/nodejs/netapp/getVolumeQuotaRule.ts +++ b/sdk/nodejs/netapp/getVolumeQuotaRule.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Volume Quota Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getVolumeQuotaRule({ + * name: "exampleQuotaRule", + * volumeId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getVolumeQuotaRule(args: GetVolumeQuotaRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +72,19 @@ export interface GetVolumeQuotaRuleResult { } /** * Use this data source to access information about an existing Volume Quota Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.netapp.getVolumeQuotaRule({ + * name: "exampleQuotaRule", + * volumeId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getVolumeQuotaRuleOutput(args: GetVolumeQuotaRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVolumeQuotaRule(a, opts)) diff --git a/sdk/nodejs/netapp/pool.ts b/sdk/nodejs/netapp/pool.ts index 8ee6786ac2..2c32940ada 100644 --- a/sdk/nodejs/netapp/pool.ts +++ b/sdk/nodejs/netapp/pool.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Pool within a NetApp Account. * + * ## NetApp Pool Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.netapp.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePool = new azure.netapp.Pool("examplePool", { + * accountName: exampleAccount.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * serviceLevel: "Premium", + * sizeInTb: 4, + * }); + * ``` + * * ## Import * * NetApp Pool can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/netapp/snapshot.ts b/sdk/nodejs/netapp/snapshot.ts index 4a1f57a112..d79ff99bdf 100644 --- a/sdk/nodejs/netapp/snapshot.ts +++ b/sdk/nodejs/netapp/snapshot.ts @@ -7,6 +7,63 @@ import * as utilities from "../utilities"; /** * Manages a NetApp Snapshot. * + * ## NetApp Snapshot Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * delegations: [{ + * name: "netapp", + * serviceDelegation: { + * name: "Microsoft.Netapp/volumes", + * actions: [ + * "Microsoft.Network/networkinterfaces/*", + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * ], + * }, + * }], + * }); + * const exampleAccount = new azure.netapp.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePool = new azure.netapp.Pool("examplePool", { + * accountName: exampleAccount.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * serviceLevel: "Premium", + * sizeInTb: 4, + * }); + * const exampleVolume = new azure.netapp.Volume("exampleVolume", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * poolName: examplePool.name, + * volumePath: "my-unique-file-path", + * serviceLevel: "Premium", + * subnetId: exampleSubnet.id, + * storageQuotaInGb: 100, + * }); + * const exampleSnapshot = new azure.netapp.Snapshot("exampleSnapshot", { + * accountName: exampleAccount.name, + * poolName: examplePool.name, + * volumeName: exampleVolume.name, + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * NetApp Snapshot can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/netapp/snapshotPolicy.ts b/sdk/nodejs/netapp/snapshotPolicy.ts index 7a8347173a..500c533a90 100644 --- a/sdk/nodejs/netapp/snapshotPolicy.ts +++ b/sdk/nodejs/netapp/snapshotPolicy.ts @@ -9,6 +9,54 @@ import * as utilities from "../utilities"; /** * Manages a NetApp Snapshot Policy. * + * ## NetApp Snapshot Policy Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleAccount = new azure.netapp.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSnapshotPolicy = new azure.netapp.SnapshotPolicy("exampleSnapshotPolicy", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * enabled: true, + * hourlySchedule: { + * snapshotsToKeep: 4, + * minute: 15, + * }, + * dailySchedule: { + * snapshotsToKeep: 2, + * hour: 20, + * minute: 15, + * }, + * weeklySchedule: { + * snapshotsToKeep: 1, + * daysOfWeeks: [ + * "Monday", + * "Friday", + * ], + * hour: 23, + * minute: 0, + * }, + * monthlySchedule: { + * snapshotsToKeep: 1, + * daysOfMonths: [ + * 1, + * 15, + * 20, + * 30, + * ], + * hour: 5, + * minute: 45, + * }, + * }); + * ``` + * * ## Import * * NetApp Snapshot Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/netapp/volumeQuotaRule.ts b/sdk/nodejs/netapp/volumeQuotaRule.ts index 9d541253b4..a0ab8e3554 100644 --- a/sdk/nodejs/netapp/volumeQuotaRule.ts +++ b/sdk/nodejs/netapp/volumeQuotaRule.ts @@ -7,6 +7,87 @@ import * as utilities from "../utilities"; /** * Manages a Volume Quota Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * delegations: [{ + * name: "netapp", + * serviceDelegation: { + * name: "Microsoft.Netapp/volumes", + * actions: [ + * "Microsoft.Network/networkinterfaces/*", + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * ], + * }, + * }], + * }); + * const exampleAccount = new azure.netapp.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const examplePool = new azure.netapp.Pool("examplePool", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * serviceLevel: "Premium", + * sizeInTb: 4, + * }); + * const exampleVolume = new azure.netapp.Volume("exampleVolume", { + * location: exampleResourceGroup.location, + * zone: "1", + * resourceGroupName: exampleResourceGroup.name, + * accountName: exampleAccount.name, + * poolName: examplePool.name, + * volumePath: "my-unique-file-path", + * serviceLevel: "Premium", + * subnetId: exampleSubnet.id, + * networkFeatures: "Basic", + * protocols: ["NFSv4.1"], + * securityStyle: "unix", + * storageQuotaInGb: 100, + * snapshotDirectoryVisible: false, + * }); + * const quota1 = new azure.netapp.VolumeQuotaRule("quota1", { + * location: exampleResourceGroup.location, + * volumeId: exampleVolume.id, + * quotaTarget: "3001", + * quotaSizeInKib: 1024, + * quotaType: "IndividualGroupQuota", + * }); + * const quota2 = new azure.netapp.VolumeQuotaRule("quota2", { + * location: exampleResourceGroup.location, + * volumeId: exampleVolume.id, + * quotaTarget: "2001", + * quotaSizeInKib: 1024, + * quotaType: "IndividualUserQuota", + * }); + * const quota3 = new azure.netapp.VolumeQuotaRule("quota3", { + * location: exampleResourceGroup.location, + * volumeId: exampleVolume.id, + * quotaSizeInKib: 1024, + * quotaType: "DefaultUserQuota", + * }); + * const quota4 = new azure.netapp.VolumeQuotaRule("quota4", { + * location: exampleResourceGroup.location, + * volumeId: exampleVolume.id, + * quotaSizeInKib: 1024, + * quotaType: "DefaultGroupQuota", + * }); + * ``` + * * ## Import * * Volume Quota Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/applicationGateway.ts b/sdk/nodejs/network/applicationGateway.ts index 88de15b567..9933f47c0f 100644 --- a/sdk/nodejs/network/applicationGateway.ts +++ b/sdk/nodejs/network/applicationGateway.ts @@ -9,6 +9,88 @@ import * as utilities from "../utilities"; /** * Manages an Application Gateway. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.254.0.0/16"], + * }); + * const frontend = new azure.network.Subnet("frontend", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.254.0.0/24"], + * }); + * const backend = new azure.network.Subnet("backend", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.254.2.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allocationMethod: "Dynamic", + * }); + * const backendAddressPoolName = pulumi.interpolate`${exampleVirtualNetwork.name}-beap`; + * const frontendPortName = pulumi.interpolate`${exampleVirtualNetwork.name}-feport`; + * const frontendIpConfigurationName = pulumi.interpolate`${exampleVirtualNetwork.name}-feip`; + * const httpSettingName = pulumi.interpolate`${exampleVirtualNetwork.name}-be-htst`; + * const listenerName = pulumi.interpolate`${exampleVirtualNetwork.name}-httplstn`; + * const requestRoutingRuleName = pulumi.interpolate`${exampleVirtualNetwork.name}-rqrt`; + * const redirectConfigurationName = pulumi.interpolate`${exampleVirtualNetwork.name}-rdrcfg`; + * const network = new azure.network.ApplicationGateway("network", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "Standard_v2", + * tier: "Standard_v2", + * capacity: 2, + * }, + * gatewayIpConfigurations: [{ + * name: "my-gateway-ip-configuration", + * subnetId: frontend.id, + * }], + * frontendPorts: [{ + * name: frontendPortName, + * port: 80, + * }], + * frontendIpConfigurations: [{ + * name: frontendIpConfigurationName, + * publicIpAddressId: examplePublicIp.id, + * }], + * backendAddressPools: [{ + * name: backendAddressPoolName, + * }], + * backendHttpSettings: [{ + * name: httpSettingName, + * cookieBasedAffinity: "Disabled", + * path: "/path1/", + * port: 80, + * protocol: "Http", + * requestTimeout: 60, + * }], + * httpListeners: [{ + * name: listenerName, + * frontendIpConfigurationName: frontendIpConfigurationName, + * frontendPortName: frontendPortName, + * protocol: "Http", + * }], + * requestRoutingRules: [{ + * name: requestRoutingRuleName, + * priority: 9, + * ruleType: "Basic", + * httpListenerName: listenerName, + * backendAddressPoolName: backendAddressPoolName, + * backendHttpSettingsName: httpSettingName, + * }], + * }); + * ``` + * * ## Import * * Application Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/applicationSecurityGroup.ts b/sdk/nodejs/network/applicationSecurityGroup.ts index 0fd5d77be5..9e2748d8a4 100644 --- a/sdk/nodejs/network/applicationSecurityGroup.ts +++ b/sdk/nodejs/network/applicationSecurityGroup.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an Application Security Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleApplicationSecurityGroup = new azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * Hello: "World", + * }, + * }); + * ``` + * * ## Import * * Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/bgpConnection.ts b/sdk/nodejs/network/bgpConnection.ts index 9aa21c33d8..75fc0ca995 100644 --- a/sdk/nodejs/network/bgpConnection.ts +++ b/sdk/nodejs/network/bgpConnection.ts @@ -7,6 +7,50 @@ import * as utilities from "../utilities"; /** * Manages a Bgp Connection for a Virtual Hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard", + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.5.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.1.0/24"], + * }); + * const exampleVirtualHubIp = new azure.network.VirtualHubIp("exampleVirtualHubIp", { + * virtualHubId: exampleVirtualHub.id, + * privateIpAddress: "10.5.1.18", + * privateIpAllocationMethod: "Static", + * publicIpAddressId: examplePublicIp.id, + * subnetId: exampleSubnet.id, + * }); + * const exampleBgpConnection = new azure.network.BgpConnection("exampleBgpConnection", { + * virtualHubId: exampleVirtualHub.id, + * peerAsn: 65514, + * peerIp: "169.254.21.5", + * }, { + * dependsOn: [exampleVirtualHubIp], + * }); + * ``` + * * ## Import * * Virtual Hub Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/ddosProtectionPlan.ts b/sdk/nodejs/network/ddosProtectionPlan.ts index e60576d022..cf0fbf45e1 100644 --- a/sdk/nodejs/network/ddosProtectionPlan.ts +++ b/sdk/nodejs/network/ddosProtectionPlan.ts @@ -11,6 +11,19 @@ import * as utilities from "../utilities"; * * > **NOTE** The DDoS Protection Plan is a [high-cost service](https://azure.microsoft.com/en-us/pricing/details/ddos-protection/#pricing). Please keep this in mind while testing and learning. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleDdosProtectionPlan = new azure.network.DdosProtectionPlan("exampleDdosProtectionPlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * Azure DDoS Protection Plan can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/expressRouteCircuit.ts b/sdk/nodejs/network/expressRouteCircuit.ts index 9777bc65f0..74289948d7 100644 --- a/sdk/nodejs/network/expressRouteCircuit.ts +++ b/sdk/nodejs/network/expressRouteCircuit.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages an ExpressRoute circuit. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serviceProviderName: "Equinix", + * peeringLocation: "Silicon Valley", + * bandwidthInMbps: 50, + * sku: { + * tier: "Standard", + * family: "MeteredData", + * }, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * ExpressRoute circuits can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/expressRouteCircuitAuthorization.ts b/sdk/nodejs/network/expressRouteCircuitAuthorization.ts index cf23202e4c..389b47ae90 100644 --- a/sdk/nodejs/network/expressRouteCircuitAuthorization.ts +++ b/sdk/nodejs/network/expressRouteCircuitAuthorization.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages an ExpressRoute Circuit Authorization. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serviceProviderName: "Equinix", + * peeringLocation: "Silicon Valley", + * bandwidthInMbps: 50, + * sku: { + * tier: "Standard", + * family: "MeteredData", + * }, + * allowClassicOperations: false, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleExpressRouteCircuitAuthorization = new azure.network.ExpressRouteCircuitAuthorization("exampleExpressRouteCircuitAuthorization", { + * expressRouteCircuitName: exampleExpressRouteCircuit.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * ExpressRoute Circuit Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/expressRouteCircuitConnection.ts b/sdk/nodejs/network/expressRouteCircuitConnection.ts index 255ae97d7f..9c203ad9e0 100644 --- a/sdk/nodejs/network/expressRouteCircuitConnection.ts +++ b/sdk/nodejs/network/expressRouteCircuitConnection.ts @@ -7,6 +7,75 @@ import * as utilities from "../utilities"; /** * Manages an Express Route Circuit Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleExpressRoutePort = new azure.network.ExpressRoutePort("exampleExpressRoutePort", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * peeringLocation: "Equinix-Seattle-SE2", + * bandwidthInGbps: 10, + * encapsulation: "Dot1Q", + * }); + * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * expressRoutePortId: exampleExpressRoutePort.id, + * bandwidthInGbps: 5, + * sku: { + * tier: "Standard", + * family: "MeteredData", + * }, + * }); + * const example2ExpressRoutePort = new azure.network.ExpressRoutePort("example2ExpressRoutePort", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * peeringLocation: "Allied-Toronto-King-West", + * bandwidthInGbps: 10, + * encapsulation: "Dot1Q", + * }); + * const example2ExpressRouteCircuit = new azure.network.ExpressRouteCircuit("example2ExpressRouteCircuit", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * expressRoutePortId: example2ExpressRoutePort.id, + * bandwidthInGbps: 5, + * sku: { + * tier: "Standard", + * family: "MeteredData", + * }, + * }); + * const exampleExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", { + * peeringType: "AzurePrivatePeering", + * expressRouteCircuitName: exampleExpressRouteCircuit.name, + * resourceGroupName: exampleResourceGroup.name, + * sharedKey: "ItsASecret", + * peerAsn: 100, + * primaryPeerAddressPrefix: "192.168.1.0/30", + * secondaryPeerAddressPrefix: "192.168.1.0/30", + * vlanId: 100, + * }); + * const example2ExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("example2ExpressRouteCircuitPeering", { + * peeringType: "AzurePrivatePeering", + * expressRouteCircuitName: example2ExpressRouteCircuit.name, + * resourceGroupName: exampleResourceGroup.name, + * sharedKey: "ItsASecret", + * peerAsn: 100, + * primaryPeerAddressPrefix: "192.168.1.0/30", + * secondaryPeerAddressPrefix: "192.168.1.0/30", + * vlanId: 100, + * }); + * const exampleExpressRouteCircuitConnection = new azure.network.ExpressRouteCircuitConnection("exampleExpressRouteCircuitConnection", { + * peeringId: exampleExpressRouteCircuitPeering.id, + * peerPeeringId: example2ExpressRouteCircuitPeering.id, + * addressPrefixIpv4: "192.169.9.0/29", + * authorizationKey: "846a1918-b7a2-4917-b43c-8c4cdaee006a", + * }); + * ``` + * * ## Import * * Express Route Circuit Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/expressRouteCircuitPeering.ts b/sdk/nodejs/network/expressRouteCircuitPeering.ts index 32e4394ea4..3328d2b6a3 100644 --- a/sdk/nodejs/network/expressRouteCircuitPeering.ts +++ b/sdk/nodejs/network/expressRouteCircuitPeering.ts @@ -10,6 +10,88 @@ import * as utilities from "../utilities"; * Manages an ExpressRoute Circuit Peering. * * ## Example Usage + * ### Creating A Microsoft Peering) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serviceProviderName: "Equinix", + * peeringLocation: "Silicon Valley", + * bandwidthInMbps: 50, + * sku: { + * tier: "Standard", + * family: "MeteredData", + * }, + * allowClassicOperations: false, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", { + * peeringType: "MicrosoftPeering", + * expressRouteCircuitName: exampleExpressRouteCircuit.name, + * resourceGroupName: exampleResourceGroup.name, + * peerAsn: 100, + * primaryPeerAddressPrefix: "123.0.0.0/30", + * secondaryPeerAddressPrefix: "123.0.0.4/30", + * ipv4Enabled: true, + * vlanId: 300, + * microsoftPeeringConfig: { + * advertisedPublicPrefixes: ["123.1.0.0/24"], + * }, + * ipv6: { + * primaryPeerAddressPrefix: "2002:db01::/126", + * secondaryPeerAddressPrefix: "2003:db01::/126", + * enabled: true, + * microsoftPeering: { + * advertisedPublicPrefixes: ["2002:db01::/126"], + * }, + * }, + * }); + * ``` + * ### Creating Azure Private Peering) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serviceProviderName: "Equinix", + * peeringLocation: "Silicon Valley", + * bandwidthInMbps: 50, + * sku: { + * tier: "Standard", + * family: "MeteredData", + * }, + * allowClassicOperations: false, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", { + * peeringType: "AzurePrivatePeering", + * expressRouteCircuitName: exampleExpressRouteCircuit.name, + * resourceGroupName: exampleResourceGroup.name, + * peerAsn: 100, + * primaryPeerAddressPrefix: "123.0.0.0/30", + * secondaryPeerAddressPrefix: "123.0.0.4/30", + * ipv4Enabled: true, + * vlanId: 300, + * ipv6: { + * primaryPeerAddressPrefix: "2002:db01::/126", + * secondaryPeerAddressPrefix: "2003:db01::/126", + * enabled: true, + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/network/expressRouteConnection.ts b/sdk/nodejs/network/expressRouteConnection.ts index f064d3f116..26c46e357f 100644 --- a/sdk/nodejs/network/expressRouteConnection.ts +++ b/sdk/nodejs/network/expressRouteConnection.ts @@ -11,6 +11,62 @@ import * as utilities from "../utilities"; * * > **NOTE:** The provider status of the Express Route Circuit must be set as provisioned while creating the Express Route Connection. See more details [here](https://docs.microsoft.com/azure/expressroute/expressroute-howto-circuit-portal-resource-manager#send-the-service-key-to-your-connectivity-provider-for-provisioning). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.1.0/24", + * }); + * const exampleExpressRouteGateway = new azure.network.ExpressRouteGateway("exampleExpressRouteGateway", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualHubId: exampleVirtualHub.id, + * scaleUnits: 1, + * }); + * const exampleExpressRoutePort = new azure.network.ExpressRoutePort("exampleExpressRoutePort", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * peeringLocation: "Equinix-Seattle-SE2", + * bandwidthInGbps: 10, + * encapsulation: "Dot1Q", + * }); + * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * expressRoutePortId: exampleExpressRoutePort.id, + * bandwidthInGbps: 5, + * sku: { + * tier: "Standard", + * family: "MeteredData", + * }, + * }); + * const exampleExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", { + * peeringType: "AzurePrivatePeering", + * expressRouteCircuitName: exampleExpressRouteCircuit.name, + * resourceGroupName: exampleResourceGroup.name, + * sharedKey: "ItsASecret", + * peerAsn: 100, + * primaryPeerAddressPrefix: "192.168.1.0/30", + * secondaryPeerAddressPrefix: "192.168.2.0/30", + * vlanId: 100, + * }); + * const exampleExpressRouteConnection = new azure.network.ExpressRouteConnection("exampleExpressRouteConnection", { + * expressRouteGatewayId: exampleExpressRouteGateway.id, + * expressRouteCircuitPeeringId: exampleExpressRouteCircuitPeering.id, + * }); + * ``` + * * ## Import * * Express Route Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/expressRouteGateway.ts b/sdk/nodejs/network/expressRouteGateway.ts index 8d77d21623..57aad113c9 100644 --- a/sdk/nodejs/network/expressRouteGateway.ts +++ b/sdk/nodejs/network/expressRouteGateway.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages an ExpressRoute gateway. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.1.0/24", + * }); + * const exampleExpressRouteGateway = new azure.network.ExpressRouteGateway("exampleExpressRouteGateway", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualHubId: exampleVirtualHub.id, + * scaleUnits: 1, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * ExpressRoute Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/expressRoutePort.ts b/sdk/nodejs/network/expressRoutePort.ts index c2c23d6397..d3c1d62210 100644 --- a/sdk/nodejs/network/expressRoutePort.ts +++ b/sdk/nodejs/network/expressRoutePort.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; /** * Manages a Express Route Port. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleExpressRoutePort = new azure.network.ExpressRoutePort("exampleExpressRoutePort", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * peeringLocation: "Airtel-Chennai-CLS", + * bandwidthInGbps: 10, + * encapsulation: "Dot1Q", + * }); + * ``` + * * ## Import * * Express Route Ports can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/expressRoutePortAuthorization.ts b/sdk/nodejs/network/expressRoutePortAuthorization.ts index 090e7a4a63..a510bfb12d 100644 --- a/sdk/nodejs/network/expressRoutePortAuthorization.ts +++ b/sdk/nodejs/network/expressRoutePortAuthorization.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages an ExpressRoute Port Authorization. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleExpressRoutePort = new azure.network.ExpressRoutePort("exampleExpressRoutePort", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * peeringLocation: "Airtel-Chennai-CLS", + * bandwidthInGbps: 10, + * encapsulation: "Dot1Q", + * }); + * const exampleExpressRoutePortAuthorization = new azure.network.ExpressRoutePortAuthorization("exampleExpressRoutePortAuthorization", { + * expressRoutePortName: exampleExpressRoutePort.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * ExpressRoute Port Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/firewall.ts b/sdk/nodejs/network/firewall.ts index cb7c8fcd86..51e6274e02 100644 --- a/sdk/nodejs/network/firewall.ts +++ b/sdk/nodejs/network/firewall.ts @@ -9,6 +9,42 @@ import * as utilities from "../utilities"; /** * Manages an Azure Firewall. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleFirewall = new azure.network.Firewall("exampleFirewall", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "AZFW_VNet", + * skuTier: "Standard", + * ipConfigurations: [{ + * name: "configuration", + * subnetId: exampleSubnet.id, + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * ``` + * * ## Import * * Azure Firewalls can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/firewallApplicationRuleCollection.ts b/sdk/nodejs/network/firewallApplicationRuleCollection.ts index fea69f47b3..1ff6f443d8 100644 --- a/sdk/nodejs/network/firewallApplicationRuleCollection.ts +++ b/sdk/nodejs/network/firewallApplicationRuleCollection.ts @@ -9,6 +9,57 @@ import * as utilities from "../utilities"; /** * Manages an Application Rule Collection within an Azure Firewall. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleFirewall = new azure.network.Firewall("exampleFirewall", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "AZFW_VNet", + * skuTier: "Standard", + * ipConfigurations: [{ + * name: "configuration", + * subnetId: exampleSubnet.id, + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleFirewallApplicationRuleCollection = new azure.network.FirewallApplicationRuleCollection("exampleFirewallApplicationRuleCollection", { + * azureFirewallName: exampleFirewall.name, + * resourceGroupName: exampleResourceGroup.name, + * priority: 100, + * action: "Allow", + * rules: [{ + * name: "testrule", + * sourceAddresses: ["10.0.0.0/16"], + * targetFqdns: ["*.google.com"], + * protocols: [{ + * port: 443, + * type: "Https", + * }], + * }], + * }); + * ``` + * * ## Import * * Firewall Application Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/firewallNatRuleCollection.ts b/sdk/nodejs/network/firewallNatRuleCollection.ts index 55fdc82ecf..a2cb0e774c 100644 --- a/sdk/nodejs/network/firewallNatRuleCollection.ts +++ b/sdk/nodejs/network/firewallNatRuleCollection.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; /** * Manages a NAT Rule Collection within an Azure Firewall. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleFirewall = new azure.network.Firewall("exampleFirewall", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "AZFW_VNet", + * skuTier: "Standard", + * ipConfigurations: [{ + * name: "configuration", + * subnetId: exampleSubnet.id, + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleFirewallNatRuleCollection = new azure.network.FirewallNatRuleCollection("exampleFirewallNatRuleCollection", { + * azureFirewallName: exampleFirewall.name, + * resourceGroupName: exampleResourceGroup.name, + * priority: 100, + * action: "Dnat", + * rules: [{ + * name: "testrule", + * sourceAddresses: ["10.0.0.0/16"], + * destinationPorts: ["53"], + * destinationAddresses: [examplePublicIp.ipAddress], + * translatedPort: "53", + * translatedAddress: "8.8.8.8", + * protocols: [ + * "TCP", + * "UDP", + * ], + * }], + * }); + * ``` + * * ## Import * * Azure Firewall NAT Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/firewallNetworkRuleCollection.ts b/sdk/nodejs/network/firewallNetworkRuleCollection.ts index ea6d642fd6..cda93ae169 100644 --- a/sdk/nodejs/network/firewallNetworkRuleCollection.ts +++ b/sdk/nodejs/network/firewallNetworkRuleCollection.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; /** * Manages a Network Rule Collection within an Azure Firewall. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleFirewall = new azure.network.Firewall("exampleFirewall", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "AZFW_VNet", + * skuTier: "Standard", + * ipConfigurations: [{ + * name: "configuration", + * subnetId: exampleSubnet.id, + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleFirewallNetworkRuleCollection = new azure.network.FirewallNetworkRuleCollection("exampleFirewallNetworkRuleCollection", { + * azureFirewallName: exampleFirewall.name, + * resourceGroupName: exampleResourceGroup.name, + * priority: 100, + * action: "Allow", + * rules: [{ + * name: "testrule", + * sourceAddresses: ["10.0.0.0/16"], + * destinationPorts: ["53"], + * destinationAddresses: [ + * "8.8.8.8", + * "8.8.4.4", + * ], + * protocols: [ + * "TCP", + * "UDP", + * ], + * }], + * }); + * ``` + * * ## Import * * Azure Firewall Network Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/firewallPolicy.ts b/sdk/nodejs/network/firewallPolicy.ts index 9ce62c49c0..9f61a3cac5 100644 --- a/sdk/nodejs/network/firewallPolicy.ts +++ b/sdk/nodejs/network/firewallPolicy.ts @@ -9,6 +9,19 @@ import * as utilities from "../utilities"; /** * Manages a Firewall Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFirewallPolicy = new azure.network.FirewallPolicy("exampleFirewallPolicy", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/getApplicationGateway.ts b/sdk/nodejs/network/getApplicationGateway.ts index 11525f64b2..bdcc273e54 100644 --- a/sdk/nodejs/network/getApplicationGateway.ts +++ b/sdk/nodejs/network/getApplicationGateway.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Application Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getApplicationGateway({ + * name: "existing-app-gateway", + * resourceGroupName: "existing-resources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getApplicationGateway(args: GetApplicationGatewayArgs, opts?: pulumi.InvokeOptions): Promise { @@ -173,6 +186,19 @@ export interface GetApplicationGatewayResult { } /** * Use this data source to access information about an existing Application Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getApplicationGateway({ + * name: "existing-app-gateway", + * resourceGroupName: "existing-resources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getApplicationGatewayOutput(args: GetApplicationGatewayOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getApplicationGateway(a, opts)) diff --git a/sdk/nodejs/network/getApplicationSecurityGroup.ts b/sdk/nodejs/network/getApplicationSecurityGroup.ts index a8a289b57d..4900a7cd70 100644 --- a/sdk/nodejs/network/getApplicationSecurityGroup.ts +++ b/sdk/nodejs/network/getApplicationSecurityGroup.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Application Security Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getApplicationSecurityGroup({ + * name: "tf-appsecuritygroup", + * resourceGroupName: "my-resource-group", + * }); + * export const applicationSecurityGroupId = example.then(example => example.id); + * ``` */ export function getApplicationSecurityGroup(args: GetApplicationSecurityGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +64,19 @@ export interface GetApplicationSecurityGroupResult { } /** * Use this data source to access information about an existing Application Security Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getApplicationSecurityGroup({ + * name: "tf-appsecuritygroup", + * resourceGroupName: "my-resource-group", + * }); + * export const applicationSecurityGroupId = example.then(example => example.id); + * ``` */ export function getApplicationSecurityGroupOutput(args: GetApplicationSecurityGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getApplicationSecurityGroup(a, opts)) diff --git a/sdk/nodejs/network/getExpressRouteCircuit.ts b/sdk/nodejs/network/getExpressRouteCircuit.ts index 1a543da7fb..3e36a3d194 100644 --- a/sdk/nodejs/network/getExpressRouteCircuit.ts +++ b/sdk/nodejs/network/getExpressRouteCircuit.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing ExpressRoute circuit. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getExpressRouteCircuit({ + * resourceGroupName: azurerm_resource_group.example.name, + * name: azurerm_express_route_circuit.example.name, + * }); + * export const expressRouteCircuitId = example.then(example => example.id); + * export const serviceKey = example.then(example => example.serviceKey); + * ``` */ export function getExpressRouteCircuit(args: GetExpressRouteCircuitArgs, opts?: pulumi.InvokeOptions): Promise { @@ -69,6 +83,20 @@ export interface GetExpressRouteCircuitResult { } /** * Use this data source to access information about an existing ExpressRoute circuit. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getExpressRouteCircuit({ + * resourceGroupName: azurerm_resource_group.example.name, + * name: azurerm_express_route_circuit.example.name, + * }); + * export const expressRouteCircuitId = example.then(example => example.id); + * export const serviceKey = example.then(example => example.serviceKey); + * ``` */ export function getExpressRouteCircuitOutput(args: GetExpressRouteCircuitOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getExpressRouteCircuit(a, opts)) diff --git a/sdk/nodejs/network/getFirewall.ts b/sdk/nodejs/network/getFirewall.ts index 8cec9f7ada..4e3b70c5d4 100644 --- a/sdk/nodejs/network/getFirewall.ts +++ b/sdk/nodejs/network/getFirewall.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure Firewall. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getFirewall({ + * name: "firewall1", + * resourceGroupName: "firewall-RG", + * }); + * export const firewallPrivateIp = example.then(example => example.ipConfigurations?.[0]?.privateIpAddress); + * ``` */ export function getFirewall(args: GetFirewallArgs, opts?: pulumi.InvokeOptions): Promise { @@ -89,6 +102,19 @@ export interface GetFirewallResult { } /** * Use this data source to access information about an existing Azure Firewall. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getFirewall({ + * name: "firewall1", + * resourceGroupName: "firewall-RG", + * }); + * export const firewallPrivateIp = example.then(example => example.ipConfigurations?.[0]?.privateIpAddress); + * ``` */ export function getFirewallOutput(args: GetFirewallOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFirewall(a, opts)) diff --git a/sdk/nodejs/network/getFirewallPolicy.ts b/sdk/nodejs/network/getFirewallPolicy.ts index 9fb04db4c6..84aea4a2d3 100644 --- a/sdk/nodejs/network/getFirewallPolicy.ts +++ b/sdk/nodejs/network/getFirewallPolicy.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Firewall Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getFirewallPolicy({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFirewallPolicy(args: GetFirewallPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +70,19 @@ export interface GetFirewallPolicyResult { } /** * Use this data source to access information about an existing Firewall Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getFirewallPolicy({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFirewallPolicyOutput(args: GetFirewallPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFirewallPolicy(a, opts)) diff --git a/sdk/nodejs/network/getGatewayConnection.ts b/sdk/nodejs/network/getGatewayConnection.ts index 225d37f3c4..e823e057ba 100644 --- a/sdk/nodejs/network/getGatewayConnection.ts +++ b/sdk/nodejs/network/getGatewayConnection.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Virtual Network Gateway Connection. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getGatewayConnection({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualNetworkGatewayConnectionId = example.then(example => example.id); + * ``` */ export function getGatewayConnection(args: GetGatewayConnectionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -133,6 +146,19 @@ export interface GetGatewayConnectionResult { } /** * Use this data source to access information about an existing Virtual Network Gateway Connection. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getGatewayConnection({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualNetworkGatewayConnectionId = example.then(example => example.id); + * ``` */ export function getGatewayConnectionOutput(args: GetGatewayConnectionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getGatewayConnection(a, opts)) diff --git a/sdk/nodejs/network/getIpGroup.ts b/sdk/nodejs/network/getIpGroup.ts index d76b68504e..54c0c2765b 100644 --- a/sdk/nodejs/network/getIpGroup.ts +++ b/sdk/nodejs/network/getIpGroup.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing IP Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getIpGroup({ + * name: "example1-ipgroup", + * resourceGroupName: "example-rg", + * }); + * export const cidrs = example.then(example => example.cidrs); + * ``` */ export function getIpGroup(args: GetIpGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetIpGroupResult { } /** * Use this data source to access information about an existing IP Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getIpGroup({ + * name: "example1-ipgroup", + * resourceGroupName: "example-rg", + * }); + * export const cidrs = example.then(example => example.cidrs); + * ``` */ export function getIpGroupOutput(args: GetIpGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getIpGroup(a, opts)) diff --git a/sdk/nodejs/network/getLocalNetworkGateway.ts b/sdk/nodejs/network/getLocalNetworkGateway.ts index 2778e19fa3..b95e91dcfb 100644 --- a/sdk/nodejs/network/getLocalNetworkGateway.ts +++ b/sdk/nodejs/network/getLocalNetworkGateway.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Local Network Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getLocalNetworkGateway({ + * name: "existing-local-network-gateway", + * resourceGroupName: "existing-resources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLocalNetworkGateway(args: GetLocalNetworkGatewayArgs, opts?: pulumi.InvokeOptions): Promise { @@ -69,6 +82,19 @@ export interface GetLocalNetworkGatewayResult { } /** * Use this data source to access information about an existing Local Network Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getLocalNetworkGateway({ + * name: "existing-local-network-gateway", + * resourceGroupName: "existing-resources", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getLocalNetworkGatewayOutput(args: GetLocalNetworkGatewayOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getLocalNetworkGateway(a, opts)) diff --git a/sdk/nodejs/network/getNetworkDdosProtectionPlan.ts b/sdk/nodejs/network/getNetworkDdosProtectionPlan.ts index bc0b76c794..f14c870f5f 100644 --- a/sdk/nodejs/network/getNetworkDdosProtectionPlan.ts +++ b/sdk/nodejs/network/getNetworkDdosProtectionPlan.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure Network DDoS Protection Plan. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkDdosProtectionPlan({ + * name: azurerm_network_ddos_protection_plan.example.name, + * resourceGroupName: azurerm_network_ddos_protection_plan.example.resource_group_name, + * }); + * export const ddosProtectionPlanId = example.then(example => example.id); + * ``` */ export function getNetworkDdosProtectionPlan(args: GetNetworkDdosProtectionPlanArgs, opts?: pulumi.InvokeOptions): Promise { @@ -60,6 +73,19 @@ export interface GetNetworkDdosProtectionPlanResult { } /** * Use this data source to access information about an existing Azure Network DDoS Protection Plan. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkDdosProtectionPlan({ + * name: azurerm_network_ddos_protection_plan.example.name, + * resourceGroupName: azurerm_network_ddos_protection_plan.example.resource_group_name, + * }); + * export const ddosProtectionPlanId = example.then(example => example.id); + * ``` */ export function getNetworkDdosProtectionPlanOutput(args: GetNetworkDdosProtectionPlanOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkDdosProtectionPlan(a, opts)) diff --git a/sdk/nodejs/network/getNetworkInterface.ts b/sdk/nodejs/network/getNetworkInterface.ts index f2067ba09e..4910facf2f 100644 --- a/sdk/nodejs/network/getNetworkInterface.ts +++ b/sdk/nodejs/network/getNetworkInterface.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Network Interface. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkInterface({ + * name: "acctest-nic", + * resourceGroupName: "networking", + * }); + * export const networkInterfaceId = example.then(example => example.id); + * ``` */ export function getNetworkInterface(args: GetNetworkInterfaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -100,6 +113,19 @@ export interface GetNetworkInterfaceResult { } /** * Use this data source to access information about an existing Network Interface. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkInterface({ + * name: "acctest-nic", + * resourceGroupName: "networking", + * }); + * export const networkInterfaceId = example.then(example => example.id); + * ``` */ export function getNetworkInterfaceOutput(args: GetNetworkInterfaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkInterface(a, opts)) diff --git a/sdk/nodejs/network/getNetworkSecurityGroup.ts b/sdk/nodejs/network/getNetworkSecurityGroup.ts index 623825d562..a35b413a88 100644 --- a/sdk/nodejs/network/getNetworkSecurityGroup.ts +++ b/sdk/nodejs/network/getNetworkSecurityGroup.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Network Security Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkSecurityGroup({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const location = example.then(example => example.location); + * ``` */ export function getNetworkSecurityGroup(args: GetNetworkSecurityGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -60,6 +73,19 @@ export interface GetNetworkSecurityGroupResult { } /** * Use this data source to access information about an existing Network Security Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkSecurityGroup({ + * name: "example", + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const location = example.then(example => example.location); + * ``` */ export function getNetworkSecurityGroupOutput(args: GetNetworkSecurityGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkSecurityGroup(a, opts)) diff --git a/sdk/nodejs/network/getNetworkWatcher.ts b/sdk/nodejs/network/getNetworkWatcher.ts index 48b5bbfcd1..3bee63deac 100644 --- a/sdk/nodejs/network/getNetworkWatcher.ts +++ b/sdk/nodejs/network/getNetworkWatcher.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Network Watcher. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkWatcher({ + * name: azurerm_network_watcher.example.name, + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const networkWatcherId = example.then(example => example.id); + * ``` */ export function getNetworkWatcher(args: GetNetworkWatcherArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +64,19 @@ export interface GetNetworkWatcherResult { } /** * Use this data source to access information about an existing Network Watcher. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getNetworkWatcher({ + * name: azurerm_network_watcher.example.name, + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const networkWatcherId = example.then(example => example.id); + * ``` */ export function getNetworkWatcherOutput(args: GetNetworkWatcherOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNetworkWatcher(a, opts)) diff --git a/sdk/nodejs/network/getPublicIP.ts b/sdk/nodejs/network/getPublicIP.ts index be8b865590..87fb3185a3 100644 --- a/sdk/nodejs/network/getPublicIP.ts +++ b/sdk/nodejs/network/getPublicIP.ts @@ -8,6 +8,68 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing Public IP Address. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getPublicIP({ + * name: "name_of_public_ip", + * resourceGroupName: "name_of_resource_group", + * }); + * export const domainNameLabel = example.then(example => example.domainNameLabel); + * export const publicIpAddress = example.then(example => example.ipAddress); + * ``` + * ### Retrieve The Dynamic Public IP Of A New VM) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Dynamic", + * idleTimeoutInMinutes: 30, + * tags: { + * environment: "test", + * }, + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Static", + * privateIpAddress: "10.0.2.5", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleVirtualMachine = new azure.compute.VirtualMachine("exampleVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * networkInterfaceIds: [exampleNetworkInterface.id], + * }); + * // ... + * const examplePublicIP = azure.network.getPublicIPOutput({ + * name: examplePublicIp.name, + * resourceGroupName: exampleVirtualMachine.resourceGroupName, + * }); + * export const publicIpAddress = examplePublicIp.ipAddress; + * ``` */ export function getPublicIP(args: GetPublicIPArgs, opts?: pulumi.InvokeOptions): Promise { @@ -103,6 +165,68 @@ export interface GetPublicIPResult { * Use this data source to access information about an existing Public IP Address. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getPublicIP({ + * name: "name_of_public_ip", + * resourceGroupName: "name_of_resource_group", + * }); + * export const domainNameLabel = example.then(example => example.domainNameLabel); + * export const publicIpAddress = example.then(example => example.ipAddress); + * ``` + * ### Retrieve The Dynamic Public IP Of A New VM) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Dynamic", + * idleTimeoutInMinutes: 30, + * tags: { + * environment: "test", + * }, + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Static", + * privateIpAddress: "10.0.2.5", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleVirtualMachine = new azure.compute.VirtualMachine("exampleVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * networkInterfaceIds: [exampleNetworkInterface.id], + * }); + * // ... + * const examplePublicIP = azure.network.getPublicIPOutput({ + * name: examplePublicIp.name, + * resourceGroupName: exampleVirtualMachine.resourceGroupName, + * }); + * export const publicIpAddress = examplePublicIp.ipAddress; + * ``` */ export function getPublicIPOutput(args: GetPublicIPOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPublicIP(a, opts)) diff --git a/sdk/nodejs/network/getPublicIPs.ts b/sdk/nodejs/network/getPublicIPs.ts index f70c982a6d..682deb9014 100644 --- a/sdk/nodejs/network/getPublicIPs.ts +++ b/sdk/nodejs/network/getPublicIPs.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about a set of existing Public IP Addresses. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getPublicIPs({ + * attachmentStatus: "Attached", + * resourceGroupName: "pip-test", + * }); + * ``` */ export function getPublicIPs(args: GetPublicIPsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +73,18 @@ export interface GetPublicIPsResult { } /** * Use this data source to access information about a set of existing Public IP Addresses. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getPublicIPs({ + * attachmentStatus: "Attached", + * resourceGroupName: "pip-test", + * }); + * ``` */ export function getPublicIPsOutput(args: GetPublicIPsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPublicIPs(a, opts)) diff --git a/sdk/nodejs/network/getPublicIpPrefix.ts b/sdk/nodejs/network/getPublicIpPrefix.ts index 6d0a857a12..ff1ef0c350 100644 --- a/sdk/nodejs/network/getPublicIpPrefix.ts +++ b/sdk/nodejs/network/getPublicIpPrefix.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing Public IP Prefix. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getPublicIpPrefix({ + * name: "name_of_public_ip", + * resourceGroupName: "name_of_resource_group", + * }); + * export const publicIpPrefix = example.then(example => example.ipPrefix); + * ``` */ export function getPublicIpPrefix(args: GetPublicIpPrefixArgs, opts?: pulumi.InvokeOptions): Promise { @@ -74,6 +86,18 @@ export interface GetPublicIpPrefixResult { * Use this data source to access information about an existing Public IP Prefix. * * ## Example Usage + * ### Reference An Existing) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getPublicIpPrefix({ + * name: "name_of_public_ip", + * resourceGroupName: "name_of_resource_group", + * }); + * export const publicIpPrefix = example.then(example => example.ipPrefix); + * ``` */ export function getPublicIpPrefixOutput(args: GetPublicIpPrefixOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPublicIpPrefix(a, opts)) diff --git a/sdk/nodejs/network/getRouteFilter.ts b/sdk/nodejs/network/getRouteFilter.ts index 23a7f89166..67ecc331ce 100644 --- a/sdk/nodejs/network/getRouteFilter.ts +++ b/sdk/nodejs/network/getRouteFilter.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Route Filter. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getRouteFilter({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getRouteFilter(args: GetRouteFilterArgs, opts?: pulumi.InvokeOptions): Promise { @@ -60,6 +73,19 @@ export interface GetRouteFilterResult { } /** * Use this data source to access information about an existing Route Filter. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getRouteFilter({ + * name: "existing", + * resourceGroupName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getRouteFilterOutput(args: GetRouteFilterOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRouteFilter(a, opts)) diff --git a/sdk/nodejs/network/getRouteTable.ts b/sdk/nodejs/network/getRouteTable.ts index c2af571720..b9bde635d9 100644 --- a/sdk/nodejs/network/getRouteTable.ts +++ b/sdk/nodejs/network/getRouteTable.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Route Table. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getRouteTable({ + * name: "myroutetable", + * resourceGroupName: "some-resource-group", + * }); + * ``` */ export function getRouteTable(args: GetRouteTableArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +80,18 @@ export interface GetRouteTableResult { } /** * Use this data source to access information about an existing Route Table. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getRouteTable({ + * name: "myroutetable", + * resourceGroupName: "some-resource-group", + * }); + * ``` */ export function getRouteTableOutput(args: GetRouteTableOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getRouteTable(a, opts)) diff --git a/sdk/nodejs/network/getServiceTags.ts b/sdk/nodejs/network/getServiceTags.ts index d1a51e2a99..beaf485de6 100644 --- a/sdk/nodejs/network/getServiceTags.ts +++ b/sdk/nodejs/network/getServiceTags.ts @@ -6,6 +6,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about Service Tags. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getServiceTags({ + * location: "westcentralus", + * service: "AzureKeyVault", + * locationFilter: "northeurope", + * }); + * export const addressPrefixes = example.then(example => example.addressPrefixes); + * export const ipv4Cidrs = example.then(example => example.ipv4Cidrs); + * ``` */ export function getServiceTags(args: GetServiceTagsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +80,21 @@ export interface GetServiceTagsResult { } /** * Use this data source to access information about Service Tags. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getServiceTags({ + * location: "westcentralus", + * service: "AzureKeyVault", + * locationFilter: "northeurope", + * }); + * export const addressPrefixes = example.then(example => example.addressPrefixes); + * export const ipv4Cidrs = example.then(example => example.ipv4Cidrs); + * ``` */ export function getServiceTagsOutput(args: GetServiceTagsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getServiceTags(a, opts)) diff --git a/sdk/nodejs/network/getSubnet.ts b/sdk/nodejs/network/getSubnet.ts index b2c7bfd4f0..d9e0d2714a 100644 --- a/sdk/nodejs/network/getSubnet.ts +++ b/sdk/nodejs/network/getSubnet.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Subnet within a Virtual Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getSubnet({ + * name: "backend", + * virtualNetworkName: "production", + * resourceGroupName: "networking", + * }); + * export const subnetId = example.then(example => example.id); + * ``` */ export function getSubnet(args: GetSubnetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -76,6 +90,20 @@ export interface GetSubnetResult { } /** * Use this data source to access information about an existing Subnet within a Virtual Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getSubnet({ + * name: "backend", + * virtualNetworkName: "production", + * resourceGroupName: "networking", + * }); + * export const subnetId = example.then(example => example.id); + * ``` */ export function getSubnetOutput(args: GetSubnetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSubnet(a, opts)) diff --git a/sdk/nodejs/network/getTrafficManager.ts b/sdk/nodejs/network/getTrafficManager.ts index 8045599300..b8db1c5e40 100644 --- a/sdk/nodejs/network/getTrafficManager.ts +++ b/sdk/nodejs/network/getTrafficManager.ts @@ -8,6 +8,17 @@ import * as utilities from "../utilities"; * Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. * * ## Example Usage + * ### World) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getTrafficManager({ + * name: "World", + * }); + * export const locationCode = example.then(example => example.id); + * ``` */ export function getTrafficManager(args: GetTrafficManagerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -41,6 +52,17 @@ export interface GetTrafficManagerResult { * Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. * * ## Example Usage + * ### World) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getTrafficManager({ + * name: "World", + * }); + * export const locationCode = example.then(example => example.id); + * ``` */ export function getTrafficManagerOutput(args: GetTrafficManagerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTrafficManager(a, opts)) diff --git a/sdk/nodejs/network/getTrafficManagerProfile.ts b/sdk/nodejs/network/getTrafficManagerProfile.ts index 3adeb36106..299a052720 100644 --- a/sdk/nodejs/network/getTrafficManagerProfile.ts +++ b/sdk/nodejs/network/getTrafficManagerProfile.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Traffic Manager Profile. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getTrafficManagerProfile({ + * name: "test", + * resourceGroupName: "test", + * }); + * export const trafficRoutingMethod = example.then(example => example.trafficRoutingMethod); + * ``` */ export function getTrafficManagerProfile(args: GetTrafficManagerProfileArgs, opts?: pulumi.InvokeOptions): Promise { @@ -86,6 +99,19 @@ export interface GetTrafficManagerProfileResult { } /** * Use this data source to access information about an existing Traffic Manager Profile. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getTrafficManagerProfile({ + * name: "test", + * resourceGroupName: "test", + * }); + * export const trafficRoutingMethod = example.then(example => example.trafficRoutingMethod); + * ``` */ export function getTrafficManagerProfileOutput(args: GetTrafficManagerProfileOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTrafficManagerProfile(a, opts)) diff --git a/sdk/nodejs/network/getVirtualHub.ts b/sdk/nodejs/network/getVirtualHub.ts index 47b5c342ff..d088686048 100644 --- a/sdk/nodejs/network/getVirtualHub.ts +++ b/sdk/nodejs/network/getVirtualHub.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing Virtual Hub. + * + * ## Virtual Hub Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualHub({ + * name: "example-hub", + * resourceGroupName: "example-resources", + * }); + * export const virtualHubId = example.then(example => example.id); + * ``` */ export function getVirtualHub(args: GetVirtualHubArgs, opts?: pulumi.InvokeOptions): Promise { @@ -71,6 +84,19 @@ export interface GetVirtualHubResult { } /** * Uses this data source to access information about an existing Virtual Hub. + * + * ## Virtual Hub Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualHub({ + * name: "example-hub", + * resourceGroupName: "example-resources", + * }); + * export const virtualHubId = example.then(example => example.id); + * ``` */ export function getVirtualHubOutput(args: GetVirtualHubOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualHub(a, opts)) diff --git a/sdk/nodejs/network/getVirtualHubConnection.ts b/sdk/nodejs/network/getVirtualHubConnection.ts index 35d26e0a43..7c2f477571 100644 --- a/sdk/nodejs/network/getVirtualHubConnection.ts +++ b/sdk/nodejs/network/getVirtualHubConnection.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing Virtual Hub Connection. + * + * ## Virtual Hub Connection Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualHubConnection({ + * name: "example-connection", + * resourceGroupName: "example-resources", + * virtualHubName: "example-hub-name", + * }); + * export const virtualHubConnectionId = example.then(example => example.id); + * ``` */ export function getVirtualHubConnection(args: GetVirtualHubConnectionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -70,6 +84,20 @@ export interface GetVirtualHubConnectionResult { } /** * Uses this data source to access information about an existing Virtual Hub Connection. + * + * ## Virtual Hub Connection Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualHubConnection({ + * name: "example-connection", + * resourceGroupName: "example-resources", + * virtualHubName: "example-hub-name", + * }); + * export const virtualHubConnectionId = example.then(example => example.id); + * ``` */ export function getVirtualHubConnectionOutput(args: GetVirtualHubConnectionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualHubConnection(a, opts)) diff --git a/sdk/nodejs/network/getVirtualHubRouteTable.ts b/sdk/nodejs/network/getVirtualHubRouteTable.ts index 99c32c0297..ffaeacad82 100644 --- a/sdk/nodejs/network/getVirtualHubRouteTable.ts +++ b/sdk/nodejs/network/getVirtualHubRouteTable.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Uses this data source to access information about an existing Virtual Hub Route Table. + * + * ## Virtual Hub Route Table Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualHubRouteTable({ + * name: "example-hub-route-table", + * resourceGroupName: "example-resources", + * virtualHubName: "example-hub-name", + * }); + * export const virtualHubRouteTableId = example.then(example => example.id); + * ``` */ export function getVirtualHubRouteTable(args: GetVirtualHubRouteTableArgs, opts?: pulumi.InvokeOptions): Promise { @@ -66,6 +80,20 @@ export interface GetVirtualHubRouteTableResult { } /** * Uses this data source to access information about an existing Virtual Hub Route Table. + * + * ## Virtual Hub Route Table Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualHubRouteTable({ + * name: "example-hub-route-table", + * resourceGroupName: "example-resources", + * virtualHubName: "example-hub-name", + * }); + * export const virtualHubRouteTableId = example.then(example => example.id); + * ``` */ export function getVirtualHubRouteTableOutput(args: GetVirtualHubRouteTableOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualHubRouteTable(a, opts)) diff --git a/sdk/nodejs/network/getVirtualNetwork.ts b/sdk/nodejs/network/getVirtualNetwork.ts index c669163b2a..a28a42211e 100644 --- a/sdk/nodejs/network/getVirtualNetwork.ts +++ b/sdk/nodejs/network/getVirtualNetwork.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Virtual Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualNetwork({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualNetworkId = example.then(example => example.id); + * ``` */ export function getVirtualNetwork(args: GetVirtualNetworkArgs, opts?: pulumi.InvokeOptions): Promise { @@ -75,6 +88,19 @@ export interface GetVirtualNetworkResult { } /** * Use this data source to access information about an existing Virtual Network. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualNetwork({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualNetworkId = example.then(example => example.id); + * ``` */ export function getVirtualNetworkOutput(args: GetVirtualNetworkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualNetwork(a, opts)) diff --git a/sdk/nodejs/network/getVirtualNetworkGateway.ts b/sdk/nodejs/network/getVirtualNetworkGateway.ts index cdd42e32fa..2dd143c2f9 100644 --- a/sdk/nodejs/network/getVirtualNetworkGateway.ts +++ b/sdk/nodejs/network/getVirtualNetworkGateway.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Virtual Network Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualNetworkGateway({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualNetworkGatewayId = example.then(example => example.id); + * ``` */ export function getVirtualNetworkGateway(args: GetVirtualNetworkGatewayArgs, opts?: pulumi.InvokeOptions): Promise { @@ -102,6 +115,19 @@ export interface GetVirtualNetworkGatewayResult { } /** * Use this data source to access information about an existing Virtual Network Gateway. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVirtualNetworkGateway({ + * name: "production", + * resourceGroupName: "networking", + * }); + * export const virtualNetworkGatewayId = example.then(example => example.id); + * ``` */ export function getVirtualNetworkGatewayOutput(args: GetVirtualNetworkGatewayOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualNetworkGateway(a, opts)) diff --git a/sdk/nodejs/network/getVpnGateway.ts b/sdk/nodejs/network/getVpnGateway.ts index 0ecedcd83b..4b23e76cf6 100644 --- a/sdk/nodejs/network/getVpnGateway.ts +++ b/sdk/nodejs/network/getVpnGateway.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing VPN Gateway within a Virtual Hub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVpnGateway({ + * name: "existing-local-vpn_gateway", + * resourceGroupName: "existing-vpn_gateway", + * }); + * export const azurermVpnGatewayId = example.then(example => example.id); + * ``` */ export function getVpnGateway(args: GetVpnGatewayArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetVpnGatewayResult { } /** * Use this data source to access information about an existing VPN Gateway within a Virtual Hub. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getVpnGateway({ + * name: "existing-local-vpn_gateway", + * resourceGroupName: "existing-vpn_gateway", + * }); + * export const azurermVpnGatewayId = example.then(example => example.id); + * ``` */ export function getVpnGatewayOutput(args: GetVpnGatewayOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVpnGateway(a, opts)) diff --git a/sdk/nodejs/network/ipgroup.ts b/sdk/nodejs/network/ipgroup.ts index 6b8a47115e..7d142d6175 100644 --- a/sdk/nodejs/network/ipgroup.ts +++ b/sdk/nodejs/network/ipgroup.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages an IP group that contains a list of CIDRs and/or IP addresses. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIPGroup = new azure.network.IPGroup("exampleIPGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * cidrs: [ + * "192.168.0.1", + * "172.16.240.0/20", + * "10.48.0.0/12", + * ], + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * IP Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/ipgroupCIDR.ts b/sdk/nodejs/network/ipgroupCIDR.ts index 71f3af348e..c6b2981224 100644 --- a/sdk/nodejs/network/ipgroupCIDR.ts +++ b/sdk/nodejs/network/ipgroupCIDR.ts @@ -11,6 +11,23 @@ import * as utilities from "../utilities"; * `azure.network.IPGroup` resource for the same IP Group. Doing so will cause a conflict and * CIDRS will be removed. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleIPGroup = new azure.network.IPGroup("exampleIPGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleIPGroupCIDR = new azure.network.IPGroupCIDR("exampleIPGroupCIDR", { + * ipGroupId: exampleIPGroup.id, + * cidr: "10.10.10.0/24", + * }); + * ``` + * * ## Import * * IP Group CIDRs can be imported using the `resource id` of the IP Group and the CIDR value (`/` characters have to be replaced by `_`), e.g. diff --git a/sdk/nodejs/network/localNetworkGateway.ts b/sdk/nodejs/network/localNetworkGateway.ts index c9c24524c0..0a5883842c 100644 --- a/sdk/nodejs/network/localNetworkGateway.ts +++ b/sdk/nodejs/network/localNetworkGateway.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; /** * Manages a local network gateway connection over which specific connections can be configured. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const home = new azure.network.LocalNetworkGateway("home", { + * resourceGroupName: example.name, + * location: example.location, + * gatewayAddress: "12.13.14.15", + * addressSpaces: ["10.0.0.0/16"], + * }); + * ``` + * * ## Import * * Local Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/natGateway.ts b/sdk/nodejs/network/natGateway.ts index c24af92800..fd9f20f9d0 100644 --- a/sdk/nodejs/network/natGateway.ts +++ b/sdk/nodejs/network/natGateway.ts @@ -7,6 +7,24 @@ import * as utilities from "../utilities"; /** * Manages an Azure NAT Gateway. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNatGateway = new azure.network.NatGateway("exampleNatGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * idleTimeoutInMinutes: 10, + * zones: ["1"], + * }); + * ``` + * + * For more complete examples, please see the azure.network.NatGatewayPublicIpAssociation and azure.network.NatGatewayPublicIpPrefixAssociation resources. + * * ## Import * * NAT Gateway can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/natGatewayPublicIpAssociation.ts b/sdk/nodejs/network/natGatewayPublicIpAssociation.ts index fccd199b53..caf298dca4 100644 --- a/sdk/nodejs/network/natGatewayPublicIpAssociation.ts +++ b/sdk/nodejs/network/natGatewayPublicIpAssociation.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages the association between a NAT Gateway and a Public IP. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleNatGateway = new azure.network.NatGateway("exampleNatGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleNatGatewayPublicIpAssociation = new azure.network.NatGatewayPublicIpAssociation("exampleNatGatewayPublicIpAssociation", { + * natGatewayId: exampleNatGateway.id, + * publicIpAddressId: examplePublicIp.id, + * }); + * ``` + * * ## Import * * Associations between NAT Gateway and Public IP Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/natGatewayPublicIpPrefixAssociation.ts b/sdk/nodejs/network/natGatewayPublicIpPrefixAssociation.ts index f15266cfc5..6302403ccc 100644 --- a/sdk/nodejs/network/natGatewayPublicIpPrefixAssociation.ts +++ b/sdk/nodejs/network/natGatewayPublicIpPrefixAssociation.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages the association between a NAT Gateway and a Public IP Prefix. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIpPrefix = new azure.network.PublicIpPrefix("examplePublicIpPrefix", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * prefixLength: 30, + * zones: ["1"], + * }); + * const exampleNatGateway = new azure.network.NatGateway("exampleNatGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * }); + * const exampleNatGatewayPublicIpPrefixAssociation = new azure.network.NatGatewayPublicIpPrefixAssociation("exampleNatGatewayPublicIpPrefixAssociation", { + * natGatewayId: exampleNatGateway.id, + * publicIpPrefixId: examplePublicIpPrefix.id, + * }); + * ``` + * * ## Import * * Associations between NAT Gateway and Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkConnectionMonitor.ts b/sdk/nodejs/network/networkConnectionMonitor.ts index e4d5731c70..a9cf79262a 100644 --- a/sdk/nodejs/network/networkConnectionMonitor.ts +++ b/sdk/nodejs/network/networkConnectionMonitor.ts @@ -11,6 +11,115 @@ import * as utilities from "../utilities"; * * > **NOTE:** Any Network Connection Monitor resource created with API versions 2019-06-01 or earlier (v1) are now incompatible with this provider, which now only supports v2. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkWatcher = new azure.network.NetworkWatcher("exampleNetworkWatcher", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleVirtualMachine = new azure.compute.VirtualMachine("exampleVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * networkInterfaceIds: [exampleNetworkInterface.id], + * vmSize: "Standard_D2s_v3", + * storageImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * storageOsDisk: { + * name: "osdisk-example01", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Standard_LRS", + * }, + * osProfile: { + * computerName: "hostnametest01", + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: false, + * }, + * }); + * const exampleExtension = new azure.compute.Extension("exampleExtension", { + * virtualMachineId: exampleVirtualMachine.id, + * publisher: "Microsoft.Azure.NetworkWatcher", + * type: "NetworkWatcherAgentLinux", + * typeHandlerVersion: "1.4", + * autoUpgradeMinorVersion: true, + * }); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleNetworkConnectionMonitor = new azure.network.NetworkConnectionMonitor("exampleNetworkConnectionMonitor", { + * networkWatcherId: exampleNetworkWatcher.id, + * location: exampleNetworkWatcher.location, + * endpoints: [ + * { + * name: "source", + * targetResourceId: exampleVirtualMachine.id, + * filter: { + * items: [{ + * address: exampleVirtualMachine.id, + * type: "AgentAddress", + * }], + * type: "Include", + * }, + * }, + * { + * name: "destination", + * address: "mycompany.io", + * }, + * ], + * testConfigurations: [{ + * name: "tcpName", + * protocol: "Tcp", + * testFrequencyInSeconds: 60, + * tcpConfiguration: { + * port: 80, + * }, + * }], + * testGroups: [{ + * name: "exampletg", + * destinationEndpoints: ["destination"], + * sourceEndpoints: ["source"], + * testConfigurationNames: ["tcpName"], + * }], + * notes: "examplenote", + * outputWorkspaceResourceIds: [exampleAnalyticsWorkspace.id], + * }, { + * dependsOn: [exampleExtension], + * }); + * ``` + * * ## Import * * Network Connection Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkInterface.ts b/sdk/nodejs/network/networkInterface.ts index 0dc52f02bc..d3055ff148 100644 --- a/sdk/nodejs/network/networkInterface.ts +++ b/sdk/nodejs/network/networkInterface.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages a Network Interface. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "internal", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * ``` + * * ## Import * * Network Interfaces can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkInterfaceApplicationSecurityGroupAssociation.ts b/sdk/nodejs/network/networkInterfaceApplicationSecurityGroupAssociation.ts index 1213266fe5..4be60192f7 100644 --- a/sdk/nodejs/network/networkInterfaceApplicationSecurityGroupAssociation.ts +++ b/sdk/nodejs/network/networkInterfaceApplicationSecurityGroupAssociation.ts @@ -7,6 +7,42 @@ import * as utilities from "../utilities"; /** * Manages the association between a Network Interface and a Application Security Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const exampleApplicationSecurityGroup = new azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleNetworkInterfaceApplicationSecurityGroupAssociation = new azure.network.NetworkInterfaceApplicationSecurityGroupAssociation("exampleNetworkInterfaceApplicationSecurityGroupAssociation", { + * networkInterfaceId: exampleNetworkInterface.id, + * applicationSecurityGroupId: exampleApplicationSecurityGroup.id, + * }); + * ``` + * * ## Import * * Associations between Network Interfaces and Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkInterfaceBackendAddressPoolAssociation.ts b/sdk/nodejs/network/networkInterfaceBackendAddressPoolAssociation.ts index 139ad0f732..e19b29eacb 100644 --- a/sdk/nodejs/network/networkInterfaceBackendAddressPoolAssociation.ts +++ b/sdk/nodejs/network/networkInterfaceBackendAddressPoolAssociation.ts @@ -7,6 +7,53 @@ import * as utilities from "../utilities"; /** * Manages the association between a Network Interface and a Load Balancer's Backend Address Pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "primary", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleBackendAddressPool = new azure.lb.BackendAddressPool("exampleBackendAddressPool", {loadbalancerId: exampleLoadBalancer.id}); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleNetworkInterfaceBackendAddressPoolAssociation = new azure.network.NetworkInterfaceBackendAddressPoolAssociation("exampleNetworkInterfaceBackendAddressPoolAssociation", { + * networkInterfaceId: exampleNetworkInterface.id, + * ipConfigurationName: "testconfiguration1", + * backendAddressPoolId: exampleBackendAddressPool.id, + * }); + * ``` + * * ## Import * * Associations between Network Interfaces and Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkInterfaceNatRuleAssociation.ts b/sdk/nodejs/network/networkInterfaceNatRuleAssociation.ts index 16014c4bcd..73a11c5118 100644 --- a/sdk/nodejs/network/networkInterfaceNatRuleAssociation.ts +++ b/sdk/nodejs/network/networkInterfaceNatRuleAssociation.ts @@ -7,6 +7,60 @@ import * as utilities from "../utilities"; /** * Manages the association between a Network Interface and a Load Balancer's NAT Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: "primary", + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleNatRule = new azure.lb.NatRule("exampleNatRule", { + * resourceGroupName: exampleResourceGroup.name, + * loadbalancerId: exampleLoadBalancer.id, + * protocol: "Tcp", + * frontendPort: 3389, + * backendPort: 3389, + * frontendIpConfigurationName: "primary", + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleNetworkInterfaceNatRuleAssociation = new azure.network.NetworkInterfaceNatRuleAssociation("exampleNetworkInterfaceNatRuleAssociation", { + * networkInterfaceId: exampleNetworkInterface.id, + * ipConfigurationName: "testconfiguration1", + * natRuleId: exampleNatRule.id, + * }); + * ``` + * * ## Import * * Associations between Network Interfaces and Load Balancer NAT Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkInterfaceSecurityGroupAssociation.ts b/sdk/nodejs/network/networkInterfaceSecurityGroupAssociation.ts index dd4a8e1e59..2c175dfc98 100644 --- a/sdk/nodejs/network/networkInterfaceSecurityGroupAssociation.ts +++ b/sdk/nodejs/network/networkInterfaceSecurityGroupAssociation.ts @@ -7,6 +7,42 @@ import * as utilities from "../utilities"; /** * Manages the association between a Network Interface and a Network Security Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleNetworkInterfaceSecurityGroupAssociation = new azure.network.NetworkInterfaceSecurityGroupAssociation("exampleNetworkInterfaceSecurityGroupAssociation", { + * networkInterfaceId: exampleNetworkInterface.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * ``` + * * ## Import * * Associations between Network Interfaces and Network Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManager.ts b/sdk/nodejs/network/networkManager.ts index cc723c0c66..1bbade0551 100644 --- a/sdk/nodejs/network/networkManager.ts +++ b/sdk/nodejs/network/networkManager.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Network Managers. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: [ + * "Connectivity", + * "SecurityAdmin", + * ], + * description: "example network manager", + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Network Managers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerAdminRule.ts b/sdk/nodejs/network/networkManagerAdminRule.ts index 5a4fefcf6d..0c7229f96b 100644 --- a/sdk/nodejs/network/networkManagerAdminRule.ts +++ b/sdk/nodejs/network/networkManagerAdminRule.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; /** * Manages a Network Manager Admin Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: [ + * "Connectivity", + * "SecurityAdmin", + * ], + * description: "example network manager", + * }); + * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", {networkManagerId: exampleNetworkManager.id}); + * const exampleNetworkManagerSecurityAdminConfiguration = new azure.network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", {networkManagerId: exampleNetworkManager.id}); + * const exampleNetworkManagerAdminRuleCollection = new azure.network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", { + * securityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.id, + * networkGroupIds: [exampleNetworkManagerNetworkGroup.id], + * }); + * const exampleNetworkManagerAdminRule = new azure.network.NetworkManagerAdminRule("exampleNetworkManagerAdminRule", { + * adminRuleCollectionId: exampleNetworkManagerAdminRuleCollection.id, + * action: "Deny", + * direction: "Outbound", + * priority: 1, + * protocol: "Tcp", + * sourcePortRanges: [ + * "80", + * "1024-65535", + * ], + * destinationPortRanges: ["80"], + * sources: [{ + * addressPrefixType: "ServiceTag", + * addressPrefix: "Internet", + * }], + * destinations: [ + * { + * addressPrefixType: "IPPrefix", + * addressPrefix: "10.1.0.1", + * }, + * { + * addressPrefixType: "IPPrefix", + * addressPrefix: "10.0.0.0/24", + * }, + * ], + * description: "example admin rule", + * }); + * ``` + * * ## Import * * Network Manager Admin Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerAdminRuleCollection.ts b/sdk/nodejs/network/networkManagerAdminRuleCollection.ts index f26ca70bf8..36a0774010 100644 --- a/sdk/nodejs/network/networkManagerAdminRuleCollection.ts +++ b/sdk/nodejs/network/networkManagerAdminRuleCollection.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a Network Manager Admin Rule Collection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: [ + * "Connectivity", + * "SecurityAdmin", + * ], + * description: "example network manager", + * }); + * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", {networkManagerId: exampleNetworkManager.id}); + * const exampleNetworkManagerSecurityAdminConfiguration = new azure.network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", {networkManagerId: exampleNetworkManager.id}); + * const exampleNetworkManagerAdminRuleCollection = new azure.network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", { + * securityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.id, + * networkGroupIds: [exampleNetworkManagerNetworkGroup.id], + * }); + * ``` + * * ## Import * * Network Manager Admin Rule Collection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerConnectivityConfiguration.ts b/sdk/nodejs/network/networkManagerConnectivityConfiguration.ts index 355aa74248..234817d310 100644 --- a/sdk/nodejs/network/networkManagerConnectivityConfiguration.ts +++ b/sdk/nodejs/network/networkManagerConnectivityConfiguration.ts @@ -11,6 +11,47 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.network.NetworkManagerConnectivityConfiguration` deployment may modify or delete existing Network Peering resource. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: [ + * "Connectivity", + * "SecurityAdmin", + * ], + * description: "example network manager", + * }); + * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", {networkManagerId: exampleNetworkManager.id}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * flowTimeoutInMinutes: 10, + * }); + * const exampleNetworkManagerConnectivityConfiguration = new azure.network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", { + * networkManagerId: exampleNetworkManager.id, + * connectivityTopology: "HubAndSpoke", + * appliesToGroups: [{ + * groupConnectivity: "DirectlyConnected", + * networkGroupId: exampleNetworkManagerNetworkGroup.id, + * }], + * hub: { + * resourceId: exampleVirtualNetwork.id, + * resourceType: "Microsoft.Network/virtualNetworks", + * }, + * }); + * ``` + * * ## Import * * Network Manager Connectivity Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerDeployment.ts b/sdk/nodejs/network/networkManagerDeployment.ts index 4f8326fa85..bd0ecaad67 100644 --- a/sdk/nodejs/network/networkManagerDeployment.ts +++ b/sdk/nodejs/network/networkManagerDeployment.ts @@ -9,6 +9,53 @@ import * as utilities from "../utilities"; * * > **NOTE on Virtual Network Peering:** Using Network Manager Deployment to deploy Connectivity Configuration may modify or delete existing Virtual Network Peering. At this time you should not use Network Peering resource in conjunction with Network Manager Deployment. Doing so may cause a conflict of Peering configurations. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: [ + * "Connectivity", + * "SecurityAdmin", + * ], + * description: "example network manager", + * }); + * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", {networkManagerId: exampleNetworkManager.id}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * flowTimeoutInMinutes: 10, + * }); + * const exampleNetworkManagerConnectivityConfiguration = new azure.network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", { + * networkManagerId: exampleNetworkManager.id, + * connectivityTopology: "HubAndSpoke", + * appliesToGroups: [{ + * groupConnectivity: "None", + * networkGroupId: exampleNetworkManagerNetworkGroup.id, + * }], + * hub: { + * resourceId: exampleVirtualNetwork.id, + * resourceType: "Microsoft.Network/virtualNetworks", + * }, + * }); + * const exampleNetworkManagerDeployment = new azure.network.NetworkManagerDeployment("exampleNetworkManagerDeployment", { + * networkManagerId: exampleNetworkManager.id, + * location: "eastus", + * scopeAccess: "Connectivity", + * configurationIds: [exampleNetworkManagerConnectivityConfiguration.id], + * }); + * ``` + * * ## Import * * Network Manager Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerManagementGroupConnection.ts b/sdk/nodejs/network/networkManagerManagementGroupConnection.ts index 9581a1de00..d690369b0b 100644 --- a/sdk/nodejs/network/networkManagerManagementGroupConnection.ts +++ b/sdk/nodejs/network/networkManagerManagementGroupConnection.ts @@ -7,6 +7,45 @@ import * as utilities from "../utilities"; /** * Manages a Network Manager Management Group Connection which may cross tenants. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleGroup = new azure.management.Group("exampleGroup", {}); + * const alt = azure.core.getSubscription({ + * subscriptionId: "00000000-0000-0000-0000-000000000000", + * }); + * const exampleGroupSubscriptionAssociation = new azure.management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", { + * managementGroupId: exampleGroup.id, + * subscriptionId: alt.then(alt => alt.id), + * }); + * const currentSubscription = azure.core.getSubscription({}); + * const currentClientConfig = azure.core.getClientConfig({}); + * const networkContributor = new azure.authorization.Assignment("networkContributor", { + * scope: exampleGroup.id, + * roleDefinitionName: "Network Contributor", + * principalId: currentClientConfig.then(currentClientConfig => currentClientConfig.objectId), + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [currentSubscription.then(currentSubscription => currentSubscription.id)], + * }, + * scopeAccesses: ["SecurityAdmin"], + * }); + * const exampleNetworkManagerManagementGroupConnection = new azure.network.NetworkManagerManagementGroupConnection("exampleNetworkManagerManagementGroupConnection", { + * managementGroupId: exampleGroup.id, + * networkManagerId: exampleNetworkManager.id, + * description: "example", + * }, { + * dependsOn: [networkContributor], + * }); + * ``` + * * ## Import * * Network Manager Management Group Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerNetworkGroup.ts b/sdk/nodejs/network/networkManagerNetworkGroup.ts index 1e6b4e1d1b..9c8a455ce6 100644 --- a/sdk/nodejs/network/networkManagerNetworkGroup.ts +++ b/sdk/nodejs/network/networkManagerNetworkGroup.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a Network Manager Network Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: [ + * "Connectivity", + * "SecurityAdmin", + * ], + * description: "example network manager", + * }); + * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", {networkManagerId: exampleNetworkManager.id}); + * ``` + * * ## Import * * Network Manager Network Group can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerScopeConnection.ts b/sdk/nodejs/network/networkManagerScopeConnection.ts index 1b221565b4..7ed874fdac 100644 --- a/sdk/nodejs/network/networkManagerScopeConnection.ts +++ b/sdk/nodejs/network/networkManagerScopeConnection.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a Network Manager Scope Connection which may cross tenants. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const currentClientConfig = azure.core.getClientConfig({}); + * const currentSubscription = azure.core.getSubscription({}); + * const alt = azure.core.getSubscription({ + * subscriptionId: "00000000-0000-0000-0000-000000000000", + * }); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [currentSubscription.then(currentSubscription => currentSubscription.id)], + * }, + * scopeAccesses: ["SecurityAdmin"], + * }); + * const exampleNetworkManagerScopeConnection = new azure.network.NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", { + * networkManagerId: exampleNetworkManager.id, + * tenantId: currentClientConfig.then(currentClientConfig => currentClientConfig.tenantId), + * targetScopeId: alt.then(alt => alt.id), + * description: "example", + * }); + * ``` + * * ## Import * * Network Manager Scope Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerStaticMember.ts b/sdk/nodejs/network/networkManagerStaticMember.ts index 4ec7969f05..0e989ef35d 100644 --- a/sdk/nodejs/network/networkManagerStaticMember.ts +++ b/sdk/nodejs/network/networkManagerStaticMember.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages a Network Manager Static Member. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: [ + * "Connectivity", + * "SecurityAdmin", + * ], + * description: "example network manager", + * }); + * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", { + * networkManagerId: exampleNetworkManager.id, + * description: "example network group", + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["192.168.1.0/24"], + * location: exampleResourceGroup.location, + * }); + * const exampleNetworkManagerStaticMember = new azure.network.NetworkManagerStaticMember("exampleNetworkManagerStaticMember", { + * networkGroupId: exampleNetworkManagerNetworkGroup.id, + * targetVirtualNetworkId: exampleVirtualNetwork.id, + * }); + * ``` + * * ## Import * * Network Manager Static Member can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkManagerSubscriptionConnection.ts b/sdk/nodejs/network/networkManagerSubscriptionConnection.ts index caa42ead01..e0788395d0 100644 --- a/sdk/nodejs/network/networkManagerSubscriptionConnection.ts +++ b/sdk/nodejs/network/networkManagerSubscriptionConnection.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a Network Manager Subscription Connection which may cross tenants. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const current = azure.core.getSubscription({}); + * const exampleNetworkManager = new azure.network.NetworkManager("exampleNetworkManager", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * scope: { + * subscriptionIds: [current.then(current => current.id)], + * }, + * scopeAccesses: ["SecurityAdmin"], + * }); + * const exampleNetworkManagerSubscriptionConnection = new azure.network.NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", { + * subscriptionId: current.then(current => current.id), + * networkManagerId: exampleNetworkManager.id, + * description: "example", + * }); + * ``` + * * ## Import * * Network Subscription Network Manager Connection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkPacketCapture.ts b/sdk/nodejs/network/networkPacketCapture.ts index cd7284f20e..86e61c1b94 100644 --- a/sdk/nodejs/network/networkPacketCapture.ts +++ b/sdk/nodejs/network/networkPacketCapture.ts @@ -11,6 +11,89 @@ import * as utilities from "../utilities"; * * !> **NOTE:** The `azure.network.NetworkPacketCapture` resource is deprecated and will be removed in favour of `azure.compute.PacketCapture` and `azure.compute.ScaleSetPacketCapture` in version 4.0 of the AzureRM Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkWatcher = new azure.network.NetworkWatcher("exampleNetworkWatcher", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "testconfiguration1", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleVirtualMachine = new azure.compute.VirtualMachine("exampleVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * networkInterfaceIds: [exampleNetworkInterface.id], + * vmSize: "Standard_F2", + * storageImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * storageOsDisk: { + * name: "osdisk", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Standard_LRS", + * }, + * osProfile: { + * computerName: "pctest-vm", + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: false, + * }, + * }); + * const exampleExtension = new azure.compute.Extension("exampleExtension", { + * virtualMachineId: exampleVirtualMachine.id, + * publisher: "Microsoft.Azure.NetworkWatcher", + * type: "NetworkWatcherAgentLinux", + * typeHandlerVersion: "1.4", + * autoUpgradeMinorVersion: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleNetworkPacketCapture = new azure.network.NetworkPacketCapture("exampleNetworkPacketCapture", { + * networkWatcherName: exampleNetworkWatcher.name, + * resourceGroupName: exampleResourceGroup.name, + * targetResourceId: exampleVirtualMachine.id, + * storageLocation: { + * storageAccountId: exampleAccount.id, + * }, + * }, { + * dependsOn: [exampleExtension], + * }); + * ``` + * + * > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `azure.compute.Extension` resource. + * * ## Import * * Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkSecurityGroup.ts b/sdk/nodejs/network/networkSecurityGroup.ts index 7ce5e78612..a333c6e11e 100644 --- a/sdk/nodejs/network/networkSecurityGroup.ts +++ b/sdk/nodejs/network/networkSecurityGroup.ts @@ -13,6 +13,33 @@ import * as utilities from "../utilities"; * provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. * At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * securityRules: [{ + * name: "test123", + * priority: 100, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * }], + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Network Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkSecurityRule.ts b/sdk/nodejs/network/networkSecurityRule.ts index 7fc7fa31e0..ab5eea5484 100644 --- a/sdk/nodejs/network/networkSecurityRule.ts +++ b/sdk/nodejs/network/networkSecurityRule.ts @@ -11,6 +11,31 @@ import * as utilities from "../utilities"; * provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. * At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleNetworkSecurityRule = new azure.network.NetworkSecurityRule("exampleNetworkSecurityRule", { + * priority: 100, + * direction: "Outbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * ``` + * * ## Import * * Network Security Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkWatcher.ts b/sdk/nodejs/network/networkWatcher.ts index 0f2e89c495..0b7ea7e4c6 100644 --- a/sdk/nodejs/network/networkWatcher.ts +++ b/sdk/nodejs/network/networkWatcher.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Network Watcher. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkWatcher = new azure.network.NetworkWatcher("exampleNetworkWatcher", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` + * * ## Import * * Network Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/networkWatcherFlowLog.ts b/sdk/nodejs/network/networkWatcherFlowLog.ts index 37c01205bd..26c54e51a2 100644 --- a/sdk/nodejs/network/networkWatcherFlowLog.ts +++ b/sdk/nodejs/network/networkWatcherFlowLog.ts @@ -7,6 +7,54 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const testNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("testNetworkSecurityGroup", { + * location: example.location, + * resourceGroupName: example.name, + * }); + * const testNetworkWatcher = new azure.network.NetworkWatcher("testNetworkWatcher", { + * location: example.location, + * resourceGroupName: example.name, + * }); + * const testAccount = new azure.storage.Account("testAccount", { + * resourceGroupName: example.name, + * location: example.location, + * accountTier: "Standard", + * accountKind: "StorageV2", + * accountReplicationType: "LRS", + * enableHttpsTrafficOnly: true, + * }); + * const testAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("testAnalyticsWorkspace", { + * location: example.location, + * resourceGroupName: example.name, + * sku: "PerGB2018", + * }); + * const testNetworkWatcherFlowLog = new azure.network.NetworkWatcherFlowLog("testNetworkWatcherFlowLog", { + * networkWatcherName: testNetworkWatcher.name, + * resourceGroupName: example.name, + * networkSecurityGroupId: testNetworkSecurityGroup.id, + * storageAccountId: testAccount.id, + * enabled: true, + * retentionPolicy: { + * enabled: true, + * days: 7, + * }, + * trafficAnalytics: { + * enabled: true, + * workspaceId: testAnalyticsWorkspace.workspaceId, + * workspaceRegion: testAnalyticsWorkspace.location, + * workspaceResourceId: testAnalyticsWorkspace.id, + * intervalInMinutes: 10, + * }, + * }); + * ``` + * * ## Import * * Network Watcher Flow Logs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/pointToPointVpnGateway.ts b/sdk/nodejs/network/pointToPointVpnGateway.ts index 8e22b1a633..71b773f70b 100644 --- a/sdk/nodejs/network/pointToPointVpnGateway.ts +++ b/sdk/nodejs/network/pointToPointVpnGateway.ts @@ -9,6 +9,67 @@ import * as utilities from "../utilities"; /** * Manages a Point-to-Site VPN Gateway. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.0.0/23", + * }); + * const exampleVpnServerConfiguration = new azure.network.VpnServerConfiguration("exampleVpnServerConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * vpnAuthenticationTypes: ["Certificate"], + * clientRootCertificates: [{ + * name: "DigiCert-Federated-ID-Root-CA", + * publicCertData: `MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + * MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + * d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + * Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + * BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + * Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + * MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + * QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + * zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + * GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + * GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + * Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + * DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + * HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + * jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + * 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + * QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + * uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + * WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + * M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + * `, + * }], + * }); + * const examplePointToPointVpnGateway = new azure.network.PointToPointVpnGateway("examplePointToPointVpnGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * virtualHubId: exampleVirtualHub.id, + * vpnServerConfigurationId: exampleVpnServerConfiguration.id, + * scaleUnit: 1, + * connectionConfiguration: { + * name: "example-gateway-config", + * vpnClientAddressPool: { + * addressPrefixes: ["10.0.2.0/24"], + * }, + * }, + * }); + * ``` + * * ## Import * * Point-to-Site VPN Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/profile.ts b/sdk/nodejs/network/profile.ts index e22631362e..03e7c6be80 100644 --- a/sdk/nodejs/network/profile.ts +++ b/sdk/nodejs/network/profile.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; /** * Manages a Network Profile. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.1.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.1.0.0/24"], + * delegations: [{ + * name: "delegation", + * serviceDelegation: { + * name: "Microsoft.ContainerInstance/containerGroups", + * actions: ["Microsoft.Network/virtualNetworks/subnets/action"], + * }, + * }], + * }); + * const exampleProfile = new azure.network.Profile("exampleProfile", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * containerNetworkInterface: { + * name: "examplecnic", + * ipConfigurations: [{ + * name: "exampleipconfig", + * subnetId: exampleSubnet.id, + * }], + * }, + * }); + * ``` + * * ## Import * * Network Profile can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/publicIp.ts b/sdk/nodejs/network/publicIp.ts index 1230d55f00..681d2ba859 100644 --- a/sdk/nodejs/network/publicIp.ts +++ b/sdk/nodejs/network/publicIp.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; * * > **Note** If this resource is to be associated with a resource that requires disassociation before destruction (such as `azure.network.NetworkInterface`) it is recommended to set the `lifecycle` argument `createBeforeDestroy = true`. Otherwise, it can fail to disassociate on destruction. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allocationMethod: "Static", + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Public IPs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/publicIpPrefix.ts b/sdk/nodejs/network/publicIpPrefix.ts index bb45a50404..981e6d0814 100644 --- a/sdk/nodejs/network/publicIpPrefix.ts +++ b/sdk/nodejs/network/publicIpPrefix.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Public IP Prefix. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIpPrefix = new azure.network.PublicIpPrefix("examplePublicIpPrefix", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * prefixLength: 31, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/route.ts b/sdk/nodejs/network/route.ts index 2797c39b55..7a14a3bf94 100644 --- a/sdk/nodejs/network/route.ts +++ b/sdk/nodejs/network/route.ts @@ -11,6 +11,25 @@ import * as utilities from "../utilities"; * provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource. * At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleRoute = new azure.network.Route("exampleRoute", { + * resourceGroupName: exampleResourceGroup.name, + * routeTableName: exampleRouteTable.name, + * addressPrefix: "10.1.0.0/16", + * nextHopType: "VnetLocal", + * }); + * ``` + * * ## Import * * Routes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/routeFilter.ts b/sdk/nodejs/network/routeFilter.ts index f797fbf92f..ba18d57b76 100644 --- a/sdk/nodejs/network/routeFilter.ts +++ b/sdk/nodejs/network/routeFilter.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages a Route Filter. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.network.RouteFilter("example", { + * location: "East US", + * resourceGroupName: "example", + * rule: { + * access: "Allow", + * communities: ["12076:52004"], + * name: "rule", + * ruleType: "Community", + * }, + * }); + * ``` + * * ## Import * * Route Filters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/routeMap.ts b/sdk/nodejs/network/routeMap.ts index aeceac32e0..f1dd1e0d11 100644 --- a/sdk/nodejs/network/routeMap.ts +++ b/sdk/nodejs/network/routeMap.ts @@ -9,6 +9,42 @@ import * as utilities from "../utilities"; /** * Manages a Route Map. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.1.0/24", + * }); + * const exampleRouteMap = new azure.network.RouteMap("exampleRouteMap", { + * virtualHubId: exampleVirtualHub.id, + * rules: [{ + * name: "rule1", + * nextStepIfMatched: "Continue", + * actions: [{ + * type: "Add", + * parameters: [{ + * asPaths: ["22334"], + * }], + * }], + * matchCriterions: [{ + * matchCondition: "Contains", + * routePrefixes: ["10.0.0.0/8"], + * }], + * }], + * }); + * ``` + * * ## Import * * Route Maps can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/routeServer.ts b/sdk/nodejs/network/routeServer.ts index 07b944fb84..09f85c3f57 100644 --- a/sdk/nodejs/network/routeServer.ts +++ b/sdk/nodejs/network/routeServer.ts @@ -7,6 +7,42 @@ import * as utilities from "../utilities"; /** * Manages an Azure Route Server * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * virtualNetworkName: exampleVirtualNetwork.name, + * resourceGroupName: exampleResourceGroup.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleRouteServer = new azure.network.RouteServer("exampleRouteServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard", + * publicIpAddressId: examplePublicIp.id, + * subnetId: exampleSubnet.id, + * branchToBranchTrafficEnabled: true, + * }); + * ``` + * * ## Import * * Route Server can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/routeServerBgpConnection.ts b/sdk/nodejs/network/routeServerBgpConnection.ts index 0cad684c2e..c416241bb3 100644 --- a/sdk/nodejs/network/routeServerBgpConnection.ts +++ b/sdk/nodejs/network/routeServerBgpConnection.ts @@ -7,6 +7,47 @@ import * as utilities from "../utilities"; /** * Manages a Bgp Connection for a Route Server * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * virtualNetworkName: exampleVirtualNetwork.name, + * resourceGroupName: exampleResourceGroup.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleRouteServer = new azure.network.RouteServer("exampleRouteServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard", + * publicIpAddressId: examplePublicIp.id, + * subnetId: exampleSubnet.id, + * branchToBranchTrafficEnabled: true, + * }); + * const exampleRouteServerBgpConnection = new azure.network.RouteServerBgpConnection("exampleRouteServerBgpConnection", { + * routeServerId: exampleRouteServer.id, + * peerAsn: 65501, + * peerIp: "169.254.21.5", + * }); + * ``` + * * ## Import * * Route Server Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/routeTable.ts b/sdk/nodejs/network/routeTable.ts index 403e2769c5..c7c10e74b3 100644 --- a/sdk/nodejs/network/routeTable.ts +++ b/sdk/nodejs/network/routeTable.ts @@ -12,6 +12,28 @@ import * as utilities from "../utilities"; * > **NOTE on Route Tables and Routes:** There is both a standalone `route` resource, and allows for Routes to be defined in-line within the `routeTable` resource. * At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * disableBgpRoutePropagation: false, + * routes: [{ + * name: "route1", + * addressPrefix: "10.1.0.0/16", + * nextHopType: "VnetLocal", + * }], + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/routingIntent.ts b/sdk/nodejs/network/routingIntent.ts index 0ee91e6ddc..ecda95c422 100644 --- a/sdk/nodejs/network/routingIntent.ts +++ b/sdk/nodejs/network/routingIntent.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Hub Routing Intent. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.1.0/24", + * }); + * const exampleFirewall = new azure.network.Firewall("exampleFirewall", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "AZFW_Hub", + * skuTier: "Standard", + * virtualHub: { + * virtualHubId: exampleVirtualHub.id, + * publicIpCount: 1, + * }, + * }); + * const exampleRoutingIntent = new azure.network.RoutingIntent("exampleRoutingIntent", { + * virtualHubId: exampleVirtualHub.id, + * routingPolicies: [{ + * name: "InternetTrafficPolicy", + * destinations: ["Internet"], + * nextHop: exampleFirewall.id, + * }], + * }); + * ``` + * * ## Import * * Virtual Hub Routing Intents can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/securityPartnerProvider.ts b/sdk/nodejs/network/securityPartnerProvider.ts index bbd9232087..8fbf135b07 100644 --- a/sdk/nodejs/network/securityPartnerProvider.ts +++ b/sdk/nodejs/network/securityPartnerProvider.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages a Security Partner Provider which could be associated to virtual hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.2.0/24", + * }); + * const exampleVpnGateway = new azure.network.VpnGateway("exampleVpnGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * virtualHubId: exampleVirtualHub.id, + * }); + * const exampleSecurityPartnerProvider = new azure.network.SecurityPartnerProvider("exampleSecurityPartnerProvider", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualHubId: exampleVirtualHub.id, + * securityProviderName: "IBoss", + * tags: { + * ENV: "Prod", + * }, + * }, { + * dependsOn: [exampleVpnGateway], + * }); + * ``` + * * ## Import * * Security Partner Providers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/subnet.ts b/sdk/nodejs/network/subnet.ts index 4a21edec9f..f9b6580b6c 100644 --- a/sdk/nodejs/network/subnet.ts +++ b/sdk/nodejs/network/subnet.ts @@ -13,6 +13,35 @@ import * as utilities from "../utilities"; * provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource. * At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnets. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * delegations: [{ + * name: "delegation", + * serviceDelegation: { + * name: "Microsoft.ContainerInstance/containerGroups", + * actions: [ + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + * ], + * }, + * }], + * }); + * ``` + * * ## Import * * Subnets can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/subnetNatGatewayAssociation.ts b/sdk/nodejs/network/subnetNatGatewayAssociation.ts index 7590a5a395..ee617d92d1 100644 --- a/sdk/nodejs/network/subnetNatGatewayAssociation.ts +++ b/sdk/nodejs/network/subnetNatGatewayAssociation.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Associates a NAT Gateway with a Subnet within a Virtual Network. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNatGateway = new azure.network.NatGateway("exampleNatGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnetNatGatewayAssociation = new azure.network.SubnetNatGatewayAssociation("exampleSubnetNatGatewayAssociation", { + * subnetId: exampleSubnet.id, + * natGatewayId: exampleNatGateway.id, + * }); + * ``` + * * ## Import * * Subnet NAT Gateway Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/nodejs/network/subnetNetworkSecurityGroupAssociation.ts b/sdk/nodejs/network/subnetNetworkSecurityGroupAssociation.ts index 8b4f1965b6..ecd19d16ec 100644 --- a/sdk/nodejs/network/subnetNetworkSecurityGroupAssociation.ts +++ b/sdk/nodejs/network/subnetNetworkSecurityGroupAssociation.ts @@ -7,6 +7,44 @@ import * as utilities from "../utilities"; /** * Associates a Network Security Group with a Subnet within a Virtual Network. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * securityRules: [{ + * name: "test123", + * priority: 100, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * }], + * }); + * const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", { + * subnetId: exampleSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * ``` + * * ## Import * * Subnet `<->` Network Security Group Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/nodejs/network/subnetRouteTableAssociation.ts b/sdk/nodejs/network/subnetRouteTableAssociation.ts index d8a011709c..96b5bc4936 100644 --- a/sdk/nodejs/network/subnetRouteTableAssociation.ts +++ b/sdk/nodejs/network/subnetRouteTableAssociation.ts @@ -7,6 +7,39 @@ import * as utilities from "../utilities"; /** * Associates a Route Table with a Subnet within a Virtual Network. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * routes: [{ + * name: "example", + * addressPrefix: "10.100.0.0/14", + * nextHopType: "VirtualAppliance", + * nextHopInIpAddress: "10.10.1.1", + * }], + * }); + * const exampleSubnetRouteTableAssociation = new azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", { + * subnetId: exampleSubnet.id, + * routeTableId: exampleRouteTable.id, + * }); + * ``` + * * ## Import * * Subnet Route Table Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/nodejs/network/trafficManagerAzureEndpoint.ts b/sdk/nodejs/network/trafficManagerAzureEndpoint.ts index 3ca5472d77..b782a5cb75 100644 --- a/sdk/nodejs/network/trafficManagerAzureEndpoint.ts +++ b/sdk/nodejs/network/trafficManagerAzureEndpoint.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages an Azure Endpoint within a Traffic Manager Profile. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * domainNameLabel: "example-public-ip", + * }); + * const exampleTrafficManagerProfile = new azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", { + * resourceGroupName: exampleResourceGroup.name, + * trafficRoutingMethod: "Weighted", + * dnsConfig: { + * relativeName: "example-profile", + * ttl: 100, + * }, + * monitorConfig: { + * protocol: "HTTP", + * port: 80, + * path: "/", + * intervalInSeconds: 30, + * timeoutInSeconds: 9, + * toleratedNumberOfFailures: 3, + * }, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleTrafficManagerAzureEndpoint = new azure.network.TrafficManagerAzureEndpoint("exampleTrafficManagerAzureEndpoint", { + * profileId: exampleTrafficManagerProfile.id, + * weight: 100, + * targetResourceId: examplePublicIp.id, + * }); + * ``` + * * ## Import * * Azure Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/trafficManagerExternalEndpoint.ts b/sdk/nodejs/network/trafficManagerExternalEndpoint.ts index ba6353dad7..d9d5bb175d 100644 --- a/sdk/nodejs/network/trafficManagerExternalEndpoint.ts +++ b/sdk/nodejs/network/trafficManagerExternalEndpoint.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages an External Endpoint within a Traffic Manager Profile. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTrafficManagerProfile = new azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", { + * resourceGroupName: exampleResourceGroup.name, + * trafficRoutingMethod: "Weighted", + * dnsConfig: { + * relativeName: "example-profile", + * ttl: 100, + * }, + * monitorConfig: { + * protocol: "HTTP", + * port: 80, + * path: "/", + * intervalInSeconds: 30, + * timeoutInSeconds: 9, + * toleratedNumberOfFailures: 3, + * }, + * tags: { + * environment: "Production", + * }, + * }); + * const exampleTrafficManagerExternalEndpoint = new azure.network.TrafficManagerExternalEndpoint("exampleTrafficManagerExternalEndpoint", { + * profileId: exampleTrafficManagerProfile.id, + * weight: 100, + * target: "www.example.com", + * }); + * ``` + * * ## Import * * External Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/trafficManagerNestedEndpoint.ts b/sdk/nodejs/network/trafficManagerNestedEndpoint.ts index 3ef85c4bcc..73bfef80f9 100644 --- a/sdk/nodejs/network/trafficManagerNestedEndpoint.ts +++ b/sdk/nodejs/network/trafficManagerNestedEndpoint.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; /** * Manages a Nested Endpoint within a Traffic Manager Profile. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * domainNameLabel: "example-pip", + * }); + * const parent = new azure.network.TrafficManagerProfile("parent", { + * resourceGroupName: exampleResourceGroup.name, + * trafficRoutingMethod: "Weighted", + * dnsConfig: { + * relativeName: "parent-profile", + * ttl: 100, + * }, + * monitorConfig: { + * protocol: "HTTP", + * port: 80, + * path: "/", + * intervalInSeconds: 30, + * timeoutInSeconds: 9, + * toleratedNumberOfFailures: 3, + * }, + * tags: { + * environment: "Production", + * }, + * }); + * const nested = new azure.network.TrafficManagerProfile("nested", { + * resourceGroupName: exampleResourceGroup.name, + * trafficRoutingMethod: "Priority", + * dnsConfig: { + * relativeName: "nested-profile", + * ttl: 30, + * }, + * monitorConfig: { + * protocol: "HTTP", + * port: 443, + * path: "/", + * }, + * }); + * const exampleTrafficManagerNestedEndpoint = new azure.network.TrafficManagerNestedEndpoint("exampleTrafficManagerNestedEndpoint", { + * targetResourceId: nested.id, + * priority: 1, + * profileId: parent.id, + * minimumChildEndpoints: 9, + * weight: 5, + * }); + * ``` + * * ## Import * * Nested Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/trafficManagerProfile.ts b/sdk/nodejs/network/trafficManagerProfile.ts index 69dd9999da..7aedec76ec 100644 --- a/sdk/nodejs/network/trafficManagerProfile.ts +++ b/sdk/nodejs/network/trafficManagerProfile.ts @@ -9,6 +9,41 @@ import * as utilities from "../utilities"; /** * Manages a Traffic Manager Profile to which multiple endpoints can be attached. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const server = new random.RandomId("server", { + * keepers: { + * azi_id: 1, + * }, + * byteLength: 8, + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTrafficManagerProfile = new azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", { + * resourceGroupName: exampleResourceGroup.name, + * trafficRoutingMethod: "Weighted", + * dnsConfig: { + * relativeName: server.hex, + * ttl: 100, + * }, + * monitorConfig: { + * protocol: "HTTP", + * port: 80, + * path: "/", + * intervalInSeconds: 30, + * timeoutInSeconds: 9, + * toleratedNumberOfFailures: 3, + * }, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualHub.ts b/sdk/nodejs/network/virtualHub.ts index 93f898bebb..ab4db1d7a1 100644 --- a/sdk/nodejs/network/virtualHub.ts +++ b/sdk/nodejs/network/virtualHub.ts @@ -9,6 +9,25 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Hub within a Virtual WAN. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.0.0/23", + * }); + * ``` + * * ## Import * * Virtual Hub's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualHubConnection.ts b/sdk/nodejs/network/virtualHubConnection.ts index 79dce3326b..0a6a019d33 100644 --- a/sdk/nodejs/network/virtualHubConnection.ts +++ b/sdk/nodejs/network/virtualHubConnection.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Manages a Connection for a Virtual Hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["172.16.0.0/12"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.1.0/24", + * }); + * const exampleVirtualHubConnection = new azure.network.VirtualHubConnection("exampleVirtualHubConnection", { + * virtualHubId: exampleVirtualHub.id, + * remoteVirtualNetworkId: exampleVirtualNetwork.id, + * }); + * ``` + * * ## Import * * Virtual Hub Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualHubIp.ts b/sdk/nodejs/network/virtualHubIp.ts index f28579c23d..19616e0523 100644 --- a/sdk/nodejs/network/virtualHubIp.ts +++ b/sdk/nodejs/network/virtualHubIp.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; * * > **NOTE** Virtual Hub IP only supports Standard Virtual Hub without Virtual Wan. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard", + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.5.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.1.0/24"], + * }); + * const exampleVirtualHubIp = new azure.network.VirtualHubIp("exampleVirtualHubIp", { + * virtualHubId: exampleVirtualHub.id, + * privateIpAddress: "10.5.1.18", + * privateIpAllocationMethod: "Static", + * publicIpAddressId: examplePublicIp.id, + * subnetId: exampleSubnet.id, + * }); + * ``` + * * ## Import * * Virtual Hub IPs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualHubRouteTable.ts b/sdk/nodejs/network/virtualHubRouteTable.ts index ffe88d4893..7cd237f165 100644 --- a/sdk/nodejs/network/virtualHubRouteTable.ts +++ b/sdk/nodejs/network/virtualHubRouteTable.ts @@ -9,6 +9,58 @@ import * as utilities from "../utilities"; /** * Manages a Virtual Hub Route Table. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.5.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.1.0/24"], + * }); + * const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", { + * subnetId: exampleSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.2.0/24", + * }); + * const exampleVirtualHubConnection = new azure.network.VirtualHubConnection("exampleVirtualHubConnection", { + * virtualHubId: exampleVirtualHub.id, + * remoteVirtualNetworkId: exampleVirtualNetwork.id, + * }); + * const exampleVirtualHubRouteTable = new azure.network.VirtualHubRouteTable("exampleVirtualHubRouteTable", { + * virtualHubId: exampleVirtualHub.id, + * labels: ["label1"], + * routes: [{ + * name: "example-route", + * destinationsType: "CIDR", + * destinations: ["10.0.0.0/16"], + * nextHopType: "ResourceId", + * nextHop: exampleVirtualHubConnection.id, + * }], + * }); + * ``` + * * ## Import * * Virtual Hub Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualHubRouteTableRoute.ts b/sdk/nodejs/network/virtualHubRouteTableRoute.ts index 4584da8bc4..5eb3029786 100644 --- a/sdk/nodejs/network/virtualHubRouteTableRoute.ts +++ b/sdk/nodejs/network/virtualHubRouteTableRoute.ts @@ -9,6 +9,61 @@ import * as utilities from "../utilities"; * * > **Note:** Route table routes can managed with this resource, or in-line with the virtualHubRouteTable resource. Using both is not supported. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.5.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.1.0/24"], + * }); + * const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", { + * subnetId: exampleSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.2.0/24", + * }); + * const exampleVirtualHubRouteTable = new azure.network.VirtualHubRouteTable("exampleVirtualHubRouteTable", { + * virtualHubId: exampleVirtualHub.id, + * labels: ["label1"], + * }); + * const exampleVirtualHubConnection = new azure.network.VirtualHubConnection("exampleVirtualHubConnection", { + * virtualHubId: exampleVirtualHub.id, + * remoteVirtualNetworkId: exampleVirtualNetwork.id, + * routing: { + * associatedRouteTableId: exampleVirtualHubRouteTable.id, + * }, + * }); + * const exampleVirtualHubRouteTableRoute = new azure.network.VirtualHubRouteTableRoute("exampleVirtualHubRouteTableRoute", { + * routeTableId: exampleVirtualHubRouteTable.id, + * destinationsType: "CIDR", + * destinations: ["10.0.0.0/16"], + * nextHopType: "ResourceId", + * nextHop: exampleVirtualHubConnection.id, + * }); + * ``` + * * ## Import * * Virtual Hub Route Table Routes can be imported using `/routes/`, e.g. diff --git a/sdk/nodejs/network/virtualNetwork.ts b/sdk/nodejs/network/virtualNetwork.ts index 9aacda9b17..8651d7d8e1 100644 --- a/sdk/nodejs/network/virtualNetwork.ts +++ b/sdk/nodejs/network/virtualNetwork.ts @@ -16,6 +16,42 @@ import * as utilities from "../utilities"; * **NOTE on Virtual Networks and DNS Servers:** This provider currently provides both a standalone virtual network DNS Servers resource, and allows for DNS servers to be defined in-line within the Virtual Network resource. * At this time you cannot use a Virtual Network with in-line DNS servers in conjunction with any Virtual Network DNS Servers resources. Doing so will cause a conflict of Virtual Network DNS Servers configurations and will overwrite virtual networks DNS servers. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * dnsServers: [ + * "10.0.0.4", + * "10.0.0.5", + * ], + * subnets: [ + * { + * name: "subnet1", + * addressPrefix: "10.0.1.0/24", + * }, + * { + * name: "subnet2", + * addressPrefix: "10.0.2.0/24", + * securityGroup: exampleNetworkSecurityGroup.id, + * }, + * ], + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualNetworkDnsServers.ts b/sdk/nodejs/network/virtualNetworkDnsServers.ts index d1f0d30b74..8664d37fef 100644 --- a/sdk/nodejs/network/virtualNetworkDnsServers.ts +++ b/sdk/nodejs/network/virtualNetworkDnsServers.ts @@ -5,6 +5,32 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * subnets: [{ + * name: "subnet1", + * addressPrefix: "10.0.1.0/24", + * }], + * }); + * const exampleVirtualNetworkDnsServers = new azure.network.VirtualNetworkDnsServers("exampleVirtualNetworkDnsServers", { + * virtualNetworkId: exampleVirtualNetwork.id, + * dnsServers: [ + * "10.7.7.2", + * "10.7.7.7", + * "10.7.7.1", + * ], + * }); + * ``` + * * ## Import * * Virtual Network DNS Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualNetworkGateway.ts b/sdk/nodejs/network/virtualNetworkGateway.ts index 05749e9421..175c6a5b6a 100644 --- a/sdk/nodejs/network/virtualNetworkGateway.ts +++ b/sdk/nodejs/network/virtualNetworkGateway.ts @@ -11,6 +11,76 @@ import * as utilities from "../utilities"; * * > **Note:** Please be aware that provisioning a Virtual Network Gateway takes a long time (between 30 minutes and 1 hour) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Dynamic", + * }); + * const exampleVirtualNetworkGateway = new azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * type: "Vpn", + * vpnType: "RouteBased", + * activeActive: false, + * enableBgp: false, + * sku: "Basic", + * ipConfigurations: [{ + * name: "vnetGatewayConfig", + * publicIpAddressId: examplePublicIp.id, + * privateIpAddressAllocation: "Dynamic", + * subnetId: exampleSubnet.id, + * }], + * vpnClientConfiguration: { + * addressSpaces: ["10.2.0.0/24"], + * rootCertificates: [{ + * name: "DigiCert-Federated-ID-Root-CA", + * publicCertData: `MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + * MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + * d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + * Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + * BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + * Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + * MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + * QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + * zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + * GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + * GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + * Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + * DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + * HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + * jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + * 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + * QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + * uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + * WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + * M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + * `, + * }], + * revokedCertificates: [{ + * name: "Verizon-Global-Root-CA", + * thumbprint: "912198EEF23DCAC40939312FEE97DD560BAE49B1", + * }], + * }, + * }); + * ``` + * * ## Import * * Virtual Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/virtualNetworkGatewayConnection.ts b/sdk/nodejs/network/virtualNetworkGatewayConnection.ts index f2c552a9fb..83e091801e 100644 --- a/sdk/nodejs/network/virtualNetworkGatewayConnection.ts +++ b/sdk/nodejs/network/virtualNetworkGatewayConnection.ts @@ -10,6 +10,142 @@ import * as utilities from "../utilities"; * Manages a connection in an existing Virtual Network Gateway. * * ## Example Usage + * ### Site-to-Site connection + * + * The following example shows a connection between an Azure virtual network + * and an on-premises VPN device and network. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const onpremiseLocalNetworkGateway = new azure.network.LocalNetworkGateway("onpremiseLocalNetworkGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * gatewayAddress: "168.62.225.23", + * addressSpaces: ["10.1.1.0/24"], + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Dynamic", + * }); + * const exampleVirtualNetworkGateway = new azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * type: "Vpn", + * vpnType: "RouteBased", + * activeActive: false, + * enableBgp: false, + * sku: "Basic", + * ipConfigurations: [{ + * publicIpAddressId: examplePublicIp.id, + * privateIpAddressAllocation: "Dynamic", + * subnetId: exampleSubnet.id, + * }], + * }); + * const onpremiseVirtualNetworkGatewayConnection = new azure.network.VirtualNetworkGatewayConnection("onpremiseVirtualNetworkGatewayConnection", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * type: "IPsec", + * virtualNetworkGatewayId: exampleVirtualNetworkGateway.id, + * localNetworkGatewayId: onpremiseLocalNetworkGateway.id, + * sharedKey: "4-v3ry-53cr37-1p53c-5h4r3d-k3y", + * }); + * ``` + * ### VNet-to-VNet connection + * + * The following example shows a connection between two Azure virtual network + * in different locations/regions. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const usResourceGroup = new azure.core.ResourceGroup("usResourceGroup", {location: "East US"}); + * const usVirtualNetwork = new azure.network.VirtualNetwork("usVirtualNetwork", { + * location: usResourceGroup.location, + * resourceGroupName: usResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const usGateway = new azure.network.Subnet("usGateway", { + * resourceGroupName: usResourceGroup.name, + * virtualNetworkName: usVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * }); + * const usPublicIp = new azure.network.PublicIp("usPublicIp", { + * location: usResourceGroup.location, + * resourceGroupName: usResourceGroup.name, + * allocationMethod: "Dynamic", + * }); + * const usVirtualNetworkGateway = new azure.network.VirtualNetworkGateway("usVirtualNetworkGateway", { + * location: usResourceGroup.location, + * resourceGroupName: usResourceGroup.name, + * type: "Vpn", + * vpnType: "RouteBased", + * sku: "Basic", + * ipConfigurations: [{ + * publicIpAddressId: usPublicIp.id, + * privateIpAddressAllocation: "Dynamic", + * subnetId: usGateway.id, + * }], + * }); + * const europeResourceGroup = new azure.core.ResourceGroup("europeResourceGroup", {location: "West Europe"}); + * const europeVirtualNetwork = new azure.network.VirtualNetwork("europeVirtualNetwork", { + * location: europeResourceGroup.location, + * resourceGroupName: europeResourceGroup.name, + * addressSpaces: ["10.1.0.0/16"], + * }); + * const europeGateway = new azure.network.Subnet("europeGateway", { + * resourceGroupName: europeResourceGroup.name, + * virtualNetworkName: europeVirtualNetwork.name, + * addressPrefixes: ["10.1.1.0/24"], + * }); + * const europePublicIp = new azure.network.PublicIp("europePublicIp", { + * location: europeResourceGroup.location, + * resourceGroupName: europeResourceGroup.name, + * allocationMethod: "Dynamic", + * }); + * const europeVirtualNetworkGateway = new azure.network.VirtualNetworkGateway("europeVirtualNetworkGateway", { + * location: europeResourceGroup.location, + * resourceGroupName: europeResourceGroup.name, + * type: "Vpn", + * vpnType: "RouteBased", + * sku: "Basic", + * ipConfigurations: [{ + * publicIpAddressId: europePublicIp.id, + * privateIpAddressAllocation: "Dynamic", + * subnetId: europeGateway.id, + * }], + * }); + * const usToEurope = new azure.network.VirtualNetworkGatewayConnection("usToEurope", { + * location: usResourceGroup.location, + * resourceGroupName: usResourceGroup.name, + * type: "Vnet2Vnet", + * virtualNetworkGatewayId: usVirtualNetworkGateway.id, + * peerVirtualNetworkGatewayId: europeVirtualNetworkGateway.id, + * sharedKey: "4-v3ry-53cr37-1p53c-5h4r3d-k3y", + * }); + * const europeToUs = new azure.network.VirtualNetworkGatewayConnection("europeToUs", { + * location: europeResourceGroup.location, + * resourceGroupName: europeResourceGroup.name, + * type: "Vnet2Vnet", + * virtualNetworkGatewayId: europeVirtualNetworkGateway.id, + * peerVirtualNetworkGatewayId: usVirtualNetworkGateway.id, + * sharedKey: "4-v3ry-53cr37-1p53c-5h4r3d-k3y", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/network/virtualNetworkPeering.ts b/sdk/nodejs/network/virtualNetworkPeering.ts index 1bd277de68..20f124f28c 100644 --- a/sdk/nodejs/network/virtualNetworkPeering.ts +++ b/sdk/nodejs/network/virtualNetworkPeering.ts @@ -8,6 +8,34 @@ import * as utilities from "../utilities"; * Manages a virtual network peering which allows resources to access other * resources in the linked virtual network. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const example_1VirtualNetwork = new azure.network.VirtualNetwork("example-1VirtualNetwork", { + * resourceGroupName: example.name, + * addressSpaces: ["10.0.1.0/24"], + * location: example.location, + * }); + * const example_2VirtualNetwork = new azure.network.VirtualNetwork("example-2VirtualNetwork", { + * resourceGroupName: example.name, + * addressSpaces: ["10.0.2.0/24"], + * location: example.location, + * }); + * const example_1VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-1VirtualNetworkPeering", { + * resourceGroupName: example.name, + * virtualNetworkName: example_1VirtualNetwork.name, + * remoteVirtualNetworkId: example_2VirtualNetwork.id, + * }); + * const example_2VirtualNetworkPeering = new azure.network.VirtualNetworkPeering("example-2VirtualNetworkPeering", { + * resourceGroupName: example.name, + * virtualNetworkName: example_2VirtualNetwork.name, + * remoteVirtualNetworkId: example_1VirtualNetwork.id, + * }); + * ``` * ## Note * * Virtual Network peerings cannot be created, updated or deleted concurrently. diff --git a/sdk/nodejs/network/virtualWan.ts b/sdk/nodejs/network/virtualWan.ts index ccb2945d78..37a6d70b43 100644 --- a/sdk/nodejs/network/virtualWan.ts +++ b/sdk/nodejs/network/virtualWan.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Virtual WAN. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Virtual WAN can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/vnpGatewayNatRule.ts b/sdk/nodejs/network/vnpGatewayNatRule.ts index 910de11df1..5a9dda84c6 100644 --- a/sdk/nodejs/network/vnpGatewayNatRule.ts +++ b/sdk/nodejs/network/vnpGatewayNatRule.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; /** * Manages a VPN Gateway NAT Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressPrefix: "10.0.1.0/24", + * virtualWanId: exampleVirtualWan.id, + * }); + * const exampleVpnGateway = new azure.network.VpnGateway("exampleVpnGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * virtualHubId: exampleVirtualHub.id, + * }); + * const exampleVnpGatewayNatRule = new azure.network.VnpGatewayNatRule("exampleVnpGatewayNatRule", { + * resourceGroupName: exampleResourceGroup.name, + * vpnGatewayId: exampleVpnGateway.id, + * externalMappings: [{ + * addressSpace: "192.168.21.0/26", + * }], + * internalMappings: [{ + * addressSpace: "10.4.0.0/26", + * }], + * }); + * ``` + * * ## Import * * VPN Gateway NAT Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/vpnGateway.ts b/sdk/nodejs/network/vpnGateway.ts index f2790c8047..e8d2900162 100644 --- a/sdk/nodejs/network/vpnGateway.ts +++ b/sdk/nodejs/network/vpnGateway.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a VPN Gateway within a Virtual Hub, which enables Site-to-Site communication. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.1.0/24", + * }); + * const exampleVpnGateway = new azure.network.VpnGateway("exampleVpnGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * virtualHubId: exampleVirtualHub.id, + * }); + * ``` + * * ## Import * * VPN Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/vpnGatewayConnection.ts b/sdk/nodejs/network/vpnGatewayConnection.ts index 70abd79bd1..5efa3f3f6d 100644 --- a/sdk/nodejs/network/vpnGatewayConnection.ts +++ b/sdk/nodejs/network/vpnGatewayConnection.ts @@ -9,6 +9,59 @@ import * as utilities from "../utilities"; /** * Manages a VPN Gateway Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVirtualHub = new azure.network.VirtualHub("exampleVirtualHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressPrefix: "10.0.0.0/24", + * }); + * const exampleVpnGateway = new azure.network.VpnGateway("exampleVpnGateway", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * virtualHubId: exampleVirtualHub.id, + * }); + * const exampleVpnSite = new azure.network.VpnSite("exampleVpnSite", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * virtualWanId: exampleVirtualWan.id, + * links: [ + * { + * name: "link1", + * ipAddress: "10.1.0.0", + * }, + * { + * name: "link2", + * ipAddress: "10.2.0.0", + * }, + * ], + * }); + * const exampleVpnGatewayConnection = new azure.network.VpnGatewayConnection("exampleVpnGatewayConnection", { + * vpnGatewayId: exampleVpnGateway.id, + * remoteVpnSiteId: exampleVpnSite.id, + * vpnLinks: [ + * { + * name: "link1", + * vpnSiteLinkId: exampleVpnSite.links.apply(links => links?.[0]?.id), + * }, + * { + * name: "link2", + * vpnSiteLinkId: exampleVpnSite.links.apply(links => links?.[1]?.id), + * }, + * ], + * }); + * ``` + * * ## Import * * VPN Gateway Connections can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/vpnServerConfiguration.ts b/sdk/nodejs/network/vpnServerConfiguration.ts index 0ae2901fcc..9aac994656 100644 --- a/sdk/nodejs/network/vpnServerConfiguration.ts +++ b/sdk/nodejs/network/vpnServerConfiguration.ts @@ -9,6 +9,44 @@ import * as utilities from "../utilities"; /** * Manages a VPN Server Configuration. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const test = new azure.network.VpnServerConfiguration("test", { + * resourceGroupName: example.name, + * location: example.location, + * vpnAuthenticationTypes: ["Certificate"], + * clientRootCertificates: [{ + * name: "DigiCert-Federated-ID-Root-CA", + * publicCertData: `MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + * MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + * d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + * Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + * BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + * Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + * MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + * QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + * zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + * GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + * GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + * Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + * DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + * HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + * jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + * 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + * QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + * uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + * WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + * M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + * `, + * }], + * }); + * ``` + * * ## Import * * VPN Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/vpnServerConfigurationPolicyGroup.ts b/sdk/nodejs/network/vpnServerConfigurationPolicyGroup.ts index 6b51b9bf19..3297471bea 100644 --- a/sdk/nodejs/network/vpnServerConfigurationPolicyGroup.ts +++ b/sdk/nodejs/network/vpnServerConfigurationPolicyGroup.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a VPN Server Configuration Policy Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVpnServerConfiguration = new azure.network.VpnServerConfiguration("exampleVpnServerConfiguration", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * vpnAuthenticationTypes: ["Radius"], + * radius: { + * servers: [{ + * address: "10.105.1.1", + * secret: "vindicators-the-return-of-worldender", + * score: 15, + * }], + * }, + * }); + * const exampleVpnServerConfigurationPolicyGroup = new azure.network.VpnServerConfigurationPolicyGroup("exampleVpnServerConfigurationPolicyGroup", { + * vpnServerConfigurationId: exampleVpnServerConfiguration.id, + * policies: [{ + * name: "policy1", + * type: "RadiusAzureGroupId", + * value: "6ad1bd08", + * }], + * }); + * ``` + * * ## Import * * VPN Server Configuration Policy Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/network/vpnSite.ts b/sdk/nodejs/network/vpnSite.ts index 9d05208c34..ac0a8bef5a 100644 --- a/sdk/nodejs/network/vpnSite.ts +++ b/sdk/nodejs/network/vpnSite.ts @@ -9,6 +9,29 @@ import * as utilities from "../utilities"; /** * Manages a VPN Site. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualWan = new azure.network.VirtualWan("exampleVirtualWan", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleVpnSite = new azure.network.VpnSite("exampleVpnSite", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualWanId: exampleVirtualWan.id, + * addressCidrs: ["10.0.0.0/24"], + * links: [{ + * name: "link1", + * ipAddress: "10.0.0.1", + * }], + * }); + * ``` + * * ## Import * * VPN Sites can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/networkfunction/azureTrafficCollector.ts b/sdk/nodejs/networkfunction/azureTrafficCollector.ts index 6c79e58a29..5c9341ad6b 100644 --- a/sdk/nodejs/networkfunction/azureTrafficCollector.ts +++ b/sdk/nodejs/networkfunction/azureTrafficCollector.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Network Function Azure Traffic Collector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleAzureTrafficCollector = new azure.networkfunction.AzureTrafficCollector("exampleAzureTrafficCollector", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West US", + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Network Function Azure Traffic Collector can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/newrelic/monitor.ts b/sdk/nodejs/newrelic/monitor.ts index 9183c216a9..1631d2ad0d 100644 --- a/sdk/nodejs/newrelic/monitor.ts +++ b/sdk/nodejs/newrelic/monitor.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; /** * Manages an Azure Native New Relic Monitor. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleMonitor = new azure.newrelic.Monitor("exampleMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * plan: { + * effectiveDate: "2023-06-06T00:00:00Z", + * }, + * user: { + * email: "user@example.com", + * firstName: "Example", + * lastName: "User", + * phoneNumber: "+12313803556", + * }, + * }); + * ``` + * * ## Import * * Azure Native New Relic Monitor can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/newrelic/tagRule.ts b/sdk/nodejs/newrelic/tagRule.ts index 4111bdb1e0..ddd83459a9 100644 --- a/sdk/nodejs/newrelic/tagRule.ts +++ b/sdk/nodejs/newrelic/tagRule.ts @@ -9,6 +9,45 @@ import * as utilities from "../utilities"; /** * Manages an Azure Native New Relic Tag Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleMonitor = new azure.newrelic.Monitor("exampleMonitor", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * plan: { + * effectiveDate: "2023-06-06T00:00:00Z", + * }, + * user: { + * email: "user@example.com", + * firstName: "Example", + * lastName: "User", + * phoneNumber: "+12313803556", + * }, + * }); + * const exampleTagRule = new azure.newrelic.TagRule("exampleTagRule", { + * monitorId: exampleMonitor.id, + * azureActiveDirectoryLogEnabled: true, + * activityLogEnabled: true, + * metricEnabled: true, + * subscriptionLogEnabled: true, + * logTagFilters: [{ + * name: "key", + * action: "Include", + * value: "value", + * }], + * metricTagFilters: [{ + * name: "key", + * action: "Exclude", + * value: "value", + * }], + * }); + * ``` + * * ## Import * * Azure Native New Relic Tag Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/nginx/certificate.ts b/sdk/nodejs/nginx/certificate.ts index 419790ba6a..c027790d49 100644 --- a/sdk/nodejs/nginx/certificate.ts +++ b/sdk/nodejs/nginx/certificate.ts @@ -7,6 +7,93 @@ import * as utilities from "../utilities"; /** * Manages a Certificate for an NGinx Deployment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allocationMethod: "Static", + * sku: "Standard", + * tags: { + * environment: "Production", + * }, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * delegations: [{ + * name: "delegation", + * serviceDelegation: { + * name: "NGINX.NGINXPLUS/nginxDeployments", + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * }, + * }], + * }); + * const exampleDeployment = new azure.nginx.Deployment("exampleDeployment", { + * resourceGroupName: exampleResourceGroup.name, + * sku: "publicpreview_Monthly_gmz7xq9ge3py", + * location: exampleResourceGroup.location, + * managedResourceGroup: "example", + * diagnoseSupportEnabled: true, + * frontendPublic: { + * ipAddresses: [examplePublicIp.id], + * }, + * networkInterfaces: [{ + * subnetId: exampleSubnet.id, + * }], + * }); + * const current = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Create", + * "Delete", + * "DeleteIssuers", + * "Get", + * "GetIssuers", + * "Import", + * "List", + * "ListIssuers", + * "ManageContacts", + * "ManageIssuers", + * "SetIssuers", + * "Update", + * ], + * }], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificate: { + * contents: Buffer.from(fs.readFileSync("certificate-to-import.pfx"), 'binary').toString('base64'), + * password: "", + * }, + * }); + * const exampleNginx_certificateCertificate = new azure.nginx.Certificate("exampleNginx/certificateCertificate", { + * nginxDeploymentId: exampleDeployment.id, + * keyVirtualPath: "/src/cert/soservermekey.key", + * certificateVirtualPath: "/src/cert/server.cert", + * keyVaultSecretId: exampleCertificate.secretId, + * }); + * ``` + * * ## Import * * An Nginx Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/nginx/deployment.ts b/sdk/nodejs/nginx/deployment.ts index a0b92662d2..55b060bf17 100644 --- a/sdk/nodejs/nginx/deployment.ts +++ b/sdk/nodejs/nginx/deployment.ts @@ -9,6 +9,56 @@ import * as utilities from "../utilities"; /** * Manages a Nginx Deployment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * allocationMethod: "Static", + * sku: "Standard", + * tags: { + * environment: "Production", + * }, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * delegations: [{ + * name: "delegation", + * serviceDelegation: { + * name: "NGINX.NGINXPLUS/nginxDeployments", + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * }, + * }], + * }); + * const exampleDeployment = new azure.nginx.Deployment("exampleDeployment", { + * resourceGroupName: exampleResourceGroup.name, + * sku: "publicpreview_Monthly_gmz7xq9ge3py", + * location: exampleResourceGroup.location, + * managedResourceGroup: "example", + * diagnoseSupportEnabled: true, + * frontendPublic: { + * ipAddresses: [examplePublicIp.id], + * }, + * networkInterfaces: [{ + * subnetId: exampleSubnet.id, + * }], + * capacity: 20, + * email: "user@test.com", + * }); + * ``` + * * ## Import * * Nginx Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/notificationhub/authorizationRule.ts b/sdk/nodejs/notificationhub/authorizationRule.ts index 038e59e8de..2512c83db4 100644 --- a/sdk/nodejs/notificationhub/authorizationRule.ts +++ b/sdk/nodejs/notificationhub/authorizationRule.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages an Authorization Rule associated with a Notification Hub within a Notification Hub Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.notificationhub.Namespace("exampleNamespace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * namespaceType: "NotificationHub", + * skuName: "Free", + * }); + * const exampleHub = new azure.notificationhub.Hub("exampleHub", { + * namespaceName: exampleNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleAuthorizationRule = new azure.notificationhub.AuthorizationRule("exampleAuthorizationRule", { + * notificationHubName: exampleHub.name, + * namespaceName: exampleNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * manage: true, + * send: true, + * listen: true, + * }); + * ``` + * * ## Import * * Notification Hub Authorization Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/notificationhub/getHub.ts b/sdk/nodejs/notificationhub/getHub.ts index 4c78c5bd73..6fc10c8884 100644 --- a/sdk/nodejs/notificationhub/getHub.ts +++ b/sdk/nodejs/notificationhub/getHub.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.notificationhub.getHub({ + * name: "notification-hub", + * namespaceName: "namespace-name", + * resourceGroupName: "resource-group-name", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getHub(args: GetHubArgs, opts?: pulumi.InvokeOptions): Promise { @@ -67,6 +81,20 @@ export interface GetHubResult { } /** * Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.notificationhub.getHub({ + * name: "notification-hub", + * namespaceName: "namespace-name", + * resourceGroupName: "resource-group-name", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getHubOutput(args: GetHubOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getHub(a, opts)) diff --git a/sdk/nodejs/notificationhub/getNamespace.ts b/sdk/nodejs/notificationhub/getNamespace.ts index 18ed777b84..b60e9b36dd 100644 --- a/sdk/nodejs/notificationhub/getNamespace.ts +++ b/sdk/nodejs/notificationhub/getNamespace.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Notification Hub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.notificationhub.getNamespace({ + * name: "my-namespace", + * resourceGroupName: "my-resource-group", + * }); + * export const servicebusEndpoint = example.then(example => example.servicebusEndpoint); + * ``` */ export function getNamespace(args: GetNamespaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -69,6 +82,19 @@ export interface GetNamespaceResult { } /** * Use this data source to access information about an existing Notification Hub Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.notificationhub.getNamespace({ + * name: "my-namespace", + * resourceGroupName: "my-resource-group", + * }); + * export const servicebusEndpoint = example.then(example => example.servicebusEndpoint); + * ``` */ export function getNamespaceOutput(args: GetNamespaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNamespace(a, opts)) diff --git a/sdk/nodejs/notificationhub/hub.ts b/sdk/nodejs/notificationhub/hub.ts index eeab611929..663bf03beb 100644 --- a/sdk/nodejs/notificationhub/hub.ts +++ b/sdk/nodejs/notificationhub/hub.ts @@ -9,6 +9,26 @@ import * as utilities from "../utilities"; /** * Manages a Notification Hub within a Notification Hub Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.notificationhub.Namespace("exampleNamespace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * namespaceType: "NotificationHub", + * skuName: "Free", + * }); + * const exampleHub = new azure.notificationhub.Hub("exampleHub", { + * namespaceName: exampleNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Notification Hubs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/notificationhub/namespace.ts b/sdk/nodejs/notificationhub/namespace.ts index e6e9b54fe4..5b0184357a 100644 --- a/sdk/nodejs/notificationhub/namespace.ts +++ b/sdk/nodejs/notificationhub/namespace.ts @@ -7,6 +7,21 @@ import * as utilities from "../utilities"; /** * Manages a Notification Hub Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.notificationhub.Namespace("exampleNamespace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * namespaceType: "NotificationHub", + * skuName: "Free", + * }); + * ``` + * * ## Import * * Notification Hub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/operationalinsights/analyticsSolution.ts b/sdk/nodejs/operationalinsights/analyticsSolution.ts index 96379dd4c0..b249d9c792 100644 --- a/sdk/nodejs/operationalinsights/analyticsSolution.ts +++ b/sdk/nodejs/operationalinsights/analyticsSolution.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics (formally Operational Insights) Solution. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const workspace = new random.RandomId("workspace", { + * keepers: { + * group_name: exampleResourceGroup.name, + * }, + * byteLength: 8, + * }); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleAnalyticsSolution = new azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", { + * solutionName: "ContainerInsights", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * workspaceName: exampleAnalyticsWorkspace.name, + * plan: { + * publisher: "Microsoft", + * product: "OMSGallery/ContainerInsights", + * }, + * }); + * ``` + * * ## Import * * Log Analytics Solutions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/operationalinsights/analyticsWorkspace.ts b/sdk/nodejs/operationalinsights/analyticsWorkspace.ts index 89c8a0e726..ecf0bbc45f 100644 --- a/sdk/nodejs/operationalinsights/analyticsWorkspace.ts +++ b/sdk/nodejs/operationalinsights/analyticsWorkspace.ts @@ -7,6 +7,21 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics (formally Operational Insights) Workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * ``` + * * ## Import * * Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/operationalinsights/getAnalyticsWorkspace.ts b/sdk/nodejs/operationalinsights/getAnalyticsWorkspace.ts index f2368b42b7..f629827b54 100644 --- a/sdk/nodejs/operationalinsights/getAnalyticsWorkspace.ts +++ b/sdk/nodejs/operationalinsights/getAnalyticsWorkspace.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.operationalinsights.getAnalyticsWorkspace({ + * name: "acctest-01", + * resourceGroupName: "acctest", + * }); + * export const logAnalyticsWorkspaceId = example.then(example => example.workspaceId); + * ``` */ export function getAnalyticsWorkspace(args: GetAnalyticsWorkspaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -72,6 +85,19 @@ export interface GetAnalyticsWorkspaceResult { } /** * Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.operationalinsights.getAnalyticsWorkspace({ + * name: "acctest-01", + * resourceGroupName: "acctest", + * }); + * export const logAnalyticsWorkspaceId = example.then(example => example.workspaceId); + * ``` */ export function getAnalyticsWorkspaceOutput(args: GetAnalyticsWorkspaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAnalyticsWorkspace(a, opts)) diff --git a/sdk/nodejs/operationalinsights/queryPackQuery.ts b/sdk/nodejs/operationalinsights/queryPackQuery.ts index d9cfb55d3c..1ed4474361 100644 --- a/sdk/nodejs/operationalinsights/queryPackQuery.ts +++ b/sdk/nodejs/operationalinsights/queryPackQuery.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a Log Analytics Query Pack Query. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleQueryPack = new azure.loganalytics.QueryPack("exampleQueryPack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleQueryPackQuery = new azure.operationalinsights.QueryPackQuery("exampleQueryPackQuery", { + * queryPackId: exampleQueryPack.id, + * body: `let newExceptionsTimeRange = 1d; + * let timeRangeToCheckBefore = 7d; + * exceptions + * | where timestamp < ago(timeRangeToCheckBefore) + * | summarize count() by problemId + * | join kind= rightanti ( + * exceptions + * | where timestamp >= ago(newExceptionsTimeRange) + * | extend stack = tostring(details[0].rawStack) + * | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId + * ) on problemId + * | order by count_ desc + * `, + * displayName: "Exceptions - New in the last 24 hours", + * }); + * ``` + * * ## Import * * Log Analytics Query Pack Queries can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/orbital/contact.ts b/sdk/nodejs/orbital/contact.ts index bd5933a069..8406b4da61 100644 --- a/sdk/nodejs/orbital/contact.ts +++ b/sdk/nodejs/orbital/contact.ts @@ -7,6 +7,87 @@ import * as utilities from "../utilities"; /** * Manages an orbital contact. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpacecraft = new azure.orbital.Spacecraft("exampleSpacecraft", { + * resourceGroupName: exampleResourceGroup.name, + * location: "westeurope", + * noradId: "12345", + * links: [{ + * bandwidthMhz: 100, + * centerFrequencyMhz: 101, + * direction: "Uplink", + * polarization: "LHCP", + * name: "examplename", + * }], + * twoLineElements: [ + * "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + * "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + * ], + * titleLine: "AQUA", + * tags: { + * "aks-managed-cluster-name": "9a57225d-a405-4d40-aa46-f13d2342abef", + * }, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * delegations: [{ + * name: "orbitalgateway", + * serviceDelegation: { + * name: "Microsoft.Orbital/orbitalGateways", + * actions: [ + * "Microsoft.Network/publicIPAddresses/join/action", + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/read", + * "Microsoft.Network/publicIPAddresses/read", + * ], + * }, + * }], + * }); + * const exampleContactProfile = new azure.orbital.ContactProfile("exampleContactProfile", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * minimumVariableContactDuration: "PT1M", + * autoTracking: "disabled", + * links: [{ + * channels: [{ + * name: "channelname", + * bandwidthMhz: 100, + * centerFrequencyMhz: 101, + * endPoints: [{ + * endPointName: "AQUA_command", + * ipAddress: "10.0.1.0", + * port: "49153", + * protocol: "TCP", + * }], + * }], + * direction: "Uplink", + * name: "RHCP_UL", + * polarization: "RHCP", + * }], + * networkConfigurationSubnetId: exampleSubnet.id, + * }); + * const exampleContact = new azure.orbital.Contact("exampleContact", { + * spacecraftId: exampleSpacecraft.id, + * reservationStartTime: "2020-07-16T20:35:00.00Z", + * reservationEndTime: "2020-07-16T20:55:00.00Z", + * groundStationName: "WESTUS2_0", + * contactProfileId: exampleContactProfile.id, + * }); + * ``` + * * ## Import * * Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/orbital/contactProfile.ts b/sdk/nodejs/orbital/contactProfile.ts index 24a45ab430..6a1da5c6a3 100644 --- a/sdk/nodejs/orbital/contactProfile.ts +++ b/sdk/nodejs/orbital/contactProfile.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; /** * Manages a Contact profile. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * delegations: [{ + * name: "orbitalgateway", + * serviceDelegation: { + * name: "Microsoft.Orbital/orbitalGateways", + * actions: [ + * "Microsoft.Network/publicIPAddresses/join/action", + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/read", + * "Microsoft.Network/publicIPAddresses/read", + * ], + * }, + * }], + * }); + * const exampleContactProfile = new azure.orbital.ContactProfile("exampleContactProfile", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * minimumVariableContactDuration: "PT1M", + * autoTracking: "disabled", + * links: [{ + * channels: [{ + * name: "channelname", + * bandwidthMhz: 100, + * centerFrequencyMhz: 101, + * endPoints: [{ + * endPointName: "AQUA_command", + * ipAddress: "10.0.1.0", + * port: "49513", + * protocol: "TCP", + * }], + * }], + * direction: "Uplink", + * name: "RHCP_UL", + * polarization: "RHCP", + * }], + * networkConfigurationSubnetId: exampleSubnet.id, + * }); + * ``` + * * ## Import * * Contact profile can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/orbital/spacecraft.ts b/sdk/nodejs/orbital/spacecraft.ts index 0b20eeedfa..9742da2a0c 100644 --- a/sdk/nodejs/orbital/spacecraft.ts +++ b/sdk/nodejs/orbital/spacecraft.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Spacecraft. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSpacecraft = new azure.orbital.Spacecraft("exampleSpacecraft", { + * resourceGroupName: exampleResourceGroup.name, + * location: "westeurope", + * noradId: "12345", + * links: [{ + * bandwidthMhz: 100, + * centerFrequencyMhz: 101, + * direction: "Uplink", + * polarization: "LHCP", + * name: "examplename", + * }], + * twoLineElements: [ + * "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + * "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + * ], + * titleLine: "AQUA", + * tags: { + * "aks-managed-cluster-name": "9a57225d-a405-4d40-aa46-f13d2342abef", + * }, + * }); + * ``` + * * ## Import * * Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/paloalto/localRulestack.ts b/sdk/nodejs/paloalto/localRulestack.ts index 40b8c305c3..f7f0c47d4d 100644 --- a/sdk/nodejs/paloalto/localRulestack.ts +++ b/sdk/nodejs/paloalto/localRulestack.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Networks Rulestack. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLocalRulestack = new azure.paloalto.LocalRulestack("exampleLocalRulestack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Palo Alto Networks Rulestacks can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/paloalto/localRulestackCertificate.ts b/sdk/nodejs/paloalto/localRulestackCertificate.ts index 6e0a0790b2..f7d4fae4a4 100644 --- a/sdk/nodejs/paloalto/localRulestackCertificate.ts +++ b/sdk/nodejs/paloalto/localRulestackCertificate.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Networks Rulestack Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLocalRulestack = new azure.paloalto.LocalRulestack("exampleLocalRulestack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleLocalRulestackCertificate = new azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", { + * rulestackId: exampleLocalRulestack.id, + * selfSigned: true, + * }); + * ``` + * * ## Import * * Palo Alto Networks Rulestack Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/paloalto/localRulestackFqdnList.ts b/sdk/nodejs/paloalto/localRulestackFqdnList.ts index 0b59a734bb..52270e349b 100644 --- a/sdk/nodejs/paloalto/localRulestackFqdnList.ts +++ b/sdk/nodejs/paloalto/localRulestackFqdnList.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Local Rulestack FQDN List. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLocalRulestack = new azure.paloalto.LocalRulestack("exampleLocalRulestack", { + * resourceGroupName: azurerm_resrouce_group.example.name, + * location: exampleResourceGroup.location, + * }); + * const exampleLocalRulestackFqdnList = new azure.paloalto.LocalRulestackFqdnList("exampleLocalRulestackFqdnList", { + * rulestackId: exampleLocalRulestack.id, + * fullyQualifiedDomainNames: ["contoso.com"], + * }); + * ``` + * * ## Import * * Palo Alto Local Rulestack FQDN Lists can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/paloalto/localRulestackOutboundTrustCertificateAssociation.ts b/sdk/nodejs/paloalto/localRulestackOutboundTrustCertificateAssociation.ts index d62dac67fa..3d27ceb79c 100644 --- a/sdk/nodejs/paloalto/localRulestackOutboundTrustCertificateAssociation.ts +++ b/sdk/nodejs/paloalto/localRulestackOutboundTrustCertificateAssociation.ts @@ -6,6 +6,24 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Networks Rulestack Outbound Trust Certificate Association. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLocalRulestack = new azure.paloalto.LocalRulestack("exampleLocalRulestack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleLocalRulestackCertificate = new azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", { + * rulestackId: exampleLocalRulestack.id, + * selfSigned: true, + * }); + * const exampleLocalRulestackOutboundTrustCertificateAssociation = new azure.paloalto.LocalRulestackOutboundTrustCertificateAssociation("exampleLocalRulestackOutboundTrustCertificateAssociation", {certificateId: exampleLocalRulestackCertificate.id}); + * ``` */ export class LocalRulestackOutboundTrustCertificateAssociation extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/paloalto/localRulestackOutboundUntrustCertificateAssociation.ts b/sdk/nodejs/paloalto/localRulestackOutboundUntrustCertificateAssociation.ts index d47ea1d6bc..353f76408f 100644 --- a/sdk/nodejs/paloalto/localRulestackOutboundUntrustCertificateAssociation.ts +++ b/sdk/nodejs/paloalto/localRulestackOutboundUntrustCertificateAssociation.ts @@ -6,6 +6,24 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Networks Rulestack Outbound Untrust Certificate Association. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLocalRulestack = new azure.paloalto.LocalRulestack("exampleLocalRulestack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleLocalRulestackCertificate = new azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", { + * rulestackId: exampleLocalRulestack.id, + * selfSigned: true, + * }); + * const exampleLocalRulestackOutboundUntrustCertificateAssociation = new azure.paloalto.LocalRulestackOutboundUntrustCertificateAssociation("exampleLocalRulestackOutboundUntrustCertificateAssociation", {certificateId: exampleLocalRulestackCertificate.id}); + * ``` */ export class LocalRulestackOutboundUntrustCertificateAssociation extends pulumi.CustomResource { /** diff --git a/sdk/nodejs/paloalto/localRulestackPrefixList.ts b/sdk/nodejs/paloalto/localRulestackPrefixList.ts index 48d69e5418..47f4c2e8b9 100644 --- a/sdk/nodejs/paloalto/localRulestackPrefixList.ts +++ b/sdk/nodejs/paloalto/localRulestackPrefixList.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Local Rulestack Prefix List. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLocalRulestack = new azure.paloalto.LocalRulestack("exampleLocalRulestack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleLocalRulestackPrefixList = new azure.paloalto.LocalRulestackPrefixList("exampleLocalRulestackPrefixList", { + * rulestackId: exampleLocalRulestack.id, + * prefixLists: ["10.0.1.0/24"], + * }); + * ``` + * * ## Import * * Palo Alto Local Rulestack Prefix Lists can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/paloalto/localRulestackRule.ts b/sdk/nodejs/paloalto/localRulestackRule.ts index 18d9409ed4..5d4a53fa04 100644 --- a/sdk/nodejs/paloalto/localRulestackRule.ts +++ b/sdk/nodejs/paloalto/localRulestackRule.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Local Rulestack Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleLocalRulestack = new azure.paloalto.LocalRulestack("exampleLocalRulestack", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleLocalRulestackRule = new azure.paloalto.LocalRulestackRule("exampleLocalRulestackRule", { + * rulestackId: exampleLocalRulestack.id, + * priority: 1000, + * action: "Allow", + * applications: ["any"], + * source: { + * cidrs: ["10.0.0.0/8"], + * }, + * destination: { + * cidrs: ["192.168.16.0/24"], + * }, + * }); + * ``` + * * ## Import * * Palo Alto Local Rulestack Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/paloalto/nextGenerationFirewallVirtualNetworkPanorama.ts b/sdk/nodejs/paloalto/nextGenerationFirewallVirtualNetworkPanorama.ts index 2ddb0d457e..09e209ea4a 100644 --- a/sdk/nodejs/paloalto/nextGenerationFirewallVirtualNetworkPanorama.ts +++ b/sdk/nodejs/paloalto/nextGenerationFirewallVirtualNetworkPanorama.ts @@ -9,6 +9,78 @@ import * as utilities from "../utilities"; /** * Manages a Palo Alto Next Generation Firewall Virtual Network Panorama. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westeurope"}); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * sku: "Standard", + * }); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: azurerm_resource_group.test.location, + * resourceGroupName: azurerm_resource_group.test.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * const trustSubnet = new azure.network.Subnet("trustSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.1.0/24"], + * delegations: [{ + * name: "trusted", + * serviceDelegation: { + * name: "PaloAltoNetworks.Cloudngfw/firewalls", + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * }, + * }], + * }); + * const trustSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("trustSubnetNetworkSecurityGroupAssociation", { + * subnetId: trustSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * const untrustSubnet = new azure.network.Subnet("untrustSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * delegations: [{ + * name: "untrusted", + * serviceDelegation: { + * name: "PaloAltoNetworks.Cloudngfw/firewalls", + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * }, + * }], + * }); + * const untrustSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("untrustSubnetNetworkSecurityGroupAssociation", { + * subnetId: untrustSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * const exampleNextGenerationFirewallVirtualNetworkPanorama = new azure.paloalto.NextGenerationFirewallVirtualNetworkPanorama("exampleNextGenerationFirewallVirtualNetworkPanorama", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * panoramaBase64Config: "e2RnbmFtZTogY25nZnctYXotZXhhbXBsZSwgdHBsbmFtZTogY25nZnctZXhhbXBsZS10ZW1wbGF0ZS1zdGFjaywgZXhhbXBsZS1wYW5vcmFtYS1zZXJ2ZXI6IDE5Mi4xNjguMC4xLCB2bS1hdXRoLWtleTogMDAwMDAwMDAwMDAwMDAwLCBleHBpcnk6IDIwMjQvMDcvMzF9Cg==", + * networkProfile: { + * publicIpAddressIds: [examplePublicIp.id], + * vnetConfiguration: { + * virtualNetworkId: exampleVirtualNetwork.id, + * trustedSubnetId: trustSubnet.id, + * untrustedSubnetId: untrustSubnet.id, + * }, + * }, + * }); + * ``` + * * ## Import * * Palo Alto Next Generation Firewall Virtual Network Panoramas can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/pim/activeRoleAssignment.ts b/sdk/nodejs/pim/activeRoleAssignment.ts index e1a7a1b43e..286f6c996b 100644 --- a/sdk/nodejs/pim/activeRoleAssignment.ts +++ b/sdk/nodejs/pim/activeRoleAssignment.ts @@ -10,6 +10,66 @@ import * as utilities from "../utilities"; * Manages a Pim Active Role Assignment. * * ## Example Usage + * ### Subscription) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as time from "@pulumiverse/time"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = azure.authorization.getRoleDefinition({ + * name: "Reader", + * }); + * const exampleStatic = new time.Static("exampleStatic", {}); + * const exampleActiveRoleAssignment = new azure.pim.ActiveRoleAssignment("exampleActiveRoleAssignment", { + * scope: primary.then(primary => primary.id), + * roleDefinitionId: Promise.all([primary, exampleRoleDefinition]).then(([primary, exampleRoleDefinition]) => `${primary.id}${exampleRoleDefinition.id}`), + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * schedule: { + * startDateTime: exampleStatic.rfc3339, + * expiration: { + * durationHours: 8, + * }, + * }, + * justification: "Expiration Duration Set", + * ticket: { + * number: "1", + * system: "example ticket system", + * }, + * }); + * ``` + * ### Management Group) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as time from "@pulumiverse/time"; + * + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = azure.authorization.getRoleDefinition({ + * name: "Reader", + * }); + * const exampleGroup = new azure.management.Group("exampleGroup", {}); + * const exampleStatic = new time.Static("exampleStatic", {}); + * const exampleActiveRoleAssignment = new azure.pim.ActiveRoleAssignment("exampleActiveRoleAssignment", { + * scope: exampleGroup.id, + * roleDefinitionId: exampleRoleDefinition.then(exampleRoleDefinition => exampleRoleDefinition.id), + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * schedule: { + * startDateTime: exampleStatic.rfc3339, + * expiration: { + * durationHours: 8, + * }, + * }, + * justification: "Expiration Duration Set", + * ticket: { + * number: "1", + * system: "example ticket system", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/pim/eligibleRoleAssignment.ts b/sdk/nodejs/pim/eligibleRoleAssignment.ts index 84b596698f..48648ae20f 100644 --- a/sdk/nodejs/pim/eligibleRoleAssignment.ts +++ b/sdk/nodejs/pim/eligibleRoleAssignment.ts @@ -10,6 +10,66 @@ import * as utilities from "../utilities"; * Manages a Pim Eligible Role Assignment. * * ## Example Usage + * ### Subscription) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as time from "@pulumiverse/time"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = azure.authorization.getRoleDefinition({ + * name: "Reader", + * }); + * const exampleStatic = new time.Static("exampleStatic", {}); + * const exampleEligibleRoleAssignment = new azure.pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", { + * scope: primary.then(primary => primary.id), + * roleDefinitionId: Promise.all([primary, exampleRoleDefinition]).then(([primary, exampleRoleDefinition]) => `${primary.id}${exampleRoleDefinition.id}`), + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * schedule: { + * startDateTime: exampleStatic.rfc3339, + * expiration: { + * durationHours: 8, + * }, + * }, + * justification: "Expiration Duration Set", + * ticket: { + * number: "1", + * system: "example ticket system", + * }, + * }); + * ``` + * ### Management Group) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as time from "@pulumiverse/time"; + * + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = azure.authorization.getRoleDefinition({ + * name: "Reader", + * }); + * const exampleGroup = new azure.management.Group("exampleGroup", {}); + * const exampleStatic = new time.Static("exampleStatic", {}); + * const exampleEligibleRoleAssignment = new azure.pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", { + * scope: exampleGroup.id, + * roleDefinitionId: exampleRoleDefinition.then(exampleRoleDefinition => exampleRoleDefinition.id), + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * schedule: { + * startDateTime: exampleStatic.rfc3339, + * expiration: { + * durationHours: 8, + * }, + * }, + * justification: "Expiration Duration Set", + * ticket: { + * number: "1", + * system: "example ticket system", + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/policy/definition.ts b/sdk/nodejs/policy/definition.ts index 2f743e18c3..683c67ff35 100644 --- a/sdk/nodejs/policy/definition.ts +++ b/sdk/nodejs/policy/definition.ts @@ -9,6 +9,50 @@ import * as utilities from "../utilities"; * * Policy definitions do not take effect until they are assigned to a scope using a Policy Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const policy = new azure.policy.Definition("policy", { + * displayName: "acceptance test policy definition", + * metadata: ` { + * "category": "General" + * } + * + * + * `, + * mode: "Indexed", + * parameters: ` { + * "allowedLocations": { + * "type": "Array", + * "metadata": { + * "description": "The list of allowed locations for resources.", + * "displayName": "Allowed locations", + * "strongType": "location" + * } + * } + * } + * + * `, + * policyRule: ` { + * "if": { + * "not": { + * "field": "location", + * "in": "[parameters('allowedLocations')]" + * } + * }, + * "then": { + * "effect": "audit" + * } + * } + * + * `, + * policyType: "Custom", + * }); + * ``` + * * ## Import * * Policy Definitions can be imported using the `policy name`, e.g. diff --git a/sdk/nodejs/policy/getPolicyAssignment.ts b/sdk/nodejs/policy/getPolicyAssignment.ts index 70da2f5907..179f4295da 100644 --- a/sdk/nodejs/policy/getPolicyAssignment.ts +++ b/sdk/nodejs/policy/getPolicyAssignment.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Policy Assignment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicyAssignment({ + * name: "existing", + * scopeId: data.azurerm_resource_group.example.id, + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicyAssignment(args: GetPolicyAssignmentArgs, opts?: pulumi.InvokeOptions): Promise { @@ -85,6 +98,19 @@ export interface GetPolicyAssignmentResult { } /** * Use this data source to access information about an existing Policy Assignment. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicyAssignment({ + * name: "existing", + * scopeId: data.azurerm_resource_group.example.id, + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicyAssignmentOutput(args: GetPolicyAssignmentOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPolicyAssignment(a, opts)) diff --git a/sdk/nodejs/policy/getPolicyDefintion.ts b/sdk/nodejs/policy/getPolicyDefintion.ts index 0c81232b43..7dd0ae0a6e 100644 --- a/sdk/nodejs/policy/getPolicyDefintion.ts +++ b/sdk/nodejs/policy/getPolicyDefintion.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicyDefintion({ + * displayName: "Allowed resource types", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicyDefintion(args?: GetPolicyDefintionArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -84,6 +96,18 @@ export interface GetPolicyDefintionResult { } /** * Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicyDefintion({ + * displayName: "Allowed resource types", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicyDefintionOutput(args?: GetPolicyDefintionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPolicyDefintion(a, opts)) diff --git a/sdk/nodejs/policy/getPolicyDefintionBuiltIn.ts b/sdk/nodejs/policy/getPolicyDefintionBuiltIn.ts index 6fe8893013..4a1bcb3c58 100644 --- a/sdk/nodejs/policy/getPolicyDefintionBuiltIn.ts +++ b/sdk/nodejs/policy/getPolicyDefintionBuiltIn.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicyDefintionBuiltIn({ + * displayName: "Allowed resource types", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicyDefintionBuiltIn(args?: GetPolicyDefintionBuiltInArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -84,6 +96,18 @@ export interface GetPolicyDefintionBuiltInResult { } /** * Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicyDefintionBuiltIn({ + * displayName: "Allowed resource types", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicyDefintionBuiltInOutput(args?: GetPolicyDefintionBuiltInOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPolicyDefintionBuiltIn(a, opts)) diff --git a/sdk/nodejs/policy/getPolicySetDefinition.ts b/sdk/nodejs/policy/getPolicySetDefinition.ts index b4b00d9c94..8b027dd541 100644 --- a/sdk/nodejs/policy/getPolicySetDefinition.ts +++ b/sdk/nodejs/policy/getPolicySetDefinition.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Policy Set Definition. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicySetDefinition({ + * displayName: "Policy Set Definition Example", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicySetDefinition(args?: GetPolicySetDefinitionArgs, opts?: pulumi.InvokeOptions): Promise { args = args || {}; @@ -88,6 +100,18 @@ export interface GetPolicySetDefinitionResult { } /** * Use this data source to access information about an existing Policy Set Definition. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getPolicySetDefinition({ + * displayName: "Policy Set Definition Example", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getPolicySetDefinitionOutput(args?: GetPolicySetDefinitionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPolicySetDefinition(a, opts)) diff --git a/sdk/nodejs/policy/getVirtualMachineConfigurationAssignment.ts b/sdk/nodejs/policy/getVirtualMachineConfigurationAssignment.ts index ce391ac503..9149c5dc75 100644 --- a/sdk/nodejs/policy/getVirtualMachineConfigurationAssignment.ts +++ b/sdk/nodejs/policy/getVirtualMachineConfigurationAssignment.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Guest Configuration Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getVirtualMachineConfigurationAssignment({ + * name: "AzureWindowsBaseline", + * resourceGroupName: "example-RG", + * virtualMachineName: "example-vm", + * }); + * export const complianceStatus = example.then(example => example.complianceStatus); + * ``` */ export function getVirtualMachineConfigurationAssignment(args: GetVirtualMachineConfigurationAssignmentArgs, opts?: pulumi.InvokeOptions): Promise { @@ -73,6 +87,20 @@ export interface GetVirtualMachineConfigurationAssignmentResult { } /** * Use this data source to access information about an existing Guest Configuration Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.policy.getVirtualMachineConfigurationAssignment({ + * name: "AzureWindowsBaseline", + * resourceGroupName: "example-RG", + * virtualMachineName: "example-vm", + * }); + * export const complianceStatus = example.then(example => example.complianceStatus); + * ``` */ export function getVirtualMachineConfigurationAssignmentOutput(args: GetVirtualMachineConfigurationAssignmentOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVirtualMachineConfigurationAssignment(a, opts)) diff --git a/sdk/nodejs/policy/policySetDefinition.ts b/sdk/nodejs/policy/policySetDefinition.ts index 8ad57a7a18..f283074a15 100644 --- a/sdk/nodejs/policy/policySetDefinition.ts +++ b/sdk/nodejs/policy/policySetDefinition.ts @@ -11,6 +11,38 @@ import * as utilities from "../utilities"; * * > **NOTE:** Policy set definitions (also known as policy initiatives) do not take effect until they are assigned to a scope using a Policy Set Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.policy.PolicySetDefinition("example", { + * displayName: "Test Policy Set", + * parameters: ` { + * "allowedLocations": { + * "type": "Array", + * "metadata": { + * "description": "The list of allowed locations for resources.", + * "displayName": "Allowed locations", + * "strongType": "location" + * } + * } + * } + * + * `, + * policyDefinitionReferences: [{ + * parameterValues: ` { + * "listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"} + * } + * + * `, + * policyDefinitionId: "/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", + * }], + * policyType: "Custom", + * }); + * ``` + * * ## Import * * Policy Set Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/policy/virtualMachineConfigurationAssignment.ts b/sdk/nodejs/policy/virtualMachineConfigurationAssignment.ts index ec081a8e7c..bfcdb21b5c 100644 --- a/sdk/nodejs/policy/virtualMachineConfigurationAssignment.ts +++ b/sdk/nodejs/policy/virtualMachineConfigurationAssignment.ts @@ -11,6 +11,92 @@ import * as utilities from "../utilities"; * * > **NOTE:** You can create Guest Configuration Policies without defining a `azure.compute.Extension` resource, however the policies will not be executed until a `azure.compute.Extension` has been provisioned to the virtual machine. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * ipConfigurations: [{ + * name: "internal", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleWindowsVirtualMachine = new azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * size: "Standard_F2", + * adminUsername: "adminuser", + * adminPassword: "P@$$w0rd1234!", + * networkInterfaceIds: [exampleNetworkInterface.id], + * identity: { + * type: "SystemAssigned", + * }, + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * sourceImageReference: { + * publisher: "MicrosoftWindowsServer", + * offer: "WindowsServer", + * sku: "2019-Datacenter", + * version: "latest", + * }, + * }); + * const exampleExtension = new azure.compute.Extension("exampleExtension", { + * virtualMachineId: exampleWindowsVirtualMachine.id, + * publisher: "Microsoft.GuestConfiguration", + * type: "ConfigurationforWindows", + * typeHandlerVersion: "1.29", + * autoUpgradeMinorVersion: true, + * }); + * const exampleVirtualMachineConfigurationAssignment = new azure.policy.VirtualMachineConfigurationAssignment("exampleVirtualMachineConfigurationAssignment", { + * location: exampleWindowsVirtualMachine.location, + * virtualMachineId: exampleWindowsVirtualMachine.id, + * configuration: { + * assignmentType: "ApplyAndMonitor", + * version: "1.*", + * parameters: [ + * { + * name: "Minimum Password Length;ExpectedValue", + * value: "16", + * }, + * { + * name: "Minimum Password Age;ExpectedValue", + * value: "0", + * }, + * { + * name: "Maximum Password Age;ExpectedValue", + * value: "30,45", + * }, + * { + * name: "Enforce Password History;ExpectedValue", + * value: "10", + * }, + * { + * name: "Password Must Meet Complexity Requirements;ExpectedValue", + * value: "1", + * }, + * ], + * }, + * }); + * ``` + * * ## Import * * Policy Virtual Machine Configuration Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/portal/dashboard.ts b/sdk/nodejs/portal/dashboard.ts index 5d684f3697..67a6e9e158 100644 --- a/sdk/nodejs/portal/dashboard.ts +++ b/sdk/nodejs/portal/dashboard.ts @@ -9,6 +9,138 @@ import * as utilities from "../utilities"; * * !> **Note:** The `azure.portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.portal.PortalDashboard` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const config = new pulumi.Config(); + * const mdContent = config.get("mdContent") || "# Hello all :)"; + * const videoLink = config.get("videoLink") || "https://www.youtube.com/watch?v=......"; + * const current = azure.core.getSubscription({}); + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const my_board = new azure.portal.Dashboard("my-board", { + * resourceGroupName: example.name, + * location: example.location, + * tags: { + * source: "managed", + * }, + * dashboardProperties: current.then(current => `{ + * "lenses": { + * "0": { + * "order": 0, + * "parts": { + * "0": { + * "position": { + * "x": 0, + * "y": 0, + * "rowSpan": 2, + * "colSpan": 3 + * }, + * "metadata": { + * "inputs": [], + * "type": "Extension/HubsExtension/PartType/MarkdownPart", + * "settings": { + * "content": { + * "settings": { + * "content": "${mdContent}", + * "subtitle": "", + * "title": "" + * } + * } + * } + * } + * }, + * "1": { + * "position": { + * "x": 5, + * "y": 0, + * "rowSpan": 4, + * "colSpan": 6 + * }, + * "metadata": { + * "inputs": [], + * "type": "Extension/HubsExtension/PartType/VideoPart", + * "settings": { + * "content": { + * "settings": { + * "title": "Important Information", + * "subtitle": "", + * "src": "${videoLink}", + * "autoplay": true + * } + * } + * } + * } + * }, + * "2": { + * "position": { + * "x": 0, + * "y": 4, + * "rowSpan": 4, + * "colSpan": 6 + * }, + * "metadata": { + * "inputs": [ + * { + * "name": "ComponentId", + * "value": "/subscriptions/${current.subscriptionId}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" + * } + * ], + * "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", + * "settings": {}, + * "asset": { + * "idInputName": "ComponentId", + * "type": "ApplicationInsights" + * } + * } + * } + * } + * } + * }, + * "metadata": { + * "model": { + * "timeRange": { + * "value": { + * "relative": { + * "duration": 24, + * "timeUnit": 1 + * } + * }, + * "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + * }, + * "filterLocale": { + * "value": "en-us" + * }, + * "filters": { + * "value": { + * "MsPortalFx_TimeRange": { + * "model": { + * "format": "utc", + * "granularity": "auto", + * "relative": "24h" + * }, + * "displayCache": { + * "name": "UTC Time", + * "value": "Past 24 hours" + * }, + * "filteredPartIds": [ + * "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" + * ] + * } + * } + * } + * } + * } + * } + * `), + * }); + * ``` + * + * It is recommended to follow the steps outlined + * [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + * * ## Import * * Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/portal/getDashboard.ts b/sdk/nodejs/portal/getDashboard.ts index 02af389900..5b6b031dea 100644 --- a/sdk/nodejs/portal/getDashboard.ts +++ b/sdk/nodejs/portal/getDashboard.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.portal.getDashboard({ + * name: "existing-dashboard", + * resourceGroupName: "dashboard-rg", + * }); + * export const id = data.azurerm_dashboard.example.id; + * ``` */ export function getDashboard(args: GetDashboardArgs, opts?: pulumi.InvokeOptions): Promise { @@ -66,6 +79,19 @@ export interface GetDashboardResult { } /** * Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.portal.getDashboard({ + * name: "existing-dashboard", + * resourceGroupName: "dashboard-rg", + * }); + * export const id = data.azurerm_dashboard.example.id; + * ``` */ export function getDashboardOutput(args: GetDashboardOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDashboard(a, opts)) diff --git a/sdk/nodejs/postgresql/activeDirectoryAdministrator.ts b/sdk/nodejs/postgresql/activeDirectoryAdministrator.ts index b82d68e756..70d09266ae 100644 --- a/sdk/nodejs/postgresql/activeDirectoryAdministrator.ts +++ b/sdk/nodejs/postgresql/activeDirectoryAdministrator.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Allows you to set a user or group as the AD administrator for an PostgreSQL server in Azure * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "9.6", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * skuName: "GP_Gen5_2", + * sslEnforcementEnabled: true, + * }); + * const exampleActiveDirectoryAdministrator = new azure.postgresql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", { + * serverName: exampleServer.name, + * resourceGroupName: exampleResourceGroup.name, + * login: "sqladmin", + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * }); + * ``` + * * ## Import * * A PostgreSQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/configuration.ts b/sdk/nodejs/postgresql/configuration.ts index 5b11d87237..2014899c98 100644 --- a/sdk/nodejs/postgresql/configuration.ts +++ b/sdk/nodejs/postgresql/configuration.ts @@ -11,6 +11,34 @@ import * as utilities from "../utilities"; * * > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "B_Gen5_2", + * storageMb: 5120, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: false, + * autoGrowEnabled: true, + * administratorLogin: "psqladmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * version: "9.5", + * sslEnforcementEnabled: true, + * }); + * const exampleConfiguration = new azure.postgresql.Configuration("exampleConfiguration", { + * name: "backslash_quote", + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * value: "on", + * }); + * ``` + * * ## Import * * PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/database.ts b/sdk/nodejs/postgresql/database.ts index 3bb0853f3c..a05cc998a2 100644 --- a/sdk/nodejs/postgresql/database.ts +++ b/sdk/nodejs/postgresql/database.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a PostgreSQL Database within a PostgreSQL Server * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "B_Gen5_2", + * storageMb: 5120, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: false, + * autoGrowEnabled: true, + * administratorLogin: "psqladmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * version: "9.5", + * sslEnforcementEnabled: true, + * }); + * const exampleDatabase = new azure.postgresql.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * charset: "UTF8", + * collation: "English_United States.1252", + * }); + * ``` + * * ## Import * * PostgreSQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/firewallRule.ts b/sdk/nodejs/postgresql/firewallRule.ts index ecefceafd1..550ea41353 100644 --- a/sdk/nodejs/postgresql/firewallRule.ts +++ b/sdk/nodejs/postgresql/firewallRule.ts @@ -8,6 +8,43 @@ import * as utilities from "../utilities"; * Manages a Firewall Rule for a PostgreSQL Server * * ## Example Usage + * ### Single IP Address) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "GP_Gen5_2", + * version: "11", + * sslEnforcementEnabled: true, + * }); + * const exampleFirewallRule = new azure.postgresql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "40.112.8.12", + * endIpAddress: "40.112.8.12", + * }); + * ``` + * ### IP Range) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.postgresql.Server("exampleServer", {}); + * // ... + * const exampleFirewallRule = new azure.postgresql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * startIpAddress: "40.112.0.0", + * endIpAddress: "40.112.255.255", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/postgresql/flexibleServer.ts b/sdk/nodejs/postgresql/flexibleServer.ts index 2f3dd99fee..7ce530efb3 100644 --- a/sdk/nodejs/postgresql/flexibleServer.ts +++ b/sdk/nodejs/postgresql/flexibleServer.ts @@ -9,6 +9,53 @@ import * as utilities from "../utilities"; /** * Manages a PostgreSQL Flexible Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * serviceEndpoints: ["Microsoft.Storage"], + * delegations: [{ + * name: "fs", + * serviceDelegation: { + * name: "Microsoft.DBforPostgreSQL/flexibleServers", + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * }, + * }], + * }); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleZoneVirtualNetworkLink = new azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", { + * privateDnsZoneName: exampleZone.name, + * virtualNetworkId: exampleVirtualNetwork.id, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleFlexibleServer = new azure.postgresql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12", + * delegatedSubnetId: exampleSubnet.id, + * privateDnsZoneId: exampleZone.id, + * administratorLogin: "psqladmin", + * administratorPassword: "H@Sh1CoR3!", + * zone: "1", + * storageMb: 32768, + * skuName: "GP_Standard_D4s_v3", + * }, { + * dependsOn: [exampleZoneVirtualNetworkLink], + * }); + * ``` + * * ## Import * * PostgreSQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/flexibleServerActiveDirectoryAdministrator.ts b/sdk/nodejs/postgresql/flexibleServerActiveDirectoryAdministrator.ts index 747e69a2c0..b4817cd6fe 100644 --- a/sdk/nodejs/postgresql/flexibleServerActiveDirectoryAdministrator.ts +++ b/sdk/nodejs/postgresql/flexibleServerActiveDirectoryAdministrator.ts @@ -7,6 +7,42 @@ import * as utilities from "../utilities"; /** * Allows you to set a user or group as the AD administrator for a PostgreSQL Flexible Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const current = azure.core.getClientConfig({}); + * const exampleServicePrincipal = current.then(current => azuread.getServicePrincipal({ + * objectId: current.objectId, + * })); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.postgresql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLogin: "adminTerraform", + * administratorPassword: "QAZwsx123", + * storageMb: 32768, + * version: "12", + * skuName: "GP_Standard_D2s_v3", + * zone: "2", + * authentication: { + * activeDirectoryAuthEnabled: true, + * tenantId: current.then(current => current.tenantId), + * }, + * }); + * const exampleFlexibleServerActiveDirectoryAdministrator = new azure.postgresql.FlexibleServerActiveDirectoryAdministrator("exampleFlexibleServerActiveDirectoryAdministrator", { + * serverName: exampleFlexibleServer.name, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.objectId), + * principalName: exampleServicePrincipal.then(exampleServicePrincipal => exampleServicePrincipal.displayName), + * principalType: "ServicePrincipal", + * }); + * ``` + * * ## Import * * A PostgreSQL Flexible Server Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/flexibleServerConfiguration.ts b/sdk/nodejs/postgresql/flexibleServerConfiguration.ts index 907403c4f0..9e8a90a26f 100644 --- a/sdk/nodejs/postgresql/flexibleServerConfiguration.ts +++ b/sdk/nodejs/postgresql/flexibleServerConfiguration.ts @@ -7,6 +7,49 @@ import * as utilities from "../utilities"; /** * Sets a PostgreSQL Configuration value on a Azure PostgreSQL Flexible Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.postgresql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12", + * administratorLogin: "psqladmin", + * administratorPassword: "H@Sh1CoR3!", + * storageMb: 32768, + * skuName: "GP_Standard_D4s_v3", + * }); + * const exampleFlexibleServerConfiguration = new azure.postgresql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", { + * serverId: exampleFlexibleServer.id, + * value: "on", + * }); + * ``` + * ### Azure Extensions + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.postgresql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12", + * administratorLogin: "psqladmin", + * administratorPassword: "H@Sh1CoR3!", + * storageMb: 32768, + * skuName: "GP_Standard_D4s_v3", + * }); + * const exampleFlexibleServerConfiguration = new azure.postgresql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", { + * serverId: exampleFlexibleServer.id, + * value: "CUBE,CITEXT,BTREE_GIST", + * }); + * ``` + * * ## Import * * PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/flexibleServerDatabase.ts b/sdk/nodejs/postgresql/flexibleServerDatabase.ts index 62de232218..2c59d32744 100644 --- a/sdk/nodejs/postgresql/flexibleServerDatabase.ts +++ b/sdk/nodejs/postgresql/flexibleServerDatabase.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a PostgreSQL Flexible Server Database. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.postgresql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12", + * administratorLogin: "psqladmin", + * administratorPassword: "H@Sh1CoR3!", + * storageMb: 32768, + * skuName: "GP_Standard_D4s_v3", + * }); + * const exampleFlexibleServerDatabase = new azure.postgresql.FlexibleServerDatabase("exampleFlexibleServerDatabase", { + * serverId: exampleFlexibleServer.id, + * collation: "en_US.utf8", + * charset: "utf8", + * }); + * ``` + * * ## Import * * Azure PostgreSQL Flexible Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/flexibleServerFirewallRule.ts b/sdk/nodejs/postgresql/flexibleServerFirewallRule.ts index c5d0df3d15..56ca8272e7 100644 --- a/sdk/nodejs/postgresql/flexibleServerFirewallRule.ts +++ b/sdk/nodejs/postgresql/flexibleServerFirewallRule.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a PostgreSQL Flexible Server Firewall Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleFlexibleServer = new azure.postgresql.FlexibleServer("exampleFlexibleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12", + * administratorLogin: "psqladmin", + * administratorPassword: "H@Sh1CoR3!", + * storageMb: 32768, + * skuName: "GP_Standard_D4s_v3", + * }); + * const exampleFlexibleServerFirewallRule = new azure.postgresql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", { + * serverId: exampleFlexibleServer.id, + * startIpAddress: "122.122.0.0", + * endIpAddress: "122.122.0.0", + * }); + * ``` + * * ## Import * * PostgreSQL Flexible Server Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/getFlexibleServer.ts b/sdk/nodejs/postgresql/getFlexibleServer.ts index 9704a96daf..d12640e0b2 100644 --- a/sdk/nodejs/postgresql/getFlexibleServer.ts +++ b/sdk/nodejs/postgresql/getFlexibleServer.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing PostgreSQL Flexible Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.postgresql.getFlexibleServer({ + * name: "existing-postgresql-fs", + * resourceGroupName: "existing-postgresql-resgroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFlexibleServer(args: GetFlexibleServerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -87,6 +100,19 @@ export interface GetFlexibleServerResult { } /** * Use this data source to access information about an existing PostgreSQL Flexible Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.postgresql.getFlexibleServer({ + * name: "existing-postgresql-fs", + * resourceGroupName: "existing-postgresql-resgroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFlexibleServerOutput(args: GetFlexibleServerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFlexibleServer(a, opts)) diff --git a/sdk/nodejs/postgresql/getServer.ts b/sdk/nodejs/postgresql/getServer.ts index 5ecba6157a..8949064dd3 100644 --- a/sdk/nodejs/postgresql/getServer.ts +++ b/sdk/nodejs/postgresql/getServer.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing PostgreSQL Azure Database Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.postgresql.getServer({ + * name: "postgresql-server-1", + * resourceGroupName: "api-rg-pro", + * }); + * export const postgresqlServerId = example.then(example => example.id); + * ``` */ export function getServer(args: GetServerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -73,6 +86,19 @@ export interface GetServerResult { } /** * Use this data source to access information about an existing PostgreSQL Azure Database Server. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.postgresql.getServer({ + * name: "postgresql-server-1", + * resourceGroupName: "api-rg-pro", + * }); + * export const postgresqlServerId = example.then(example => example.id); + * ``` */ export function getServerOutput(args: GetServerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getServer(a, opts)) diff --git a/sdk/nodejs/postgresql/server.ts b/sdk/nodejs/postgresql/server.ts index 3186ff8cac..dbe9441214 100644 --- a/sdk/nodejs/postgresql/server.ts +++ b/sdk/nodejs/postgresql/server.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a PostgreSQL Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "psqladmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "GP_Gen5_4", + * version: "11", + * storageMb: 640000, + * backupRetentionDays: 7, + * geoRedundantBackupEnabled: true, + * autoGrowEnabled: true, + * publicNetworkAccessEnabled: false, + * sslEnforcementEnabled: true, + * sslMinimalTlsVersionEnforced: "TLS1_2", + * }); + * ``` + * * ## Import * * PostgreSQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/postgresql/serverKey.ts b/sdk/nodejs/postgresql/serverKey.ts index fa9b19ccc2..f3f604e254 100644 --- a/sdk/nodejs/postgresql/serverKey.ts +++ b/sdk/nodejs/postgresql/serverKey.ts @@ -7,6 +7,91 @@ import * as utilities from "../utilities"; /** * Manages a Customer Managed Key for a PostgreSQL Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * purgeProtectionEnabled: true, + * }); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * administratorLogin: "psqladmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * skuName: "GP_Gen5_2", + * version: "11", + * storageMb: 51200, + * sslEnforcementEnabled: true, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const server = new azure.keyvault.AccessPolicy("server", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleServer.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "UnwrapKey", + * "WrapKey", + * ], + * secretPermissions: ["Get"], + * }); + * const client = new azure.keyvault.AccessPolicy("client", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Get", + * "Create", + * "Delete", + * "List", + * "Restore", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * "Purge", + * "Encrypt", + * "Decrypt", + * "Sign", + * "Verify", + * "GetRotationPolicy", + * ], + * secretPermissions: ["Get"], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * client, + * server, + * ], + * }); + * const exampleServerKey = new azure.postgresql.ServerKey("exampleServerKey", { + * serverId: exampleServer.id, + * keyVaultKeyId: exampleKey.id, + * }); + * ``` + * * ## Import * * A PostgreSQL Server Key can be imported using the `resource id` of the PostgreSQL Server Key, e.g. diff --git a/sdk/nodejs/postgresql/virtualNetworkRule.ts b/sdk/nodejs/postgresql/virtualNetworkRule.ts index 1bdc0da872..76b00d361f 100644 --- a/sdk/nodejs/postgresql/virtualNetworkRule.ts +++ b/sdk/nodejs/postgresql/virtualNetworkRule.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; * * > **NOTE:** PostgreSQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/postgresql/concepts-data-access-and-security-vnet) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.7.29.0/29"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.7.29.0/29"], + * serviceEndpoints: ["Microsoft.Sql"], + * }); + * const exampleServer = new azure.postgresql.Server("exampleServer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "GP_Gen5_2", + * storageMb: 5120, + * backupRetentionDays: 7, + * administratorLogin: "psqladmin", + * administratorLoginPassword: "H@Sh1CoR3!", + * version: "9.5", + * sslEnforcementEnabled: true, + * }); + * const exampleVirtualNetworkRule = new azure.postgresql.VirtualNetworkRule("exampleVirtualNetworkRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleServer.name, + * subnetId: internal.id, + * ignoreMissingVnetServiceEndpoint: true, + * }); + * ``` + * * ## Import * * PostgreSQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/powerbi/embedded.ts b/sdk/nodejs/powerbi/embedded.ts index b2b98ba5d8..39989c6354 100644 --- a/sdk/nodejs/powerbi/embedded.ts +++ b/sdk/nodejs/powerbi/embedded.ts @@ -7,6 +7,21 @@ import * as utilities from "../utilities"; /** * Manages a PowerBI Embedded. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEmbedded = new azure.powerbi.Embedded("exampleEmbedded", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "A1", + * administrators: ["azsdktest@microsoft.com"], + * }); + * ``` + * * ## Import * * PowerBI Embedded can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/aaaarecord.ts b/sdk/nodejs/privatedns/aaaarecord.ts index d416fbd60a..dee9c4200a 100644 --- a/sdk/nodejs/privatedns/aaaarecord.ts +++ b/sdk/nodejs/privatedns/aaaarecord.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS AAAA Records within Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const testZone = new azure.privatedns.Zone("testZone", {resourceGroupName: example.name}); + * const testAAAARecord = new azure.privatedns.AAAARecord("testAAAARecord", { + * zoneName: testZone.name, + * resourceGroupName: example.name, + * ttl: 300, + * records: [ + * "fd5d:70bc:930e:d008:0000:0000:0000:7334", + * "fd5d:70bc:930e:d008::7335", + * ], + * }); + * ``` + * * ## Import * * Private DNS AAAA Records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/arecord.ts b/sdk/nodejs/privatedns/arecord.ts index 592875a625..0dd49bd533 100644 --- a/sdk/nodejs/privatedns/arecord.ts +++ b/sdk/nodejs/privatedns/arecord.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS A Records within Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleARecord = new azure.privatedns.ARecord("exampleARecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: ["10.0.180.17"], + * }); + * ``` + * * ## Import * * Private DNS A Records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/cnameRecord.ts b/sdk/nodejs/privatedns/cnameRecord.ts index 1e94d5fb9f..ea4360c4e7 100644 --- a/sdk/nodejs/privatedns/cnameRecord.ts +++ b/sdk/nodejs/privatedns/cnameRecord.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS CNAME Records within Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleCnameRecord = new azure.privatedns.CnameRecord("exampleCnameRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * record: "contoso.com", + * }); + * ``` + * * ## Import * * Private DNS CName Records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/getAAAARecord.ts b/sdk/nodejs/privatedns/getAAAARecord.ts index 93fbd9adeb..648b259a08 100644 --- a/sdk/nodejs/privatedns/getAAAARecord.ts +++ b/sdk/nodejs/privatedns/getAAAARecord.ts @@ -4,6 +4,20 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.AAAARecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsAaaaRecordId = example.id; + * ``` + */ export function getAAAARecord(args: GetAAAARecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -60,6 +74,20 @@ export interface GetAAAARecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.AAAARecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsAaaaRecordId = example.id; + * ``` + */ export function getAAAARecordOutput(args: GetAAAARecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAAAARecord(a, opts)) } diff --git a/sdk/nodejs/privatedns/getARecord.ts b/sdk/nodejs/privatedns/getARecord.ts index 90f6f65cc8..842bc0ceda 100644 --- a/sdk/nodejs/privatedns/getARecord.ts +++ b/sdk/nodejs/privatedns/getARecord.ts @@ -4,6 +4,21 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getARecord({ + * name: "test", + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsARecordId = example.then(example => example.id); + * ``` + */ export function getARecord(args: GetARecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -60,6 +75,21 @@ export interface GetARecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getARecord({ + * name: "test", + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsARecordId = example.then(example => example.id); + * ``` + */ export function getARecordOutput(args: GetARecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getARecord(a, opts)) } diff --git a/sdk/nodejs/privatedns/getCnameRecord.ts b/sdk/nodejs/privatedns/getCnameRecord.ts index a27e987dc5..2042b48891 100644 --- a/sdk/nodejs/privatedns/getCnameRecord.ts +++ b/sdk/nodejs/privatedns/getCnameRecord.ts @@ -4,6 +4,20 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.CnameRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsCnameRecordId = example.id; + * ``` + */ export function getCnameRecord(args: GetCnameRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -61,6 +75,20 @@ export interface GetCnameRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.CnameRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsCnameRecordId = example.id; + * ``` + */ export function getCnameRecordOutput(args: GetCnameRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCnameRecord(a, opts)) } diff --git a/sdk/nodejs/privatedns/getDnsZone.ts b/sdk/nodejs/privatedns/getDnsZone.ts index d0e3353c6b..b556c8c922 100644 --- a/sdk/nodejs/privatedns/getDnsZone.ts +++ b/sdk/nodejs/privatedns/getDnsZone.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Private DNS Zone. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getDnsZone({ + * name: "contoso.internal", + * resourceGroupName: "contoso-dns", + * }); + * export const privateDnsZoneId = example.then(example => example.id); + * ``` */ export function getDnsZone(args: GetDnsZoneArgs, opts?: pulumi.InvokeOptions): Promise { @@ -70,6 +83,19 @@ export interface GetDnsZoneResult { } /** * Use this data source to access information about an existing Private DNS Zone. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getDnsZone({ + * name: "contoso.internal", + * resourceGroupName: "contoso-dns", + * }); + * export const privateDnsZoneId = example.then(example => example.id); + * ``` */ export function getDnsZoneOutput(args: GetDnsZoneOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDnsZone(a, opts)) diff --git a/sdk/nodejs/privatedns/getMxRecord.ts b/sdk/nodejs/privatedns/getMxRecord.ts index 6cdb6da835..9a08e15c37 100644 --- a/sdk/nodejs/privatedns/getMxRecord.ts +++ b/sdk/nodejs/privatedns/getMxRecord.ts @@ -6,6 +6,20 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.MxRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsMxRecordId = example.id; + * ``` + */ export function getMxRecord(args: GetMxRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -62,6 +76,20 @@ export interface GetMxRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.MxRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsMxRecordId = example.id; + * ``` + */ export function getMxRecordOutput(args: GetMxRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getMxRecord(a, opts)) } diff --git a/sdk/nodejs/privatedns/getPtrRecord.ts b/sdk/nodejs/privatedns/getPtrRecord.ts index 5c1b622f1c..02537de913 100644 --- a/sdk/nodejs/privatedns/getPtrRecord.ts +++ b/sdk/nodejs/privatedns/getPtrRecord.ts @@ -4,6 +4,20 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.PTRRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsPtrRecordId = example.id; + * ``` + */ export function getPtrRecord(args: GetPtrRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -60,6 +74,20 @@ export interface GetPtrRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.PTRRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsPtrRecordId = example.id; + * ``` + */ export function getPtrRecordOutput(args: GetPtrRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPtrRecord(a, opts)) } diff --git a/sdk/nodejs/privatedns/getResolver.ts b/sdk/nodejs/privatedns/getResolver.ts index db8c710655..366564ab8a 100644 --- a/sdk/nodejs/privatedns/getResolver.ts +++ b/sdk/nodejs/privatedns/getResolver.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Gets information about an existing Private DNS Resolver. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.privatedns.getResolver({ + * name: "example", + * resourceGroupName: "example-resourcegroup-name", + * }); + * ``` */ export function getResolver(args: GetResolverArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +67,18 @@ export interface GetResolverResult { } /** * Gets information about an existing Private DNS Resolver. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const test = azure.privatedns.getResolver({ + * name: "example", + * resourceGroupName: "example-resourcegroup-name", + * }); + * ``` */ export function getResolverOutput(args: GetResolverOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getResolver(a, opts)) diff --git a/sdk/nodejs/privatedns/getResolverDnsForwardingRuleset.ts b/sdk/nodejs/privatedns/getResolverDnsForwardingRuleset.ts index 073a865cec..f885b0dd96 100644 --- a/sdk/nodejs/privatedns/getResolverDnsForwardingRuleset.ts +++ b/sdk/nodejs/privatedns/getResolverDnsForwardingRuleset.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Gets information about an existing Private DNS Resolver Dns Forwarding Ruleset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverDnsForwardingRuleset({ + * name: "example-ruleset", + * resourceGroupName: "example-ruleset-resourcegroup", + * }); + * ``` */ export function getResolverDnsForwardingRuleset(args: GetResolverDnsForwardingRulesetArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +67,18 @@ export interface GetResolverDnsForwardingRulesetResult { } /** * Gets information about an existing Private DNS Resolver Dns Forwarding Ruleset. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverDnsForwardingRuleset({ + * name: "example-ruleset", + * resourceGroupName: "example-ruleset-resourcegroup", + * }); + * ``` */ export function getResolverDnsForwardingRulesetOutput(args: GetResolverDnsForwardingRulesetOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getResolverDnsForwardingRuleset(a, opts)) diff --git a/sdk/nodejs/privatedns/getResolverForwardingRule.ts b/sdk/nodejs/privatedns/getResolverForwardingRule.ts index 4e58e14612..11efe50d44 100644 --- a/sdk/nodejs/privatedns/getResolverForwardingRule.ts +++ b/sdk/nodejs/privatedns/getResolverForwardingRule.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Gets information about an existing Private DNS Resolver Forwarding Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverForwardingRule({ + * dnsForwardingRulesetId: "example-forwarding-rulset-id", + * name: "example-rule", + * }); + * ``` */ export function getResolverForwardingRule(args: GetResolverForwardingRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +73,18 @@ export interface GetResolverForwardingRuleResult { } /** * Gets information about an existing Private DNS Resolver Forwarding Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverForwardingRule({ + * dnsForwardingRulesetId: "example-forwarding-rulset-id", + * name: "example-rule", + * }); + * ``` */ export function getResolverForwardingRuleOutput(args: GetResolverForwardingRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getResolverForwardingRule(a, opts)) diff --git a/sdk/nodejs/privatedns/getResolverInboundEndpoint.ts b/sdk/nodejs/privatedns/getResolverInboundEndpoint.ts index f193fa414c..73a17a2ec8 100644 --- a/sdk/nodejs/privatedns/getResolverInboundEndpoint.ts +++ b/sdk/nodejs/privatedns/getResolverInboundEndpoint.ts @@ -8,6 +8,18 @@ import * as utilities from "../utilities"; /** * Gets information about an existing Private DNS Resolver Inbound Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverInboundEndpoint({ + * name: "example-drie", + * privateDnsResolverId: "example-private-dns-resolver-id", + * }); + * ``` */ export function getResolverInboundEndpoint(args: GetResolverInboundEndpointArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +69,18 @@ export interface GetResolverInboundEndpointResult { } /** * Gets information about an existing Private DNS Resolver Inbound Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverInboundEndpoint({ + * name: "example-drie", + * privateDnsResolverId: "example-private-dns-resolver-id", + * }); + * ``` */ export function getResolverInboundEndpointOutput(args: GetResolverInboundEndpointOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getResolverInboundEndpoint(a, opts)) diff --git a/sdk/nodejs/privatedns/getResolverOutboundEndpoint.ts b/sdk/nodejs/privatedns/getResolverOutboundEndpoint.ts index e2dfafc63b..feed0e2ca7 100644 --- a/sdk/nodejs/privatedns/getResolverOutboundEndpoint.ts +++ b/sdk/nodejs/privatedns/getResolverOutboundEndpoint.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Gets information about an existing Private DNS Resolver Outbound Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverOutboundEndpoint({ + * name: "example-endpoint", + * privateDnsResolverId: "example-private-dns-resolver-id", + * }); + * ``` */ export function getResolverOutboundEndpoint(args: GetResolverOutboundEndpointArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +67,18 @@ export interface GetResolverOutboundEndpointResult { } /** * Gets information about an existing Private DNS Resolver Outbound Endpoint. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverOutboundEndpoint({ + * name: "example-endpoint", + * privateDnsResolverId: "example-private-dns-resolver-id", + * }); + * ``` */ export function getResolverOutboundEndpointOutput(args: GetResolverOutboundEndpointOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getResolverOutboundEndpoint(a, opts)) diff --git a/sdk/nodejs/privatedns/getResolverVirtualNetworkLink.ts b/sdk/nodejs/privatedns/getResolverVirtualNetworkLink.ts index 8825d967cd..27547fee6c 100644 --- a/sdk/nodejs/privatedns/getResolverVirtualNetworkLink.ts +++ b/sdk/nodejs/privatedns/getResolverVirtualNetworkLink.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Gets information about an existing Private DNS Resolver Virtual Network Link. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverVirtualNetworkLink({ + * dnsForwardingRulesetId: "example-dns-forwarding-ruleset-id", + * name: "example-link", + * }); + * ``` */ export function getResolverVirtualNetworkLink(args: GetResolverVirtualNetworkLinkArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +63,18 @@ export interface GetResolverVirtualNetworkLinkResult { } /** * Gets information about an existing Private DNS Resolver Virtual Network Link. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getResolverVirtualNetworkLink({ + * dnsForwardingRulesetId: "example-dns-forwarding-ruleset-id", + * name: "example-link", + * }); + * ``` */ export function getResolverVirtualNetworkLinkOutput(args: GetResolverVirtualNetworkLinkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getResolverVirtualNetworkLink(a, opts)) diff --git a/sdk/nodejs/privatedns/getSrvRecord.ts b/sdk/nodejs/privatedns/getSrvRecord.ts index 183007eb60..6345601d7b 100644 --- a/sdk/nodejs/privatedns/getSrvRecord.ts +++ b/sdk/nodejs/privatedns/getSrvRecord.ts @@ -6,6 +6,20 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.SRVRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsSrvRecordId = example.id; + * ``` + */ export function getSrvRecord(args: GetSrvRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -62,6 +76,20 @@ export interface GetSrvRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.SRVRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsSrvRecordId = example.id; + * ``` + */ export function getSrvRecordOutput(args: GetSrvRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSrvRecord(a, opts)) } diff --git a/sdk/nodejs/privatedns/getTxtRecord.ts b/sdk/nodejs/privatedns/getTxtRecord.ts index 0830d73d04..b2fed85073 100644 --- a/sdk/nodejs/privatedns/getTxtRecord.ts +++ b/sdk/nodejs/privatedns/getTxtRecord.ts @@ -6,6 +6,20 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; import * as utilities from "../utilities"; +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.TxtRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsTxtRecordId = example.id; + * ``` + */ export function getTxtRecord(args: GetTxtRecordArgs, opts?: pulumi.InvokeOptions): Promise { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); @@ -62,6 +76,20 @@ export interface GetTxtRecordResult { readonly ttl: number; readonly zoneName: string; } +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.privatedns.TxtRecord("example", { + * zoneName: "test-zone", + * resourceGroupName: "test-rg", + * }); + * export const privateDnsTxtRecordId = example.id; + * ``` + */ export function getTxtRecordOutput(args: GetTxtRecordOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTxtRecord(a, opts)) } diff --git a/sdk/nodejs/privatedns/getZoneVirtualNetworkLink.ts b/sdk/nodejs/privatedns/getZoneVirtualNetworkLink.ts index 5b5103ce18..890fff0966 100644 --- a/sdk/nodejs/privatedns/getZoneVirtualNetworkLink.ts +++ b/sdk/nodejs/privatedns/getZoneVirtualNetworkLink.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Private DNS zone Virtual Network Link. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getZoneVirtualNetworkLink({ + * name: "test", + * resourceGroupName: "test-rg", + * privateDnsZoneName: "test-zone", + * }); + * export const privateDnsARecordId = example.then(example => example.id); + * ``` */ export function getZoneVirtualNetworkLink(args: GetZoneVirtualNetworkLinkArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +75,20 @@ export interface GetZoneVirtualNetworkLinkResult { } /** * Use this data source to access information about an existing Private DNS zone Virtual Network Link. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatedns.getZoneVirtualNetworkLink({ + * name: "test", + * resourceGroupName: "test-rg", + * privateDnsZoneName: "test-zone", + * }); + * export const privateDnsARecordId = example.then(example => example.id); + * ``` */ export function getZoneVirtualNetworkLinkOutput(args: GetZoneVirtualNetworkLinkOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getZoneVirtualNetworkLink(a, opts)) diff --git a/sdk/nodejs/privatedns/linkService.ts b/sdk/nodejs/privatedns/linkService.ts index fb06016b66..e64961d2bf 100644 --- a/sdk/nodejs/privatedns/linkService.ts +++ b/sdk/nodejs/privatedns/linkService.ts @@ -11,6 +11,64 @@ import * as utilities from "../utilities"; * * > **NOTE** Private Link is now in [GA](https://docs.microsoft.com/en-gb/azure/private-link/). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.5.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.1.0/24"], + * enforcePrivateLinkServiceNetworkPolicies: true, + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * sku: "Standard", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * sku: "Standard", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: examplePublicIp.name, + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleLinkService = new azure.privatedns.LinkService("exampleLinkService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * autoApprovalSubscriptionIds: ["00000000-0000-0000-0000-000000000000"], + * visibilitySubscriptionIds: ["00000000-0000-0000-0000-000000000000"], + * loadBalancerFrontendIpConfigurationIds: [exampleLoadBalancer.frontendIpConfigurations.apply(frontendIpConfigurations => frontendIpConfigurations?.[0]?.id)], + * natIpConfigurations: [ + * { + * name: "primary", + * privateIpAddress: "10.5.1.17", + * privateIpAddressVersion: "IPv4", + * subnetId: exampleSubnet.id, + * primary: true, + * }, + * { + * name: "secondary", + * privateIpAddress: "10.5.1.18", + * privateIpAddressVersion: "IPv4", + * subnetId: exampleSubnet.id, + * primary: false, + * }, + * ], + * }); + * ``` + * * ## Import * * Private Link Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/mxRecord.ts b/sdk/nodejs/privatedns/mxRecord.ts index e61a1c279e..b54c64d436 100644 --- a/sdk/nodejs/privatedns/mxRecord.ts +++ b/sdk/nodejs/privatedns/mxRecord.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS MX Records within Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleMxRecord = new azure.privatedns.MxRecord("exampleMxRecord", { + * resourceGroupName: exampleResourceGroup.name, + * zoneName: exampleZone.name, + * ttl: 300, + * records: [ + * { + * preference: 10, + * exchange: "mx1.contoso.com", + * }, + * { + * preference: 20, + * exchange: "backupmx.contoso.com", + * }, + * ], + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Private DNS MX Records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/ptrrecord.ts b/sdk/nodejs/privatedns/ptrrecord.ts index 558c5bbf92..015aec96a7 100644 --- a/sdk/nodejs/privatedns/ptrrecord.ts +++ b/sdk/nodejs/privatedns/ptrrecord.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS PTR Records within Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const examplePTRRecord = new azure.privatedns.PTRRecord("examplePTRRecord", { + * zoneName: exampleZone.name, + * resourceGroupName: exampleResourceGroup.name, + * ttl: 300, + * records: ["test.example.com"], + * }); + * ``` + * * ## Import * * Private DNS PTR Records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/resolver.ts b/sdk/nodejs/privatedns/resolver.ts index 3b700dd2c3..779ea067a4 100644 --- a/sdk/nodejs/privatedns/resolver.ts +++ b/sdk/nodejs/privatedns/resolver.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Private DNS Resolver. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const test = new azure.privatedns.Resolver("test", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualNetworkId: exampleVirtualNetwork.id, + * }); + * ``` + * * ## Import * * DNS Resolver can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/resolverDnsForwardingRuleset.ts b/sdk/nodejs/privatedns/resolverDnsForwardingRuleset.ts index a09f5d6eb0..9bae3d12fb 100644 --- a/sdk/nodejs/privatedns/resolverDnsForwardingRuleset.ts +++ b/sdk/nodejs/privatedns/resolverDnsForwardingRuleset.ts @@ -7,6 +7,53 @@ import * as utilities from "../utilities"; /** * Manages a Private DNS Resolver Dns Forwarding Ruleset. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.64/28"], + * delegations: [{ + * name: "Microsoft.Network.dnsResolvers", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * name: "Microsoft.Network/dnsResolvers", + * }, + * }], + * }); + * const exampleResolver = new azure.privatedns.Resolver("exampleResolver", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualNetworkId: exampleVirtualNetwork.id, + * }); + * const exampleResolverOutboundEndpoint = new azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", { + * privateDnsResolverId: exampleResolver.id, + * location: exampleResolver.location, + * subnetId: exampleSubnet.id, + * tags: { + * key: "value", + * }, + * }); + * const exampleResolverDnsForwardingRuleset = new azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * privateDnsResolverOutboundEndpointIds: [exampleResolverOutboundEndpoint.id], + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Private DNS Resolver Dns Forwarding Ruleset can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/resolverForwardingRule.ts b/sdk/nodejs/privatedns/resolverForwardingRule.ts index 5fffdf8ea8..c911927921 100644 --- a/sdk/nodejs/privatedns/resolverForwardingRule.ts +++ b/sdk/nodejs/privatedns/resolverForwardingRule.ts @@ -9,6 +9,62 @@ import * as utilities from "../utilities"; /** * Manages a Private DNS Resolver Forwarding Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.64/28"], + * delegations: [{ + * name: "Microsoft.Network.dnsResolvers", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * name: "Microsoft.Network/dnsResolvers", + * }, + * }], + * }); + * const exampleResolver = new azure.privatedns.Resolver("exampleResolver", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualNetworkId: exampleVirtualNetwork.id, + * }); + * const exampleResolverOutboundEndpoint = new azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", { + * privateDnsResolverId: exampleResolver.id, + * location: exampleResolver.location, + * subnetId: exampleSubnet.id, + * tags: { + * key: "value", + * }, + * }); + * const exampleResolverDnsForwardingRuleset = new azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * privateDnsResolverOutboundEndpointIds: [exampleResolverOutboundEndpoint.id], + * }); + * const exampleResolverForwardingRule = new azure.privatedns.ResolverForwardingRule("exampleResolverForwardingRule", { + * dnsForwardingRulesetId: exampleResolverDnsForwardingRuleset.id, + * domainName: "onprem.local.", + * enabled: true, + * targetDnsServers: [{ + * ipAddress: "10.10.0.1", + * port: 53, + * }], + * metadata: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Private DNS Resolver Forwarding Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/resolverInboundEndpoint.ts b/sdk/nodejs/privatedns/resolverInboundEndpoint.ts index d49ccd7309..ad18ac36f6 100644 --- a/sdk/nodejs/privatedns/resolverInboundEndpoint.ts +++ b/sdk/nodejs/privatedns/resolverInboundEndpoint.ts @@ -9,6 +9,48 @@ import * as utilities from "../utilities"; /** * Manages a Private DNS Resolver Inbound Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleResolver = new azure.privatedns.Resolver("exampleResolver", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualNetworkId: exampleVirtualNetwork.id, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/28"], + * delegations: [{ + * name: "Microsoft.Network.dnsResolvers", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * name: "Microsoft.Network/dnsResolvers", + * }, + * }], + * }); + * const exampleResolverInboundEndpoint = new azure.privatedns.ResolverInboundEndpoint("exampleResolverInboundEndpoint", { + * privateDnsResolverId: exampleResolver.id, + * location: exampleResolver.location, + * ipConfigurations: [{ + * privateIpAllocationMethod: "Dynamic", + * subnetId: exampleSubnet.id, + * }], + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Private DNS Resolver Inbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/resolverOutboundEndpoint.ts b/sdk/nodejs/privatedns/resolverOutboundEndpoint.ts index a51fc401a7..5786a6949c 100644 --- a/sdk/nodejs/privatedns/resolverOutboundEndpoint.ts +++ b/sdk/nodejs/privatedns/resolverOutboundEndpoint.ts @@ -7,6 +7,45 @@ import * as utilities from "../utilities"; /** * Manages a Private DNS Resolver Outbound Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.64/28"], + * delegations: [{ + * name: "Microsoft.Network.dnsResolvers", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * name: "Microsoft.Network/dnsResolvers", + * }, + * }], + * }); + * const exampleResolver = new azure.privatedns.Resolver("exampleResolver", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualNetworkId: exampleVirtualNetwork.id, + * }); + * const exampleResolverOutboundEndpoint = new azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", { + * privateDnsResolverId: exampleResolver.id, + * location: exampleResolver.location, + * subnetId: exampleSubnet.id, + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Private DNS Resolver Outbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/resolverVirtualNetworkLink.ts b/sdk/nodejs/privatedns/resolverVirtualNetworkLink.ts index d680630913..16dbbb946c 100644 --- a/sdk/nodejs/privatedns/resolverVirtualNetworkLink.ts +++ b/sdk/nodejs/privatedns/resolverVirtualNetworkLink.ts @@ -7,6 +7,60 @@ import * as utilities from "../utilities"; /** * Manages a Private DNS Resolver Virtual Network Link. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.64/28"], + * delegations: [{ + * name: "Microsoft.Network.dnsResolvers", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/subnets/join/action"], + * name: "Microsoft.Network/dnsResolvers", + * }, + * }], + * }); + * const exampleResolver = new azure.privatedns.Resolver("exampleResolver", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * virtualNetworkId: exampleVirtualNetwork.id, + * }); + * const exampleResolverOutboundEndpoint = new azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", { + * privateDnsResolverId: exampleResolver.id, + * location: exampleResolver.location, + * subnetId: exampleSubnet.id, + * tags: { + * key: "value", + * }, + * }); + * const exampleResolverDnsForwardingRuleset = new azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * privateDnsResolverOutboundEndpointIds: [exampleResolverOutboundEndpoint.id], + * tags: { + * key: "value", + * }, + * }); + * const exampleResolverVirtualNetworkLink = new azure.privatedns.ResolverVirtualNetworkLink("exampleResolverVirtualNetworkLink", { + * dnsForwardingRulesetId: exampleResolverDnsForwardingRuleset.id, + * virtualNetworkId: exampleVirtualNetwork.id, + * metadata: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Private DNS Resolver Virtual Network Link can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/srvrecord.ts b/sdk/nodejs/privatedns/srvrecord.ts index a1abd56cda..57cccfbf69 100644 --- a/sdk/nodejs/privatedns/srvrecord.ts +++ b/sdk/nodejs/privatedns/srvrecord.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS SRV Records within Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleSRVRecord = new azure.privatedns.SRVRecord("exampleSRVRecord", { + * resourceGroupName: exampleResourceGroup.name, + * zoneName: exampleZone.name, + * ttl: 300, + * records: [ + * { + * priority: 1, + * weight: 5, + * port: 8080, + * target: "target1.contoso.com", + * }, + * { + * priority: 10, + * weight: 10, + * port: 8080, + * target: "target2.contoso.com", + * }, + * ], + * tags: { + * Environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Private DNS SRV Records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/txtRecord.ts b/sdk/nodejs/privatedns/txtRecord.ts index e4f7fca60b..11876d5d82 100644 --- a/sdk/nodejs/privatedns/txtRecord.ts +++ b/sdk/nodejs/privatedns/txtRecord.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Enables you to manage DNS TXT Records within Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleTxtRecord = new azure.privatedns.TxtRecord("exampleTxtRecord", { + * resourceGroupName: exampleResourceGroup.name, + * zoneName: exampleZone.name, + * ttl: 300, + * records: [{ + * value: "v=spf1 mx ~all", + * }], + * }); + * ``` + * * ## Import * * Private DNS TXT Records can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/zone.ts b/sdk/nodejs/privatedns/zone.ts index 750f138fc6..648a8e29c2 100644 --- a/sdk/nodejs/privatedns/zone.ts +++ b/sdk/nodejs/privatedns/zone.ts @@ -9,6 +9,16 @@ import * as utilities from "../utilities"; /** * Enables you to manage Private DNS zones within Azure DNS. These zones are hosted on Azure's name servers. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * ``` + * * ## Import * * Private DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatedns/zoneVirtualNetworkLink.ts b/sdk/nodejs/privatedns/zoneVirtualNetworkLink.ts index f61d449a64..f3511303f6 100644 --- a/sdk/nodejs/privatedns/zoneVirtualNetworkLink.ts +++ b/sdk/nodejs/privatedns/zoneVirtualNetworkLink.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Enables you to manage Private DNS zone Virtual Network Links. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleZone = new azure.privatedns.Zone("exampleZone", {resourceGroupName: exampleResourceGroup.name}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleZoneVirtualNetworkLink = new azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", { + * resourceGroupName: exampleResourceGroup.name, + * privateDnsZoneName: exampleZone.name, + * virtualNetworkId: exampleVirtualNetwork.id, + * }); + * ``` + * * ## Import * * Private DNS Zone Virtual Network Links can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatelink/applicationSecurityGroupAssociation.ts b/sdk/nodejs/privatelink/applicationSecurityGroupAssociation.ts index 14069feb92..4e83126924 100644 --- a/sdk/nodejs/privatelink/applicationSecurityGroupAssociation.ts +++ b/sdk/nodejs/privatelink/applicationSecurityGroupAssociation.ts @@ -7,6 +7,78 @@ import * as utilities from "../utilities"; /** * Manages an association between Private Endpoint and Application Security Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getSubscription({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.5.0.0/16"], + * }); + * const service = new azure.network.Subnet("service", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.1.0/24"], + * enforcePrivateLinkServiceNetworkPolicies: true, + * }); + * const endpoint = new azure.network.Subnet("endpoint", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.2.0/24"], + * enforcePrivateLinkEndpointNetworkPolicies: true, + * }); + * const examplePublicIp = new azure.network.PublicIp("examplePublicIp", { + * sku: "Standard", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * allocationMethod: "Static", + * }); + * const exampleLoadBalancer = new azure.lb.LoadBalancer("exampleLoadBalancer", { + * sku: "Standard", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * frontendIpConfigurations: [{ + * name: examplePublicIp.name, + * publicIpAddressId: examplePublicIp.id, + * }], + * }); + * const exampleLinkService = new azure.privatedns.LinkService("exampleLinkService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * autoApprovalSubscriptionIds: [current.then(current => current.subscriptionId)], + * visibilitySubscriptionIds: [current.then(current => current.subscriptionId)], + * natIpConfigurations: [{ + * name: "primaryIpConfiguration", + * primary: true, + * subnetId: service.id, + * }], + * loadBalancerFrontendIpConfigurationIds: [exampleLoadBalancer.frontendIpConfigurations.apply(frontendIpConfigurations => frontendIpConfigurations?.[0]?.id)], + * }); + * const exampleEndpoint = new azure.privatelink.Endpoint("exampleEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subnetId: endpoint.id, + * privateServiceConnection: { + * name: exampleLinkService.name, + * isManualConnection: false, + * privateConnectionResourceId: exampleLinkService.id, + * }, + * }); + * const exampleApplicationSecurityGroup = new azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleApplicationSecurityGroupAssociation = new azure.privatelink.ApplicationSecurityGroupAssociation("exampleApplicationSecurityGroupAssociation", { + * privateEndpointId: exampleEndpoint.id, + * applicationSecurityGroupId: exampleApplicationSecurityGroup.id, + * }); + * ``` + * * ## Import * * Associations between Private Endpoint and Application Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/privatelink/getEndpointConnection.ts b/sdk/nodejs/privatelink/getEndpointConnection.ts index a7c9e18bb7..8004965bde 100644 --- a/sdk/nodejs/privatelink/getEndpointConnection.ts +++ b/sdk/nodejs/privatelink/getEndpointConnection.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access the connection status information about an existing Private Endpoint Connection. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatelink.getEndpointConnection({ + * name: "example-private-endpoint", + * resourceGroupName: "example-rg", + * }); + * export const privateEndpointStatus = example.then(example => example.privateServiceConnections?.[0]?.status); + * ``` */ export function getEndpointConnection(args: GetEndpointConnectionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -54,6 +67,19 @@ export interface GetEndpointConnectionResult { } /** * Use this data source to access the connection status information about an existing Private Endpoint Connection. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatelink.getEndpointConnection({ + * name: "example-private-endpoint", + * resourceGroupName: "example-rg", + * }); + * export const privateEndpointStatus = example.then(example => example.privateServiceConnections?.[0]?.status); + * ``` */ export function getEndpointConnectionOutput(args: GetEndpointConnectionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEndpointConnection(a, opts)) diff --git a/sdk/nodejs/privatelink/getService.ts b/sdk/nodejs/privatelink/getService.ts index 7a7fe950f4..e9f722747d 100644 --- a/sdk/nodejs/privatelink/getService.ts +++ b/sdk/nodejs/privatelink/getService.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Private Link Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatelink.getService({ + * name: "myPrivateLinkService", + * resourceGroupName: "PrivateLinkServiceRG", + * }); + * export const privateLinkServiceId = example.then(example => example.id); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -80,6 +93,19 @@ export interface GetServiceResult { } /** * Use this data source to access information about an existing Private Link Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatelink.getService({ + * name: "myPrivateLinkService", + * resourceGroupName: "PrivateLinkServiceRG", + * }); + * export const privateLinkServiceId = example.then(example => example.id); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/privatelink/getServiceEndpointConnections.ts b/sdk/nodejs/privatelink/getServiceEndpointConnections.ts index d4e8c7e60c..66e9e4ec0c 100644 --- a/sdk/nodejs/privatelink/getServiceEndpointConnections.ts +++ b/sdk/nodejs/privatelink/getServiceEndpointConnections.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access endpoint connection information about an existing Private Link Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatelink.getServiceEndpointConnections({ + * serviceId: azurerm_private_link_service.example.id, + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const privateEndpointStatus = example.then(example => example.privateEndpointConnections?.[0]?.status); + * ``` */ export function getServiceEndpointConnections(args: GetServiceEndpointConnectionsArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +64,19 @@ export interface GetServiceEndpointConnectionsResult { } /** * Use this data source to access endpoint connection information about an existing Private Link Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.privatelink.getServiceEndpointConnections({ + * serviceId: azurerm_private_link_service.example.id, + * resourceGroupName: azurerm_resource_group.example.name, + * }); + * export const privateEndpointStatus = example.then(example => example.privateEndpointConnections?.[0]?.status); + * ``` */ export function getServiceEndpointConnectionsOutput(args: GetServiceEndpointConnectionsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getServiceEndpointConnections(a, opts)) diff --git a/sdk/nodejs/proximity/getPlacementGroup.ts b/sdk/nodejs/proximity/getPlacementGroup.ts index 571dd8a9fa..8ad9393c1f 100644 --- a/sdk/nodejs/proximity/getPlacementGroup.ts +++ b/sdk/nodejs/proximity/getPlacementGroup.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Proximity Placement Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.proximity.getPlacementGroup({ + * name: "tf-appsecuritygroup", + * resourceGroupName: "my-resource-group", + * }); + * export const proximityPlacementGroupId = example.then(example => example.id); + * ``` */ export function getPlacementGroup(args: GetPlacementGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -45,6 +58,19 @@ export interface GetPlacementGroupResult { } /** * Use this data source to access information about an existing Proximity Placement Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.proximity.getPlacementGroup({ + * name: "tf-appsecuritygroup", + * resourceGroupName: "my-resource-group", + * }); + * export const proximityPlacementGroupId = example.then(example => example.id); + * ``` */ export function getPlacementGroupOutput(args: GetPlacementGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPlacementGroup(a, opts)) diff --git a/sdk/nodejs/proximity/placementGroup.ts b/sdk/nodejs/proximity/placementGroup.ts index 583af2bbe1..2ccc846f5d 100644 --- a/sdk/nodejs/proximity/placementGroup.ts +++ b/sdk/nodejs/proximity/placementGroup.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a proximity placement group for virtual machines, virtual machine scale sets and availability sets. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePlacementGroup = new azure.proximity.PlacementGroup("examplePlacementGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Proximity Placement Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/purview/account.ts b/sdk/nodejs/purview/account.ts index 3289b489f9..635b2912c0 100644 --- a/sdk/nodejs/purview/account.ts +++ b/sdk/nodejs/purview/account.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; /** * Manages a Purview Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.purview.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` + * * ## Import * * Purview Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/recoveryservices/getVault.ts b/sdk/nodejs/recoveryservices/getVault.ts index 909b5ce9ce..fef47ae9b3 100644 --- a/sdk/nodejs/recoveryservices/getVault.ts +++ b/sdk/nodejs/recoveryservices/getVault.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Recovery Services Vault. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const vault = azure.recoveryservices.getVault({ + * name: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getVault(args: GetVaultArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +67,18 @@ export interface GetVaultResult { } /** * Use this data source to access information about an existing Recovery Services Vault. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const vault = azure.recoveryservices.getVault({ + * name: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getVaultOutput(args: GetVaultOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getVault(a, opts)) diff --git a/sdk/nodejs/recoveryservices/vault.ts b/sdk/nodejs/recoveryservices/vault.ts index 64e938e877..c3842d0037 100644 --- a/sdk/nodejs/recoveryservices/vault.ts +++ b/sdk/nodejs/recoveryservices/vault.ts @@ -9,6 +9,21 @@ import * as utilities from "../utilities"; /** * Manages a Recovery Services Vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: example.location, + * resourceGroupName: example.name, + * sku: "Standard", + * softDeleteEnabled: true, + * }); + * ``` + * * ## Import * * Recovery Services Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/recoveryservices/vaultResourceGuardAssociation.ts b/sdk/nodejs/recoveryservices/vaultResourceGuardAssociation.ts index b148d3692a..39b161c1ee 100644 --- a/sdk/nodejs/recoveryservices/vaultResourceGuardAssociation.ts +++ b/sdk/nodejs/recoveryservices/vaultResourceGuardAssociation.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an association of a Resource Guard and Recovery Services Vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleResourceGuard = new azure.dataprotection.ResourceGuard("exampleResourceGuard", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * softDeleteEnabled: true, + * }); + * const test = new azure.recoveryservices.VaultResourceGuardAssociation("test", { + * vaultId: azurerm_recovery_services_vault.test.id, + * resourceGuardId: azurerm_data_protection_resource_guard.test.id, + * }); + * ``` + * * ## Import * * Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/redis/cache.ts b/sdk/nodejs/redis/cache.ts index 5b58cb8132..d67d8ad855 100644 --- a/sdk/nodejs/redis/cache.ts +++ b/sdk/nodejs/redis/cache.ts @@ -11,6 +11,27 @@ import * as utilities from "../utilities"; * * > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines) * + * ## Example Usage + * + * This example provisions a Standard Redis Cache. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * // NOTE: the Name used for Redis needs to be globally unique + * const exampleCache = new azure.redis.Cache("exampleCache", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * capacity: 2, + * family: "C", + * skuName: "Standard", + * enableNonSslPort: false, + * minimumTlsVersion: "1.2", + * redisConfiguration: {}, + * }); + * ``` * ## Relevant Links * * * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq) diff --git a/sdk/nodejs/redis/enterpriseCluster.ts b/sdk/nodejs/redis/enterpriseCluster.ts index 5389f3a54d..f4628bb103 100644 --- a/sdk/nodejs/redis/enterpriseCluster.ts +++ b/sdk/nodejs/redis/enterpriseCluster.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manages a Redis Enterprise Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEnterpriseCluster = new azure.redis.EnterpriseCluster("exampleEnterpriseCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "EnterpriseFlash_F300-3", + * }); + * ``` + * * ## Import * * Redis Enterprise Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/redis/enterpriseDatabase.ts b/sdk/nodejs/redis/enterpriseDatabase.ts index cefc2f08f9..2fb469b7d6 100644 --- a/sdk/nodejs/redis/enterpriseDatabase.ts +++ b/sdk/nodejs/redis/enterpriseDatabase.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; /** * Manages a Redis Enterprise Database. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEnterpriseCluster = new azure.redis.EnterpriseCluster("exampleEnterpriseCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "Enterprise_E20-4", + * }); + * const example1 = new azure.redis.EnterpriseCluster("example1", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * skuName: "Enterprise_E20-4", + * }); + * const exampleEnterpriseDatabase = new azure.redis.EnterpriseDatabase("exampleEnterpriseDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * clusterId: exampleEnterpriseCluster.id, + * clientProtocol: "Encrypted", + * clusteringPolicy: "EnterpriseCluster", + * evictionPolicy: "NoEviction", + * port: 10000, + * linkedDatabaseIds: [ + * pulumi.interpolate`${exampleEnterpriseCluster.id}/databases/default`, + * pulumi.interpolate`${example1.id}/databases/default`, + * ], + * linkedDatabaseGroupNickname: "tftestGeoGroup", + * }); + * ``` + * * ## Import * * Redis Enterprise Databases can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/redis/firewallRule.ts b/sdk/nodejs/redis/firewallRule.ts index 6dc56a3b5b..b8b5e5e6fb 100644 --- a/sdk/nodejs/redis/firewallRule.ts +++ b/sdk/nodejs/redis/firewallRule.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages a Firewall Rule associated with a Redis Cache. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const server = new random.RandomId("server", { + * keepers: { + * azi_id: 1, + * }, + * byteLength: 8, + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCache = new azure.redis.Cache("exampleCache", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * capacity: 1, + * family: "P", + * skuName: "Premium", + * enableNonSslPort: false, + * redisConfiguration: { + * maxmemoryReserved: 2, + * maxmemoryDelta: 2, + * maxmemoryPolicy: "allkeys-lru", + * }, + * }); + * const exampleFirewallRule = new azure.redis.FirewallRule("exampleFirewallRule", { + * redisCacheName: exampleCache.name, + * resourceGroupName: exampleResourceGroup.name, + * startIp: "1.2.3.4", + * endIp: "2.3.4.5", + * }); + * ``` + * * ## Import * * Redis Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/redis/getCache.ts b/sdk/nodejs/redis/getCache.ts index d26998e48f..84697af8f5 100644 --- a/sdk/nodejs/redis/getCache.ts +++ b/sdk/nodejs/redis/getCache.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Redis Cache + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.redis.getCache({ + * name: "myrediscache", + * resourceGroupName: "redis-cache", + * }); + * export const primaryAccessKey = example.then(example => example.primaryAccessKey); + * export const hostname = example.then(example => example.hostname); + * ``` */ export function getCache(args: GetCacheArgs, opts?: pulumi.InvokeOptions): Promise { @@ -116,6 +130,20 @@ export interface GetCacheResult { } /** * Use this data source to access information about an existing Redis Cache + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.redis.getCache({ + * name: "myrediscache", + * resourceGroupName: "redis-cache", + * }); + * export const primaryAccessKey = example.then(example => example.primaryAccessKey); + * export const hostname = example.then(example => example.hostname); + * ``` */ export function getCacheOutput(args: GetCacheOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getCache(a, opts)) diff --git a/sdk/nodejs/redis/getEnterpriseDatabase.ts b/sdk/nodejs/redis/getEnterpriseDatabase.ts index f509506e81..1afd07cfc5 100644 --- a/sdk/nodejs/redis/getEnterpriseDatabase.ts +++ b/sdk/nodejs/redis/getEnterpriseDatabase.ts @@ -6,6 +6,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Redis Enterprise Database + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.redis.getEnterpriseDatabase({ + * name: "default", + * resourceGroupName: azurerm_resource_group.example.name, + * clusterId: azurerm_redis_enterprise_cluster.example.id, + * }); + * export const redisEnterpriseDatabasePrimaryKey = example.then(example => example.primaryAccessKey); + * export const redisEnterpriseDatabaseSecondaryKey = example.then(example => example.secondaryAccessKey); + * ``` */ export function getEnterpriseDatabase(args: GetEnterpriseDatabaseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -76,6 +91,21 @@ export interface GetEnterpriseDatabaseResult { } /** * Use this data source to access information about an existing Redis Enterprise Database + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.redis.getEnterpriseDatabase({ + * name: "default", + * resourceGroupName: azurerm_resource_group.example.name, + * clusterId: azurerm_redis_enterprise_cluster.example.id, + * }); + * export const redisEnterpriseDatabasePrimaryKey = example.then(example => example.primaryAccessKey); + * export const redisEnterpriseDatabaseSecondaryKey = example.then(example => example.secondaryAccessKey); + * ``` */ export function getEnterpriseDatabaseOutput(args: GetEnterpriseDatabaseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEnterpriseDatabase(a, opts)) diff --git a/sdk/nodejs/redis/linkedServer.ts b/sdk/nodejs/redis/linkedServer.ts index 2bcd8b8ad7..9e2215e525 100644 --- a/sdk/nodejs/redis/linkedServer.ts +++ b/sdk/nodejs/redis/linkedServer.ts @@ -7,6 +7,49 @@ import * as utilities from "../utilities"; /** * Manages a Redis Linked Server (ie Geo Location) * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example_primaryResourceGroup = new azure.core.ResourceGroup("example-primaryResourceGroup", {location: "East US"}); + * const example_primaryCache = new azure.redis.Cache("example-primaryCache", { + * location: example_primaryResourceGroup.location, + * resourceGroupName: example_primaryResourceGroup.name, + * capacity: 1, + * family: "P", + * skuName: "Premium", + * enableNonSslPort: false, + * redisConfiguration: { + * maxmemoryReserved: 2, + * maxmemoryDelta: 2, + * maxmemoryPolicy: "allkeys-lru", + * }, + * }); + * const example_secondaryResourceGroup = new azure.core.ResourceGroup("example-secondaryResourceGroup", {location: "West US"}); + * const example_secondaryCache = new azure.redis.Cache("example-secondaryCache", { + * location: example_secondaryResourceGroup.location, + * resourceGroupName: example_secondaryResourceGroup.name, + * capacity: 1, + * family: "P", + * skuName: "Premium", + * enableNonSslPort: false, + * redisConfiguration: { + * maxmemoryReserved: 2, + * maxmemoryDelta: 2, + * maxmemoryPolicy: "allkeys-lru", + * }, + * }); + * const example_link = new azure.redis.LinkedServer("example-link", { + * targetRedisCacheName: example_primaryCache.name, + * resourceGroupName: example_primaryCache.resourceGroupName, + * linkedRedisCacheId: example_secondaryCache.id, + * linkedRedisCacheLocation: example_secondaryCache.location, + * serverRole: "Secondary", + * }); + * ``` + * * ## Import * * Redis can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/relay/hybridConnection.ts b/sdk/nodejs/relay/hybridConnection.ts index 0872eeabd4..a62a7722b3 100644 --- a/sdk/nodejs/relay/hybridConnection.ts +++ b/sdk/nodejs/relay/hybridConnection.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an Azure Relay Hybrid Connection. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.relay.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * tags: { + * source: "managed", + * }, + * }); + * const exampleHybridConnection = new azure.relay.HybridConnection("exampleHybridConnection", { + * resourceGroupName: exampleResourceGroup.name, + * relayNamespaceName: exampleNamespace.name, + * requiresClientAuthorization: false, + * userMetadata: "testmetadata", + * }); + * ``` + * * ## Import * * Relay Hybrid Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/relay/hybridConnectionAuthorizationRule.ts b/sdk/nodejs/relay/hybridConnectionAuthorizationRule.ts index 0d51136459..3beeba8cca 100644 --- a/sdk/nodejs/relay/hybridConnectionAuthorizationRule.ts +++ b/sdk/nodejs/relay/hybridConnectionAuthorizationRule.ts @@ -7,6 +7,37 @@ import * as utilities from "../utilities"; /** * Manages an Azure Relay Hybrid Connection Authorization Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.relay.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * tags: { + * source: "terraform", + * }, + * }); + * const exampleHybridConnection = new azure.relay.HybridConnection("exampleHybridConnection", { + * resourceGroupName: exampleResourceGroup.name, + * relayNamespaceName: exampleNamespace.name, + * requiresClientAuthorization: false, + * userMetadata: "testmetadata", + * }); + * const exampleHybridConnectionAuthorizationRule = new azure.relay.HybridConnectionAuthorizationRule("exampleHybridConnectionAuthorizationRule", { + * resourceGroupName: exampleResourceGroup.name, + * hybridConnectionName: exampleHybridConnection.name, + * namespaceName: exampleNamespace.name, + * listen: true, + * send: true, + * manage: false, + * }); + * ``` + * * ## Import * * Azure Relay Hybrid Connection Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/relay/namespace.ts b/sdk/nodejs/relay/namespace.ts index 2737c192eb..8af375cb45 100644 --- a/sdk/nodejs/relay/namespace.ts +++ b/sdk/nodejs/relay/namespace.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages an Azure Relay Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.relay.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * tags: { + * source: "example", + * }, + * }); + * ``` + * * ## Import * * Azure Relay Namespace's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/relay/namespaceAuthorizationRule.ts b/sdk/nodejs/relay/namespaceAuthorizationRule.ts index f2d7b2231f..b9f1ea41a5 100644 --- a/sdk/nodejs/relay/namespaceAuthorizationRule.ts +++ b/sdk/nodejs/relay/namespaceAuthorizationRule.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages an Azure Relay Namespace Authorization Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.relay.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * skuName: "Standard", + * tags: { + * source: "terraform", + * }, + * }); + * const exampleNamespaceAuthorizationRule = new azure.relay.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", { + * resourceGroupName: exampleResourceGroup.name, + * namespaceName: exampleNamespace.name, + * listen: true, + * send: true, + * manage: false, + * }); + * ``` + * * ## Import * * Azure Relay Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/role/assignment.ts b/sdk/nodejs/role/assignment.ts index 4ba2d78f9d..3d6291d9cd 100644 --- a/sdk/nodejs/role/assignment.ts +++ b/sdk/nodejs/role/assignment.ts @@ -8,6 +8,95 @@ import * as utilities from "../utilities"; * Assigns a given Principal (User or Group) to a given Role. * * ## Example Usage + * ### Using A Built-In Role) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * scope: primary.then(primary => primary.id), + * roleDefinitionName: "Reader", + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` + * ### Custom Role & Service Principal) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = new azure.authorization.RoleDefinition("exampleRoleDefinition", { + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * permissions: [{ + * actions: ["Microsoft.Resources/subscriptions/resourceGroups/read"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * name: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * roleDefinitionId: exampleRoleDefinition.roleDefinitionResourceId, + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` + * ### Custom Role & User) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleRoleDefinition = new azure.authorization.RoleDefinition("exampleRoleDefinition", { + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * permissions: [{ + * actions: ["Microsoft.Resources/subscriptions/resourceGroups/read"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * name: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * roleDefinitionId: exampleRoleDefinition.roleDefinitionResourceId, + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` + * ### Custom Role & Management Group) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const exampleClientConfig = azure.core.getClientConfig({}); + * const exampleGroup = azure.management.getGroup({ + * name: "00000000-0000-0000-0000-000000000000", + * }); + * const exampleRoleDefinition = new azure.authorization.RoleDefinition("exampleRoleDefinition", { + * roleDefinitionId: "00000000-0000-0000-0000-000000000000", + * scope: primary.then(primary => primary.id), + * permissions: [{ + * actions: ["Microsoft.Resources/subscriptions/resourceGroups/read"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * const exampleAssignment = new azure.authorization.Assignment("exampleAssignment", { + * name: "00000000-0000-0000-0000-000000000000", + * scope: data.azurerm_management_group.primary.id, + * roleDefinitionId: exampleRoleDefinition.roleDefinitionResourceId, + * principalId: exampleClientConfig.then(exampleClientConfig => exampleClientConfig.objectId), + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/role/definition.ts b/sdk/nodejs/role/definition.ts index ef74a127a5..eaca8c9ddd 100644 --- a/sdk/nodejs/role/definition.ts +++ b/sdk/nodejs/role/definition.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; /** * Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = azure.core.getSubscription({}); + * const example = new azure.authorization.RoleDefinition("example", { + * scope: primary.then(primary => primary.id), + * description: "This is a custom role created", + * permissions: [{ + * actions: ["*"], + * notActions: [], + * }], + * assignableScopes: [primary.then(primary => primary.id)], + * }); + * ``` + * * ## Import * * Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/search/getService.ts b/sdk/nodejs/search/getService.ts index f65dc17702..aad0d127f1 100644 --- a/sdk/nodejs/search/getService.ts +++ b/sdk/nodejs/search/getService.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Manages a Search Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = azure.search.getServiceOutput({ + * name: "example-search-service", + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -76,6 +89,19 @@ export interface GetServiceResult { } /** * Manages a Search Service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = azure.search.getServiceOutput({ + * name: "example-search-service", + * resourceGroupName: exampleResourceGroup.name, + * }); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/search/service.ts b/sdk/nodejs/search/service.ts index e72404db32..49244091f8 100644 --- a/sdk/nodejs/search/service.ts +++ b/sdk/nodejs/search/service.ts @@ -10,6 +10,48 @@ import * as utilities from "../utilities"; * Manages a Search Service. * * ## Example Usage + * ### Supporting API Keys) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.search.Service("exampleService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "standard", + * }); + * ``` + * ### Using Both AzureAD And API Keys) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.search.Service("exampleService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "standard", + * localAuthenticationEnabled: true, + * authenticationFailureMode: "http403", + * }); + * ``` + * ### Supporting Only AzureAD Authentication) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.search.Service("exampleService", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "standard", + * localAuthenticationEnabled: false, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/search/sharedPrivateLinkService.ts b/sdk/nodejs/search/sharedPrivateLinkService.ts index 0b4be2274f..92af748d32 100644 --- a/sdk/nodejs/search/sharedPrivateLinkService.ts +++ b/sdk/nodejs/search/sharedPrivateLinkService.ts @@ -7,6 +7,32 @@ import * as utilities from "../utilities"; /** * Manages the Shared Private Link Service for an Azure Search Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const testResourceGroup = new azure.core.ResourceGroup("testResourceGroup", {location: "east us"}); + * const testService = new azure.search.Service("testService", { + * resourceGroupName: testResourceGroup.name, + * location: testResourceGroup.location, + * sku: "standard", + * }); + * const testAccount = new azure.storage.Account("testAccount", { + * resourceGroupName: testResourceGroup.name, + * location: testResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const testSharedPrivateLinkService = new azure.search.SharedPrivateLinkService("testSharedPrivateLinkService", { + * searchServiceId: testService.id, + * subresourceName: "blob", + * targetResourceId: testAccount.id, + * requestMessage: "please approve", + * }); + * ``` + * * ## Import * * Azure Search Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/advancedThreatProtection.ts b/sdk/nodejs/securitycenter/advancedThreatProtection.ts index 0c53c56a1c..17f7325250 100644 --- a/sdk/nodejs/securitycenter/advancedThreatProtection.ts +++ b/sdk/nodejs/securitycenter/advancedThreatProtection.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages a resources Advanced Threat Protection setting. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * tags: { + * environment: "example", + * }, + * }); + * const exampleAdvancedThreatProtection = new azure.securitycenter.AdvancedThreatProtection("exampleAdvancedThreatProtection", { + * targetResourceId: exampleAccount.id, + * enabled: true, + * }); + * ``` + * * ## Import * * Advanced Threat Protection can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/assessment.ts b/sdk/nodejs/securitycenter/assessment.ts index c09b01c2f8..1505477694 100644 --- a/sdk/nodejs/securitycenter/assessment.ts +++ b/sdk/nodejs/securitycenter/assessment.ts @@ -9,6 +9,68 @@ import * as utilities from "../utilities"; /** * Manages the Security Center Assessment for Azure Security Center. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.0.0.0/16"], + * }); + * const internal = new azure.network.Subnet("internal", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleLinuxVirtualMachineScaleSet = new azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: "Standard_F2", + * instances: 1, + * adminUsername: "adminuser", + * adminSshKeys: [{ + * username: "adminuser", + * publicKey: fs.readFileSync("~/.ssh/id_rsa.pub"), + * }], + * sourceImageReference: { + * publisher: "Canonical", + * offer: "0001-com-ubuntu-server-focal", + * sku: "20_04-lts", + * version: "latest", + * }, + * osDisk: { + * storageAccountType: "Standard_LRS", + * caching: "ReadWrite", + * }, + * networkInterfaces: [{ + * name: "example", + * primary: true, + * ipConfigurations: [{ + * name: "internal", + * primary: true, + * subnetId: internal.id, + * }], + * }], + * }); + * const exampleAssessmentPolicy = new azure.securitycenter.AssessmentPolicy("exampleAssessmentPolicy", { + * displayName: "Test Display Name", + * severity: "Medium", + * description: "Test Description", + * }); + * const exampleAssessment = new azure.securitycenter.Assessment("exampleAssessment", { + * assessmentPolicyId: exampleAssessmentPolicy.id, + * targetResourceId: exampleLinuxVirtualMachineScaleSet.id, + * status: { + * code: "Healthy", + * }, + * }); + * ``` + * * ## Import * * Security Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/assessmentPolicy.ts b/sdk/nodejs/securitycenter/assessmentPolicy.ts index ff182d9748..88924f9672 100644 --- a/sdk/nodejs/securitycenter/assessmentPolicy.ts +++ b/sdk/nodejs/securitycenter/assessmentPolicy.ts @@ -7,6 +7,19 @@ import * as utilities from "../utilities"; /** * Manages the Security Center Assessment Metadata for Azure Security Center. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.securitycenter.AssessmentPolicy("example", { + * description: "Test Description", + * displayName: "Test Display Name", + * severity: "Medium", + * }); + * ``` + * * ## Import * * Security Assessments Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/autoProvisioning.ts b/sdk/nodejs/securitycenter/autoProvisioning.ts index aec5f150d5..a6b4e7bb1a 100644 --- a/sdk/nodejs/securitycenter/autoProvisioning.ts +++ b/sdk/nodejs/securitycenter/autoProvisioning.ts @@ -9,6 +9,15 @@ import * as utilities from "../utilities"; * * > **NOTE:** There is no resource name required, it will always be "default" * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.securitycenter.AutoProvisioning("example", {autoProvision: "On"}); + * ``` + * * ## Import * * Security Center Auto Provisioning can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/automation.ts b/sdk/nodejs/securitycenter/automation.ts index 7aa1e18970..1c1250a6cd 100644 --- a/sdk/nodejs/securitycenter/automation.ts +++ b/sdk/nodejs/securitycenter/automation.ts @@ -9,6 +9,57 @@ import * as utilities from "../utilities"; /** * Manages Security Center Automation and Continuous Export. This resource supports three types of destination in the `action`, Logic Apps, Log Analytics and Event Hubs * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 2, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 2, + * }); + * const exampleAuthorizationRule = new azure.eventhub.AuthorizationRule("exampleAuthorizationRule", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * listen: true, + * send: false, + * manage: false, + * }); + * const exampleAutomation = new azure.securitycenter.Automation("exampleAutomation", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * actions: [{ + * type: "EventHub", + * resourceId: exampleEventHub.id, + * connectionString: exampleAuthorizationRule.primaryConnectionString, + * }], + * sources: [{ + * eventSource: "Alerts", + * ruleSets: [{ + * rules: [{ + * propertyPath: "properties.metadata.severity", + * operator: "Equals", + * expectedValue: "High", + * propertyType: "String", + * }], + * }], + * }], + * scopes: [current.then(current => `/subscriptions/${current.subscriptionId}`)], + * }); + * ``` + * * ## Import * * Security Center Automations can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/contact.ts b/sdk/nodejs/securitycenter/contact.ts index 4a74c9fc9f..891cfc20e5 100644 --- a/sdk/nodejs/securitycenter/contact.ts +++ b/sdk/nodejs/securitycenter/contact.ts @@ -9,6 +9,20 @@ import * as utilities from "../utilities"; * * > **NOTE:** Owner access permission is required. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.securitycenter.Contact("example", { + * alertNotifications: true, + * alertsToAdmins: true, + * email: "contact@example.com", + * phone: "+1-555-555-5555", + * }); + * ``` + * * ## Import * * The contact can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/serverVulnerabilityAssessment.ts b/sdk/nodejs/securitycenter/serverVulnerabilityAssessment.ts index 7bd09aba5b..d1e4c0ab68 100644 --- a/sdk/nodejs/securitycenter/serverVulnerabilityAssessment.ts +++ b/sdk/nodejs/securitycenter/serverVulnerabilityAssessment.ts @@ -12,6 +12,54 @@ import * as utilities from "../utilities"; * > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. * See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["192.168.1.0/24"], + * location: exampleResourceGroup.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["192.168.1.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "vm-example", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * size: "Standard_B1s", + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * disablePasswordAuthentication: false, + * sourceImageReference: { + * publisher: "OpenLogic", + * offer: "CentOS", + * sku: "7.5", + * version: "latest", + * }, + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * networkInterfaceIds: [exampleNetworkInterface.id], + * }); + * const exampleServerVulnerabilityAssessment = new azure.securitycenter.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", {virtualMachineId: exampleLinuxVirtualMachine.id}); + * ``` + * * ## Import * * Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/serverVulnerabilityAssessmentVirtualMachine.ts b/sdk/nodejs/securitycenter/serverVulnerabilityAssessmentVirtualMachine.ts index b860eb4680..ca88cc016f 100644 --- a/sdk/nodejs/securitycenter/serverVulnerabilityAssessmentVirtualMachine.ts +++ b/sdk/nodejs/securitycenter/serverVulnerabilityAssessmentVirtualMachine.ts @@ -10,6 +10,54 @@ import * as utilities from "../utilities"; * > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. * See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["192.168.1.0/24"], + * location: exampleResourceGroup.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["192.168.1.0/24"], + * }); + * const exampleNetworkInterface = new azure.network.NetworkInterface("exampleNetworkInterface", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * ipConfigurations: [{ + * name: "vm-example", + * subnetId: exampleSubnet.id, + * privateIpAddressAllocation: "Dynamic", + * }], + * }); + * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * size: "Standard_B1s", + * adminUsername: "testadmin", + * adminPassword: "Password1234!", + * disablePasswordAuthentication: false, + * sourceImageReference: { + * publisher: "OpenLogic", + * offer: "CentOS", + * sku: "7.5", + * version: "latest", + * }, + * osDisk: { + * caching: "ReadWrite", + * storageAccountType: "Standard_LRS", + * }, + * networkInterfaceIds: [exampleNetworkInterface.id], + * }); + * const exampleServerVulnerabilityAssessmentVirtualMachine = new azure.securitycenter.ServerVulnerabilityAssessmentVirtualMachine("exampleServerVulnerabilityAssessmentVirtualMachine", {virtualMachineId: exampleLinuxVirtualMachine.id}); + * ``` + * * ## Import * * Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/setting.ts b/sdk/nodejs/securitycenter/setting.ts index 2643ddb392..9bfe8790f3 100644 --- a/sdk/nodejs/securitycenter/setting.ts +++ b/sdk/nodejs/securitycenter/setting.ts @@ -11,6 +11,18 @@ import * as utilities from "../utilities"; * * > **NOTE:** Deletion of this resource disables the setting. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.securitycenter.Setting("example", { + * enabled: true, + * settingName: "MCAS", + * }); + * ``` + * * ## Import * * The setting can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/storageDefender.ts b/sdk/nodejs/securitycenter/storageDefender.ts index 77365f6383..e3bef2a14b 100644 --- a/sdk/nodejs/securitycenter/storageDefender.ts +++ b/sdk/nodejs/securitycenter/storageDefender.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages the Defender for Storage. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westus2"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleStorageDefender = new azure.securitycenter.StorageDefender("exampleStorageDefender", {storageAccountId: exampleAccount.id}); + * ``` + * * ## Import * * The setting can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/securitycenter/subscriptionPricing.ts b/sdk/nodejs/securitycenter/subscriptionPricing.ts index 4be7e49795..3adbebc8d5 100644 --- a/sdk/nodejs/securitycenter/subscriptionPricing.ts +++ b/sdk/nodejs/securitycenter/subscriptionPricing.ts @@ -12,6 +12,45 @@ import * as utilities from "../utilities"; * > **NOTE:** Deletion of this resource will reset the pricing tier to `Free` * * ## Example Usage + * ### Basic usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.securitycenter.SubscriptionPricing("example", { + * resourceType: "VirtualMachines", + * tier: "Standard", + * }); + * ``` + * ### Using Extensions with Defender CSPM + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example1 = new azure.securitycenter.SubscriptionPricing("example1", { + * extensions: [ + * { + * name: "ContainerRegistriesVulnerabilityAssessments", + * }, + * { + * additionalExtensionProperties: { + * ExclusionTags: "[]", + * }, + * name: "AgentlessVmScanning", + * }, + * { + * name: "AgentlessDiscoveryForKubernetes", + * }, + * { + * name: "SensitiveDataDiscovery", + * }, + * ], + * resourceType: "CloudPosture", + * tier: "Standard", + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/securitycenter/workspace.ts b/sdk/nodejs/securitycenter/workspace.ts index 8d5aad8df9..be2d0ce8d9 100644 --- a/sdk/nodejs/securitycenter/workspace.ts +++ b/sdk/nodejs/securitycenter/workspace.ts @@ -9,6 +9,24 @@ import * as utilities from "../utilities"; * * > **NOTE:** Owner access permission is required. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleWorkspace = new azure.securitycenter.Workspace("exampleWorkspace", { + * scope: "/subscriptions/00000000-0000-0000-0000-000000000000", + * workspaceId: exampleAnalyticsWorkspace.id, + * }); + * ``` + * * ## Import * * The contact can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleAnomalyBuiltIn.ts b/sdk/nodejs/sentinel/alertRuleAnomalyBuiltIn.ts index 3f21a7670f..e3521c8383 100644 --- a/sdk/nodejs/sentinel/alertRuleAnomalyBuiltIn.ts +++ b/sdk/nodejs/sentinel/alertRuleAnomalyBuiltIn.ts @@ -7,6 +7,34 @@ import * as outputs from "../types/output"; import * as utilities from "../utilities"; /** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", { + * workspaceId: exampleAnalyticsWorkspace.id, + * customerManagedKeyEnabled: false, + * }); + * const exampleAlertRuleAnomaly = azure.sentinel.getAlertRuleAnomalyOutput({ + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "Potential data staging", + * }); + * const exampleAlertRuleAnomalyBuiltIn = new azure.sentinel.AlertRuleAnomalyBuiltIn("exampleAlertRuleAnomalyBuiltIn", { + * displayName: "Potential data staging", + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * mode: "Production", + * enabled: false, + * }); + * ``` + * * ## Import * * Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleAnomalyDuplicate.ts b/sdk/nodejs/sentinel/alertRuleAnomalyDuplicate.ts index 226fef2fcd..8eeccd0b65 100644 --- a/sdk/nodejs/sentinel/alertRuleAnomalyDuplicate.ts +++ b/sdk/nodejs/sentinel/alertRuleAnomalyDuplicate.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a Duplicated Anomaly Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", { + * workspaceId: exampleAnalyticsWorkspace.id, + * customerManagedKeyEnabled: false, + * }); + * const exampleAlertRuleAnomaly = azure.sentinel.getAlertRuleAnomalyOutput({ + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "UEBA Anomalous Sign In", + * }); + * const exampleAlertRuleAnomalyDuplicate = new azure.sentinel.AlertRuleAnomalyDuplicate("exampleAlertRuleAnomalyDuplicate", { + * displayName: "example duplicated UEBA Anomalous Sign In", + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * builtInRuleId: exampleAlertRuleAnomaly.apply(exampleAlertRuleAnomaly => exampleAlertRuleAnomaly.id), + * enabled: true, + * mode: "Flighting", + * thresholdObservations: [{ + * name: "Anomaly score threshold", + * value: "0.6", + * }], + * }); + * ``` + * * ## Import * * Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleFusion.ts b/sdk/nodejs/sentinel/alertRuleFusion.ts index 5490285bb3..6499a27ff9 100644 --- a/sdk/nodejs/sentinel/alertRuleFusion.ts +++ b/sdk/nodejs/sentinel/alertRuleFusion.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Fusion Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleAnalyticsSolution = new azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", { + * solutionName: "SecurityInsights", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * workspaceName: exampleAnalyticsWorkspace.name, + * plan: { + * publisher: "Microsoft", + * product: "OMSGallery/SecurityInsights", + * }, + * }); + * const exampleAlertRuleFusion = new azure.sentinel.AlertRuleFusion("exampleAlertRuleFusion", { + * logAnalyticsWorkspaceId: exampleAnalyticsSolution.workspaceResourceId, + * alertRuleTemplateGuid: "f71aba3d-28fb-450b-b192-4e76a83015c8", + * }); + * ``` + * * ## Import * * Sentinel Fusion Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleMachineLearningBehaviorAnalytics.ts b/sdk/nodejs/sentinel/alertRuleMachineLearningBehaviorAnalytics.ts index d697e1abbe..6cadaa581c 100644 --- a/sdk/nodejs/sentinel/alertRuleMachineLearningBehaviorAnalytics.ts +++ b/sdk/nodejs/sentinel/alertRuleMachineLearningBehaviorAnalytics.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Machine Learning Behavior Analytics Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleAlertRuleMachineLearningBehaviorAnalytics = new azure.sentinel.AlertRuleMachineLearningBehaviorAnalytics("exampleAlertRuleMachineLearningBehaviorAnalytics", { + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * alertRuleTemplateGuid: "737a2ce1-70a3-4968-9e90-3e6aca836abf", + * }); + * ``` + * * ## Import * * Sentinel Machine Learning Behavior Analytics Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleMsSecurityIncident.ts b/sdk/nodejs/sentinel/alertRuleMsSecurityIncident.ts index 0d233ad819..c38a75271c 100644 --- a/sdk/nodejs/sentinel/alertRuleMsSecurityIncident.ts +++ b/sdk/nodejs/sentinel/alertRuleMsSecurityIncident.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel MS Security Incident Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleAlertRuleMsSecurityIncident = new azure.sentinel.AlertRuleMsSecurityIncident("exampleAlertRuleMsSecurityIncident", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * productFilter: "Microsoft Cloud App Security", + * displayName: "example rule", + * severityFilters: ["High"], + * }); + * ``` + * * ## Import * * Sentinel MS Security Incident Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleNrt.ts b/sdk/nodejs/sentinel/alertRuleNrt.ts index 2e2fe0a104..622d60d44c 100644 --- a/sdk/nodejs/sentinel/alertRuleNrt.ts +++ b/sdk/nodejs/sentinel/alertRuleNrt.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel NRT Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "pergb2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleAlertRuleNrt = new azure.sentinel.AlertRuleNrt("exampleAlertRuleNrt", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "example", + * severity: "High", + * query: `AzureActivity | + * where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + * where ActivityStatus == "Succeeded" | + * make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + * `, + * }); + * ``` + * * ## Import * * Sentinel NRT Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleScheduled.ts b/sdk/nodejs/sentinel/alertRuleScheduled.ts index 7d39531f06..b472470fbb 100644 --- a/sdk/nodejs/sentinel/alertRuleScheduled.ts +++ b/sdk/nodejs/sentinel/alertRuleScheduled.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Scheduled Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleAlertRuleScheduled = new azure.sentinel.AlertRuleScheduled("exampleAlertRuleScheduled", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "example", + * severity: "High", + * query: `AzureActivity | + * where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + * where ActivityStatus == "Succeeded" | + * make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + * `, + * }); + * ``` + * * ## Import * * Sentinel Scheduled Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/alertRuleThreatIntelligence.ts b/sdk/nodejs/sentinel/alertRuleThreatIntelligence.ts index 04529efb90..a6b6fb3880 100644 --- a/sdk/nodejs/sentinel/alertRuleThreatIntelligence.ts +++ b/sdk/nodejs/sentinel/alertRuleThreatIntelligence.ts @@ -7,6 +7,39 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Threat Intelligence Alert Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "pergb2018", + * }); + * const exampleAnalyticsSolution = new azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", { + * solutionName: "SecurityInsights", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * workspaceName: exampleAnalyticsWorkspace.name, + * plan: { + * publisher: "Microsoft", + * product: "OMSGallery/SecurityInsights", + * }, + * }); + * const exampleAlertRuleTemplate = azure.sentinel.getAlertRuleTemplateOutput({ + * displayName: "(Preview) Microsoft Defender Threat Intelligence Analytics", + * logAnalyticsWorkspaceId: exampleAnalyticsSolution.workspaceResourceId, + * }); + * const exampleAlertRuleThreatIntelligence = new azure.sentinel.AlertRuleThreatIntelligence("exampleAlertRuleThreatIntelligence", { + * logAnalyticsWorkspaceId: exampleAnalyticsSolution.workspaceResourceId, + * alertRuleTemplateGuid: exampleAlertRuleTemplate.apply(exampleAlertRuleTemplate => exampleAlertRuleTemplate.name), + * }); + * ``` + * * ## Import * * Sentinel Threat Intelligence Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/authomationRule.ts b/sdk/nodejs/sentinel/authomationRule.ts index f417ac669a..86e52b2369 100644 --- a/sdk/nodejs/sentinel/authomationRule.ts +++ b/sdk/nodejs/sentinel/authomationRule.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Automation Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleAutomationRule = new azure.sentinel.AutomationRule("exampleAutomationRule", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "automation_rule1", + * order: 1, + * actionIncidents: [{ + * order: 1, + * status: "Active", + * }], + * }); + * ``` + * * ## Import * * Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/automationRule.ts b/sdk/nodejs/sentinel/automationRule.ts index 352fbe3e70..daa7d28183 100644 --- a/sdk/nodejs/sentinel/automationRule.ts +++ b/sdk/nodejs/sentinel/automationRule.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Automation Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleAutomationRule = new azure.sentinel.AutomationRule("exampleAutomationRule", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "automation_rule1", + * order: 1, + * actionIncidents: [{ + * order: 1, + * status: "Active", + * }], + * }); + * ``` + * * ## Import * * Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorAwsCloudTrail.ts b/sdk/nodejs/sentinel/dataConnectorAwsCloudTrail.ts index 55c4adc1cd..76cbae6da0 100644 --- a/sdk/nodejs/sentinel/dataConnectorAwsCloudTrail.ts +++ b/sdk/nodejs/sentinel/dataConnectorAwsCloudTrail.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a AWS CloudTrail Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorAwsCloudTrail = new azure.sentinel.DataConnectorAwsCloudTrail("exampleDataConnectorAwsCloudTrail", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * awsRoleArn: "arn:aws:iam::000000000000:role/role1", + * }); + * ``` + * * ## Import * * AWS CloudTrail Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorAwsS3.ts b/sdk/nodejs/sentinel/dataConnectorAwsS3.ts index 03539ce2ed..e6530134fc 100644 --- a/sdk/nodejs/sentinel/dataConnectorAwsS3.ts +++ b/sdk/nodejs/sentinel/dataConnectorAwsS3.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a AWS S3 Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorAwsS3 = new azure.sentinel.DataConnectorAwsS3("exampleDataConnectorAwsS3", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * awsRoleArn: "arn:aws:iam::000000000000:role/role1", + * destinationTable: "AWSGuardDuty", + * sqsUrls: ["https://sqs.us-east-1.amazonaws.com/000000000000/example"], + * }); + * ``` + * * ## Import * * AWS S3 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorAzureActiveDirectory.ts b/sdk/nodejs/sentinel/dataConnectorAzureActiveDirectory.ts index 368c3d1545..f9df7d1b9e 100644 --- a/sdk/nodejs/sentinel/dataConnectorAzureActiveDirectory.ts +++ b/sdk/nodejs/sentinel/dataConnectorAzureActiveDirectory.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Azure Active Directory Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorAzureActiveDirectory = new azure.sentinel.DataConnectorAzureActiveDirectory("exampleDataConnectorAzureActiveDirectory", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Azure Active Directory Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorAzureAdvancedThreadProtection.ts b/sdk/nodejs/sentinel/dataConnectorAzureAdvancedThreadProtection.ts index a6e9a0213b..54be25d556 100644 --- a/sdk/nodejs/sentinel/dataConnectorAzureAdvancedThreadProtection.ts +++ b/sdk/nodejs/sentinel/dataConnectorAzureAdvancedThreadProtection.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; * * !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorAzureAdvancedThreadProtection = new azure.sentinel.DataConnectorAzureAdvancedThreadProtection("exampleDataConnectorAzureAdvancedThreadProtection", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Azure Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorAzureSecurityCenter.ts b/sdk/nodejs/sentinel/dataConnectorAzureSecurityCenter.ts index f6da8057ae..fbe62a1b7e 100644 --- a/sdk/nodejs/sentinel/dataConnectorAzureSecurityCenter.ts +++ b/sdk/nodejs/sentinel/dataConnectorAzureSecurityCenter.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Azure Security Center Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorAzureSecurityCenter = new azure.sentinel.DataConnectorAzureSecurityCenter("exampleDataConnectorAzureSecurityCenter", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Azure Security Center Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorDynamics365.ts b/sdk/nodejs/sentinel/dataConnectorDynamics365.ts index 09c899631b..f8d43a5ceb 100644 --- a/sdk/nodejs/sentinel/dataConnectorDynamics365.ts +++ b/sdk/nodejs/sentinel/dataConnectorDynamics365.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Dynamics 365 Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorDynamics365 = new azure.sentinel.DataConnectorDynamics365("exampleDataConnectorDynamics365", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Dynamics 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorIot.ts b/sdk/nodejs/sentinel/dataConnectorIot.ts index 5f14e5cffe..d53bd8425b 100644 --- a/sdk/nodejs/sentinel/dataConnectorIot.ts +++ b/sdk/nodejs/sentinel/dataConnectorIot.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an Iot Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorIot = new azure.sentinel.DataConnectorIot("exampleDataConnectorIot", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Iot Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorMicrosoftCloudAppSecurity.ts b/sdk/nodejs/sentinel/dataConnectorMicrosoftCloudAppSecurity.ts index cb26ab2ae6..d6f49dfad3 100644 --- a/sdk/nodejs/sentinel/dataConnectorMicrosoftCloudAppSecurity.ts +++ b/sdk/nodejs/sentinel/dataConnectorMicrosoftCloudAppSecurity.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; * * !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorMicrosoftCloudAppSecurity = new azure.sentinel.DataConnectorMicrosoftCloudAppSecurity("exampleDataConnectorMicrosoftCloudAppSecurity", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Microsoft Cloud App Security Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.ts b/sdk/nodejs/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.ts index 749c1028f0..708e203503 100644 --- a/sdk/nodejs/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.ts +++ b/sdk/nodejs/sentinel/dataConnectorMicrosoftDefenderAdvancedThreatProtection.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft Defender Advanced Threat Protection Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorMicrosoftDefenderAdvancedThreatProtection = new azure.sentinel.DataConnectorMicrosoftDefenderAdvancedThreatProtection("exampleDataConnectorMicrosoftDefenderAdvancedThreatProtection", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Microsoft Defender Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatIntelligence.ts b/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatIntelligence.ts index 332bee35c5..6f32fe604c 100644 --- a/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatIntelligence.ts +++ b/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatIntelligence.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft Threat Intelligence Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorMicrosoftThreatIntelligence = new azure.sentinel.DataConnectorMicrosoftThreatIntelligence("exampleDataConnectorMicrosoftThreatIntelligence", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * microsoftEmergingThreatFeedLookbackDate: "1970-01-01T00:00:00Z", + * }); + * ``` + * * ## Import * * sentinels can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatProtection.ts b/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatProtection.ts index a388b64ddc..fd33a1e697 100644 --- a/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatProtection.ts +++ b/sdk/nodejs/sentinel/dataConnectorMicrosoftThreatProtection.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft Threat Protection Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorMicrosoftThreatProtection = new azure.sentinel.DataConnectorMicrosoftThreatProtection("exampleDataConnectorMicrosoftThreatProtection", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Microsoft Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorOffice365.ts b/sdk/nodejs/sentinel/dataConnectorOffice365.ts index 753d455356..f225a8a941 100644 --- a/sdk/nodejs/sentinel/dataConnectorOffice365.ts +++ b/sdk/nodejs/sentinel/dataConnectorOffice365.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Office 365 Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorOffice365 = new azure.sentinel.DataConnectorOffice365("exampleDataConnectorOffice365", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Office 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorOffice365Project.ts b/sdk/nodejs/sentinel/dataConnectorOffice365Project.ts index f1452d3f97..a5eb932124 100644 --- a/sdk/nodejs/sentinel/dataConnectorOffice365Project.ts +++ b/sdk/nodejs/sentinel/dataConnectorOffice365Project.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an Office 365 Project Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorOffice365Project = new azure.sentinel.DataConnectorOffice365Project("exampleDataConnectorOffice365Project", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Office 365 Project Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorOfficeAtp.ts b/sdk/nodejs/sentinel/dataConnectorOfficeAtp.ts index 8a5b773cf7..e0a185846e 100644 --- a/sdk/nodejs/sentinel/dataConnectorOfficeAtp.ts +++ b/sdk/nodejs/sentinel/dataConnectorOfficeAtp.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Office ATP Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorOfficeAtp = new azure.sentinel.DataConnectorOfficeAtp("exampleDataConnectorOfficeAtp", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Office ATP Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorOfficeIrm.ts b/sdk/nodejs/sentinel/dataConnectorOfficeIrm.ts index bc201ebfb4..80f370e8c5 100644 --- a/sdk/nodejs/sentinel/dataConnectorOfficeIrm.ts +++ b/sdk/nodejs/sentinel/dataConnectorOfficeIrm.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an Office IRM Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorOfficeIrm = new azure.sentinel.DataConnectorOfficeIrm("exampleDataConnectorOfficeIrm", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Office IRM Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorOfficePowerBi.ts b/sdk/nodejs/sentinel/dataConnectorOfficePowerBi.ts index 36445ea56d..bef6a8f1d9 100644 --- a/sdk/nodejs/sentinel/dataConnectorOfficePowerBi.ts +++ b/sdk/nodejs/sentinel/dataConnectorOfficePowerBi.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages an Office Power BI Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorOfficePowerBi = new azure.sentinel.DataConnectorOfficePowerBi("exampleDataConnectorOfficePowerBi", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Office Power BI Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorThreatIntelligence.ts b/sdk/nodejs/sentinel/dataConnectorThreatIntelligence.ts index f2151c099b..4dbc11c242 100644 --- a/sdk/nodejs/sentinel/dataConnectorThreatIntelligence.ts +++ b/sdk/nodejs/sentinel/dataConnectorThreatIntelligence.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Threat Intelligence Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorThreatIntelligence = new azure.sentinel.DataConnectorThreatIntelligence("exampleDataConnectorThreatIntelligence", {logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId}); + * ``` + * * ## Import * * Threat Intelligence Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/dataConnectorThreatIntelligenceTaxii.ts b/sdk/nodejs/sentinel/dataConnectorThreatIntelligenceTaxii.ts index 64f43b9ff2..c99df45ed1 100644 --- a/sdk/nodejs/sentinel/dataConnectorThreatIntelligenceTaxii.ts +++ b/sdk/nodejs/sentinel/dataConnectorThreatIntelligenceTaxii.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages an Threat Intelligence TAXII Data Connector. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleDataConnectorThreatIntelligenceTaxii = new azure.sentinel.DataConnectorThreatIntelligenceTaxii("exampleDataConnectorThreatIntelligenceTaxii", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "example", + * apiRootUrl: "https://foo/taxii2/api2/", + * collectionId: "someid", + * }); + * ``` + * * ## Import * * Threat Intelligence TAXII Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/getAlertRule.ts b/sdk/nodejs/sentinel/getAlertRule.ts index 05f94ad562..7ba81cab31 100644 --- a/sdk/nodejs/sentinel/getAlertRule.ts +++ b/sdk/nodejs/sentinel/getAlertRule.ts @@ -6,6 +6,23 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Sentinel Alert Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAnalyticsWorkspace = azure.operationalinsights.getAnalyticsWorkspace({ + * name: "example", + * resourceGroupName: "example-resources", + * }); + * const exampleAlertRule = exampleAnalyticsWorkspace.then(exampleAnalyticsWorkspace => azure.sentinel.getAlertRule({ + * name: "existing", + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * })); + * export const id = exampleAlertRule.then(exampleAlertRule => exampleAlertRule.id); + * ``` */ export function getAlertRule(args: GetAlertRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +60,23 @@ export interface GetAlertRuleResult { } /** * Use this data source to access information about an existing Sentinel Alert Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAnalyticsWorkspace = azure.operationalinsights.getAnalyticsWorkspace({ + * name: "example", + * resourceGroupName: "example-resources", + * }); + * const exampleAlertRule = exampleAnalyticsWorkspace.then(exampleAnalyticsWorkspace => azure.sentinel.getAlertRule({ + * name: "existing", + * logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id, + * })); + * export const id = exampleAlertRule.then(exampleAlertRule => exampleAlertRule.id); + * ``` */ export function getAlertRuleOutput(args: GetAlertRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAlertRule(a, opts)) diff --git a/sdk/nodejs/sentinel/getAlertRuleAnomaly.ts b/sdk/nodejs/sentinel/getAlertRuleAnomaly.ts index e7957d8e8e..968d2899ca 100644 --- a/sdk/nodejs/sentinel/getAlertRuleAnomaly.ts +++ b/sdk/nodejs/sentinel/getAlertRuleAnomaly.ts @@ -8,6 +8,29 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Anomaly Alert Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", { + * workspaceId: exampleAnalyticsWorkspace.id, + * customerManagedKeyEnabled: false, + * }); + * const exampleAlertRuleAnomaly = azure.sentinel.getAlertRuleAnomalyOutput({ + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "Potential data staging", + * }); + * export const id = exampleAlertRuleAnomaly.apply(exampleAlertRuleAnomaly => exampleAlertRuleAnomaly.id); + * ``` */ export function getAlertRuleAnomaly(args: GetAlertRuleAnomalyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -109,6 +132,29 @@ export interface GetAlertRuleAnomalyResult { } /** * Use this data source to access information about an existing Anomaly Alert Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", { + * workspaceId: exampleAnalyticsWorkspace.id, + * customerManagedKeyEnabled: false, + * }); + * const exampleAlertRuleAnomaly = azure.sentinel.getAlertRuleAnomalyOutput({ + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "Potential data staging", + * }); + * export const id = exampleAlertRuleAnomaly.apply(exampleAlertRuleAnomaly => exampleAlertRuleAnomaly.id); + * ``` */ export function getAlertRuleAnomalyOutput(args: GetAlertRuleAnomalyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAlertRuleAnomaly(a, opts)) diff --git a/sdk/nodejs/sentinel/getAlertRuleTemplate.ts b/sdk/nodejs/sentinel/getAlertRuleTemplate.ts index 6c5999b5c1..b61f9b4afb 100644 --- a/sdk/nodejs/sentinel/getAlertRuleTemplate.ts +++ b/sdk/nodejs/sentinel/getAlertRuleTemplate.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Sentinel Alert Rule Template. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sentinel.getAlertRuleTemplate({ + * logAnalyticsWorkspaceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", + * displayName: "Create incidents based on Azure Security Center for IoT alerts", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getAlertRuleTemplate(args: GetAlertRuleTemplateArgs, opts?: pulumi.InvokeOptions): Promise { @@ -65,6 +78,19 @@ export interface GetAlertRuleTemplateResult { } /** * Use this data source to access information about an existing Sentinel Alert Rule Template. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sentinel.getAlertRuleTemplate({ + * logAnalyticsWorkspaceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", + * displayName: "Create incidents based on Azure Security Center for IoT alerts", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getAlertRuleTemplateOutput(args: GetAlertRuleTemplateOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAlertRuleTemplate(a, opts)) diff --git a/sdk/nodejs/sentinel/logAnalyticsWorkspaceOnboarding.ts b/sdk/nodejs/sentinel/logAnalyticsWorkspaceOnboarding.ts index 655b7f2aba..2a8388544c 100644 --- a/sdk/nodejs/sentinel/logAnalyticsWorkspaceOnboarding.ts +++ b/sdk/nodejs/sentinel/logAnalyticsWorkspaceOnboarding.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Security Insights Sentinel Onboarding. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceName: exampleAnalyticsWorkspace.name, + * customerManagedKeyEnabled: false, + * }); + * ``` + * * ## Import * * Security Insights Sentinel Onboarding States can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/metadata.ts b/sdk/nodejs/sentinel/metadata.ts index 99bb3cd4ae..5438c83b7e 100644 --- a/sdk/nodejs/sentinel/metadata.ts +++ b/sdk/nodejs/sentinel/metadata.ts @@ -9,6 +9,47 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Metadata. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "pergb2018", + * }); + * const exampleAnalyticsSolution = new azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", { + * solutionName: "SecurityInsights", + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * workspaceResourceId: exampleAnalyticsWorkspace.id, + * workspaceName: exampleAnalyticsWorkspace.name, + * plan: { + * publisher: "Microsoft", + * product: "OMSGallery/SecurityInsights", + * }, + * }); + * const exampleAlertRuleNrt = new azure.sentinel.AlertRuleNrt("exampleAlertRuleNrt", { + * logAnalyticsWorkspaceId: exampleAnalyticsSolution.workspaceResourceId, + * displayName: "example", + * severity: "High", + * query: `AzureActivity | + * where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + * where ActivityStatus == "Succeeded" | + * make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + * `, + * }); + * const exampleMetadata = new azure.sentinel.Metadata("exampleMetadata", { + * workspaceId: exampleAnalyticsSolution.workspaceResourceId, + * contentId: exampleAlertRuleNrt.name, + * kind: "AnalyticsRule", + * parentId: exampleAlertRuleNrt.id, + * }); + * ``` + * * ## Import * * Sentinel Metadata can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/threatIntelligenceIndicator.ts b/sdk/nodejs/sentinel/threatIntelligenceIndicator.ts index 6ce01e83db..e4792def72 100644 --- a/sdk/nodejs/sentinel/threatIntelligenceIndicator.ts +++ b/sdk/nodejs/sentinel/threatIntelligenceIndicator.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Threat Intelligence Indicator. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * retentionInDays: 30, + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", { + * resourceGroupName: exampleResourceGroup.name, + * workspaceName: exampleAnalyticsWorkspace.name, + * }); + * const exampleThreatIntelligenceIndicator = new azure.sentinel.ThreatIntelligenceIndicator("exampleThreatIntelligenceIndicator", { + * workspaceId: exampleAnalyticsWorkspace.id, + * patternType: "domain-name", + * pattern: "http://example.com", + * source: "Microsoft Sentinel", + * validateFromUtc: "2022-12-14T16:00:00Z", + * displayName: "example-indicator", + * }, { + * dependsOn: [azurerm_sentinel_log_analytics_workspace_onboarding.test], + * }); + * ``` + * * ## Import * * Sentinel Threat Intelligence Indicators can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/watchlist.ts b/sdk/nodejs/sentinel/watchlist.ts index 0f65bda1a4..3dfa7bf543 100644 --- a/sdk/nodejs/sentinel/watchlist.ts +++ b/sdk/nodejs/sentinel/watchlist.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Watchlist. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleWatchlist = new azure.sentinel.Watchlist("exampleWatchlist", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "example-wl", + * itemSearchKey: "Key", + * }); + * ``` + * * ## Import * * Sentinel Watchlists can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sentinel/watchlistItem.ts b/sdk/nodejs/sentinel/watchlistItem.ts index 4e573646e4..ef9a4ae0a7 100644 --- a/sdk/nodejs/sentinel/watchlistItem.ts +++ b/sdk/nodejs/sentinel/watchlistItem.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages a Sentinel Watchlist Item. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "PerGB2018", + * }); + * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", {workspaceId: exampleAnalyticsWorkspace.id}); + * const exampleWatchlist = new azure.sentinel.Watchlist("exampleWatchlist", { + * logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId, + * displayName: "example-wl", + * itemSearchKey: "Key", + * }); + * const exampleWatchlistItem = new azure.sentinel.WatchlistItem("exampleWatchlistItem", { + * watchlistId: exampleWatchlist.id, + * properties: { + * k1: "v1", + * k2: "v2", + * }, + * }); + * ``` + * * ## Import * * Sentinel Watchlist Items can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/getNamespace.ts b/sdk/nodejs/servicebus/getNamespace.ts index de7fb83b56..3a5a845979 100644 --- a/sdk/nodejs/servicebus/getNamespace.ts +++ b/sdk/nodejs/servicebus/getNamespace.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing ServiceBus Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getNamespace({ + * name: "examplenamespace", + * resourceGroupName: "example-resources", + * }); + * export const location = example.then(example => example.location); + * ``` */ export function getNamespace(args: GetNamespaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -85,6 +98,19 @@ export interface GetNamespaceResult { } /** * Use this data source to access information about an existing ServiceBus Namespace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getNamespace({ + * name: "examplenamespace", + * resourceGroupName: "example-resources", + * }); + * export const location = example.then(example => example.location); + * ``` */ export function getNamespaceOutput(args: GetNamespaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNamespace(a, opts)) diff --git a/sdk/nodejs/servicebus/getNamespaceAuthorizationRule.ts b/sdk/nodejs/servicebus/getNamespaceAuthorizationRule.ts index a4203adf5e..42c989b2c1 100644 --- a/sdk/nodejs/servicebus/getNamespaceAuthorizationRule.ts +++ b/sdk/nodejs/servicebus/getNamespaceAuthorizationRule.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing ServiceBus Namespace Authorization Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getNamespaceAuthorizationRule({ + * name: "examplerule", + * namespaceId: "examplenamespace", + * }); + * export const ruleId = example.then(example => example.id); + * ``` */ export function getNamespaceAuthorizationRule(args: GetNamespaceAuthorizationRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -91,6 +104,19 @@ export interface GetNamespaceAuthorizationRuleResult { } /** * Use this data source to access information about an existing ServiceBus Namespace Authorization Rule. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getNamespaceAuthorizationRule({ + * name: "examplerule", + * namespaceId: "examplenamespace", + * }); + * export const ruleId = example.then(example => example.id); + * ``` */ export function getNamespaceAuthorizationRuleOutput(args: GetNamespaceAuthorizationRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getNamespaceAuthorizationRule(a, opts)) diff --git a/sdk/nodejs/servicebus/getQueue.ts b/sdk/nodejs/servicebus/getQueue.ts index d26c8fba70..afa594758b 100644 --- a/sdk/nodejs/servicebus/getQueue.ts +++ b/sdk/nodejs/servicebus/getQueue.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Service Bus Queue. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getQueue({ + * name: "existing", + * namespaceId: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getQueue(args: GetQueueArgs, opts?: pulumi.InvokeOptions): Promise { @@ -127,6 +140,19 @@ export interface GetQueueResult { } /** * Use this data source to access information about an existing Service Bus Queue. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getQueue({ + * name: "existing", + * namespaceId: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getQueueOutput(args: GetQueueOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getQueue(a, opts)) diff --git a/sdk/nodejs/servicebus/getQueueAuthorizationRule.ts b/sdk/nodejs/servicebus/getQueueAuthorizationRule.ts index 53b537fe77..f8627cea10 100644 --- a/sdk/nodejs/servicebus/getQueueAuthorizationRule.ts +++ b/sdk/nodejs/servicebus/getQueueAuthorizationRule.ts @@ -6,6 +6,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing ServiceBus Queue Authorisation Rule within a ServiceBus Queue. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getQueueAuthorizationRule({ + * name: "example-tfex_name", + * resourceGroupName: "example-resources", + * queueName: "example-servicebus_queue", + * namespaceName: "example-namespace", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getQueueAuthorizationRule(args: GetQueueAuthorizationRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -85,6 +100,21 @@ export interface GetQueueAuthorizationRuleResult { } /** * Use this data source to access information about an existing ServiceBus Queue Authorisation Rule within a ServiceBus Queue. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getQueueAuthorizationRule({ + * name: "example-tfex_name", + * resourceGroupName: "example-resources", + * queueName: "example-servicebus_queue", + * namespaceName: "example-namespace", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getQueueAuthorizationRuleOutput(args: GetQueueAuthorizationRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getQueueAuthorizationRule(a, opts)) diff --git a/sdk/nodejs/servicebus/getSubscription.ts b/sdk/nodejs/servicebus/getSubscription.ts index fbcf0c99e2..b2a321d6bb 100644 --- a/sdk/nodejs/servicebus/getSubscription.ts +++ b/sdk/nodejs/servicebus/getSubscription.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing ServiceBus Subscription. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getSubscription({ + * name: "examplesubscription", + * topicId: "exampletopic", + * }); + * export const servicebusSubscription = data.azurerm_servicebus_namespace.example; + * ``` */ export function getSubscription(args: GetSubscriptionArgs, opts?: pulumi.InvokeOptions): Promise { @@ -118,6 +131,19 @@ export interface GetSubscriptionResult { } /** * Use this data source to access information about an existing ServiceBus Subscription. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getSubscription({ + * name: "examplesubscription", + * topicId: "exampletopic", + * }); + * export const servicebusSubscription = data.azurerm_servicebus_namespace.example; + * ``` */ export function getSubscriptionOutput(args: GetSubscriptionOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSubscription(a, opts)) diff --git a/sdk/nodejs/servicebus/getTopic.ts b/sdk/nodejs/servicebus/getTopic.ts index 4fd99df190..8f29a7e47c 100644 --- a/sdk/nodejs/servicebus/getTopic.ts +++ b/sdk/nodejs/servicebus/getTopic.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Service Bus Topic. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getTopic({ + * name: "existing", + * namespaceId: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getTopic(args: GetTopicArgs, opts?: pulumi.InvokeOptions): Promise { @@ -107,6 +120,19 @@ export interface GetTopicResult { } /** * Use this data source to access information about an existing Service Bus Topic. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getTopic({ + * name: "existing", + * namespaceId: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getTopicOutput(args: GetTopicOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTopic(a, opts)) diff --git a/sdk/nodejs/servicebus/getTopicAuthorizationRule.ts b/sdk/nodejs/servicebus/getTopicAuthorizationRule.ts index abeba36cf8..bed9df8d5d 100644 --- a/sdk/nodejs/servicebus/getTopicAuthorizationRule.ts +++ b/sdk/nodejs/servicebus/getTopicAuthorizationRule.ts @@ -6,6 +6,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about a ServiceBus Topic Authorization Rule within a ServiceBus Topic. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getTopicAuthorizationRule({ + * name: "example-tfex_name", + * resourceGroupName: "example-resources", + * namespaceName: "example-namespace", + * topicName: "example-servicebus_topic", + * }); + * export const servicebusAuthorizationRuleId = data.azurem_servicebus_topic_authorization_rule.example.id; + * ``` */ export function getTopicAuthorizationRule(args: GetTopicAuthorizationRuleArgs, opts?: pulumi.InvokeOptions): Promise { @@ -88,6 +103,21 @@ export interface GetTopicAuthorizationRuleResult { } /** * Use this data source to access information about a ServiceBus Topic Authorization Rule within a ServiceBus Topic. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.servicebus.getTopicAuthorizationRule({ + * name: "example-tfex_name", + * resourceGroupName: "example-resources", + * namespaceName: "example-namespace", + * topicName: "example-servicebus_topic", + * }); + * export const servicebusAuthorizationRuleId = data.azurem_servicebus_topic_authorization_rule.example.id; + * ``` */ export function getTopicAuthorizationRuleOutput(args: GetTopicAuthorizationRuleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTopicAuthorizationRule(a, opts)) diff --git a/sdk/nodejs/servicebus/namespace.ts b/sdk/nodejs/servicebus/namespace.ts index 9e547d4de3..e24a1a4ff1 100644 --- a/sdk/nodejs/servicebus/namespace.ts +++ b/sdk/nodejs/servicebus/namespace.ts @@ -9,6 +9,23 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Namespace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * ``` + * * ## Import * * Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/namespaceAuthorizationRule.ts b/sdk/nodejs/servicebus/namespaceAuthorizationRule.ts index ed1a1ee7c0..ec2d7920a6 100644 --- a/sdk/nodejs/servicebus/namespaceAuthorizationRule.ts +++ b/sdk/nodejs/servicebus/namespaceAuthorizationRule.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Namespace authorization Rule within a ServiceBus. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleNamespaceAuthorizationRule = new azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", { + * namespaceId: exampleNamespace.id, + * listen: true, + * send: true, + * manage: false, + * }); + * ``` + * * ## Import * * ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/namespaceDisasterRecoveryConfig.ts b/sdk/nodejs/servicebus/namespaceDisasterRecoveryConfig.ts index f930e56a07..ab86023394 100644 --- a/sdk/nodejs/servicebus/namespaceDisasterRecoveryConfig.ts +++ b/sdk/nodejs/servicebus/namespaceDisasterRecoveryConfig.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; * * > **NOTE:** Disaster Recovery Config is a Premium SKU only capability. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const primary = new azure.servicebus.Namespace("primary", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Premium", + * capacity: 1, + * }); + * const secondary = new azure.servicebus.Namespace("secondary", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Premium", + * capacity: 1, + * }); + * const exampleNamespaceAuthorizationRule = new azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", { + * namespaceId: azurerm_servicebus_namespace.example.id, + * listen: true, + * send: true, + * manage: false, + * }); + * const exampleNamespaceDisasterRecoveryConfig = new azure.servicebus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", { + * primaryNamespaceId: primary.id, + * partnerNamespaceId: secondary.id, + * aliasAuthorizationRuleId: exampleNamespaceAuthorizationRule.id, + * }); + * ``` + * * ## Import * * Service Bus DR configs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/namespaceNetworkRuleSet.ts b/sdk/nodejs/servicebus/namespaceNetworkRuleSet.ts index 4a133e3eb5..a18825f95d 100644 --- a/sdk/nodejs/servicebus/namespaceNetworkRuleSet.ts +++ b/sdk/nodejs/servicebus/namespaceNetworkRuleSet.ts @@ -9,6 +9,46 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Namespace Network Rule Set. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Premium", + * capacity: 1, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["172.17.0.0/16"], + * dnsServers: [ + * "10.0.0.4", + * "10.0.0.5", + * ], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["172.17.0.0/24"], + * serviceEndpoints: ["Microsoft.ServiceBus"], + * }); + * const exampleNamespaceNetworkRuleSet = new azure.servicebus.NamespaceNetworkRuleSet("exampleNamespaceNetworkRuleSet", { + * namespaceId: exampleNamespace.id, + * defaultAction: "Deny", + * publicNetworkAccessEnabled: true, + * networkRules: [{ + * subnetId: exampleSubnet.id, + * ignoreMissingVnetServiceEndpoint: false, + * }], + * ipRules: ["1.1.1.1"], + * }); + * ``` + * * ## Import * * Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/queue.ts b/sdk/nodejs/servicebus/queue.ts index cbb905eec5..8fa5beb467 100644 --- a/sdk/nodejs/servicebus/queue.ts +++ b/sdk/nodejs/servicebus/queue.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Queue. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleQueue = new azure.servicebus.Queue("exampleQueue", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * ``` + * * ## Import * * Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/queueAuthorizationRule.ts b/sdk/nodejs/servicebus/queueAuthorizationRule.ts index 9fe62e743e..f882c0e31a 100644 --- a/sdk/nodejs/servicebus/queueAuthorizationRule.ts +++ b/sdk/nodejs/servicebus/queueAuthorizationRule.ts @@ -7,6 +7,33 @@ import * as utilities from "../utilities"; /** * Manages an Authorization Rule for a ServiceBus Queue. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleQueue = new azure.servicebus.Queue("exampleQueue", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleQueueAuthorizationRule = new azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", { + * queueId: exampleQueue.id, + * listen: true, + * send: true, + * manage: false, + * }); + * ``` + * * ## Import * * ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/subscription.ts b/sdk/nodejs/servicebus/subscription.ts index 2a35d0f6de..01c5470e6f 100644 --- a/sdk/nodejs/servicebus/subscription.ts +++ b/sdk/nodejs/servicebus/subscription.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Subscription. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleSubscription = new azure.servicebus.Subscription("exampleSubscription", { + * topicId: exampleTopic.id, + * maxDeliveryCount: 1, + * }); + * ``` + * * ## Import * * Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/subscriptionRule.ts b/sdk/nodejs/servicebus/subscriptionRule.ts index 535095875f..b02601b312 100644 --- a/sdk/nodejs/servicebus/subscriptionRule.ts +++ b/sdk/nodejs/servicebus/subscriptionRule.ts @@ -10,6 +10,70 @@ import * as utilities from "../utilities"; * Manages a ServiceBus Subscription Rule. * * ## Example Usage + * ### SQL Filter) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleSubscription = new azure.servicebus.Subscription("exampleSubscription", { + * topicId: exampleTopic.id, + * maxDeliveryCount: 1, + * }); + * const exampleSubscriptionRule = new azure.servicebus.SubscriptionRule("exampleSubscriptionRule", { + * subscriptionId: exampleSubscription.id, + * filterType: "SqlFilter", + * sqlFilter: "colour = 'red'", + * }); + * ``` + * ### Correlation Filter) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleSubscription = new azure.servicebus.Subscription("exampleSubscription", { + * topicId: exampleTopic.id, + * maxDeliveryCount: 1, + * }); + * const exampleSubscriptionRule = new azure.servicebus.SubscriptionRule("exampleSubscriptionRule", { + * subscriptionId: exampleSubscription.id, + * filterType: "CorrelationFilter", + * correlationFilter: { + * correlationId: "high", + * label: "red", + * properties: { + * customProperty: "value", + * }, + * }, + * }); + * ``` * * ## Import * diff --git a/sdk/nodejs/servicebus/topic.ts b/sdk/nodejs/servicebus/topic.ts index dbc513771c..8dacef8006 100644 --- a/sdk/nodejs/servicebus/topic.ts +++ b/sdk/nodejs/servicebus/topic.ts @@ -9,6 +9,27 @@ import * as utilities from "../utilities"; * * **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * ``` + * * ## Import * * Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicebus/topicAuthorizationRule.ts b/sdk/nodejs/servicebus/topicAuthorizationRule.ts index bfcf1050ea..bade5acca5 100644 --- a/sdk/nodejs/servicebus/topicAuthorizationRule.ts +++ b/sdk/nodejs/servicebus/topicAuthorizationRule.ts @@ -7,6 +7,30 @@ import * as utilities from "../utilities"; /** * Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * tags: { + * source: "example", + * }, + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", {namespaceId: exampleNamespace.id}); + * const exampleTopicAuthorizationRule = new azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", { + * topicId: exampleTopic.id, + * listen: true, + * send: false, + * manage: false, + * }); + * ``` + * * ## Import * * ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicefabric/cluster.ts b/sdk/nodejs/servicefabric/cluster.ts index 4921d49de2..f21b4ca0cc 100644 --- a/sdk/nodejs/servicefabric/cluster.ts +++ b/sdk/nodejs/servicefabric/cluster.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Service Fabric Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.servicefabric.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * reliabilityLevel: "Bronze", + * upgradeMode: "Manual", + * clusterCodeVersion: "7.1.456.959", + * vmImage: "Windows", + * managementEndpoint: "https://example:80", + * nodeTypes: [{ + * name: "first", + * instanceCount: 3, + * isPrimary: true, + * clientEndpointPort: 2020, + * httpEndpointPort: 80, + * }], + * }); + * ``` + * * ## Import * * Service Fabric Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/servicefabric/managedCluster.ts b/sdk/nodejs/servicefabric/managedCluster.ts index 6d63bd251a..1d39009653 100644 --- a/sdk/nodejs/servicefabric/managedCluster.ts +++ b/sdk/nodejs/servicefabric/managedCluster.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; /** * Manages a Resource Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.servicefabric.ManagedCluster("example", { + * clientConnectionPort: 12345, + * httpGatewayPort: 4567, + * lbRules: [{ + * backendPort: 38080, + * frontendPort: 80, + * probeProtocol: "http", + * probeRequestPath: "/test", + * protocol: "tcp", + * }], + * location: "West Europe", + * nodeTypes: [{ + * applicationPortRange: "30000-49000", + * dataDiskSizeGb: 130, + * ephemeralPortRange: "10000-20000", + * name: "test1", + * primary: true, + * vmImageOffer: "WindowsServer", + * vmImagePublisher: "MicrosoftWindowsServer", + * vmImageSku: "2019-Datacenter-with-Containers", + * vmImageVersion: "latest", + * vmInstanceCount: 5, + * vmSize: "Standard_DS1_v2", + * }], + * resourceGroupName: "example", + * }); + * ``` + * * ## Import * * Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/signalr/getService.ts b/sdk/nodejs/signalr/getService.ts index 52e3ec783a..8aa50fa26f 100644 --- a/sdk/nodejs/signalr/getService.ts +++ b/sdk/nodejs/signalr/getService.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure SignalR service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.signalr.getService({ + * name: "test-signalr", + * resourceGroupName: "signalr-resource-group", + * }); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -100,6 +112,18 @@ export interface GetServiceResult { } /** * Use this data source to access information about an existing Azure SignalR service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.signalr.getService({ + * name: "test-signalr", + * resourceGroupName: "signalr-resource-group", + * }); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/signalr/service.ts b/sdk/nodejs/signalr/service.ts index d2c55f0dbb..4cb72f1051 100644 --- a/sdk/nodejs/signalr/service.ts +++ b/sdk/nodejs/signalr/service.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages an Azure SignalR service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"}); + * const exampleService = new azure.signalr.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Free_F1", + * capacity: 1, + * }, + * cors: [{ + * allowedOrigins: ["http://www.example.com"], + * }], + * publicNetworkAccessEnabled: false, + * connectivityLogsEnabled: true, + * messagingLogsEnabled: true, + * serviceMode: "Default", + * upstreamEndpoints: [{ + * categoryPatterns: [ + * "connections", + * "messages", + * ], + * eventPatterns: ["*"], + * hubPatterns: ["hub1"], + * urlTemplate: "http://foo.com", + * }], + * }); + * ``` + * * ## Import * * SignalR services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/signalr/serviceCustomCertificate.ts b/sdk/nodejs/signalr/serviceCustomCertificate.ts index 924fdea863..7e21c9122a 100644 --- a/sdk/nodejs/signalr/serviceCustomCertificate.ts +++ b/sdk/nodejs/signalr/serviceCustomCertificate.ts @@ -7,6 +7,75 @@ import * as utilities from "../utilities"; /** * Manages an Azure SignalR Custom Certificate. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.signalr.Service("exampleService", { + * location: azurerm_resource_group.test.location, + * resourceGroupName: azurerm_resource_group.test.name, + * sku: { + * name: "Premium_P1", + * capacity: 1, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Create", + * "Get", + * "List", + * ], + * secretPermissions: [ + * "Get", + * "List", + * ], + * }, + * { + * tenantId: current.then(current => current.tenantId), + * objectId: azurerm_signalr_service.test.identity[0].principal_id, + * certificatePermissions: [ + * "Create", + * "Get", + * "List", + * ], + * secretPermissions: [ + * "Get", + * "List", + * ], + * }, + * ], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificate: { + * contents: Buffer.from(fs.readFileSync("certificate-to-import.pfx"), 'binary').toString('base64'), + * password: "", + * }, + * }); + * const test = new azure.signalr.ServiceCustomCertificate("test", { + * signalrServiceId: exampleService.id, + * customCertificateId: exampleCertificate.id, + * }, { + * dependsOn: [azurerm_key_vault_access_policy.example], + * }); + * ``` + * * ## Import * * Custom Certificate for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/signalr/serviceCustomDomain.ts b/sdk/nodejs/signalr/serviceCustomDomain.ts index f526e3c0af..1c0944f0ed 100644 --- a/sdk/nodejs/signalr/serviceCustomDomain.ts +++ b/sdk/nodejs/signalr/serviceCustomDomain.ts @@ -7,6 +7,80 @@ import * as utilities from "../utilities"; /** * Manages an Azure SignalR Custom Domain. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as fs from "fs"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.signalr.Service("exampleService", { + * location: azurerm_resource_group.test.location, + * resourceGroupName: azurerm_resource_group.test.name, + * sku: { + * name: "Premium_P1", + * capacity: 1, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "premium", + * accessPolicies: [ + * { + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: [ + * "Create", + * "Get", + * "List", + * ], + * secretPermissions: [ + * "Get", + * "List", + * ], + * }, + * { + * tenantId: current.then(current => current.tenantId), + * objectId: azurerm_signalr_service.test.identity[0].principal_id, + * certificatePermissions: [ + * "Create", + * "Get", + * "List", + * ], + * secretPermissions: [ + * "Get", + * "List", + * ], + * }, + * ], + * }); + * const exampleCertificate = new azure.keyvault.Certificate("exampleCertificate", { + * keyVaultId: exampleKeyVault.id, + * certificate: { + * contents: Buffer.from(fs.readFileSync("certificate-to-import.pfx"), 'binary').toString('base64'), + * password: "", + * }, + * }); + * const testServiceCustomCertificate = new azure.signalr.ServiceCustomCertificate("testServiceCustomCertificate", { + * signalrServiceId: exampleService.id, + * customCertificateId: exampleCertificate.id, + * }, { + * dependsOn: [azurerm_key_vault_access_policy.example], + * }); + * const testServiceCustomDomain = new azure.signalr.ServiceCustomDomain("testServiceCustomDomain", { + * signalrServiceId: azurerm_signalr_service.test.id, + * domainName: "tftest.com", + * signalrCustomCertificateId: testServiceCustomCertificate.id, + * }); + * ``` + * * ## Import * * Custom Domain for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/signalr/serviceNetworkAcl.ts b/sdk/nodejs/signalr/serviceNetworkAcl.ts index 91a7f98614..68ac1d5efa 100644 --- a/sdk/nodejs/signalr/serviceNetworkAcl.ts +++ b/sdk/nodejs/signalr/serviceNetworkAcl.ts @@ -9,6 +9,56 @@ import * as utilities from "../utilities"; /** * Manages the Network ACL for a SignalR service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleService = new azure.signalr.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: { + * name: "Standard_S1", + * capacity: 1, + * }, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.5.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.2.0/24"], + * enforcePrivateLinkEndpointNetworkPolicies: true, + * }); + * const exampleEndpoint = new azure.privatelink.Endpoint("exampleEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subnetId: exampleSubnet.id, + * privateServiceConnection: { + * name: "psc-sig-test", + * isManualConnection: false, + * privateConnectionResourceId: exampleService.id, + * subresourceNames: ["signalr"], + * }, + * }); + * const exampleServiceNetworkAcl = new azure.signalr.ServiceNetworkAcl("exampleServiceNetworkAcl", { + * signalrServiceId: exampleService.id, + * defaultAction: "Deny", + * publicNetwork: { + * allowedRequestTypes: ["ClientConnection"], + * }, + * privateEndpoints: [{ + * id: exampleEndpoint.id, + * allowedRequestTypes: ["ServerConnection"], + * }], + * }); + * ``` + * * ## Import * * Network ACLs for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/signalr/sharedPrivateLinkResource.ts b/sdk/nodejs/signalr/sharedPrivateLinkResource.ts index acf332b20a..a1274df5ad 100644 --- a/sdk/nodejs/signalr/sharedPrivateLinkResource.ts +++ b/sdk/nodejs/signalr/sharedPrivateLinkResource.ts @@ -7,6 +7,43 @@ import * as utilities from "../utilities"; /** * Manages the Shared Private Link Resource for a Signalr service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * softDeleteRetentionDays: 7, + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: ["ManageContacts"], + * keyPermissions: ["Create"], + * secretPermissions: ["Set"], + * }], + * }); + * const test = new azure.signalr.Service("test", { + * location: azurerm_resource_group.test.location, + * resourceGroupName: azurerm_resource_group.test.name, + * sku: { + * name: "Standard_S1", + * capacity: 1, + * }, + * }); + * const exampleSharedPrivateLinkResource = new azure.signalr.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", { + * signalrServiceId: azurerm_signalr_service.example.id, + * subResourceName: "vault", + * targetResourceId: exampleKeyVault.id, + * }); + * ``` + * * ## Import * * Signalr Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/fabric.ts b/sdk/nodejs/siterecovery/fabric.ts index 8043e4aade..eccd0352a4 100644 --- a/sdk/nodejs/siterecovery/fabric.ts +++ b/sdk/nodejs/siterecovery/fabric.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Azure Site Recovery Replication Fabric within a Recovery Services vault. Only Azure fabrics are supported at this time. Replication Fabrics serve as a container within an Azure region for other Site Recovery resources such as protection containers, protected items, network mappings. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = new azure.core.ResourceGroup("primary", {location: "West US"}); + * const secondary = new azure.core.ResourceGroup("secondary", {location: "East US"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: secondary.location, + * resourceGroupName: secondary.name, + * sku: "Standard", + * }); + * const fabric = new azure.siterecovery.Fabric("fabric", { + * resourceGroupName: secondary.name, + * recoveryVaultName: vault.name, + * location: primary.location, + * }); + * ``` + * * ## Import * * Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/getFabric.ts b/sdk/nodejs/siterecovery/getFabric.ts index d936f21644..f544576684 100644 --- a/sdk/nodejs/siterecovery/getFabric.ts +++ b/sdk/nodejs/siterecovery/getFabric.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Site Recovery Replication Fabric. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const fabric = azure.siterecovery.getFabric({ + * name: "primary-fabric", + * recoveryVaultName: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getFabric(args: GetFabricArgs, opts?: pulumi.InvokeOptions): Promise { @@ -53,6 +66,19 @@ export interface GetFabricResult { } /** * Use this data source to access information about an existing Site Recovery Replication Fabric. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const fabric = azure.siterecovery.getFabric({ + * name: "primary-fabric", + * recoveryVaultName: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getFabricOutput(args: GetFabricOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFabric(a, opts)) diff --git a/sdk/nodejs/siterecovery/getProtectionContainer.ts b/sdk/nodejs/siterecovery/getProtectionContainer.ts index 6aac166850..421d981a26 100644 --- a/sdk/nodejs/siterecovery/getProtectionContainer.ts +++ b/sdk/nodejs/siterecovery/getProtectionContainer.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing site recovery services protection container. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const container = azure.siterecovery.getProtectionContainer({ + * name: "primary-container", + * recoveryFabricName: "primary-fabric", + * recoveryVaultName: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getProtectionContainer(args: GetProtectionContainerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +69,20 @@ export interface GetProtectionContainerResult { } /** * Use this data source to access information about an existing site recovery services protection container. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const container = azure.siterecovery.getProtectionContainer({ + * name: "primary-container", + * recoveryFabricName: "primary-fabric", + * recoveryVaultName: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getProtectionContainerOutput(args: GetProtectionContainerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getProtectionContainer(a, opts)) diff --git a/sdk/nodejs/siterecovery/getReplicationPolicy.ts b/sdk/nodejs/siterecovery/getReplicationPolicy.ts index 099ed8cc9d..a9abf4ec9a 100644 --- a/sdk/nodejs/siterecovery/getReplicationPolicy.ts +++ b/sdk/nodejs/siterecovery/getReplicationPolicy.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure Site Recovery replication policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const policy = azure.siterecovery.getReplicationPolicy({ + * name: "replication-policy", + * recoveryVaultName: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getReplicationPolicy(args: GetReplicationPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -57,6 +70,19 @@ export interface GetReplicationPolicyResult { } /** * Use this data source to access information about an existing Azure Site Recovery replication policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const policy = azure.siterecovery.getReplicationPolicy({ + * name: "replication-policy", + * recoveryVaultName: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * ``` */ export function getReplicationPolicyOutput(args: GetReplicationPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getReplicationPolicy(a, opts)) diff --git a/sdk/nodejs/siterecovery/getReplicationRecoveryPlan.ts b/sdk/nodejs/siterecovery/getReplicationRecoveryPlan.ts index 55d7179c74..d7ad04b489 100644 --- a/sdk/nodejs/siterecovery/getReplicationRecoveryPlan.ts +++ b/sdk/nodejs/siterecovery/getReplicationRecoveryPlan.ts @@ -8,6 +8,22 @@ import * as utilities from "../utilities"; /** * Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const vault = azure.recoveryservices.getVault({ + * name: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * const example = vault.then(vault => azure.siterecovery.getReplicationRecoveryPlan({ + * name: "example-recovery-plan", + * recoveryVaultId: vault.id, + * })); + * ``` */ export function getReplicationRecoveryPlan(args: GetReplicationRecoveryPlanArgs, opts?: pulumi.InvokeOptions): Promise { @@ -63,6 +79,22 @@ export interface GetReplicationRecoveryPlanResult { } /** * Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const vault = azure.recoveryservices.getVault({ + * name: "tfex-recovery_vault", + * resourceGroupName: "tfex-resource_group", + * }); + * const example = vault.then(vault => azure.siterecovery.getReplicationRecoveryPlan({ + * name: "example-recovery-plan", + * recoveryVaultId: vault.id, + * })); + * ``` */ export function getReplicationRecoveryPlanOutput(args: GetReplicationRecoveryPlanOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getReplicationRecoveryPlan(a, opts)) diff --git a/sdk/nodejs/siterecovery/hyperVReplicationPolicy.ts b/sdk/nodejs/siterecovery/hyperVReplicationPolicy.ts index 92f8710070..c145b5854c 100644 --- a/sdk/nodejs/siterecovery/hyperVReplicationPolicy.ts +++ b/sdk/nodejs/siterecovery/hyperVReplicationPolicy.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Azure Site Recovery replication policy for HyperV within a Recovery Vault. Replication policies define the frequency at which recovery points are created and how long they are stored. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "East US"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: example.location, + * resourceGroupName: example.name, + * sku: "Standard", + * }); + * const policy = new azure.siterecovery.HyperVReplicationPolicy("policy", { + * recoveryVaultId: vault.id, + * recoveryPointRetentionInHours: 2, + * applicationConsistentSnapshotFrequencyInHours: 1, + * replicationIntervalInSeconds: 300, + * }); + * ``` + * * ## Import * * Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/hyperVReplicationPolicyAssociation.ts b/sdk/nodejs/siterecovery/hyperVReplicationPolicyAssociation.ts index 44d011e5fe..570bb6f615 100644 --- a/sdk/nodejs/siterecovery/hyperVReplicationPolicyAssociation.ts +++ b/sdk/nodejs/siterecovery/hyperVReplicationPolicyAssociation.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages an Azure Site Recovery replication policy for HyperV within a Recovery Vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleHyperVSite = new azure.siterecovery.HyperVSite("exampleHyperVSite", {recoveryVaultId: exampleVault.id}); + * const exampleHyperVReplicationPolicy = new azure.siterecovery.HyperVReplicationPolicy("exampleHyperVReplicationPolicy", { + * recoveryVaultId: exampleVault.id, + * recoveryPointRetentionInHours: 2, + * applicationConsistentSnapshotFrequencyInHours: 1, + * replicationIntervalInSeconds: 300, + * }); + * const exampleHyperVReplicationPolicyAssociation = new azure.siterecovery.HyperVReplicationPolicyAssociation("exampleHyperVReplicationPolicyAssociation", { + * hypervSiteId: exampleHyperVSite.id, + * policyId: exampleHyperVReplicationPolicy.id, + * }); + * ``` + * * ## Import * * Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/hyperVSite.ts b/sdk/nodejs/siterecovery/hyperVSite.ts index 343397c0ef..4cb7ec0e50 100644 --- a/sdk/nodejs/siterecovery/hyperVSite.ts +++ b/sdk/nodejs/siterecovery/hyperVSite.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a HyperV Site in Recovery Service Vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "eastus"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * softDeleteEnabled: false, + * }); + * const exampleHyperVSite = new azure.siterecovery.HyperVSite("exampleHyperVSite", {recoveryVaultId: exampleVault.id}); + * ``` + * * ## Import * * Recovery Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/hypervNetworkMapping.ts b/sdk/nodejs/siterecovery/hypervNetworkMapping.ts index 662b3162db..5ef0d93e98 100644 --- a/sdk/nodejs/siterecovery/hypervNetworkMapping.ts +++ b/sdk/nodejs/siterecovery/hypervNetworkMapping.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a HyperV site recovery network mapping on Azure. A HyperV network mapping decides how to translate connected networks when a VM is migrated from HyperV VMM Center to Azure. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const targetResourceGroup = new azure.core.ResourceGroup("targetResourceGroup", {location: "East US"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: targetResourceGroup.location, + * resourceGroupName: targetResourceGroup.name, + * sku: "Standard", + * }); + * const targetVirtualNetwork = new azure.network.VirtualNetwork("targetVirtualNetwork", { + * resourceGroupName: targetResourceGroup.name, + * addressSpaces: ["192.168.2.0/24"], + * location: targetResourceGroup.location, + * }); + * const recovery_mapping = new azure.siterecovery.HypervNetworkMapping("recovery-mapping", { + * recoveryVaultId: vault.id, + * sourceSystemCenterVirtualMachineManagerName: "my-vmm-server", + * sourceNetworkName: "my-vmm-network", + * targetNetworkId: targetVirtualNetwork.id, + * }); + * ``` + * * ## Import * * Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/networkMapping.ts b/sdk/nodejs/siterecovery/networkMapping.ts index a4470ad530..db7ab5b398 100644 --- a/sdk/nodejs/siterecovery/networkMapping.ts +++ b/sdk/nodejs/siterecovery/networkMapping.ts @@ -7,6 +7,52 @@ import * as utilities from "../utilities"; /** * Manages a site recovery network mapping on Azure. A network mapping decides how to translate connected networks when a VM is migrated from one region to another. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primaryResourceGroup = new azure.core.ResourceGroup("primaryResourceGroup", {location: "West US"}); + * const secondaryResourceGroup = new azure.core.ResourceGroup("secondaryResourceGroup", {location: "East US"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: secondaryResourceGroup.location, + * resourceGroupName: secondaryResourceGroup.name, + * sku: "Standard", + * }); + * const primaryFabric = new azure.siterecovery.Fabric("primaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: primaryResourceGroup.location, + * }); + * const secondaryFabric = new azure.siterecovery.Fabric("secondaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: secondaryResourceGroup.location, + * }, { + * dependsOn: [primaryFabric], + * }); + * // Avoids issues with creating fabrics simultaneously + * const primaryVirtualNetwork = new azure.network.VirtualNetwork("primaryVirtualNetwork", { + * resourceGroupName: primaryResourceGroup.name, + * addressSpaces: ["192.168.1.0/24"], + * location: primaryResourceGroup.location, + * }); + * const secondaryVirtualNetwork = new azure.network.VirtualNetwork("secondaryVirtualNetwork", { + * resourceGroupName: secondaryResourceGroup.name, + * addressSpaces: ["192.168.2.0/24"], + * location: secondaryResourceGroup.location, + * }); + * const recovery_mapping = new azure.siterecovery.NetworkMapping("recovery-mapping", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * sourceRecoveryFabricName: "primary-fabric", + * targetRecoveryFabricName: "secondary-fabric", + * sourceNetworkId: primaryVirtualNetwork.id, + * targetNetworkId: secondaryVirtualNetwork.id, + * }); + * ``` + * * ## Import * * Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/protectionContainer.ts b/sdk/nodejs/siterecovery/protectionContainer.ts index 4bc6fa9730..1119adbfd8 100644 --- a/sdk/nodejs/siterecovery/protectionContainer.ts +++ b/sdk/nodejs/siterecovery/protectionContainer.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a Azure Site Recovery protection container. Protection containers serve as containers for replicated VMs and belong to a single region / recovery fabric. Protection containers can contain more than one replicated VM. To replicate a VM, a container must exist in both the source and target Azure regions. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primary = new azure.core.ResourceGroup("primary", {location: "West US"}); + * const secondary = new azure.core.ResourceGroup("secondary", {location: "East US"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: secondary.location, + * resourceGroupName: secondary.name, + * sku: "Standard", + * }); + * const fabric = new azure.siterecovery.Fabric("fabric", { + * resourceGroupName: secondary.name, + * recoveryVaultName: vault.name, + * location: primary.location, + * }); + * const protection_container = new azure.siterecovery.ProtectionContainer("protection-container", { + * resourceGroupName: secondary.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: fabric.name, + * }); + * ``` + * * ## Import * * Site Recovery Protection Containers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/protectionContainerMapping.ts b/sdk/nodejs/siterecovery/protectionContainerMapping.ts index af327ded22..2f7e3ecd24 100644 --- a/sdk/nodejs/siterecovery/protectionContainerMapping.ts +++ b/sdk/nodejs/siterecovery/protectionContainerMapping.ts @@ -9,6 +9,55 @@ import * as utilities from "../utilities"; /** * Manages a Azure recovery vault protection container mapping. A protection container mapping decides how to translate the protection container when a VM is migrated from one region to another. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primaryResourceGroup = new azure.core.ResourceGroup("primaryResourceGroup", {location: "West US"}); + * const secondaryResourceGroup = new azure.core.ResourceGroup("secondaryResourceGroup", {location: "East US"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: secondaryResourceGroup.location, + * resourceGroupName: secondaryResourceGroup.name, + * sku: "Standard", + * }); + * const primaryFabric = new azure.siterecovery.Fabric("primaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: primaryResourceGroup.location, + * }); + * const secondaryFabric = new azure.siterecovery.Fabric("secondaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: secondaryResourceGroup.location, + * }); + * const primaryProtectionContainer = new azure.siterecovery.ProtectionContainer("primaryProtectionContainer", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: primaryFabric.name, + * }); + * const secondaryProtectionContainer = new azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: secondaryFabric.name, + * }); + * const policy = new azure.siterecovery.ReplicationPolicy("policy", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryPointRetentionInMinutes: 24 * 60, + * applicationConsistentSnapshotFrequencyInMinutes: 4 * 60, + * }); + * const container_mapping = new azure.siterecovery.ProtectionContainerMapping("container-mapping", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: primaryFabric.name, + * recoverySourceProtectionContainerName: primaryProtectionContainer.name, + * recoveryTargetProtectionContainerId: secondaryProtectionContainer.id, + * recoveryReplicationPolicyId: policy.id, + * }); + * ``` + * * ## Import * * Site Recovery Protection Container Mappings can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/replicatedVM.ts b/sdk/nodejs/siterecovery/replicatedVM.ts index cc4a6f5045..a379a8e636 100644 --- a/sdk/nodejs/siterecovery/replicatedVM.ts +++ b/sdk/nodejs/siterecovery/replicatedVM.ts @@ -9,6 +9,166 @@ import * as utilities from "../utilities"; /** * Manages a VM replicated using Azure Site Recovery (Azure to Azure only). A replicated VM keeps a copiously updated image of the VM in another region in order to be able to start the VM in that region in case of a disaster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primaryResourceGroup = new azure.core.ResourceGroup("primaryResourceGroup", {location: "West US"}); + * const secondaryResourceGroup = new azure.core.ResourceGroup("secondaryResourceGroup", {location: "East US"}); + * const primaryVirtualNetwork = new azure.network.VirtualNetwork("primaryVirtualNetwork", { + * resourceGroupName: primaryResourceGroup.name, + * addressSpaces: ["192.168.1.0/24"], + * location: primaryResourceGroup.location, + * }); + * const primarySubnet = new azure.network.Subnet("primarySubnet", { + * resourceGroupName: primaryResourceGroup.name, + * virtualNetworkName: primaryVirtualNetwork.name, + * addressPrefixes: ["192.168.1.0/24"], + * }); + * const primaryPublicIp = new azure.network.PublicIp("primaryPublicIp", { + * allocationMethod: "Static", + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * sku: "Basic", + * }); + * const vmNetworkInterface = new azure.network.NetworkInterface("vmNetworkInterface", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * ipConfigurations: [{ + * name: "vm", + * subnetId: primarySubnet.id, + * privateIpAddressAllocation: "Dynamic", + * publicIpAddressId: primaryPublicIp.id, + * }], + * }); + * const vmVirtualMachine = new azure.compute.VirtualMachine("vmVirtualMachine", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * vmSize: "Standard_B1s", + * networkInterfaceIds: [vmNetworkInterface.id], + * storageImageReference: { + * publisher: "OpenLogic", + * offer: "CentOS", + * sku: "7.5", + * version: "latest", + * }, + * storageOsDisk: { + * name: "vm-os-disk", + * osType: "Linux", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Premium_LRS", + * }, + * osProfile: { + * adminUsername: "test-admin-123", + * adminPassword: "test-pwd-123", + * computerName: "vm", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: false, + * }, + * }); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: secondaryResourceGroup.location, + * resourceGroupName: secondaryResourceGroup.name, + * sku: "Standard", + * }); + * const primaryFabric = new azure.siterecovery.Fabric("primaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: primaryResourceGroup.location, + * }); + * const secondaryFabric = new azure.siterecovery.Fabric("secondaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: secondaryResourceGroup.location, + * }); + * const primaryProtectionContainer = new azure.siterecovery.ProtectionContainer("primaryProtectionContainer", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: primaryFabric.name, + * }); + * const secondaryProtectionContainer = new azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: secondaryFabric.name, + * }); + * const policy = new azure.siterecovery.ReplicationPolicy("policy", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryPointRetentionInMinutes: 24 * 60, + * applicationConsistentSnapshotFrequencyInMinutes: 4 * 60, + * }); + * const container_mapping = new azure.siterecovery.ProtectionContainerMapping("container-mapping", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: primaryFabric.name, + * recoverySourceProtectionContainerName: primaryProtectionContainer.name, + * recoveryTargetProtectionContainerId: secondaryProtectionContainer.id, + * recoveryReplicationPolicyId: policy.id, + * }); + * const secondaryVirtualNetwork = new azure.network.VirtualNetwork("secondaryVirtualNetwork", { + * resourceGroupName: secondaryResourceGroup.name, + * addressSpaces: ["192.168.2.0/24"], + * location: secondaryResourceGroup.location, + * }); + * const network_mapping = new azure.siterecovery.NetworkMapping("network-mapping", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * sourceRecoveryFabricName: primaryFabric.name, + * targetRecoveryFabricName: secondaryFabric.name, + * sourceNetworkId: primaryVirtualNetwork.id, + * targetNetworkId: secondaryVirtualNetwork.id, + * }); + * const primaryAccount = new azure.storage.Account("primaryAccount", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const secondarySubnet = new azure.network.Subnet("secondarySubnet", { + * resourceGroupName: secondaryResourceGroup.name, + * virtualNetworkName: secondaryVirtualNetwork.name, + * addressPrefixes: ["192.168.2.0/24"], + * }); + * const secondaryPublicIp = new azure.network.PublicIp("secondaryPublicIp", { + * allocationMethod: "Static", + * location: secondaryResourceGroup.location, + * resourceGroupName: secondaryResourceGroup.name, + * sku: "Basic", + * }); + * const vm_replication = new azure.siterecovery.ReplicatedVM("vm-replication", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * sourceRecoveryFabricName: primaryFabric.name, + * sourceVmId: vmVirtualMachine.id, + * recoveryReplicationPolicyId: policy.id, + * sourceRecoveryProtectionContainerName: primaryProtectionContainer.name, + * targetResourceGroupId: secondaryResourceGroup.id, + * targetRecoveryFabricId: secondaryFabric.id, + * targetRecoveryProtectionContainerId: secondaryProtectionContainer.id, + * managedDisks: [{ + * diskId: vmVirtualMachine.storageOsDisk.apply(storageOsDisk => storageOsDisk.managedDiskId), + * stagingStorageAccountId: primaryAccount.id, + * targetResourceGroupId: secondaryResourceGroup.id, + * targetDiskType: "Premium_LRS", + * targetReplicaDiskType: "Premium_LRS", + * }], + * networkInterfaces: [{ + * sourceNetworkInterfaceId: vmNetworkInterface.id, + * targetSubnetName: secondarySubnet.name, + * recoveryPublicIpAddressId: secondaryPublicIp.id, + * }], + * }, { + * dependsOn: [ + * container_mapping, + * network_mapping, + * ], + * }); + * ``` + * * ## Import * * Site Recovery Replicated VM's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/replicationPolicy.ts b/sdk/nodejs/siterecovery/replicationPolicy.ts index fcb53ee7a3..bc8addd709 100644 --- a/sdk/nodejs/siterecovery/replicationPolicy.ts +++ b/sdk/nodejs/siterecovery/replicationPolicy.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages a Azure Site Recovery replication policy within a recovery vault. Replication policies define the frequency at which recovery points are created and how long they are stored. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "East US"}); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: example.location, + * resourceGroupName: example.name, + * sku: "Standard", + * }); + * const policy = new azure.siterecovery.ReplicationPolicy("policy", { + * resourceGroupName: example.name, + * recoveryVaultName: vault.name, + * recoveryPointRetentionInMinutes: 24 * 60, + * applicationConsistentSnapshotFrequencyInMinutes: 4 * 60, + * }); + * ``` + * * ## Import * * Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/replicationRecoveryPlan.ts b/sdk/nodejs/siterecovery/replicationRecoveryPlan.ts index 8b328ded9c..00e64d03a9 100644 --- a/sdk/nodejs/siterecovery/replicationRecoveryPlan.ts +++ b/sdk/nodejs/siterecovery/replicationRecoveryPlan.ts @@ -9,6 +9,176 @@ import * as utilities from "../utilities"; /** * Manages a Site Recovery Replication Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const primaryResourceGroup = new azure.core.ResourceGroup("primaryResourceGroup", {location: "West US"}); + * const secondaryResourceGroup = new azure.core.ResourceGroup("secondaryResourceGroup", {location: "East US"}); + * const primaryVirtualNetwork = new azure.network.VirtualNetwork("primaryVirtualNetwork", { + * resourceGroupName: primaryResourceGroup.name, + * addressSpaces: ["192.168.1.0/24"], + * location: primaryResourceGroup.location, + * }); + * const primarySubnet = new azure.network.Subnet("primarySubnet", { + * resourceGroupName: primaryResourceGroup.name, + * virtualNetworkName: primaryVirtualNetwork.name, + * addressPrefixes: ["192.168.1.0/24"], + * }); + * const primaryPublicIp = new azure.network.PublicIp("primaryPublicIp", { + * allocationMethod: "Static", + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * sku: "Basic", + * }); + * const vmNetworkInterface = new azure.network.NetworkInterface("vmNetworkInterface", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * ipConfigurations: [{ + * name: "vm", + * subnetId: primarySubnet.id, + * privateIpAddressAllocation: "Dynamic", + * publicIpAddressId: primaryPublicIp.id, + * }], + * }); + * const vmVirtualMachine = new azure.compute.VirtualMachine("vmVirtualMachine", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * vmSize: "Standard_B1s", + * networkInterfaceIds: [vmNetworkInterface.id], + * storageImageReference: { + * publisher: "OpenLogic", + * offer: "CentOS", + * sku: "7.5", + * version: "latest", + * }, + * storageOsDisk: { + * name: "vm-os-disk", + * osType: "Linux", + * caching: "ReadWrite", + * createOption: "FromImage", + * managedDiskType: "Premium_LRS", + * }, + * osProfile: { + * adminUsername: "test-admin-123", + * adminPassword: "test-pwd-123", + * computerName: "vm", + * }, + * osProfileLinuxConfig: { + * disablePasswordAuthentication: false, + * }, + * }); + * const vault = new azure.recoveryservices.Vault("vault", { + * location: secondaryResourceGroup.location, + * resourceGroupName: secondaryResourceGroup.name, + * sku: "Standard", + * }); + * const primaryFabric = new azure.siterecovery.Fabric("primaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: primaryResourceGroup.location, + * }); + * const secondaryFabric = new azure.siterecovery.Fabric("secondaryFabric", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * location: secondaryResourceGroup.location, + * }); + * const primaryProtectionContainer = new azure.siterecovery.ProtectionContainer("primaryProtectionContainer", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: primaryFabric.name, + * }); + * const secondaryProtectionContainer = new azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: secondaryFabric.name, + * }); + * const policy = new azure.siterecovery.ReplicationPolicy("policy", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryPointRetentionInMinutes: 24 * 60, + * applicationConsistentSnapshotFrequencyInMinutes: 4 * 60, + * }); + * const container_mapping = new azure.siterecovery.ProtectionContainerMapping("container-mapping", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * recoveryFabricName: primaryFabric.name, + * recoverySourceProtectionContainerName: primaryProtectionContainer.name, + * recoveryTargetProtectionContainerId: secondaryProtectionContainer.id, + * recoveryReplicationPolicyId: policy.id, + * }); + * const secondaryVirtualNetwork = new azure.network.VirtualNetwork("secondaryVirtualNetwork", { + * resourceGroupName: secondaryResourceGroup.name, + * addressSpaces: ["192.168.2.0/24"], + * location: secondaryResourceGroup.location, + * }); + * const network_mapping = new azure.siterecovery.NetworkMapping("network-mapping", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * sourceRecoveryFabricName: primaryFabric.name, + * targetRecoveryFabricName: secondaryFabric.name, + * sourceNetworkId: primaryVirtualNetwork.id, + * targetNetworkId: secondaryVirtualNetwork.id, + * }); + * const primaryAccount = new azure.storage.Account("primaryAccount", { + * location: primaryResourceGroup.location, + * resourceGroupName: primaryResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const secondarySubnet = new azure.network.Subnet("secondarySubnet", { + * resourceGroupName: secondaryResourceGroup.name, + * virtualNetworkName: secondaryVirtualNetwork.name, + * addressPrefixes: ["192.168.2.0/24"], + * }); + * const secondaryPublicIp = new azure.network.PublicIp("secondaryPublicIp", { + * allocationMethod: "Static", + * location: secondaryResourceGroup.location, + * resourceGroupName: secondaryResourceGroup.name, + * sku: "Basic", + * }); + * const vm_replication = new azure.siterecovery.ReplicatedVM("vm-replication", { + * resourceGroupName: secondaryResourceGroup.name, + * recoveryVaultName: vault.name, + * sourceRecoveryFabricName: primaryFabric.name, + * sourceVmId: vmVirtualMachine.id, + * recoveryReplicationPolicyId: policy.id, + * sourceRecoveryProtectionContainerName: primaryProtectionContainer.name, + * targetResourceGroupId: secondaryResourceGroup.id, + * targetRecoveryFabricId: secondaryFabric.id, + * targetRecoveryProtectionContainerId: secondaryProtectionContainer.id, + * managedDisks: [{ + * diskId: vmVirtualMachine.storageOsDisk.apply(storageOsDisk => storageOsDisk.managedDiskId), + * stagingStorageAccountId: primaryAccount.id, + * targetResourceGroupId: secondaryResourceGroup.id, + * targetDiskType: "Premium_LRS", + * targetReplicaDiskType: "Premium_LRS", + * }], + * networkInterfaces: [{ + * sourceNetworkInterfaceId: vmNetworkInterface.id, + * targetSubnetName: secondarySubnet.name, + * recoveryPublicIpAddressId: secondaryPublicIp.id, + * }], + * }, { + * dependsOn: [ + * container_mapping, + * network_mapping, + * ], + * }); + * const example = new azure.siterecovery.ReplicationRecoveryPlan("example", { + * recoveryVaultId: vault.id, + * sourceRecoveryFabricId: primaryFabric.id, + * targetRecoveryFabricId: secondaryFabric.id, + * shutdownRecoveryGroup: {}, + * failoverRecoveryGroup: {}, + * bootRecoveryGroups: [{ + * replicatedProtectedItems: [vm_replication.id], + * }], + * }); + * ``` + * * ## Import * * Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/vmwareReplicationPolicy.ts b/sdk/nodejs/siterecovery/vmwareReplicationPolicy.ts index 51ef7ea3ca..96de17734f 100644 --- a/sdk/nodejs/siterecovery/vmwareReplicationPolicy.ts +++ b/sdk/nodejs/siterecovery/vmwareReplicationPolicy.ts @@ -7,6 +7,27 @@ import * as utilities from "../utilities"; /** * Manages a VMWare Replication Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "eastus"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * classicVmwareReplicationEnabled: true, + * softDeleteEnabled: false, + * }); + * const exampleVMWareReplicationPolicy = new azure.siterecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", { + * recoveryVaultId: exampleVault.id, + * recoveryPointRetentionInMinutes: 1440, + * applicationConsistentSnapshotFrequencyInMinutes: 240, + * }); + * ``` + * * ## Import * * VMWare Replication Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/siterecovery/vmwareReplicationPolicyAssociation.ts b/sdk/nodejs/siterecovery/vmwareReplicationPolicyAssociation.ts index 81569fbf21..157dd1fe79 100644 --- a/sdk/nodejs/siterecovery/vmwareReplicationPolicyAssociation.ts +++ b/sdk/nodejs/siterecovery/vmwareReplicationPolicyAssociation.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages an Azure Site Recovery replication policy for VMWare within a Recovery Vault. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleVault = new azure.recoveryservices.Vault("exampleVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleVMWareReplicationPolicy = new azure.siterecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", { + * recoveryVaultId: exampleVault.id, + * recoveryPointRetentionInMinutes: 1440, + * applicationConsistentSnapshotFrequencyInMinutes: 240, + * }); + * const exampleVmwareReplicationPolicyAssociation = new azure.siterecovery.VmwareReplicationPolicyAssociation("exampleVmwareReplicationPolicyAssociation", { + * recoveryVaultId: exampleVault.id, + * policyId: exampleVMWareReplicationPolicy.id, + * }); + * ``` + * * ## Import * * Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/activeDirectoryAdministrator.ts b/sdk/nodejs/sql/activeDirectoryAdministrator.ts index 1cb12fde8e..fea8d2dcda 100644 --- a/sdk/nodejs/sql/activeDirectoryAdministrator.ts +++ b/sdk/nodejs/sql/activeDirectoryAdministrator.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.ActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azureadAdministrator` block of the `azure.mssql.Server` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleActiveDirectoryAdministrator = new azure.sql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", { + * serverName: exampleSqlServer.name, + * resourceGroupName: exampleResourceGroup.name, + * login: "sqladmin", + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * }); + * ``` + * * ## Import * * A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/database.ts b/sdk/nodejs/sql/database.ts index 785d310ece..d888802527 100644 --- a/sdk/nodejs/sql/database.ts +++ b/sdk/nodejs/sql/database.ts @@ -11,6 +11,39 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.Database` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Database` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * tags: { + * environment: "production", + * }, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDatabase = new azure.sql.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serverName: exampleSqlServer.name, + * tags: { + * environment: "production", + * }, + * }); + * ``` + * * ## Import * * SQL Databases can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/elasticPool.ts b/sdk/nodejs/sql/elasticPool.ts index e4bfe2ac1f..ab90ff80f7 100644 --- a/sdk/nodejs/sql/elasticPool.ts +++ b/sdk/nodejs/sql/elasticPool.ts @@ -9,6 +9,34 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.ElasticPool` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ElasticPool` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleElasticPool = new azure.sql.ElasticPool("exampleElasticPool", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serverName: exampleSqlServer.name, + * edition: "Basic", + * dtu: 50, + * dbDtuMin: 0, + * dbDtuMax: 5, + * poolSize: 5000, + * }); + * ``` + * + * > **NOTE on `azure.sql.ElasticPool`:** - The values of `edition`, `dtu`, and `poolSize` must be consistent with the [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). Any inconsistent argument configuration will be rejected. + * * ## Import * * SQL Elastic Pool's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/failoverGroup.ts b/sdk/nodejs/sql/failoverGroup.ts index 62a546657d..1deb94c4b2 100644 --- a/sdk/nodejs/sql/failoverGroup.ts +++ b/sdk/nodejs/sql/failoverGroup.ts @@ -11,6 +11,46 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.FailoverGroup` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.FailoverGroup` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const primary = new azure.sql.SqlServer("primary", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "sqladmin", + * administratorLoginPassword: "pa$$w0rd", + * }); + * const secondary = new azure.sql.SqlServer("secondary", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "sqladmin", + * administratorLoginPassword: "pa$$w0rd", + * }); + * const db1 = new azure.sql.Database("db1", { + * resourceGroupName: primary.resourceGroupName, + * location: primary.location, + * serverName: primary.name, + * }); + * const exampleFailoverGroup = new azure.sql.FailoverGroup("exampleFailoverGroup", { + * resourceGroupName: primary.resourceGroupName, + * serverName: primary.name, + * databases: [db1.id], + * partnerServers: [{ + * id: secondary.id, + * }], + * readWriteEndpointFailoverPolicy: { + * mode: "Automatic", + * graceMinutes: 60, + * }, + * }); + * ``` + * * ## Import * * SQL Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/firewallRule.ts b/sdk/nodejs/sql/firewallRule.ts index 26a009e313..3035133544 100644 --- a/sdk/nodejs/sql/firewallRule.ts +++ b/sdk/nodejs/sql/firewallRule.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.FirewallRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.FirewallRule` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const exampleFirewallRule = new azure.sql.FirewallRule("exampleFirewallRule", { + * resourceGroupName: exampleResourceGroup.name, + * serverName: exampleSqlServer.name, + * startIpAddress: "10.0.17.62", + * endIpAddress: "10.0.17.62", + * }); + * ``` + * * ## Import * * SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/getDatabase.ts b/sdk/nodejs/sql/getDatabase.ts index 7dbab41853..19a2e29ae8 100644 --- a/sdk/nodejs/sql/getDatabase.ts +++ b/sdk/nodejs/sql/getDatabase.ts @@ -8,6 +8,20 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing SQL Azure Database. * * > **Note:** The `azure.sql.Database` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Database` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sql.getDatabase({ + * name: "example_db", + * serverName: "example_db_server", + * resourceGroupName: "example-resources", + * }); + * export const sqlDatabaseId = example.then(example => example.id); + * ``` */ export function getDatabase(args: GetDatabaseArgs, opts?: pulumi.InvokeOptions): Promise { @@ -99,6 +113,20 @@ export interface GetDatabaseResult { * Use this data source to access information about an existing SQL Azure Database. * * > **Note:** The `azure.sql.Database` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Database` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sql.getDatabase({ + * name: "example_db", + * serverName: "example_db_server", + * resourceGroupName: "example-resources", + * }); + * export const sqlDatabaseId = example.then(example => example.id); + * ``` */ export function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getDatabase(a, opts)) diff --git a/sdk/nodejs/sql/getServer.ts b/sdk/nodejs/sql/getServer.ts index 796e4dca98..86bb753611 100644 --- a/sdk/nodejs/sql/getServer.ts +++ b/sdk/nodejs/sql/getServer.ts @@ -10,6 +10,19 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing SQL Azure Database Server. * * > **Note:** The `azure.sql.SqlServer` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Server` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sql.getServer({ + * name: "examplesqlservername", + * resourceGroupName: "example-resources", + * }); + * export const sqlServerId = example.then(example => example.id); + * ``` */ export function getServer(args: GetServerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -73,6 +86,19 @@ export interface GetServerResult { * Use this data source to access information about an existing SQL Azure Database Server. * * > **Note:** The `azure.sql.SqlServer` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.Server` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sql.getServer({ + * name: "examplesqlservername", + * resourceGroupName: "example-resources", + * }); + * export const sqlServerId = example.then(example => example.id); + * ``` */ export function getServerOutput(args: GetServerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getServer(a, opts)) diff --git a/sdk/nodejs/sql/getSqlManagedInstance.ts b/sdk/nodejs/sql/getSqlManagedInstance.ts index d2c79c4c41..3183775419 100644 --- a/sdk/nodejs/sql/getSqlManagedInstance.ts +++ b/sdk/nodejs/sql/getSqlManagedInstance.ts @@ -10,6 +10,19 @@ import * as utilities from "../utilities"; * Use this data source to access information about an existing SQL Managed Instance. * * > **Note:** The `azure.sql.ManagedInstance` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedInstance` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sql.getSqlManagedInstance({ + * name: "example_mi", + * resourceGroupName: "example-resources", + * }); + * export const sqlInstanceId = example.then(example => example.id); + * ``` */ export function getSqlManagedInstance(args: GetSqlManagedInstanceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -122,6 +135,19 @@ export interface GetSqlManagedInstanceResult { * Use this data source to access information about an existing SQL Managed Instance. * * > **Note:** The `azure.sql.ManagedInstance` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedInstance` data source instead. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.sql.getSqlManagedInstance({ + * name: "example_mi", + * resourceGroupName: "example-resources", + * }); + * export const sqlInstanceId = example.then(example => example.id); + * ``` */ export function getSqlManagedInstanceOutput(args: GetSqlManagedInstanceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSqlManagedInstance(a, opts)) diff --git a/sdk/nodejs/sql/managedDatabase.ts b/sdk/nodejs/sql/managedDatabase.ts index 29f0b9cb91..d0234999f4 100644 --- a/sdk/nodejs/sql/managedDatabase.ts +++ b/sdk/nodejs/sql/managedDatabase.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.ManagedDatabase` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedDatabase` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * }); + * const exampleManagedInstance = new azure.sql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLogin: "mradministrator", + * administratorLoginPassword: "thisIsDog11", + * licenseType: "BasePrice", + * subnetId: exampleSubnet.id, + * skuName: "GP_Gen5", + * vcores: 4, + * storageSizeInGb: 32, + * }); + * const exampleManagedDatabase = new azure.sql.ManagedDatabase("exampleManagedDatabase", { + * sqlManagedInstanceId: exampleManagedInstance.id, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/managedInstance.ts b/sdk/nodejs/sql/managedInstance.ts index f284c518a9..7178ca6a11 100644 --- a/sdk/nodejs/sql/managedInstance.ts +++ b/sdk/nodejs/sql/managedInstance.ts @@ -13,6 +13,177 @@ import * as utilities from "../utilities"; * * > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const allowManagementInbound = new azure.network.NetworkSecurityRule("allowManagementInbound", { + * priority: 106, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRanges: [ + * "9000", + * "9003", + * "1438", + * "1440", + * "1452", + * ], + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowMisubnetInbound = new azure.network.NetworkSecurityRule("allowMisubnetInbound", { + * priority: 200, + * direction: "Inbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "10.0.0.0/24", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowHealthProbeInbound = new azure.network.NetworkSecurityRule("allowHealthProbeInbound", { + * priority: 300, + * direction: "Inbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "AzureLoadBalancer", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowTdsInbound = new azure.network.NetworkSecurityRule("allowTdsInbound", { + * priority: 1000, + * direction: "Inbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRange: "1433", + * sourceAddressPrefix: "VirtualNetwork", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const denyAllInbound = new azure.network.NetworkSecurityRule("denyAllInbound", { + * priority: 4096, + * direction: "Inbound", + * access: "Deny", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowManagementOutbound = new azure.network.NetworkSecurityRule("allowManagementOutbound", { + * priority: 102, + * direction: "Outbound", + * access: "Allow", + * protocol: "Tcp", + * sourcePortRange: "*", + * destinationPortRanges: [ + * "80", + * "443", + * "12000", + * ], + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const allowMisubnetOutbound = new azure.network.NetworkSecurityRule("allowMisubnetOutbound", { + * priority: 200, + * direction: "Outbound", + * access: "Allow", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "10.0.0.0/24", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const denyAllOutbound = new azure.network.NetworkSecurityRule("denyAllOutbound", { + * priority: 4096, + * direction: "Outbound", + * access: "Deny", + * protocol: "*", + * sourcePortRange: "*", + * destinationPortRange: "*", + * sourceAddressPrefix: "*", + * destinationAddressPrefix: "*", + * resourceGroupName: exampleResourceGroup.name, + * networkSecurityGroupName: exampleNetworkSecurityGroup.name, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.0.0/24"], + * delegations: [{ + * name: "managedinstancedelegation", + * serviceDelegation: { + * name: "Microsoft.Sql/managedInstances", + * actions: [ + * "Microsoft.Network/virtualNetworks/subnets/join/action", + * "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + * "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + * ], + * }, + * }], + * }); + * const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", { + * subnetId: exampleSubnet.id, + * networkSecurityGroupId: exampleNetworkSecurityGroup.id, + * }); + * const exampleRouteTable = new azure.network.RouteTable("exampleRouteTable", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * disableBgpRoutePropagation: false, + * }, { + * dependsOn: [exampleSubnet], + * }); + * const exampleSubnetRouteTableAssociation = new azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", { + * subnetId: exampleSubnet.id, + * routeTableId: exampleRouteTable.id, + * }); + * const exampleManagedInstance = new azure.sql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLogin: "mradministrator", + * administratorLoginPassword: "thisIsDog11", + * licenseType: "BasePrice", + * subnetId: exampleSubnet.id, + * skuName: "GP_Gen5", + * vcores: 4, + * storageSizeInGb: 32, + * }, { + * dependsOn: [ + * exampleSubnetNetworkSecurityGroupAssociation, + * exampleSubnetRouteTableAssociation, + * ], + * }); + * ``` + * * ## Import * * SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/managedInstanceActiveDirectoryAdministrator.ts b/sdk/nodejs/sql/managedInstanceActiveDirectoryAdministrator.ts index 07082cd9fc..e9af2ea27d 100644 --- a/sdk/nodejs/sql/managedInstanceActiveDirectoryAdministrator.ts +++ b/sdk/nodejs/sql/managedInstanceActiveDirectoryAdministrator.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.ManagedInstanceActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ManagedInstanceActiveDirectoryAdministrator` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleManagedInstance = new azure.sql.ManagedInstance("exampleManagedInstance", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * administratorLogin: "mradministrator", + * administratorLoginPassword: "thisIsDog11", + * licenseType: "BasePrice", + * subnetId: azurerm_subnet.example.id, + * skuName: "GP_Gen5", + * vcores: 4, + * storageSizeInGb: 32, + * }, { + * dependsOn: [ + * azurerm_subnet_network_security_group_association.example, + * azurerm_subnet_route_table_association.example, + * ], + * }); + * const current = azure.core.getClientConfig({}); + * const exampleManagedInstanceActiveDirectoryAdministrator = new azure.sql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", { + * managedInstanceName: exampleManagedInstance.name, + * resourceGroupName: exampleResourceGroup.name, + * login: "sqladmin", + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * }); + * ``` + * * ## Import * * A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/sqlServer.ts b/sdk/nodejs/sql/sqlServer.ts index d81c7adfde..42d3a50d3d 100644 --- a/sdk/nodejs/sql/sqlServer.ts +++ b/sdk/nodejs/sql/sqlServer.ts @@ -9,6 +9,31 @@ import * as utilities from "../utilities"; /** * Manages a Microsoft SQL Azure Database Server. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "mradministrator", + * administratorLoginPassword: "thisIsDog11", + * tags: { + * environment: "production", + * }, + * }); + * ``` + * * ## Import * * SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/sql/virtualNetworkRule.ts b/sdk/nodejs/sql/virtualNetworkRule.ts index 843e708b8c..26ca8b48b7 100644 --- a/sdk/nodejs/sql/virtualNetworkRule.ts +++ b/sdk/nodejs/sql/virtualNetworkRule.ts @@ -9,6 +9,38 @@ import * as utilities from "../utilities"; * * > **Note:** The `azure.sql.VirtualNetworkRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.VirtualNetworkRule` resource instead. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.core.ResourceGroup("example", {location: "West Europe"}); + * const vnet = new azure.network.VirtualNetwork("vnet", { + * addressSpaces: ["10.7.29.0/29"], + * location: example.location, + * resourceGroupName: example.name, + * }); + * const subnet = new azure.network.Subnet("subnet", { + * resourceGroupName: example.name, + * virtualNetworkName: vnet.name, + * addressPrefixes: ["10.7.29.0/29"], + * serviceEndpoints: ["Microsoft.Sql"], + * }); + * const sqlserver = new azure.sql.SqlServer("sqlserver", { + * resourceGroupName: example.name, + * location: example.location, + * version: "12.0", + * administratorLogin: "4dm1n157r470r", + * administratorLoginPassword: "4-v3ry-53cr37-p455w0rd", + * }); + * const sqlvnetrule = new azure.sql.VirtualNetworkRule("sqlvnetrule", { + * resourceGroupName: example.name, + * serverName: sqlserver.name, + * subnetId: subnet.id, + * }); + * ``` + * * ## Import * * SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/stack/hciCluster.ts b/sdk/nodejs/stack/hciCluster.ts index 6668552efc..c444961a8a 100644 --- a/sdk/nodejs/stack/hciCluster.ts +++ b/sdk/nodejs/stack/hciCluster.ts @@ -7,6 +7,26 @@ import * as utilities from "../utilities"; /** * Manages an Azure Stack HCI Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as azuread from "@pulumi/azuread"; + * + * const exampleApplication = azuread.getApplication({ + * displayName: "Allowed resource types", + * }); + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleHciCluster = new azure.stack.HciCluster("exampleHciCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * clientId: exampleApplication.then(exampleApplication => exampleApplication.applicationId), + * tenantId: current.then(current => current.tenantId), + * }); + * ``` + * * ## Import * * Azure Stack HCI Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/account.ts b/sdk/nodejs/storage/account.ts index 181d60cc55..47c0f38b2c 100644 --- a/sdk/nodejs/storage/account.ts +++ b/sdk/nodejs/storage/account.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; /** * Manages an Azure Storage Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * tags: { + * environment: "staging", + * }, + * }); + * ``` + * ### With Network Rules + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * serviceEndpoints: [ + * "Microsoft.Sql", + * "Microsoft.Storage", + * ], + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * networkRules: { + * defaultAction: "Deny", + * ipRules: ["100.0.0.1"], + * virtualNetworkSubnetIds: [exampleSubnet.id], + * }, + * tags: { + * environment: "staging", + * }, + * }); + * ``` + * * ## Import * * Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/accountNetworkRules.ts b/sdk/nodejs/storage/accountNetworkRules.ts index f269b31e43..eba5de8672 100644 --- a/sdk/nodejs/storage/accountNetworkRules.ts +++ b/sdk/nodejs/storage/accountNetworkRules.ts @@ -15,6 +15,42 @@ import * as utilities from "../utilities"; * * > **NOTE:** Deleting this resource updates the storage account back to the default values it had when the storage account was created. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * addressSpaces: ["10.0.0.0/16"], + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.0.2.0/24"], + * serviceEndpoints: ["Microsoft.Storage"], + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleAccountNetworkRules = new azure.storage.AccountNetworkRules("exampleAccountNetworkRules", { + * storageAccountId: exampleAccount.id, + * defaultAction: "Allow", + * ipRules: ["127.0.0.1"], + * virtualNetworkSubnetIds: [exampleSubnet.id], + * bypasses: ["Metrics"], + * }); + * ``` + * * ## Import * * Storage Account Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/blob.ts b/sdk/nodejs/storage/blob.ts index 99e2e1d626..2715b2aded 100644 --- a/sdk/nodejs/storage/blob.ts +++ b/sdk/nodejs/storage/blob.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages a Blob within a Storage Container. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleBlob = new azure.storage.Blob("exampleBlob", { + * storageAccountName: exampleAccount.name, + * storageContainerName: exampleContainer.name, + * type: "Block", + * source: new pulumi.asset.FileAsset("some-local-file.zip"), + * }); + * ``` + * * ## Import * * Storage Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/blobInventoryPolicy.ts b/sdk/nodejs/storage/blobInventoryPolicy.ts index 8e94071d45..f4ad77b55f 100644 --- a/sdk/nodejs/storage/blobInventoryPolicy.ts +++ b/sdk/nodejs/storage/blobInventoryPolicy.ts @@ -9,6 +9,42 @@ import * as utilities from "../utilities"; /** * Manages a Storage Blob Inventory Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * blobProperties: { + * versioningEnabled: true, + * }, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleBlobInventoryPolicy = new azure.storage.BlobInventoryPolicy("exampleBlobInventoryPolicy", { + * storageAccountId: exampleAccount.id, + * rules: [{ + * name: "rule1", + * storageContainerName: exampleContainer.name, + * format: "Csv", + * schedule: "Daily", + * scope: "Container", + * schemaFields: [ + * "Name", + * "Last-Modified", + * ], + * }], + * }); + * ``` + * * ## Import * * Storage Blob Inventory Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/container.ts b/sdk/nodejs/storage/container.ts index 5eb77689f7..697a4718c9 100644 --- a/sdk/nodejs/storage/container.ts +++ b/sdk/nodejs/storage/container.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages a Container within an Azure Storage Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * ``` + * * ## Import * * Storage Containers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/customerManagedKey.ts b/sdk/nodejs/storage/customerManagedKey.ts index 3337f4e853..78b0a47e09 100644 --- a/sdk/nodejs/storage/customerManagedKey.ts +++ b/sdk/nodejs/storage/customerManagedKey.ts @@ -9,6 +9,89 @@ import * as utilities from "../utilities"; * * > **NOTE:** It's possible to define a Customer Managed Key both within the `azure.storage.Account` resource via the `customerManagedKey` block and by using the `azure.storage.CustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Storage Account, since there'll be conflicts. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const storage = new azure.keyvault.AccessPolicy("storage", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: exampleAccount.identity.apply(identity => identity?.principalId), + * secretPermissions: ["Get"], + * keyPermissions: [ + * "Get", + * "UnwrapKey", + * "WrapKey", + * ], + * }); + * const client = new azure.keyvault.AccessPolicy("client", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * secretPermissions: ["Get"], + * keyPermissions: [ + * "Get", + * "Create", + * "Delete", + * "List", + * "Restore", + * "Recover", + * "UnwrapKey", + * "WrapKey", + * "Purge", + * "Encrypt", + * "Decrypt", + * "Sign", + * "Verify", + * "GetRotationPolicy", + * "SetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "decrypt", + * "encrypt", + * "sign", + * "unwrapKey", + * "verify", + * "wrapKey", + * ], + * }, { + * dependsOn: [ + * client, + * storage, + * ], + * }); + * const exampleCustomerManagedKey = new azure.storage.CustomerManagedKey("exampleCustomerManagedKey", { + * storageAccountId: exampleAccount.id, + * keyVaultId: exampleKeyVault.id, + * keyName: exampleKey.name, + * }); + * ``` + * * ## Import * * Customer Managed Keys for a Storage Account can be imported using the `resource id` of the Storage Account, e.g. diff --git a/sdk/nodejs/storage/dataLakeGen2Filesystem.ts b/sdk/nodejs/storage/dataLakeGen2Filesystem.ts index 2f09a8080b..5a9b7caa1c 100644 --- a/sdk/nodejs/storage/dataLakeGen2Filesystem.ts +++ b/sdk/nodejs/storage/dataLakeGen2Filesystem.ts @@ -11,6 +11,29 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", { + * storageAccountId: exampleAccount.id, + * properties: { + * hello: "aGVsbG8=", + * }, + * }); + * ``` + * * ## Import * * Data Lake Gen2 File System's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/dataLakeGen2Path.ts b/sdk/nodejs/storage/dataLakeGen2Path.ts index 6c622ede8a..9b974f78f7 100644 --- a/sdk/nodejs/storage/dataLakeGen2Path.ts +++ b/sdk/nodejs/storage/dataLakeGen2Path.ts @@ -11,6 +11,30 @@ import * as utilities from "../utilities"; * * > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleDataLakeGen2Path = new azure.storage.DataLakeGen2Path("exampleDataLakeGen2Path", { + * path: "example", + * filesystemName: exampleDataLakeGen2Filesystem.name, + * storageAccountId: exampleAccount.id, + * resource: "directory", + * }); + * ``` + * * ## Import * * Data Lake Gen2 Paths can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/encryptionScope.ts b/sdk/nodejs/storage/encryptionScope.ts index d3ac3752c4..35fb4dfb56 100644 --- a/sdk/nodejs/storage/encryptionScope.ts +++ b/sdk/nodejs/storage/encryptionScope.ts @@ -9,6 +9,28 @@ import * as utilities from "../utilities"; * * > **Note:** Storage Encryption Scopes are in Preview [more information can be found here](https://docs.microsoft.com/azure/storage/blobs/encryption-scope-manage). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleEncryptionScope = new azure.storage.EncryptionScope("exampleEncryptionScope", { + * storageAccountId: exampleAccount.id, + * source: "Microsoft.Storage", + * }); + * ``` + * * ## Import * * Storage Encryption Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/getAccount.ts b/sdk/nodejs/storage/getAccount.ts index aeedb66b9b..cb1b3fa380 100644 --- a/sdk/nodejs/storage/getAccount.ts +++ b/sdk/nodejs/storage/getAccount.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getAccount({ + * name: "packerimages", + * resourceGroupName: "packer-storage", + * }); + * export const storageAccountTier = example.then(example => example.accountTier); + * ``` */ export function getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise { @@ -251,6 +264,19 @@ export interface GetAccountResult { } /** * Use this data source to access information about an existing Storage Account. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getAccount({ + * name: "packerimages", + * resourceGroupName: "packer-storage", + * }); + * export const storageAccountTier = example.then(example => example.accountTier); + * ``` */ export function getAccountOutput(args: GetAccountOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccount(a, opts)) diff --git a/sdk/nodejs/storage/getAccountBlobContainerSAS.ts b/sdk/nodejs/storage/getAccountBlobContainerSAS.ts index ad5d1500f4..7bc9fac1e5 100644 --- a/sdk/nodejs/storage/getAccountBlobContainerSAS.ts +++ b/sdk/nodejs/storage/getAccountBlobContainerSAS.ts @@ -10,6 +10,47 @@ import * as utilities from "../utilities"; * Use this data source to obtain a Shared Access Signature (SAS Token) for an existing Storage Account Blob Container. * * Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const rg = new azure.core.ResourceGroup("rg", {location: "West Europe"}); + * const storage = new azure.storage.Account("storage", { + * resourceGroupName: rg.name, + * location: rg.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const container = new azure.storage.Container("container", { + * storageAccountName: storage.name, + * containerAccessType: "private", + * }); + * const example = azure.storage.getAccountBlobContainerSASOutput({ + * connectionString: storage.primaryConnectionString, + * containerName: container.name, + * httpsOnly: true, + * ipAddress: "168.1.5.65", + * start: "2018-03-21", + * expiry: "2018-03-21", + * permissions: { + * read: true, + * add: true, + * create: false, + * write: false, + * "delete": true, + * list: true, + * }, + * cacheControl: "max-age=5", + * contentDisposition: "inline", + * contentEncoding: "deflate", + * contentLanguage: "en-US", + * contentType: "application/json", + * }); + * export const sasUrlQueryString = example.apply(example => example.sas); + * ``` */ export function getAccountBlobContainerSAS(args: GetAccountBlobContainerSASArgs, opts?: pulumi.InvokeOptions): Promise { @@ -115,6 +156,47 @@ export interface GetAccountBlobContainerSASResult { * Use this data source to obtain a Shared Access Signature (SAS Token) for an existing Storage Account Blob Container. * * Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const rg = new azure.core.ResourceGroup("rg", {location: "West Europe"}); + * const storage = new azure.storage.Account("storage", { + * resourceGroupName: rg.name, + * location: rg.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const container = new azure.storage.Container("container", { + * storageAccountName: storage.name, + * containerAccessType: "private", + * }); + * const example = azure.storage.getAccountBlobContainerSASOutput({ + * connectionString: storage.primaryConnectionString, + * containerName: container.name, + * httpsOnly: true, + * ipAddress: "168.1.5.65", + * start: "2018-03-21", + * expiry: "2018-03-21", + * permissions: { + * read: true, + * add: true, + * create: false, + * write: false, + * "delete": true, + * list: true, + * }, + * cacheControl: "max-age=5", + * contentDisposition: "inline", + * contentEncoding: "deflate", + * contentLanguage: "en-US", + * contentType: "application/json", + * }); + * export const sasUrlQueryString = example.apply(example => example.sas); + * ``` */ export function getAccountBlobContainerSASOutput(args: GetAccountBlobContainerSASOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccountBlobContainerSAS(a, opts)) diff --git a/sdk/nodejs/storage/getAccountSAS.ts b/sdk/nodejs/storage/getAccountSAS.ts index a99c71f002..ec2d5da033 100644 --- a/sdk/nodejs/storage/getAccountSAS.ts +++ b/sdk/nodejs/storage/getAccountSAS.ts @@ -13,6 +13,55 @@ import * as utilities from "../utilities"; * * Note that this is an [Account SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas) * and *not* a [Service SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-a-service-sas). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleAccountSAS = azure.storage.getAccountSASOutput({ + * connectionString: exampleAccount.primaryConnectionString, + * httpsOnly: true, + * signedVersion: "2017-07-29", + * resourceTypes: { + * service: true, + * container: false, + * object: false, + * }, + * services: { + * blob: true, + * queue: false, + * table: false, + * file: false, + * }, + * start: "2018-03-21T00:00:00Z", + * expiry: "2020-03-21T00:00:00Z", + * permissions: { + * read: true, + * write: true, + * "delete": false, + * list: false, + * add: true, + * create: true, + * update: false, + * process: false, + * tag: false, + * filter: false, + * }, + * }); + * export const sasUrlQueryString = exampleAccountSAS.apply(exampleAccountSAS => exampleAccountSAS.sas); + * ``` */ export function getAccountSAS(args: GetAccountSASArgs, opts?: pulumi.InvokeOptions): Promise { @@ -103,6 +152,55 @@ export interface GetAccountSASResult { * * Note that this is an [Account SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas) * and *not* a [Service SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-a-service-sas). + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * tags: { + * environment: "staging", + * }, + * }); + * const exampleAccountSAS = azure.storage.getAccountSASOutput({ + * connectionString: exampleAccount.primaryConnectionString, + * httpsOnly: true, + * signedVersion: "2017-07-29", + * resourceTypes: { + * service: true, + * container: false, + * object: false, + * }, + * services: { + * blob: true, + * queue: false, + * table: false, + * file: false, + * }, + * start: "2018-03-21T00:00:00Z", + * expiry: "2020-03-21T00:00:00Z", + * permissions: { + * read: true, + * write: true, + * "delete": false, + * list: false, + * add: true, + * create: true, + * update: false, + * process: false, + * tag: false, + * filter: false, + * }, + * }); + * export const sasUrlQueryString = exampleAccountSAS.apply(exampleAccountSAS => exampleAccountSAS.sas); + * ``` */ export function getAccountSASOutput(args: GetAccountSASOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getAccountSAS(a, opts)) diff --git a/sdk/nodejs/storage/getBlob.ts b/sdk/nodejs/storage/getBlob.ts index 773a1fa043..c5bcb52295 100644 --- a/sdk/nodejs/storage/getBlob.ts +++ b/sdk/nodejs/storage/getBlob.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Blob. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getBlob({ + * name: "example-blob-name", + * storageAccountName: "example-storage-account-name", + * storageContainerName: "example-storage-container-name", + * }); + * ``` */ export function getBlob(args: GetBlobArgs, opts?: pulumi.InvokeOptions): Promise { @@ -78,6 +91,19 @@ export interface GetBlobResult { } /** * Use this data source to access information about an existing Storage Blob. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getBlob({ + * name: "example-blob-name", + * storageAccountName: "example-storage-account-name", + * storageContainerName: "example-storage-container-name", + * }); + * ``` */ export function getBlobOutput(args: GetBlobOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getBlob(a, opts)) diff --git a/sdk/nodejs/storage/getEncryptionScope.ts b/sdk/nodejs/storage/getEncryptionScope.ts index 3efc111d26..0fe05eb81b 100644 --- a/sdk/nodejs/storage/getEncryptionScope.ts +++ b/sdk/nodejs/storage/getEncryptionScope.ts @@ -6,6 +6,23 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Encryption Scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.storage.getAccount({ + * name: "storageaccountname", + * resourceGroupName: "resourcegroupname", + * }); + * const exampleEncryptionScope = exampleAccount.then(exampleAccount => azure.storage.getEncryptionScope({ + * name: "existingStorageES", + * storageAccountId: exampleAccount.id, + * })); + * export const id = exampleEncryptionScope.then(exampleEncryptionScope => exampleEncryptionScope.id); + * ``` */ export function getEncryptionScope(args: GetEncryptionScopeArgs, opts?: pulumi.InvokeOptions): Promise { @@ -51,6 +68,23 @@ export interface GetEncryptionScopeResult { } /** * Use this data source to access information about an existing Storage Encryption Scope. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.storage.getAccount({ + * name: "storageaccountname", + * resourceGroupName: "resourcegroupname", + * }); + * const exampleEncryptionScope = exampleAccount.then(exampleAccount => azure.storage.getEncryptionScope({ + * name: "existingStorageES", + * storageAccountId: exampleAccount.id, + * })); + * export const id = exampleEncryptionScope.then(exampleEncryptionScope => exampleEncryptionScope.id); + * ``` */ export function getEncryptionScopeOutput(args: GetEncryptionScopeOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getEncryptionScope(a, opts)) diff --git a/sdk/nodejs/storage/getPolicy.ts b/sdk/nodejs/storage/getPolicy.ts index 5122d2904b..403d67a229 100644 --- a/sdk/nodejs/storage/getPolicy.ts +++ b/sdk/nodejs/storage/getPolicy.ts @@ -8,6 +8,21 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Management Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.storage.getAccount({ + * name: "storageaccountname", + * resourceGroupName: "resourcegroupname", + * }); + * const examplePolicy = exampleAccount.then(exampleAccount => azure.storage.getPolicy({ + * storageAccountId: exampleAccount.id, + * })); + * ``` */ export function getPolicy(args: GetPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +58,21 @@ export interface GetPolicyResult { } /** * Use this data source to access information about an existing Storage Management Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleAccount = azure.storage.getAccount({ + * name: "storageaccountname", + * resourceGroupName: "resourcegroupname", + * }); + * const examplePolicy = exampleAccount.then(exampleAccount => azure.storage.getPolicy({ + * storageAccountId: exampleAccount.id, + * })); + * ``` */ export function getPolicyOutput(args: GetPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPolicy(a, opts)) diff --git a/sdk/nodejs/storage/getShare.ts b/sdk/nodejs/storage/getShare.ts index a5667c012e..8dcd2dbaf4 100644 --- a/sdk/nodejs/storage/getShare.ts +++ b/sdk/nodejs/storage/getShare.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing File Share. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getShare({ + * name: "existing", + * storageAccountName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getShare(args: GetShareArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +81,19 @@ export interface GetShareResult { } /** * Use this data source to access information about an existing File Share. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getShare({ + * name: "existing", + * storageAccountName: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getShareOutput(args: GetShareOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getShare(a, opts)) diff --git a/sdk/nodejs/storage/getStorageContainer.ts b/sdk/nodejs/storage/getStorageContainer.ts index ceec5bc7c4..dd1fb90760 100644 --- a/sdk/nodejs/storage/getStorageContainer.ts +++ b/sdk/nodejs/storage/getStorageContainer.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Container. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getStorageContainer({ + * name: "example-container-name", + * storageAccountName: "example-storage-account-name", + * }); + * ``` */ export function getStorageContainer(args: GetStorageContainerArgs, opts?: pulumi.InvokeOptions): Promise { @@ -68,6 +80,18 @@ export interface GetStorageContainerResult { } /** * Use this data source to access information about an existing Storage Container. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getStorageContainer({ + * name: "example-container-name", + * storageAccountName: "example-storage-account-name", + * }); + * ``` */ export function getStorageContainerOutput(args: GetStorageContainerOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getStorageContainer(a, opts)) diff --git a/sdk/nodejs/storage/getSync.ts b/sdk/nodejs/storage/getSync.ts index 68f66318fe..b9fffc8edb 100644 --- a/sdk/nodejs/storage/getSync.ts +++ b/sdk/nodejs/storage/getSync.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Sync. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getSync({ + * name: "existingStorageSyncName", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getSync(args: GetSyncArgs, opts?: pulumi.InvokeOptions): Promise { @@ -55,6 +68,19 @@ export interface GetSyncResult { } /** * Use this data source to access information about an existing Storage Sync. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getSync({ + * name: "existingStorageSyncName", + * resourceGroupName: "existingResGroup", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getSyncOutput(args: GetSyncOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSync(a, opts)) diff --git a/sdk/nodejs/storage/getSyncGroup.ts b/sdk/nodejs/storage/getSyncGroup.ts index 5ca4d11499..326ce86d16 100644 --- a/sdk/nodejs/storage/getSyncGroup.ts +++ b/sdk/nodejs/storage/getSyncGroup.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Sync Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getSyncGroup({ + * name: "existing-ss-group", + * storageSyncId: "existing-ss-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getSyncGroup(args: GetSyncGroupArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +56,19 @@ export interface GetSyncGroupResult { } /** * Use this data source to access information about an existing Storage Sync Group. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getSyncGroup({ + * name: "existing-ss-group", + * storageSyncId: "existing-ss-id", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getSyncGroupOutput(args: GetSyncGroupOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getSyncGroup(a, opts)) diff --git a/sdk/nodejs/storage/getTableEntity.ts b/sdk/nodejs/storage/getTableEntity.ts index 1e023db8a5..b631271db5 100644 --- a/sdk/nodejs/storage/getTableEntity.ts +++ b/sdk/nodejs/storage/getTableEntity.ts @@ -6,6 +6,20 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Storage Table Entity. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getTableEntity({ + * partitionKey: "example-partition-key", + * rowKey: "example-row-key", + * storageAccountName: "example-storage-account-name", + * tableName: "example-table-name", + * }); + * ``` */ export function getTableEntity(args: GetTableEntityArgs, opts?: pulumi.InvokeOptions): Promise { @@ -59,6 +73,20 @@ export interface GetTableEntityResult { } /** * Use this data source to access information about an existing Storage Table Entity. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.storage.getTableEntity({ + * partitionKey: "example-partition-key", + * rowKey: "example-row-key", + * storageAccountName: "example-storage-account-name", + * tableName: "example-table-name", + * }); + * ``` */ export function getTableEntityOutput(args: GetTableEntityOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getTableEntity(a, opts)) diff --git a/sdk/nodejs/storage/localUser.ts b/sdk/nodejs/storage/localUser.ts index 332c489b27..8a69c881ec 100644 --- a/sdk/nodejs/storage/localUser.ts +++ b/sdk/nodejs/storage/localUser.ts @@ -9,6 +9,48 @@ import * as utilities from "../utilities"; /** * Manages a Storage Account Local User. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "WestEurope"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "StorageV2", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * isHnsEnabled: true, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name}); + * const exampleLocalUser = new azure.storage.LocalUser("exampleLocalUser", { + * storageAccountId: exampleAccount.id, + * sshKeyEnabled: true, + * sshPasswordEnabled: true, + * homeDirectory: "example_path", + * sshAuthorizedKeys: [ + * { + * description: "key1", + * key: local.first_public_key, + * }, + * { + * description: "key2", + * key: local.second_public_key, + * }, + * ], + * permissionScopes: [{ + * permissions: { + * read: true, + * create: true, + * }, + * service: "blob", + * resourceName: exampleContainer.name, + * }], + * }); + * ``` + * * ## Import * * Storage Account Local Users can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/managementPolicy.ts b/sdk/nodejs/storage/managementPolicy.ts index 2d02d3c5eb..a9005ebac2 100644 --- a/sdk/nodejs/storage/managementPolicy.ts +++ b/sdk/nodejs/storage/managementPolicy.ts @@ -9,6 +9,78 @@ import * as utilities from "../utilities"; /** * Manages an Azure Storage Account Management Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "BlobStorage", + * }); + * const exampleManagementPolicy = new azure.storage.ManagementPolicy("exampleManagementPolicy", { + * storageAccountId: exampleAccount.id, + * rules: [ + * { + * name: "rule1", + * enabled: true, + * filters: { + * prefixMatches: ["container1/prefix1"], + * blobTypes: ["blockBlob"], + * matchBlobIndexTags: [{ + * name: "tag1", + * operation: "==", + * value: "val1", + * }], + * }, + * actions: { + * baseBlob: { + * tierToCoolAfterDaysSinceModificationGreaterThan: 10, + * tierToArchiveAfterDaysSinceModificationGreaterThan: 50, + * deleteAfterDaysSinceModificationGreaterThan: 100, + * }, + * snapshot: { + * deleteAfterDaysSinceCreationGreaterThan: 30, + * }, + * }, + * }, + * { + * name: "rule2", + * enabled: false, + * filters: { + * prefixMatches: [ + * "container2/prefix1", + * "container2/prefix2", + * ], + * blobTypes: ["blockBlob"], + * }, + * actions: { + * baseBlob: { + * tierToCoolAfterDaysSinceModificationGreaterThan: 11, + * tierToArchiveAfterDaysSinceModificationGreaterThan: 51, + * deleteAfterDaysSinceModificationGreaterThan: 101, + * }, + * snapshot: { + * changeTierToArchiveAfterDaysSinceCreation: 90, + * changeTierToCoolAfterDaysSinceCreation: 23, + * deleteAfterDaysSinceCreationGreaterThan: 31, + * }, + * version: { + * changeTierToArchiveAfterDaysSinceCreation: 9, + * changeTierToCoolAfterDaysSinceCreation: 90, + * deleteAfterDaysSinceCreation: 3, + * }, + * }, + * }, + * ], + * }); + * ``` + * * ## Import * * Storage Account Management Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/mover.ts b/sdk/nodejs/storage/mover.ts index 922692c990..58db209b0d 100644 --- a/sdk/nodejs/storage/mover.ts +++ b/sdk/nodejs/storage/mover.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Storage Mover. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleMover = new azure.storage.Mover("exampleMover", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * description: "Example Storage Mover Description", + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Storage Mover can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/moverAgent.ts b/sdk/nodejs/storage/moverAgent.ts index 2dfdfd274f..52ef0f144e 100644 --- a/sdk/nodejs/storage/moverAgent.ts +++ b/sdk/nodejs/storage/moverAgent.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Storage Mover Agent. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"}); + * const exampleMover = new azure.storage.Mover("exampleMover", {resourceGroupName: exampleResourceGroup.name}); + * const exampleMoverAgent = new azure.storage.MoverAgent("exampleMoverAgent", { + * storageMoverId: exampleMover.id, + * arcVirtualMachineId: pulumi.interpolate`${exampleResourceGroup.id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName`, + * arcVirtualMachineUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", + * description: "Example Agent Description", + * }); + * ``` + * * ## Import * * Storage Mover Agent can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/moverJobDefinition.ts b/sdk/nodejs/storage/moverJobDefinition.ts index a7b701aec1..4a7e81aae4 100644 --- a/sdk/nodejs/storage/moverJobDefinition.ts +++ b/sdk/nodejs/storage/moverJobDefinition.ts @@ -7,6 +7,55 @@ import * as utilities from "../utilities"; /** * Manages a Storage Mover Job Definition. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleMover = new azure.storage.Mover("exampleMover", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleMoverAgent = new azure.storage.MoverAgent("exampleMoverAgent", { + * storageMoverId: exampleMover.id, + * arcVirtualMachineId: pulumi.interpolate`${exampleResourceGroup.id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName`, + * arcVirtualMachineUuid: "3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * allowNestedItemsToBePublic: true, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "blob", + * }); + * const exampleMoverTargetEndpoint = new azure.storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", { + * storageMoverId: exampleMover.id, + * storageAccountId: exampleAccount.id, + * storageContainerName: exampleContainer.name, + * }); + * const exampleMoverSourceEndpoint = new azure.storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", { + * storageMoverId: exampleMover.id, + * host: "192.168.0.1", + * }); + * const exampleMoverProject = new azure.storage.MoverProject("exampleMoverProject", {storageMoverId: exampleMover.id}); + * const exampleMoverJobDefinition = new azure.storage.MoverJobDefinition("exampleMoverJobDefinition", { + * storageMoverProjectId: exampleMoverProject.id, + * agentName: exampleMoverAgent.name, + * copyMode: "Additive", + * sourceName: exampleMoverSourceEndpoint.name, + * sourceSubPath: "/", + * targetName: exampleMoverTargetEndpoint.name, + * targetSubPath: "/", + * description: "Example Job Definition Description", + * }); + * ``` + * * ## Import * * Storage Mover Job Definition can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/moverProject.ts b/sdk/nodejs/storage/moverProject.ts index 6c756309a8..04bfd13306 100644 --- a/sdk/nodejs/storage/moverProject.ts +++ b/sdk/nodejs/storage/moverProject.ts @@ -7,6 +7,23 @@ import * as utilities from "../utilities"; /** * Manages a Storage Mover Project. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleMover = new azure.storage.Mover("exampleMover", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleMoverProject = new azure.storage.MoverProject("exampleMoverProject", { + * storageMoverId: exampleMover.id, + * description: "Example Project Description", + * }); + * ``` + * * ## Import * * Storage Mover Project can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/moverSourceEndpoint.ts b/sdk/nodejs/storage/moverSourceEndpoint.ts index de5d7f87b4..4f9aa5f957 100644 --- a/sdk/nodejs/storage/moverSourceEndpoint.ts +++ b/sdk/nodejs/storage/moverSourceEndpoint.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Storage Mover Source Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleMover = new azure.storage.Mover("exampleMover", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * }); + * const exampleMoverSourceEndpoint = new azure.storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", { + * storageMoverId: exampleMover.id, + * "export": "/", + * host: "192.168.0.1", + * nfsVersion: "NFSv3", + * }); + * ``` + * * ## Import * * Storage Mover Source Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/moverTargetEndpoint.ts b/sdk/nodejs/storage/moverTargetEndpoint.ts index 65ee03d203..902d70e85f 100644 --- a/sdk/nodejs/storage/moverTargetEndpoint.ts +++ b/sdk/nodejs/storage/moverTargetEndpoint.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a Storage Mover Target Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * allowNestedItemsToBePublic: true, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "blob", + * }); + * const exampleMover = new azure.storage.Mover("exampleMover", { + * resourceGroupName: exampleResourceGroup.name, + * location: "West Europe", + * }); + * const exampleMoverTargetEndpoint = new azure.storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", { + * storageMoverId: exampleMover.id, + * storageAccountId: exampleAccount.id, + * storageContainerName: exampleContainer.name, + * description: "Example Storage Container Endpoint Description", + * }); + * ``` + * * ## Import * * Storage Mover Target Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/objectReplication.ts b/sdk/nodejs/storage/objectReplication.ts index b37a992540..f360a891a4 100644 --- a/sdk/nodejs/storage/objectReplication.ts +++ b/sdk/nodejs/storage/objectReplication.ts @@ -9,6 +9,52 @@ import * as utilities from "../utilities"; /** * Manages a Storage Object Replication. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const srcResourceGroup = new azure.core.ResourceGroup("srcResourceGroup", {location: "West Europe"}); + * const srcAccount = new azure.storage.Account("srcAccount", { + * resourceGroupName: srcResourceGroup.name, + * location: srcResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * blobProperties: { + * versioningEnabled: true, + * changeFeedEnabled: true, + * }, + * }); + * const srcContainer = new azure.storage.Container("srcContainer", { + * storageAccountName: srcAccount.name, + * containerAccessType: "private", + * }); + * const dstResourceGroup = new azure.core.ResourceGroup("dstResourceGroup", {location: "East US"}); + * const dstAccount = new azure.storage.Account("dstAccount", { + * resourceGroupName: dstResourceGroup.name, + * location: dstResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * blobProperties: { + * versioningEnabled: true, + * changeFeedEnabled: true, + * }, + * }); + * const dstContainer = new azure.storage.Container("dstContainer", { + * storageAccountName: dstAccount.name, + * containerAccessType: "private", + * }); + * const example = new azure.storage.ObjectReplication("example", { + * sourceStorageAccountId: srcAccount.id, + * destinationStorageAccountId: dstAccount.id, + * rules: [{ + * sourceContainerName: srcContainer.name, + * destinationContainerName: dstContainer.name, + * }], + * }); + * ``` + * * ## Import * * Storage Object Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/queue.ts b/sdk/nodejs/storage/queue.ts index 36699441d4..cc5ea81f1d 100644 --- a/sdk/nodejs/storage/queue.ts +++ b/sdk/nodejs/storage/queue.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Queue within an Azure Storage Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleQueue = new azure.storage.Queue("exampleQueue", {storageAccountName: exampleAccount.name}); + * ``` + * * ## Import * * Storage Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/share.ts b/sdk/nodejs/storage/share.ts index 4852e2d8ed..d990903b3a 100644 --- a/sdk/nodejs/storage/share.ts +++ b/sdk/nodejs/storage/share.ts @@ -11,6 +11,33 @@ import * as utilities from "../utilities"; * * > **Note:** The storage share supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts. For further information, refer to the section "What storage tiers are supported in Azure Files?" of [documentation](https://docs.microsoft.com/azure/storage/files/storage-files-faq#general). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleShare = new azure.storage.Share("exampleShare", { + * storageAccountName: exampleAccount.name, + * quota: 50, + * acls: [{ + * id: "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI", + * accessPolicies: [{ + * permissions: "rwdl", + * start: "2019-07-02T09:38:21.0000000Z", + * expiry: "2019-07-02T10:38:21.0000000Z", + * }], + * }], + * }); + * ``` + * * ## Import * * Storage Shares can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/shareDirectory.ts b/sdk/nodejs/storage/shareDirectory.ts index 0dabe2e8ee..c31ef4bba5 100644 --- a/sdk/nodejs/storage/shareDirectory.ts +++ b/sdk/nodejs/storage/shareDirectory.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a Directory within an Azure Storage File Share. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleShare = new azure.storage.Share("exampleShare", { + * storageAccountName: exampleAccount.name, + * quota: 50, + * }); + * const exampleShareDirectory = new azure.storage.ShareDirectory("exampleShareDirectory", { + * shareName: exampleShare.name, + * storageAccountName: exampleAccount.name, + * }); + * ``` + * * ## Import * * Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/shareFile.ts b/sdk/nodejs/storage/shareFile.ts index 4e627aedc8..f20f822ee0 100644 --- a/sdk/nodejs/storage/shareFile.ts +++ b/sdk/nodejs/storage/shareFile.ts @@ -7,6 +7,29 @@ import * as utilities from "../utilities"; /** * Manages a File within an Azure Storage File Share. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleShare = new azure.storage.Share("exampleShare", { + * storageAccountName: exampleAccount.name, + * quota: 50, + * }); + * const exampleShareFile = new azure.storage.ShareFile("exampleShareFile", { + * storageShareId: exampleShare.id, + * source: "some-local-file.zip", + * }); + * ``` + * * ## Import * * Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/sync.ts b/sdk/nodejs/storage/sync.ts index c2a4be3ad7..2062c44c78 100644 --- a/sdk/nodejs/storage/sync.ts +++ b/sdk/nodejs/storage/sync.ts @@ -7,6 +7,22 @@ import * as utilities from "../utilities"; /** * Manages a Storage Sync. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSync = new azure.storage.Sync("exampleSync", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * tags: { + * foo: "bar", + * }, + * }); + * ``` + * * ## Import * * Storage Syncs can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/syncCloudEndpoint.ts b/sdk/nodejs/storage/syncCloudEndpoint.ts index a711c287c6..3116ea265a 100644 --- a/sdk/nodejs/storage/syncCloudEndpoint.ts +++ b/sdk/nodejs/storage/syncCloudEndpoint.ts @@ -9,6 +9,41 @@ import * as utilities from "../utilities"; * * > **NOTE:** Please ensure Azure File Sync has access to the storage account in your subscription, which indicates that `Microsoft.StorageSync` is assigned role `Reader and Data Access` ( refer to details [here](https://docs.microsoft.com/azure/storage/files/storage-sync-files-troubleshoot?tabs=portal1%2Cazure-portal#common-troubleshooting-steps)). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSync = new azure.storage.Sync("exampleSync", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSyncGroup = new azure.storage.SyncGroup("exampleSyncGroup", {storageSyncId: exampleSync.id}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleShare = new azure.storage.Share("exampleShare", { + * storageAccountName: exampleAccount.name, + * quota: 50, + * acls: [{ + * id: "GhostedRecall", + * accessPolicies: [{ + * permissions: "r", + * }], + * }], + * }); + * const exampleSyncCloudEndpoint = new azure.storage.SyncCloudEndpoint("exampleSyncCloudEndpoint", { + * storageSyncGroupId: exampleSyncGroup.id, + * fileShareName: exampleShare.name, + * storageAccountId: exampleAccount.id, + * }); + * ``` + * * ## Import * * Storage Sync Cloud Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/syncGroup.ts b/sdk/nodejs/storage/syncGroup.ts index ab9439f4d1..c7e3436adc 100644 --- a/sdk/nodejs/storage/syncGroup.ts +++ b/sdk/nodejs/storage/syncGroup.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manages a Storage Sync Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleSync = new azure.storage.Sync("exampleSync", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleSyncGroup = new azure.storage.SyncGroup("exampleSyncGroup", {storageSyncId: exampleSync.id}); + * ``` + * * ## Import * * Storage Sync Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/table.ts b/sdk/nodejs/storage/table.ts index e7551c815f..deb25949ee 100644 --- a/sdk/nodejs/storage/table.ts +++ b/sdk/nodejs/storage/table.ts @@ -9,6 +9,22 @@ import * as utilities from "../utilities"; /** * Manages a Table within an Azure Storage Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleTable = new azure.storage.Table("exampleTable", {storageAccountName: exampleAccount.name}); + * ``` + * * ## Import * * Table's within a Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/storage/tableEntity.ts b/sdk/nodejs/storage/tableEntity.ts index bf454c8c39..9cec059a15 100644 --- a/sdk/nodejs/storage/tableEntity.ts +++ b/sdk/nodejs/storage/tableEntity.ts @@ -7,6 +7,31 @@ import * as utilities from "../utilities"; /** * Manages an Entity within a Table in an Azure Storage Account. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleTable = new azure.storage.Table("exampleTable", {storageAccountName: exampleAccount.name}); + * const exampleTableEntity = new azure.storage.TableEntity("exampleTableEntity", { + * storageAccountName: exampleAccount.name, + * tableName: exampleTable.name, + * partitionKey: "examplepartition", + * rowKey: "examplerow", + * entity: { + * example: "example", + * }, + * }); + * ``` + * * ## Import * * Entities within a Table in an Azure Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/cluster.ts b/sdk/nodejs/streamanalytics/cluster.ts index 78896db355..ad4b842a70 100644 --- a/sdk/nodejs/streamanalytics/cluster.ts +++ b/sdk/nodejs/streamanalytics/cluster.ts @@ -7,6 +7,20 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Cluster. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleCluster = new azure.streamanalytics.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * streamingCapacity: 36, + * }); + * ``` + * * ## Import * * Stream Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/functionJavaScriptUDF.ts b/sdk/nodejs/streamanalytics/functionJavaScriptUDF.ts index c4fdae4f60..0002f638b4 100644 --- a/sdk/nodejs/streamanalytics/functionJavaScriptUDF.ts +++ b/sdk/nodejs/streamanalytics/functionJavaScriptUDF.ts @@ -9,6 +9,35 @@ import * as utilities from "../utilities"; /** * Manages a JavaScript UDF Function within Stream Analytics Streaming Job. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = azure.core.getResourceGroup({ + * name: "example-resources", + * }); + * const exampleJob = exampleResourceGroup.then(exampleResourceGroup => azure.streamanalytics.getJob({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * })); + * const exampleFunctionJavaScriptUDF = new azure.streamanalytics.FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", { + * streamAnalyticsJobName: exampleJob.then(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.then(exampleJob => exampleJob.resourceGroupName), + * script: `function getRandomNumber(in) { + * return in; + * } + * `, + * inputs: [{ + * type: "bigint", + * }], + * output: { + * type: "bigint", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics JavaScript UDF Functions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/functionJavascriptUda.ts b/sdk/nodejs/streamanalytics/functionJavascriptUda.ts index 34587762c5..c331d75cb0 100644 --- a/sdk/nodejs/streamanalytics/functionJavascriptUda.ts +++ b/sdk/nodejs/streamanalytics/functionJavascriptUda.ts @@ -9,6 +9,44 @@ import * as utilities from "../utilities"; /** * Manages a JavaScript UDA Function within a Stream Analytics Streaming Job. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = azure.core.getResourceGroup({ + * name: "example-resources", + * }); + * const exampleJob = exampleResourceGroup.then(exampleResourceGroup => azure.streamanalytics.getJob({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * })); + * const exampleFunctionJavascriptUda = new azure.streamanalytics.FunctionJavascriptUda("exampleFunctionJavascriptUda", { + * streamAnalyticsJobId: exampleJob.then(exampleJob => exampleJob.id), + * script: `function main() { + * this.init = function () { + * this.state = 0; + * } + * + * this.accumulate = function (value, timestamp) { + * this.state += value; + * } + * + * this.computeResult = function () { + * return this.state; + * } + * } + * `, + * inputs: [{ + * type: "bigint", + * }], + * output: { + * type: "bigint", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics JavaScript UDA Functions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/getJob.ts b/sdk/nodejs/streamanalytics/getJob.ts index 6e4e8c3b34..0a4a1e9006 100644 --- a/sdk/nodejs/streamanalytics/getJob.ts +++ b/sdk/nodejs/streamanalytics/getJob.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Stream Analytics Job. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.streamanalytics.getJob({ + * name: "example-job", + * resourceGroupName: "example-resources", + * }); + * export const jobId = example.then(example => example.jobId); + * ``` */ export function getJob(args: GetJobArgs, opts?: pulumi.InvokeOptions): Promise { @@ -101,6 +114,19 @@ export interface GetJobResult { } /** * Use this data source to access information about an existing Stream Analytics Job. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.streamanalytics.getJob({ + * name: "example-job", + * resourceGroupName: "example-resources", + * }); + * export const jobId = example.then(example => example.jobId); + * ``` */ export function getJobOutput(args: GetJobOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getJob(a, opts)) diff --git a/sdk/nodejs/streamanalytics/job.ts b/sdk/nodejs/streamanalytics/job.ts index 162a07db7d..7b5b539688 100644 --- a/sdk/nodejs/streamanalytics/job.ts +++ b/sdk/nodejs/streamanalytics/job.ts @@ -9,6 +9,33 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Job. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = new azure.streamanalytics.Job("exampleJob", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * compatibilityLevel: "1.2", + * dataLocale: "en-GB", + * eventsLateArrivalMaxDelayInSeconds: 60, + * eventsOutOfOrderMaxDelayInSeconds: 50, + * eventsOutOfOrderPolicy: "Adjust", + * outputErrorPolicy: "Drop", + * streamingUnits: 3, + * tags: { + * environment: "Example", + * }, + * transformationQuery: ` SELECT * + * INTO [YourOutputAlias] + * FROM [YourInputAlias] + * `, + * }); + * ``` + * * ## Import * * Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/jobSchedule.ts b/sdk/nodejs/streamanalytics/jobSchedule.ts index 06e08c9065..e02fdfd7be 100644 --- a/sdk/nodejs/streamanalytics/jobSchedule.ts +++ b/sdk/nodejs/streamanalytics/jobSchedule.ts @@ -7,6 +7,88 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Job Schedule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleBlob = new azure.storage.Blob("exampleBlob", { + * storageAccountName: exampleAccount.name, + * storageContainerName: exampleContainer.name, + * type: "Block", + * source: new pulumi.asset.FileAsset("example.csv"), + * }); + * const exampleJob = new azure.streamanalytics.Job("exampleJob", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * compatibilityLevel: "1.2", + * dataLocale: "en-GB", + * eventsLateArrivalMaxDelayInSeconds: 60, + * eventsOutOfOrderMaxDelayInSeconds: 50, + * eventsOutOfOrderPolicy: "Adjust", + * outputErrorPolicy: "Drop", + * streamingUnits: 3, + * tags: { + * environment: "Example", + * }, + * transformationQuery: ` SELECT * + * INTO [exampleoutput] + * FROM [exampleinput] + * `, + * }); + * const exampleStreamInputBlob = new azure.streamanalytics.StreamInputBlob("exampleStreamInputBlob", { + * streamAnalyticsJobName: exampleJob.name, + * resourceGroupName: exampleJob.resourceGroupName, + * storageAccountName: exampleAccount.name, + * storageAccountKey: exampleAccount.primaryAccessKey, + * storageContainerName: exampleContainer.name, + * pathPattern: "", + * dateFormat: "yyyy/MM/dd", + * timeFormat: "HH", + * serialization: { + * type: "Csv", + * encoding: "UTF8", + * fieldDelimiter: ",", + * }, + * }); + * const exampleOutputBlob = new azure.streamanalytics.OutputBlob("exampleOutputBlob", { + * streamAnalyticsJobName: exampleJob.name, + * resourceGroupName: exampleJob.resourceGroupName, + * storageAccountName: exampleAccount.name, + * storageAccountKey: exampleAccount.primaryAccessKey, + * storageContainerName: exampleContainer.name, + * pathPattern: "example-{date}-{time}", + * dateFormat: "yyyy-MM-dd", + * timeFormat: "HH", + * serialization: { + * type: "Avro", + * }, + * }); + * const exampleJobSchedule = new azure.streamanalytics.JobSchedule("exampleJobSchedule", { + * streamAnalyticsJobId: exampleJob.id, + * startMode: "CustomTime", + * startTime: "2022-09-21T00:00:00Z", + * }, { + * dependsOn: [ + * exampleJob, + * exampleStreamInputBlob, + * exampleOutputBlob, + * ], + * }); + * ``` + * * ## Import * * Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/managedPrivateEndpoint.ts b/sdk/nodejs/streamanalytics/managedPrivateEndpoint.ts index c25cb5ca61..038932ec34 100644 --- a/sdk/nodejs/streamanalytics/managedPrivateEndpoint.ts +++ b/sdk/nodejs/streamanalytics/managedPrivateEndpoint.ts @@ -7,6 +7,34 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Managed Private Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleCluster = new azure.streamanalytics.Cluster("exampleCluster", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * streamingCapacity: 36, + * }); + * const exampleManagedPrivateEndpoint = new azure.streamanalytics.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * streamAnalyticsClusterName: exampleCluster.name, + * targetResourceId: exampleAccount.id, + * subresourceName: "blob", + * }); + * ``` + * * ## Import * * Stream Analytics Private Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputBlob.ts b/sdk/nodejs/streamanalytics/outputBlob.ts index f09999101e..56e000c81f 100644 --- a/sdk/nodejs/streamanalytics/outputBlob.ts +++ b/sdk/nodejs/streamanalytics/outputBlob.ts @@ -9,6 +9,44 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output to Blob Storage. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleOutputBlob = new azure.streamanalytics.OutputBlob("exampleOutputBlob", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * storageAccountName: exampleAccount.name, + * storageAccountKey: exampleAccount.primaryAccessKey, + * storageContainerName: exampleContainer.name, + * pathPattern: "some-pattern", + * dateFormat: "yyyy-MM-dd", + * timeFormat: "HH", + * serialization: { + * type: "Csv", + * encoding: "UTF8", + * fieldDelimiter: ",", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Outputs to Blob Storage can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputCosmosdb.ts b/sdk/nodejs/streamanalytics/outputCosmosdb.ts index 7fcea18b74..acca961076 100644 --- a/sdk/nodejs/streamanalytics/outputCosmosdb.ts +++ b/sdk/nodejs/streamanalytics/outputCosmosdb.ts @@ -7,6 +7,52 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output to CosmosDB. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleAccount = new azure.cosmosdb.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * offerType: "Standard", + * kind: "GlobalDocumentDB", + * consistencyPolicy: { + * consistencyLevel: "BoundedStaleness", + * maxIntervalInSeconds: 10, + * maxStalenessPrefix: 200, + * }, + * geoLocations: [{ + * location: exampleResourceGroup.location, + * failoverPriority: 0, + * }], + * }); + * const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("exampleSqlDatabase", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * throughput: 400, + * }); + * const exampleSqlContainer = new azure.cosmosdb.SqlContainer("exampleSqlContainer", { + * resourceGroupName: exampleAccount.resourceGroupName, + * accountName: exampleAccount.name, + * databaseName: exampleSqlDatabase.name, + * partitionKeyPath: "foo", + * }); + * const exampleOutputCosmosdb = new azure.streamanalytics.OutputCosmosdb("exampleOutputCosmosdb", { + * streamAnalyticsJobId: exampleJob.apply(exampleJob => exampleJob.id), + * cosmosdbAccountKey: exampleAccount.primaryKey, + * cosmosdbSqlDatabaseId: exampleSqlDatabase.id, + * containerName: exampleSqlContainer.name, + * documentId: "exampledocumentid", + * }); + * ``` + * * ## Import * * Stream Analytics Outputs for CosmosDB can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputEventHub.ts b/sdk/nodejs/streamanalytics/outputEventHub.ts index de9a37c29c..c89334e54b 100644 --- a/sdk/nodejs/streamanalytics/outputEventHub.ts +++ b/sdk/nodejs/streamanalytics/outputEventHub.ts @@ -9,6 +9,42 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output to an EventHub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 1, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * const exampleOutputEventHub = new azure.streamanalytics.OutputEventHub("exampleOutputEventHub", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * eventhubName: exampleEventHub.name, + * servicebusNamespace: exampleEventHubNamespace.name, + * sharedAccessPolicyKey: exampleEventHubNamespace.defaultPrimaryKey, + * sharedAccessPolicyName: "RootManageSharedAccessKey", + * serialization: { + * type: "Avro", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Outputs to an EventHub can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputFunction.ts b/sdk/nodejs/streamanalytics/outputFunction.ts index ec83c00160..1f60881fd6 100644 --- a/sdk/nodejs/streamanalytics/outputFunction.ts +++ b/sdk/nodejs/streamanalytics/outputFunction.ts @@ -7,6 +7,56 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output Function. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const examplePlan = new azure.appservice.Plan("examplePlan", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * kind: "FunctionApp", + * reserved: true, + * sku: { + * tier: "Dynamic", + * size: "Y1", + * }, + * }); + * const exampleFunctionApp = new azure.appservice.FunctionApp("exampleFunctionApp", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * appServicePlanId: examplePlan.id, + * storageAccountName: exampleAccount.name, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * osType: "linux", + * version: "~3", + * }); + * const exampleJob = new azure.streamanalytics.Job("exampleJob", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * streamingUnits: 3, + * transformationQuery: ` SELECT * + * INTO [YourOutputAlias] + * FROM [YourInputAlias] + * `, + * }); + * const exampleOutputFunction = new azure.streamanalytics.OutputFunction("exampleOutputFunction", { + * resourceGroupName: exampleJob.resourceGroupName, + * streamAnalyticsJobName: exampleJob.name, + * functionApp: exampleFunctionApp.name, + * functionName: "examplefunctionname", + * apiKey: "exampleapikey", + * }); + * ``` + * * ## Import * * Stream Analytics Output Functions can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputMssql.ts b/sdk/nodejs/streamanalytics/outputMssql.ts index 89afb6a4df..b86c8f67cc 100644 --- a/sdk/nodejs/streamanalytics/outputMssql.ts +++ b/sdk/nodejs/streamanalytics/outputMssql.ts @@ -7,6 +7,44 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output to Microsoft SQL Server Database. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleSqlServer = new azure.sql.SqlServer("exampleSqlServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "dbadmin", + * administratorLoginPassword: "example-password", + * }); + * const exampleDatabase = new azure.sql.Database("exampleDatabase", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * serverName: exampleSqlServer.name, + * requestedServiceObjectiveName: "S0", + * collation: "SQL_LATIN1_GENERAL_CP1_CI_AS", + * maxSizeBytes: "268435456000", + * createMode: "Default", + * }); + * const exampleOutputMssql = new azure.streamanalytics.OutputMssql("exampleOutputMssql", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * server: exampleSqlServer.fullyQualifiedDomainName, + * user: exampleSqlServer.administratorLogin, + * password: exampleSqlServer.administratorLoginPassword, + * database: exampleDatabase.name, + * table: "ExampleTable", + * }); + * ``` + * * ## Import * * Stream Analytics Outputs to Microsoft SQL Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputPowerbi.ts b/sdk/nodejs/streamanalytics/outputPowerbi.ts index d220361c93..11e1ccda18 100644 --- a/sdk/nodejs/streamanalytics/outputPowerbi.ts +++ b/sdk/nodejs/streamanalytics/outputPowerbi.ts @@ -7,6 +7,28 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output powerBI. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = azure.core.getResourceGroup({ + * name: "example-resources", + * }); + * const exampleJob = exampleResourceGroup.then(exampleResourceGroup => azure.streamanalytics.getJob({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * })); + * const exampleOutputPowerbi = new azure.streamanalytics.OutputPowerbi("exampleOutputPowerbi", { + * streamAnalyticsJobId: exampleJob.then(exampleJob => exampleJob.id), + * dataset: "example-dataset", + * table: "example-table", + * groupId: "00000000-0000-0000-0000-000000000000", + * groupName: "some-group-name", + * }); + * ``` + * * ## Import * * Stream Analytics Output to Power BI can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputServiceBusQueue.ts b/sdk/nodejs/streamanalytics/outputServiceBusQueue.ts index cae5c4528e..bf005609ed 100644 --- a/sdk/nodejs/streamanalytics/outputServiceBusQueue.ts +++ b/sdk/nodejs/streamanalytics/outputServiceBusQueue.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output to a ServiceBus Queue. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleQueue = new azure.servicebus.Queue("exampleQueue", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleOutputServiceBusQueue = new azure.streamanalytics.OutputServiceBusQueue("exampleOutputServiceBusQueue", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * queueName: exampleQueue.name, + * servicebusNamespace: exampleNamespace.name, + * sharedAccessPolicyKey: exampleNamespace.defaultPrimaryKey, + * sharedAccessPolicyName: "RootManageSharedAccessKey", + * serialization: { + * type: "Csv", + * format: "Array", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Output ServiceBus Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputServicebusTopic.ts b/sdk/nodejs/streamanalytics/outputServicebusTopic.ts index 9878f9a47b..3972c43005 100644 --- a/sdk/nodejs/streamanalytics/outputServicebusTopic.ts +++ b/sdk/nodejs/streamanalytics/outputServicebusTopic.ts @@ -9,6 +9,44 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output to a ServiceBus Topic. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleNamespace = new azure.servicebus.Namespace("exampleNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * }); + * const exampleTopic = new azure.servicebus.Topic("exampleTopic", { + * namespaceId: exampleNamespace.id, + * enablePartitioning: true, + * }); + * const exampleOutputServicebusTopic = new azure.streamanalytics.OutputServicebusTopic("exampleOutputServicebusTopic", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * topicName: exampleTopic.name, + * servicebusNamespace: exampleNamespace.name, + * sharedAccessPolicyKey: exampleNamespace.defaultPrimaryKey, + * sharedAccessPolicyName: "RootManageSharedAccessKey", + * propertyColumns: [ + * "col1", + * "col2", + * ], + * serialization: { + * type: "Csv", + * format: "Array", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Output ServiceBus Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputSynapse.ts b/sdk/nodejs/streamanalytics/outputSynapse.ts index c397f1b27f..4d81a55f87 100644 --- a/sdk/nodejs/streamanalytics/outputSynapse.ts +++ b/sdk/nodejs/streamanalytics/outputSynapse.ts @@ -7,6 +7,47 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output to an Azure Synapse Analytics Workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleOutputSynapse = new azure.streamanalytics.OutputSynapse("exampleOutputSynapse", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * server: exampleWorkspace.connectivityEndpoints.sqlOnDemand, + * user: exampleWorkspace.sqlAdministratorLogin, + * password: exampleWorkspace.sqlAdministratorLoginPassword, + * database: "master", + * table: "ExampleTable", + * }); + * ``` + * * ## Import * * A Stream Analytics Output to an Azure Synapse Analytics Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/outputTable.ts b/sdk/nodejs/streamanalytics/outputTable.ts index 9beb377fcf..e47fba6ac2 100644 --- a/sdk/nodejs/streamanalytics/outputTable.ts +++ b/sdk/nodejs/streamanalytics/outputTable.ts @@ -7,6 +7,36 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Output Table. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleTable = new azure.storage.Table("exampleTable", {storageAccountName: exampleAccount.name}); + * const exampleOutputTable = new azure.streamanalytics.OutputTable("exampleOutputTable", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * storageAccountName: exampleAccount.name, + * storageAccountKey: exampleAccount.primaryAccessKey, + * table: exampleTable.name, + * partitionKey: "foo", + * rowKey: "bar", + * batchSize: 100, + * }); + * ``` + * * ## Import * * Stream Analytics Output to Table can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/referenceInputBlob.ts b/sdk/nodejs/streamanalytics/referenceInputBlob.ts index 46863e6598..10d8182951 100644 --- a/sdk/nodejs/streamanalytics/referenceInputBlob.ts +++ b/sdk/nodejs/streamanalytics/referenceInputBlob.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Reference Input Blob. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-blob-storage). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const test = new azure.streamanalytics.ReferenceInputBlob("test", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * storageAccountName: exampleAccount.name, + * storageAccountKey: exampleAccount.primaryAccessKey, + * storageContainerName: exampleContainer.name, + * pathPattern: "some-random-pattern", + * dateFormat: "yyyy/MM/dd", + * timeFormat: "HH", + * serialization: { + * type: "Json", + * encoding: "UTF8", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Reference Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/referenceInputMssql.ts b/sdk/nodejs/streamanalytics/referenceInputMssql.ts index 362ccbd2a7..000add9cbf 100644 --- a/sdk/nodejs/streamanalytics/referenceInputMssql.ts +++ b/sdk/nodejs/streamanalytics/referenceInputMssql.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Reference Input from MS SQL. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-sql-database). * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleServer = new azure.mssql.Server("exampleServer", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * version: "12.0", + * administratorLogin: "admin", + * administratorLoginPassword: "password", + * }); + * const exampleDatabase = new azure.mssql.Database("exampleDatabase", {serverId: exampleServer.id}); + * const exampleReferenceInputMssql = new azure.streamanalytics.ReferenceInputMssql("exampleReferenceInputMssql", { + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * server: exampleServer.fullyQualifiedDomainName, + * database: exampleDatabase.name, + * username: "exampleuser", + * password: "examplepassword", + * refreshType: "RefreshPeriodicallyWithFull", + * refreshIntervalDuration: "00:20:00", + * fullSnapshotQuery: ` SELECT * + * INTO [YourOutputAlias] + * FROM [YourInputAlias] + * `, + * }); + * ``` + * * ## Import * * Stream Analytics can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/streamInputBlob.ts b/sdk/nodejs/streamanalytics/streamInputBlob.ts index 6b7d0c5902..d632f9f02d 100644 --- a/sdk/nodejs/streamanalytics/streamInputBlob.ts +++ b/sdk/nodejs/streamanalytics/streamInputBlob.ts @@ -9,6 +9,43 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Stream Input Blob. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleStreamInputBlob = new azure.streamanalytics.StreamInputBlob("exampleStreamInputBlob", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * storageAccountName: exampleAccount.name, + * storageAccountKey: exampleAccount.primaryAccessKey, + * storageContainerName: exampleContainer.name, + * pathPattern: "some-random-pattern", + * dateFormat: "yyyy/MM/dd", + * timeFormat: "HH", + * serialization: { + * type: "Json", + * encoding: "UTF8", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Stream Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/streamInputEventHub.ts b/sdk/nodejs/streamanalytics/streamInputEventHub.ts index 85f3be67a5..79a475c218 100644 --- a/sdk/nodejs/streamanalytics/streamInputEventHub.ts +++ b/sdk/nodejs/streamanalytics/streamInputEventHub.ts @@ -11,6 +11,49 @@ import * as utilities from "../utilities"; * * Manages a Stream Analytics Stream Input EventHub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 1, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleStreamInputEventHub = new azure.streamanalytics.StreamInputEventHub("exampleStreamInputEventHub", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * eventhubConsumerGroupName: exampleConsumerGroup.name, + * eventhubName: exampleEventHub.name, + * servicebusNamespace: exampleEventHubNamespace.name, + * sharedAccessPolicyKey: exampleEventHubNamespace.defaultPrimaryKey, + * sharedAccessPolicyName: "RootManageSharedAccessKey", + * serialization: { + * type: "Json", + * encoding: "UTF8", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/streamInputEventHubV2.ts b/sdk/nodejs/streamanalytics/streamInputEventHubV2.ts index 19132b46c9..547e314181 100644 --- a/sdk/nodejs/streamanalytics/streamInputEventHubV2.ts +++ b/sdk/nodejs/streamanalytics/streamInputEventHubV2.ts @@ -11,6 +11,48 @@ import * as utilities from "../utilities"; * * Manages a Stream Analytics Stream Input EventHub V2. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleEventHubNamespace = new azure.eventhub.EventHubNamespace("exampleEventHubNamespace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard", + * capacity: 1, + * }); + * const exampleEventHub = new azure.eventhub.EventHub("exampleEventHub", { + * namespaceName: exampleEventHubNamespace.name, + * resourceGroupName: exampleResourceGroup.name, + * partitionCount: 2, + * messageRetention: 1, + * }); + * const exampleConsumerGroup = new azure.eventhub.ConsumerGroup("exampleConsumerGroup", { + * namespaceName: exampleEventHubNamespace.name, + * eventhubName: exampleEventHub.name, + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleStreamInputEventHubV2 = new azure.streamanalytics.StreamInputEventHubV2("exampleStreamInputEventHubV2", { + * streamAnalyticsJobId: exampleJob.apply(exampleJob => exampleJob.id), + * eventhubConsumerGroupName: exampleConsumerGroup.name, + * eventhubName: exampleEventHub.name, + * servicebusNamespace: exampleEventHubNamespace.name, + * sharedAccessPolicyKey: exampleEventHubNamespace.defaultPrimaryKey, + * sharedAccessPolicyName: "RootManageSharedAccessKey", + * serialization: { + * type: "Json", + * encoding: "UTF8", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/streamanalytics/streamInputIotHub.ts b/sdk/nodejs/streamanalytics/streamInputIotHub.ts index c97fa417b9..2a3ded3360 100644 --- a/sdk/nodejs/streamanalytics/streamInputIotHub.ts +++ b/sdk/nodejs/streamanalytics/streamInputIotHub.ts @@ -9,6 +9,40 @@ import * as utilities from "../utilities"; /** * Manages a Stream Analytics Stream Input IoTHub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleJob = azure.streamanalytics.getJobOutput({ + * name: "example-job", + * resourceGroupName: exampleResourceGroup.name, + * }); + * const exampleIoTHub = new azure.iot.IoTHub("exampleIoTHub", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * sku: { + * name: "S1", + * capacity: 1, + * }, + * }); + * const exampleStreamInputIotHub = new azure.streamanalytics.StreamInputIotHub("exampleStreamInputIotHub", { + * streamAnalyticsJobName: exampleJob.apply(exampleJob => exampleJob.name), + * resourceGroupName: exampleJob.apply(exampleJob => exampleJob.resourceGroupName), + * endpoint: "messages/events", + * eventhubConsumerGroupName: "$Default", + * iothubNamespace: exampleIoTHub.name, + * sharedAccessPolicyKey: exampleIoTHub.sharedAccessPolicies.apply(sharedAccessPolicies => sharedAccessPolicies[0].primaryKey), + * sharedAccessPolicyName: "iothubowner", + * serialization: { + * type: "Json", + * encoding: "UTF8", + * }, + * }); + * ``` + * * ## Import * * Stream Analytics Stream Input IoTHub's can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/firewallRule.ts b/sdk/nodejs/synapse/firewallRule.ts index c80b710725..16aa189988 100644 --- a/sdk/nodejs/synapse/firewallRule.ts +++ b/sdk/nodejs/synapse/firewallRule.ts @@ -7,6 +7,39 @@ import * as utilities from "../utilities"; /** * Allows you to Manages a Synapse Firewall Rule. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleFirewallRule = new azure.synapse.FirewallRule("exampleFirewallRule", { + * synapseWorkspaceId: exampleWorkspace.id, + * startIpAddress: "0.0.0.0", + * endIpAddress: "255.255.255.255", + * }); + * ``` + * * ## Import * * Synapse Firewall Rule can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/getWorkspace.ts b/sdk/nodejs/synapse/getWorkspace.ts index 769b381af3..82dce6bde4 100644 --- a/sdk/nodejs/synapse/getWorkspace.ts +++ b/sdk/nodejs/synapse/getWorkspace.ts @@ -8,6 +8,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Synapse Workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.synapse.getWorkspace({ + * name: "existing", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getWorkspace(args: GetWorkspaceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -61,6 +74,19 @@ export interface GetWorkspaceResult { } /** * Use this data source to access information about an existing Synapse Workspace. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.synapse.getWorkspace({ + * name: "existing", + * resourceGroupName: "example-resource-group", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getWorkspaceOutput(args: GetWorkspaceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getWorkspace(a, opts)) diff --git a/sdk/nodejs/synapse/integrationRuntimeAzure.ts b/sdk/nodejs/synapse/integrationRuntimeAzure.ts index 0923af2da9..840817dba4 100644 --- a/sdk/nodejs/synapse/integrationRuntimeAzure.ts +++ b/sdk/nodejs/synapse/integrationRuntimeAzure.ts @@ -7,6 +7,46 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Azure Integration Runtime. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * managedVirtualNetworkEnabled: true, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleFirewallRule = new azure.synapse.FirewallRule("exampleFirewallRule", { + * synapseWorkspaceId: exampleWorkspace.id, + * startIpAddress: "0.0.0.0", + * endIpAddress: "255.255.255.255", + * }); + * const exampleIntegrationRuntimeAzure = new azure.synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", { + * synapseWorkspaceId: exampleWorkspace.id, + * location: exampleResourceGroup.location, + * }); + * ``` + * * ## Import * * Synapse Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/integrationRuntimeSelfHosted.ts b/sdk/nodejs/synapse/integrationRuntimeSelfHosted.ts index 42025f188a..d2f51c4514 100644 --- a/sdk/nodejs/synapse/integrationRuntimeSelfHosted.ts +++ b/sdk/nodejs/synapse/integrationRuntimeSelfHosted.ts @@ -7,6 +7,43 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Self-hosted Integration Runtime. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * managedVirtualNetworkEnabled: true, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleFirewallRule = new azure.synapse.FirewallRule("exampleFirewallRule", { + * synapseWorkspaceId: exampleWorkspace.id, + * startIpAddress: "0.0.0.0", + * endIpAddress: "255.255.255.255", + * }); + * const exampleIntegrationRuntimeSelfHosted = new azure.synapse.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", {synapseWorkspaceId: exampleWorkspace.id}); + * ``` + * * ## Import * * Synapse Self-hosted Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/linkedService.ts b/sdk/nodejs/synapse/linkedService.ts index a8c82cc8a3..4dc2936c10 100644 --- a/sdk/nodejs/synapse/linkedService.ts +++ b/sdk/nodejs/synapse/linkedService.ts @@ -9,6 +9,56 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Linked Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * managedVirtualNetworkEnabled: true, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleFirewallRule = new azure.synapse.FirewallRule("exampleFirewallRule", { + * synapseWorkspaceId: exampleWorkspace.id, + * startIpAddress: "0.0.0.0", + * endIpAddress: "255.255.255.255", + * }); + * const exampleIntegrationRuntimeAzure = new azure.synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", { + * synapseWorkspaceId: exampleWorkspace.id, + * location: exampleResourceGroup.location, + * }); + * const exampleLinkedService = new azure.synapse.LinkedService("exampleLinkedService", { + * synapseWorkspaceId: exampleWorkspace.id, + * type: "AzureBlobStorage", + * typePropertiesJson: pulumi.interpolate`{ + * "connectionString": "${exampleAccount.primaryConnectionString}" + * } + * `, + * integrationRuntime: { + * name: exampleIntegrationRuntimeAzure.name, + * }, + * }, { + * dependsOn: [exampleFirewallRule], + * }); + * ``` + * * ## Import * * Synapse Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/managedPrivateEndpoint.ts b/sdk/nodejs/synapse/managedPrivateEndpoint.ts index 1883d8d6fe..543f21d333 100644 --- a/sdk/nodejs/synapse/managedPrivateEndpoint.ts +++ b/sdk/nodejs/synapse/managedPrivateEndpoint.ts @@ -7,6 +7,54 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Managed Private Endpoint. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * managedVirtualNetworkEnabled: true, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleFirewallRule = new azure.synapse.FirewallRule("exampleFirewallRule", { + * synapseWorkspaceId: exampleWorkspace.id, + * startIpAddress: "0.0.0.0", + * endIpAddress: "255.255.255.255", + * }); + * const exampleConnect = new azure.storage.Account("exampleConnect", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "BlobStorage", + * }); + * const exampleManagedPrivateEndpoint = new azure.synapse.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", { + * synapseWorkspaceId: exampleWorkspace.id, + * targetResourceId: exampleConnect.id, + * subresourceName: "blob", + * }, { + * dependsOn: [exampleFirewallRule], + * }); + * ``` + * * ## Import * * Synapse Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/privateLinkHub.ts b/sdk/nodejs/synapse/privateLinkHub.ts index 5766e87181..4f8625c0a2 100644 --- a/sdk/nodejs/synapse/privateLinkHub.ts +++ b/sdk/nodejs/synapse/privateLinkHub.ts @@ -7,6 +7,18 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Private Link Hub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.synapse.PrivateLinkHub("example", { + * location: "West Europe", + * resourceGroupName: "example-rg", + * }); + * ``` + * * ## Import * * Synapse Private Link Hub can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/roleAssignment.ts b/sdk/nodejs/synapse/roleAssignment.ts index ed469822e4..ea33895f4f 100644 --- a/sdk/nodejs/synapse/roleAssignment.ts +++ b/sdk/nodejs/synapse/roleAssignment.ts @@ -7,6 +7,47 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Role Assignment. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleFirewallRule = new azure.synapse.FirewallRule("exampleFirewallRule", { + * synapseWorkspaceId: exampleWorkspace.id, + * startIpAddress: "0.0.0.0", + * endIpAddress: "255.255.255.255", + * }); + * const current = azure.core.getClientConfig({}); + * const exampleRoleAssignment = new azure.synapse.RoleAssignment("exampleRoleAssignment", { + * synapseWorkspaceId: exampleWorkspace.id, + * roleName: "Synapse SQL Administrator", + * principalId: current.then(current => current.objectId), + * }, { + * dependsOn: [exampleFirewallRule], + * }); + * ``` + * * ## Import * * Synapse Role Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/sqlPool.ts b/sdk/nodejs/synapse/sqlPool.ts index 0d146f5e0f..ba18c481bc 100644 --- a/sdk/nodejs/synapse/sqlPool.ts +++ b/sdk/nodejs/synapse/sqlPool.ts @@ -9,6 +9,39 @@ import * as utilities from "../utilities"; /** * Manages a Synapse SQL Pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "BlobStorage", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSqlPool = new azure.synapse.SqlPool("exampleSqlPool", { + * synapseWorkspaceId: exampleWorkspace.id, + * skuName: "DW100c", + * createMode: "Default", + * storageAccountType: "GRS", + * }); + * ``` + * * ## Import * * Synapse SQL Pool can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/sqlPoolExtendedAuditingPolicy.ts b/sdk/nodejs/synapse/sqlPoolExtendedAuditingPolicy.ts index d12a46cf9b..5a828d3375 100644 --- a/sdk/nodejs/synapse/sqlPoolExtendedAuditingPolicy.ts +++ b/sdk/nodejs/synapse/sqlPoolExtendedAuditingPolicy.ts @@ -7,6 +7,51 @@ import * as utilities from "../utilities"; /** * Manages a Synapse SQL Pool Extended Auditing Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "BlobStorage", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSqlPool = new azure.synapse.SqlPool("exampleSqlPool", { + * synapseWorkspaceId: exampleWorkspace.id, + * skuName: "DW100c", + * createMode: "Default", + * }); + * const auditLogs = new azure.storage.Account("auditLogs", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleSqlPoolExtendedAuditingPolicy = new azure.synapse.SqlPoolExtendedAuditingPolicy("exampleSqlPoolExtendedAuditingPolicy", { + * sqlPoolId: exampleSqlPool.id, + * storageEndpoint: auditLogs.primaryBlobEndpoint, + * storageAccountAccessKey: auditLogs.primaryAccessKey, + * storageAccountAccessKeyIsSecondary: false, + * retentionInDays: 6, + * }); + * ``` + * * ## Import * * Synapse SQL Pool Extended Auditing Policys can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/sqlPoolSecurityAlertPolicy.ts b/sdk/nodejs/synapse/sqlPoolSecurityAlertPolicy.ts index 0b1daa823f..cb071580f8 100644 --- a/sdk/nodejs/synapse/sqlPoolSecurityAlertPolicy.ts +++ b/sdk/nodejs/synapse/sqlPoolSecurityAlertPolicy.ts @@ -7,6 +7,64 @@ import * as utilities from "../utilities"; /** * Manages a Security Alert Policy for a Synapse SQL Pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * aadAdmin: { + * login: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * tenantId: "00000000-0000-0000-0000-000000000000", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const exampleSqlPool = new azure.synapse.SqlPool("exampleSqlPool", { + * synapseWorkspaceId: exampleWorkspace.id, + * skuName: "DW100c", + * createMode: "Default", + * }); + * const auditLogs = new azure.storage.Account("auditLogs", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleSqlPoolSecurityAlertPolicy = new azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", { + * sqlPoolId: exampleSqlPool.id, + * policyState: "Enabled", + * storageEndpoint: auditLogs.primaryBlobEndpoint, + * storageAccountAccessKey: auditLogs.primaryAccessKey, + * disabledAlerts: [ + * "Sql_Injection", + * "Data_Exfiltration", + * ], + * retentionDays: 20, + * }); + * ``` + * * ## Import * * Synapse SQL Pool Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessment.ts b/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessment.ts index 3e2052fec8..6eb8e5a0f7 100644 --- a/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessment.ts +++ b/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessment.ts @@ -9,6 +9,78 @@ import * as utilities from "../utilities"; /** * Manages the Vulnerability Assessment for a Synapse SQL Pool. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name}); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * aadAdmin: { + * login: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * tenantId: "00000000-0000-0000-0000-000000000000", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const exampleSqlPool = new azure.synapse.SqlPool("exampleSqlPool", { + * synapseWorkspaceId: exampleWorkspace.id, + * skuName: "DW100c", + * createMode: "Default", + * }); + * const auditLogs = new azure.storage.Account("auditLogs", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleSqlPoolSecurityAlertPolicy = new azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", { + * sqlPoolId: exampleSqlPool.id, + * policyState: "Enabled", + * storageEndpoint: auditLogs.primaryBlobEndpoint, + * storageAccountAccessKey: auditLogs.primaryAccessKey, + * disabledAlerts: [ + * "Sql_Injection", + * "Data_Exfiltration", + * ], + * retentionDays: 20, + * }); + * const exampleSqlPoolVulnerabilityAssessment = new azure.synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", { + * sqlPoolSecurityAlertPolicyId: exampleSqlPoolSecurityAlertPolicy.id, + * storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * recurringScans: { + * enabled: true, + * emailSubscriptionAdminsEnabled: true, + * emails: [ + * "email@example1.com", + * "email@example2.com", + * ], + * }, + * }); + * ``` + * * ## Import * * Synapse SQL Pool Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessmentBaseline.ts b/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessmentBaseline.ts index 91a8f362b7..dfb77f8ee7 100644 --- a/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessmentBaseline.ts +++ b/sdk/nodejs/synapse/sqlPoolVulnerabilityAssessmentBaseline.ts @@ -9,6 +9,71 @@ import * as utilities from "../utilities"; /** * Manages a Synapse SQL Pool Vulnerability Assessment Rule Baseline. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSqlPool = new azure.synapse.SqlPool("exampleSqlPool", { + * synapseWorkspaceId: exampleWorkspace.id, + * skuName: "DW100c", + * createMode: "Default", + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", { + * storageAccountName: exampleAccount.name, + * containerAccessType: "private", + * }); + * const exampleSqlPoolSecurityAlertPolicy = new azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", { + * sqlPoolId: exampleSqlPool.id, + * policyState: "Enabled", + * storageEndpoint: exampleAccount.primaryBlobEndpoint, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * const exampleSqlPoolVulnerabilityAssessment = new azure.synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", { + * sqlPoolSecurityAlertPolicyId: exampleSqlPoolSecurityAlertPolicy.id, + * storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * }); + * const exampleSqlPoolVulnerabilityAssessmentBaseline = new azure.synapse.SqlPoolVulnerabilityAssessmentBaseline("exampleSqlPoolVulnerabilityAssessmentBaseline", { + * ruleName: "VA1017", + * sqlPoolVulnerabilityAssessmentId: exampleSqlPoolVulnerabilityAssessment.id, + * baselines: [ + * { + * results: [ + * "userA", + * "SELECT", + * ], + * }, + * { + * results: [ + * "userB", + * "SELECT", + * ], + * }, + * ], + * }); + * ``` + * * ## Import * * Synapse SQL Pool Vulnerability Assessment Rule Baselines can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/sqlPoolWorkloadClassifier.ts b/sdk/nodejs/synapse/sqlPoolWorkloadClassifier.ts index 1d2b89c65f..710c696fd3 100644 --- a/sdk/nodejs/synapse/sqlPoolWorkloadClassifier.ts +++ b/sdk/nodejs/synapse/sqlPoolWorkloadClassifier.ts @@ -7,6 +7,56 @@ import * as utilities from "../utilities"; /** * Manages a Synapse SQL Pool Workload Classifier. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSqlPool = new azure.synapse.SqlPool("exampleSqlPool", { + * synapseWorkspaceId: exampleWorkspace.id, + * skuName: "DW100c", + * createMode: "Default", + * }); + * const exampleSqlPoolWorkloadGroup = new azure.synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", { + * sqlPoolId: exampleSqlPool.id, + * importance: "normal", + * maxResourcePercent: 100, + * minResourcePercent: 0, + * maxResourcePercentPerRequest: 3, + * minResourcePercentPerRequest: 3, + * queryExecutionTimeoutInSeconds: 0, + * }); + * const exampleSqlPoolWorkloadClassifier = new azure.synapse.SqlPoolWorkloadClassifier("exampleSqlPoolWorkloadClassifier", { + * workloadGroupId: exampleSqlPoolWorkloadGroup.id, + * context: "example_context", + * endTime: "14:00", + * importance: "high", + * label: "example_label", + * memberName: "dbo", + * startTime: "12:00", + * }); + * ``` + * * ## Import * * Synapse SQL Pool Workload Classifiers can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/sqlPoolWorkloadGroup.ts b/sdk/nodejs/synapse/sqlPoolWorkloadGroup.ts index 4c4a60e749..b2b9f01f99 100644 --- a/sdk/nodejs/synapse/sqlPoolWorkloadGroup.ts +++ b/sdk/nodejs/synapse/sqlPoolWorkloadGroup.ts @@ -7,6 +7,47 @@ import * as utilities from "../utilities"; /** * Manages a Synapse SQL Pool Workload Group. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "west europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountKind: "BlobStorage", + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const exampleSqlPool = new azure.synapse.SqlPool("exampleSqlPool", { + * synapseWorkspaceId: exampleWorkspace.id, + * skuName: "DW100c", + * createMode: "Default", + * }); + * const exampleSqlPoolWorkloadGroup = new azure.synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", { + * sqlPoolId: exampleSqlPool.id, + * importance: "normal", + * maxResourcePercent: 100, + * minResourcePercent: 0, + * maxResourcePercentPerRequest: 3, + * minResourcePercentPerRequest: 3, + * queryExecutionTimeoutInSeconds: 0, + * }); + * ``` + * * ## Import * * Synapse SQL Pool Workload Groups can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/workspace.ts b/sdk/nodejs/synapse/workspace.ts index 450e242784..c29026b115 100644 --- a/sdk/nodejs/synapse/workspace.ts +++ b/sdk/nodejs/synapse/workspace.ts @@ -9,6 +9,133 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * aadAdmin: { + * login: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * tenantId: "00000000-0000-0000-0000-000000000000", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * ``` + * ### Creating A Workspace With Customer Managed Key And Azure AD Admin + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const deployer = new azure.keyvault.AccessPolicy("deployer", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * "Delete", + * "Purge", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "unwrapKey", + * "wrapKey", + * ], + * }, { + * dependsOn: [deployer], + * }); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * customerManagedKey: { + * keyVersionlessId: exampleKey.versionlessId, + * keyName: "enckey", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const workspacePolicy = new azure.keyvault.AccessPolicy("workspacePolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: exampleWorkspace.identity.apply(identity => identity?.tenantId), + * objectId: exampleWorkspace.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "WrapKey", + * "UnwrapKey", + * ], + * }); + * const exampleWorkspaceKey = new azure.synapse.WorkspaceKey("exampleWorkspaceKey", { + * customerManagedKeyVersionlessId: exampleKey.versionlessId, + * synapseWorkspaceId: exampleWorkspace.id, + * active: true, + * customerManagedKeyName: "enckey", + * }, { + * dependsOn: [workspacePolicy], + * }); + * const exampleWorkspaceAadAdmin = new azure.synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", { + * synapseWorkspaceId: exampleWorkspace.id, + * login: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * tenantId: "00000000-0000-0000-0000-000000000000", + * }, { + * dependsOn: [exampleWorkspaceKey], + * }); + * ``` + * * ## Import * * Synapse Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/workspaceAadAdmin.ts b/sdk/nodejs/synapse/workspaceAadAdmin.ts index 68ba9c875a..b516981684 100644 --- a/sdk/nodejs/synapse/workspaceAadAdmin.ts +++ b/sdk/nodejs/synapse/workspaceAadAdmin.ts @@ -7,6 +7,74 @@ import * as utilities from "../utilities"; /** * Manages an Azure Active Directory Administrator setting for a Synapse Workspace * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const current = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const deployer = new azure.keyvault.AccessPolicy("deployer", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * "Delete", + * "Purge", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "unwrapKey", + * "wrapKey", + * ], + * }, { + * dependsOn: [deployer], + * }); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const exampleWorkspaceAadAdmin = new azure.synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", { + * synapseWorkspaceId: exampleWorkspace.id, + * login: "AzureAD Admin", + * objectId: current.then(current => current.objectId), + * tenantId: current.then(current => current.tenantId), + * }); + * ``` + * * ## Import * * Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/workspaceExtendedAuditingPolicy.ts b/sdk/nodejs/synapse/workspaceExtendedAuditingPolicy.ts index bb241d695d..731b761b5b 100644 --- a/sdk/nodejs/synapse/workspaceExtendedAuditingPolicy.ts +++ b/sdk/nodejs/synapse/workspaceExtendedAuditingPolicy.ts @@ -7,6 +7,46 @@ import * as utilities from "../utilities"; /** * Manages a Synapse Workspace Extended Auditing Policy. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "BlobStorage", + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * }); + * const auditLogs = new azure.storage.Account("auditLogs", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleWorkspaceExtendedAuditingPolicy = new azure.synapse.WorkspaceExtendedAuditingPolicy("exampleWorkspaceExtendedAuditingPolicy", { + * synapseWorkspaceId: exampleWorkspace.id, + * storageEndpoint: auditLogs.primaryBlobEndpoint, + * storageAccountAccessKey: auditLogs.primaryAccessKey, + * storageAccountAccessKeyIsSecondary: false, + * retentionInDays: 6, + * }); + * ``` + * * ## Import * * Synapse Workspace Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/workspaceKey.ts b/sdk/nodejs/synapse/workspaceKey.ts index 5694be8119..a75c3e861d 100644 --- a/sdk/nodejs/synapse/workspaceKey.ts +++ b/sdk/nodejs/synapse/workspaceKey.ts @@ -9,6 +9,90 @@ import * as utilities from "../utilities"; * * > **Note:** Keys that are actively protecting a workspace cannot be deleted. When the keys resource is deleted, if the key is inactive it will be deleted, if it is active it will not be deleted. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const current = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const deployer = new azure.keyvault.AccessPolicy("deployer", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * "Delete", + * "Purge", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "unwrapKey", + * "wrapKey", + * ], + * }, { + * dependsOn: [deployer], + * }); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * customerManagedKey: { + * keyVersionlessId: exampleKey.versionlessId, + * keyName: "enckey", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const workspacePolicy = new azure.keyvault.AccessPolicy("workspacePolicy", { + * keyVaultId: exampleKeyVault.id, + * tenantId: exampleWorkspace.identity.apply(identity => identity?.tenantId), + * objectId: exampleWorkspace.identity.apply(identity => identity?.principalId), + * keyPermissions: [ + * "Get", + * "WrapKey", + * "UnwrapKey", + * ], + * }); + * const exampleWorkspaceKey = new azure.synapse.WorkspaceKey("exampleWorkspaceKey", { + * customerManagedKeyVersionlessId: exampleKey.versionlessId, + * synapseWorkspaceId: exampleWorkspace.id, + * active: true, + * customerManagedKeyName: "enckey", + * }, { + * dependsOn: [workspacePolicy], + * }); + * ``` + * * ## Import * * Synapse Workspace Keys can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/workspaceSecurityAlertPolicy.ts b/sdk/nodejs/synapse/workspaceSecurityAlertPolicy.ts index 580051b21c..a837e8b0ca 100644 --- a/sdk/nodejs/synapse/workspaceSecurityAlertPolicy.ts +++ b/sdk/nodejs/synapse/workspaceSecurityAlertPolicy.ts @@ -7,6 +7,59 @@ import * as utilities from "../utilities"; /** * Manages a Security Alert Policy for a Synapse Workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * aadAdmin: { + * login: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * tenantId: "00000000-0000-0000-0000-000000000000", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const auditLogs = new azure.storage.Account("auditLogs", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleWorkspaceSecurityAlertPolicy = new azure.synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", { + * synapseWorkspaceId: exampleWorkspace.id, + * policyState: "Enabled", + * storageEndpoint: auditLogs.primaryBlobEndpoint, + * storageAccountAccessKey: auditLogs.primaryAccessKey, + * disabledAlerts: [ + * "Sql_Injection", + * "Data_Exfiltration", + * ], + * retentionDays: 20, + * }); + * ``` + * * ## Import * * Synapse Workspace Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/workspaceSqlAadAdmin.ts b/sdk/nodejs/synapse/workspaceSqlAadAdmin.ts index 476456a93d..8fa8606f20 100644 --- a/sdk/nodejs/synapse/workspaceSqlAadAdmin.ts +++ b/sdk/nodejs/synapse/workspaceSqlAadAdmin.ts @@ -7,6 +7,74 @@ import * as utilities from "../utilities"; /** * Manages an Azure Active Directory SQL Administrator setting for a Synapse Workspace * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const current = azure.core.getClientConfig({}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * purgeProtectionEnabled: true, + * }); + * const deployer = new azure.keyvault.AccessPolicy("deployer", { + * keyVaultId: exampleKeyVault.id, + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * keyPermissions: [ + * "Create", + * "Get", + * "Delete", + * "Purge", + * "GetRotationPolicy", + * ], + * }); + * const exampleKey = new azure.keyvault.Key("exampleKey", { + * keyVaultId: exampleKeyVault.id, + * keyType: "RSA", + * keySize: 2048, + * keyOpts: [ + * "unwrapKey", + * "wrapKey", + * ], + * }, { + * dependsOn: [deployer], + * }); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const exampleWorkspaceSqlAadAdmin = new azure.synapse.WorkspaceSqlAadAdmin("exampleWorkspaceSqlAadAdmin", { + * synapseWorkspaceId: exampleWorkspace.id, + * login: "AzureAD Admin", + * objectId: current.then(current => current.objectId), + * tenantId: current.then(current => current.tenantId), + * }); + * ``` + * * ## Import * * Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/synapse/workspaceVulnerabilityAssessment.ts b/sdk/nodejs/synapse/workspaceVulnerabilityAssessment.ts index a46f4cf0fe..371d1f94e1 100644 --- a/sdk/nodejs/synapse/workspaceVulnerabilityAssessment.ts +++ b/sdk/nodejs/synapse/workspaceVulnerabilityAssessment.ts @@ -9,6 +9,73 @@ import * as utilities from "../utilities"; /** * Manages the Vulnerability Assessment for a Synapse Workspace. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * accountKind: "StorageV2", + * isHnsEnabled: true, + * }); + * const exampleContainer = new azure.storage.Container("exampleContainer", {storageAccountName: exampleAccount.name}); + * const exampleDataLakeGen2Filesystem = new azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", {storageAccountId: exampleAccount.id}); + * const exampleWorkspace = new azure.synapse.Workspace("exampleWorkspace", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * storageDataLakeGen2FilesystemId: exampleDataLakeGen2Filesystem.id, + * sqlAdministratorLogin: "sqladminuser", + * sqlAdministratorLoginPassword: "H@Sh1CoR3!", + * aadAdmin: { + * login: "AzureAD Admin", + * objectId: "00000000-0000-0000-0000-000000000000", + * tenantId: "00000000-0000-0000-0000-000000000000", + * }, + * identity: { + * type: "SystemAssigned", + * }, + * tags: { + * Env: "production", + * }, + * }); + * const auditLogs = new azure.storage.Account("auditLogs", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "LRS", + * }); + * const exampleWorkspaceSecurityAlertPolicy = new azure.synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", { + * synapseWorkspaceId: exampleWorkspace.id, + * policyState: "Enabled", + * storageEndpoint: auditLogs.primaryBlobEndpoint, + * storageAccountAccessKey: auditLogs.primaryAccessKey, + * disabledAlerts: [ + * "Sql_Injection", + * "Data_Exfiltration", + * ], + * retentionDays: 20, + * }); + * const exampleWorkspaceVulnerabilityAssessment = new azure.synapse.WorkspaceVulnerabilityAssessment("exampleWorkspaceVulnerabilityAssessment", { + * workspaceSecurityAlertPolicyId: exampleWorkspaceSecurityAlertPolicy.id, + * storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`, + * storageAccountAccessKey: exampleAccount.primaryAccessKey, + * recurringScans: { + * enabled: true, + * emailSubscriptionAdminsEnabled: true, + * emails: [ + * "email@example1.com", + * "email@example2.com", + * ], + * }, + * }); + * ``` + * * ## Import * * Synapse Workspace Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/trafficmanager/getGeographicalLocation.ts b/sdk/nodejs/trafficmanager/getGeographicalLocation.ts index 44dbfa3a38..0dc174d049 100644 --- a/sdk/nodejs/trafficmanager/getGeographicalLocation.ts +++ b/sdk/nodejs/trafficmanager/getGeographicalLocation.ts @@ -8,6 +8,17 @@ import * as utilities from "../utilities"; * Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. * * ## Example Usage + * ### World) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getTrafficManager({ + * name: "World", + * }); + * export const locationCode = example.then(example => example.id); + * ``` */ /** @deprecated azure.trafficmanager.getGeographicalLocation has been deprecated in favor of azure.network.getTrafficManager */ export function getGeographicalLocation(args: GetGeographicalLocationArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +54,17 @@ export interface GetGeographicalLocationResult { * Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. * * ## Example Usage + * ### World) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.network.getTrafficManager({ + * name: "World", + * }); + * export const locationCode = example.then(example => example.id); + * ``` */ /** @deprecated azure.trafficmanager.getGeographicalLocation has been deprecated in favor of azure.network.getTrafficManager */ export function getGeographicalLocationOutput(args: GetGeographicalLocationOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { diff --git a/sdk/nodejs/trafficmanager/profile.ts b/sdk/nodejs/trafficmanager/profile.ts index 8a62bcc4b0..abf4296d9b 100644 --- a/sdk/nodejs/trafficmanager/profile.ts +++ b/sdk/nodejs/trafficmanager/profile.ts @@ -9,6 +9,41 @@ import * as utilities from "../utilities"; /** * Manages a Traffic Manager Profile to which multiple endpoints can be attached. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * import * as random from "@pulumi/random"; + * + * const server = new random.RandomId("server", { + * keepers: { + * azi_id: 1, + * }, + * byteLength: 8, + * }); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleTrafficManagerProfile = new azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", { + * resourceGroupName: exampleResourceGroup.name, + * trafficRoutingMethod: "Weighted", + * dnsConfig: { + * relativeName: server.hex, + * ttl: 100, + * }, + * monitorConfig: { + * protocol: "HTTP", + * port: 80, + * path: "/", + * intervalInSeconds: 30, + * timeoutInSeconds: 9, + * toleratedNumberOfFailures: 3, + * }, + * tags: { + * environment: "Production", + * }, + * }); + * ``` + * * ## Import * * Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index 11b303a6b4..dbb6b3d0c5 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -18998,6 +18998,33 @@ export namespace compute { export interface ScaleSetIdentity { /** * Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.compute.ScaleSet("example", { + * resourceGroupName: azurerm_resource_group.example.name, + * location: azurerm_resource_group.example.location, + * sku: { + * name: _var.vm_sku, + * tier: "Standard", + * capacity: _var.instance_count, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * extensions: [{ + * name: "MSILinuxExtension", + * publisher: "Microsoft.ManagedIdentity", + * type: "ManagedIdentityExtensionForLinux", + * typeHandlerVersion: "1.0", + * settings: "{\"port\": 50342}", + * }], + * }); + * // ... + * export const principalId = example.identity.apply(identity => identity.principalId); + * ``` */ identityIds?: pulumi.Input[]>; principalId?: pulumi.Input; @@ -22263,6 +22290,19 @@ export namespace containerservice { * > **Note:** At this time ACI Connectors are not supported in Azure China. * * > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const virtual = new azure.network.Subnet("virtual", {delegations: [{ + * name: "aciDelegation", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/subnets/action"], + * name: "Microsoft.ContainerInstance/containerGroups", + * }, + * }]}); + * ``` */ subnetName: pulumi.Input; } @@ -33759,6 +33799,9 @@ export namespace keyvault { * > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. * * To convert a private key to pkcs8 format with openssl use: + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` * * The PEM content should look something like: */ @@ -33930,6 +33973,9 @@ export namespace keyvault { * > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. * * To convert a private key to pkcs8 format with openssl use: + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` * * The PEM content should look something like: */ @@ -41902,6 +41948,10 @@ export namespace network { * One or more `ipConfiguration` blocks as defined below. * * > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ ipConfigurations: pulumi.Input[]>; /** @@ -46244,6 +46294,10 @@ export namespace redis { * Second Storage Account connection string for AOF persistence. * * Example usage: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ aofStorageConnectionString1?: pulumi.Input; /** @@ -46274,6 +46328,10 @@ export namespace redis { maxmemoryReserved?: pulumi.Input; /** * Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ notifyKeyspaceEvents?: pulumi.Input; /** diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 8f8917ea46..f364ccde5b 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -25606,6 +25606,33 @@ export namespace compute { export interface ScaleSetIdentity { /** * Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = new azure.compute.ScaleSet("example", { + * resourceGroupName: azurerm_resource_group.example.name, + * location: azurerm_resource_group.example.location, + * sku: { + * name: _var.vm_sku, + * tier: "Standard", + * capacity: _var.instance_count, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * extensions: [{ + * name: "MSILinuxExtension", + * publisher: "Microsoft.ManagedIdentity", + * type: "ManagedIdentityExtensionForLinux", + * typeHandlerVersion: "1.0", + * settings: "{\"port\": 50342}", + * }], + * }); + * // ... + * export const principalId = example.identity.apply(identity => identity.principalId); + * ``` */ identityIds?: string[]; principalId: string; @@ -30109,6 +30136,19 @@ export namespace containerservice { * > **Note:** At this time ACI Connectors are not supported in Azure China. * * > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const virtual = new azure.network.Subnet("virtual", {delegations: [{ + * name: "aciDelegation", + * serviceDelegation: { + * actions: ["Microsoft.Network/virtualNetworks/subnets/action"], + * name: "Microsoft.ContainerInstance/containerGroups", + * }, + * }]}); + * ``` */ subnetName: string; } @@ -42654,6 +42694,9 @@ export namespace keyvault { * > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. * * To convert a private key to pkcs8 format with openssl use: + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` * * The PEM content should look something like: */ @@ -42825,6 +42868,9 @@ export namespace keyvault { * > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a privateKey in pkcs8 format. There should only be linux style `\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. * * To convert a private key to pkcs8 format with openssl use: + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` * * The PEM content should look something like: */ @@ -52652,6 +52698,10 @@ export namespace network { * One or more `ipConfiguration` blocks as defined below. * * > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ ipConfigurations: outputs.network.ApplicationGatewayPrivateLinkConfigurationIpConfiguration[]; /** @@ -58896,6 +58946,10 @@ export namespace redis { * Second Storage Account connection string for AOF persistence. * * Example usage: + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ aofStorageConnectionString1?: string; /** @@ -58926,6 +58980,10 @@ export namespace redis { maxmemoryReserved: number; /** * Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * ``` */ notifyKeyspaceEvents?: string; /** diff --git a/sdk/nodejs/videoanalyzer/analyzer.ts b/sdk/nodejs/videoanalyzer/analyzer.ts index 37cc5a0371..a2e2653faa 100644 --- a/sdk/nodejs/videoanalyzer/analyzer.ts +++ b/sdk/nodejs/videoanalyzer/analyzer.ts @@ -11,6 +11,55 @@ import * as utilities from "../utilities"; * * !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `azure.videoanalyzer.Analyzer` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const contributor = new azure.authorization.Assignment("contributor", { + * scope: exampleAccount.id, + * roleDefinitionName: "Storage Blob Data Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const reader = new azure.authorization.Assignment("reader", { + * scope: exampleAccount.id, + * roleDefinitionName: "Reader", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const exampleAnalyzer = new azure.videoanalyzer.Analyzer("exampleAnalyzer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccount: { + * id: exampleAccount.id, + * userAssignedIdentityId: exampleUserAssignedIdentity.id, + * }, + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * tags: { + * environment: "staging", + * }, + * }, { + * dependsOn: [ + * contributor, + * reader, + * ], + * }); + * ``` + * * ## Import * * Video Analyzer can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/videoanalyzer/edgeModule.ts b/sdk/nodejs/videoanalyzer/edgeModule.ts index 09e18b4d6a..34cd9746a1 100644 --- a/sdk/nodejs/videoanalyzer/edgeModule.ts +++ b/sdk/nodejs/videoanalyzer/edgeModule.ts @@ -9,6 +9,60 @@ import * as utilities from "../utilities"; * * !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `azure.videoanalyzer.EdgeModule` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleAccount = new azure.storage.Account("exampleAccount", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * accountTier: "Standard", + * accountReplicationType: "GRS", + * }); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const contributor = new azure.authorization.Assignment("contributor", { + * scope: exampleAccount.id, + * roleDefinitionName: "Storage Blob Data Contributor", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const reader = new azure.authorization.Assignment("reader", { + * scope: exampleAccount.id, + * roleDefinitionName: "Reader", + * principalId: exampleUserAssignedIdentity.principalId, + * }); + * const exampleAnalyzer = new azure.videoanalyzer.Analyzer("exampleAnalyzer", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * storageAccount: { + * id: exampleAccount.id, + * userAssignedIdentityId: exampleUserAssignedIdentity.id, + * }, + * identity: { + * type: "UserAssigned", + * identityIds: [exampleUserAssignedIdentity.id], + * }, + * tags: { + * environment: "staging", + * }, + * }, { + * dependsOn: [ + * exampleUserAssignedIdentity, + * contributor, + * reader, + * ], + * }); + * const exampleEdgeModule = new azure.videoanalyzer.EdgeModule("exampleEdgeModule", { + * resourceGroupName: exampleResourceGroup.name, + * videoAnalyzerName: exampleAnalyzer.name, + * }); + * ``` + * * ## Import * * Video Analyzer Edge Module can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/voice/servicesCommunicationsGateway.ts b/sdk/nodejs/voice/servicesCommunicationsGateway.ts index e9dbce1f14..931fa794cd 100644 --- a/sdk/nodejs/voice/servicesCommunicationsGateway.ts +++ b/sdk/nodejs/voice/servicesCommunicationsGateway.ts @@ -13,6 +13,53 @@ import * as utilities from "../utilities"; * * !> **NOTE:** Access to Azure Communications Gateway is restricted, see [`Get access to Azure Communications Gateway for your Azure subscription`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#9-get-access-to-azure-communications-gateway-for-your-azure-subscription) for details. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const exampleServicesCommunicationsGateway = new azure.voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", { + * location: "West Europe", + * resourceGroupName: exampleResourceGroup.name, + * connectivity: "PublicAddress", + * codecs: "PCMA", + * e911Type: "DirectToEsrp", + * platforms: [ + * "OperatorConnect", + * "TeamsPhoneMobile", + * ], + * serviceLocations: [ + * { + * location: "eastus", + * allowedMediaSourceAddressPrefixes: ["10.1.2.0/24"], + * allowedSignalingSourceAddressPrefixes: ["10.1.1.0/24"], + * esrpAddresses: ["198.51.100.3"], + * operatorAddresses: ["198.51.100.1"], + * }, + * { + * location: "eastus2", + * allowedMediaSourceAddressPrefixes: ["10.2.2.0/24"], + * allowedSignalingSourceAddressPrefixes: ["10.2.1.0/24"], + * esrpAddresses: ["198.51.100.4"], + * operatorAddresses: ["198.51.100.2"], + * }, + * ], + * autoGeneratedDomainNameLabelScope: "SubscriptionReuse", + * apiBridge: JSON.stringify({}), + * emergencyDialStrings: [ + * "911", + * "933", + * ], + * onPremMcpEnabled: false, + * tags: { + * key: "value", + * }, + * microsoftTeamsVoicemailPilotNumber: "1", + * }); + * ``` + * * ## Import * * Voice Services Communications Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/voice/servicesCommunicationsGatewayTestLine.ts b/sdk/nodejs/voice/servicesCommunicationsGatewayTestLine.ts index cfc34bd381..9d7e337e93 100644 --- a/sdk/nodejs/voice/servicesCommunicationsGatewayTestLine.ts +++ b/sdk/nodejs/voice/servicesCommunicationsGatewayTestLine.ts @@ -7,6 +7,25 @@ import * as utilities from "../utilities"; /** * Manages a Voice Services Communications Gateway Test Line. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Central US"}); + * const exampleServicesCommunicationsGateway = new azure.voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", {resourceGroupName: exampleResourceGroup.name}); + * const exampleServicesCommunicationsGatewayTestLine = new azure.voice.ServicesCommunicationsGatewayTestLine("exampleServicesCommunicationsGatewayTestLine", { + * location: "West Central US", + * voiceServicesCommunicationsGatewayId: exampleServicesCommunicationsGateway.id, + * phoneNumber: "123456789", + * purpose: "Automated", + * tags: { + * key: "value", + * }, + * }); + * ``` + * * ## Import * * Voice Services Communications Gateway Test Line can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/waf/getFirewallPolicy.ts b/sdk/nodejs/waf/getFirewallPolicy.ts index 9d2904d9e8..c319238f14 100644 --- a/sdk/nodejs/waf/getFirewallPolicy.ts +++ b/sdk/nodejs/waf/getFirewallPolicy.ts @@ -6,6 +6,19 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Web Application Firewall Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.waf.getFirewallPolicy({ + * resourceGroupName: "existing", + * name: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFirewallPolicy(args: GetFirewallPolicyArgs, opts?: pulumi.InvokeOptions): Promise { @@ -47,6 +60,19 @@ export interface GetFirewallPolicyResult { } /** * Use this data source to access information about an existing Web Application Firewall Policy. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.waf.getFirewallPolicy({ + * resourceGroupName: "existing", + * name: "existing", + * }); + * export const id = example.then(example => example.id); + * ``` */ export function getFirewallPolicyOutput(args: GetFirewallPolicyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getFirewallPolicy(a, opts)) diff --git a/sdk/nodejs/waf/policy.ts b/sdk/nodejs/waf/policy.ts index 449a52cc6b..46f6dd3b52 100644 --- a/sdk/nodejs/waf/policy.ts +++ b/sdk/nodejs/waf/policy.ts @@ -9,6 +9,103 @@ import * as utilities from "../utilities"; /** * Manages a Azure Web Application Firewall Policy instance. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"}); + * const examplePolicy = new azure.waf.Policy("examplePolicy", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * customRules: [ + * { + * name: "Rule1", + * priority: 1, + * ruleType: "MatchRule", + * matchConditions: [{ + * matchVariables: [{ + * variableName: "RemoteAddr", + * }], + * operator: "IPMatch", + * negationCondition: false, + * matchValues: [ + * "192.168.1.0/24", + * "10.0.0.0/24", + * ], + * }], + * action: "Block", + * }, + * { + * name: "Rule2", + * priority: 2, + * ruleType: "MatchRule", + * matchConditions: [ + * { + * matchVariables: [{ + * variableName: "RemoteAddr", + * }], + * operator: "IPMatch", + * negationCondition: false, + * matchValues: ["192.168.1.0/24"], + * }, + * { + * matchVariables: [{ + * variableName: "RequestHeaders", + * selector: "UserAgent", + * }], + * operator: "Contains", + * negationCondition: false, + * matchValues: ["Windows"], + * }, + * ], + * action: "Block", + * }, + * ], + * policySettings: { + * enabled: true, + * mode: "Prevention", + * requestBodyCheck: true, + * fileUploadLimitInMb: 100, + * maxRequestBodySizeInKb: 128, + * }, + * managedRules: { + * exclusions: [ + * { + * matchVariable: "RequestHeaderNames", + * selector: "x-company-secret-header", + * selectorMatchOperator: "Equals", + * }, + * { + * matchVariable: "RequestCookieNames", + * selector: "too-tasty", + * selectorMatchOperator: "EndsWith", + * }, + * ], + * managedRuleSets: [{ + * type: "OWASP", + * version: "3.2", + * ruleGroupOverrides: [{ + * ruleGroupName: "REQUEST-920-PROTOCOL-ENFORCEMENT", + * rules: [ + * { + * id: "920300", + * enabled: true, + * action: "Log", + * }, + * { + * id: "920440", + * enabled: true, + * action: "Block", + * }, + * ], + * }], + * }], + * }, + * }); + * ``` + * * ## Import * * Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/webpubsub/getPrivateLinkResource.ts b/sdk/nodejs/webpubsub/getPrivateLinkResource.ts index 46d7d7d7fa..c472ff2c2a 100644 --- a/sdk/nodejs/webpubsub/getPrivateLinkResource.ts +++ b/sdk/nodejs/webpubsub/getPrivateLinkResource.ts @@ -8,6 +8,24 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const testResourceGroup = new azure.core.ResourceGroup("testResourceGroup", {location: "east us"}); + * const testService = new azure.webpubsub.Service("testService", { + * location: testResourceGroup.location, + * resourceGroupName: testResourceGroup.name, + * sku: "Standard_S1", + * capacity: 1, + * }); + * const testPrivateLinkResource = azure.webpubsub.getPrivateLinkResourceOutput({ + * webPubsubId: testService.id, + * }); + * ``` */ export function getPrivateLinkResource(args: GetPrivateLinkResourceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -43,6 +61,24 @@ export interface GetPrivateLinkResourceResult { } /** * Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const testResourceGroup = new azure.core.ResourceGroup("testResourceGroup", {location: "east us"}); + * const testService = new azure.webpubsub.Service("testService", { + * location: testResourceGroup.location, + * resourceGroupName: testResourceGroup.name, + * sku: "Standard_S1", + * capacity: 1, + * }); + * const testPrivateLinkResource = azure.webpubsub.getPrivateLinkResourceOutput({ + * webPubsubId: testService.id, + * }); + * ``` */ export function getPrivateLinkResourceOutput(args: GetPrivateLinkResourceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getPrivateLinkResource(a, opts)) diff --git a/sdk/nodejs/webpubsub/getService.ts b/sdk/nodejs/webpubsub/getService.ts index 09386ff81e..cac7f2ffe5 100644 --- a/sdk/nodejs/webpubsub/getService.ts +++ b/sdk/nodejs/webpubsub/getService.ts @@ -6,6 +6,18 @@ import * as utilities from "../utilities"; /** * Use this data source to access information about an existing Azure Web Pubsub service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.webpubsub.getService({ + * name: "test-webpubsub", + * resourceGroupName: "wps-resource-group", + * }); + * ``` */ export function getService(args: GetServiceArgs, opts?: pulumi.InvokeOptions): Promise { @@ -84,6 +96,18 @@ export interface GetServiceResult { } /** * Use this data source to access information about an existing Azure Web Pubsub service. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const example = azure.webpubsub.getService({ + * name: "test-webpubsub", + * resourceGroupName: "wps-resource-group", + * }); + * ``` */ export function getServiceOutput(args: GetServiceOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { return pulumi.output(args).apply((a: any) => getService(a, opts)) diff --git a/sdk/nodejs/webpubsub/hub.ts b/sdk/nodejs/webpubsub/hub.ts index e2e90e510d..387951768f 100644 --- a/sdk/nodejs/webpubsub/hub.ts +++ b/sdk/nodejs/webpubsub/hub.ts @@ -9,6 +9,72 @@ import * as utilities from "../utilities"; /** * Manages the hub settings for a Web Pubsub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * }); + * const exampleService = new azure.webpubsub.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard_S1", + * capacity: 1, + * }); + * const exampleHub = new azure.webpubsub.Hub("exampleHub", { + * webPubsubId: exampleService.id, + * eventHandlers: [ + * { + * urlTemplate: "https://test.com/api/{hub}/{event}", + * userEventPattern: "*", + * systemEvents: [ + * "connect", + * "connected", + * ], + * }, + * { + * urlTemplate: "https://test.com/api/{hub}/{event}", + * userEventPattern: "event1, event2", + * systemEvents: ["connected"], + * auth: { + * managedIdentityId: exampleUserAssignedIdentity.id, + * }, + * }, + * ], + * eventListeners: [ + * { + * systemEventNameFilters: ["connected"], + * userEventNameFilters: [ + * "event1", + * "event2", + * ], + * eventhubNamespaceName: azurerm_eventhub_namespace.test.name, + * eventhubName: azurerm_eventhub.test1.name, + * }, + * { + * systemEventNameFilters: ["connected"], + * userEventNameFilters: ["*"], + * eventhubNamespaceName: azurerm_eventhub_namespace.test.name, + * eventhubName: azurerm_eventhub.test1.name, + * }, + * { + * systemEventNameFilters: ["connected"], + * userEventNameFilters: ["event1"], + * eventhubNamespaceName: azurerm_eventhub_namespace.test.name, + * eventhubName: azurerm_eventhub.test1.name, + * }, + * ], + * anonymousConnectionsEnabled: true, + * }, { + * dependsOn: [exampleService], + * }); + * ``` + * * ## Import * * Web Pubsub Hub can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/webpubsub/networkAcl.ts b/sdk/nodejs/webpubsub/networkAcl.ts index 72576f917c..a4224ee76e 100644 --- a/sdk/nodejs/webpubsub/networkAcl.ts +++ b/sdk/nodejs/webpubsub/networkAcl.ts @@ -9,6 +9,59 @@ import * as utilities from "../utilities"; /** * Manages the Network ACL for a Web Pubsub. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleService = new azure.webpubsub.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard_S1", + * capacity: 1, + * }); + * const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * addressSpaces: ["10.5.0.0/16"], + * }); + * const exampleSubnet = new azure.network.Subnet("exampleSubnet", { + * resourceGroupName: exampleResourceGroup.name, + * virtualNetworkName: exampleVirtualNetwork.name, + * addressPrefixes: ["10.5.2.0/24"], + * enforcePrivateLinkEndpointNetworkPolicies: true, + * }); + * const exampleEndpoint = new azure.privatelink.Endpoint("exampleEndpoint", { + * resourceGroupName: exampleResourceGroup.name, + * location: exampleResourceGroup.location, + * subnetId: exampleSubnet.id, + * privateServiceConnection: { + * name: "psc-sig-test", + * isManualConnection: false, + * privateConnectionResourceId: exampleService.id, + * subresourceNames: ["webpubsub"], + * }, + * }); + * const exampleNetworkAcl = new azure.webpubsub.NetworkAcl("exampleNetworkAcl", { + * webPubsubId: exampleService.id, + * defaultAction: "Allow", + * publicNetwork: { + * deniedRequestTypes: ["ClientConnection"], + * }, + * privateEndpoints: [{ + * id: exampleEndpoint.id, + * deniedRequestTypes: [ + * "RESTAPI", + * "ClientConnection", + * ], + * }], + * }, { + * dependsOn: [exampleEndpoint], + * }); + * ``` + * * ## Import * * Network ACLs for a Web Pubsub service can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/webpubsub/service.ts b/sdk/nodejs/webpubsub/service.ts index 2cea00a350..4fc2de380a 100644 --- a/sdk/nodejs/webpubsub/service.ts +++ b/sdk/nodejs/webpubsub/service.ts @@ -9,6 +9,30 @@ import * as utilities from "../utilities"; /** * Manages an Azure Web PubSub Service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleService = new azure.webpubsub.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard_S1", + * capacity: 1, + * publicNetworkAccessEnabled: false, + * liveTrace: { + * enabled: true, + * messagingLogsEnabled: true, + * connectivityLogsEnabled: false, + * }, + * identity: { + * type: "SystemAssigned", + * }, + * }); + * ``` + * * ## Import * * Web PubSub services can be imported using the `resource id`, e.g. diff --git a/sdk/nodejs/webpubsub/sharedPrivateLinkResource.ts b/sdk/nodejs/webpubsub/sharedPrivateLinkResource.ts index 07f22f6f9d..1986fbc4df 100644 --- a/sdk/nodejs/webpubsub/sharedPrivateLinkResource.ts +++ b/sdk/nodejs/webpubsub/sharedPrivateLinkResource.ts @@ -7,6 +7,41 @@ import * as utilities from "../utilities"; /** * Manages the Shared Private Link Resource for a Web Pubsub service. * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as azure from "@pulumi/azure"; + * + * const current = azure.core.getClientConfig({}); + * const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "east us"}); + * const exampleKeyVault = new azure.keyvault.KeyVault("exampleKeyVault", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * tenantId: current.then(current => current.tenantId), + * skuName: "standard", + * softDeleteRetentionDays: 7, + * accessPolicies: [{ + * tenantId: current.then(current => current.tenantId), + * objectId: current.then(current => current.objectId), + * certificatePermissions: ["managecontacts"], + * keyPermissions: ["create"], + * secretPermissions: ["set"], + * }], + * }); + * const exampleService = new azure.webpubsub.Service("exampleService", { + * location: exampleResourceGroup.location, + * resourceGroupName: exampleResourceGroup.name, + * sku: "Standard_S1", + * capacity: 1, + * }); + * const exampleSharedPrivateLinkResource = new azure.webpubsub.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", { + * webPubsubId: exampleService.id, + * subresourceName: "vault", + * targetResourceId: exampleKeyVault.id, + * }); + * ``` + * * ## Import * * Web Pubsub Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/aadb2c/directory.py b/sdk/python/pulumi_azure/aadb2c/directory.py index eeae1af4cb..c259b3c656 100644 --- a/sdk/python/pulumi_azure/aadb2c/directory.py +++ b/sdk/python/pulumi_azure/aadb2c/directory.py @@ -401,6 +401,21 @@ def __init__(__self__, """ Manages an AAD B2C Directory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.aadb2c.Directory("example", + country_code="US", + data_residency_location="United States", + display_name="example-b2c-tenant", + domain_name="exampleb2ctenant.onmicrosoft.com", + resource_group_name="example-rg", + sku_name="PremiumP1") + ``` + ## Import AAD B2C Directories can be imported using the `resource id`, e.g. @@ -428,6 +443,21 @@ def __init__(__self__, """ Manages an AAD B2C Directory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.aadb2c.Directory("example", + country_code="US", + data_residency_location="United States", + display_name="example-b2c-tenant", + domain_name="exampleb2ctenant.onmicrosoft.com", + resource_group_name="example-rg", + sku_name="PremiumP1") + ``` + ## Import AAD B2C Directories can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/aadb2c/get_directory.py b/sdk/python/pulumi_azure/aadb2c/get_directory.py index 291b61a602..7a8e4233a0 100644 --- a/sdk/python/pulumi_azure/aadb2c/get_directory.py +++ b/sdk/python/pulumi_azure/aadb2c/get_directory.py @@ -140,6 +140,17 @@ def get_directory(domain_name: Optional[str] = None, """ Use this data source to access information about an existing AAD B2C Directory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.aadb2c.get_directory(resource_group_name="example-rg", + domain_name="exampleb2ctenant.onmicrosoft.com") + pulumi.export("tenantId", example.tenant_id) + ``` + :param str domain_name: Domain name of the B2C tenant, including the `.onmicrosoft.com` suffix. :param str resource_group_name: The name of the Resource Group where the AAD B2C Directory exists. @@ -169,6 +180,17 @@ def get_directory_output(domain_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing AAD B2C Directory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.aadb2c.get_directory(resource_group_name="example-rg", + domain_name="exampleb2ctenant.onmicrosoft.com") + pulumi.export("tenantId", example.tenant_id) + ``` + :param str domain_name: Domain name of the B2C tenant, including the `.onmicrosoft.com` suffix. :param str resource_group_name: The name of the Resource Group where the AAD B2C Directory exists. diff --git a/sdk/python/pulumi_azure/advisor/get_recommendations.py b/sdk/python/pulumi_azure/advisor/get_recommendations.py index d64eaa1acd..9023034e97 100644 --- a/sdk/python/pulumi_azure/advisor/get_recommendations.py +++ b/sdk/python/pulumi_azure/advisor/get_recommendations.py @@ -81,6 +81,20 @@ def get_recommendations(filter_by_categories: Optional[Sequence[str]] = None, """ Use this data source to access information about an existing Advisor Recommendations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.advisor.get_recommendations(filter_by_categories=[ + "security", + "cost", + ], + filter_by_resource_groups=["example-resgroups"]) + pulumi.export("recommendations", example.recommendations) + ``` + :param Sequence[str] filter_by_categories: Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are `HighAvailability`, `Security`, `Performance`, `Cost` and `OperationalExcellence`. :param Sequence[str] filter_by_resource_groups: Specifies a list of resource groups about which the Advisor Recommendations will be listed. @@ -105,6 +119,20 @@ def get_recommendations_output(filter_by_categories: Optional[pulumi.Input[Optio """ Use this data source to access information about an existing Advisor Recommendations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.advisor.get_recommendations(filter_by_categories=[ + "security", + "cost", + ], + filter_by_resource_groups=["example-resgroups"]) + pulumi.export("recommendations", example.recommendations) + ``` + :param Sequence[str] filter_by_categories: Specifies a list of categories in which the Advisor Recommendations will be listed. Possible values are `HighAvailability`, `Security`, `Performance`, `Cost` and `OperationalExcellence`. :param Sequence[str] filter_by_resource_groups: Specifies a list of resource groups about which the Advisor Recommendations will be listed. diff --git a/sdk/python/pulumi_azure/analysisservices/server.py b/sdk/python/pulumi_azure/analysisservices/server.py index 849c9f6d1b..6b45b66c6a 100644 --- a/sdk/python/pulumi_azure/analysisservices/server.py +++ b/sdk/python/pulumi_azure/analysisservices/server.py @@ -472,6 +472,31 @@ def __init__(__self__, """ Manages an Analysis Services Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + server = azure.analysisservices.Server("server", + location=example.location, + resource_group_name=example.name, + sku="S0", + admin_users=["myuser@domain.tld"], + enable_power_bi_service=True, + ipv4_firewall_rules=[azure.analysisservices.ServerIpv4FirewallRuleArgs( + name="myRule1", + range_start="210.117.252.0", + range_end="210.117.252.255", + )], + tags={ + "abc": "123", + }) + ``` + + > **NOTE:** The server resource will automatically be started and stopped during an update if it is in `paused` state. + ## Import Analysis Services Server can be imported using the `resource id`, e.g. @@ -502,6 +527,31 @@ def __init__(__self__, """ Manages an Analysis Services Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + server = azure.analysisservices.Server("server", + location=example.location, + resource_group_name=example.name, + sku="S0", + admin_users=["myuser@domain.tld"], + enable_power_bi_service=True, + ipv4_firewall_rules=[azure.analysisservices.ServerIpv4FirewallRuleArgs( + name="myRule1", + range_start="210.117.252.0", + range_end="210.117.252.255", + )], + tags={ + "abc": "123", + }) + ``` + + > **NOTE:** The server resource will automatically be started and stopped during an update if it is in `paused` state. + ## Import Analysis Services Server can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api.py b/sdk/python/pulumi_azure/apimanagement/api.py index 6b98916930..2b272e6fc3 100644 --- a/sdk/python/pulumi_azure/apimanagement/api.py +++ b/sdk/python/pulumi_azure/apimanagement/api.py @@ -1087,6 +1087,32 @@ def __init__(__self__, """ Manages an API within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1", + display_name="Example API", + path="example", + protocols=["https"], + import_=azure.apimanagement.ApiImportArgs( + content_format="swagger-link-json", + content_value="http://conferenceapi.azurewebsites.net/?format=json", + )) + ``` + ## Import API Management API's can be imported using the `resource id`, e.g. @@ -1137,6 +1163,32 @@ def __init__(__self__, """ Manages an API within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1", + display_name="Example API", + path="example", + protocols=["https"], + import_=azure.apimanagement.ApiImportArgs( + content_format="swagger-link-json", + content_value="http://conferenceapi.azurewebsites.net/?format=json", + )) + ``` + ## Import API Management API's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_diagnostic.py b/sdk/python/pulumi_azure/apimanagement/api_diagnostic.py index 19d75a8f4b..ceac839c11 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_diagnostic.py +++ b/sdk/python/pulumi_azure/apimanagement/api_diagnostic.py @@ -668,6 +668,85 @@ def __init__(__self__, """ Manages a API Management Service API Diagnostics Logs. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1", + display_name="Example API", + path="example", + protocols=["https"], + import_=azure.apimanagement.ApiImportArgs( + content_format="swagger-link-json", + content_value="http://conferenceapi.azurewebsites.net/?format=json", + )) + example_logger = azure.apimanagement.Logger("exampleLogger", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + application_insights=azure.apimanagement.LoggerApplicationInsightsArgs( + instrumentation_key=example_insights.instrumentation_key, + )) + example_api_diagnostic = azure.apimanagement.ApiDiagnostic("exampleApiDiagnostic", + identifier="applicationinsights", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + api_name=example_api.name, + api_management_logger_id=example_logger.id, + sampling_percentage=5, + always_log_errors=True, + log_client_ip=True, + verbosity="verbose", + http_correlation_protocol="W3C", + frontend_request=azure.apimanagement.ApiDiagnosticFrontendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + frontend_response=azure.apimanagement.ApiDiagnosticFrontendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + ), + backend_request=azure.apimanagement.ApiDiagnosticBackendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + backend_response=azure.apimanagement.ApiDiagnosticBackendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + )) + ``` + ## Import API Management Service API Diagnostics Logs can be imported using the `resource id`, e.g. @@ -703,6 +782,85 @@ def __init__(__self__, """ Manages a API Management Service API Diagnostics Logs. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1", + display_name="Example API", + path="example", + protocols=["https"], + import_=azure.apimanagement.ApiImportArgs( + content_format="swagger-link-json", + content_value="http://conferenceapi.azurewebsites.net/?format=json", + )) + example_logger = azure.apimanagement.Logger("exampleLogger", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + application_insights=azure.apimanagement.LoggerApplicationInsightsArgs( + instrumentation_key=example_insights.instrumentation_key, + )) + example_api_diagnostic = azure.apimanagement.ApiDiagnostic("exampleApiDiagnostic", + identifier="applicationinsights", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + api_name=example_api.name, + api_management_logger_id=example_logger.id, + sampling_percentage=5, + always_log_errors=True, + log_client_ip=True, + verbosity="verbose", + http_correlation_protocol="W3C", + frontend_request=azure.apimanagement.ApiDiagnosticFrontendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + frontend_response=azure.apimanagement.ApiDiagnosticFrontendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + ), + backend_request=azure.apimanagement.ApiDiagnosticBackendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + backend_response=azure.apimanagement.ApiDiagnosticBackendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + )) + ``` + ## Import API Management Service API Diagnostics Logs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_operation.py b/sdk/python/pulumi_azure/apimanagement/api_operation.py index 2ffd1fb933..fb8468537d 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_operation.py +++ b/sdk/python/pulumi_azure/apimanagement/api_operation.py @@ -498,6 +498,30 @@ def __init__(__self__, """ Manages an API Operation within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + example_api_operation = azure.apimanagement.ApiOperation("exampleApiOperation", + operation_id="user-delete", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + display_name="Delete User Operation", + method="DELETE", + url_template="/users/{id}/delete", + description="This can only be done by the logged in user.", + responses=[azure.apimanagement.ApiOperationResponseArgs( + status_code=200, + )]) + ``` + ## Import API Management API Operation's can be imported using the `resource id`, e.g. @@ -529,6 +553,30 @@ def __init__(__self__, """ Manages an API Operation within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + example_api_operation = azure.apimanagement.ApiOperation("exampleApiOperation", + operation_id="user-delete", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + display_name="Delete User Operation", + method="DELETE", + url_template="/users/{id}/delete", + description="This can only be done by the logged in user.", + responses=[azure.apimanagement.ApiOperationResponseArgs( + status_code=200, + )]) + ``` + ## Import API Management API Operation's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_operation_policy.py b/sdk/python/pulumi_azure/apimanagement/api_operation_policy.py index 04213c8116..b25aca4e04 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_operation_policy.py +++ b/sdk/python/pulumi_azure/apimanagement/api_operation_policy.py @@ -304,6 +304,44 @@ def __init__(__self__, """ Manages an API Management API Operation Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1") + example_api_operation = azure.apimanagement.ApiOperation("exampleApiOperation", + operation_id="acctest-operation", + api_name=example_api.name, + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + display_name="DELETE Resource", + method="DELETE", + url_template="/resource") + example_api_operation_policy = azure.apimanagement.ApiOperationPolicy("exampleApiOperationPolicy", + api_name=example_api_operation.api_name, + api_management_name=example_api_operation.api_management_name, + resource_group_name=example_api_operation.resource_group_name, + operation_id=example_api_operation.operation_id, + xml_content=\"\"\" + + + + + \"\"\") + ``` + ## Import API Management API Operation Policy can be imported using the `resource id`, e.g. @@ -330,6 +368,44 @@ def __init__(__self__, """ Manages an API Management API Operation Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1") + example_api_operation = azure.apimanagement.ApiOperation("exampleApiOperation", + operation_id="acctest-operation", + api_name=example_api.name, + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + display_name="DELETE Resource", + method="DELETE", + url_template="/resource") + example_api_operation_policy = azure.apimanagement.ApiOperationPolicy("exampleApiOperationPolicy", + api_name=example_api_operation.api_name, + api_management_name=example_api_operation.api_management_name, + resource_group_name=example_api_operation.resource_group_name, + operation_id=example_api_operation.operation_id, + xml_content=\"\"\" + + + + + \"\"\") + ``` + ## Import API Management API Operation Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_operation_tag.py b/sdk/python/pulumi_azure/apimanagement/api_operation_tag.py index c25784fbf5..90ee72fd74 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_operation_tag.py +++ b/sdk/python/pulumi_azure/apimanagement/api_operation_tag.py @@ -175,6 +175,33 @@ def __init__(__self__, """ Manages a API Management API Operation Tag. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + example_api_operation = azure.apimanagement.ApiOperation("exampleApiOperation", + operation_id="user-delete", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + display_name="Delete User Operation", + method="DELETE", + url_template="/users/{id}/delete", + description="This can only be done by the logged in user.", + responses=[azure.apimanagement.ApiOperationResponseArgs( + status_code=200, + )]) + example_api_operation_tag = azure.apimanagement.ApiOperationTag("exampleApiOperationTag", + api_operation_id=example_api_operation.id, + display_name="example-Tag") + ``` + ## Import API Management API Operation Tags can be imported using the `resource id`, e.g. @@ -198,6 +225,33 @@ def __init__(__self__, """ Manages a API Management API Operation Tag. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + example_api_operation = azure.apimanagement.ApiOperation("exampleApiOperation", + operation_id="user-delete", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + display_name="Delete User Operation", + method="DELETE", + url_template="/users/{id}/delete", + description="This can only be done by the logged in user.", + responses=[azure.apimanagement.ApiOperationResponseArgs( + status_code=200, + )]) + example_api_operation_tag = azure.apimanagement.ApiOperationTag("exampleApiOperationTag", + api_operation_id=example_api_operation.id, + display_name="example-Tag") + ``` + ## Import API Management API Operation Tags can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_policy.py b/sdk/python/pulumi_azure/apimanagement/api_policy.py index c745cf26b1..7e9acae883 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_policy.py +++ b/sdk/python/pulumi_azure/apimanagement/api_policy.py @@ -262,6 +262,28 @@ def __init__(__self__, """ Manages an API Management API Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="my-api", + api_management_name="example-apim", + resource_group_name="search-service", + revision="2") + example_api_policy = azure.apimanagement.ApiPolicy("exampleApiPolicy", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + xml_content=\"\"\" + + + + + \"\"\") + ``` + ## Import API Management API Policy can be imported using the `resource id`, e.g. @@ -287,6 +309,28 @@ def __init__(__self__, """ Manages an API Management API Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="my-api", + api_management_name="example-apim", + resource_group_name="search-service", + revision="2") + example_api_policy = azure.apimanagement.ApiPolicy("exampleApiPolicy", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + xml_content=\"\"\" + + + + + \"\"\") + ``` + ## Import API Management API Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_release.py b/sdk/python/pulumi_azure/apimanagement/api_release.py index be3ee242cd..8922f83ff4 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_release.py +++ b/sdk/python/pulumi_azure/apimanagement/api_release.py @@ -170,6 +170,33 @@ def __init__(__self__, """ Manages a API Management API Release. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1", + display_name="Example API", + path="example", + protocols=["https"], + import_=azure.apimanagement.ApiImportArgs( + content_format="swagger-link-json", + content_value="http://conferenceapi.azurewebsites.net/?format=json", + )) + example_api_release = azure.apimanagement.ApiRelease("exampleApiRelease", api_id=example_api.id) + ``` + ## Import API Management API Releases can be imported using the `resource id`, e.g. @@ -193,6 +220,33 @@ def __init__(__self__, """ Manages a API Management API Release. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1", + display_name="Example API", + path="example", + protocols=["https"], + import_=azure.apimanagement.ApiImportArgs( + content_format="swagger-link-json", + content_value="http://conferenceapi.azurewebsites.net/?format=json", + )) + example_api_release = azure.apimanagement.ApiRelease("exampleApiRelease", api_id=example_api.id) + ``` + ## Import API Management API Releases can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_schema.py b/sdk/python/pulumi_azure/apimanagement/api_schema.py index 552f09aa51..e6269509a1 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_schema.py +++ b/sdk/python/pulumi_azure/apimanagement/api_schema.py @@ -375,6 +375,25 @@ def __init__(__self__, """ Manages an API Schema within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + example_api_schema = azure.apimanagement.ApiSchema("exampleApiSchema", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + schema_id="example-schema", + content_type="application/vnd.ms-azure-apim.xsd+xml", + value=(lambda path: open(path).read())("api_management_api_schema.xml")) + ``` + ## Import API Management API Schema's can be imported using the `resource id`, e.g. @@ -403,6 +422,25 @@ def __init__(__self__, """ Manages an API Schema within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + example_api_schema = azure.apimanagement.ApiSchema("exampleApiSchema", + api_name=example_api.name, + api_management_name=example_api.api_management_name, + resource_group_name=example_api.resource_group_name, + schema_id="example-schema", + content_type="application/vnd.ms-azure-apim.xsd+xml", + value=(lambda path: open(path).read())("api_management_api_schema.xml")) + ``` + ## Import API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_tag.py b/sdk/python/pulumi_azure/apimanagement/api_tag.py index 17dd422515..bfd149c703 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_tag.py +++ b/sdk/python/pulumi_azure/apimanagement/api_tag.py @@ -133,6 +133,23 @@ def __init__(__self__, """ Manages the Assignment of an API Management API Tag to an API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.get_service_output(name="example-apim", + resource_group_name=example_resource_group.name) + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1") + example_tag = azure.apimanagement.Tag("exampleTag", api_management_id=example_service.id) + example_api_tag = azure.apimanagement.ApiTag("exampleApiTag", api_id=example_api.id) + ``` + ## Import API Management API Tags can be imported using the `resource id`, e.g. @@ -155,6 +172,23 @@ def __init__(__self__, """ Manages the Assignment of an API Management API Tag to an API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.get_service_output(name="example-apim", + resource_group_name=example_resource_group.name) + example_api = azure.apimanagement.Api("exampleApi", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + revision="1") + example_tag = azure.apimanagement.Tag("exampleTag", api_management_id=example_service.id) + example_api_tag = azure.apimanagement.ApiTag("exampleApiTag", api_id=example_api.id) + ``` + ## Import API Management API Tags can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/api_version_set.py b/sdk/python/pulumi_azure/apimanagement/api_version_set.py index bca9fdb2ac..ac0b73b104 100644 --- a/sdk/python/pulumi_azure/apimanagement/api_version_set.py +++ b/sdk/python/pulumi_azure/apimanagement/api_version_set.py @@ -394,6 +394,26 @@ def __init__(__self__, """ Manages an API Version Set within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_api_version_set = azure.apimanagement.ApiVersionSet("exampleApiVersionSet", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="ExampleAPIVersionSet", + versioning_scheme="Segment") + ``` + ## Import API Version Set can be imported using the `resource id`, e.g. @@ -426,6 +446,26 @@ def __init__(__self__, """ Manages an API Version Set within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_api_version_set = azure.apimanagement.ApiVersionSet("exampleApiVersionSet", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="ExampleAPIVersionSet", + versioning_scheme="Segment") + ``` + ## Import API Version Set can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/authorization_server.py b/sdk/python/pulumi_azure/apimanagement/authorization_server.py index f353055d7d..ab4d387a4d 100644 --- a/sdk/python/pulumi_azure/apimanagement/authorization_server.py +++ b/sdk/python/pulumi_azure/apimanagement/authorization_server.py @@ -859,6 +859,25 @@ def __init__(__self__, """ Manages an Authorization Server within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="search-api", + resource_group_name="search-service") + example_authorization_server = azure.apimanagement.AuthorizationServer("exampleAuthorizationServer", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + display_name="Test Server", + authorization_endpoint="https://example.mydomain.com/client/authorize", + client_id="42424242-4242-4242-4242-424242424242", + client_registration_endpoint="https://example.mydomain.com/client/register", + grant_types=["authorizationCode"], + authorization_methods=["GET"]) + ``` + ## Import API Management Authorization Servers can be imported using the `resource id`, e.g. @@ -904,6 +923,25 @@ def __init__(__self__, """ Manages an Authorization Server within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="search-api", + resource_group_name="search-service") + example_authorization_server = azure.apimanagement.AuthorizationServer("exampleAuthorizationServer", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + display_name="Test Server", + authorization_endpoint="https://example.mydomain.com/client/authorize", + client_id="42424242-4242-4242-4242-424242424242", + client_registration_endpoint="https://example.mydomain.com/client/register", + grant_types=["authorizationCode"], + authorization_methods=["GET"]) + ``` + ## Import API Management Authorization Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/backend.py b/sdk/python/pulumi_azure/apimanagement/backend.py index bff959f5a3..a9e4cd1ab8 100644 --- a/sdk/python/pulumi_azure/apimanagement/backend.py +++ b/sdk/python/pulumi_azure/apimanagement/backend.py @@ -520,6 +520,26 @@ def __init__(__self__, """ Manages a backend within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_backend = azure.apimanagement.Backend("exampleBackend", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + protocol="http", + url="https://backend") + ``` + ## Import API Management backends can be imported using the `resource id`, e.g. @@ -552,6 +572,26 @@ def __init__(__self__, """ Manages a backend within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_backend = azure.apimanagement.Backend("exampleBackend", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + protocol="http", + url="https://backend") + ``` + ## Import API Management backends can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/certificate.py b/sdk/python/pulumi_azure/apimanagement/certificate.py index 9471bd6d57..38c0defe10 100644 --- a/sdk/python/pulumi_azure/apimanagement/certificate.py +++ b/sdk/python/pulumi_azure/apimanagement/certificate.py @@ -410,6 +410,79 @@ def __init__(__self__, Manages an Certificate within an API Management Service. ## Example Usage + ### With Base64 Certificate) + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_certificate = azure.apimanagement.Certificate("exampleCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.pfx")) + ``` + ### With Key Vault Certificate) + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1", + identity=azure.apimanagement.ServiceIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_service.identity.tenant_id, + object_id=example_service.identity.principal_id, + secret_permissions=["Get"], + certificate_permissions=["Get"]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example_cert.pfx"), + password="terraform", + ), + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=False, + ), + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + )) + example_apimanagement_certificate_certificate = azure.apimanagement.Certificate("exampleApimanagement/certificateCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + key_vault_secret_id=example_certificate.secret_id) + ``` ## Import @@ -445,6 +518,79 @@ def __init__(__self__, Manages an Certificate within an API Management Service. ## Example Usage + ### With Base64 Certificate) + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_certificate = azure.apimanagement.Certificate("exampleCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.pfx")) + ``` + ### With Key Vault Certificate) + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1", + identity=azure.apimanagement.ServiceIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_service.identity.tenant_id, + object_id=example_service.identity.principal_id, + secret_permissions=["Get"], + certificate_permissions=["Get"]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example_cert.pfx"), + password="terraform", + ), + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=False, + ), + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + )) + example_apimanagement_certificate_certificate = azure.apimanagement.Certificate("exampleApimanagement/certificateCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + key_vault_secret_id=example_certificate.secret_id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/apimanagement/custom_domain.py b/sdk/python/pulumi_azure/apimanagement/custom_domain.py index 99a328d241..b967cdea61 100644 --- a/sdk/python/pulumi_azure/apimanagement/custom_domain.py +++ b/sdk/python/pulumi_azure/apimanagement/custom_domain.py @@ -291,6 +291,75 @@ def __init__(__self__, > **Note:** It's possible to define Custom Domains both within the `apimanagement.Service` resource via the `hostname_configurations` block and by using this resource. However it's not possible to use both methods to manage Custom Domains within an API Management Service, since there will be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.get_key_vault(name="mykeyvault", + resource_group_name="some-resource-group") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject="CN=api.example.com", + validity_in_months=12, + subject_alternative_names=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs( + dns_names=[ + "api.example.com", + "portal.example.com", + ], + ), + ), + )) + example_custom_domain = azure.apimanagement.CustomDomain("exampleCustomDomain", + api_management_id=example_service.id, + gateways=[azure.apimanagement.CustomDomainGatewayArgs( + host_name="api.example.com", + key_vault_id=example_certificate.versionless_secret_id, + )], + developer_portals=[azure.apimanagement.CustomDomainDeveloperPortalArgs( + host_name="portal.example.com", + key_vault_id=example_certificate.versionless_secret_id, + )]) + ``` + ## Import API Management Custom Domains can be imported using the `resource id`, e.g. @@ -321,6 +390,75 @@ def __init__(__self__, > **Note:** It's possible to define Custom Domains both within the `apimanagement.Service` resource via the `hostname_configurations` block and by using this resource. However it's not possible to use both methods to manage Custom Domains within an API Management Service, since there will be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.get_key_vault(name="mykeyvault", + resource_group_name="some-resource-group") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject="CN=api.example.com", + validity_in_months=12, + subject_alternative_names=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs( + dns_names=[ + "api.example.com", + "portal.example.com", + ], + ), + ), + )) + example_custom_domain = azure.apimanagement.CustomDomain("exampleCustomDomain", + api_management_id=example_service.id, + gateways=[azure.apimanagement.CustomDomainGatewayArgs( + host_name="api.example.com", + key_vault_id=example_certificate.versionless_secret_id, + )], + developer_portals=[azure.apimanagement.CustomDomainDeveloperPortalArgs( + host_name="portal.example.com", + key_vault_id=example_certificate.versionless_secret_id, + )]) + ``` + ## Import API Management Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/diagnostic.py b/sdk/python/pulumi_azure/apimanagement/diagnostic.py index dc739882ab..be30430a3c 100644 --- a/sdk/python/pulumi_azure/apimanagement/diagnostic.py +++ b/sdk/python/pulumi_azure/apimanagement/diagnostic.py @@ -626,6 +626,73 @@ def __init__(__self__, """ Manages an API Management Service Diagnostic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_logger = azure.apimanagement.Logger("exampleLogger", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + application_insights=azure.apimanagement.LoggerApplicationInsightsArgs( + instrumentation_key=example_insights.instrumentation_key, + )) + example_diagnostic = azure.apimanagement.Diagnostic("exampleDiagnostic", + identifier="applicationinsights", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + api_management_logger_id=example_logger.id, + sampling_percentage=5, + always_log_errors=True, + log_client_ip=True, + verbosity="verbose", + http_correlation_protocol="W3C", + frontend_request=azure.apimanagement.DiagnosticFrontendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + frontend_response=azure.apimanagement.DiagnosticFrontendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + ), + backend_request=azure.apimanagement.DiagnosticBackendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + backend_response=azure.apimanagement.DiagnosticBackendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + )) + ``` + ## Import API Management Diagnostics can be imported using the `resource id`, e.g. @@ -660,6 +727,73 @@ def __init__(__self__, """ Manages an API Management Service Diagnostic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_logger = azure.apimanagement.Logger("exampleLogger", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + application_insights=azure.apimanagement.LoggerApplicationInsightsArgs( + instrumentation_key=example_insights.instrumentation_key, + )) + example_diagnostic = azure.apimanagement.Diagnostic("exampleDiagnostic", + identifier="applicationinsights", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + api_management_logger_id=example_logger.id, + sampling_percentage=5, + always_log_errors=True, + log_client_ip=True, + verbosity="verbose", + http_correlation_protocol="W3C", + frontend_request=azure.apimanagement.DiagnosticFrontendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + frontend_response=azure.apimanagement.DiagnosticFrontendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + ), + backend_request=azure.apimanagement.DiagnosticBackendRequestArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "accept", + "origin", + ], + ), + backend_response=azure.apimanagement.DiagnosticBackendResponseArgs( + body_bytes=32, + headers_to_logs=[ + "content-type", + "content-length", + "origin", + ], + )) + ``` + ## Import API Management Diagnostics can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/email_template.py b/sdk/python/pulumi_azure/apimanagement/email_template.py index f698c6e948..1b83b07afc 100644 --- a/sdk/python/pulumi_azure/apimanagement/email_template.py +++ b/sdk/python/pulumi_azure/apimanagement/email_template.py @@ -300,6 +300,37 @@ def __init__(__self__, """ Manages a API Management Email Template. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_email_template = azure.apimanagement.EmailTemplate("exampleEmailTemplate", + template_name="ConfirmSignUpIdentityDefault", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + subject="Customized confirmation email for your new $OrganizationName API account", + body=\"\"\" + + + + Customized Letter Title + + +

Dear $DevFirstName $DevLastName,

+ + + \"\"\") + ``` + ## Import API Management Email Templates can be imported using the `resource id`, e.g. @@ -327,6 +358,37 @@ def __init__(__self__, """ Manages a API Management Email Template. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_email_template = azure.apimanagement.EmailTemplate("exampleEmailTemplate", + template_name="ConfirmSignUpIdentityDefault", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + subject="Customized confirmation email for your new $OrganizationName API account", + body=\"\"\" + + + + Customized Letter Title + + +

Dear $DevFirstName $DevLastName,

+ + + \"\"\") + ``` + ## Import API Management Email Templates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/gateway.py b/sdk/python/pulumi_azure/apimanagement/gateway.py index 06fa4b572f..6bf15352f6 100644 --- a/sdk/python/pulumi_azure/apimanagement/gateway.py +++ b/sdk/python/pulumi_azure/apimanagement/gateway.py @@ -214,6 +214,30 @@ def __init__(__self__, """ Manages an API Management Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_gateway = azure.apimanagement.Gateway("exampleGateway", + api_management_id=example_service.id, + description="Example API Management gateway", + location_data=azure.apimanagement.GatewayLocationDataArgs( + name="example name", + city="example city", + district="example district", + region="example region", + )) + ``` + ## Import API Management Gateways can be imported using the `resource id`, e.g. @@ -238,6 +262,30 @@ def __init__(__self__, """ Manages an API Management Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_gateway = azure.apimanagement.Gateway("exampleGateway", + api_management_id=example_service.id, + description="Example API Management gateway", + location_data=azure.apimanagement.GatewayLocationDataArgs( + name="example name", + city="example city", + district="example district", + region="example region", + )) + ``` + ## Import API Management Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/gateway_api.py b/sdk/python/pulumi_azure/apimanagement/gateway_api.py index 67e12d2b1e..f20d280fae 100644 --- a/sdk/python/pulumi_azure/apimanagement/gateway_api.py +++ b/sdk/python/pulumi_azure/apimanagement/gateway_api.py @@ -138,6 +138,25 @@ def __init__(__self__, """ Manages a API Management Gateway API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-api", + resource_group_name="example-resources") + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + revision="2") + example_gateway = azure.apimanagement.get_gateway(name="example-gateway", + api_management_id=example_service.id) + example_gateway_api = azure.apimanagement.GatewayApi("exampleGatewayApi", + gateway_id=example_gateway.id, + api_id=example_api.id) + ``` + ## Import API Management Gateway APIs can be imported using the `resource id`, e.g. @@ -160,6 +179,25 @@ def __init__(__self__, """ Manages a API Management Gateway API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-api", + resource_group_name="example-resources") + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + revision="2") + example_gateway = azure.apimanagement.get_gateway(name="example-gateway", + api_management_id=example_service.id) + example_gateway_api = azure.apimanagement.GatewayApi("exampleGatewayApi", + gateway_id=example_gateway.id, + api_id=example_api.id) + ``` + ## Import API Management Gateway APIs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/gateway_certificate_authority.py b/sdk/python/pulumi_azure/apimanagement/gateway_certificate_authority.py index d8fba3f98c..880502ed01 100644 --- a/sdk/python/pulumi_azure/apimanagement/gateway_certificate_authority.py +++ b/sdk/python/pulumi_azure/apimanagement/gateway_certificate_authority.py @@ -221,6 +221,40 @@ def __init__(__self__, """ Manages an API Management Gateway Certificate Authority. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_gateway = azure.apimanagement.Gateway("exampleGateway", + api_management_id=example_service.id, + description="Example API Management gateway", + location_data=azure.apimanagement.GatewayLocationDataArgs( + name="example name", + city="example city", + district="example district", + region="example region", + )) + example_certificate = azure.apimanagement.Certificate("exampleCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.pfx")) + example_gateway_certificate_authority = azure.apimanagement.GatewayCertificateAuthority("exampleGatewayCertificateAuthority", + api_management_id=example_service.id, + certificate_name=example_certificate.name, + gateway_name=example_gateway.name, + is_trusted=True) + ``` + ## Import API Management Gateway Certificate Authority can be imported using the `resource id`, e.g. @@ -245,6 +279,40 @@ def __init__(__self__, """ Manages an API Management Gateway Certificate Authority. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_gateway = azure.apimanagement.Gateway("exampleGateway", + api_management_id=example_service.id, + description="Example API Management gateway", + location_data=azure.apimanagement.GatewayLocationDataArgs( + name="example name", + city="example city", + district="example district", + region="example region", + )) + example_certificate = azure.apimanagement.Certificate("exampleCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.pfx")) + example_gateway_certificate_authority = azure.apimanagement.GatewayCertificateAuthority("exampleGatewayCertificateAuthority", + api_management_id=example_service.id, + certificate_name=example_certificate.name, + gateway_name=example_gateway.name, + is_trusted=True) + ``` + ## Import API Management Gateway Certificate Authority can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/gateway_host_name_configuration.py b/sdk/python/pulumi_azure/apimanagement/gateway_host_name_configuration.py index 0e1c4daa2d..81c6ef68a4 100644 --- a/sdk/python/pulumi_azure/apimanagement/gateway_host_name_configuration.py +++ b/sdk/python/pulumi_azure/apimanagement/gateway_host_name_configuration.py @@ -423,6 +423,44 @@ def __init__(__self__, """ Manages an API Management Gateway Host Name Configuration. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_gateway = azure.apimanagement.Gateway("exampleGateway", + api_management_id=example_service.id, + description="Example API Management gateway", + location_data=azure.apimanagement.GatewayLocationDataArgs( + name="example name", + city="example city", + district="example district", + region="example region", + )) + example_certificate = azure.apimanagement.Certificate("exampleCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.pfx")) + example_gateway_host_name_configuration = azure.apimanagement.GatewayHostNameConfiguration("exampleGatewayHostNameConfiguration", + api_management_id=example_service.id, + gateway_name=example_gateway.name, + certificate_id=example_certificate.id, + host_name="example-host-name", + request_client_certificate_enabled=True, + http2_enabled=True, + tls10_enabled=True, + tls11_enabled=False) + ``` + ## Import API Management Gateway Host Name Configuration can be imported using the `resource id`, e.g. @@ -452,6 +490,44 @@ def __init__(__self__, """ Manages an API Management Gateway Host Name Configuration. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_gateway = azure.apimanagement.Gateway("exampleGateway", + api_management_id=example_service.id, + description="Example API Management gateway", + location_data=azure.apimanagement.GatewayLocationDataArgs( + name="example name", + city="example city", + district="example district", + region="example region", + )) + example_certificate = azure.apimanagement.Certificate("exampleCertificate", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + data=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.pfx")) + example_gateway_host_name_configuration = azure.apimanagement.GatewayHostNameConfiguration("exampleGatewayHostNameConfiguration", + api_management_id=example_service.id, + gateway_name=example_gateway.name, + certificate_id=example_certificate.id, + host_name="example-host-name", + request_client_certificate_enabled=True, + http2_enabled=True, + tls10_enabled=True, + tls11_enabled=False) + ``` + ## Import API Management Gateway Host Name Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/get_api.py b/sdk/python/pulumi_azure/apimanagement/get_api.py index a45223ef9b..957c94b759 100644 --- a/sdk/python/pulumi_azure/apimanagement/get_api.py +++ b/sdk/python/pulumi_azure/apimanagement/get_api.py @@ -233,6 +233,19 @@ def get_api(api_management_name: Optional[str] = None, """ Use this data source to access information about an existing API Management API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + pulumi.export("apiManagementApiId", example.id) + ``` + :param str api_management_name: The name of the API Management Service in which the API Management API exists. :param str name: The name of the API Management API. @@ -276,6 +289,19 @@ def get_api_output(api_management_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing API Management API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_api(name="search-api", + api_management_name="search-api-management", + resource_group_name="search-service", + revision="2") + pulumi.export("apiManagementApiId", example.id) + ``` + :param str api_management_name: The name of the API Management Service in which the API Management API exists. :param str name: The name of the API Management API. diff --git a/sdk/python/pulumi_azure/apimanagement/get_api_version_set.py b/sdk/python/pulumi_azure/apimanagement/get_api_version_set.py index b71e5233f7..4d86915118 100644 --- a/sdk/python/pulumi_azure/apimanagement/get_api_version_set.py +++ b/sdk/python/pulumi_azure/apimanagement/get_api_version_set.py @@ -135,6 +135,18 @@ def get_api_version_set(api_management_name: Optional[str] = None, """ Uses this data source to access information about an API Version Set within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_api_version_set(resource_group_name="example-resources", + api_management_name="example-api", + name="example-api-version-set") + pulumi.export("apiManagementApiVersionSetId", example.id) + ``` + :param str api_management_name: The name of the API Management Service where the API Version Set exists. :param str name: The name of the API Version Set. @@ -167,6 +179,18 @@ def get_api_version_set_output(api_management_name: Optional[pulumi.Input[str]] """ Uses this data source to access information about an API Version Set within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_api_version_set(resource_group_name="example-resources", + api_management_name="example-api", + name="example-api-version-set") + pulumi.export("apiManagementApiVersionSetId", example.id) + ``` + :param str api_management_name: The name of the API Management Service where the API Version Set exists. :param str name: The name of the API Version Set. diff --git a/sdk/python/pulumi_azure/apimanagement/get_gateway.py b/sdk/python/pulumi_azure/apimanagement/get_gateway.py index f09525546e..4352410173 100644 --- a/sdk/python/pulumi_azure/apimanagement/get_gateway.py +++ b/sdk/python/pulumi_azure/apimanagement/get_gateway.py @@ -96,6 +96,18 @@ def get_gateway(api_management_id: Optional[str] = None, """ Use this data source to access information about an existing API Management Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-apim", + resource_group_name="example-rg") + example_gateway = azure.apimanagement.get_gateway(name="example-api-gateway", + api_management_id=example_service.id) + ``` + :param str api_management_id: The ID of the API Management Service in which the Gateway exists. :param str name: The name of the API Management Gateway. @@ -121,6 +133,18 @@ def get_gateway_output(api_management_id: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing API Management Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-apim", + resource_group_name="example-rg") + example_gateway = azure.apimanagement.get_gateway(name="example-api-gateway", + api_management_id=example_service.id) + ``` + :param str api_management_id: The ID of the API Management Service in which the Gateway exists. :param str name: The name of the API Management Gateway. diff --git a/sdk/python/pulumi_azure/apimanagement/get_gateway_host_name_configuration.py b/sdk/python/pulumi_azure/apimanagement/get_gateway_host_name_configuration.py index 39dc5b2e38..2c2d8561e8 100644 --- a/sdk/python/pulumi_azure/apimanagement/get_gateway_host_name_configuration.py +++ b/sdk/python/pulumi_azure/apimanagement/get_gateway_host_name_configuration.py @@ -150,6 +150,22 @@ def get_gateway_host_name_configuration(api_management_id: Optional[str] = None, """ Use this data source to access information about an existing API Management Gateway Host Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-apim", + resource_group_name="example-resources") + example_gateway = azure.apimanagement.get_gateway(name="example-gateway", + api_management_id=data["azurerm_api_management"]["main"]["id"]) + example_gateway_host_name_configuration = azure.apimanagement.get_gateway_host_name_configuration(name="example-host-configuration", + api_management_id=example_service.id, + gateway_name=example_gateway.name) + pulumi.export("hostName", example_gateway_host_name_configuration.host_name) + ``` + :param str api_management_id: The ID of the API Management Service. :param str gateway_name: The name of the API Management Gateway. @@ -184,6 +200,22 @@ def get_gateway_host_name_configuration_output(api_management_id: Optional[pulum """ Use this data source to access information about an existing API Management Gateway Host Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-apim", + resource_group_name="example-resources") + example_gateway = azure.apimanagement.get_gateway(name="example-gateway", + api_management_id=data["azurerm_api_management"]["main"]["id"]) + example_gateway_host_name_configuration = azure.apimanagement.get_gateway_host_name_configuration(name="example-host-configuration", + api_management_id=example_service.id, + gateway_name=example_gateway.name) + pulumi.export("hostName", example_gateway_host_name_configuration.host_name) + ``` + :param str api_management_id: The ID of the API Management Service. :param str gateway_name: The name of the API Management Gateway. diff --git a/sdk/python/pulumi_azure/apimanagement/get_group.py b/sdk/python/pulumi_azure/apimanagement/get_group.py index 7b60fa87ca..4d6c0d36a0 100644 --- a/sdk/python/pulumi_azure/apimanagement/get_group.py +++ b/sdk/python/pulumi_azure/apimanagement/get_group.py @@ -126,6 +126,18 @@ def get_group(api_management_name: Optional[str] = None, """ Use this data source to access information about an existing API Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_group(name="my-group", + api_management_name="example-apim", + resource_group_name="search-service") + pulumi.export("groupType", example.type) + ``` + :param str api_management_name: The Name of the API Management Service in which this Group exists. :param str name: The Name of the API Management Group. @@ -157,6 +169,18 @@ def get_group_output(api_management_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing API Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_group(name="my-group", + api_management_name="example-apim", + resource_group_name="search-service") + pulumi.export("groupType", example.type) + ``` + :param str api_management_name: The Name of the API Management Service in which this Group exists. :param str name: The Name of the API Management Group. diff --git a/sdk/python/pulumi_azure/apimanagement/get_product.py b/sdk/python/pulumi_azure/apimanagement/get_product.py index d0cd9088d1..7ec4dfec5f 100644 --- a/sdk/python/pulumi_azure/apimanagement/get_product.py +++ b/sdk/python/pulumi_azure/apimanagement/get_product.py @@ -162,6 +162,18 @@ def get_product(api_management_name: Optional[str] = None, """ Use this data source to access information about an existing API Management Product. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_product(product_id="my-product", + api_management_name="example-apim", + resource_group_name="search-service") + pulumi.export("productTerms", example.terms) + ``` + :param str api_management_name: The Name of the API Management Service in which this Product exists. :param str product_id: The Identifier for the API Management Product. @@ -196,6 +208,18 @@ def get_product_output(api_management_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing API Management Product. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_product(product_id="my-product", + api_management_name="example-apim", + resource_group_name="search-service") + pulumi.export("productTerms", example.terms) + ``` + :param str api_management_name: The Name of the API Management Service in which this Product exists. :param str product_id: The Identifier for the API Management Product. diff --git a/sdk/python/pulumi_azure/apimanagement/get_service.py b/sdk/python/pulumi_azure/apimanagement/get_service.py index aaeb8f7ddf..9c9cd7e248 100644 --- a/sdk/python/pulumi_azure/apimanagement/get_service.py +++ b/sdk/python/pulumi_azure/apimanagement/get_service.py @@ -298,6 +298,17 @@ def get_service(name: Optional[str] = None, """ Use this data source to access information about an existing API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_service(name="search-api", + resource_group_name="search-service") + pulumi.export("apiManagementId", example.id) + ``` + :param str name: The name of the API Management service. :param str resource_group_name: The Name of the Resource Group in which the API Management Service exists. @@ -343,6 +354,17 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.apimanagement.get_service(name="search-api", + resource_group_name="search-service") + pulumi.export("apiManagementId", example.id) + ``` + :param str name: The name of the API Management service. :param str resource_group_name: The Name of the Resource Group in which the API Management Service exists. diff --git a/sdk/python/pulumi_azure/apimanagement/global_schema.py b/sdk/python/pulumi_azure/apimanagement/global_schema.py index 77a5373b9f..8df5d1d760 100644 --- a/sdk/python/pulumi_azure/apimanagement/global_schema.py +++ b/sdk/python/pulumi_azure/apimanagement/global_schema.py @@ -293,6 +293,27 @@ def __init__(__self__, """ Manages a Global Schema within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_global_schema = azure.apimanagement.GlobalSchema("exampleGlobalSchema", + schema_id="example-schema1", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + type="xml", + value=(lambda path: open(path).read())("api_management_api_schema.xml")) + ``` + ## Import API Management API Schema's can be imported using the `resource id`, e.g. @@ -319,6 +340,27 @@ def __init__(__self__, """ Manages a Global Schema within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_global_schema = azure.apimanagement.GlobalSchema("exampleGlobalSchema", + schema_id="example-schema1", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + type="xml", + value=(lambda path: open(path).read())("api_management_api_schema.xml")) + ``` + ## Import API Management API Schema's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/group.py b/sdk/python/pulumi_azure/apimanagement/group.py index 36ec8f8fc9..0333acfa7a 100644 --- a/sdk/python/pulumi_azure/apimanagement/group.py +++ b/sdk/python/pulumi_azure/apimanagement/group.py @@ -332,6 +332,26 @@ def __init__(__self__, """ Manages an API Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_group = azure.apimanagement.Group("exampleGroup", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="Example Group", + description="This is an example API management group.") + ``` + ## Import API Management Groups can be imported using the `resource id`, e.g. @@ -359,6 +379,26 @@ def __init__(__self__, """ Manages an API Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_group = azure.apimanagement.Group("exampleGroup", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="Example Group", + description="This is an example API management group.") + ``` + ## Import API Management Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/group_user.py b/sdk/python/pulumi_azure/apimanagement/group_user.py index c38d918ff0..807659563e 100644 --- a/sdk/python/pulumi_azure/apimanagement/group_user.py +++ b/sdk/python/pulumi_azure/apimanagement/group_user.py @@ -222,6 +222,22 @@ def __init__(__self__, """ Manages an API Management User Assignment to a Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_user = azure.apimanagement.get_user(user_id="my-user", + api_management_name="example-apim", + resource_group_name="search-service") + example_group_user = azure.apimanagement.GroupUser("exampleGroupUser", + user_id=example_user.id, + group_name="example-group", + resource_group_name=example_user.resource_group_name, + api_management_name=example_user.api_management_name) + ``` + ## Import API Management Group Users can be imported using the `resource id`, e.g. @@ -246,6 +262,22 @@ def __init__(__self__, """ Manages an API Management User Assignment to a Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_user = azure.apimanagement.get_user(user_id="my-user", + api_management_name="example-apim", + resource_group_name="search-service") + example_group_user = azure.apimanagement.GroupUser("exampleGroupUser", + user_id=example_user.id, + group_name="example-group", + resource_group_name=example_user.resource_group_name, + api_management_name=example_user.api_management_name) + ``` + ## Import API Management Group Users can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/identity_provider_aad.py b/sdk/python/pulumi_azure/apimanagement/identity_provider_aad.py index df01866518..08b6f443c6 100644 --- a/sdk/python/pulumi_azure/apimanagement/identity_provider_aad.py +++ b/sdk/python/pulumi_azure/apimanagement/identity_provider_aad.py @@ -305,6 +305,27 @@ def __init__(__self__, """ Manages an API Management AAD Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_aad = azure.apimanagement.IdentityProviderAad("exampleIdentityProviderAad", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id="00000000-0000-0000-0000-000000000000", + client_secret="00000000000000000000000000000000", + allowed_tenants=["00000000-0000-0000-0000-000000000000"]) + ``` + ## Import API Management AAD Identity Provider can be imported using the `resource id`, e.g. @@ -331,6 +352,27 @@ def __init__(__self__, """ Manages an API Management AAD Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_aad = azure.apimanagement.IdentityProviderAad("exampleIdentityProviderAad", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id="00000000-0000-0000-0000-000000000000", + client_secret="00000000000000000000000000000000", + allowed_tenants=["00000000-0000-0000-0000-000000000000"]) + ``` + ## Import API Management AAD Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/identity_provider_aadb2c.py b/sdk/python/pulumi_azure/apimanagement/identity_provider_aadb2c.py index c630dc8dd8..3f152be07a 100644 --- a/sdk/python/pulumi_azure/apimanagement/identity_provider_aadb2c.py +++ b/sdk/python/pulumi_azure/apimanagement/identity_provider_aadb2c.py @@ -510,6 +510,37 @@ def __init__(__self__, """ Manages an API Management Azure AD B2C Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_application = azuread.Application("exampleApplication", display_name="acctestam-example") + example_application_password = azuread.ApplicationPassword("exampleApplicationPassword", + application_object_id=example_application.object_id, + end_date_relative="36h") + example_identity_provider_aadb2c = azure.apimanagement.IdentityProviderAadb2c("exampleIdentityProviderAadb2c", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id=example_application.application_id, + client_secret="P@55w0rD!", + allowed_tenant="myb2ctenant.onmicrosoft.com", + signin_tenant="myb2ctenant.onmicrosoft.com", + authority="myb2ctenant.b2clogin.com", + signin_policy="B2C_1_Login", + signup_policy="B2C_1_Signup", + opts=pulumi.ResourceOptions(depends_on=[example_application_password])) + ``` + ## Import API Management Azure AD B2C Identity Providers can be imported using the `resource id`, e.g. @@ -541,6 +572,37 @@ def __init__(__self__, """ Manages an API Management Azure AD B2C Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_application = azuread.Application("exampleApplication", display_name="acctestam-example") + example_application_password = azuread.ApplicationPassword("exampleApplicationPassword", + application_object_id=example_application.object_id, + end_date_relative="36h") + example_identity_provider_aadb2c = azure.apimanagement.IdentityProviderAadb2c("exampleIdentityProviderAadb2c", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id=example_application.application_id, + client_secret="P@55w0rD!", + allowed_tenant="myb2ctenant.onmicrosoft.com", + signin_tenant="myb2ctenant.onmicrosoft.com", + authority="myb2ctenant.b2clogin.com", + signin_policy="B2C_1_Login", + signup_policy="B2C_1_Signup", + opts=pulumi.ResourceOptions(depends_on=[example_application_password])) + ``` + ## Import API Management Azure AD B2C Identity Providers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/identity_provider_facebook.py b/sdk/python/pulumi_azure/apimanagement/identity_provider_facebook.py index a48a4024c3..23db8ae07d 100644 --- a/sdk/python/pulumi_azure/apimanagement/identity_provider_facebook.py +++ b/sdk/python/pulumi_azure/apimanagement/identity_provider_facebook.py @@ -222,6 +222,26 @@ def __init__(__self__, """ Manages an API Management Facebook Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_facebook = azure.apimanagement.IdentityProviderFacebook("exampleIdentityProviderFacebook", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + app_id="00000000000000000000000000000000", + app_secret="00000000000000000000000000000000") + ``` + ## Import API Management Facebook Identity Provider can be imported using the `resource id`, e.g. @@ -246,6 +266,26 @@ def __init__(__self__, """ Manages an API Management Facebook Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_facebook = azure.apimanagement.IdentityProviderFacebook("exampleIdentityProviderFacebook", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + app_id="00000000000000000000000000000000", + app_secret="00000000000000000000000000000000") + ``` + ## Import API Management Facebook Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/identity_provider_google.py b/sdk/python/pulumi_azure/apimanagement/identity_provider_google.py index 447d72acdc..02aebc5377 100644 --- a/sdk/python/pulumi_azure/apimanagement/identity_provider_google.py +++ b/sdk/python/pulumi_azure/apimanagement/identity_provider_google.py @@ -222,6 +222,26 @@ def __init__(__self__, """ Manages an API Management Google Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_google = azure.apimanagement.IdentityProviderGoogle("exampleIdentityProviderGoogle", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id="00000000.apps.googleusercontent.com", + client_secret="00000000000000000000000000000000") + ``` + ## Import API Management Google Identity Provider can be imported using the `resource id`, e.g. @@ -246,6 +266,26 @@ def __init__(__self__, """ Manages an API Management Google Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_google = azure.apimanagement.IdentityProviderGoogle("exampleIdentityProviderGoogle", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id="00000000.apps.googleusercontent.com", + client_secret="00000000000000000000000000000000") + ``` + ## Import API Management Google Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/identity_provider_microsoft.py b/sdk/python/pulumi_azure/apimanagement/identity_provider_microsoft.py index 62f79fc0a6..76da27dd7d 100644 --- a/sdk/python/pulumi_azure/apimanagement/identity_provider_microsoft.py +++ b/sdk/python/pulumi_azure/apimanagement/identity_provider_microsoft.py @@ -222,6 +222,26 @@ def __init__(__self__, """ Manages an API Management Microsoft Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_microsoft = azure.apimanagement.IdentityProviderMicrosoft("exampleIdentityProviderMicrosoft", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id="00000000-0000-0000-0000-000000000000", + client_secret="00000000000000000000000000000000") + ``` + ## Import API Management Microsoft Identity Provider can be imported using the `resource id`, e.g. @@ -246,6 +266,26 @@ def __init__(__self__, """ Manages an API Management Microsoft Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_microsoft = azure.apimanagement.IdentityProviderMicrosoft("exampleIdentityProviderMicrosoft", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + client_id="00000000-0000-0000-0000-000000000000", + client_secret="00000000000000000000000000000000") + ``` + ## Import API Management Microsoft Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/identity_provider_twitter.py b/sdk/python/pulumi_azure/apimanagement/identity_provider_twitter.py index e550d4ffc7..8ccf3df12a 100644 --- a/sdk/python/pulumi_azure/apimanagement/identity_provider_twitter.py +++ b/sdk/python/pulumi_azure/apimanagement/identity_provider_twitter.py @@ -222,6 +222,26 @@ def __init__(__self__, """ Manages an API Management Twitter Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_twitter = azure.apimanagement.IdentityProviderTwitter("exampleIdentityProviderTwitter", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + api_key="00000000000000000000000000000000", + api_secret_key="00000000000000000000000000000000") + ``` + ## Import API Management Twitter Identity Provider can be imported using the `resource id`, e.g. @@ -246,6 +266,26 @@ def __init__(__self__, """ Manages an API Management Twitter Identity Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@mycompany.io", + sku_name="Developer_1") + example_identity_provider_twitter = azure.apimanagement.IdentityProviderTwitter("exampleIdentityProviderTwitter", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + api_key="00000000000000000000000000000000", + api_secret_key="00000000000000000000000000000000") + ``` + ## Import API Management Twitter Identity Provider can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/logger.py b/sdk/python/pulumi_azure/apimanagement/logger.py index 1f6263dbc5..640c02d384 100644 --- a/sdk/python/pulumi_azure/apimanagement/logger.py +++ b/sdk/python/pulumi_azure/apimanagement/logger.py @@ -370,6 +370,32 @@ def __init__(__self__, """ Manages a Logger within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="other") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_logger = azure.apimanagement.Logger("exampleLogger", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + resource_id=example_insights.id, + application_insights=azure.apimanagement.LoggerApplicationInsightsArgs( + instrumentation_key=example_insights.instrumentation_key, + )) + ``` + ## Import API Management Loggers can be imported using the `resource id`, e.g. @@ -398,6 +424,32 @@ def __init__(__self__, """ Manages a Logger within an API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="other") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_logger = azure.apimanagement.Logger("exampleLogger", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + resource_id=example_insights.id, + application_insights=azure.apimanagement.LoggerApplicationInsightsArgs( + instrumentation_key=example_insights.instrumentation_key, + )) + ``` + ## Import API Management Loggers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/named_value.py b/sdk/python/pulumi_azure/apimanagement/named_value.py index 26dbc7df4a..cbf3638cf8 100644 --- a/sdk/python/pulumi_azure/apimanagement/named_value.py +++ b/sdk/python/pulumi_azure/apimanagement/named_value.py @@ -379,6 +379,26 @@ def __init__(__self__, """ Manages an API Management Named Value. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_named_value = azure.apimanagement.NamedValue("exampleNamedValue", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="ExampleProperty", + value="Example Value") + ``` + ## Import API Management Properties can be imported using the `resource id`, e.g. @@ -409,6 +429,26 @@ def __init__(__self__, """ Manages an API Management Named Value. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_named_value = azure.apimanagement.NamedValue("exampleNamedValue", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="ExampleProperty", + value="Example Value") + ``` + ## Import API Management Properties can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/notification_recipient_email.py b/sdk/python/pulumi_azure/apimanagement/notification_recipient_email.py index 75d6904dfc..9d7cda56a8 100644 --- a/sdk/python/pulumi_azure/apimanagement/notification_recipient_email.py +++ b/sdk/python/pulumi_azure/apimanagement/notification_recipient_email.py @@ -176,6 +176,25 @@ def __init__(__self__, """ Manages a API Management Notification Recipient Email. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_notification_recipient_email = azure.apimanagement.NotificationRecipientEmail("exampleNotificationRecipientEmail", + api_management_id=example_service.id, + notification_type="AccountClosedPublisher", + email="foo@bar.com") + ``` + ## Import API Management Notification Recipient Emails can be imported using the `resource id`, e.g. @@ -199,6 +218,25 @@ def __init__(__self__, """ Manages a API Management Notification Recipient Email. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_notification_recipient_email = azure.apimanagement.NotificationRecipientEmail("exampleNotificationRecipientEmail", + api_management_id=example_service.id, + notification_type="AccountClosedPublisher", + email="foo@bar.com") + ``` + ## Import API Management Notification Recipient Emails can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/notification_recipient_user.py b/sdk/python/pulumi_azure/apimanagement/notification_recipient_user.py index 7783e867d3..c46519f6fa 100644 --- a/sdk/python/pulumi_azure/apimanagement/notification_recipient_user.py +++ b/sdk/python/pulumi_azure/apimanagement/notification_recipient_user.py @@ -180,6 +180,33 @@ def __init__(__self__, """ Manages a API Management Notification Recipient User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_user = azure.apimanagement.User("exampleUser", + user_id="123", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + first_name="Example", + last_name="User", + email="foo@bar.com", + state="active") + example_notification_recipient_user = azure.apimanagement.NotificationRecipientUser("exampleNotificationRecipientUser", + api_management_id=example_service.id, + notification_type="AccountClosedPublisher", + user_id=example_user.user_id) + ``` + ## Import API Management Notification Recipient Users can be imported using the `resource id`, e.g. @@ -203,6 +230,33 @@ def __init__(__self__, """ Manages a API Management Notification Recipient User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_user = azure.apimanagement.User("exampleUser", + user_id="123", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + first_name="Example", + last_name="User", + email="foo@bar.com", + state="active") + example_notification_recipient_user = azure.apimanagement.NotificationRecipientUser("exampleNotificationRecipientUser", + api_management_id=example_service.id, + notification_type="AccountClosedPublisher", + user_id=example_user.user_id) + ``` + ## Import API Management Notification Recipient Users can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/open_id_connect_provider.py b/sdk/python/pulumi_azure/apimanagement/open_id_connect_provider.py index d165086cc3..e39199bed2 100644 --- a/sdk/python/pulumi_azure/apimanagement/open_id_connect_provider.py +++ b/sdk/python/pulumi_azure/apimanagement/open_id_connect_provider.py @@ -380,6 +380,28 @@ def __init__(__self__, """ Manages an OpenID Connect Provider within a API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_open_id_connect_provider = azure.apimanagement.OpenIdConnectProvider("exampleOpenIdConnectProvider", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + client_id="00001111-2222-3333-4444-555566667777", + client_secret="00001111-423egvwdcsjx-00001111", + display_name="Example Provider", + metadata_endpoint="https://example.com/example") + ``` + ## Import API Management OpenID Connect Providers can be imported using the `resource id`, e.g. @@ -408,6 +430,28 @@ def __init__(__self__, """ Manages an OpenID Connect Provider within a API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_open_id_connect_provider = azure.apimanagement.OpenIdConnectProvider("exampleOpenIdConnectProvider", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + client_id="00001111-2222-3333-4444-555566667777", + client_secret="00001111-423egvwdcsjx-00001111", + display_name="Example Provider", + metadata_endpoint="https://example.com/example") + ``` + ## Import API Management OpenID Connect Providers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/policy.py b/sdk/python/pulumi_azure/apimanagement/policy.py index cf09ce3b51..eb6952fac7 100644 --- a/sdk/python/pulumi_azure/apimanagement/policy.py +++ b/sdk/python/pulumi_azure/apimanagement/policy.py @@ -180,6 +180,29 @@ def __init__(__self__, > **NOTE:** This resource will, upon creation, **overwrite any existing policy in the API Management service**, as there is no feasible way to test whether the policy has been modified from the default. Similarly, when this resource is destroyed, the API Management service will revert to its default policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_named_value = azure.apimanagement.NamedValue("exampleNamedValue", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="ExampleProperty", + value="Example Value") + example_policy = azure.apimanagement.Policy("examplePolicy", + api_management_id=example_service.id, + xml_content=(lambda path: open(path).read())("example.xml")) + ``` + ## Import API Management service Policys can be imported using the `resource id`, e.g. @@ -205,6 +228,29 @@ def __init__(__self__, > **NOTE:** This resource will, upon creation, **overwrite any existing policy in the API Management service**, as there is no feasible way to test whether the policy has been modified from the default. Similarly, when this resource is destroyed, the API Management service will revert to its default policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Developer_1") + example_named_value = azure.apimanagement.NamedValue("exampleNamedValue", + resource_group_name=example_resource_group.name, + api_management_name=example_service.name, + display_name="ExampleProperty", + value="Example Value") + example_policy = azure.apimanagement.Policy("examplePolicy", + api_management_id=example_service.id, + xml_content=(lambda path: open(path).read())("example.xml")) + ``` + ## Import API Management service Policys can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/product.py b/sdk/python/pulumi_azure/apimanagement/product.py index 9cd2c6e99b..9f8a87ed0e 100644 --- a/sdk/python/pulumi_azure/apimanagement/product.py +++ b/sdk/python/pulumi_azure/apimanagement/product.py @@ -473,6 +473,29 @@ def __init__(__self__, """ Manages an API Management Product. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_product = azure.apimanagement.Product("exampleProduct", + product_id="test-product", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + display_name="Test Product", + subscription_required=True, + approval_required=True, + published=True) + ``` + ## Import API Management Products can be imported using the `resource id`, e.g. @@ -507,6 +530,29 @@ def __init__(__self__, """ Manages an API Management Product. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_product = azure.apimanagement.Product("exampleProduct", + product_id="test-product", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + display_name="Test Product", + subscription_required=True, + approval_required=True, + published=True) + ``` + ## Import API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/product_api.py b/sdk/python/pulumi_azure/apimanagement/product_api.py index 65126ff427..5c0cd8bacd 100644 --- a/sdk/python/pulumi_azure/apimanagement/product_api.py +++ b/sdk/python/pulumi_azure/apimanagement/product_api.py @@ -222,6 +222,28 @@ def __init__(__self__, """ Manages an API Management API Assignment to a Product. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-api", + resource_group_name="example-resources") + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + revision="2") + example_product = azure.apimanagement.get_product(product_id="my-product", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_product_api = azure.apimanagement.ProductApi("exampleProductApi", + api_name=example_api.name, + product_id=example_product.product_id, + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + ``` + ## Import API Management Product API's can be imported using the `resource id`, e.g. @@ -246,6 +268,28 @@ def __init__(__self__, """ Manages an API Management API Assignment to a Product. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-api", + resource_group_name="example-resources") + example_api = azure.apimanagement.get_api(name="search-api", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + revision="2") + example_product = azure.apimanagement.get_product(product_id="my-product", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_product_api = azure.apimanagement.ProductApi("exampleProductApi", + api_name=example_api.name, + product_id=example_product.product_id, + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + ``` + ## Import API Management Product API's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/product_group.py b/sdk/python/pulumi_azure/apimanagement/product_group.py index 1a6669df76..7b4a219c95 100644 --- a/sdk/python/pulumi_azure/apimanagement/product_group.py +++ b/sdk/python/pulumi_azure/apimanagement/product_group.py @@ -222,6 +222,27 @@ def __init__(__self__, """ Manages an API Management Product Assignment to a Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-api", + resource_group_name="example-resources") + example_product = azure.apimanagement.get_product(product_id="my-product", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_group = azure.apimanagement.get_group(name="my-group", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_product_group = azure.apimanagement.ProductGroup("exampleProductGroup", + product_id=example_product.product_id, + group_name=example_group.name, + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + ``` + ## Import API Management Product Groups can be imported using the `resource id`, e.g. @@ -246,6 +267,27 @@ def __init__(__self__, """ Manages an API Management Product Assignment to a Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-api", + resource_group_name="example-resources") + example_product = azure.apimanagement.get_product(product_id="my-product", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_group = azure.apimanagement.get_group(name="my-group", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_product_group = azure.apimanagement.ProductGroup("exampleProductGroup", + product_id=example_product.product_id, + group_name=example_group.name, + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + ``` + ## Import API Management Product Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/product_policy.py b/sdk/python/pulumi_azure/apimanagement/product_policy.py index dde53fa07b..8cb8962aae 100644 --- a/sdk/python/pulumi_azure/apimanagement/product_policy.py +++ b/sdk/python/pulumi_azure/apimanagement/product_policy.py @@ -262,6 +262,27 @@ def __init__(__self__, """ Manages an API Management Product Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_product = azure.apimanagement.get_product(product_id="my-product", + api_management_name="example-apim", + resource_group_name="search-service") + example_product_policy = azure.apimanagement.ProductPolicy("exampleProductPolicy", + product_id=example_product.product_id, + api_management_name=example_product.api_management_name, + resource_group_name=example_product.resource_group_name, + xml_content=\"\"\" + + + + + \"\"\") + ``` + ## Import API Management Product Policy can be imported using the `resource id`, e.g. @@ -287,6 +308,27 @@ def __init__(__self__, """ Manages an API Management Product Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_product = azure.apimanagement.get_product(product_id="my-product", + api_management_name="example-apim", + resource_group_name="search-service") + example_product_policy = azure.apimanagement.ProductPolicy("exampleProductPolicy", + product_id=example_product.product_id, + api_management_name=example_product.api_management_name, + resource_group_name=example_product.resource_group_name, + xml_content=\"\"\" + + + + + \"\"\") + ``` + ## Import API Management Product Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/product_tag.py b/sdk/python/pulumi_azure/apimanagement/product_tag.py index 96bab205e6..62985f10ec 100644 --- a/sdk/python/pulumi_azure/apimanagement/product_tag.py +++ b/sdk/python/pulumi_azure/apimanagement/product_tag.py @@ -217,6 +217,34 @@ def __init__(__self__, """ Manages an API Management Product tag + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_product = azure.apimanagement.Product("exampleProduct", + product_id="test-product", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + display_name="Test Product", + subscription_required=True, + approval_required=True, + published=True) + example_tag = azure.apimanagement.Tag("exampleTag", api_management_id=example_service.id) + example_product_tag = azure.apimanagement.ProductTag("exampleProductTag", + api_management_product_id=example_product.product_id, + api_management_name=example_service.name, + resource_group_name=example_resource_group.name) + ``` + ## Import API Management Products can be imported using the `resource id`, e.g. @@ -241,6 +269,34 @@ def __init__(__self__, """ Manages an API Management Product tag + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Developer_1") + example_product = azure.apimanagement.Product("exampleProduct", + product_id="test-product", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + display_name="Test Product", + subscription_required=True, + approval_required=True, + published=True) + example_tag = azure.apimanagement.Tag("exampleTag", api_management_id=example_service.id) + example_product_tag = azure.apimanagement.ProductTag("exampleProductTag", + api_management_product_id=example_product.product_id, + api_management_name=example_service.name, + resource_group_name=example_resource_group.name) + ``` + ## Import API Management Products can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/redis_cache.py b/sdk/python/pulumi_azure/apimanagement/redis_cache.py index 8b390a4e04..8b637ef700 100644 --- a/sdk/python/pulumi_azure/apimanagement/redis_cache.py +++ b/sdk/python/pulumi_azure/apimanagement/redis_cache.py @@ -294,6 +294,36 @@ def __init__(__self__, """ Manages a API Management Redis Cache. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=1, + family="C", + sku_name="Basic", + enable_non_ssl_port=False, + minimum_tls_version="1.2", + redis_configuration=azure.redis.CacheRedisConfigurationArgs()) + example_redis_cache = azure.apimanagement.RedisCache("exampleRedisCache", + api_management_id=example_service.id, + connection_string=example_cache.primary_connection_string, + description="Redis cache instances", + redis_cache_id=example_cache.id, + cache_location="East Us") + ``` + ## Import API Management Redis Caches can be imported using the `resource id`, e.g. @@ -320,6 +350,36 @@ def __init__(__self__, """ Manages a API Management Redis Cache. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="pub1", + publisher_email="pub1@email.com", + sku_name="Consumption_0") + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=1, + family="C", + sku_name="Basic", + enable_non_ssl_port=False, + minimum_tls_version="1.2", + redis_configuration=azure.redis.CacheRedisConfigurationArgs()) + example_redis_cache = azure.apimanagement.RedisCache("exampleRedisCache", + api_management_id=example_service.id, + connection_string=example_cache.primary_connection_string, + description="Redis cache instances", + redis_cache_id=example_cache.id, + cache_location="East Us") + ``` + ## Import API Management Redis Caches can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/service.py b/sdk/python/pulumi_azure/apimanagement/service.py index 47c06bcab0..7e3db319de 100644 --- a/sdk/python/pulumi_azure/apimanagement/service.py +++ b/sdk/python/pulumi_azure/apimanagement/service.py @@ -1333,6 +1333,21 @@ def __init__(__self__, zones: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + ``` + ## Import API Management Services can be imported using the `resource id`, e.g. @@ -1390,6 +1405,21 @@ def __init__(__self__, args: ServiceArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + ``` + ## Import API Management Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/subscription.py b/sdk/python/pulumi_azure/apimanagement/subscription.py index 12518145b4..d911b95569 100644 --- a/sdk/python/pulumi_azure/apimanagement/subscription.py +++ b/sdk/python/pulumi_azure/apimanagement/subscription.py @@ -520,6 +520,28 @@ def __init__(__self__, """ Manages a Subscription within a API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-apim", + resource_group_name="example-resources") + example_product = azure.apimanagement.get_product(product_id="00000000-0000-0000-0000-000000000000", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_user = azure.apimanagement.get_user(user_id="11111111-1111-1111-1111-111111111111", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_subscription = azure.apimanagement.Subscription("exampleSubscription", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + user_id=example_user.id, + product_id=example_product.id, + display_name="Parser API") + ``` + ## Import API Management Subscriptions can be imported using the `resource id`, e.g. @@ -555,6 +577,28 @@ def __init__(__self__, """ Manages a Subscription within a API Management Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.apimanagement.get_service(name="example-apim", + resource_group_name="example-resources") + example_product = azure.apimanagement.get_product(product_id="00000000-0000-0000-0000-000000000000", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_user = azure.apimanagement.get_user(user_id="11111111-1111-1111-1111-111111111111", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name) + example_subscription = azure.apimanagement.Subscription("exampleSubscription", + api_management_name=example_service.name, + resource_group_name=example_service.resource_group_name, + user_id=example_user.id, + product_id=example_product.id, + display_name="Parser API") + ``` + ## Import API Management Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/tag.py b/sdk/python/pulumi_azure/apimanagement/tag.py index da2852e75a..ab6f0c5fc5 100644 --- a/sdk/python/pulumi_azure/apimanagement/tag.py +++ b/sdk/python/pulumi_azure/apimanagement/tag.py @@ -174,6 +174,22 @@ def __init__(__self__, """ Manages a API Management Tag. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Consumption_0") + example_tag = azure.apimanagement.Tag("exampleTag", api_management_id=example_service.id) + ``` + ## Import API Management Tags can be imported using the `resource id`, e.g. @@ -197,6 +213,22 @@ def __init__(__self__, """ Manages a API Management Tag. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@terraform.io", + sku_name="Consumption_0") + example_tag = azure.apimanagement.Tag("exampleTag", api_management_id=example_service.id) + ``` + ## Import API Management Tags can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/apimanagement/user.py b/sdk/python/pulumi_azure/apimanagement/user.py index ee582a0bd0..e4b06bb68f 100644 --- a/sdk/python/pulumi_azure/apimanagement/user.py +++ b/sdk/python/pulumi_azure/apimanagement/user.py @@ -458,6 +458,29 @@ def __init__(__self__, """ Manages an API Management User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_user = azure.apimanagement.User("exampleUser", + user_id="5931a75ae4bbd512288c680b", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + first_name="Example", + last_name="User", + email="user@example.com", + state="active") + ``` + ## Import API Management Users can be imported using the `resource id`, e.g. @@ -490,6 +513,29 @@ def __init__(__self__, """ Manages an API Management User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.apimanagement.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + publisher_name="My Company", + publisher_email="company@exmaple.com", + sku_name="Developer_1") + example_user = azure.apimanagement.User("exampleUser", + user_id="5931a75ae4bbd512288c680b", + api_management_name=example_service.name, + resource_group_name=example_resource_group.name, + first_name="Example", + last_name="User", + email="user@example.com", + state="active") + ``` + ## Import API Management Users can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appconfiguration/configuration_feature.py b/sdk/python/pulumi_azure/appconfiguration/configuration_feature.py index 309dab91e6..fa98a484d8 100644 --- a/sdk/python/pulumi_azure/appconfiguration/configuration_feature.py +++ b/sdk/python/pulumi_azure/appconfiguration/configuration_feature.py @@ -511,6 +511,28 @@ def __init__(__self__, > **Note:** App Configuration Features are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). This is similar to providing App Configuration Keys. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + current = azure.core.get_client_config() + appconf_dataowner = azure.authorization.Assignment("appconfDataowner", + scope=appconf.id, + role_definition_name="App Configuration Data Owner", + principal_id=current.object_id) + test = azure.appconfiguration.ConfigurationFeature("test", + configuration_store_id=appconf.id, + description="test description", + label="test-ackeylabel", + enabled=True) + ``` + ## Import App Configuration Features can be imported using the `resource id`, e.g. @@ -550,6 +572,28 @@ def __init__(__self__, > **Note:** App Configuration Features are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). This is similar to providing App Configuration Keys. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + current = azure.core.get_client_config() + appconf_dataowner = azure.authorization.Assignment("appconfDataowner", + scope=appconf.id, + role_definition_name="App Configuration Data Owner", + principal_id=current.object_id) + test = azure.appconfiguration.ConfigurationFeature("test", + configuration_store_id=appconf.id, + description="test description", + label="test-ackeylabel", + enabled=True) + ``` + ## Import App Configuration Features can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appconfiguration/configuration_key.py b/sdk/python/pulumi_azure/appconfiguration/configuration_key.py index e3d731f683..1eb4d01989 100644 --- a/sdk/python/pulumi_azure/appconfiguration/configuration_key.py +++ b/sdk/python/pulumi_azure/appconfiguration/configuration_key.py @@ -449,6 +449,75 @@ def __init__(__self__, > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). ## Example Usage + ### `Kv` Type + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + current = azure.core.get_client_config() + appconf_dataowner = azure.authorization.Assignment("appconfDataowner", + scope=appconf.id, + role_definition_name="App Configuration Data Owner", + principal_id=current.object_id) + test = azure.appconfiguration.ConfigurationKey("test", + configuration_store_id=appconf.id, + key="appConfKey1", + label="somelabel", + value="a test", + opts=pulumi.ResourceOptions(depends_on=[appconf_dataowner])) + ``` + ### `Vault` Type + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + current = azure.core.get_client_config() + kv = azure.keyvault.KeyVault("kv", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + )]) + kvs = azure.keyvault.Secret("kvs", + value="szechuan", + key_vault_id=kv.id) + appconf_dataowner = azure.authorization.Assignment("appconfDataowner", + scope=appconf.id, + role_definition_name="App Configuration Data Owner", + principal_id=current.object_id) + test = azure.appconfiguration.ConfigurationKey("test", + configuration_store_id=azurerm_app_configuration["test"]["id"], + key="key1", + type="vault", + label="label1", + vault_key_reference=kvs.versionless_id, + opts=pulumi.ResourceOptions(depends_on=[appconf_dataowner])) + ``` ## Import @@ -491,6 +560,75 @@ def __init__(__self__, > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). ## Example Usage + ### `Kv` Type + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + current = azure.core.get_client_config() + appconf_dataowner = azure.authorization.Assignment("appconfDataowner", + scope=appconf.id, + role_definition_name="App Configuration Data Owner", + principal_id=current.object_id) + test = azure.appconfiguration.ConfigurationKey("test", + configuration_store_id=appconf.id, + key="appConfKey1", + label="somelabel", + value="a test", + opts=pulumi.ResourceOptions(depends_on=[appconf_dataowner])) + ``` + ### `Vault` Type + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + current = azure.core.get_client_config() + kv = azure.keyvault.KeyVault("kv", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + )]) + kvs = azure.keyvault.Secret("kvs", + value="szechuan", + key_vault_id=kv.id) + appconf_dataowner = azure.authorization.Assignment("appconfDataowner", + scope=appconf.id, + role_definition_name="App Configuration Data Owner", + principal_id=current.object_id) + test = azure.appconfiguration.ConfigurationKey("test", + configuration_store_id=azurerm_app_configuration["test"]["id"], + key="key1", + type="vault", + label="label1", + vault_key_reference=kvs.versionless_id, + opts=pulumi.ResourceOptions(depends_on=[appconf_dataowner])) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appconfiguration/configuration_store.py b/sdk/python/pulumi_azure/appconfiguration/configuration_store.py index d7176967e2..153f0d170d 100644 --- a/sdk/python/pulumi_azure/appconfiguration/configuration_store.py +++ b/sdk/python/pulumi_azure/appconfiguration/configuration_store.py @@ -649,6 +649,111 @@ def __init__(__self__, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + ``` + ### Encryption) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + purge_protection_enabled=True) + server = azure.keyvault.AccessPolicy("server", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ], + secret_permissions=["Get"]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + example_configuration_store = azure.appconfiguration.ConfigurationStore("exampleConfigurationStore", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard", + local_auth_enabled=True, + public_network_access="Enabled", + purge_protection_enabled=False, + soft_delete_retention_days=1, + identity=azure.appconfiguration.ConfigurationStoreIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + encryption=azure.appconfiguration.ConfigurationStoreEncryptionArgs( + key_vault_key_identifier=example_key.id, + identity_client_id=example_user_assigned_identity.client_id, + ), + replicas=[azure.appconfiguration.ConfigurationStoreReplicaArgs( + name="replica1", + location="West US", + )], + tags={ + "environment": "development", + }, + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + ``` + ## Import App Configurations can be imported using the `resource id`, e.g. @@ -687,6 +792,111 @@ def __init__(__self__, args: ConfigurationStoreArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + appconf = azure.appconfiguration.ConfigurationStore("appconf", + resource_group_name=example.name, + location=example.location) + ``` + ### Encryption) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + purge_protection_enabled=True) + server = azure.keyvault.AccessPolicy("server", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ], + secret_permissions=["Get"]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + example_configuration_store = azure.appconfiguration.ConfigurationStore("exampleConfigurationStore", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard", + local_auth_enabled=True, + public_network_access="Enabled", + purge_protection_enabled=False, + soft_delete_retention_days=1, + identity=azure.appconfiguration.ConfigurationStoreIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + encryption=azure.appconfiguration.ConfigurationStoreEncryptionArgs( + key_vault_key_identifier=example_key.id, + identity_client_id=example_user_assigned_identity.client_id, + ), + replicas=[azure.appconfiguration.ConfigurationStoreReplicaArgs( + name="replica1", + location="West US", + )], + tags={ + "environment": "development", + }, + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + ``` + ## Import App Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appconfiguration/get_configuration_key.py b/sdk/python/pulumi_azure/appconfiguration/get_configuration_key.py index b1e6f983f7..af08fbe0f7 100644 --- a/sdk/python/pulumi_azure/appconfiguration/get_configuration_key.py +++ b/sdk/python/pulumi_azure/appconfiguration/get_configuration_key.py @@ -164,6 +164,18 @@ def get_configuration_key(configuration_store_id: Optional[str] = None, > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.appconfiguration.get_configuration_key(configuration_store_id=azurerm_app_configuration["appconf"]["id"], + key="appConfKey1", + label="somelabel") + pulumi.export("value", test.value) + ``` + :param str configuration_store_id: Specifies the id of the App Configuration. :param str key: The name of the App Configuration Key. @@ -200,6 +212,18 @@ def get_configuration_key_output(configuration_store_id: Optional[pulumi.Input[s > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.appconfiguration.get_configuration_key(configuration_store_id=azurerm_app_configuration["appconf"]["id"], + key="appConfKey1", + label="somelabel") + pulumi.export("value", test.value) + ``` + :param str configuration_store_id: Specifies the id of the App Configuration. :param str key: The name of the App Configuration Key. diff --git a/sdk/python/pulumi_azure/appconfiguration/get_configuration_keys.py b/sdk/python/pulumi_azure/appconfiguration/get_configuration_keys.py index 44ec1be18e..b896578b5d 100644 --- a/sdk/python/pulumi_azure/appconfiguration/get_configuration_keys.py +++ b/sdk/python/pulumi_azure/appconfiguration/get_configuration_keys.py @@ -99,6 +99,16 @@ def get_configuration_keys(configuration_store_id: Optional[str] = None, > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.appconfiguration.get_configuration_keys(configuration_store_id=azurerm_app_configuration["appconf"]["id"]) + pulumi.export("value", test.items) + ``` + :param str configuration_store_id: Specifies the id of the App Configuration. :param str key: The name of the App Configuration Keys to look up. @@ -129,6 +139,16 @@ def get_configuration_keys_output(configuration_store_id: Optional[pulumi.Input[ > **Note:** App Configuration Keys are provisioned using a Data Plane API which requires the role `App Configuration Data Owner` on either the App Configuration or a parent scope (such as the Resource Group/Subscription). [More information can be found in the Azure Documentation for App Configuration](https://docs.microsoft.com/azure/azure-app-configuration/concept-enable-rbac#azure-built-in-roles-for-azure-app-configuration). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.appconfiguration.get_configuration_keys(configuration_store_id=azurerm_app_configuration["appconf"]["id"]) + pulumi.export("value", test.items) + ``` + :param str configuration_store_id: Specifies the id of the App Configuration. :param str key: The name of the App Configuration Keys to look up. diff --git a/sdk/python/pulumi_azure/appconfiguration/get_configuration_store.py b/sdk/python/pulumi_azure/appconfiguration/get_configuration_store.py index 14c853fbbc..2d58fd46ff 100644 --- a/sdk/python/pulumi_azure/appconfiguration/get_configuration_store.py +++ b/sdk/python/pulumi_azure/appconfiguration/get_configuration_store.py @@ -258,6 +258,17 @@ def get_configuration_store(name: Optional[str] = None, """ Use this data source to access information about an existing App Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appconfiguration.get_configuration_store(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The Name of this App Configuration. :param str resource_group_name: The name of the Resource Group where the App Configuration exists. @@ -297,6 +308,17 @@ def get_configuration_store_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing App Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appconfiguration.get_configuration_store(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The Name of this App Configuration. :param str resource_group_name: The name of the Resource Group where the App Configuration exists. diff --git a/sdk/python/pulumi_azure/appconfiguration/lication_load_balancer.py b/sdk/python/pulumi_azure/appconfiguration/lication_load_balancer.py index 0523df7c4b..07f9d5be08 100644 --- a/sdk/python/pulumi_azure/appconfiguration/lication_load_balancer.py +++ b/sdk/python/pulumi_azure/appconfiguration/lication_load_balancer.py @@ -227,6 +227,18 @@ def __init__(__self__, """ Manages an Application Gateway for Containers (ALB). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lication_load_balancer = azure.appconfiguration.LicationLoadBalancer("exampleLicationLoadBalancer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Application Gateway for Containers (ALB) can be imported using the `resource id`, e.g. @@ -251,6 +263,18 @@ def __init__(__self__, """ Manages an Application Gateway for Containers (ALB). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lication_load_balancer = azure.appconfiguration.LicationLoadBalancer("exampleLicationLoadBalancer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Application Gateway for Containers (ALB) can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/analytics_item.py b/sdk/python/pulumi_azure/appinsights/analytics_item.py index b213073091..ec3018eca9 100644 --- a/sdk/python/pulumi_azure/appinsights/analytics_item.py +++ b/sdk/python/pulumi_azure/appinsights/analytics_item.py @@ -346,6 +346,24 @@ def __init__(__self__, """ Manages an Application Insights Analytics Item component. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_analytics_item = azure.appinsights.AnalyticsItem("exampleAnalyticsItem", + application_insights_id=example_insights.id, + content="requests //simple example query", + scope="shared", + type="query") + ``` + ## Import Application Insights Analytics Items can be imported using the `resource id`, e.g. @@ -374,6 +392,24 @@ def __init__(__self__, """ Manages an Application Insights Analytics Item component. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_analytics_item = azure.appinsights.AnalyticsItem("exampleAnalyticsItem", + application_insights_id=example_insights.id, + content="requests //simple example query", + scope="shared", + type="query") + ``` + ## Import Application Insights Analytics Items can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/api_key.py b/sdk/python/pulumi_azure/appinsights/api_key.py index 0fe4494b52..89dce46cd1 100644 --- a/sdk/python/pulumi_azure/appinsights/api_key.py +++ b/sdk/python/pulumi_azure/appinsights/api_key.py @@ -243,6 +243,49 @@ def __init__(__self__, """ Manages an Application Insights API key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + read_telemetry = azure.appinsights.ApiKey("readTelemetry", + application_insights_id=example_insights.id, + read_permissions=[ + "aggregate", + "api", + "draft", + "extendqueries", + "search", + ]) + write_annotations = azure.appinsights.ApiKey("writeAnnotations", + application_insights_id=example_insights.id, + write_permissions=["annotations"]) + authenticate_sdk_control_channel_api_key = azure.appinsights.ApiKey("authenticateSdkControlChannelApiKey", + application_insights_id=example_insights.id, + read_permissions=["agentconfig"]) + full_permissions = azure.appinsights.ApiKey("fullPermissions", + application_insights_id=example_insights.id, + read_permissions=[ + "agentconfig", + "aggregate", + "api", + "draft", + "extendqueries", + "search", + ], + write_permissions=["annotations"]) + pulumi.export("readTelemetryApiKey", read_telemetry.api_key) + pulumi.export("writeAnnotationsApiKey", write_annotations.api_key) + pulumi.export("authenticateSdkControlChannel", authenticate_sdk_control_channel_api_key.api_key) + pulumi.export("fullPermissionsApiKey", full_permissions.api_key) + ``` + ## Import Application Insights API keys can be imported using the `resource id`, e.g. @@ -269,6 +312,49 @@ def __init__(__self__, """ Manages an Application Insights API key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + read_telemetry = azure.appinsights.ApiKey("readTelemetry", + application_insights_id=example_insights.id, + read_permissions=[ + "aggregate", + "api", + "draft", + "extendqueries", + "search", + ]) + write_annotations = azure.appinsights.ApiKey("writeAnnotations", + application_insights_id=example_insights.id, + write_permissions=["annotations"]) + authenticate_sdk_control_channel_api_key = azure.appinsights.ApiKey("authenticateSdkControlChannelApiKey", + application_insights_id=example_insights.id, + read_permissions=["agentconfig"]) + full_permissions = azure.appinsights.ApiKey("fullPermissions", + application_insights_id=example_insights.id, + read_permissions=[ + "agentconfig", + "aggregate", + "api", + "draft", + "extendqueries", + "search", + ], + write_permissions=["annotations"]) + pulumi.export("readTelemetryApiKey", read_telemetry.api_key) + pulumi.export("writeAnnotationsApiKey", write_annotations.api_key) + pulumi.export("authenticateSdkControlChannel", authenticate_sdk_control_channel_api_key.api_key) + pulumi.export("fullPermissionsApiKey", full_permissions.api_key) + ``` + ## Import Application Insights API keys can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/get_insights.py b/sdk/python/pulumi_azure/appinsights/get_insights.py index 19e45fbddd..b94e1791c1 100644 --- a/sdk/python/pulumi_azure/appinsights/get_insights.py +++ b/sdk/python/pulumi_azure/appinsights/get_insights.py @@ -164,6 +164,17 @@ def get_insights(name: Optional[str] = None, """ Use this data source to access information about an existing Application Insights component. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appinsights.get_insights(name="production", + resource_group_name="networking") + pulumi.export("applicationInsightsInstrumentationKey", example.instrumentation_key) + ``` + :param str name: Specifies the name of the Application Insights component. :param str resource_group_name: Specifies the name of the resource group the Application Insights component is located in. @@ -195,6 +206,17 @@ def get_insights_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Application Insights component. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appinsights.get_insights(name="production", + resource_group_name="networking") + pulumi.export("applicationInsightsInstrumentationKey", example.instrumentation_key) + ``` + :param str name: Specifies the name of the Application Insights component. :param str resource_group_name: Specifies the name of the resource group the Application Insights component is located in. diff --git a/sdk/python/pulumi_azure/appinsights/insights.py b/sdk/python/pulumi_azure/appinsights/insights.py index d3b30b2c24..b5832d9db4 100644 --- a/sdk/python/pulumi_azure/appinsights/insights.py +++ b/sdk/python/pulumi_azure/appinsights/insights.py @@ -727,6 +727,41 @@ def __init__(__self__, """ Manages an Application Insights component. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + pulumi.export("instrumentationKey", example_insights.instrumentation_key) + pulumi.export("appId", example_insights.app_id) + ``` + ### Workspace Mode + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_id=example_analytics_workspace.id, + application_type="web") + pulumi.export("instrumentationKey", example_insights.instrumentation_key) + pulumi.export("appId", example_insights.app_id) + ``` + ## Import Application Insights instances can be imported using the `resource id`, e.g. @@ -764,6 +799,41 @@ def __init__(__self__, """ Manages an Application Insights component. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + pulumi.export("instrumentationKey", example_insights.instrumentation_key) + pulumi.export("appId", example_insights.app_id) + ``` + ### Workspace Mode + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_id=example_analytics_workspace.id, + application_type="web") + pulumi.export("instrumentationKey", example_insights.instrumentation_key) + pulumi.export("appId", example_insights.app_id) + ``` + ## Import Application Insights instances can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/smart_detection_rule.py b/sdk/python/pulumi_azure/appinsights/smart_detection_rule.py index 63d83ba91a..f94a31d146 100644 --- a/sdk/python/pulumi_azure/appinsights/smart_detection_rule.py +++ b/sdk/python/pulumi_azure/appinsights/smart_detection_rule.py @@ -260,6 +260,22 @@ def __init__(__self__, """ Manages an Application Insights Smart Detection Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_smart_detection_rule = azure.appinsights.SmartDetectionRule("exampleSmartDetectionRule", + application_insights_id=example_insights.id, + enabled=False) + ``` + ## Import Application Insights Smart Detection Rules can be imported using the `resource id`, e.g. @@ -287,6 +303,22 @@ def __init__(__self__, """ Manages an Application Insights Smart Detection Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_smart_detection_rule = azure.appinsights.SmartDetectionRule("exampleSmartDetectionRule", + application_insights_id=example_insights.id, + enabled=False) + ``` + ## Import Application Insights Smart Detection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/standard_web_test.py b/sdk/python/pulumi_azure/appinsights/standard_web_test.py index 8dd2152d0f..e151951026 100644 --- a/sdk/python/pulumi_azure/appinsights/standard_web_test.py +++ b/sdk/python/pulumi_azure/appinsights/standard_web_test.py @@ -589,6 +589,27 @@ def __init__(__self__, """ Manages a Application Insights Standard WebTest. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_standard_web_test = azure.appinsights.StandardWebTest("exampleStandardWebTest", + resource_group_name=example_resource_group.name, + location="West Europe", + application_insights_id=example_insights.id, + geo_locations=["example"], + request=azure.appinsights.StandardWebTestRequestArgs( + url="http://www.example.com", + )) + ``` + ## Import Application Insights Standard WebTests can be imported using the `resource id`, e.g. @@ -624,6 +645,27 @@ def __init__(__self__, """ Manages a Application Insights Standard WebTest. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_standard_web_test = azure.appinsights.StandardWebTest("exampleStandardWebTest", + resource_group_name=example_resource_group.name, + location="West Europe", + application_insights_id=example_insights.id, + geo_locations=["example"], + request=azure.appinsights.StandardWebTestRequestArgs( + url="http://www.example.com", + )) + ``` + ## Import Application Insights Standard WebTests can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/web_test.py b/sdk/python/pulumi_azure/appinsights/web_test.py index a300b3c96f..18b0ca95fb 100644 --- a/sdk/python/pulumi_azure/appinsights/web_test.py +++ b/sdk/python/pulumi_azure/appinsights/web_test.py @@ -580,6 +580,39 @@ def __init__(__self__, """ Manages an Application Insights WebTest. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_web_test = azure.appinsights.WebTest("exampleWebTest", + location=example_insights.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + kind="ping", + frequency=300, + timeout=60, + enabled=True, + geo_locations=[ + "us-tx-sn1-azr", + "us-il-ch1-azr", + ], + configuration=\"\"\" + + + + + \"\"\") + pulumi.export("webtestId", example_web_test.id) + pulumi.export("webtestsSyntheticId", example_web_test.synthetic_monitor_id) + ``` + ## Import Application Insights Web Tests can be imported using the `resource id`, e.g. @@ -615,6 +648,39 @@ def __init__(__self__, """ Manages an Application Insights WebTest. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_web_test = azure.appinsights.WebTest("exampleWebTest", + location=example_insights.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + kind="ping", + frequency=300, + timeout=60, + enabled=True, + geo_locations=[ + "us-tx-sn1-azr", + "us-il-ch1-azr", + ], + configuration=\"\"\" + + + + + \"\"\") + pulumi.export("webtestId", example_web_test.id) + pulumi.export("webtestsSyntheticId", example_web_test.synthetic_monitor_id) + ``` + ## Import Application Insights Web Tests can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/workbook.py b/sdk/python/pulumi_azure/appinsights/workbook.py index 6a8392a350..44f7600930 100644 --- a/sdk/python/pulumi_azure/appinsights/workbook.py +++ b/sdk/python/pulumi_azure/appinsights/workbook.py @@ -494,6 +494,35 @@ def __init__(__self__, """ Manages an Azure Workbook. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workbook = azure.appinsights.Workbook("exampleWorkbook", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + display_name="workbook1", + data_json=json.dumps({ + "version": "Notebook/1.0", + "items": [{ + "type": 1, + "content": { + "json": "Test2022", + }, + "name": "text - 0", + }], + "isLocked": False, + "fallbackResourceIds": ["Azure Monitor"], + }), + tags={ + "ENV": "Test", + }) + ``` + ## Import Workbooks can be imported using the `resource id`, e.g. @@ -527,6 +556,35 @@ def __init__(__self__, """ Manages an Azure Workbook. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workbook = azure.appinsights.Workbook("exampleWorkbook", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + display_name="workbook1", + data_json=json.dumps({ + "version": "Notebook/1.0", + "items": [{ + "type": 1, + "content": { + "json": "Test2022", + }, + "name": "text - 0", + }], + "isLocked": False, + "fallbackResourceIds": ["Azure Monitor"], + }), + tags={ + "ENV": "Test", + }) + ``` + ## Import Workbooks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appinsights/workbook_template.py b/sdk/python/pulumi_azure/appinsights/workbook_template.py index c44548cd6a..755cbe0db6 100644 --- a/sdk/python/pulumi_azure/appinsights/workbook_template.py +++ b/sdk/python/pulumi_azure/appinsights/workbook_template.py @@ -400,6 +400,72 @@ def __init__(__self__, """ Manages an Application Insights Workbook Template. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workbook_template = azure.appinsights.WorkbookTemplate("exampleWorkbookTemplate", + resource_group_name=example_resource_group.name, + location="West Europe", + author="test author", + priority=1, + galleries=[azure.appinsights.WorkbookTemplateGalleryArgs( + category="workbook", + name="test", + order=100, + resource_type="microsoft.insights/components", + type="tsg", + )], + template_data=json.dumps({ + "version": "Notebook/1.0", + "items": [{ + "type": 1, + "content": { + "json": \"\"\"## New workbook + --- + + Welcome to your new workbook.\"\"\", + }, + "name": "text - 2", + }], + "styleSettings": {}, + "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + }), + localized=json.dumps({ + "ar": [{ + "galleries": [{ + "name": "test", + "category": "Failures", + "type": "tsg", + "resourceType": "microsoft.insights/components", + "order": 100, + }], + "templateData": { + "version": "Notebook/1.0", + "items": [{ + "type": 1, + "content": { + "json": \"\"\"## New workbook + --- + + Welcome to your new workbook.\"\"\", + }, + "name": "text - 2", + }], + "styleSettings": {}, + "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + }, + }], + }), + tags={ + "key": "value", + }) + ``` + ## Import Application Insights Workbook Template can be imported using the `resource id`, e.g. @@ -429,6 +495,72 @@ def __init__(__self__, """ Manages an Application Insights Workbook Template. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workbook_template = azure.appinsights.WorkbookTemplate("exampleWorkbookTemplate", + resource_group_name=example_resource_group.name, + location="West Europe", + author="test author", + priority=1, + galleries=[azure.appinsights.WorkbookTemplateGalleryArgs( + category="workbook", + name="test", + order=100, + resource_type="microsoft.insights/components", + type="tsg", + )], + template_data=json.dumps({ + "version": "Notebook/1.0", + "items": [{ + "type": 1, + "content": { + "json": \"\"\"## New workbook + --- + + Welcome to your new workbook.\"\"\", + }, + "name": "text - 2", + }], + "styleSettings": {}, + "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + }), + localized=json.dumps({ + "ar": [{ + "galleries": [{ + "name": "test", + "category": "Failures", + "type": "tsg", + "resourceType": "microsoft.insights/components", + "order": 100, + }], + "templateData": { + "version": "Notebook/1.0", + "items": [{ + "type": 1, + "content": { + "json": \"\"\"## New workbook + --- + + Welcome to your new workbook.\"\"\", + }, + "name": "text - 2", + }], + "styleSettings": {}, + "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", + }, + }], + }), + tags={ + "key": "value", + }) + ``` + ## Import Application Insights Workbook Template can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/get_spring_cloud_app.py b/sdk/python/pulumi_azure/appplatform/get_spring_cloud_app.py index ab2ba14d0a..cf3c236a07 100644 --- a/sdk/python/pulumi_azure/appplatform/get_spring_cloud_app.py +++ b/sdk/python/pulumi_azure/appplatform/get_spring_cloud_app.py @@ -163,6 +163,18 @@ def get_spring_cloud_app(name: Optional[str] = None, """ Use this data source to access information about an existing Spring Cloud Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appplatform.get_spring_cloud_app(name=azurerm_spring_cloud_app["example"]["name"], + resource_group_name=azurerm_spring_cloud_app["example"]["resource_group_name"], + service_name=azurerm_spring_cloud_app["example"]["service_name"]) + pulumi.export("springCloudAppId", example.id) + ``` + :param str name: The name of the Spring Cloud Application. :param str resource_group_name: The name of the Resource Group where the Spring Cloud Application exists. @@ -197,6 +209,18 @@ def get_spring_cloud_app_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Spring Cloud Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appplatform.get_spring_cloud_app(name=azurerm_spring_cloud_app["example"]["name"], + resource_group_name=azurerm_spring_cloud_app["example"]["resource_group_name"], + service_name=azurerm_spring_cloud_app["example"]["service_name"]) + pulumi.export("springCloudAppId", example.id) + ``` + :param str name: The name of the Spring Cloud Application. :param str resource_group_name: The name of the Resource Group where the Spring Cloud Application exists. diff --git a/sdk/python/pulumi_azure/appplatform/get_spring_cloud_service.py b/sdk/python/pulumi_azure/appplatform/get_spring_cloud_service.py index 78866544fa..c76233204e 100644 --- a/sdk/python/pulumi_azure/appplatform/get_spring_cloud_service.py +++ b/sdk/python/pulumi_azure/appplatform/get_spring_cloud_service.py @@ -132,6 +132,17 @@ def get_spring_cloud_service(name: Optional[str] = None, """ Use this data source to access information about an existing Spring Cloud Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appplatform.get_spring_cloud_service(name=azurerm_spring_cloud_service["example"]["name"], + resource_group_name=azurerm_spring_cloud_service["example"]["resource_group_name"]) + pulumi.export("springCloudServiceId", example.id) + ``` + :param str name: Specifies The name of the Spring Cloud Service resource. :param str resource_group_name: Specifies the name of the Resource Group where the Spring Cloud Service exists. @@ -160,6 +171,17 @@ def get_spring_cloud_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Spring Cloud Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appplatform.get_spring_cloud_service(name=azurerm_spring_cloud_service["example"]["name"], + resource_group_name=azurerm_spring_cloud_service["example"]["resource_group_name"]) + pulumi.export("springCloudServiceId", example.id) + ``` + :param str name: Specifies The name of the Spring Cloud Service resource. :param str resource_group_name: Specifies the name of the Resource Group where the Spring Cloud Service exists. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_accelerator.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_accelerator.py index 7d3d245b6b..14b1e5ea0f 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_accelerator.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_accelerator.py @@ -135,6 +135,20 @@ def __init__(__self__, Manages a Spring Cloud Accelerator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_accelerator = azure.appplatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", spring_cloud_service_id=example_spring_cloud_service.id) + ``` + ## Import Spring Cloud Accelerators can be imported using the `resource id`, e.g. @@ -159,6 +173,20 @@ def __init__(__self__, Manages a Spring Cloud Accelerator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_accelerator = azure.appplatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", spring_cloud_service_id=example_spring_cloud_service.id) + ``` + ## Import Spring Cloud Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_active_deployment.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_active_deployment.py index 52780c0bd6..f76e1665b4 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_active_deployment.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_active_deployment.py @@ -138,6 +138,39 @@ def __init__(__self__, """ Manages an Active Azure Spring Cloud Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + instance_count=2, + jvm_options="-XX:+PrintGC", + runtime_version="Java_11", + quota=azure.appplatform.SpringCloudJavaDeploymentQuotaArgs( + cpu="2", + memory="4Gi", + ), + environment_variables={ + "Env": "Staging", + }) + example_spring_cloud_active_deployment = azure.appplatform.SpringCloudActiveDeployment("exampleSpringCloudActiveDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + deployment_name=example_spring_cloud_java_deployment.name) + ``` + ## Import Spring Cloud Active Deployment can be imported using the `resource id`, e.g. @@ -160,6 +193,39 @@ def __init__(__self__, """ Manages an Active Azure Spring Cloud Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + instance_count=2, + jvm_options="-XX:+PrintGC", + runtime_version="Java_11", + quota=azure.appplatform.SpringCloudJavaDeploymentQuotaArgs( + cpu="2", + memory="4Gi", + ), + environment_variables={ + "Env": "Staging", + }) + example_spring_cloud_active_deployment = azure.appplatform.SpringCloudActiveDeployment("exampleSpringCloudActiveDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + deployment_name=example_spring_cloud_java_deployment.name) + ``` + ## Import Spring Cloud Active Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal.py index 72ca716be7..356b4c8059 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal.py @@ -356,6 +356,32 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_api_portal = azure.appplatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", + spring_cloud_service_id=example_spring_cloud_service.id, + gateway_ids=[example_spring_cloud_gateway.id], + https_only_enabled=False, + public_network_access_enabled=True, + instance_count=1, + sso=azure.appplatform.SpringCloudApiPortalSsoArgs( + client_id="test", + client_secret="secret", + issuer_uri="https://www.example.com/issueToken", + scopes=["read"], + )) + ``` + ## Import Spring Cloud API Portals can be imported using the `resource id`, e.g. @@ -385,6 +411,32 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_api_portal = azure.appplatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", + spring_cloud_service_id=example_spring_cloud_service.id, + gateway_ids=[example_spring_cloud_gateway.id], + https_only_enabled=False, + public_network_access_enabled=True, + instance_count=1, + sso=azure.appplatform.SpringCloudApiPortalSsoArgs( + client_id="test", + client_secret="secret", + issuer_uri="https://www.example.com/issueToken", + scopes=["read"], + )) + ``` + ## Import Spring Cloud API Portals can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal_custom_domain.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal_custom_domain.py index 6edb2ac73b..f5984523aa 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal_custom_domain.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_api_portal_custom_domain.py @@ -172,6 +172,24 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_api_portal = azure.appplatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", + spring_cloud_service_id=example_spring_cloud_service.id, + gateway_ids=[example_spring_cloud_gateway.id]) + example_spring_cloud_api_portal_custom_domain = azure.appplatform.SpringCloudApiPortalCustomDomain("exampleSpringCloudApiPortalCustomDomain", spring_cloud_api_portal_id=example_spring_cloud_api_portal.id) + ``` + ## Import Spring Cloud API Portal Domains can be imported using the `resource id`, e.g. @@ -197,6 +215,24 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_api_portal = azure.appplatform.SpringCloudApiPortal("exampleSpringCloudApiPortal", + spring_cloud_service_id=example_spring_cloud_service.id, + gateway_ids=[example_spring_cloud_gateway.id]) + example_spring_cloud_api_portal_custom_domain = azure.appplatform.SpringCloudApiPortalCustomDomain("exampleSpringCloudApiPortalCustomDomain", spring_cloud_api_portal_id=example_spring_cloud_api_portal.id) + ``` + ## Import Spring Cloud API Portal Domains can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_app.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_app.py index a23bbf1733..98440464e5 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_app.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_app.py @@ -578,6 +578,24 @@ def __init__(__self__, """ Manage an Azure Spring Cloud Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Spring Cloud Application can be imported using the `resource id`, e.g. @@ -610,6 +628,24 @@ def __init__(__self__, """ Manage an Azure Spring Cloud Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Spring Cloud Application can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_app_cosmos_dbassociation.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_app_cosmos_dbassociation.py index 365165367d..bde9572dfe 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_app_cosmos_dbassociation.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_app_cosmos_dbassociation.py @@ -464,6 +464,38 @@ def __init__(__self__, """ Associates a Spring Cloud Application with a CosmosDB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_spring_cloud_app_cosmos_dbassociation = azure.appplatform.SpringCloudAppCosmosDBAssociation("exampleSpringCloudAppCosmosDBAssociation", + spring_cloud_app_id=example_spring_cloud_app.id, + cosmosdb_account_id=example_account.id, + api_type="table", + cosmosdb_access_key=example_account.primary_key) + ``` + ## Import Spring Cloud Application CosmosDB Association can be imported using the `resource id`, e.g. @@ -494,6 +526,38 @@ def __init__(__self__, """ Associates a Spring Cloud Application with a CosmosDB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_spring_cloud_app_cosmos_dbassociation = azure.appplatform.SpringCloudAppCosmosDBAssociation("exampleSpringCloudAppCosmosDBAssociation", + spring_cloud_app_id=example_spring_cloud_app.id, + cosmosdb_account_id=example_account.id, + api_type="table", + cosmosdb_access_key=example_account.primary_key) + ``` + ## Import Spring Cloud Application CosmosDB Association can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_app_mysql_association.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_app_mysql_association.py index 848e8881a3..ab876fc036 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_app_mysql_association.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_app_mysql_association.py @@ -293,6 +293,42 @@ def __init__(__self__, """ Associates a Spring Cloud Application with a MySQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7", + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + example_database = azure.mysql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="utf8", + collation="utf8_unicode_ci") + example_spring_cloud_app_mysql_association = azure.appplatform.SpringCloudAppMysqlAssociation("exampleSpringCloudAppMysqlAssociation", + spring_cloud_app_id=example_spring_cloud_app.id, + mysql_server_id=example_server.id, + database_name=example_database.name, + username=example_server.administrator_login, + password=example_server.administrator_login_password) + ``` + ## Import Spring Cloud Application MySQL Association can be imported using the `resource id`, e.g. @@ -319,6 +355,42 @@ def __init__(__self__, """ Associates a Spring Cloud Application with a MySQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7", + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + example_database = azure.mysql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="utf8", + collation="utf8_unicode_ci") + example_spring_cloud_app_mysql_association = azure.appplatform.SpringCloudAppMysqlAssociation("exampleSpringCloudAppMysqlAssociation", + spring_cloud_app_id=example_spring_cloud_app.id, + mysql_server_id=example_server.id, + database_name=example_database.name, + username=example_server.administrator_login, + password=example_server.administrator_login_password) + ``` + ## Import Spring Cloud Application MySQL Association can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_app_redis_association.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_app_redis_association.py index 124f997c70..d69d09c19d 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_app_redis_association.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_app_redis_association.py @@ -258,6 +258,33 @@ def __init__(__self__, """ Associates a Spring Cloud Application with a Redis Cache. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=0, + family="C", + sku_name="Basic", + enable_non_ssl_port=True) + example_spring_cloud_app_redis_association = azure.appplatform.SpringCloudAppRedisAssociation("exampleSpringCloudAppRedisAssociation", + spring_cloud_app_id=example_spring_cloud_app.id, + redis_cache_id=example_cache.id, + redis_access_key=example_cache.primary_access_key, + ssl_enabled=True) + ``` + ## Import Spring Cloud Application Redis Association can be imported using the `resource id`, e.g. @@ -283,6 +310,33 @@ def __init__(__self__, """ Associates a Spring Cloud Application with a Redis Cache. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=0, + family="C", + sku_name="Basic", + enable_non_ssl_port=True) + example_spring_cloud_app_redis_association = azure.appplatform.SpringCloudAppRedisAssociation("exampleSpringCloudAppRedisAssociation", + spring_cloud_app_id=example_spring_cloud_app.id, + redis_cache_id=example_cache.id, + redis_access_key=example_cache.primary_access_key, + ssl_enabled=True) + ``` + ## Import Spring Cloud Application Redis Association can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_application_insights_application_performance_monitoring.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_application_insights_application_performance_monitoring.py index b942c1c006..dcfa69fa18 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_application_insights_application_performance_monitoring.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_application_insights_application_performance_monitoring.py @@ -381,6 +381,31 @@ def __init__(__self__, Manages a Spring Cloud Application Performance Monitoring resource for Application Insights. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_application_insights_application_performance_monitoring = azure.appplatform.SpringCloudApplicationInsightsApplicationPerformanceMonitoring("exampleSpringCloudApplicationInsightsApplicationPerformanceMonitoring", + spring_cloud_service_id=example_spring_cloud_service.id, + connection_string=example_insights.instrumentation_key, + globally_enabled=True, + role_name="test-role", + role_instance="test-instance", + sampling_percentage=50, + sampling_requests_per_second=10) + ``` + ## Import Spring Cloud Application Performance Monitoring resource for Application Insights can be imported using the `resource id`, e.g. @@ -411,6 +436,31 @@ def __init__(__self__, Manages a Spring Cloud Application Performance Monitoring resource for Application Insights. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_application_insights_application_performance_monitoring = azure.appplatform.SpringCloudApplicationInsightsApplicationPerformanceMonitoring("exampleSpringCloudApplicationInsightsApplicationPerformanceMonitoring", + spring_cloud_service_id=example_spring_cloud_service.id, + connection_string=example_insights.instrumentation_key, + globally_enabled=True, + role_name="test-role", + role_instance="test-instance", + sampling_percentage=50, + sampling_requests_per_second=10) + ``` + ## Import Spring Cloud Application Performance Monitoring resource for Application Insights can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_application_live_view.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_application_live_view.py index 852bb147cf..ec9d317293 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_application_live_view.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_application_live_view.py @@ -135,6 +135,20 @@ def __init__(__self__, Manages a Spring Cloud Application Live View. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_application_live_view = azure.appplatform.SpringCloudApplicationLiveView("exampleSpringCloudApplicationLiveView", spring_cloud_service_id=example_spring_cloud_service.id) + ``` + ## Import Spring Cloud Application Live Views can be imported using the `resource id`, e.g. g @@ -159,6 +173,20 @@ def __init__(__self__, Manages a Spring Cloud Application Live View. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_application_live_view = azure.appplatform.SpringCloudApplicationLiveView("exampleSpringCloudApplicationLiveView", spring_cloud_service_id=example_spring_cloud_service.id) + ``` + ## Import Spring Cloud Application Live Views can be imported using the `resource id`, e.g. g diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_build_deployment.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_build_deployment.py index d444ef651d..223727223c 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_build_deployment.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_build_deployment.py @@ -339,6 +339,34 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_spring_cloud_service.resource_group_name, + service_name=example_spring_cloud_service.name) + example_spring_cloud_build_deployment = azure.appplatform.SpringCloudBuildDeployment("exampleSpringCloudBuildDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + build_result_id="", + instance_count=2, + environment_variables={ + "Foo": "Bar", + "Env": "Staging", + }, + quota=azure.appplatform.SpringCloudBuildDeploymentQuotaArgs( + cpu="2", + memory="4Gi", + )) + ``` + ## Import Spring Cloud Build Deployments can be imported using the `resource id`, e.g. @@ -368,6 +396,34 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_spring_cloud_service.resource_group_name, + service_name=example_spring_cloud_service.name) + example_spring_cloud_build_deployment = azure.appplatform.SpringCloudBuildDeployment("exampleSpringCloudBuildDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + build_result_id="", + instance_count=2, + environment_variables={ + "Foo": "Bar", + "Env": "Staging", + }, + quota=azure.appplatform.SpringCloudBuildDeploymentQuotaArgs( + cpu="2", + memory="4Gi", + )) + ``` + ## Import Spring Cloud Build Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_build_pack_binding.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_build_pack_binding.py index 0890883111..2ec5f9d1ec 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_build_pack_binding.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_build_pack_binding.py @@ -215,6 +215,42 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="E0") + example_spring_cloud_builder = azure.appplatform.SpringCloudBuilder("exampleSpringCloudBuilder", + spring_cloud_service_id=example_spring_cloud_service.id, + build_pack_groups=[azure.appplatform.SpringCloudBuilderBuildPackGroupArgs( + name="mix", + build_pack_ids=["tanzu-Build Packs/java-azure"], + )], + stack=azure.appplatform.SpringCloudBuilderStackArgs( + id="io.Build Packs.stacks.bionic", + version="base", + )) + example_spring_cloud_build_pack_binding = azure.appplatform.SpringCloudBuildPackBinding("exampleSpringCloudBuildPackBinding", + spring_cloud_builder_id=example_spring_cloud_builder.id, + binding_type="ApplicationInsights", + launch=azure.appplatform.SpringCloudBuildPackBindingLaunchArgs( + properties={ + "abc": "def", + "any-string": "any-string", + "sampling-rate": "12.0", + }, + secrets={ + "connection-string": "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX", + }, + )) + ``` + ## Import Spring Cloud Build Pack Bindings can be imported using the `resource id`, e.g. @@ -241,6 +277,42 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="E0") + example_spring_cloud_builder = azure.appplatform.SpringCloudBuilder("exampleSpringCloudBuilder", + spring_cloud_service_id=example_spring_cloud_service.id, + build_pack_groups=[azure.appplatform.SpringCloudBuilderBuildPackGroupArgs( + name="mix", + build_pack_ids=["tanzu-Build Packs/java-azure"], + )], + stack=azure.appplatform.SpringCloudBuilderStackArgs( + id="io.Build Packs.stacks.bionic", + version="base", + )) + example_spring_cloud_build_pack_binding = azure.appplatform.SpringCloudBuildPackBinding("exampleSpringCloudBuildPackBinding", + spring_cloud_builder_id=example_spring_cloud_builder.id, + binding_type="ApplicationInsights", + launch=azure.appplatform.SpringCloudBuildPackBindingLaunchArgs( + properties={ + "abc": "def", + "any-string": "any-string", + "sampling-rate": "12.0", + }, + secrets={ + "connection-string": "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX", + }, + )) + ``` + ## Import Spring Cloud Build Pack Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_builder.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_builder.py index 6e9e75672e..37b23e1173 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_builder.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_builder.py @@ -217,6 +217,29 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="E0") + example_spring_cloud_builder = azure.appplatform.SpringCloudBuilder("exampleSpringCloudBuilder", + spring_cloud_service_id=example_spring_cloud_service.id, + build_pack_groups=[azure.appplatform.SpringCloudBuilderBuildPackGroupArgs( + name="mix", + build_pack_ids=["tanzu-buildpacks/java-azure"], + )], + stack=azure.appplatform.SpringCloudBuilderStackArgs( + id="io.buildpacks.stacks.bionic", + version="base", + )) + ``` + ## Import Spring Cloud Builders can be imported using the `resource id`, e.g. @@ -243,6 +266,29 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="E0") + example_spring_cloud_builder = azure.appplatform.SpringCloudBuilder("exampleSpringCloudBuilder", + spring_cloud_service_id=example_spring_cloud_service.id, + build_pack_groups=[azure.appplatform.SpringCloudBuilderBuildPackGroupArgs( + name="mix", + build_pack_ids=["tanzu-buildpacks/java-azure"], + )], + stack=azure.appplatform.SpringCloudBuilderStackArgs( + id="io.buildpacks.stacks.bionic", + version="base", + )) + ``` + ## Import Spring Cloud Builders can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_certificate.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_certificate.py index 32a6cfbf2b..3f4e861aba 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_certificate.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_certificate.py @@ -316,6 +316,92 @@ def __init__(__self__, """ Manages an Azure Spring Cloud Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_service_principal = azuread.get_service_principal(display_name="Azure Spring Cloud Resource Provider") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=["Set"], + certificate_permissions=[ + "Create", + "Delete", + "Get", + "Update", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=example_service_principal.object_id, + secret_permissions=[ + "Get", + "List", + ], + certificate_permissions=[ + "Get", + "List", + ], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject="CN=contoso.com", + validity_in_months=12, + ), + )) + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_certificate = azure.appplatform.SpringCloudCertificate("exampleSpringCloudCertificate", + resource_group_name=example_spring_cloud_service.resource_group_name, + service_name=example_spring_cloud_service.name, + key_vault_certificate_id=example_certificate.id, + exclude_private_key=True) + ``` + ## Import Spring Cloud Certificate can be imported using the `resource id`, e.g. @@ -342,6 +428,92 @@ def __init__(__self__, """ Manages an Azure Spring Cloud Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_service_principal = azuread.get_service_principal(display_name="Azure Spring Cloud Resource Provider") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=["Set"], + certificate_permissions=[ + "Create", + "Delete", + "Get", + "Update", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=example_service_principal.object_id, + secret_permissions=[ + "Get", + "List", + ], + certificate_permissions=[ + "Get", + "List", + ], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject="CN=contoso.com", + validity_in_months=12, + ), + )) + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_certificate = azure.appplatform.SpringCloudCertificate("exampleSpringCloudCertificate", + resource_group_name=example_spring_cloud_service.resource_group_name, + service_name=example_spring_cloud_service.name, + key_vault_certificate_id=example_certificate.id, + exclude_private_key=True) + ``` + ## Import Spring Cloud Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_configuration_service.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_configuration_service.py index b6ddcf053e..db1a89e7cd 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_configuration_service.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_configuration_service.py @@ -211,6 +211,34 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_configuration_service = azure.appplatform.SpringCloudConfigurationService("exampleSpringCloudConfigurationService", + spring_cloud_service_id=example_spring_cloud_service.id, + repositories=[azure.appplatform.SpringCloudConfigurationServiceRepositoryArgs( + name="fake", + label="master", + patterns=["app/dev"], + uri="https://github.com/Azure-Samples/piggymetrics", + search_paths=[ + "dir1", + "dir2", + ], + strict_host_key_checking=False, + username="adminuser", + password="H@Sh1CoR3!", + )]) + ``` + ## Import Spring Cloud Configuration Services can be imported using the `resource id`, e.g. @@ -237,6 +265,34 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_configuration_service = azure.appplatform.SpringCloudConfigurationService("exampleSpringCloudConfigurationService", + spring_cloud_service_id=example_spring_cloud_service.id, + repositories=[azure.appplatform.SpringCloudConfigurationServiceRepositoryArgs( + name="fake", + label="master", + patterns=["app/dev"], + uri="https://github.com/Azure-Samples/piggymetrics", + search_paths=[ + "dir1", + "dir2", + ], + strict_host_key_checking=False, + username="adminuser", + password="H@Sh1CoR3!", + )]) + ``` + ## Import Spring Cloud Configuration Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_connection.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_connection.py index 40930dda09..fb545903d4 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_connection.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_connection.py @@ -338,6 +338,54 @@ def __init__(__self__, """ Manages a service connector for spring cloud app. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", spring_cloud_app_id=example_spring_cloud_app.id) + example_spring_cloud_connection = azure.appplatform.SpringCloudConnection("exampleSpringCloudConnection", + spring_cloud_id=example_spring_cloud_java_deployment.id, + target_resource_id=example_sql_database.id, + authentication=azure.appplatform.SpringCloudConnectionAuthenticationArgs( + type="systemAssignedIdentity", + )) + ``` + ## Import Service Connector for spring cloud can be imported using the `resource id`, e.g. @@ -365,6 +413,54 @@ def __init__(__self__, """ Manages a service connector for spring cloud app. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", spring_cloud_app_id=example_spring_cloud_app.id) + example_spring_cloud_connection = azure.appplatform.SpringCloudConnection("exampleSpringCloudConnection", + spring_cloud_id=example_spring_cloud_java_deployment.id, + target_resource_id=example_sql_database.id, + authentication=azure.appplatform.SpringCloudConnectionAuthenticationArgs( + type="systemAssignedIdentity", + )) + ``` + ## Import Service Connector for spring cloud can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_container_deployment.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_container_deployment.py index 81554277a9..f951d0a5d8 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_container_deployment.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_container_deployment.py @@ -486,6 +486,38 @@ def __init__(__self__, """ Manages a Spring Cloud Container Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_spring_cloud_service.resource_group_name, + service_name=example_spring_cloud_service.name) + example_spring_cloud_container_deployment = azure.appplatform.SpringCloudContainerDeployment("exampleSpringCloudContainerDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + instance_count=2, + arguments=[ + "-cp", + "/app/resources:/app/classes:/app/libs/*", + "hello.Application", + ], + commands=["java"], + environment_variables={ + "Foo": "Bar", + "Env": "Staging", + }, + server="docker.io", + image="springio/gs-spring-boot-docker", + language_framework="springboot") + ``` + ## Import Spring Cloud Container Deployments can be imported using the `resource id`, e.g. @@ -517,6 +549,38 @@ def __init__(__self__, """ Manages a Spring Cloud Container Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_spring_cloud_service.resource_group_name, + service_name=example_spring_cloud_service.name) + example_spring_cloud_container_deployment = azure.appplatform.SpringCloudContainerDeployment("exampleSpringCloudContainerDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + instance_count=2, + arguments=[ + "-cp", + "/app/resources:/app/classes:/app/libs/*", + "hello.Application", + ], + commands=["java"], + environment_variables={ + "Foo": "Bar", + "Env": "Staging", + }, + server="docker.io", + image="springio/gs-spring-boot-docker", + language_framework="springboot") + ``` + ## Import Spring Cloud Container Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_customized_accelerator.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_customized_accelerator.py index 7b806ae990..1e7e51f71b 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_customized_accelerator.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_customized_accelerator.py @@ -337,6 +337,34 @@ def __init__(__self__, """ Manages a Spring Cloud Customized Accelerator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_accelerator = azure.appplatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_customized_accelerator = azure.appplatform.SpringCloudCustomizedAccelerator("exampleSpringCloudCustomizedAccelerator", + spring_cloud_accelerator_id=example_spring_cloud_accelerator.id, + git_repository=azure.appplatform.SpringCloudCustomizedAcceleratorGitRepositoryArgs( + url="https://github.com/Azure-Samples/piggymetrics", + git_tag="spring.version.2.0.3", + interval_in_seconds=100, + ), + accelerator_tags=[ + "tag-a", + "tag-b", + ], + description="example description", + display_name="example name", + icon_url="https://images.freecreatives.com/wp-content/uploads/2015/05/smiley-559124_640.jpg") + ``` + ## Import Spring Cloud Customized Accelerators can be imported using the `resource id`, e.g. @@ -364,6 +392,34 @@ def __init__(__self__, """ Manages a Spring Cloud Customized Accelerator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_accelerator = azure.appplatform.SpringCloudAccelerator("exampleSpringCloudAccelerator", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_customized_accelerator = azure.appplatform.SpringCloudCustomizedAccelerator("exampleSpringCloudCustomizedAccelerator", + spring_cloud_accelerator_id=example_spring_cloud_accelerator.id, + git_repository=azure.appplatform.SpringCloudCustomizedAcceleratorGitRepositoryArgs( + url="https://github.com/Azure-Samples/piggymetrics", + git_tag="spring.version.2.0.3", + interval_in_seconds=100, + ), + accelerator_tags=[ + "tag-a", + "tag-b", + ], + description="example description", + display_name="example name", + icon_url="https://images.freecreatives.com/wp-content/uploads/2015/05/smiley-559124_640.jpg") + ``` + ## Import Spring Cloud Customized Accelerators can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_dev_tool_portal.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_dev_tool_portal.py index 66f6472cae..896ba99692 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_dev_tool_portal.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_dev_tool_portal.py @@ -297,6 +297,35 @@ def __init__(__self__, Manages a Spring Cloud Dev Tool Portal. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_dev_tool_portal = azure.appplatform.SpringCloudDevToolPortal("exampleSpringCloudDevToolPortal", + spring_cloud_service_id=example_spring_cloud_service.id, + public_network_access_enabled=True, + sso=azure.appplatform.SpringCloudDevToolPortalSsoArgs( + client_id="example id", + client_secret="example secret", + metadata_url=f"https://login.microsoftonline.com/{current.tenant_id}/v2.0/.well-known/openid-configuration", + scopes=[ + "openid", + "profile", + "email", + ], + ), + application_accelerator_enabled=True, + application_live_view_enabled=True) + ``` + ## Import Spring Cloud Dev Tool Portals can be imported using the `resource id`, e.g. @@ -325,6 +354,35 @@ def __init__(__self__, Manages a Spring Cloud Dev Tool Portal. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_dev_tool_portal = azure.appplatform.SpringCloudDevToolPortal("exampleSpringCloudDevToolPortal", + spring_cloud_service_id=example_spring_cloud_service.id, + public_network_access_enabled=True, + sso=azure.appplatform.SpringCloudDevToolPortalSsoArgs( + client_id="example id", + client_secret="example secret", + metadata_url=f"https://login.microsoftonline.com/{current.tenant_id}/v2.0/.well-known/openid-configuration", + scopes=[ + "openid", + "profile", + "email", + ], + ), + application_accelerator_enabled=True, + application_live_view_enabled=True) + ``` + ## Import Spring Cloud Dev Tool Portals can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway.py index 98cac91416..ee3bcbba47 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway.py @@ -594,6 +594,49 @@ def __init__(__self__, Manages a Spring Cloud Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", + spring_cloud_service_id=example_spring_cloud_service.id, + https_only=False, + public_network_access_enabled=True, + instance_count=2, + api_metadata=azure.appplatform.SpringCloudGatewayApiMetadataArgs( + description="example description", + documentation_url="https://www.example.com/docs", + server_url="https://wwww.example.com", + title="example title", + version="1.0", + ), + cors=azure.appplatform.SpringCloudGatewayCorsArgs( + credentials_allowed=False, + allowed_headers=["*"], + allowed_methods=["PUT"], + allowed_origins=["example.com"], + exposed_headers=["x-example-header"], + max_age_seconds=86400, + ), + quota=azure.appplatform.SpringCloudGatewayQuotaArgs( + cpu="1", + memory="2Gi", + ), + sso=azure.appplatform.SpringCloudGatewaySsoArgs( + client_id="example id", + client_secret="example secret", + issuer_uri="https://www.test.com/issueToken", + scopes=["read"], + )) + ``` + ## Import Spring Cloud Gateways can be imported using the `resource id`, e.g. @@ -629,6 +672,49 @@ def __init__(__self__, Manages a Spring Cloud Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", + spring_cloud_service_id=example_spring_cloud_service.id, + https_only=False, + public_network_access_enabled=True, + instance_count=2, + api_metadata=azure.appplatform.SpringCloudGatewayApiMetadataArgs( + description="example description", + documentation_url="https://www.example.com/docs", + server_url="https://wwww.example.com", + title="example title", + version="1.0", + ), + cors=azure.appplatform.SpringCloudGatewayCorsArgs( + credentials_allowed=False, + allowed_headers=["*"], + allowed_methods=["PUT"], + allowed_origins=["example.com"], + exposed_headers=["x-example-header"], + max_age_seconds=86400, + ), + quota=azure.appplatform.SpringCloudGatewayQuotaArgs( + cpu="1", + memory="2Gi", + ), + sso=azure.appplatform.SpringCloudGatewaySsoArgs( + client_id="example id", + client_secret="example secret", + issuer_uri="https://www.test.com/issueToken", + scopes=["read"], + )) + ``` + ## Import Spring Cloud Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_custom_domain.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_custom_domain.py index 73c7c8d3eb..137cc14a75 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_custom_domain.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_custom_domain.py @@ -172,6 +172,21 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_gateway_custom_domain = azure.appplatform.SpringCloudGatewayCustomDomain("exampleSpringCloudGatewayCustomDomain", spring_cloud_gateway_id=example_spring_cloud_gateway.id) + ``` + ## Import Spring Cloud Gateway Custom Domains can be imported using the `resource id`, e.g. @@ -197,6 +212,21 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_gateway_custom_domain = azure.appplatform.SpringCloudGatewayCustomDomain("exampleSpringCloudGatewayCustomDomain", spring_cloud_gateway_id=example_spring_cloud_gateway.id) + ``` + ## Import Spring Cloud Gateway Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_route_config.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_route_config.py index 4e3ae1d4fb..bfd8ab7948 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_route_config.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_gateway_route_config.py @@ -416,6 +416,44 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_gateway_route_config = azure.appplatform.SpringCloudGatewayRouteConfig("exampleSpringCloudGatewayRouteConfig", + spring_cloud_gateway_id=example_spring_cloud_gateway.id, + spring_cloud_app_id=example_spring_cloud_app.id, + protocol="HTTPS", + routes=[azure.appplatform.SpringCloudGatewayRouteConfigRouteArgs( + description="example description", + filters=[ + "StripPrefix=2", + "RateLimit=1,1s", + ], + order=1, + predicates=["Path=/api5/customer/**"], + sso_validation_enabled=True, + title="myApp route config", + token_relay=True, + uri="https://www.example.com", + classification_tags=[ + "tag1", + "tag2", + ], + )]) + ``` + ## Import Spring Cloud Gateway Route Configs can be imported using the `resource id`, e.g. @@ -449,6 +487,44 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="E0") + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name) + example_spring_cloud_gateway = azure.appplatform.SpringCloudGateway("exampleSpringCloudGateway", spring_cloud_service_id=example_spring_cloud_service.id) + example_spring_cloud_gateway_route_config = azure.appplatform.SpringCloudGatewayRouteConfig("exampleSpringCloudGatewayRouteConfig", + spring_cloud_gateway_id=example_spring_cloud_gateway.id, + spring_cloud_app_id=example_spring_cloud_app.id, + protocol="HTTPS", + routes=[azure.appplatform.SpringCloudGatewayRouteConfigRouteArgs( + description="example description", + filters=[ + "StripPrefix=2", + "RateLimit=1,1s", + ], + order=1, + predicates=["Path=/api5/customer/**"], + sso_validation_enabled=True, + title="myApp route config", + token_relay=True, + uri="https://www.example.com", + classification_tags=[ + "tag1", + "tag2", + ], + )]) + ``` + ## Import Spring Cloud Gateway Route Configs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_java_deployment.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_java_deployment.py index b11e20b3b6..058db03715 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_java_deployment.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_java_deployment.py @@ -338,6 +338,37 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with basic and standard tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + instance_count=2, + jvm_options="-XX:+PrintGC", + quota=azure.appplatform.SpringCloudJavaDeploymentQuotaArgs( + cpu="2", + memory="4Gi", + ), + runtime_version="Java_11", + environment_variables={ + "Foo": "Bar", + "Env": "Staging", + }) + ``` + ## Import Spring Cloud Deployment can be imported using the `resource id`, e.g. @@ -367,6 +398,37 @@ def __init__(__self__, > **NOTE:** This resource is applicable only for Spring Cloud Service with basic and standard tier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_spring_cloud_app = azure.appplatform.SpringCloudApp("exampleSpringCloudApp", + resource_group_name=example_resource_group.name, + service_name=example_spring_cloud_service.name, + identity=azure.appplatform.SpringCloudAppIdentityArgs( + type="SystemAssigned", + )) + example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", + spring_cloud_app_id=example_spring_cloud_app.id, + instance_count=2, + jvm_options="-XX:+PrintGC", + quota=azure.appplatform.SpringCloudJavaDeploymentQuotaArgs( + cpu="2", + memory="4Gi", + ), + runtime_version="Java_11", + environment_variables={ + "Foo": "Bar", + "Env": "Staging", + }) + ``` + ## Import Spring Cloud Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_service.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_service.py index 545d5a4be0..ba00fcdfe3 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_service.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_service.py @@ -708,6 +708,38 @@ def __init__(__self__, """ Manages an Azure Spring Cloud Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="S0", + config_server_git_setting=azure.appplatform.SpringCloudServiceConfigServerGitSettingArgs( + uri="https://github.com/Azure-Samples/piggymetrics", + label="config", + search_paths=[ + "dir1", + "dir2", + ], + ), + trace=azure.appplatform.SpringCloudServiceTraceArgs( + connection_string=example_insights.connection_string, + sample_rate=10, + ), + tags={ + "Env": "staging", + }) + ``` + ## Import Spring Cloud services can be imported using the `resource id`, e.g. @@ -743,6 +775,38 @@ def __init__(__self__, """ Manages an Azure Spring Cloud Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="S0", + config_server_git_setting=azure.appplatform.SpringCloudServiceConfigServerGitSettingArgs( + uri="https://github.com/Azure-Samples/piggymetrics", + label="config", + search_paths=[ + "dir1", + "dir2", + ], + ), + trace=azure.appplatform.SpringCloudServiceTraceArgs( + connection_string=example_insights.connection_string, + sample_rate=10, + ), + tags={ + "Env": "staging", + }) + ``` + ## Import Spring Cloud services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appplatform/spring_cloud_storage.py b/sdk/python/pulumi_azure/appplatform/spring_cloud_storage.py index 84d863a979..fd57355793 100644 --- a/sdk/python/pulumi_azure/appplatform/spring_cloud_storage.py +++ b/sdk/python/pulumi_azure/appplatform/spring_cloud_storage.py @@ -217,6 +217,27 @@ def __init__(__self__, """ Manages a Spring Cloud Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_spring_cloud_storage = azure.appplatform.SpringCloudStorage("exampleSpringCloudStorage", + spring_cloud_service_id=example_spring_cloud_service.id, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key) + ``` + ## Import Spring Cloud Storages can be imported using the `resource id`, e.g. @@ -241,6 +262,27 @@ def __init__(__self__, """ Manages a Spring Cloud Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_spring_cloud_service = azure.appplatform.SpringCloudService("exampleSpringCloudService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_spring_cloud_storage = azure.appplatform.SpringCloudStorage("exampleSpringCloudStorage", + spring_cloud_service_id=example_spring_cloud_service.id, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key) + ``` + ## Import Spring Cloud Storages can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/active_slot.py b/sdk/python/pulumi_azure/appservice/active_slot.py index a962f3fa0b..5036fc69a9 100644 --- a/sdk/python/pulumi_azure/appservice/active_slot.py +++ b/sdk/python/pulumi_azure/appservice/active_slot.py @@ -184,6 +184,29 @@ def __init__(__self__, > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server") + # ... + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup") + # ... + example_plan = azure.appservice.Plan("examplePlan") + # ... + example_app_service = azure.appservice.AppService("exampleAppService") + # ... + example_slot = azure.appservice.Slot("exampleSlot") + # ... + example_active_slot = azure.appservice.ActiveSlot("exampleActiveSlot", + resource_group_name=example_resource_group.name, + app_service_name=example_app_service.name, + app_service_slot_name=example_slot.name) + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] app_service_name: The name of the App Service within which the Slot exists. Changing this forces a new resource to be created. @@ -203,6 +226,29 @@ def __init__(__self__, > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server") + # ... + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup") + # ... + example_plan = azure.appservice.Plan("examplePlan") + # ... + example_app_service = azure.appservice.AppService("exampleAppService") + # ... + example_slot = azure.appservice.Slot("exampleSlot") + # ... + example_active_slot = azure.appservice.ActiveSlot("exampleActiveSlot", + resource_group_name=example_resource_group.name, + app_service_name=example_app_service.name, + app_service_slot_name=example_slot.name) + ``` + :param str resource_name: The name of the resource. :param ActiveSlotArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_azure/appservice/app_connection.py b/sdk/python/pulumi_azure/appservice/app_connection.py index aa7bdcf438..62291b78bf 100644 --- a/sdk/python/pulumi_azure/appservice/app_connection.py +++ b/sdk/python/pulumi_azure/appservice/app_connection.py @@ -346,6 +346,60 @@ def __init__(__self__, """ Manages a service connector for function app. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition") + example_storage_account_account = azure.storage.Account("exampleStorage/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="P1v2", + os_type="Linux") + test = azure.appservice.FunctionApp("test", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + app_service_plan_id=azurerm_app_service_plan["test"]["id"], + storage_account_name=azurerm_storage_account["test"]["name"], + storage_account_access_key=azurerm_storage_account["test"]["primary_access_key"]) + example_app_connection = azure.appservice.AppConnection("exampleAppConnection", + function_app_id=azurerm_function_app["example"]["id"], + target_resource_id=azurerm_cosmosdb_account["test"]["id"], + authentication=azure.appservice.AppConnectionAuthenticationArgs( + type="systemAssignedIdentity", + )) + ``` + ## Import Service Connector for app service can be imported using the `resource id`, e.g. @@ -375,6 +429,60 @@ def __init__(__self__, """ Manages a service connector for function app. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition") + example_storage_account_account = azure.storage.Account("exampleStorage/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="P1v2", + os_type="Linux") + test = azure.appservice.FunctionApp("test", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + app_service_plan_id=azurerm_app_service_plan["test"]["id"], + storage_account_name=azurerm_storage_account["test"]["name"], + storage_account_access_key=azurerm_storage_account["test"]["primary_access_key"]) + example_app_connection = azure.appservice.AppConnection("exampleAppConnection", + function_app_id=azurerm_function_app["example"]["id"], + target_resource_id=azurerm_cosmosdb_account["test"]["id"], + authentication=azure.appservice.AppConnectionAuthenticationArgs( + type="systemAssignedIdentity", + )) + ``` + ## Import Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/app_service.py b/sdk/python/pulumi_azure/appservice/app_service.py index 318c779478..9f2e0c14db 100644 --- a/sdk/python/pulumi_azure/appservice/app_service.py +++ b/sdk/python/pulumi_azure/appservice/app_service.py @@ -994,6 +994,40 @@ def __init__(__self__, > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. + ## Example Usage + + This example provisions a Windows App Service. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.AppServiceSiteConfigArgs( + dotnet_framework_version="v4.0", + scm_type="LocalGit", + ), + app_settings={ + "SOME_KEY": "some-value", + }, + connection_strings=[azure.appservice.AppServiceConnectionStringArgs( + name="Database", + type="SQLServer", + value="Server=some-server.mydomain.com;Integrated Security=SSPI", + )]) + ``` + ## Import App Services can be imported using the `resource id`, e.g. @@ -1038,6 +1072,40 @@ def __init__(__self__, > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. + ## Example Usage + + This example provisions a Windows App Service. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.AppServiceSiteConfigArgs( + dotnet_framework_version="v4.0", + scm_type="LocalGit", + ), + app_settings={ + "SOME_KEY": "some-value", + }, + connection_strings=[azure.appservice.AppServiceConnectionStringArgs( + name="Database", + type="SQLServer", + value="Server=some-server.mydomain.com;Integrated Security=SSPI", + )]) + ``` + ## Import App Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/certificate.py b/sdk/python/pulumi_azure/appservice/certificate.py index 3ff08be1cb..cce309257a 100644 --- a/sdk/python/pulumi_azure/appservice/certificate.py +++ b/sdk/python/pulumi_azure/appservice/certificate.py @@ -531,6 +531,23 @@ def __init__(__self__, """ Manages an App Service certificate. + ## Example Usage + + This example provisions an App Service Certificate from a Local File. + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_certificate = azure.appservice.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pfx_blob=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx"), + password="password123!") + ``` + ## Import App Service Certificates can be imported using the `resource id`, e.g. @@ -561,6 +578,23 @@ def __init__(__self__, """ Manages an App Service certificate. + ## Example Usage + + This example provisions an App Service Certificate from a Local File. + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_certificate = azure.appservice.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pfx_blob=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx"), + password="password123!") + ``` + ## Import App Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/certificate_order.py b/sdk/python/pulumi_azure/appservice/certificate_order.py index 432669cc50..1379d3e59c 100644 --- a/sdk/python/pulumi_azure/appservice/certificate_order.py +++ b/sdk/python/pulumi_azure/appservice/certificate_order.py @@ -635,6 +635,20 @@ def __init__(__self__, """ Manages an App Service Certificate Order. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_certificate_order = azure.appservice.CertificateOrder("exampleCertificateOrder", + resource_group_name=example_resource_group.name, + location="global", + distinguished_name="CN=example.com", + product_type="Standard") + ``` + ## Import App Service Certificate Orders can be imported using the `resource id`, e.g. @@ -667,6 +681,20 @@ def __init__(__self__, """ Manages an App Service Certificate Order. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_certificate_order = azure.appservice.CertificateOrder("exampleCertificateOrder", + resource_group_name=example_resource_group.name, + location="global", + distinguished_name="CN=example.com", + product_type="Standard") + ``` + ## Import App Service Certificate Orders can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/connection.py b/sdk/python/pulumi_azure/appservice/connection.py index 4bfd700859..c31a75e50c 100644 --- a/sdk/python/pulumi_azure/appservice/connection.py +++ b/sdk/python/pulumi_azure/appservice/connection.py @@ -346,6 +346,54 @@ def __init__(__self__, """ Manages a service connector for app service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="P1v2", + os_type="Linux") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_connection = azure.appservice.Connection("exampleConnection", + app_service_id=example_linux_web_app.id, + target_resource_id=example_sql_database.id, + authentication=azure.appservice.ConnectionAuthenticationArgs( + type="systemAssignedIdentity", + )) + ``` + ## Import Service Connector for app service can be imported using the `resource id`, e.g. @@ -375,6 +423,54 @@ def __init__(__self__, """ Manages a service connector for app service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="P1v2", + os_type="Linux") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_connection = azure.appservice.Connection("exampleConnection", + app_service_id=example_linux_web_app.id, + target_resource_id=example_sql_database.id, + authentication=azure.appservice.ConnectionAuthenticationArgs( + type="systemAssignedIdentity", + )) + ``` + ## Import Service Connector for app service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/custom_hostname_binding.py b/sdk/python/pulumi_azure/appservice/custom_hostname_binding.py index d9206bd79b..c46c4e016e 100644 --- a/sdk/python/pulumi_azure/appservice/custom_hostname_binding.py +++ b/sdk/python/pulumi_azure/appservice/custom_hostname_binding.py @@ -290,6 +290,36 @@ def __init__(__self__, """ Manages a Hostname Binding within an App Service (or Function App). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_custom_hostname_binding = azure.appservice.CustomHostnameBinding("exampleCustomHostnameBinding", + hostname="www.mywebsite.com", + app_service_name=example_app_service.name, + resource_group_name=example_resource_group.name) + ``` + ## Import App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. @@ -319,6 +349,36 @@ def __init__(__self__, """ Manages a Hostname Binding within an App Service (or Function App). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_custom_hostname_binding = azure.appservice.CustomHostnameBinding("exampleCustomHostnameBinding", + hostname="www.mywebsite.com", + app_service_name=example_app_service.name, + resource_group_name=example_resource_group.name) + ``` + ## Import App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/environment.py b/sdk/python/pulumi_azure/appservice/environment.py index a12add16d9..5e43955987 100644 --- a/sdk/python/pulumi_azure/appservice/environment.py +++ b/sdk/python/pulumi_azure/appservice/environment.py @@ -513,6 +513,41 @@ def __init__(__self__, """ Manages an App Service Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + ase = azure.network.Subnet("ase", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + gateway = azure.network.Subnet("gateway", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_environment = azure.appservice.Environment("exampleEnvironment", + resource_group_name=example_resource_group.name, + subnet_id=ase.id, + pricing_tier="I2", + front_end_scale_factor=10, + internal_load_balancing_mode="Web, Publishing", + allowed_user_ip_cidrs=[ + "11.22.33.44/32", + "55.66.77.0/24", + ], + cluster_settings=[azure.appservice.EnvironmentClusterSettingArgs( + name="DisableTls1.0", + value="1", + )]) + ``` + ## Import The App Service Environment can be imported using the `resource id`, e.g. @@ -546,6 +581,41 @@ def __init__(__self__, """ Manages an App Service Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + ase = azure.network.Subnet("ase", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + gateway = azure.network.Subnet("gateway", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_environment = azure.appservice.Environment("exampleEnvironment", + resource_group_name=example_resource_group.name, + subnet_id=ase.id, + pricing_tier="I2", + front_end_scale_factor=10, + internal_load_balancing_mode="Web, Publishing", + allowed_user_ip_cidrs=[ + "11.22.33.44/32", + "55.66.77.0/24", + ], + cluster_settings=[azure.appservice.EnvironmentClusterSettingArgs( + name="DisableTls1.0", + value="1", + )]) + ``` + ## Import The App Service Environment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/function_app.py b/sdk/python/pulumi_azure/appservice/function_app.py index 89856c51f4..e15f16cf68 100644 --- a/sdk/python/pulumi_azure/appservice/function_app.py +++ b/sdk/python/pulumi_azure/appservice/function_app.py @@ -1053,6 +1053,91 @@ def __init__(__self__, For an example, check the `appservice.VirtualNetworkSwiftConnection` documentation. ## Example Usage + ### With App Service Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + ``` + ### In A Consumption Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="FunctionApp", + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + ``` + ### Linux) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Linux", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + os_type="linux", + version="~3") + ``` + + > **Note:** Version `~3` or `~4` is required for Linux Function Apps. ## Import @@ -1109,6 +1194,91 @@ def __init__(__self__, For an example, check the `appservice.VirtualNetworkSwiftConnection` documentation. ## Example Usage + ### With App Service Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + ``` + ### In A Consumption Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="FunctionApp", + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + ``` + ### Linux) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Linux", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + os_type="linux", + version="~3") + ``` + + > **Note:** Version `~3` or `~4` is required for Linux Function Apps. ## Import diff --git a/sdk/python/pulumi_azure/appservice/function_app_active_slot.py b/sdk/python/pulumi_azure/appservice/function_app_active_slot.py index 06d92064df..57214cdd88 100644 --- a/sdk/python/pulumi_azure/appservice/function_app_active_slot.py +++ b/sdk/python/pulumi_azure/appservice/function_app_active_slot.py @@ -158,6 +158,64 @@ def __init__(__self__, Manages a Function App Active Slot. ## Example Usage + ### Windows Function App + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="Y1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + example_windows_function_app_slot = azure.appservice.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", + function_app_id=example_windows_function_app.id, + storage_account_name=example_account.name, + site_config=azure.appservice.WindowsFunctionAppSlotSiteConfigArgs()) + example_function_app_active_slot = azure.appservice.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", slot_id=example_windows_function_app_slot.id) + ``` + ### Linux Function App + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="Y1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs()) + example_linux_function_app_slot = azure.appservice.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", + function_app_id=example_linux_function_app.name, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSlotSiteConfigArgs()) + example_function_app_active_slot = azure.appservice.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", slot_id=example_linux_function_app_slot.id) + ``` ## Import @@ -182,6 +240,64 @@ def __init__(__self__, Manages a Function App Active Slot. ## Example Usage + ### Windows Function App + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="Y1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + example_windows_function_app_slot = azure.appservice.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", + function_app_id=example_windows_function_app.id, + storage_account_name=example_account.name, + site_config=azure.appservice.WindowsFunctionAppSlotSiteConfigArgs()) + example_function_app_active_slot = azure.appservice.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", slot_id=example_windows_function_app_slot.id) + ``` + ### Linux Function App + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="Y1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs()) + example_linux_function_app_slot = azure.appservice.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", + function_app_id=example_linux_function_app.name, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSlotSiteConfigArgs()) + example_function_app_active_slot = azure.appservice.FunctionAppActiveSlot("exampleFunctionAppActiveSlot", slot_id=example_linux_function_app_slot.id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/function_app_function.py b/sdk/python/pulumi_azure/appservice/function_app_function.py index fa81f33697..410deee8fd 100644 --- a/sdk/python/pulumi_azure/appservice/function_app_function.py +++ b/sdk/python/pulumi_azure/appservice/function_app_function.py @@ -476,6 +476,120 @@ def __init__(__self__, Manages a Function App Function. ## Example Usage + ### Basic HTTP Trigger + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Linux", + sku_name="S1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs( + application_stack=azure.appservice.LinuxFunctionAppSiteConfigApplicationStackArgs( + python_version="3.9", + ), + )) + example_function_app_function = azure.appservice.FunctionAppFunction("exampleFunctionAppFunction", + function_app_id=example_linux_function_app.id, + language="Python", + test_data=json.dumps({ + "name": "Azure", + }), + config_json=json.dumps({ + "bindings": [ + { + "authLevel": "function", + "direction": "in", + "methods": [ + "get", + "post", + ], + "name": "req", + "type": "httpTrigger", + }, + { + "direction": "out", + "name": "$return", + "type": "http", + }, + ], + })) + ``` + ### HTTP Trigger With Code Upload + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Windows", + sku_name="S1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs( + application_stack=azure.appservice.WindowsFunctionAppSiteConfigApplicationStackArgs( + dotnet_version="6", + ), + )) + example_function_app_function = azure.appservice.FunctionAppFunction("exampleFunctionAppFunction", + function_app_id=example_windows_function_app.id, + language="CSharp", + files=[azure.appservice.FunctionAppFunctionFileArgs( + name="run.csx", + content=(lambda path: open(path).read())("exampledata/run.csx"), + )], + test_data=json.dumps({ + "name": "Azure", + }), + config_json=json.dumps({ + "bindings": [ + { + "authLevel": "function", + "direction": "in", + "methods": [ + "get", + "post", + ], + "name": "req", + "type": "httpTrigger", + }, + { + "direction": "out", + "name": "$return", + "type": "http", + }, + ], + })) + ``` ## Import @@ -507,6 +621,120 @@ def __init__(__self__, Manages a Function App Function. ## Example Usage + ### Basic HTTP Trigger + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Linux", + sku_name="S1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs( + application_stack=azure.appservice.LinuxFunctionAppSiteConfigApplicationStackArgs( + python_version="3.9", + ), + )) + example_function_app_function = azure.appservice.FunctionAppFunction("exampleFunctionAppFunction", + function_app_id=example_linux_function_app.id, + language="Python", + test_data=json.dumps({ + "name": "Azure", + }), + config_json=json.dumps({ + "bindings": [ + { + "authLevel": "function", + "direction": "in", + "methods": [ + "get", + "post", + ], + "name": "req", + "type": "httpTrigger", + }, + { + "direction": "out", + "name": "$return", + "type": "http", + }, + ], + })) + ``` + ### HTTP Trigger With Code Upload + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Windows", + sku_name="S1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs( + application_stack=azure.appservice.WindowsFunctionAppSiteConfigApplicationStackArgs( + dotnet_version="6", + ), + )) + example_function_app_function = azure.appservice.FunctionAppFunction("exampleFunctionAppFunction", + function_app_id=example_windows_function_app.id, + language="CSharp", + files=[azure.appservice.FunctionAppFunctionFileArgs( + name="run.csx", + content=(lambda path: open(path).read())("exampledata/run.csx"), + )], + test_data=json.dumps({ + "name": "Azure", + }), + config_json=json.dumps({ + "bindings": [ + { + "authLevel": "function", + "direction": "in", + "methods": [ + "get", + "post", + ], + "name": "req", + "type": "httpTrigger", + }, + { + "direction": "out", + "name": "$return", + "type": "http", + }, + ], + })) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/function_app_hybrid_connection.py b/sdk/python/pulumi_azure/appservice/function_app_hybrid_connection.py index edf4fd4fef..f6be483ada 100644 --- a/sdk/python/pulumi_azure/appservice/function_app_hybrid_connection.py +++ b/sdk/python/pulumi_azure/appservice/function_app_hybrid_connection.py @@ -355,6 +355,49 @@ def __init__(__self__, """ Manages a Function App Hybrid Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Windows", + sku_name="S1") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + example_function_app_hybrid_connection = azure.appservice.FunctionAppHybridConnection("exampleFunctionAppHybridConnection", + function_app_id=example_windows_web_app.id, + relay_id=example_hybrid_connection.id, + hostname="myhostname.example", + port=8081) + ``` + ## Import a Function App Hybrid Connection can be imported using the `resource id`, e.g. @@ -380,6 +423,49 @@ def __init__(__self__, """ Manages a Function App Hybrid Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Windows", + sku_name="S1") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + example_function_app_hybrid_connection = azure.appservice.FunctionAppHybridConnection("exampleFunctionAppHybridConnection", + function_app_id=example_windows_web_app.id, + relay_id=example_hybrid_connection.id, + hostname="myhostname.example", + port=8081) + ``` + ## Import a Function App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/function_app_slot.py b/sdk/python/pulumi_azure/appservice/function_app_slot.py index eac3330a3b..585308c080 100644 --- a/sdk/python/pulumi_azure/appservice/function_app_slot.py +++ b/sdk/python/pulumi_azure/appservice/function_app_slot.py @@ -949,6 +949,39 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.LinuxFunctionAppSlot` resources instead. ## Example Usage + ### With App Service Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + example_function_app_slot = azure.appservice.FunctionAppSlot("exampleFunctionAppSlot", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + function_app_name=example_function_app.name, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + ``` ## Import @@ -1000,6 +1033,39 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.LinuxFunctionAppSlot` resources instead. ## Example Usage + ### With App Service Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + example_function_app_slot = azure.appservice.FunctionAppSlot("exampleFunctionAppSlot", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + function_app_name=example_function_app.name, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/get_app_service.py b/sdk/python/pulumi_azure/appservice/get_app_service.py index 366c48626d..2f9578438b 100644 --- a/sdk/python/pulumi_azure/appservice/get_app_service.py +++ b/sdk/python/pulumi_azure/appservice/get_app_service.py @@ -287,6 +287,17 @@ def get_app_service(name: Optional[str] = None, !> **Note:** The `appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.LinuxWebApp` data sources instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_app_service(name="search-app-service", + resource_group_name="search-service") + pulumi.export("appServiceId", example.id) + ``` + :param str name: The name of the App Service. :param str resource_group_name: The Name of the Resource Group where the App Service exists. @@ -330,6 +341,17 @@ def get_app_service_output(name: Optional[pulumi.Input[str]] = None, !> **Note:** The `appservice.AppService` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.LinuxWebApp` data sources instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_app_service(name="search-app-service", + resource_group_name="search-service") + pulumi.export("appServiceId", example.id) + ``` + :param str name: The name of the App Service. :param str resource_group_name: The Name of the Resource Group where the App Service exists. diff --git a/sdk/python/pulumi_azure/appservice/get_app_service_environment.py b/sdk/python/pulumi_azure/appservice/get_app_service_environment.py index 7a015d4c22..96f9437227 100644 --- a/sdk/python/pulumi_azure/appservice/get_app_service_environment.py +++ b/sdk/python/pulumi_azure/appservice/get_app_service_environment.py @@ -168,6 +168,17 @@ def get_app_service_environment(name: Optional[str] = None, """ Use this data source to access information about an existing App Service Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_app_service_environment(name="existing-ase", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this App Service Environment. :param str resource_group_name: The name of the Resource Group where the App Service Environment exists. @@ -199,6 +210,17 @@ def get_app_service_environment_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing App Service Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_app_service_environment(name="existing-ase", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this App Service Environment. :param str resource_group_name: The name of the Resource Group where the App Service Environment exists. diff --git a/sdk/python/pulumi_azure/appservice/get_app_service_plan.py b/sdk/python/pulumi_azure/appservice/get_app_service_plan.py index 126e62c564..4e7c259434 100644 --- a/sdk/python/pulumi_azure/appservice/get_app_service_plan.py +++ b/sdk/python/pulumi_azure/appservice/get_app_service_plan.py @@ -203,6 +203,17 @@ def get_app_service_plan(name: Optional[str] = None, !> **Note:** The `appservice.Plan` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.ServicePlan` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_app_service_plan(name="search-app-service-plan", + resource_group_name="search-service") + pulumi.export("appServicePlanId", example.id) + ``` + :param str name: The name of the App Service Plan. :param str resource_group_name: The Name of the Resource Group where the App Service Plan exists. @@ -239,6 +250,17 @@ def get_app_service_plan_output(name: Optional[pulumi.Input[str]] = None, !> **Note:** The `appservice.Plan` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.ServicePlan` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_app_service_plan(name="search-app-service-plan", + resource_group_name="search-service") + pulumi.export("appServicePlanId", example.id) + ``` + :param str name: The name of the App Service Plan. :param str resource_group_name: The Name of the Resource Group where the App Service Plan exists. diff --git a/sdk/python/pulumi_azure/appservice/get_certificate.py b/sdk/python/pulumi_azure/appservice/get_certificate.py index 92e0dfe58b..04240b1e8b 100644 --- a/sdk/python/pulumi_azure/appservice/get_certificate.py +++ b/sdk/python/pulumi_azure/appservice/get_certificate.py @@ -171,6 +171,17 @@ def get_certificate(name: Optional[str] = None, """ Use this data source to access information about an App Service Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_certificate(name="example-app-service-certificate", + resource_group_name="example-rg") + pulumi.export("appServiceCertificateId", example.id) + ``` + :param str name: Specifies the name of the certificate. :param str resource_group_name: The name of the resource group in which to create the certificate. @@ -205,6 +216,17 @@ def get_certificate_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an App Service Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_certificate(name="example-app-service-certificate", + resource_group_name="example-rg") + pulumi.export("appServiceCertificateId", example.id) + ``` + :param str name: Specifies the name of the certificate. :param str resource_group_name: The name of the resource group in which to create the certificate. diff --git a/sdk/python/pulumi_azure/appservice/get_certificate_order.py b/sdk/python/pulumi_azure/appservice/get_certificate_order.py index 48c525c1e9..64e5d184af 100644 --- a/sdk/python/pulumi_azure/appservice/get_certificate_order.py +++ b/sdk/python/pulumi_azure/appservice/get_certificate_order.py @@ -273,6 +273,17 @@ def get_certificate_order(name: Optional[str] = None, """ Use this data source to access information about an existing App Service Certificate Order. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_certificate_order(name="example-cert-order", + resource_group_name="example-resources") + pulumi.export("certificateOrderId", example.id) + ``` + :param str name: The name of the App Service. :param str resource_group_name: The Name of the Resource Group where the App Service exists. @@ -313,6 +324,17 @@ def get_certificate_order_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing App Service Certificate Order. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_certificate_order(name="example-cert-order", + resource_group_name="example-resources") + pulumi.export("certificateOrderId", example.id) + ``` + :param str name: The name of the App Service. :param str resource_group_name: The Name of the Resource Group where the App Service exists. diff --git a/sdk/python/pulumi_azure/appservice/get_environment_v3.py b/sdk/python/pulumi_azure/appservice/get_environment_v3.py index 5c0acf2f3a..6f997734b6 100644 --- a/sdk/python/pulumi_azure/appservice/get_environment_v3.py +++ b/sdk/python/pulumi_azure/appservice/get_environment_v3.py @@ -261,6 +261,17 @@ def get_environment_v3(name: Optional[str] = None, """ Use this data source to access information about an existing 3rd Generation (v3) App Service Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_environment_v3(name="example-ASE", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this v3 App Service Environment. :param str resource_group_name: The name of the Resource Group where the v3 App Service Environment exists. @@ -300,6 +311,17 @@ def get_environment_v3_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing 3rd Generation (v3) App Service Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_environment_v3(name="example-ASE", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this v3 App Service Environment. :param str resource_group_name: The name of the Resource Group where the v3 App Service Environment exists. diff --git a/sdk/python/pulumi_azure/appservice/get_function_app.py b/sdk/python/pulumi_azure/appservice/get_function_app.py index 2e15973c1a..734681d1fd 100644 --- a/sdk/python/pulumi_azure/appservice/get_function_app.py +++ b/sdk/python/pulumi_azure/appservice/get_function_app.py @@ -258,6 +258,16 @@ def get_function_app(name: Optional[str] = None, !> **Note:** The `appservice.FunctionApp` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.LinuxFunctionApp` data sources instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_function_app(name="test-azure-functions", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the Function App resource. :param str resource_group_name: The name of the Resource Group where the Function App exists. @@ -301,6 +311,16 @@ def get_function_app_output(name: Optional[pulumi.Input[str]] = None, !> **Note:** The `appservice.FunctionApp` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `appservice.LinuxFunctionApp` data sources instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_function_app(name="test-azure-functions", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the Function App resource. :param str resource_group_name: The name of the Resource Group where the Function App exists. diff --git a/sdk/python/pulumi_azure/appservice/get_function_app_host_keys.py b/sdk/python/pulumi_azure/appservice/get_function_app_host_keys.py index dd1a5efff4..b945c8eda0 100644 --- a/sdk/python/pulumi_azure/appservice/get_function_app_host_keys.py +++ b/sdk/python/pulumi_azure/appservice/get_function_app_host_keys.py @@ -152,6 +152,16 @@ def get_function_app_host_keys(name: Optional[str] = None, """ Use this data source to fetch the Host Keys of an existing Function App + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_function_app_host_keys(name="example-function", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the Function App. :param str resource_group_name: The name of the Resource Group where the Function App exists. @@ -182,6 +192,16 @@ def get_function_app_host_keys_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to fetch the Host Keys of an existing Function App + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_function_app_host_keys(name="example-function", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the Function App. :param str resource_group_name: The name of the Resource Group where the Function App exists. diff --git a/sdk/python/pulumi_azure/appservice/get_linux_function_app.py b/sdk/python/pulumi_azure/appservice/get_linux_function_app.py index 422d5457b1..c1939e9644 100644 --- a/sdk/python/pulumi_azure/appservice/get_linux_function_app.py +++ b/sdk/python/pulumi_azure/appservice/get_linux_function_app.py @@ -513,6 +513,17 @@ def get_linux_function_app(name: Optional[str] = None, """ Use this data source to access information about an existing Linux Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_linux_function_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name which should be used for this Linux Function App. :param str resource_group_name: The name of the Resource Group where the Linux Function App should exist. @@ -573,6 +584,17 @@ def get_linux_function_app_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Linux Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_linux_function_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name which should be used for this Linux Function App. :param str resource_group_name: The name of the Resource Group where the Linux Function App should exist. diff --git a/sdk/python/pulumi_azure/appservice/get_linux_web_app.py b/sdk/python/pulumi_azure/appservice/get_linux_web_app.py index f21fc8f43a..82f158a029 100644 --- a/sdk/python/pulumi_azure/appservice/get_linux_web_app.py +++ b/sdk/python/pulumi_azure/appservice/get_linux_web_app.py @@ -475,6 +475,17 @@ def get_linux_web_app(name: Optional[str] = None, """ Use this data source to access information about an existing Linux Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_linux_web_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Linux Web App. :param str resource_group_name: The name of the Resource Group where the Linux Web App exists. @@ -532,6 +543,17 @@ def get_linux_web_app_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Linux Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_linux_web_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Linux Web App. :param str resource_group_name: The name of the Resource Group where the Linux Web App exists. diff --git a/sdk/python/pulumi_azure/appservice/get_service_plan.py b/sdk/python/pulumi_azure/appservice/get_service_plan.py index 80e7c31db6..00fa41480b 100644 --- a/sdk/python/pulumi_azure/appservice/get_service_plan.py +++ b/sdk/python/pulumi_azure/appservice/get_service_plan.py @@ -200,6 +200,17 @@ def get_service_plan(name: Optional[str] = None, """ Use this data source to access information about an existing Service Plan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_service_plan(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Service Plan. :param str resource_group_name: The name of the Resource Group where the Service Plan exists. @@ -234,6 +245,17 @@ def get_service_plan_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Service Plan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_service_plan(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Service Plan. :param str resource_group_name: The name of the Resource Group where the Service Plan exists. diff --git a/sdk/python/pulumi_azure/appservice/get_source_control_token.py b/sdk/python/pulumi_azure/appservice/get_source_control_token.py index 69b401b7bd..c4d53a02b8 100644 --- a/sdk/python/pulumi_azure/appservice/get_source_control_token.py +++ b/sdk/python/pulumi_azure/appservice/get_source_control_token.py @@ -77,7 +77,16 @@ def __await__(self): def get_source_control_token(type: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSourceControlTokenResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_source_control_token(type="GitHub") + pulumi.export("id", data["azurerm_app_service_github_token"]["example"]["id"]) + ``` + :param str type: The Token type. Possible values include `Bitbucket`, `Dropbox`, `Github`, and `OneDrive`. """ @@ -97,7 +106,16 @@ def get_source_control_token(type: Optional[str] = None, def get_source_control_token_output(type: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetSourceControlTokenResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_source_control_token(type="GitHub") + pulumi.export("id", data["azurerm_app_service_github_token"]["example"]["id"]) + ``` + :param str type: The Token type. Possible values include `Bitbucket`, `Dropbox`, `Github`, and `OneDrive`. """ diff --git a/sdk/python/pulumi_azure/appservice/get_windows_function_app.py b/sdk/python/pulumi_azure/appservice/get_windows_function_app.py index b9c760a55e..cba71ac498 100644 --- a/sdk/python/pulumi_azure/appservice/get_windows_function_app.py +++ b/sdk/python/pulumi_azure/appservice/get_windows_function_app.py @@ -489,6 +489,17 @@ def get_windows_function_app(name: Optional[str] = None, """ Use this data source to access information about an existing Windows Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_windows_function_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Windows Function App. :param str resource_group_name: The name of the Resource Group where the Windows Function App exists. @@ -547,6 +558,17 @@ def get_windows_function_app_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Windows Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_windows_function_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Windows Function App. :param str resource_group_name: The name of the Resource Group where the Windows Function App exists. diff --git a/sdk/python/pulumi_azure/appservice/get_windows_web_app.py b/sdk/python/pulumi_azure/appservice/get_windows_web_app.py index e002bc322a..3ace1c9892 100644 --- a/sdk/python/pulumi_azure/appservice/get_windows_web_app.py +++ b/sdk/python/pulumi_azure/appservice/get_windows_web_app.py @@ -429,6 +429,17 @@ def get_windows_web_app(name: Optional[str] = None, """ Use this data source to access information about an existing Windows Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_windows_web_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Windows Web App. :param str resource_group_name: The name of the Resource Group where the Windows Web App exists. @@ -482,6 +493,17 @@ def get_windows_web_app_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Windows Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.get_windows_web_app(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Windows Web App. :param str resource_group_name: The name of the Resource Group where the Windows Web App exists. diff --git a/sdk/python/pulumi_azure/appservice/hybrid_connection.py b/sdk/python/pulumi_azure/appservice/hybrid_connection.py index 3dde0cd6cc..ea6ca22e4c 100644 --- a/sdk/python/pulumi_azure/appservice/hybrid_connection.py +++ b/sdk/python/pulumi_azure/appservice/hybrid_connection.py @@ -395,6 +395,43 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.FunctionAppHybridConnection` resources instead. + ## Example Usage + + This example provisions an App Service, a Relay Hybrid Connection, and a Service Bus using their outputs to create the App Service Hybrid Connection. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name, + user_metadata="examplemetadata") + example_appservice_hybrid_connection_hybrid_connection = azure.appservice.HybridConnection("exampleAppservice/hybridConnectionHybridConnection", + app_service_name=example_app_service.name, + resource_group_name=example_resource_group.name, + relay_id=example_hybrid_connection.id, + hostname="testhostname.example", + port=8080, + send_key_name="exampleSharedAccessKey") + ``` + ## Import App Service Hybrid Connections can be imported using the `resource id`, e.g. @@ -423,6 +460,43 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.FunctionAppHybridConnection` resources instead. + ## Example Usage + + This example provisions an App Service, a Relay Hybrid Connection, and a Service Bus using their outputs to create the App Service Hybrid Connection. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name, + user_metadata="examplemetadata") + example_appservice_hybrid_connection_hybrid_connection = azure.appservice.HybridConnection("exampleAppservice/hybridConnectionHybridConnection", + app_service_name=example_app_service.name, + resource_group_name=example_resource_group.name, + relay_id=example_hybrid_connection.id, + hostname="testhostname.example", + port=8080, + send_key_name="exampleSharedAccessKey") + ``` + ## Import App Service Hybrid Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/linux_function_app.py b/sdk/python/pulumi_azure/appservice/linux_function_app.py index 5606b4bd27..699ed1fef5 100644 --- a/sdk/python/pulumi_azure/appservice/linux_function_app.py +++ b/sdk/python/pulumi_azure/appservice/linux_function_app.py @@ -1512,6 +1512,32 @@ def __init__(__self__, """ Manages a Linux Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="Y1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs()) + ``` + ## Import Linux Function Apps can be imported using the `resource id`, e.g. @@ -1571,6 +1597,32 @@ def __init__(__self__, """ Manages a Linux Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="Y1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs()) + ``` + ## Import Linux Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/linux_function_app_slot.py b/sdk/python/pulumi_azure/appservice/linux_function_app_slot.py index 8aeccf2550..c6f9af373e 100644 --- a/sdk/python/pulumi_azure/appservice/linux_function_app_slot.py +++ b/sdk/python/pulumi_azure/appservice/linux_function_app_slot.py @@ -1380,6 +1380,35 @@ def __init__(__self__, """ Manages a Linux Function App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="Y1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs()) + example_linux_function_app_slot = azure.appservice.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", + function_app_id=example_linux_function_app.id, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSlotSiteConfigArgs()) + ``` + ## Import A Linux Function App Slot can be imported using the `resource id`, e.g. @@ -1433,6 +1462,35 @@ def __init__(__self__, """ Manages a Linux Function App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="Y1") + example_linux_function_app = azure.appservice.LinuxFunctionApp("exampleLinuxFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_plan_id=example_service_plan.id, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSiteConfigArgs()) + example_linux_function_app_slot = azure.appservice.LinuxFunctionAppSlot("exampleLinuxFunctionAppSlot", + function_app_id=example_linux_function_app.id, + storage_account_name=example_account.name, + site_config=azure.appservice.LinuxFunctionAppSlotSiteConfigArgs()) + ``` + ## Import A Linux Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/linux_web_app.py b/sdk/python/pulumi_azure/appservice/linux_web_app.py index a3680c40dc..3d914ed041 100644 --- a/sdk/python/pulumi_azure/appservice/linux_web_app.py +++ b/sdk/python/pulumi_azure/appservice/linux_web_app.py @@ -1226,6 +1226,25 @@ def __init__(__self__, """ Manages a Linux Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + ``` + ## Import Linux Web Apps can be imported using the `resource id`, e.g. @@ -1271,6 +1290,25 @@ def __init__(__self__, """ Manages a Linux Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + ``` + ## Import Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/linux_web_app_slot.py b/sdk/python/pulumi_azure/appservice/linux_web_app_slot.py index 38f196b49e..98d29d5b6b 100644 --- a/sdk/python/pulumi_azure/appservice/linux_web_app_slot.py +++ b/sdk/python/pulumi_azure/appservice/linux_web_app_slot.py @@ -1167,6 +1167,28 @@ def __init__(__self__, """ Manages a Linux Web App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_linux_web_app_slot = azure.appservice.LinuxWebAppSlot("exampleLinuxWebAppSlot", + app_service_id=example_linux_web_app.id, + site_config=azure.appservice.LinuxWebAppSlotSiteConfigArgs()) + ``` + ## Import Linux Web Apps can be imported using the `resource id`, e.g. @@ -1210,6 +1232,28 @@ def __init__(__self__, """ Manages a Linux Web App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_linux_web_app_slot = azure.appservice.LinuxWebAppSlot("exampleLinuxWebAppSlot", + app_service_id=example_linux_web_app.id, + site_config=azure.appservice.LinuxWebAppSlotSiteConfigArgs()) + ``` + ## Import Linux Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/plan.py b/sdk/python/pulumi_azure/appservice/plan.py index 3c5d5d3019..69285e5fb6 100644 --- a/sdk/python/pulumi_azure/appservice/plan.py +++ b/sdk/python/pulumi_azure/appservice/plan.py @@ -573,6 +573,71 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.ServicePlan` resource instead. ## Example Usage + ### Dedicated) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + ``` + ### Shared / Consumption Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="FunctionApp", + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + ``` + ### Linux) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Linux", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + ``` + ### Windows Container) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="xenon", + is_xenon=True, + sku=azure.appservice.PlanSkuArgs( + tier="PremiumContainer", + size="PC2", + )) + ``` ## Import @@ -615,6 +680,71 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `appservice.ServicePlan` resource instead. ## Example Usage + ### Dedicated) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + ``` + ### Shared / Consumption Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="FunctionApp", + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + ``` + ### Linux) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Linux", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + ``` + ### Windows Container) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="xenon", + is_xenon=True, + sku=azure.appservice.PlanSkuArgs( + tier="PremiumContainer", + size="PC2", + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/public_certificate.py b/sdk/python/pulumi_azure/appservice/public_certificate.py index 695f4bdc90..71073a34dc 100644 --- a/sdk/python/pulumi_azure/appservice/public_certificate.py +++ b/sdk/python/pulumi_azure/appservice/public_certificate.py @@ -278,6 +278,33 @@ def __init__(__self__, """ Manages an App Service Public Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_public_certificate = azure.appservice.PublicCertificate("examplePublicCertificate", + resource_group_name=example_resource_group.name, + app_service_name=example_app_service.name, + certificate_name="example-public-certificate", + certificate_location="Unknown", + blob=(lambda path: base64.b64encode(open(path).read().encode()).decode())("app_service_public_certificate.cer")) + ``` + ## Import App Service Public Certificates can be imported using the `resource id`, e.g. @@ -303,6 +330,33 @@ def __init__(__self__, """ Manages an App Service Public Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_public_certificate = azure.appservice.PublicCertificate("examplePublicCertificate", + resource_group_name=example_resource_group.name, + app_service_name=example_app_service.name, + certificate_name="example-public-certificate", + certificate_location="Unknown", + blob=(lambda path: base64.b64encode(open(path).read().encode()).decode())("app_service_public_certificate.cer")) + ``` + ## Import App Service Public Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/service_plan.py b/sdk/python/pulumi_azure/appservice/service_plan.py index 515333a790..362dc9532e 100644 --- a/sdk/python/pulumi_azure/appservice/service_plan.py +++ b/sdk/python/pulumi_azure/appservice/service_plan.py @@ -564,6 +564,20 @@ def __init__(__self__, """ Manages an App Service: Service Plan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + ``` + ## Import AppServices can be imported using the `resource id`, e.g. @@ -603,6 +617,20 @@ def __init__(__self__, """ Manages an App Service: Service Plan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + ``` + ## Import AppServices can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/slot.py b/sdk/python/pulumi_azure/appservice/slot.py index a4876a65a1..6b75aefa68 100644 --- a/sdk/python/pulumi_azure/appservice/slot.py +++ b/sdk/python/pulumi_azure/appservice/slot.py @@ -777,6 +777,98 @@ def __init__(__self__, > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. ## Example Usage + ### NET 4.X) + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.AppServiceSiteConfigArgs( + dotnet_framework_version="v4.0", + ), + app_settings={ + "SOME_KEY": "some-value", + }, + connection_strings=[azure.appservice.AppServiceConnectionStringArgs( + name="Database", + type="SQLServer", + value="Server=some-server.mydomain.com;Integrated Security=SSPI", + )]) + example_slot = azure.appservice.Slot("exampleSlot", + app_service_name=example_app_service.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.SlotSiteConfigArgs( + dotnet_framework_version="v4.0", + ), + app_settings={ + "SOME_KEY": "some-value", + }, + connection_strings=[azure.appservice.SlotConnectionStringArgs( + name="Database", + type="SQLServer", + value="Server=some-server.mydomain.com;Integrated Security=SSPI", + )]) + ``` + ### Java 1.8) + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.AppServiceSiteConfigArgs( + java_version="1.8", + java_container="JETTY", + java_container_version="9.3", + )) + example_slot = azure.appservice.Slot("exampleSlot", + app_service_name=example_app_service.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.SlotSiteConfigArgs( + java_version="1.8", + java_container="JETTY", + java_container_version="9.3", + )) + ``` ## Import @@ -820,6 +912,98 @@ def __init__(__self__, > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `appservice.AppService` resource will be overwritten when promoting a Slot using the `appservice.ActiveSlot` resource. ## Example Usage + ### NET 4.X) + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.AppServiceSiteConfigArgs( + dotnet_framework_version="v4.0", + ), + app_settings={ + "SOME_KEY": "some-value", + }, + connection_strings=[azure.appservice.AppServiceConnectionStringArgs( + name="Database", + type="SQLServer", + value="Server=some-server.mydomain.com;Integrated Security=SSPI", + )]) + example_slot = azure.appservice.Slot("exampleSlot", + app_service_name=example_app_service.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.SlotSiteConfigArgs( + dotnet_framework_version="v4.0", + ), + app_settings={ + "SOME_KEY": "some-value", + }, + connection_strings=[azure.appservice.SlotConnectionStringArgs( + name="Database", + type="SQLServer", + value="Server=some-server.mydomain.com;Integrated Security=SSPI", + )]) + ``` + ### Java 1.8) + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.AppServiceSiteConfigArgs( + java_version="1.8", + java_container="JETTY", + java_container_version="9.3", + )) + example_slot = azure.appservice.Slot("exampleSlot", + app_service_name=example_app_service.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + site_config=azure.appservice.SlotSiteConfigArgs( + java_version="1.8", + java_container="JETTY", + java_container_version="9.3", + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/slot_custom_hostname_binding.py b/sdk/python/pulumi_azure/appservice/slot_custom_hostname_binding.py index 97c7193ece..d2d82e56c9 100644 --- a/sdk/python/pulumi_azure/appservice/slot_custom_hostname_binding.py +++ b/sdk/python/pulumi_azure/appservice/slot_custom_hostname_binding.py @@ -248,6 +248,34 @@ def __init__(__self__, """ Manages a Hostname Binding within an App Service Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_slot = azure.appservice.Slot("exampleSlot", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_name=example_app_service.name, + app_service_plan_id=example_plan.id) + example_slot_custom_hostname_binding = azure.appservice.SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", + app_service_slot_id=example_slot.id, + hostname="www.mywebsite.com") + ``` + ## Import App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. @@ -276,6 +304,34 @@ def __init__(__self__, """ Manages a Hostname Binding within an App Service Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_slot = azure.appservice.Slot("exampleSlot", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_name=example_app_service.name, + app_service_plan_id=example_plan.id) + example_slot_custom_hostname_binding = azure.appservice.SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", + app_service_slot_id=example_slot.id, + hostname="www.mywebsite.com") + ``` + ## Import App Service Custom Hostname Bindings can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/slot_virtual_network_swift_connection.py b/sdk/python/pulumi_azure/appservice/slot_virtual_network_swift_connection.py index ffa7b37422..9f831668b9 100644 --- a/sdk/python/pulumi_azure/appservice/slot_virtual_network_swift_connection.py +++ b/sdk/python/pulumi_azure/appservice/slot_virtual_network_swift_connection.py @@ -180,6 +180,50 @@ def __init__(__self__, """ Manages an App Service Slot's Virtual Network Association (this is for the [Regional VNet Integration](https://docs.microsoft.com/azure/app-service/web-sites-integrate-with-vnet#regional-vnet-integration) which is still in preview). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="example-delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Web/serverFarms", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_staging = azure.appservice.Slot("example-staging", + app_service_name=example_app_service.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_slot_virtual_network_swift_connection = azure.appservice.SlotVirtualNetworkSwiftConnection("exampleSlotVirtualNetworkSwiftConnection", + slot_name=example_staging.name, + app_service_id=example_app_service.id, + subnet_id=example_subnet.id) + ``` + ## Import App Service Slot Virtual Network Associations can be imported using the `resource id`, e.g. @@ -203,6 +247,50 @@ def __init__(__self__, """ Manages an App Service Slot's Virtual Network Association (this is for the [Regional VNet Integration](https://docs.microsoft.com/azure/app-service/web-sites-integrate-with-vnet#regional-vnet-integration) which is still in preview). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="example-delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Web/serverFarms", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_staging = azure.appservice.Slot("example-staging", + app_service_name=example_app_service.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_slot_virtual_network_swift_connection = azure.appservice.SlotVirtualNetworkSwiftConnection("exampleSlotVirtualNetworkSwiftConnection", + slot_name=example_staging.name, + app_service_id=example_app_service.id, + subnet_id=example_subnet.id) + ``` + ## Import App Service Slot Virtual Network Associations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/source_code_token.py b/sdk/python/pulumi_azure/appservice/source_code_token.py index 099d851296..0423f8cfa4 100644 --- a/sdk/python/pulumi_azure/appservice/source_code_token.py +++ b/sdk/python/pulumi_azure/appservice/source_code_token.py @@ -175,6 +175,17 @@ def __init__(__self__, > **NOTE:** Source Control Tokens are configured at the subscription level, not on each App Service - as such this can only be configured Subscription-wide + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.SourceCodeToken("example", + token="7e57735e77e577e57", + type="GitHub") + ``` + ## Import App Service Source Control Token's can be imported using the `type`, e.g. @@ -202,6 +213,17 @@ def __init__(__self__, > **NOTE:** Source Control Tokens are configured at the subscription level, not on each App Service - as such this can only be configured Subscription-wide + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.SourceCodeToken("example", + token="7e57735e77e577e57", + type="GitHub") + ``` + ## Import App Service Source Control Token's can be imported using the `type`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/source_control.py b/sdk/python/pulumi_azure/appservice/source_control.py index b284edad4e..8ba71a2701 100644 --- a/sdk/python/pulumi_azure/appservice/source_control.py +++ b/sdk/python/pulumi_azure/appservice/source_control.py @@ -437,6 +437,29 @@ def __init__(__self__, """ Manages an App Service Web App or Function App Source Control Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_source_control = azure.appservice.SourceControl("exampleSourceControl", + app_id=example_linux_web_app.id, + repo_url="https://github.com/Azure-Samples/python-docs-hello-world", + branch="master") + ``` + ## Import App Service Source Controls can be imported using the `resource id`, e.g. @@ -469,6 +492,29 @@ def __init__(__self__, """ Manages an App Service Web App or Function App Source Control Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_source_control = azure.appservice.SourceControl("exampleSourceControl", + app_id=example_linux_web_app.id, + repo_url="https://github.com/Azure-Samples/python-docs-hello-world", + branch="master") + ``` + ## Import App Service Source Controls can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/source_control_slot.py b/sdk/python/pulumi_azure/appservice/source_control_slot.py index 889468a022..25f405140e 100644 --- a/sdk/python/pulumi_azure/appservice/source_control_slot.py +++ b/sdk/python/pulumi_azure/appservice/source_control_slot.py @@ -429,6 +429,32 @@ def __init__(__self__, """ Manages an App Service Source Control Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_linux_web_app_slot = azure.appservice.LinuxWebAppSlot("exampleLinuxWebAppSlot", + app_service_id=example_linux_web_app.id, + site_config=azure.appservice.LinuxWebAppSlotSiteConfigArgs()) + example_source_control_slot = azure.appservice.SourceControlSlot("exampleSourceControlSlot", + slot_id=example_linux_web_app_slot.id, + repo_url="https://github.com/Azure-Samples/python-docs-hello-world", + branch="master") + ``` + ## Import an App Service Source Control Slot can be imported using the `resource id`, e.g. @@ -459,6 +485,32 @@ def __init__(__self__, """ Manages an App Service Source Control Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + sku_name="P1v2") + example_linux_web_app = azure.appservice.LinuxWebApp("exampleLinuxWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.LinuxWebAppSiteConfigArgs()) + example_linux_web_app_slot = azure.appservice.LinuxWebAppSlot("exampleLinuxWebAppSlot", + app_service_id=example_linux_web_app.id, + site_config=azure.appservice.LinuxWebAppSlotSiteConfigArgs()) + example_source_control_slot = azure.appservice.SourceControlSlot("exampleSourceControlSlot", + slot_id=example_linux_web_app_slot.id, + repo_url="https://github.com/Azure-Samples/python-docs-hello-world", + branch="master") + ``` + ## Import an App Service Source Control Slot can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/source_control_token.py b/sdk/python/pulumi_azure/appservice/source_control_token.py index fba93404e9..5bde01c9f9 100644 --- a/sdk/python/pulumi_azure/appservice/source_control_token.py +++ b/sdk/python/pulumi_azure/appservice/source_control_token.py @@ -177,6 +177,17 @@ def __init__(__self__, type: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.SourceControlToken("example", + token="ghp_sometokenvaluesecretsauce", + type="GitHub") + ``` + ## Import App Service Source GitHub Tokens can be imported using the `resource id`, e.g. @@ -200,6 +211,17 @@ def __init__(__self__, args: SourceControlTokenArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.SourceControlToken("example", + token="ghp_sometokenvaluesecretsauce", + type="GitHub") + ``` + ## Import App Service Source GitHub Tokens can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/static_site.py b/sdk/python/pulumi_azure/appservice/static_site.py index 2f13c92558..e5dc801615 100644 --- a/sdk/python/pulumi_azure/appservice/static_site.py +++ b/sdk/python/pulumi_azure/appservice/static_site.py @@ -411,6 +411,17 @@ def __init__(__self__, ->**NOTE:** After the Static Site is provisioned, you'll need to associate your target repository, which contains your web app, to the Static Site, by following the [Azure Static Site document](https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.StaticSite("example", + location="West Europe", + resource_group_name="example") + ``` + ## Import Static Web Apps can be imported using the `resource id`, e.g. @@ -441,6 +452,17 @@ def __init__(__self__, ->**NOTE:** After the Static Site is provisioned, you'll need to associate your target repository, which contains your web app, to the Static Site, by following the [Azure Static Site document](https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.appservice.StaticSite("example", + location="West Europe", + resource_group_name="example") + ``` + ## Import Static Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/static_site_custom_domain.py b/sdk/python/pulumi_azure/appservice/static_site_custom_domain.py index 147dd47d82..c463d5a377 100644 --- a/sdk/python/pulumi_azure/appservice/static_site_custom_domain.py +++ b/sdk/python/pulumi_azure/appservice/static_site_custom_domain.py @@ -198,6 +198,48 @@ def __init__(__self__, __props__=None): """ ## Example Usage + ### CNAME validation + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_static_site = azure.appservice.StaticSite("exampleStaticSite", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name="contoso.com", + resource_group_name=example_resource_group.name, + ttl=300, + record=example_static_site.default_host_name) + example_static_site_custom_domain = azure.appservice.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", + static_site_id=example_static_site.id, + domain_name=pulumi.Output.all(example_c_name_record.name, example_c_name_record.zone_name).apply(lambda name, zone_name: f"{name}.{zone_name}"), + validation_type="cname-delegation") + ``` + ### TXT validation + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_static_site = azure.appservice.StaticSite("exampleStaticSite", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_static_site_custom_domain = azure.appservice.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", + static_site_id=example_static_site.id, + domain_name="my-domain.contoso.com", + validation_type="dns-txt-token") + example_txt_record = azure.dns.TxtRecord("exampleTxtRecord", + zone_name="contoso.com", + resource_group_name=example_resource_group.name, + ttl=300, + records=[azure.dns.TxtRecordRecordArgs( + value=example_static_site_custom_domain.validation_token, + )]) + ``` ## Import @@ -221,6 +263,48 @@ def __init__(__self__, opts: Optional[pulumi.ResourceOptions] = None): """ ## Example Usage + ### CNAME validation + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_static_site = azure.appservice.StaticSite("exampleStaticSite", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name="contoso.com", + resource_group_name=example_resource_group.name, + ttl=300, + record=example_static_site.default_host_name) + example_static_site_custom_domain = azure.appservice.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", + static_site_id=example_static_site.id, + domain_name=pulumi.Output.all(example_c_name_record.name, example_c_name_record.zone_name).apply(lambda name, zone_name: f"{name}.{zone_name}"), + validation_type="cname-delegation") + ``` + ### TXT validation + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_static_site = azure.appservice.StaticSite("exampleStaticSite", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_static_site_custom_domain = azure.appservice.StaticSiteCustomDomain("exampleStaticSiteCustomDomain", + static_site_id=example_static_site.id, + domain_name="my-domain.contoso.com", + validation_type="dns-txt-token") + example_txt_record = azure.dns.TxtRecord("exampleTxtRecord", + zone_name="contoso.com", + resource_group_name=example_resource_group.name, + ttl=300, + records=[azure.dns.TxtRecordRecordArgs( + value=example_static_site_custom_domain.validation_token, + )]) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/virtual_network_swift_connection.py b/sdk/python/pulumi_azure/appservice/virtual_network_swift_connection.py index 730aaa902a..d4b98c7e8e 100644 --- a/sdk/python/pulumi_azure/appservice/virtual_network_swift_connection.py +++ b/sdk/python/pulumi_azure/appservice/virtual_network_swift_connection.py @@ -160,6 +160,87 @@ def __init__(__self__, Multiple apps in the same App Service plan can use the same VNet. ## Example Usage + ### With App Service) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="example-delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Web/serverFarms", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_virtual_network_swift_connection = azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", + app_service_id=example_app_service.id, + subnet_id=example_subnet.id) + ``` + ### With Function App) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="example-delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Web/serverFarms", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + example_virtual_network_swift_connection = azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", + app_service_id=example_function_app.id, + subnet_id=example_subnet.id) + ``` ## Import @@ -205,6 +286,87 @@ def __init__(__self__, Multiple apps in the same App Service plan can use the same VNet. ## Example Usage + ### With App Service) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="example-delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Web/serverFarms", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_app_service = azure.appservice.AppService("exampleAppService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id) + example_virtual_network_swift_connection = azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", + app_service_id=example_app_service.id, + subnet_id=example_subnet.id) + ``` + ### With Function App) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="example-delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Web/serverFarms", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.appservice.PlanSkuArgs( + tier="Standard", + size="S1", + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key) + example_virtual_network_swift_connection = azure.appservice.VirtualNetworkSwiftConnection("exampleVirtualNetworkSwiftConnection", + app_service_id=example_function_app.id, + subnet_id=example_subnet.id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/web_app_active_slot.py b/sdk/python/pulumi_azure/appservice/web_app_active_slot.py index a53ff3813c..0f6df7e75c 100644 --- a/sdk/python/pulumi_azure/appservice/web_app_active_slot.py +++ b/sdk/python/pulumi_azure/appservice/web_app_active_slot.py @@ -158,6 +158,28 @@ def __init__(__self__, Manages a Web App Active Slot. ## Example Usage + ### Windows Web App + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="P1v2") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_windows_web_app_slot = azure.appservice.WindowsWebAppSlot("exampleWindowsWebAppSlot", + app_service_id=example_windows_web_app.name, + site_config=azure.appservice.WindowsWebAppSlotSiteConfigArgs()) + example_web_app_active_slot = azure.appservice.WebAppActiveSlot("exampleWebAppActiveSlot", slot_id=example_windows_web_app_slot.id) + ``` ## Import @@ -182,6 +204,28 @@ def __init__(__self__, Manages a Web App Active Slot. ## Example Usage + ### Windows Web App + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="P1v2") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_windows_web_app_slot = azure.appservice.WindowsWebAppSlot("exampleWindowsWebAppSlot", + app_service_id=example_windows_web_app.name, + site_config=azure.appservice.WindowsWebAppSlotSiteConfigArgs()) + example_web_app_active_slot = azure.appservice.WebAppActiveSlot("exampleWebAppActiveSlot", slot_id=example_windows_web_app_slot.id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/appservice/web_app_hybrid_connection.py b/sdk/python/pulumi_azure/appservice/web_app_hybrid_connection.py index 19ccd26457..c6a4d76ee7 100644 --- a/sdk/python/pulumi_azure/appservice/web_app_hybrid_connection.py +++ b/sdk/python/pulumi_azure/appservice/web_app_hybrid_connection.py @@ -355,6 +355,37 @@ def __init__(__self__, """ Manages a Web App Hybrid Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Windows", + sku_name="S1") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name) + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_web_app_hybrid_connection = azure.appservice.WebAppHybridConnection("exampleWebAppHybridConnection", + web_app_id=example_windows_web_app.id, + relay_id=example_hybrid_connection.id, + hostname="myhostname.example", + port=8081) + ``` + ## Import a Web App Hybrid Connection can be imported using the `resource id`, e.g. @@ -380,6 +411,37 @@ def __init__(__self__, """ Manages a Web App Hybrid Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + os_type="Windows", + sku_name="S1") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name) + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_web_app_hybrid_connection = azure.appservice.WebAppHybridConnection("exampleWebAppHybridConnection", + web_app_id=example_windows_web_app.id, + relay_id=example_hybrid_connection.id, + hostname="myhostname.example", + port=8081) + ``` + ## Import a Web App Hybrid Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/windows_function_app.py b/sdk/python/pulumi_azure/appservice/windows_function_app.py index 3b80932f3b..1fb340f9f7 100644 --- a/sdk/python/pulumi_azure/appservice/windows_function_app.py +++ b/sdk/python/pulumi_azure/appservice/windows_function_app.py @@ -1512,6 +1512,32 @@ def __init__(__self__, """ Manages a Windows Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="Y1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + ``` + ## Import Windows Function Apps can be imported using the `resource id`, e.g. @@ -1571,6 +1597,32 @@ def __init__(__self__, """ Manages a Windows Function App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="Y1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + ``` + ## Import Windows Function Apps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/windows_function_app_slot.py b/sdk/python/pulumi_azure/appservice/windows_function_app_slot.py index e970bdd36d..89ecc9e37a 100644 --- a/sdk/python/pulumi_azure/appservice/windows_function_app_slot.py +++ b/sdk/python/pulumi_azure/appservice/windows_function_app_slot.py @@ -1380,6 +1380,35 @@ def __init__(__self__, """ Manages a Windows Function App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="Y1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + example_windows_function_app_slot = azure.appservice.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", + function_app_id=example_windows_function_app.id, + storage_account_name=example_account.name, + site_config=azure.appservice.WindowsFunctionAppSlotSiteConfigArgs()) + ``` + ## Import A Windows Function App Slot can be imported using the `resource id`, e.g. @@ -1433,6 +1462,35 @@ def __init__(__self__, """ Manages a Windows Function App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="Y1") + example_windows_function_app = azure.appservice.WindowsFunctionApp("exampleWindowsFunctionApp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_account_name=example_account.name, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsFunctionAppSiteConfigArgs()) + example_windows_function_app_slot = azure.appservice.WindowsFunctionAppSlot("exampleWindowsFunctionAppSlot", + function_app_id=example_windows_function_app.id, + storage_account_name=example_account.name, + site_config=azure.appservice.WindowsFunctionAppSlotSiteConfigArgs()) + ``` + ## Import A Windows Function App Slot can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/windows_web_app.py b/sdk/python/pulumi_azure/appservice/windows_web_app.py index 734cd6c311..31e1c3fdd4 100644 --- a/sdk/python/pulumi_azure/appservice/windows_web_app.py +++ b/sdk/python/pulumi_azure/appservice/windows_web_app.py @@ -1242,6 +1242,25 @@ def __init__(__self__, """ Manages a Windows Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="P1v2", + os_type="Windows") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + ``` + ## Import Windows Web Apps can be imported using the `resource id`, e.g. @@ -1290,6 +1309,25 @@ def __init__(__self__, """ Manages a Windows Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="P1v2", + os_type="Windows") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + ``` + ## Import Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/appservice/windows_web_app_slot.py b/sdk/python/pulumi_azure/appservice/windows_web_app_slot.py index ce003e3782..c5449ec25c 100644 --- a/sdk/python/pulumi_azure/appservice/windows_web_app_slot.py +++ b/sdk/python/pulumi_azure/appservice/windows_web_app_slot.py @@ -1147,6 +1147,28 @@ def __init__(__self__, """ Manages a Windows Web App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="P1v2") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_windows_web_app_slot = azure.appservice.WindowsWebAppSlot("exampleWindowsWebAppSlot", + app_service_id=example_windows_web_app.id, + site_config=azure.appservice.WindowsWebAppSlotSiteConfigArgs()) + ``` + ## Import Windows Web Apps can be imported using the `resource id`, e.g. @@ -1190,6 +1212,28 @@ def __init__(__self__, """ Manages a Windows Web App Slot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.appservice.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Windows", + sku_name="P1v2") + example_windows_web_app = azure.appservice.WindowsWebApp("exampleWindowsWebApp", + resource_group_name=example_resource_group.name, + location=example_service_plan.location, + service_plan_id=example_service_plan.id, + site_config=azure.appservice.WindowsWebAppSiteConfigArgs()) + example_windows_web_app_slot = azure.appservice.WindowsWebAppSlot("exampleWindowsWebAppSlot", + app_service_id=example_windows_web_app.id, + site_config=azure.appservice.WindowsWebAppSlotSiteConfigArgs()) + ``` + ## Import Windows Web Apps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/arc/private_link_scope.py b/sdk/python/pulumi_azure/arc/private_link_scope.py index 348532129a..539a1bc408 100644 --- a/sdk/python/pulumi_azure/arc/private_link_scope.py +++ b/sdk/python/pulumi_azure/arc/private_link_scope.py @@ -248,6 +248,18 @@ def __init__(__self__, """ Manages an Azure Arc Private Link Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_private_link_scope = azure.arc.PrivateLinkScope("examplePrivateLinkScope", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Azure Arc Private Link Scope can be imported using the `resource id`, e.g. @@ -273,6 +285,18 @@ def __init__(__self__, """ Manages an Azure Arc Private Link Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_private_link_scope = azure.arc.PrivateLinkScope("examplePrivateLinkScope", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Azure Arc Private Link Scope can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/arc/resource_bridge_appliance.py b/sdk/python/pulumi_azure/arc/resource_bridge_appliance.py index f1dd7f94c8..bee3ab986d 100644 --- a/sdk/python/pulumi_azure/arc/resource_bridge_appliance.py +++ b/sdk/python/pulumi_azure/arc/resource_bridge_appliance.py @@ -368,6 +368,26 @@ def __init__(__self__, """ Manages an Arc Resource Bridge Appliance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_bridge_appliance = azure.arc.ResourceBridgeAppliance("exampleResourceBridgeAppliance", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + distro="AKSEdge", + infrastructure_provider="VMWare", + identity=azure.arc.ResourceBridgeApplianceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "hello": "world", + }) + ``` + ## Import Arc Resource Bridge Appliance can be imported using the `resource id`, e.g. @@ -396,6 +416,26 @@ def __init__(__self__, """ Manages an Arc Resource Bridge Appliance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_bridge_appliance = azure.arc.ResourceBridgeAppliance("exampleResourceBridgeAppliance", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + distro="AKSEdge", + infrastructure_provider="VMWare", + identity=azure.arc.ResourceBridgeApplianceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "hello": "world", + }) + ``` + ## Import Arc Resource Bridge Appliance can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/arckubernetes/cluster_extension.py b/sdk/python/pulumi_azure/arckubernetes/cluster_extension.py index 00dba1b5d3..f0ee36ca71 100644 --- a/sdk/python/pulumi_azure/arckubernetes/cluster_extension.py +++ b/sdk/python/pulumi_azure/arckubernetes/cluster_extension.py @@ -477,6 +477,29 @@ def __init__(__self__, """ Manages an Arc Kubernetes Cluster Extension. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.arckubernetes.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location="West Europe", + agent_public_key_certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("testdata/public.cer"), + identity=azure.arckubernetes.ClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "ENV": "Test", + }) + example_cluster_extension = azure.arckubernetes.ClusterExtension("exampleClusterExtension", + cluster_id=example_cluster.id, + extension_type="microsoft.flux") + ``` + ## Import Arc Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. @@ -507,6 +530,29 @@ def __init__(__self__, """ Manages an Arc Kubernetes Cluster Extension. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.arckubernetes.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location="West Europe", + agent_public_key_certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("testdata/public.cer"), + identity=azure.arckubernetes.ClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "ENV": "Test", + }) + example_cluster_extension = azure.arckubernetes.ClusterExtension("exampleClusterExtension", + cluster_id=example_cluster.id, + extension_type="microsoft.flux") + ``` + ## Import Arc Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/python/pulumi_azure/arckubernetes/flux_configuration.py b/sdk/python/pulumi_azure/arckubernetes/flux_configuration.py index 4e0c6e5665..156ec9fb4b 100644 --- a/sdk/python/pulumi_azure/arckubernetes/flux_configuration.py +++ b/sdk/python/pulumi_azure/arckubernetes/flux_configuration.py @@ -408,6 +408,41 @@ def __init__(__self__, """ Manages an Arc Kubernetes Flux Configuration. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.arckubernetes.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location="West Europe", + agent_public_key_certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("testdata/public.cer"), + identity=azure.arckubernetes.ClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "ENV": "Test", + }) + example_cluster_extension = azure.arckubernetes.ClusterExtension("exampleClusterExtension", + cluster_id=azurerm_arc_kubernetes_cluster["test"]["id"], + extension_type="microsoft.flux") + example_flux_configuration = azure.arckubernetes.FluxConfiguration("exampleFluxConfiguration", + cluster_id=azurerm_arc_kubernetes_cluster["test"]["id"], + namespace="flux", + git_repository=azure.arckubernetes.FluxConfigurationGitRepositoryArgs( + url="https://github.com/Azure/arc-k8s-demo", + reference_type="branch", + reference_value="main", + ), + kustomizations=[azure.arckubernetes.FluxConfigurationKustomizationArgs( + name="kustomization-1", + )], + opts=pulumi.ResourceOptions(depends_on=[example_cluster_extension])) + ``` + ## Import Arc Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. @@ -437,6 +472,41 @@ def __init__(__self__, """ Manages an Arc Kubernetes Flux Configuration. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.arckubernetes.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location="West Europe", + agent_public_key_certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("testdata/public.cer"), + identity=azure.arckubernetes.ClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "ENV": "Test", + }) + example_cluster_extension = azure.arckubernetes.ClusterExtension("exampleClusterExtension", + cluster_id=azurerm_arc_kubernetes_cluster["test"]["id"], + extension_type="microsoft.flux") + example_flux_configuration = azure.arckubernetes.FluxConfiguration("exampleFluxConfiguration", + cluster_id=azurerm_arc_kubernetes_cluster["test"]["id"], + namespace="flux", + git_repository=azure.arckubernetes.FluxConfigurationGitRepositoryArgs( + url="https://github.com/Azure/arc-k8s-demo", + reference_type="branch", + reference_value="main", + ), + kustomizations=[azure.arckubernetes.FluxConfigurationKustomizationArgs( + name="kustomization-1", + )], + opts=pulumi.ResourceOptions(depends_on=[example_cluster_extension])) + ``` + ## Import Arc Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/python/pulumi_azure/arcmachine/get.py b/sdk/python/pulumi_azure/arcmachine/get.py index f1dd0fe615..0cb09a3f0c 100644 --- a/sdk/python/pulumi_azure/arcmachine/get.py +++ b/sdk/python/pulumi_azure/arcmachine/get.py @@ -396,6 +396,17 @@ def get(name: Optional[str] = None, """ Use this data source to access information about an existing Azure Arc machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.arcmachine.get(name="existing-hcmachine", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Azure Arc machine. :param str resource_group_name: The name of the Resource Group where the Hybrid Compute exists. @@ -446,6 +457,17 @@ def get_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Azure Arc machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.arcmachine.get(name="existing-hcmachine", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Azure Arc machine. :param str resource_group_name: The name of the Resource Group where the Hybrid Compute exists. diff --git a/sdk/python/pulumi_azure/attestation/provider.py b/sdk/python/pulumi_azure/attestation/provider.py index bc176c40e2..d8f0fffd17 100644 --- a/sdk/python/pulumi_azure/attestation/provider.py +++ b/sdk/python/pulumi_azure/attestation/provider.py @@ -511,6 +511,19 @@ def __init__(__self__, """ Manages an Attestation Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_provider = azure.attestation.Provider("exampleProvider", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + policy_signing_certificate_data=(lambda path: open(path).read())("./example/cert.pem")) + ``` + ## Import Attestation Providers can be imported using the `resource id`, e.g. @@ -544,6 +557,19 @@ def __init__(__self__, """ Manages an Attestation Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_provider = azure.attestation.Provider("exampleProvider", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + policy_signing_certificate_data=(lambda path: open(path).read())("./example/cert.pem")) + ``` + ## Import Attestation Providers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/authorization/assignment.py b/sdk/python/pulumi_azure/authorization/assignment.py index ae885578d5..abe2609372 100644 --- a/sdk/python/pulumi_azure/authorization/assignment.py +++ b/sdk/python/pulumi_azure/authorization/assignment.py @@ -495,6 +495,86 @@ def __init__(__self__, Assigns a given Principal (User or Group) to a given Role. ## Example Usage + ### Using A Built-In Role) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Reader", + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Service Principal) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & User) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Management Group) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=data["azurerm_management_group"]["primary"]["id"], + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` ## Import @@ -535,6 +615,86 @@ def __init__(__self__, Assigns a given Principal (User or Group) to a given Role. ## Example Usage + ### Using A Built-In Role) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Reader", + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Service Principal) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & User) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Management Group) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=data["azurerm_management_group"]["primary"]["id"], + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py b/sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py index a5dfc101f3..809d617aa6 100644 --- a/sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py +++ b/sdk/python/pulumi_azure/authorization/get_user_assigned_identity.py @@ -129,6 +129,18 @@ def get_user_assigned_identity(name: Optional[str] = None, Use this data source to access information about an existing User Assigned Identity. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity", + resource_group_name="name_of_resource_group") + pulumi.export("uaiClientId", example.client_id) + pulumi.export("uaiPrincipalId", example.principal_id) + pulumi.export("uaiTenantId", example.tenant_id) + ``` :param str name: The name of the User Assigned Identity. @@ -159,6 +171,18 @@ def get_user_assigned_identity_output(name: Optional[pulumi.Input[str]] = None, Use this data source to access information about an existing User Assigned Identity. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity", + resource_group_name="name_of_resource_group") + pulumi.export("uaiClientId", example.client_id) + pulumi.export("uaiPrincipalId", example.principal_id) + pulumi.export("uaiTenantId", example.tenant_id) + ``` :param str name: The name of the User Assigned Identity. diff --git a/sdk/python/pulumi_azure/authorization/role_definition.py b/sdk/python/pulumi_azure/authorization/role_definition.py index de4ab38dfc..298be596e7 100644 --- a/sdk/python/pulumi_azure/authorization/role_definition.py +++ b/sdk/python/pulumi_azure/authorization/role_definition.py @@ -315,6 +315,23 @@ def __init__(__self__, """ Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example = azure.authorization.RoleDefinition("example", + scope=primary.id, + description="This is a custom role created", + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["*"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + ``` + ## Import Role Definitions can be imported using the `resource id`, e.g. @@ -343,6 +360,23 @@ def __init__(__self__, """ Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example = azure.authorization.RoleDefinition("example", + scope=primary.id, + description="This is a custom role created", + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["*"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + ``` + ## Import Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/authorization/user_assigned_identity.py b/sdk/python/pulumi_azure/authorization/user_assigned_identity.py index bca8052cc9..c5721b4ef1 100644 --- a/sdk/python/pulumi_azure/authorization/user_assigned_identity.py +++ b/sdk/python/pulumi_azure/authorization/user_assigned_identity.py @@ -269,6 +269,18 @@ def __init__(__self__, Manages a User Assigned Identity. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. @@ -297,6 +309,18 @@ def __init__(__self__, Manages a User Assigned Identity. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automanage/configuration.py b/sdk/python/pulumi_azure/automanage/configuration.py index 6f8092dfcc..ade27e03ce 100644 --- a/sdk/python/pulumi_azure/automanage/configuration.py +++ b/sdk/python/pulumi_azure/automanage/configuration.py @@ -570,6 +570,73 @@ def __init__(__self__, """ Manages an Automanage Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_configuration = azure.automanage.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + antimalware=azure.automanage.ConfigurationAntimalwareArgs( + exclusions=azure.automanage.ConfigurationAntimalwareExclusionsArgs( + extensions="exe;dll", + paths="C:\\\\Windows\\\\Temp;D:\\\\Temp", + processes="svchost.exe;notepad.exe", + ), + real_time_protection_enabled=True, + scheduled_scan_enabled=True, + scheduled_scan_type="Quick", + scheduled_scan_day=1, + scheduled_scan_time_in_minutes=1339, + ), + azure_security_baseline=azure.automanage.ConfigurationAzureSecurityBaselineArgs( + assignment_type="ApplyAndAutoCorrect", + ), + automation_account_enabled=True, + backup=azure.automanage.ConfigurationBackupArgs( + policy_name="acctest-backup-policy-%d", + time_zone="UTC", + instant_rp_retention_range_in_days=2, + schedule_policy=azure.automanage.ConfigurationBackupSchedulePolicyArgs( + schedule_run_frequency="Daily", + schedule_run_days=[ + "Monday", + "Tuesday", + ], + schedule_run_times=["12:00"], + schedule_policy_type="SimpleSchedulePolicy", + ), + retention_policy=azure.automanage.ConfigurationBackupRetentionPolicyArgs( + retention_policy_type="LongTermRetentionPolicy", + daily_schedule=azure.automanage.ConfigurationBackupRetentionPolicyDailyScheduleArgs( + retention_times=["12:00"], + retention_duration=azure.automanage.ConfigurationBackupRetentionPolicyDailyScheduleRetentionDurationArgs( + count=7, + duration_type="Days", + ), + ), + weekly_schedule=azure.automanage.ConfigurationBackupRetentionPolicyWeeklyScheduleArgs( + retention_times=["14:00"], + retention_duration=azure.automanage.ConfigurationBackupRetentionPolicyWeeklyScheduleRetentionDurationArgs( + count=4, + duration_type="Weeks", + ), + ), + ), + ), + boot_diagnostics_enabled=True, + defender_for_cloud_enabled=True, + guest_configuration_enabled=True, + log_analytics_enabled=True, + status_change_alert_enabled=True, + tags={ + "env": "test", + }) + ``` + ## Import Automanage Configuration can be imported using the `resource id`, e.g. @@ -603,6 +670,73 @@ def __init__(__self__, """ Manages an Automanage Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_configuration = azure.automanage.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + antimalware=azure.automanage.ConfigurationAntimalwareArgs( + exclusions=azure.automanage.ConfigurationAntimalwareExclusionsArgs( + extensions="exe;dll", + paths="C:\\\\Windows\\\\Temp;D:\\\\Temp", + processes="svchost.exe;notepad.exe", + ), + real_time_protection_enabled=True, + scheduled_scan_enabled=True, + scheduled_scan_type="Quick", + scheduled_scan_day=1, + scheduled_scan_time_in_minutes=1339, + ), + azure_security_baseline=azure.automanage.ConfigurationAzureSecurityBaselineArgs( + assignment_type="ApplyAndAutoCorrect", + ), + automation_account_enabled=True, + backup=azure.automanage.ConfigurationBackupArgs( + policy_name="acctest-backup-policy-%d", + time_zone="UTC", + instant_rp_retention_range_in_days=2, + schedule_policy=azure.automanage.ConfigurationBackupSchedulePolicyArgs( + schedule_run_frequency="Daily", + schedule_run_days=[ + "Monday", + "Tuesday", + ], + schedule_run_times=["12:00"], + schedule_policy_type="SimpleSchedulePolicy", + ), + retention_policy=azure.automanage.ConfigurationBackupRetentionPolicyArgs( + retention_policy_type="LongTermRetentionPolicy", + daily_schedule=azure.automanage.ConfigurationBackupRetentionPolicyDailyScheduleArgs( + retention_times=["12:00"], + retention_duration=azure.automanage.ConfigurationBackupRetentionPolicyDailyScheduleRetentionDurationArgs( + count=7, + duration_type="Days", + ), + ), + weekly_schedule=azure.automanage.ConfigurationBackupRetentionPolicyWeeklyScheduleArgs( + retention_times=["14:00"], + retention_duration=azure.automanage.ConfigurationBackupRetentionPolicyWeeklyScheduleRetentionDurationArgs( + count=4, + duration_type="Weeks", + ), + ), + ), + ), + boot_diagnostics_enabled=True, + defender_for_cloud_enabled=True, + guest_configuration_enabled=True, + log_analytics_enabled=True, + status_change_alert_enabled=True, + tags={ + "env": "test", + }) + ``` + ## Import Automanage Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/account.py b/sdk/python/pulumi_azure/automation/account.py index 5dddaa0ca6..f0f7b80f52 100644 --- a/sdk/python/pulumi_azure/automation/account.py +++ b/sdk/python/pulumi_azure/automation/account.py @@ -503,6 +503,22 @@ def __init__(__self__, """ Manages a Automation Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic", + tags={ + "environment": "development", + }) + ``` + ## Import Automation Accounts can be imported using the `resource id`, e.g. @@ -532,6 +548,22 @@ def __init__(__self__, """ Manages a Automation Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic", + tags={ + "environment": "development", + }) + ``` + ## Import Automation Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/bool_variable.py b/sdk/python/pulumi_azure/automation/bool_variable.py index 2233a3c259..2cf539f985 100644 --- a/sdk/python/pulumi_azure/automation/bool_variable.py +++ b/sdk/python/pulumi_azure/automation/bool_variable.py @@ -286,6 +286,23 @@ def __init__(__self__, """ Manages a boolean variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_bool_variable = azure.automation.BoolVariable("exampleBoolVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value=False) + ``` + ## Import Automation Bool Variable can be imported using the `resource id`, e.g. @@ -312,6 +329,23 @@ def __init__(__self__, """ Manages a boolean variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_bool_variable = azure.automation.BoolVariable("exampleBoolVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value=False) + ``` + ## Import Automation Bool Variable can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/certificate.py b/sdk/python/pulumi_azure/automation/certificate.py index 9d38652478..7aec802b8d 100644 --- a/sdk/python/pulumi_azure/automation/certificate.py +++ b/sdk/python/pulumi_azure/automation/certificate.py @@ -305,6 +305,26 @@ def __init__(__self__, """ Manages an Automation Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_certificate = azure.automation.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + description="This is an example certificate", + base64=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx"), + exportable=True) + ``` + ## Import Automation Certificates can be imported using the `resource id`, e.g. @@ -331,6 +351,26 @@ def __init__(__self__, """ Manages an Automation Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_certificate = azure.automation.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + description="This is an example certificate", + base64=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx"), + exportable=True) + ``` + ## Import Automation Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/connection.py b/sdk/python/pulumi_azure/automation/connection.py index 6c151fbed5..0c5f13e5fa 100644 --- a/sdk/python/pulumi_azure/automation/connection.py +++ b/sdk/python/pulumi_azure/automation/connection.py @@ -288,6 +288,30 @@ def __init__(__self__, """ Manages an Automation Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection = azure.automation.Connection("exampleConnection", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + type="AzureServicePrincipal", + values={ + "ApplicationId": "00000000-0000-0000-0000-000000000000", + "TenantId": example_client_config.tenant_id, + "SubscriptionId": example_client_config.subscription_id, + "CertificateThumbprint": "sample-certificate-thumbprint", + }) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. @@ -314,6 +338,30 @@ def __init__(__self__, """ Manages an Automation Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection = azure.automation.Connection("exampleConnection", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + type="AzureServicePrincipal", + values={ + "ApplicationId": "00000000-0000-0000-0000-000000000000", + "TenantId": example_client_config.tenant_id, + "SubscriptionId": example_client_config.subscription_id, + "CertificateThumbprint": "sample-certificate-thumbprint", + }) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/connection_certificate.py b/sdk/python/pulumi_azure/automation/connection_certificate.py index ef4ef06e4e..0dab570844 100644 --- a/sdk/python/pulumi_azure/automation/connection_certificate.py +++ b/sdk/python/pulumi_azure/automation/connection_certificate.py @@ -296,6 +296,30 @@ def __init__(__self__, """ Manages an Automation Connection with type `Azure`. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_certificate = azure.automation.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + base64=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx")) + example_connection_certificate = azure.automation.ConnectionCertificate("exampleConnectionCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + automation_certificate_name=example_certificate.name, + subscription_id=example_client_config.subscription_id) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. @@ -322,6 +346,30 @@ def __init__(__self__, """ Manages an Automation Connection with type `Azure`. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_certificate = azure.automation.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + base64=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx")) + example_connection_certificate = azure.automation.ConnectionCertificate("exampleConnectionCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + automation_certificate_name=example_certificate.name, + subscription_id=example_client_config.subscription_id) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/connection_classic_certificate.py b/sdk/python/pulumi_azure/automation/connection_classic_certificate.py index c3166f9614..502dd39b05 100644 --- a/sdk/python/pulumi_azure/automation/connection_classic_certificate.py +++ b/sdk/python/pulumi_azure/automation/connection_classic_certificate.py @@ -338,6 +338,26 @@ def __init__(__self__, """ Manages an Automation Connection with type `AzureClassicCertificate`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection_classic_certificate = azure.automation.ConnectionClassicCertificate("exampleConnectionClassicCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + certificate_asset_name="cert1", + subscription_name="subs1", + subscription_id=example_client_config.subscription_id) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. @@ -365,6 +385,26 @@ def __init__(__self__, """ Manages an Automation Connection with type `AzureClassicCertificate`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection_classic_certificate = azure.automation.ConnectionClassicCertificate("exampleConnectionClassicCertificate", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + certificate_asset_name="cert1", + subscription_name="subs1", + subscription_id=example_client_config.subscription_id) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/connection_service_principal.py b/sdk/python/pulumi_azure/automation/connection_service_principal.py index d4f03e2649..6b70eb0e55 100644 --- a/sdk/python/pulumi_azure/automation/connection_service_principal.py +++ b/sdk/python/pulumi_azure/automation/connection_service_principal.py @@ -380,6 +380,27 @@ def __init__(__self__, """ Manages an Automation Connection with type `AzureServicePrincipal`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection_service_principal = azure.automation.ConnectionServicePrincipal("exampleConnectionServicePrincipal", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + application_id="00000000-0000-0000-0000-000000000000", + tenant_id=example_client_config.tenant_id, + subscription_id=example_client_config.subscription_id, + certificate_thumbprint=(lambda path: open(path).read())("automation_certificate_test.thumb")) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. @@ -408,6 +429,27 @@ def __init__(__self__, """ Manages an Automation Connection with type `AzureServicePrincipal`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection_service_principal = azure.automation.ConnectionServicePrincipal("exampleConnectionServicePrincipal", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + application_id="00000000-0000-0000-0000-000000000000", + tenant_id=example_client_config.tenant_id, + subscription_id=example_client_config.subscription_id, + certificate_thumbprint=(lambda path: open(path).read())("automation_certificate_test.thumb")) + ``` + ## Import Automation Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/connection_type.py b/sdk/python/pulumi_azure/automation/connection_type.py index 1dce2c47f4..3b89ba455f 100644 --- a/sdk/python/pulumi_azure/automation/connection_type.py +++ b/sdk/python/pulumi_azure/automation/connection_type.py @@ -256,6 +256,27 @@ def __init__(__self__, """ Manages anAutomation Connection Type. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection_type = azure.automation.ConnectionType("exampleConnectionType", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + fields=[azure.automation.ConnectionTypeFieldArgs( + name="example", + type="string", + )]) + ``` + ## Import Automations can be imported using the `resource id`, e.g. @@ -281,6 +302,27 @@ def __init__(__self__, """ Manages anAutomation Connection Type. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_client_config = azure.core.get_client_config() + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_connection_type = azure.automation.ConnectionType("exampleConnectionType", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + fields=[azure.automation.ConnectionTypeFieldArgs( + name="example", + type="string", + )]) + ``` + ## Import Automations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/credential.py b/sdk/python/pulumi_azure/automation/credential.py index eefc563f0e..8a3afaba7b 100644 --- a/sdk/python/pulumi_azure/automation/credential.py +++ b/sdk/python/pulumi_azure/automation/credential.py @@ -288,6 +288,25 @@ def __init__(__self__, """ Manages a Automation Credential. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_credential = azure.automation.Credential("exampleCredential", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + username="example_user", + password="example_pwd", + description="This is an example credential") + ``` + ## Import Automation Credentials can be imported using the `resource id`, e.g. @@ -314,6 +333,25 @@ def __init__(__self__, """ Manages a Automation Credential. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_credential = azure.automation.Credential("exampleCredential", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + username="example_user", + password="example_pwd", + description="This is an example credential") + ``` + ## Import Automation Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/date_time_variable.py b/sdk/python/pulumi_azure/automation/date_time_variable.py index 017d920a18..8eeeca23ef 100644 --- a/sdk/python/pulumi_azure/automation/date_time_variable.py +++ b/sdk/python/pulumi_azure/automation/date_time_variable.py @@ -286,6 +286,23 @@ def __init__(__self__, """ Manages a DateTime variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_date_time_variable = azure.automation.DateTimeVariable("exampleDateTimeVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value="2019-04-24T21:40:54.074Z") + ``` + ## Import Automation DateTime Variable can be imported using the `resource id`, e.g. @@ -312,6 +329,23 @@ def __init__(__self__, """ Manages a DateTime variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_date_time_variable = azure.automation.DateTimeVariable("exampleDateTimeVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value="2019-04-24T21:40:54.074Z") + ``` + ## Import Automation DateTime Variable can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/dsc_configuration.py b/sdk/python/pulumi_azure/automation/dsc_configuration.py index 2f397217f9..63d1fdec0e 100644 --- a/sdk/python/pulumi_azure/automation/dsc_configuration.py +++ b/sdk/python/pulumi_azure/automation/dsc_configuration.py @@ -383,6 +383,24 @@ def __init__(__self__, """ Manages a Automation DSC Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_dsc_configuration = azure.automation.DscConfiguration("exampleDscConfiguration", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + location=example_resource_group.location, + content_embedded="configuration test {}") + ``` + ## Import Automation DSC Configuration's can be imported using the `resource id`, e.g. @@ -411,6 +429,24 @@ def __init__(__self__, """ Manages a Automation DSC Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_dsc_configuration = azure.automation.DscConfiguration("exampleDscConfiguration", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + location=example_resource_group.location, + content_embedded="configuration test {}") + ``` + ## Import Automation DSC Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/dsc_node_configuration.py b/sdk/python/pulumi_azure/automation/dsc_node_configuration.py index 9a26783cbb..7ab5b3a9fc 100644 --- a/sdk/python/pulumi_azure/automation/dsc_node_configuration.py +++ b/sdk/python/pulumi_azure/automation/dsc_node_configuration.py @@ -233,6 +233,50 @@ def __init__(__self__, """ Manages a Automation DSC Node Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_dsc_configuration = azure.automation.DscConfiguration("exampleDscConfiguration", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + location=example_resource_group.location, + content_embedded="configuration test {}") + example_dsc_node_configuration = azure.automation.DscNodeConfiguration("exampleDscNodeConfiguration", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + content_embedded=\"\"\"instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref + { + ResourceID = "[File]bla"; + Ensure = "Present"; + Contents = "bogus Content"; + DestinationPath = "c:\\\\bogus.txt"; + ModuleName = "PSDesiredStateConfiguration"; + SourceInfo = "::3::9::file"; + ModuleVersion = "1.0"; + ConfigurationName = "bla"; + }; + instance of OMI_ConfigurationDocument + { + Version="2.0.0"; + MinimumCompatibleVersion = "1.0.0"; + CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"}; + Author="bogusAuthor"; + GenerationDate="06/15/2018 14:06:24"; + GenerationHost="bogusComputer"; + Name="test"; + }; + \"\"\", + opts=pulumi.ResourceOptions(depends_on=[example_dsc_configuration])) + ``` + ## Import Automation DSC Node Configuration's can be imported using the `resource id`, e.g. @@ -257,6 +301,50 @@ def __init__(__self__, """ Manages a Automation DSC Node Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_dsc_configuration = azure.automation.DscConfiguration("exampleDscConfiguration", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + location=example_resource_group.location, + content_embedded="configuration test {}") + example_dsc_node_configuration = azure.automation.DscNodeConfiguration("exampleDscNodeConfiguration", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + content_embedded=\"\"\"instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref + { + ResourceID = "[File]bla"; + Ensure = "Present"; + Contents = "bogus Content"; + DestinationPath = "c:\\\\bogus.txt"; + ModuleName = "PSDesiredStateConfiguration"; + SourceInfo = "::3::9::file"; + ModuleVersion = "1.0"; + ConfigurationName = "bla"; + }; + instance of OMI_ConfigurationDocument + { + Version="2.0.0"; + MinimumCompatibleVersion = "1.0.0"; + CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationName"}; + Author="bogusAuthor"; + GenerationDate="06/15/2018 14:06:24"; + GenerationHost="bogusComputer"; + Name="test"; + }; + \"\"\", + opts=pulumi.ResourceOptions(depends_on=[example_dsc_configuration])) + ``` + ## Import Automation DSC Node Configuration's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/get_account.py b/sdk/python/pulumi_azure/automation/get_account.py index 19637fd143..3bd12173a2 100644 --- a/sdk/python/pulumi_azure/automation/get_account.py +++ b/sdk/python/pulumi_azure/automation/get_account.py @@ -138,6 +138,17 @@ def get_account(name: Optional[str] = None, """ Use this data source to access information about an existing Automation Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_account(name="example-account", + resource_group_name="example-resources") + pulumi.export("automationAccountId", example.id) + ``` + :param str name: The name of the Automation Account. :param str resource_group_name: Specifies the name of the Resource Group where the Automation Account exists. @@ -167,6 +178,17 @@ def get_account_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Automation Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_account(name="example-account", + resource_group_name="example-resources") + pulumi.export("automationAccountId", example.id) + ``` + :param str name: The name of the Automation Account. :param str resource_group_name: Specifies the name of the Resource Group where the Automation Account exists. diff --git a/sdk/python/pulumi_azure/automation/get_bool_variable.py b/sdk/python/pulumi_azure/automation/get_bool_variable.py index 441353faa7..99a4391e05 100644 --- a/sdk/python/pulumi_azure/automation/get_bool_variable.py +++ b/sdk/python/pulumi_azure/automation/get_bool_variable.py @@ -114,6 +114,18 @@ def get_bool_variable(automation_account_name: Optional[str] = None, """ Use this data source to access information about an existing Automation Bool Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_bool_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. @@ -144,6 +156,18 @@ def get_bool_variable_output(automation_account_name: Optional[pulumi.Input[str] """ Use this data source to access information about an existing Automation Bool Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_bool_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. diff --git a/sdk/python/pulumi_azure/automation/get_date_time_variable.py b/sdk/python/pulumi_azure/automation/get_date_time_variable.py index 485287eeef..bafaa62e1c 100644 --- a/sdk/python/pulumi_azure/automation/get_date_time_variable.py +++ b/sdk/python/pulumi_azure/automation/get_date_time_variable.py @@ -114,6 +114,18 @@ def get_date_time_variable(automation_account_name: Optional[str] = None, """ Use this data source to access information about an existing Automation Datetime Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_date_time_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. @@ -144,6 +156,18 @@ def get_date_time_variable_output(automation_account_name: Optional[pulumi.Input """ Use this data source to access information about an existing Automation Datetime Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_date_time_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. diff --git a/sdk/python/pulumi_azure/automation/get_int_variable.py b/sdk/python/pulumi_azure/automation/get_int_variable.py index 41d4e36a55..324a8215c4 100644 --- a/sdk/python/pulumi_azure/automation/get_int_variable.py +++ b/sdk/python/pulumi_azure/automation/get_int_variable.py @@ -114,6 +114,18 @@ def get_int_variable(automation_account_name: Optional[str] = None, """ Use this data source to access information about an existing Automation Int Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_int_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. @@ -144,6 +156,18 @@ def get_int_variable_output(automation_account_name: Optional[pulumi.Input[str]] """ Use this data source to access information about an existing Automation Int Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_int_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. diff --git a/sdk/python/pulumi_azure/automation/get_string_variable.py b/sdk/python/pulumi_azure/automation/get_string_variable.py index 1b4b12ed36..58f0a2d586 100644 --- a/sdk/python/pulumi_azure/automation/get_string_variable.py +++ b/sdk/python/pulumi_azure/automation/get_string_variable.py @@ -114,6 +114,18 @@ def get_string_variable(automation_account_name: Optional[str] = None, """ Use this data source to access information about an existing Automation String Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_string_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. @@ -144,6 +156,18 @@ def get_string_variable_output(automation_account_name: Optional[pulumi.Input[st """ Use this data source to access information about an existing Automation String Variable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.get_string_variable(name="tfex-example-var", + resource_group_name="tfex-example-rg", + automation_account_name="tfex-example-account") + pulumi.export("variableId", example.id) + ``` + :param str automation_account_name: The name of the automation account in which the Automation Variable exists. :param str name: The name of the Automation Variable. diff --git a/sdk/python/pulumi_azure/automation/get_variables.py b/sdk/python/pulumi_azure/automation/get_variables.py index 92d69eda43..e2e91e8d8a 100644 --- a/sdk/python/pulumi_azure/automation/get_variables.py +++ b/sdk/python/pulumi_azure/automation/get_variables.py @@ -140,6 +140,18 @@ def get_variables(automation_account_id: Optional[str] = None, """ Use this data source to get all variables in an Automation Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.automation.get_account(name="example-account", + resource_group_name="example-resources") + example_variables = azure.automation.get_variables(automation_account_id=example_account.id) + pulumi.export("stringVars", data["azurerm_automation_variable_string"]["example"]["string"]) + ``` + :param str automation_account_id: The resource ID of the automation account. """ @@ -166,6 +178,18 @@ def get_variables_output(automation_account_id: Optional[pulumi.Input[str]] = No """ Use this data source to get all variables in an Automation Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.automation.get_account(name="example-account", + resource_group_name="example-resources") + example_variables = azure.automation.get_variables(automation_account_id=example_account.id) + pulumi.export("stringVars", data["azurerm_automation_variable_string"]["example"]["string"]) + ``` + :param str automation_account_id: The resource ID of the automation account. """ diff --git a/sdk/python/pulumi_azure/automation/hybrid_runbook_worker.py b/sdk/python/pulumi_azure/automation/hybrid_runbook_worker.py index b51f03a658..507bc0f83f 100644 --- a/sdk/python/pulumi_azure/automation/hybrid_runbook_worker.py +++ b/sdk/python/pulumi_azure/automation/hybrid_runbook_worker.py @@ -362,6 +362,63 @@ def __init__(__self__, """ Manages a Automation Hybrid Runbook Worker. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_hybrid_runbook_worker_group = azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm-example", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + size="Standard_B1s", + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + network_interface_ids=[example_network_interface.id]) + example_hybrid_runbook_worker = azure.automation.HybridRunbookWorker("exampleHybridRunbookWorker", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + worker_group_name=example_hybrid_runbook_worker_group.name, + vm_resource_id=example_linux_virtual_machine.id, + worker_id="00000000-0000-0000-0000-000000000000") + #unique uuid + ``` + ## Import Automations can be imported using the `resource id`, e.g. @@ -387,6 +444,63 @@ def __init__(__self__, """ Manages a Automation Hybrid Runbook Worker. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_hybrid_runbook_worker_group = azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm-example", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + size="Standard_B1s", + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + network_interface_ids=[example_network_interface.id]) + example_hybrid_runbook_worker = azure.automation.HybridRunbookWorker("exampleHybridRunbookWorker", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + worker_group_name=example_hybrid_runbook_worker_group.name, + vm_resource_id=example_linux_virtual_machine.id, + worker_id="00000000-0000-0000-0000-000000000000") + #unique uuid + ``` + ## Import Automations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/hybrid_runbook_worker_group.py b/sdk/python/pulumi_azure/automation/hybrid_runbook_worker_group.py index 5bfa6af16b..a4484c065d 100644 --- a/sdk/python/pulumi_azure/automation/hybrid_runbook_worker_group.py +++ b/sdk/python/pulumi_azure/automation/hybrid_runbook_worker_group.py @@ -216,6 +216,22 @@ def __init__(__self__, """ Manages a Automation Hybrid Runbook Worker Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_hybrid_runbook_worker_group = azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name) + ``` + ## Import Automations can be imported using the `resource id`, e.g. @@ -240,6 +256,22 @@ def __init__(__self__, """ Manages a Automation Hybrid Runbook Worker Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_hybrid_runbook_worker_group = azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name) + ``` + ## Import Automations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/int_variable.py b/sdk/python/pulumi_azure/automation/int_variable.py index a565f40bd7..784909f570 100644 --- a/sdk/python/pulumi_azure/automation/int_variable.py +++ b/sdk/python/pulumi_azure/automation/int_variable.py @@ -286,6 +286,23 @@ def __init__(__self__, """ Manages a integer variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_int_variable = azure.automation.IntVariable("exampleIntVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value=1234) + ``` + ## Import Automation Int Variable can be imported using the `resource id`, e.g. @@ -312,6 +329,23 @@ def __init__(__self__, """ Manages a integer variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_int_variable = azure.automation.IntVariable("exampleIntVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value=1234) + ``` + ## Import Automation Int Variable can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/job_schedule.py b/sdk/python/pulumi_azure/automation/job_schedule.py index 7d1e7b6cce..b91ceeec03 100644 --- a/sdk/python/pulumi_azure/automation/job_schedule.py +++ b/sdk/python/pulumi_azure/automation/job_schedule.py @@ -349,6 +349,25 @@ def __init__(__self__, """ Links an Automation Runbook and Schedule. + ## Example Usage + + This is an example of just the Job Schedule. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.JobSchedule("example", + automation_account_name="tf-automation-account", + parameters={ + "resourcegroup": "tf-rgr-vm", + "vmname": "TF-VM-01", + }, + resource_group_name="tf-rgr-automation", + runbook_name="Get-VirtualMachine", + schedule_name="hour") + ``` + ## Import Automation Job Schedules can be imported using the `resource id`, e.g. @@ -378,6 +397,25 @@ def __init__(__self__, """ Links an Automation Runbook and Schedule. + ## Example Usage + + This is an example of just the Job Schedule. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.automation.JobSchedule("example", + automation_account_name="tf-automation-account", + parameters={ + "resourcegroup": "tf-rgr-vm", + "vmname": "TF-VM-01", + }, + resource_group_name="tf-rgr-automation", + runbook_name="Get-VirtualMachine", + schedule_name="hour") + ``` + ## Import Automation Job Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/module.py b/sdk/python/pulumi_azure/automation/module.py index 8b9aff30fb..64a88d05af 100644 --- a/sdk/python/pulumi_azure/automation/module.py +++ b/sdk/python/pulumi_azure/automation/module.py @@ -219,6 +219,25 @@ def __init__(__self__, """ Manages a Automation Module. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_module = azure.automation.Module("exampleModule", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + module_link=azure.automation.ModuleModuleLinkArgs( + uri="https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg", + )) + ``` + ## Import Automation Modules can be imported using the `resource id`, e.g. @@ -243,6 +262,25 @@ def __init__(__self__, """ Manages a Automation Module. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_module = azure.automation.Module("exampleModule", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + module_link=azure.automation.ModuleModuleLinkArgs( + uri="https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg", + )) + ``` + ## Import Automation Modules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/python3_package.py b/sdk/python/pulumi_azure/automation/python3_package.py index d47a52aa72..5e0f885746 100644 --- a/sdk/python/pulumi_azure/automation/python3_package.py +++ b/sdk/python/pulumi_azure/automation/python3_package.py @@ -377,6 +377,29 @@ def __init__(__self__, """ Manages a Automation Python3 Package. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="%[2]s") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_python3_package = azure.automation.Python3Package("examplePython3Package", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + content_uri="https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz", + content_version="2.31.0", + hash_algorithm="sha256", + hash_value="942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1", + tags={ + "key": "foo", + }) + ``` + ## Import Automation Python3 Packages can be imported using the `resource id`, e.g. @@ -405,6 +428,29 @@ def __init__(__self__, """ Manages a Automation Python3 Package. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="%[2]s") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_python3_package = azure.automation.Python3Package("examplePython3Package", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + content_uri="https://pypi.org/packages/source/r/requests/requests-2.31.0.tar.gz", + content_version="2.31.0", + hash_algorithm="sha256", + hash_value="942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1", + tags={ + "key": "foo", + }) + ``` + ## Import Automation Python3 Packages can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/run_book.py b/sdk/python/pulumi_azure/automation/run_book.py index bb0a0d647b..bc0fa9f985 100644 --- a/sdk/python/pulumi_azure/automation/run_book.py +++ b/sdk/python/pulumi_azure/automation/run_book.py @@ -611,6 +611,53 @@ def __init__(__self__, """ Manages a Automation Runbook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShellWorkflow", + publish_content_link=azure.automation.RunBookPublishContentLinkArgs( + uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + )) + ``` + ### Custom Content + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_local as local + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_file = local.get_file(filename=f"{path['module']}/example.ps1") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShell", + content=example_file.content) + ``` + ## Import Automation Runbooks can be imported using the `resource id`, e.g. @@ -646,6 +693,53 @@ def __init__(__self__, """ Manages a Automation Runbook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShellWorkflow", + publish_content_link=azure.automation.RunBookPublishContentLinkArgs( + uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + )) + ``` + ### Custom Content + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_local as local + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_file = local.get_file(filename=f"{path['module']}/example.ps1") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShell", + content=example_file.content) + ``` + ## Import Automation Runbooks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/schedule.py b/sdk/python/pulumi_azure/automation/schedule.py index ec267f1c14..789e80440e 100644 --- a/sdk/python/pulumi_azure/automation/schedule.py +++ b/sdk/python/pulumi_azure/automation/schedule.py @@ -531,6 +531,28 @@ def __init__(__self__, """ Manages a Automation Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_schedule = azure.automation.Schedule("exampleSchedule", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + frequency="Week", + interval=1, + timezone="Australia/Perth", + start_time="2014-04-15T18:00:15+02:00", + description="This is an example schedule", + week_days=["Friday"]) + ``` + ## Import Automation Schedule can be imported using the `resource id`, e.g. @@ -563,6 +585,28 @@ def __init__(__self__, """ Manages a Automation Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_schedule = azure.automation.Schedule("exampleSchedule", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + frequency="Week", + interval=1, + timezone="Australia/Perth", + start_time="2014-04-15T18:00:15+02:00", + description="This is an example schedule", + week_days=["Friday"]) + ``` + ## Import Automation Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/software_update_configuration.py b/sdk/python/pulumi_azure/automation/software_update_configuration.py index 954ee1ed2b..505f093c59 100644 --- a/sdk/python/pulumi_azure/automation/software_update_configuration.py +++ b/sdk/python/pulumi_azure/automation/software_update_configuration.py @@ -600,6 +600,49 @@ def __init__(__self__, """ Manages an Automation Software Update Configuraion. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is a example runbook for terraform acceptance example", + runbook_type="Python3", + content=\"\"\"# Some example content + # for Terraform acceptance example + \"\"\", + tags={ + "ENV": "runbook_test", + }) + example_software_update_configuration = azure.automation.SoftwareUpdateConfiguration("exampleSoftwareUpdateConfiguration", + automation_account_id=example_account.id, + operating_system="Linux", + linuxes=[azure.automation.SoftwareUpdateConfigurationLinuxArgs( + classification_included="Security", + excluded_packages=["apt"], + included_packages=["vim"], + reboot="IfRequired", + )], + pre_tasks=[azure.automation.SoftwareUpdateConfigurationPreTaskArgs( + source=example_run_book.name, + parameters={ + "COMPUTER_NAME": "Foo", + }, + )], + duration="PT2H2M2S") + ``` + ## Import Automations Software Update Configuration can be imported using the `resource id`, e.g. @@ -633,6 +676,49 @@ def __init__(__self__, """ Manages an Automation Software Update Configuraion. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is a example runbook for terraform acceptance example", + runbook_type="Python3", + content=\"\"\"# Some example content + # for Terraform acceptance example + \"\"\", + tags={ + "ENV": "runbook_test", + }) + example_software_update_configuration = azure.automation.SoftwareUpdateConfiguration("exampleSoftwareUpdateConfiguration", + automation_account_id=example_account.id, + operating_system="Linux", + linuxes=[azure.automation.SoftwareUpdateConfigurationLinuxArgs( + classification_included="Security", + excluded_packages=["apt"], + included_packages=["vim"], + reboot="IfRequired", + )], + pre_tasks=[azure.automation.SoftwareUpdateConfigurationPreTaskArgs( + source=example_run_book.name, + parameters={ + "COMPUTER_NAME": "Foo", + }, + )], + duration="PT2H2M2S") + ``` + ## Import Automations Software Update Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/source_control.py b/sdk/python/pulumi_azure/automation/source_control.py index 5b1fbcf4b7..0c5a7667be 100644 --- a/sdk/python/pulumi_azure/automation/source_control.py +++ b/sdk/python/pulumi_azure/automation/source_control.py @@ -455,6 +455,29 @@ def __init__(__self__, """ Manages an Automation Source Control. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_source_control = azure.automation.SourceControl("exampleSourceControl", + automation_account_id=example_account.id, + folder_path="runbook", + security=azure.automation.SourceControlSecurityArgs( + token="ghp_xxx", + token_type="PersonalAccessToken", + ), + repository_url="https://github.com/foo/bat.git", + source_control_type="GitHub", + branch="main") + ``` + ## Import Automations can be imported using the `resource id`, e.g. @@ -485,6 +508,29 @@ def __init__(__self__, """ Manages an Automation Source Control. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_source_control = azure.automation.SourceControl("exampleSourceControl", + automation_account_id=example_account.id, + folder_path="runbook", + security=azure.automation.SourceControlSecurityArgs( + token="ghp_xxx", + token_type="PersonalAccessToken", + ), + repository_url="https://github.com/foo/bat.git", + source_control_type="GitHub", + branch="main") + ``` + ## Import Automations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/string_variable.py b/sdk/python/pulumi_azure/automation/string_variable.py index 8c1ee3f690..4baad3150d 100644 --- a/sdk/python/pulumi_azure/automation/string_variable.py +++ b/sdk/python/pulumi_azure/automation/string_variable.py @@ -286,6 +286,23 @@ def __init__(__self__, """ Manages a string variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_string_variable = azure.automation.StringVariable("exampleStringVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value="Hello, Basic Test.") + ``` + ## Import Automation String Variable can be imported using the `resource id`, e.g. @@ -312,6 +329,23 @@ def __init__(__self__, """ Manages a string variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_string_variable = azure.automation.StringVariable("exampleStringVariable", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value="Hello, Basic Test.") + ``` + ## Import Automation String Variable can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/variable_object.py b/sdk/python/pulumi_azure/automation/variable_object.py index 6ac1fc145f..a558dd80fc 100644 --- a/sdk/python/pulumi_azure/automation/variable_object.py +++ b/sdk/python/pulumi_azure/automation/variable_object.py @@ -286,6 +286,27 @@ def __init__(__self__, """ Manages an object variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_variable_object = azure.automation.VariableObject("exampleVariableObject", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value=json.dumps({ + "greeting": "Hello, Terraform Basic Test.", + "language": "en", + })) + ``` + ## Import Automation Object Variable can be imported using the `resource id`, e.g. @@ -312,6 +333,27 @@ def __init__(__self__, """ Manages an object variable in Azure Automation + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_variable_object = azure.automation.VariableObject("exampleVariableObject", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + value=json.dumps({ + "greeting": "Hello, Terraform Basic Test.", + "language": "en", + })) + ``` + ## Import Automation Object Variable can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/watcher.py b/sdk/python/pulumi_azure/automation/watcher.py index 1c74f3fa7c..ff25c21cb4 100644 --- a/sdk/python/pulumi_azure/automation/watcher.py +++ b/sdk/python/pulumi_azure/automation/watcher.py @@ -466,6 +466,46 @@ def __init__(__self__, """ Manages an Automation Wacher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_hybrid_runbook_worker_group = azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name) + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShellWorkflow", + publish_content_link=azure.automation.RunBookPublishContentLinkArgs( + uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + )) + example_watcher = azure.automation.Watcher("exampleWatcher", + automation_account_id=example_account.id, + location="West Europe", + script_name=example_run_book.name, + script_run_on=example_hybrid_runbook_worker_group.name, + description="example-watcher desc", + execution_frequency_in_seconds=42, + tags={ + "foo": "bar", + }, + script_parameters={ + "foo": "bar", + }) + ``` + ## Import Automation Watchers can be imported using the `resource id`, e.g. @@ -496,6 +536,46 @@ def __init__(__self__, """ Manages an Automation Wacher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_hybrid_runbook_worker_group = azure.automation.HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name) + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShellWorkflow", + publish_content_link=azure.automation.RunBookPublishContentLinkArgs( + uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + )) + example_watcher = azure.automation.Watcher("exampleWatcher", + automation_account_id=example_account.id, + location="West Europe", + script_name=example_run_book.name, + script_run_on=example_hybrid_runbook_worker_group.name, + description="example-watcher desc", + execution_frequency_in_seconds=42, + tags={ + "foo": "bar", + }, + script_parameters={ + "foo": "bar", + }) + ``` + ## Import Automation Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/automation/webhook.py b/sdk/python/pulumi_azure/automation/webhook.py index 8ae1ee817d..fe2ee2a178 100644 --- a/sdk/python/pulumi_azure/automation/webhook.py +++ b/sdk/python/pulumi_azure/automation/webhook.py @@ -411,6 +411,39 @@ def __init__(__self__, """ Manages an Automation Runbook's Webhook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShellWorkflow", + publish_content_link=azure.automation.RunBookPublishContentLinkArgs( + uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + )) + example_webhook = azure.automation.Webhook("exampleWebhook", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + expiry_time="2021-12-31T00:00:00Z", + enabled=True, + runbook_name=example_run_book.name, + parameters={ + "input": "parameter", + }) + ``` + ## Import Automation Webhooks can be imported using the `resource id`, e.g. @@ -440,6 +473,39 @@ def __init__(__self__, """ Manages an Automation Runbook's Webhook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_run_book = azure.automation.RunBook("exampleRunBook", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + log_verbose=True, + log_progress=True, + description="This is an example runbook", + runbook_type="PowerShellWorkflow", + publish_content_link=azure.automation.RunBookPublishContentLinkArgs( + uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1", + )) + example_webhook = azure.automation.Webhook("exampleWebhook", + resource_group_name=example_resource_group.name, + automation_account_name=example_account.name, + expiry_time="2021-12-31T00:00:00Z", + enabled=True, + runbook_name=example_run_book.name, + parameters={ + "input": "parameter", + }) + ``` + ## Import Automation Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/avs/cluster.py b/sdk/python/pulumi_azure/avs/cluster.py index 4747038e47..1a33dbc3c1 100644 --- a/sdk/python/pulumi_azure/avs/cluster.py +++ b/sdk/python/pulumi_azure/avs/cluster.py @@ -255,6 +255,30 @@ def __init__(__self__, """ Manages a VMware Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_cloud = azure.avs.PrivateCloud("examplePrivateCloud", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="av36", + management_cluster=azure.avs.PrivateCloudManagementClusterArgs( + size=3, + ), + network_subnet_cidr="192.168.48.0/22", + internet_connection_enabled=False, + nsxt_password="QazWsx13$Edc", + vcenter_password="WsxEdc23$Rfv") + example_cluster = azure.avs.Cluster("exampleCluster", + vmware_cloud_id=example_private_cloud.id, + cluster_node_count=3, + sku_name="av36") + ``` + ## Import VMware Clusters can be imported using the `resource id`, e.g. @@ -279,6 +303,30 @@ def __init__(__self__, """ Manages a VMware Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_cloud = azure.avs.PrivateCloud("examplePrivateCloud", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="av36", + management_cluster=azure.avs.PrivateCloudManagementClusterArgs( + size=3, + ), + network_subnet_cidr="192.168.48.0/22", + internet_connection_enabled=False, + nsxt_password="QazWsx13$Edc", + vcenter_password="WsxEdc23$Rfv") + example_cluster = azure.avs.Cluster("exampleCluster", + vmware_cloud_id=example_private_cloud.id, + cluster_node_count=3, + sku_name="av36") + ``` + ## Import VMware Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/avs/express_route_authorization.py b/sdk/python/pulumi_azure/avs/express_route_authorization.py index ffd7748c5e..31689d885c 100644 --- a/sdk/python/pulumi_azure/avs/express_route_authorization.py +++ b/sdk/python/pulumi_azure/avs/express_route_authorization.py @@ -173,6 +173,27 @@ def __init__(__self__, """ Manages an Express Route VMware Authorization. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_cloud = azure.avs.PrivateCloud("examplePrivateCloud", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="av36", + management_cluster=azure.avs.PrivateCloudManagementClusterArgs( + size=3, + ), + network_subnet_cidr="192.168.48.0/22", + internet_connection_enabled=False, + nsxt_password="QazWsx13$Edc", + vcenter_password="WsxEdc23$Rfv") + example_express_route_authorization = azure.avs.ExpressRouteAuthorization("exampleExpressRouteAuthorization", private_cloud_id=example_private_cloud.id) + ``` + ## Import VMware Authorizations can be imported using the `resource id`, e.g. @@ -195,6 +216,27 @@ def __init__(__self__, """ Manages an Express Route VMware Authorization. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_cloud = azure.avs.PrivateCloud("examplePrivateCloud", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="av36", + management_cluster=azure.avs.PrivateCloudManagementClusterArgs( + size=3, + ), + network_subnet_cidr="192.168.48.0/22", + internet_connection_enabled=False, + nsxt_password="QazWsx13$Edc", + vcenter_password="WsxEdc23$Rfv") + example_express_route_authorization = azure.avs.ExpressRouteAuthorization("exampleExpressRouteAuthorization", private_cloud_id=example_private_cloud.id) + ``` + ## Import VMware Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/avs/get_private_cloud.py b/sdk/python/pulumi_azure/avs/get_private_cloud.py index 1e7fdbf08a..0ad753d96b 100644 --- a/sdk/python/pulumi_azure/avs/get_private_cloud.py +++ b/sdk/python/pulumi_azure/avs/get_private_cloud.py @@ -249,6 +249,19 @@ def get_private_cloud(name: Optional[str] = None, """ Use this data source to access information about an existing VMware Private Cloud. + ## Example Usage + + > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.avs.get_private_cloud(name="existing-vmware-private-cloud", + resource_group_name="existing-resgroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this VMware Private Cloud. :param str resource_group_name: The name of the Resource Group where the VMware Private Cloud exists. @@ -287,6 +300,19 @@ def get_private_cloud_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing VMware Private Cloud. + ## Example Usage + + > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.avs.get_private_cloud(name="existing-vmware-private-cloud", + resource_group_name="existing-resgroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this VMware Private Cloud. :param str resource_group_name: The name of the Resource Group where the VMware Private Cloud exists. diff --git a/sdk/python/pulumi_azure/avs/private_cloud.py b/sdk/python/pulumi_azure/avs/private_cloud.py index c71ec75c4a..48c8c13772 100644 --- a/sdk/python/pulumi_azure/avs/private_cloud.py +++ b/sdk/python/pulumi_azure/avs/private_cloud.py @@ -644,6 +644,28 @@ def __init__(__self__, """ Manages a VMware Private Cloud. + ## Example Usage + + > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_cloud = azure.avs.PrivateCloud("examplePrivateCloud", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="av36", + management_cluster=azure.avs.PrivateCloudManagementClusterArgs( + size=3, + ), + network_subnet_cidr="192.168.48.0/22", + internet_connection_enabled=False, + nsxt_password="QazWsx13$Edc", + vcenter_password="WsxEdc23$Rfv") + ``` + ## Import VMware Private Clouds can be imported using the `resource id`, e.g. @@ -676,6 +698,28 @@ def __init__(__self__, """ Manages a VMware Private Cloud. + ## Example Usage + + > **NOTE :** Normal `pulumi up` could ignore this note. Please disable correlation request id for continuous operations in one build (like acctest). The continuous operations like `update` or `delete` could not be triggered when it shares the same `correlation-id` with its previous operation. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_cloud = azure.avs.PrivateCloud("examplePrivateCloud", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="av36", + management_cluster=azure.avs.PrivateCloudManagementClusterArgs( + size=3, + ), + network_subnet_cidr="192.168.48.0/22", + internet_connection_enabled=False, + nsxt_password="QazWsx13$Edc", + vcenter_password="WsxEdc23$Rfv") + ``` + ## Import VMware Private Clouds can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/backup/container_storage_account.py b/sdk/python/pulumi_azure/backup/container_storage_account.py index e503204900..08ff45b0aa 100644 --- a/sdk/python/pulumi_azure/backup/container_storage_account.py +++ b/sdk/python/pulumi_azure/backup/container_storage_account.py @@ -188,6 +188,28 @@ def __init__(__self__, """ Manages registration of a storage account with Azure Backup. Storage accounts must be registered with an Azure Recovery Vault in order to backup file shares within the storage account. Registering a storage account with a vault creates what is known as a protection container within Azure Recovery Services. Once the container is created, Azure file shares within the storage account can be backed up using the `backup.ProtectedFileShare` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard") + sa = azure.storage.Account("sa", + location=example.location, + resource_group_name=example.name, + account_tier="Standard", + account_replication_type="LRS") + container = azure.backup.ContainerStorageAccount("container", + resource_group_name=example.name, + recovery_vault_name=vault.name, + storage_account_id=sa.id) + ``` + ## Import Backup Storage Account Containers can be imported using the `resource id`, e.g. @@ -215,6 +237,28 @@ def __init__(__self__, """ Manages registration of a storage account with Azure Backup. Storage accounts must be registered with an Azure Recovery Vault in order to backup file shares within the storage account. Registering a storage account with a vault creates what is known as a protection container within Azure Recovery Services. Once the container is created, Azure file shares within the storage account can be backed up using the `backup.ProtectedFileShare` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard") + sa = azure.storage.Account("sa", + location=example.location, + resource_group_name=example.name, + account_tier="Standard", + account_replication_type="LRS") + container = azure.backup.ContainerStorageAccount("container", + resource_group_name=example.name, + recovery_vault_name=vault.name, + storage_account_id=sa.id) + ``` + ## Import Backup Storage Account Containers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/backup/get_policy_fileshare.py b/sdk/python/pulumi_azure/backup/get_policy_fileshare.py index 52641dd1ab..2e949210c9 100644 --- a/sdk/python/pulumi_azure/backup/get_policy_fileshare.py +++ b/sdk/python/pulumi_azure/backup/get_policy_fileshare.py @@ -78,6 +78,17 @@ def get_policy_fileshare(name: Optional[str] = None, """ Use this data source to access information about an existing File Share Backup Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.backup.get_policy_fileshare(name="policy", + recovery_vault_name="recovery_vault", + resource_group_name="resource_group") + ``` + :param str name: Specifies the name of the File Share Backup Policy. :param str recovery_vault_name: Specifies the name of the Recovery Services Vault. @@ -105,6 +116,17 @@ def get_policy_fileshare_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing File Share Backup Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.backup.get_policy_fileshare(name="policy", + recovery_vault_name="recovery_vault", + resource_group_name="resource_group") + ``` + :param str name: Specifies the name of the File Share Backup Policy. :param str recovery_vault_name: Specifies the name of the Recovery Services Vault. diff --git a/sdk/python/pulumi_azure/backup/get_policy_vm.py b/sdk/python/pulumi_azure/backup/get_policy_vm.py index c8267d74af..718b9964f4 100644 --- a/sdk/python/pulumi_azure/backup/get_policy_vm.py +++ b/sdk/python/pulumi_azure/backup/get_policy_vm.py @@ -78,6 +78,17 @@ def get_policy_vm(name: Optional[str] = None, """ Use this data source to access information about an existing VM Backup Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.backup.get_policy_vm(name="policy", + recovery_vault_name="recovery_vault", + resource_group_name="resource_group") + ``` + :param str name: Specifies the name of the VM Backup Policy. :param str recovery_vault_name: Specifies the name of the Recovery Services Vault. @@ -105,6 +116,17 @@ def get_policy_vm_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing VM Backup Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.backup.get_policy_vm(name="policy", + recovery_vault_name="recovery_vault", + resource_group_name="resource_group") + ``` + :param str name: Specifies the name of the VM Backup Policy. :param str recovery_vault_name: Specifies the name of the Recovery Services Vault. diff --git a/sdk/python/pulumi_azure/backup/policy_file_share.py b/sdk/python/pulumi_azure/backup/policy_file_share.py index 7f1a6b350e..0055ee856b 100644 --- a/sdk/python/pulumi_azure/backup/policy_file_share.py +++ b/sdk/python/pulumi_azure/backup/policy_file_share.py @@ -425,6 +425,56 @@ def __init__(__self__, """ Manages an Azure File Share Backup Policy within a Recovery Services vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + policy = azure.backup.PolicyFileShare("policy", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + timezone="UTC", + backup=azure.backup.PolicyFileShareBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyFileShareRetentionDailyArgs( + count=10, + ), + retention_weekly=azure.backup.PolicyFileShareRetentionWeeklyArgs( + count=7, + weekdays=[ + "Sunday", + "Wednesday", + "Friday", + "Saturday", + ], + ), + retention_monthly=azure.backup.PolicyFileShareRetentionMonthlyArgs( + count=7, + weekdays=[ + "Sunday", + "Wednesday", + ], + weeks=[ + "First", + "Last", + ], + ), + retention_yearly=azure.backup.PolicyFileShareRetentionYearlyArgs( + count=7, + weekdays=["Sunday"], + weeks=["Last"], + months=["January"], + )) + ``` + ## Import Azure File Share Backup Policies can be imported using the `resource id`, e.g. @@ -456,6 +506,56 @@ def __init__(__self__, """ Manages an Azure File Share Backup Policy within a Recovery Services vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + policy = azure.backup.PolicyFileShare("policy", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + timezone="UTC", + backup=azure.backup.PolicyFileShareBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyFileShareRetentionDailyArgs( + count=10, + ), + retention_weekly=azure.backup.PolicyFileShareRetentionWeeklyArgs( + count=7, + weekdays=[ + "Sunday", + "Wednesday", + "Friday", + "Saturday", + ], + ), + retention_monthly=azure.backup.PolicyFileShareRetentionMonthlyArgs( + count=7, + weekdays=[ + "Sunday", + "Wednesday", + ], + weeks=[ + "First", + "Last", + ], + ), + retention_yearly=azure.backup.PolicyFileShareRetentionYearlyArgs( + count=7, + weekdays=["Sunday"], + weeks=["Last"], + months=["January"], + )) + ``` + ## Import Azure File Share Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/backup/policy_vm.py b/sdk/python/pulumi_azure/backup/policy_vm.py index 7774ffa275..519def433d 100644 --- a/sdk/python/pulumi_azure/backup/policy_vm.py +++ b/sdk/python/pulumi_azure/backup/policy_vm.py @@ -539,6 +539,56 @@ def __init__(__self__, """ Manages an Azure Backup VM Backup Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_policy_vm = azure.backup.PolicyVM("examplePolicyVM", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + timezone="UTC", + backup=azure.backup.PolicyVMBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyVMRetentionDailyArgs( + count=10, + ), + retention_weekly=azure.backup.PolicyVMRetentionWeeklyArgs( + count=42, + weekdays=[ + "Sunday", + "Wednesday", + "Friday", + "Saturday", + ], + ), + retention_monthly=azure.backup.PolicyVMRetentionMonthlyArgs( + count=7, + weekdays=[ + "Sunday", + "Wednesday", + ], + weeks=[ + "First", + "Last", + ], + ), + retention_yearly=azure.backup.PolicyVMRetentionYearlyArgs( + count=77, + weekdays=["Sunday"], + weeks=["Last"], + months=["January"], + )) + ``` + ## Import VM Backup Policies can be imported using the `resource id`, e.g. @@ -571,6 +621,56 @@ def __init__(__self__, """ Manages an Azure Backup VM Backup Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_policy_vm = azure.backup.PolicyVM("examplePolicyVM", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + timezone="UTC", + backup=azure.backup.PolicyVMBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyVMRetentionDailyArgs( + count=10, + ), + retention_weekly=azure.backup.PolicyVMRetentionWeeklyArgs( + count=42, + weekdays=[ + "Sunday", + "Wednesday", + "Friday", + "Saturday", + ], + ), + retention_monthly=azure.backup.PolicyVMRetentionMonthlyArgs( + count=7, + weekdays=[ + "Sunday", + "Wednesday", + ], + weeks=[ + "First", + "Last", + ], + ), + retention_yearly=azure.backup.PolicyVMRetentionYearlyArgs( + count=77, + weekdays=["Sunday"], + weeks=["Last"], + months=["January"], + )) + ``` + ## Import VM Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/backup/policy_vm_workload.py b/sdk/python/pulumi_azure/backup/policy_vm_workload.py index 9a23ef682e..f56c17256d 100644 --- a/sdk/python/pulumi_azure/backup/policy_vm_workload.py +++ b/sdk/python/pulumi_azure/backup/policy_vm_workload.py @@ -299,6 +299,49 @@ def __init__(__self__, """ Manages an Azure VM Workload Backup Policy within a Recovery Services vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + soft_delete_enabled=False) + example_policy_vm_workload = azure.backup.PolicyVMWorkload("examplePolicyVMWorkload", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + workload_type="SQLDataBase", + settings=azure.backup.PolicyVMWorkloadSettingsArgs( + time_zone="UTC", + compression_enabled=False, + ), + protection_policies=[ + azure.backup.PolicyVMWorkloadProtectionPolicyArgs( + policy_type="Full", + backup=azure.backup.PolicyVMWorkloadProtectionPolicyBackupArgs( + frequency="Daily", + time="15:00", + ), + retention_daily=azure.backup.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs( + count=8, + ), + ), + azure.backup.PolicyVMWorkloadProtectionPolicyArgs( + policy_type="Log", + backup=azure.backup.PolicyVMWorkloadProtectionPolicyBackupArgs( + frequency_in_minutes=15, + ), + simple_retention=azure.backup.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs( + count=8, + ), + ), + ]) + ``` + ## Import Azure VM Workload Backup Policies can be imported using the `resource id`, e.g. @@ -325,6 +368,49 @@ def __init__(__self__, """ Manages an Azure VM Workload Backup Policy within a Recovery Services vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + soft_delete_enabled=False) + example_policy_vm_workload = azure.backup.PolicyVMWorkload("examplePolicyVMWorkload", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + workload_type="SQLDataBase", + settings=azure.backup.PolicyVMWorkloadSettingsArgs( + time_zone="UTC", + compression_enabled=False, + ), + protection_policies=[ + azure.backup.PolicyVMWorkloadProtectionPolicyArgs( + policy_type="Full", + backup=azure.backup.PolicyVMWorkloadProtectionPolicyBackupArgs( + frequency="Daily", + time="15:00", + ), + retention_daily=azure.backup.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs( + count=8, + ), + ), + azure.backup.PolicyVMWorkloadProtectionPolicyArgs( + policy_type="Log", + backup=azure.backup.PolicyVMWorkloadProtectionPolicyBackupArgs( + frequency_in_minutes=15, + ), + simple_retention=azure.backup.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs( + count=8, + ), + ), + ]) + ``` + ## Import Azure VM Workload Backup Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/backup/protected_file_share.py b/sdk/python/pulumi_azure/backup/protected_file_share.py index 004344b8fe..eb382ed368 100644 --- a/sdk/python/pulumi_azure/backup/protected_file_share.py +++ b/sdk/python/pulumi_azure/backup/protected_file_share.py @@ -272,6 +272,47 @@ def __init__(__self__, """ Manages an Azure Backup Protected File Share to enable backups for file shares within an Azure Storage Account + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + vault = azure.recoveryservices.Vault("vault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + sa = azure.storage.Account("sa", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=sa.name, + quota=1) + protection_container = azure.backup.ContainerStorageAccount("protection-container", + resource_group_name=example_resource_group.name, + recovery_vault_name=vault.name, + storage_account_id=sa.id) + example_policy_file_share = azure.backup.PolicyFileShare("examplePolicyFileShare", + resource_group_name=example_resource_group.name, + recovery_vault_name=vault.name, + backup=azure.backup.PolicyFileShareBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyFileShareRetentionDailyArgs( + count=10, + )) + share1 = azure.backup.ProtectedFileShare("share1", + resource_group_name=example_resource_group.name, + recovery_vault_name=vault.name, + source_storage_account_id=protection_container.storage_account_id, + source_file_share_name=example_share.name, + backup_policy_id=example_policy_file_share.id) + ``` + ## Import Azure Backup Protected File Shares can be imported using the `resource id`, e.g. @@ -301,6 +342,47 @@ def __init__(__self__, """ Manages an Azure Backup Protected File Share to enable backups for file shares within an Azure Storage Account + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + vault = azure.recoveryservices.Vault("vault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + sa = azure.storage.Account("sa", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=sa.name, + quota=1) + protection_container = azure.backup.ContainerStorageAccount("protection-container", + resource_group_name=example_resource_group.name, + recovery_vault_name=vault.name, + storage_account_id=sa.id) + example_policy_file_share = azure.backup.PolicyFileShare("examplePolicyFileShare", + resource_group_name=example_resource_group.name, + recovery_vault_name=vault.name, + backup=azure.backup.PolicyFileShareBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyFileShareRetentionDailyArgs( + count=10, + )) + share1 = azure.backup.ProtectedFileShare("share1", + resource_group_name=example_resource_group.name, + recovery_vault_name=vault.name, + source_storage_account_id=protection_container.storage_account_id, + source_file_share_name=example_share.name, + backup_policy_id=example_policy_file_share.id) + ``` + ## Import Azure Backup Protected File Shares can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/backup/protected_vm.py b/sdk/python/pulumi_azure/backup/protected_vm.py index da38e0b7e1..20b5fc71eb 100644 --- a/sdk/python/pulumi_azure/backup/protected_vm.py +++ b/sdk/python/pulumi_azure/backup/protected_vm.py @@ -355,6 +355,36 @@ def __init__(__self__, """ Manages Azure Backup for an Azure VM + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_policy_vm = azure.backup.PolicyVM("examplePolicyVM", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + backup=azure.backup.PolicyVMBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyVMRetentionDailyArgs( + count=10, + )) + example_virtual_machine = azure.compute.get_virtual_machine_output(name="example-vm", + resource_group_name=example_resource_group.name) + vm1 = azure.backup.ProtectedVM("vm1", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + source_vm_id=example_virtual_machine.id, + backup_policy_id=example_policy_vm.id) + ``` + ## Import Recovery Services Protected VMs can be imported using the `resource id`, e.g. @@ -387,6 +417,36 @@ def __init__(__self__, """ Manages Azure Backup for an Azure VM + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_policy_vm = azure.backup.PolicyVM("examplePolicyVM", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + backup=azure.backup.PolicyVMBackupArgs( + frequency="Daily", + time="23:00", + ), + retention_daily=azure.backup.PolicyVMRetentionDailyArgs( + count=10, + )) + example_virtual_machine = azure.compute.get_virtual_machine_output(name="example-vm", + resource_group_name=example_resource_group.name) + vm1 = azure.backup.ProtectedVM("vm1", + resource_group_name=example_resource_group.name, + recovery_vault_name=example_vault.name, + source_vm_id=example_virtual_machine.id, + backup_policy_id=example_policy_vm.id) + ``` + ## Import Recovery Services Protected VMs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/batch/account.py b/sdk/python/pulumi_azure/batch/account.py index 1c3955db63..2eb30e252c 100644 --- a/sdk/python/pulumi_azure/batch/account.py +++ b/sdk/python/pulumi_azure/batch/account.py @@ -711,6 +711,29 @@ def __init__(__self__, """ Manages an Azure Batch account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys", + tags={ + "env": "test", + }) + ``` + ## Import Batch Account can be imported using the `resource id`, e.g. @@ -755,6 +778,29 @@ def __init__(__self__, """ Manages an Azure Batch account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys", + tags={ + "env": "test", + }) + ``` + ## Import Batch Account can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/batch/application.py b/sdk/python/pulumi_azure/batch/application.py index 2c84a56a14..75238668b1 100644 --- a/sdk/python/pulumi_azure/batch/application.py +++ b/sdk/python/pulumi_azure/batch/application.py @@ -298,6 +298,29 @@ def __init__(__self__, """ Manages Azure Batch Application instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys") + example_application = azure.batch.Application("exampleApplication", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"]) + ``` + ## Import Batch Applications can be imported using the `resource id`, e.g. @@ -324,6 +347,29 @@ def __init__(__self__, """ Manages Azure Batch Application instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys") + example_application = azure.batch.Application("exampleApplication", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"]) + ``` + ## Import Batch Applications can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/batch/certificate.py b/sdk/python/pulumi_azure/batch/certificate.py index e61198e647..8f8fc774ca 100644 --- a/sdk/python/pulumi_azure/batch/certificate.py +++ b/sdk/python/pulumi_azure/batch/certificate.py @@ -369,6 +369,38 @@ def __init__(__self__, """ Manages a certificate in an Azure Batch account. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys", + tags={ + "env": "test", + }) + example_certificate = azure.batch.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"], + certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx"), + format="Pfx", + password="password", + thumbprint="42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + thumbprint_algorithm="SHA1") + ``` + ## Import Batch Certificates can be imported using the `resource id`, e.g. @@ -396,6 +428,38 @@ def __init__(__self__, """ Manages a certificate in an Azure Batch account. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys", + tags={ + "env": "test", + }) + example_certificate = azure.batch.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"], + certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.pfx"), + format="Pfx", + password="password", + thumbprint="42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + thumbprint_algorithm="SHA1") + ``` + ## Import Batch Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/batch/get_account.py b/sdk/python/pulumi_azure/batch/get_account.py index 9db2efdfde..9b3a871102 100644 --- a/sdk/python/pulumi_azure/batch/get_account.py +++ b/sdk/python/pulumi_azure/batch/get_account.py @@ -182,6 +182,17 @@ def get_account(encryption: Optional[pulumi.InputType['GetAccountEncryptionArgs' """ Use this data source to access information about an existing Batch Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_account(name="testbatchaccount", + resource_group_name="test") + pulumi.export("poolAllocationMode", example.pool_allocation_mode) + ``` + :param pulumi.InputType['GetAccountEncryptionArgs'] encryption: The `encryption` block that describes the Azure KeyVault key reference used to encrypt data for the Azure Batch account. :param str name: The name of the Batch account. @@ -217,6 +228,17 @@ def get_account_output(encryption: Optional[pulumi.Input[Optional[pulumi.InputTy """ Use this data source to access information about an existing Batch Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_account(name="testbatchaccount", + resource_group_name="test") + pulumi.export("poolAllocationMode", example.pool_allocation_mode) + ``` + :param pulumi.InputType['GetAccountEncryptionArgs'] encryption: The `encryption` block that describes the Azure KeyVault key reference used to encrypt data for the Azure Batch account. :param str name: The name of the Batch account. diff --git a/sdk/python/pulumi_azure/batch/get_application.py b/sdk/python/pulumi_azure/batch/get_application.py index b0f067228d..7cd5f71eea 100644 --- a/sdk/python/pulumi_azure/batch/get_application.py +++ b/sdk/python/pulumi_azure/batch/get_application.py @@ -117,6 +117,18 @@ def get_application(account_name: Optional[str] = None, """ Use this data source to access information about an existing Batch Application instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_application(name="testapplication", + resource_group_name="test", + account_name="testbatchaccount") + pulumi.export("batchApplicationId", example.id) + ``` + :param str account_name: The name of the Batch account. :param str name: The name of the Application. @@ -147,6 +159,18 @@ def get_application_output(account_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Batch Application instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_application(name="testapplication", + resource_group_name="test", + account_name="testbatchaccount") + pulumi.export("batchApplicationId", example.id) + ``` + :param str account_name: The name of the Batch account. :param str name: The name of the Application. diff --git a/sdk/python/pulumi_azure/batch/get_certificate.py b/sdk/python/pulumi_azure/batch/get_certificate.py index 16696468ea..868d4d121c 100644 --- a/sdk/python/pulumi_azure/batch/get_certificate.py +++ b/sdk/python/pulumi_azure/batch/get_certificate.py @@ -126,6 +126,18 @@ def get_certificate(account_name: Optional[str] = None, """ Use this data source to access information about an existing certificate in a Batch Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_certificate(name="SHA1-42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + account_name="examplebatchaccount", + resource_group_name="example") + pulumi.export("thumbprint", example.thumbprint) + ``` + :param str account_name: The name of the Batch account. :param str name: The name of the Batch certificate. @@ -157,6 +169,18 @@ def get_certificate_output(account_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing certificate in a Batch Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_certificate(name="SHA1-42C107874FD0E4A9583292A2F1098E8FE4B2EDDA", + account_name="examplebatchaccount", + resource_group_name="example") + pulumi.export("thumbprint", example.thumbprint) + ``` + :param str account_name: The name of the Batch account. :param str name: The name of the Batch certificate. diff --git a/sdk/python/pulumi_azure/batch/get_pool.py b/sdk/python/pulumi_azure/batch/get_pool.py index 1a6d7e7321..c68f4786cf 100644 --- a/sdk/python/pulumi_azure/batch/get_pool.py +++ b/sdk/python/pulumi_azure/batch/get_pool.py @@ -352,6 +352,17 @@ def get_pool(account_name: Optional[str] = None, """ Use this data source to access information about an existing Batch pool + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_pool(account_name="testbatchaccount", + name="testbatchpool", + resource_group_name="test") + ``` + :param str account_name: The Azure Storage Account name. :param str name: The name of the user account. @@ -401,6 +412,17 @@ def get_pool_output(account_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Batch pool + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.batch.get_pool(account_name="testbatchaccount", + name="testbatchpool", + resource_group_name="test") + ``` + :param str account_name: The Azure Storage Account name. :param str name: The name of the user account. diff --git a/sdk/python/pulumi_azure/batch/job.py b/sdk/python/pulumi_azure/batch/job.py index 2bd9bc67dc..ba086f9be5 100644 --- a/sdk/python/pulumi_azure/batch/job.py +++ b/sdk/python/pulumi_azure/batch/job.py @@ -293,6 +293,33 @@ def __init__(__self__, """ Manages a Batch Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.batch.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_pool = azure.batch.Pool("examplePool", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + node_agent_sku_id="batch.node.ubuntu 16.04", + vm_size="Standard_A1", + fixed_scale=azure.batch.PoolFixedScaleArgs( + target_dedicated_nodes=1, + ), + storage_image_reference=azure.batch.PoolStorageImageReferenceArgs( + publisher="Canonical", + offer="UbuntuServer", + sku="16.04.0-LTS", + version="latest", + )) + example_job = azure.batch.Job("exampleJob", batch_pool_id=example_pool.id) + ``` + ## Import Batch Jobs can be imported using the `resource id`, e.g. @@ -319,6 +346,33 @@ def __init__(__self__, """ Manages a Batch Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.batch.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_pool = azure.batch.Pool("examplePool", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + node_agent_sku_id="batch.node.ubuntu 16.04", + vm_size="Standard_A1", + fixed_scale=azure.batch.PoolFixedScaleArgs( + target_dedicated_nodes=1, + ), + storage_image_reference=azure.batch.PoolStorageImageReferenceArgs( + publisher="Canonical", + offer="UbuntuServer", + sku="16.04.0-LTS", + version="latest", + )) + example_job = azure.batch.Job("exampleJob", batch_pool_id=example_pool.id) + ``` + ## Import Batch Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/batch/pool.py b/sdk/python/pulumi_azure/batch/pool.py index 8ccff87333..62f74dd87d 100644 --- a/sdk/python/pulumi_azure/batch/pool.py +++ b/sdk/python/pulumi_azure/batch/pool.py @@ -1238,6 +1238,85 @@ def __init__(__self__, """ Manages an Azure Batch pool. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys", + tags={ + "env": "test", + }) + example_certificate = azure.batch.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"], + certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.cer"), + format="Cer", + thumbprint="312d31a79fa0cef49c00f769afc2b73e9f4edf34", + thumbprint_algorithm="SHA1") + example_pool = azure.batch.Pool("examplePool", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"], + display_name="Test Acc Pool Auto", + vm_size="Standard_A1", + node_agent_sku_id="batch.node.ubuntu 20.04", + auto_scale=azure.batch.PoolAutoScaleArgs( + evaluation_interval="PT15M", + formula=\"\"\" startingNumberOfVMs = 1; + maxNumberofVMs = 25; + pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(180 * TimeInterval_Second); + pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(180 * TimeInterval_Second)); + $TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples); + \"\"\", + ), + storage_image_reference=azure.batch.PoolStorageImageReferenceArgs( + publisher="microsoft-azure-batch", + offer="ubuntu-server-container", + sku="20-04-lts", + version="latest", + ), + container_configuration=azure.batch.PoolContainerConfigurationArgs( + type="DockerCompatible", + container_registries=[azure.batch.PoolContainerConfigurationContainerRegistryArgs( + registry_server="docker.io", + user_name="login", + password="apassword", + )], + ), + start_task=azure.batch.PoolStartTaskArgs( + command_line="echo 'Hello World from $env'", + task_retry_maximum=1, + wait_for_success=True, + common_environment_properties={ + "env": "TEST", + }, + user_identity=azure.batch.PoolStartTaskUserIdentityArgs( + auto_user=azure.batch.PoolStartTaskUserIdentityAutoUserArgs( + elevation_level="NonAdmin", + scope="Task", + ), + ), + ), + certificates=[azure.batch.PoolCertificateArgs( + id=example_certificate.id, + store_location="CurrentUser", + visibilities=["StartTask"], + )]) + ``` + ## Import Batch Pools can be imported using the `resource id`, e.g. @@ -1291,6 +1370,85 @@ def __init__(__self__, """ Manages an Azure Batch pool. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_batch_account_account = azure.batch.Account("exampleBatch/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + pool_allocation_mode="BatchService", + storage_account_id=example_account.id, + storage_account_authentication_mode="StorageKeys", + tags={ + "env": "test", + }) + example_certificate = azure.batch.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"], + certificate=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate.cer"), + format="Cer", + thumbprint="312d31a79fa0cef49c00f769afc2b73e9f4edf34", + thumbprint_algorithm="SHA1") + example_pool = azure.batch.Pool("examplePool", + resource_group_name=example_resource_group.name, + account_name=example_batch / account_account["name"], + display_name="Test Acc Pool Auto", + vm_size="Standard_A1", + node_agent_sku_id="batch.node.ubuntu 20.04", + auto_scale=azure.batch.PoolAutoScaleArgs( + evaluation_interval="PT15M", + formula=\"\"\" startingNumberOfVMs = 1; + maxNumberofVMs = 25; + pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(180 * TimeInterval_Second); + pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(180 * TimeInterval_Second)); + $TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples); + \"\"\", + ), + storage_image_reference=azure.batch.PoolStorageImageReferenceArgs( + publisher="microsoft-azure-batch", + offer="ubuntu-server-container", + sku="20-04-lts", + version="latest", + ), + container_configuration=azure.batch.PoolContainerConfigurationArgs( + type="DockerCompatible", + container_registries=[azure.batch.PoolContainerConfigurationContainerRegistryArgs( + registry_server="docker.io", + user_name="login", + password="apassword", + )], + ), + start_task=azure.batch.PoolStartTaskArgs( + command_line="echo 'Hello World from $env'", + task_retry_maximum=1, + wait_for_success=True, + common_environment_properties={ + "env": "TEST", + }, + user_identity=azure.batch.PoolStartTaskUserIdentityArgs( + auto_user=azure.batch.PoolStartTaskUserIdentityAutoUserArgs( + elevation_level="NonAdmin", + scope="Task", + ), + ), + ), + certificates=[azure.batch.PoolCertificateArgs( + id=example_certificate.id, + store_location="CurrentUser", + visibilities=["StartTask"], + )]) + ``` + ## Import Batch Pools can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/billing/account_cost_management_export.py b/sdk/python/pulumi_azure/billing/account_cost_management_export.py index 5307e0280d..4c7862ccaa 100644 --- a/sdk/python/pulumi_azure/billing/account_cost_management_export.py +++ b/sdk/python/pulumi_azure/billing/account_cost_management_export.py @@ -382,6 +382,34 @@ def __init__(__self__, """ Manages a Cost Management Export for a Billing Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_account_cost_management_export = azure.billing.AccountCostManagementExport("exampleAccountCostManagementExport", + billing_account_id="example", + recurrence_type="Monthly", + recurrence_period_start_date="2020-08-18T00:00:00Z", + recurrence_period_end_date="2020-09-18T00:00:00Z", + export_data_storage_location=azure.billing.AccountCostManagementExportExportDataStorageLocationArgs( + container_id=example_container.resource_manager_id, + root_folder_path="/root/updated", + ), + export_data_options=azure.billing.AccountCostManagementExportExportDataOptionsArgs( + type="Usage", + time_frame="WeekToDate", + )) + ``` + ## Import Billing Account Cost Management Exports can be imported using the `resource id`, e.g. @@ -410,6 +438,34 @@ def __init__(__self__, """ Manages a Cost Management Export for a Billing Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_account_cost_management_export = azure.billing.AccountCostManagementExport("exampleAccountCostManagementExport", + billing_account_id="example", + recurrence_type="Monthly", + recurrence_period_start_date="2020-08-18T00:00:00Z", + recurrence_period_end_date="2020-09-18T00:00:00Z", + export_data_storage_location=azure.billing.AccountCostManagementExportExportDataStorageLocationArgs( + container_id=example_container.resource_manager_id, + root_folder_path="/root/updated", + ), + export_data_options=azure.billing.AccountCostManagementExportExportDataOptionsArgs( + type="Usage", + time_frame="WeekToDate", + )) + ``` + ## Import Billing Account Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/billing/get_enrollment_account_scope.py b/sdk/python/pulumi_azure/billing/get_enrollment_account_scope.py index ae2f130ad8..cb6789f732 100644 --- a/sdk/python/pulumi_azure/billing/get_enrollment_account_scope.py +++ b/sdk/python/pulumi_azure/billing/get_enrollment_account_scope.py @@ -68,6 +68,17 @@ def get_enrollment_account_scope(billing_account_name: Optional[str] = None, """ Use this data source to access information about an existing Enrollment Account Billing Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.billing.get_enrollment_account_scope(billing_account_name="existing", + enrollment_account_name="existing") + pulumi.export("id", example.id) + ``` + :param str billing_account_name: The Billing Account Name of the Enterprise Account. :param str enrollment_account_name: The Enrollment Account Name in the above Enterprise Account. @@ -91,6 +102,17 @@ def get_enrollment_account_scope_output(billing_account_name: Optional[pulumi.In """ Use this data source to access information about an existing Enrollment Account Billing Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.billing.get_enrollment_account_scope(billing_account_name="existing", + enrollment_account_name="existing") + pulumi.export("id", example.id) + ``` + :param str billing_account_name: The Billing Account Name of the Enterprise Account. :param str enrollment_account_name: The Enrollment Account Name in the above Enterprise Account. diff --git a/sdk/python/pulumi_azure/billing/get_mca_account_scope.py b/sdk/python/pulumi_azure/billing/get_mca_account_scope.py index c5c720a990..524dc77655 100644 --- a/sdk/python/pulumi_azure/billing/get_mca_account_scope.py +++ b/sdk/python/pulumi_azure/billing/get_mca_account_scope.py @@ -78,6 +78,18 @@ def get_mca_account_scope(billing_account_name: Optional[str] = None, """ Use this data source to access an ID for your MCA Account billing scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.billing.get_mca_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + billing_profile_name="PE2Q-NOIT-BG7-TGB", + invoice_section_name="MTT4-OBS7-PJA-TGB") + pulumi.export("id", example.id) + ``` + :param str billing_account_name: The Billing Account Name of the MCA account. :param str billing_profile_name: The Billing Profile Name in the above Billing Account. @@ -105,6 +117,18 @@ def get_mca_account_scope_output(billing_account_name: Optional[pulumi.Input[str """ Use this data source to access an ID for your MCA Account billing scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.billing.get_mca_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + billing_profile_name="PE2Q-NOIT-BG7-TGB", + invoice_section_name="MTT4-OBS7-PJA-TGB") + pulumi.export("id", example.id) + ``` + :param str billing_account_name: The Billing Account Name of the MCA account. :param str billing_profile_name: The Billing Profile Name in the above Billing Account. diff --git a/sdk/python/pulumi_azure/billing/get_mpa_account_scope.py b/sdk/python/pulumi_azure/billing/get_mpa_account_scope.py index 864e6d3d49..c721cce1d4 100644 --- a/sdk/python/pulumi_azure/billing/get_mpa_account_scope.py +++ b/sdk/python/pulumi_azure/billing/get_mpa_account_scope.py @@ -68,6 +68,17 @@ def get_mpa_account_scope(billing_account_name: Optional[str] = None, """ Use this data source to access an ID for your MPA Account billing scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.billing.get_mpa_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + customer_name="2281f543-7321-4cf9-1e23-edb4Oc31a31c") + pulumi.export("id", example.id) + ``` + :param str billing_account_name: The Billing Account Name of the MPA account. :param str customer_name: The Customer Name in the above Billing Account. @@ -91,6 +102,17 @@ def get_mpa_account_scope_output(billing_account_name: Optional[pulumi.Input[str """ Use this data source to access an ID for your MPA Account billing scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.billing.get_mpa_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + customer_name="2281f543-7321-4cf9-1e23-edb4Oc31a31c") + pulumi.export("id", example.id) + ``` + :param str billing_account_name: The Billing Account Name of the MPA account. :param str customer_name: The Customer Name in the above Billing Account. diff --git a/sdk/python/pulumi_azure/blueprint/assignment.py b/sdk/python/pulumi_azure/blueprint/assignment.py index 86f69c2bc3..ad6c6149b0 100644 --- a/sdk/python/pulumi_azure/blueprint/assignment.py +++ b/sdk/python/pulumi_azure/blueprint/assignment.py @@ -553,6 +553,63 @@ def __init__(__self__, > **NOTE:** Azure Blueprint Assignments can only be applied to Subscriptions. Assignments to Management Groups is not currently supported by the service or by this provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_subscription = azure.core.get_subscription() + example_definition = azure.blueprint.get_definition(name="exampleBlueprint", + scope_id=example_subscription.id) + example_published_version = azure.blueprint.get_published_version(scope_id=example_definition.scope_id, + blueprint_name=example_definition.name, + version="v1.0.0") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="West Europe", + tags={ + "Environment": "example", + }) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + operator = azure.authorization.Assignment("operator", + scope=example_subscription.id, + role_definition_name="Blueprint Operator", + principal_id=example_user_assigned_identity.principal_id) + owner = azure.authorization.Assignment("owner", + scope=example_subscription.id, + role_definition_name="Owner", + principal_id=example_user_assigned_identity.principal_id) + example_assignment = azure.blueprint.Assignment("exampleAssignment", + target_subscription_id=example_subscription.id, + version_id=example_published_version.id, + location=example_resource_group.location, + lock_mode="AllResourcesDoNotDelete", + lock_exclude_principals=[current.object_id], + identity=azure.blueprint.AssignmentIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + resource_groups=\"\"\" { + "ResourceGroup": { + "name": "exampleRG-bp" + } + } + \"\"\", + parameter_values=\"\"\" { + "allowedlocationsforresourcegroups_listOfAllowedLocations": { + "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"] + } + } + \"\"\", + opts=pulumi.ResourceOptions(depends_on=[ + operator, + owner, + ])) + ``` + ## Import Azure Blueprint Assignments can be imported using the `resource id`, e.g. @@ -591,6 +648,63 @@ def __init__(__self__, > **NOTE:** Azure Blueprint Assignments can only be applied to Subscriptions. Assignments to Management Groups is not currently supported by the service or by this provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_subscription = azure.core.get_subscription() + example_definition = azure.blueprint.get_definition(name="exampleBlueprint", + scope_id=example_subscription.id) + example_published_version = azure.blueprint.get_published_version(scope_id=example_definition.scope_id, + blueprint_name=example_definition.name, + version="v1.0.0") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="West Europe", + tags={ + "Environment": "example", + }) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + operator = azure.authorization.Assignment("operator", + scope=example_subscription.id, + role_definition_name="Blueprint Operator", + principal_id=example_user_assigned_identity.principal_id) + owner = azure.authorization.Assignment("owner", + scope=example_subscription.id, + role_definition_name="Owner", + principal_id=example_user_assigned_identity.principal_id) + example_assignment = azure.blueprint.Assignment("exampleAssignment", + target_subscription_id=example_subscription.id, + version_id=example_published_version.id, + location=example_resource_group.location, + lock_mode="AllResourcesDoNotDelete", + lock_exclude_principals=[current.object_id], + identity=azure.blueprint.AssignmentIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + resource_groups=\"\"\" { + "ResourceGroup": { + "name": "exampleRG-bp" + } + } + \"\"\", + parameter_values=\"\"\" { + "allowedlocationsforresourcegroups_listOfAllowedLocations": { + "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"] + } + } + \"\"\", + opts=pulumi.ResourceOptions(depends_on=[ + operator, + owner, + ])) + ``` + ## Import Azure Blueprint Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/blueprint/get_definition.py b/sdk/python/pulumi_azure/blueprint/get_definition.py index 1e055e53a8..537ad26899 100644 --- a/sdk/python/pulumi_azure/blueprint/get_definition.py +++ b/sdk/python/pulumi_azure/blueprint/get_definition.py @@ -142,6 +142,18 @@ def get_definition(name: Optional[str] = None, > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + root = azure.management.get_group(name=current.tenant_id) + example = azure.blueprint.get_definition(name="exampleManagementGroupBP", + scope_id=root.id) + ``` + :param str name: The name of the Blueprint. :param str scope_id: The ID of the Subscription or Management Group, as the scope at which the blueprint definition is stored. @@ -173,6 +185,18 @@ def get_definition_output(name: Optional[pulumi.Input[str]] = None, > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + root = azure.management.get_group(name=current.tenant_id) + example = azure.blueprint.get_definition(name="exampleManagementGroupBP", + scope_id=root.id) + ``` + :param str name: The name of the Blueprint. :param str scope_id: The ID of the Subscription or Management Group, as the scope at which the blueprint definition is stored. diff --git a/sdk/python/pulumi_azure/blueprint/get_published_version.py b/sdk/python/pulumi_azure/blueprint/get_published_version.py index be26a25300..9972355dd0 100644 --- a/sdk/python/pulumi_azure/blueprint/get_published_version.py +++ b/sdk/python/pulumi_azure/blueprint/get_published_version.py @@ -146,6 +146,18 @@ def get_published_version(blueprint_name: Optional[str] = None, > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + test = azure.blueprint.get_published_version(scope_id=current.id, + blueprint_name="exampleBluePrint", + version="dev_v2.3") + ``` + :param str blueprint_name: The name of the Blueprint Definition :param str scope_id: The ID of the Management Group / Subscription where this Blueprint Definition is stored. @@ -181,6 +193,18 @@ def get_published_version_output(blueprint_name: Optional[pulumi.Input[str]] = N > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + test = azure.blueprint.get_published_version(scope_id=current.id, + blueprint_name="exampleBluePrint", + version="dev_v2.3") + ``` + :param str blueprint_name: The name of the Blueprint Definition :param str scope_id: The ID of the Management Group / Subscription where this Blueprint Definition is stored. diff --git a/sdk/python/pulumi_azure/bot/channel_alexa.py b/sdk/python/pulumi_azure/bot/channel_alexa.py index ab49f931ec..fab45e3355 100644 --- a/sdk/python/pulumi_azure/bot/channel_alexa.py +++ b/sdk/python/pulumi_azure/bot/channel_alexa.py @@ -219,6 +219,26 @@ def __init__(__self__, > **Note** A bot can only have a single Alexa Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_alexa = azure.bot.ChannelAlexa("exampleChannelAlexa", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + skill_id="amzn1.ask.skill.00000000-0000-0000-0000-000000000000") + ``` + ## Import The Alexa Integration for a Bot Channel can be imported using the `resource id`, e.g. @@ -245,6 +265,26 @@ def __init__(__self__, > **Note** A bot can only have a single Alexa Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_alexa = azure.bot.ChannelAlexa("exampleChannelAlexa", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + skill_id="amzn1.ask.skill.00000000-0000-0000-0000-000000000000") + ``` + ## Import The Alexa Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_direct_line.py b/sdk/python/pulumi_azure/bot/channel_direct_line.py index 91f13ad532..0275f61c92 100644 --- a/sdk/python/pulumi_azure/bot/channel_direct_line.py +++ b/sdk/python/pulumi_azure/bot/channel_direct_line.py @@ -215,6 +215,29 @@ def __init__(__self__, """ Manages a Directline integration for a Bot Channel + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_direct_line = azure.bot.ChannelDirectLine("exampleChannelDirectLine", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + sites=[azure.bot.ChannelDirectLineSiteArgs( + name="default", + enabled=True, + )]) + ``` + ## Import The Directline Channel for a Bot can be imported using the `resource id`, e.g. @@ -239,6 +262,29 @@ def __init__(__self__, """ Manages a Directline integration for a Bot Channel + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_direct_line = azure.bot.ChannelDirectLine("exampleChannelDirectLine", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + sites=[azure.bot.ChannelDirectLineSiteArgs( + name="default", + enabled=True, + )]) + ``` + ## Import The Directline Channel for a Bot can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_direct_line_speech.py b/sdk/python/pulumi_azure/bot/channel_direct_line_speech.py index afcc53baa9..21fee77e4b 100644 --- a/sdk/python/pulumi_azure/bot/channel_direct_line_speech.py +++ b/sdk/python/pulumi_azure/bot/channel_direct_line_speech.py @@ -382,6 +382,32 @@ def __init__(__self__, """ Manages a Direct Line Speech integration for a Bot Channel + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="SpeechServices", + sku_name="S0") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_direct_line_speech = azure.bot.ChannelDirectLineSpeech("exampleChannelDirectLineSpeech", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + cognitive_service_location=example_account.location, + cognitive_service_access_key=example_account.primary_access_key) + ``` + ## Import Direct Line Speech Channels can be imported using the `resource id`, e.g. @@ -410,6 +436,32 @@ def __init__(__self__, """ Manages a Direct Line Speech integration for a Bot Channel + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="SpeechServices", + sku_name="S0") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_direct_line_speech = azure.bot.ChannelDirectLineSpeech("exampleChannelDirectLineSpeech", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + cognitive_service_location=example_account.location, + cognitive_service_access_key=example_account.primary_access_key) + ``` + ## Import Direct Line Speech Channels can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_email.py b/sdk/python/pulumi_azure/bot/channel_email.py index 816bb179fe..04dfb409ef 100644 --- a/sdk/python/pulumi_azure/bot/channel_email.py +++ b/sdk/python/pulumi_azure/bot/channel_email.py @@ -261,6 +261,27 @@ def __init__(__self__, > **Note** A bot can only have a single Email Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_email = azure.bot.ChannelEmail("exampleChannelEmail", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + email_address="example.com", + email_password="123456") + ``` + ## Import The Email Integration for a Bot Channel can be imported using the `resource id`, e.g. @@ -288,6 +309,27 @@ def __init__(__self__, > **Note** A bot can only have a single Email Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_email = azure.bot.ChannelEmail("exampleChannelEmail", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + email_address="example.com", + email_password="123456") + ``` + ## Import The Email Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_facebook.py b/sdk/python/pulumi_azure/bot/channel_facebook.py index 8a7b49208b..fcfaf4dac8 100644 --- a/sdk/python/pulumi_azure/bot/channel_facebook.py +++ b/sdk/python/pulumi_azure/bot/channel_facebook.py @@ -301,6 +301,31 @@ def __init__(__self__, > **Note** A bot can only have a single Facebook Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_facebook = azure.bot.ChannelFacebook("exampleChannelFacebook", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + facebook_application_id="563490254873576", + facebook_application_secret="8976d2536445ad5b976dee8437b9beb0", + pages=[azure.bot.ChannelFacebookPageArgs( + id="876248795081953", + access_token="CGGCec3UAFPMBAKwK3Ft8SEpO8ZCuvpNBI5DClaJCDfqJj2BgEHCKxcY0FDarmUQap6XxpZC9GWCW4nZCzjcKosAZAP7SO44X8Q8gAntbDIXgYUBGp9xtS8wUkwgKPobUePcOOVFkvClxvYZByuiQxoTiK9fQ9jZCPEorbmZCsKDZAx4VLnrNwCTZAPUwXxO61gfq4ZD", + )]) + ``` + ## Import The Facebook Integration for a Bot Channel can be imported using the `resource id`, e.g. @@ -329,6 +354,31 @@ def __init__(__self__, > **Note** A bot can only have a single Facebook Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_facebook = azure.bot.ChannelFacebook("exampleChannelFacebook", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + facebook_application_id="563490254873576", + facebook_application_secret="8976d2536445ad5b976dee8437b9beb0", + pages=[azure.bot.ChannelFacebookPageArgs( + id="876248795081953", + access_token="CGGCec3UAFPMBAKwK3Ft8SEpO8ZCuvpNBI5DClaJCDfqJj2BgEHCKxcY0FDarmUQap6XxpZC9GWCW4nZCzjcKosAZAP7SO44X8Q8gAntbDIXgYUBGp9xtS8wUkwgKPobUePcOOVFkvClxvYZByuiQxoTiK9fQ9jZCPEorbmZCsKDZAx4VLnrNwCTZAPUwXxO61gfq4ZD", + )]) + ``` + ## Import The Facebook Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_line.py b/sdk/python/pulumi_azure/bot/channel_line.py index 5543724f6a..200439ccb4 100644 --- a/sdk/python/pulumi_azure/bot/channel_line.py +++ b/sdk/python/pulumi_azure/bot/channel_line.py @@ -221,6 +221,29 @@ def __init__(__self__, > **Note** A bot can only have a single Line Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_line = azure.bot.ChannelLine("exampleChannelLine", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + line_channels=[azure.bot.ChannelLineLineChannelArgs( + access_token="asdfdsdfTYUIOIoj1231hkjhk", + secret="aagfdgfd123567", + )]) + ``` + ## Import The Line Integration for a Bot Channel can be imported using the `resource id`, e.g. @@ -247,6 +270,29 @@ def __init__(__self__, > **Note** A bot can only have a single Line Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_line = azure.bot.ChannelLine("exampleChannelLine", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + line_channels=[azure.bot.ChannelLineLineChannelArgs( + access_token="asdfdsdfTYUIOIoj1231hkjhk", + secret="aagfdgfd123567", + )]) + ``` + ## Import The Line Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_slack.py b/sdk/python/pulumi_azure/bot/channel_slack.py index 9af696657a..b8453fbcaa 100644 --- a/sdk/python/pulumi_azure/bot/channel_slack.py +++ b/sdk/python/pulumi_azure/bot/channel_slack.py @@ -385,6 +385,28 @@ def __init__(__self__, > **Note** A bot can only have a single Slack Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_slack = azure.bot.ChannelSlack("exampleChannelSlack", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + client_id="exampleId", + client_secret="exampleSecret", + verification_token="exampleVerificationToken") + ``` + ## Import The Slack Integration for a Bot Channel can be imported using the `resource id`, e.g. @@ -415,6 +437,28 @@ def __init__(__self__, > **Note** A bot can only have a single Slack Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_slack = azure.bot.ChannelSlack("exampleChannelSlack", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + client_id="exampleId", + client_secret="exampleSecret", + verification_token="exampleVerificationToken") + ``` + ## Import The Slack Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_sms.py b/sdk/python/pulumi_azure/bot/channel_sms.py index a0997e809e..c39767b3de 100644 --- a/sdk/python/pulumi_azure/bot/channel_sms.py +++ b/sdk/python/pulumi_azure/bot/channel_sms.py @@ -303,6 +303,28 @@ def __init__(__self__, > **Note** A bot can only have a single SMS Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_sms = azure.bot.ChannelSms("exampleChannelSms", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + sms_channel_account_security_id="BG61f7cf5157f439b084e98256409c2815", + sms_channel_auth_token="jh8980432610052ed4e29565c5e232f", + phone_number="+12313803556") + ``` + ## Import The SMS Integration for a Bot Channel can be imported using the `resource id`, e.g. @@ -331,6 +353,28 @@ def __init__(__self__, > **Note** A bot can only have a single SMS Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_sms = azure.bot.ChannelSms("exampleChannelSms", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + sms_channel_account_security_id="BG61f7cf5157f439b084e98256409c2815", + sms_channel_auth_token="jh8980432610052ed4e29565c5e232f", + phone_number="+12313803556") + ``` + ## Import The SMS Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_teams.py b/sdk/python/pulumi_azure/bot/channel_teams.py index 0368924d35..16db1d5923 100644 --- a/sdk/python/pulumi_azure/bot/channel_teams.py +++ b/sdk/python/pulumi_azure/bot/channel_teams.py @@ -300,6 +300,25 @@ def __init__(__self__, > **Note** A bot can only have a single MS Teams Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_teams = azure.bot.ChannelTeams("exampleChannelTeams", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name) + ``` + ## Import The Microsoft Teams Integration for a Bot Channel can be imported using the `resource id`, e.g. @@ -328,6 +347,25 @@ def __init__(__self__, > **Note** A bot can only have a single MS Teams Channel associated with it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_teams = azure.bot.ChannelTeams("exampleChannelTeams", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name) + ``` + ## Import The Microsoft Teams Integration for a Bot Channel can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channel_web_chat.py b/sdk/python/pulumi_azure/bot/channel_web_chat.py index 220391ea1b..0cab284222 100644 --- a/sdk/python/pulumi_azure/bot/channel_web_chat.py +++ b/sdk/python/pulumi_azure/bot/channel_web_chat.py @@ -275,6 +275,28 @@ def __init__(__self__, """ Manages a Web Chat integration for a Bot Channel + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_web_chat = azure.bot.ChannelWebChat("exampleChannelWebChat", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + sites=[azure.bot.ChannelWebChatSiteArgs( + name="TestSite", + )]) + ``` + ## Import Web Chat Channels can be imported using the `resource id`, e.g. @@ -302,6 +324,28 @@ def __init__(__self__, """ Manages a Web Chat integration for a Bot Channel + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_channel_web_chat = azure.bot.ChannelWebChat("exampleChannelWebChat", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + sites=[azure.bot.ChannelWebChatSiteArgs( + name="TestSite", + )]) + ``` + ## Import Web Chat Channels can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/channels_registration.py b/sdk/python/pulumi_azure/bot/channels_registration.py index c70a36a22b..34c7f17c6d 100644 --- a/sdk/python/pulumi_azure/bot/channels_registration.py +++ b/sdk/python/pulumi_azure/bot/channels_registration.py @@ -766,6 +766,21 @@ def __init__(__self__, """ Manages a Bot Channels Registration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + ``` + ## Import Bot Channels Registration can be imported using the `resource id`, e.g. @@ -809,6 +824,21 @@ def __init__(__self__, """ Manages a Bot Channels Registration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + ``` + ## Import Bot Channels Registration can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/connection.py b/sdk/python/pulumi_azure/bot/connection.py index 15ec9ec373..569461eeb3 100644 --- a/sdk/python/pulumi_azure/bot/connection.py +++ b/sdk/python/pulumi_azure/bot/connection.py @@ -469,6 +469,28 @@ def __init__(__self__, """ Manages a Bot Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_connection = azure.bot.Connection("exampleConnection", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + service_provider_name="box", + client_id="exampleId", + client_secret="exampleSecret") + ``` + ## Import Bot Connection can be imported using the `resource id`, e.g. @@ -501,6 +523,28 @@ def __init__(__self__, """ Manages a Bot Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_channels_registration = azure.bot.ChannelsRegistration("exampleChannelsRegistration", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + example_connection = azure.bot.Connection("exampleConnection", + bot_name=example_channels_registration.name, + location=example_channels_registration.location, + resource_group_name=example_resource_group.name, + service_provider_name="box", + client_id="exampleId", + client_secret="exampleSecret") + ``` + ## Import Bot Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/healthbot.py b/sdk/python/pulumi_azure/bot/healthbot.py index 3ea0ef1178..642ed91a81 100644 --- a/sdk/python/pulumi_azure/bot/healthbot.py +++ b/sdk/python/pulumi_azure/bot/healthbot.py @@ -269,6 +269,19 @@ def __init__(__self__, """ Manages a Healthbot Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_healthbot = azure.bot.Healthbot("exampleHealthbot", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="F0") + ``` + ## Import Healthbot Service can be imported using the `resource id`, e.g. @@ -294,6 +307,19 @@ def __init__(__self__, """ Manages a Healthbot Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_healthbot = azure.bot.Healthbot("exampleHealthbot", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="F0") + ``` + ## Import Healthbot Service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/service_azure_bot.py b/sdk/python/pulumi_azure/bot/service_azure_bot.py index 74d8b0f6b5..4f7d39b704 100644 --- a/sdk/python/pulumi_azure/bot/service_azure_bot.py +++ b/sdk/python/pulumi_azure/bot/service_azure_bot.py @@ -816,6 +816,40 @@ def __init__(__self__, """ Manages an Azure Bot Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_api_key = azure.appinsights.ApiKey("exampleApiKey", + application_insights_id=example_insights.id, + read_permissions=[ + "aggregate", + "api", + "draft", + "extendqueries", + "search", + ]) + current = azure.core.get_client_config() + example_service_azure_bot = azure.bot.ServiceAzureBot("exampleServiceAzureBot", + resource_group_name=example_resource_group.name, + location="global", + microsoft_app_id=current.client_id, + sku="F0", + endpoint="https://example.com", + developer_app_insights_api_key=example_api_key.api_key, + developer_app_insights_application_id=example_insights.app_id, + tags={ + "environment": "test", + }) + ``` + ## Import Azure Bot Services can be imported using the `resource id`, e.g. @@ -855,6 +889,40 @@ def __init__(__self__, """ Manages an Azure Bot Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_api_key = azure.appinsights.ApiKey("exampleApiKey", + application_insights_id=example_insights.id, + read_permissions=[ + "aggregate", + "api", + "draft", + "extendqueries", + "search", + ]) + current = azure.core.get_client_config() + example_service_azure_bot = azure.bot.ServiceAzureBot("exampleServiceAzureBot", + resource_group_name=example_resource_group.name, + location="global", + microsoft_app_id=current.client_id, + sku="F0", + endpoint="https://example.com", + developer_app_insights_api_key=example_api_key.api_key, + developer_app_insights_application_id=example_insights.app_id, + tags={ + "environment": "test", + }) + ``` + ## Import Azure Bot Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/bot/web_app.py b/sdk/python/pulumi_azure/bot/web_app.py index 4a4ec663fb..2c5b5e4484 100644 --- a/sdk/python/pulumi_azure/bot/web_app.py +++ b/sdk/python/pulumi_azure/bot/web_app.py @@ -570,6 +570,21 @@ def __init__(__self__, """ Manages a Bot Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_web_app = azure.bot.WebApp("exampleWebApp", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + ``` + ## Import Bot Web App's can be imported using the `resource id`, e.g. @@ -603,6 +618,21 @@ def __init__(__self__, """ Manages a Bot Web App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_web_app = azure.bot.WebApp("exampleWebApp", + location="global", + resource_group_name=example_resource_group.name, + sku="F0", + microsoft_app_id=current.client_id) + ``` + ## Import Bot Web App's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/endpoint.py b/sdk/python/pulumi_azure/cdn/endpoint.py index ba29c55450..2b34f1b5ab 100644 --- a/sdk/python/pulumi_azure/cdn/endpoint.py +++ b/sdk/python/pulumi_azure/cdn/endpoint.py @@ -805,6 +805,27 @@ def __init__(__self__, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_profile = azure.cdn.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_Verizon") + example_endpoint = azure.cdn.Endpoint("exampleEndpoint", + profile_name=example_profile.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + origins=[azure.cdn.EndpointOriginArgs( + name="example", + host_name="www.contoso.com", + )]) + ``` + ## Import CDN Endpoints can be imported using the `resource id`, e.g. @@ -843,6 +864,27 @@ def __init__(__self__, args: EndpointArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_profile = azure.cdn.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_Verizon") + example_endpoint = azure.cdn.Endpoint("exampleEndpoint", + profile_name=example_profile.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + origins=[azure.cdn.EndpointOriginArgs( + name="example", + host_name="www.contoso.com", + )]) + ``` + ## Import CDN Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/endpoint_custom_domain.py b/sdk/python/pulumi_azure/cdn/endpoint_custom_domain.py index 1f9d0e995b..c81e999d46 100644 --- a/sdk/python/pulumi_azure/cdn/endpoint_custom_domain.py +++ b/sdk/python/pulumi_azure/cdn/endpoint_custom_domain.py @@ -267,6 +267,42 @@ def __init__(__self__, """ Manages a Custom Domain for a CDN Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_profile = azure.cdn.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_Verizon") + example_endpoint = azure.cdn.Endpoint("exampleEndpoint", + profile_name=example_profile.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + origins=[azure.cdn.EndpointOriginArgs( + name="example", + host_name=example_account.primary_blob_host, + )]) + example_zone = azure.dns.get_zone(name="example-domain.com", + resource_group_name="domain-rg") + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name=example_zone.name, + resource_group_name=example_zone.resource_group_name, + ttl=3600, + target_resource_id=example_endpoint.id) + example_endpoint_custom_domain = azure.cdn.EndpointCustomDomain("exampleEndpointCustomDomain", + cdn_endpoint_id=example_endpoint.id, + host_name=example_c_name_record.name.apply(lambda name: f"{name}.{example_zone.name}")) + ``` + ## Import CDN Endpoint Custom Domains can be imported using the `resource id`, e.g. @@ -294,6 +330,42 @@ def __init__(__self__, """ Manages a Custom Domain for a CDN Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_profile = azure.cdn.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_Verizon") + example_endpoint = azure.cdn.Endpoint("exampleEndpoint", + profile_name=example_profile.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + origins=[azure.cdn.EndpointOriginArgs( + name="example", + host_name=example_account.primary_blob_host, + )]) + example_zone = azure.dns.get_zone(name="example-domain.com", + resource_group_name="domain-rg") + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name=example_zone.name, + resource_group_name=example_zone.resource_group_name, + ttl=3600, + target_resource_id=example_endpoint.id) + example_endpoint_custom_domain = azure.cdn.EndpointCustomDomain("exampleEndpointCustomDomain", + cdn_endpoint_id=example_endpoint.id, + host_name=example_c_name_record.name.apply(lambda name: f"{name}.{example_zone.name}")) + ``` + ## Import CDN Endpoint Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_custom_domain.py b/sdk/python/pulumi_azure/cdn/frontdoor_custom_domain.py index c630355f0b..3561807931 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_custom_domain.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_custom_domain.py @@ -310,6 +310,45 @@ def __init__(__self__, tls: Optional[pulumi.Input[pulumi.InputType['FrontdoorCustomDomainTlsArgs']]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_custom_domain = azure.cdn.FrontdoorCustomDomain("exampleFrontdoorCustomDomain", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + dns_zone_id=example_zone.id, + host_name="contoso.fabrikam.com", + tls=azure.cdn.FrontdoorCustomDomainTlsArgs( + certificate_type="ManagedCertificate", + minimum_tls_version="TLS12", + )) + ``` + ## Example CNAME Record Usage + + !>**IMPORTANT:** You **must** include the `depends_on` meta-argument which references both the `cdn.FrontdoorRoute` and the `cdn.FrontdoorSecurityPolicy` that are associated with your Custom Domain. The reason for these `depends_on` meta-arguments is because all of the resources for the Custom Domain need to be associated within Front Door before the CNAME record can be written to the domains DNS, else the CNAME validation will fail and Front Door will not enable traffic to the Domain. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.CNameRecord("example", + zone_name=azurerm_dns_zone["example"]["name"], + resource_group_name=azurerm_resource_group["example"]["name"], + ttl=3600, + record=azurerm_cdn_frontdoor_endpoint["example"]["host_name"], + opts=pulumi.ResourceOptions(depends_on=[ + azurerm_cdn_frontdoor_route["example"], + azurerm_cdn_frontdoor_security_policy["example"], + ])) + ``` + ## Import Front Door Custom Domains can be imported using the `resource id`, e.g. @@ -337,6 +376,45 @@ def __init__(__self__, args: FrontdoorCustomDomainArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_custom_domain = azure.cdn.FrontdoorCustomDomain("exampleFrontdoorCustomDomain", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + dns_zone_id=example_zone.id, + host_name="contoso.fabrikam.com", + tls=azure.cdn.FrontdoorCustomDomainTlsArgs( + certificate_type="ManagedCertificate", + minimum_tls_version="TLS12", + )) + ``` + ## Example CNAME Record Usage + + !>**IMPORTANT:** You **must** include the `depends_on` meta-argument which references both the `cdn.FrontdoorRoute` and the `cdn.FrontdoorSecurityPolicy` that are associated with your Custom Domain. The reason for these `depends_on` meta-arguments is because all of the resources for the Custom Domain need to be associated within Front Door before the CNAME record can be written to the domains DNS, else the CNAME validation will fail and Front Door will not enable traffic to the Domain. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.CNameRecord("example", + zone_name=azurerm_dns_zone["example"]["name"], + resource_group_name=azurerm_resource_group["example"]["name"], + ttl=3600, + record=azurerm_cdn_frontdoor_endpoint["example"]["host_name"], + opts=pulumi.ResourceOptions(depends_on=[ + azurerm_cdn_frontdoor_route["example"], + azurerm_cdn_frontdoor_security_policy["example"], + ])) + ``` + ## Import Front Door Custom Domains can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_endpoint.py b/sdk/python/pulumi_azure/cdn/frontdoor_endpoint.py index ad9368c9c0..09b78c52d0 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_endpoint.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_endpoint.py @@ -227,6 +227,23 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_endpoint = azure.cdn.FrontdoorEndpoint("exampleFrontdoorEndpoint", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + tags={ + "ENV": "example", + }) + ``` + ## Import Front Door Endpoints can be imported using the `resource id`, e.g. @@ -251,6 +268,23 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_endpoint = azure.cdn.FrontdoorEndpoint("exampleFrontdoorEndpoint", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + tags={ + "ENV": "example", + }) + ``` + ## Import Front Door Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_firewall_policy.py b/sdk/python/pulumi_azure/cdn/frontdoor_firewall_policy.py index 9f17129233..9bc320d71d 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_firewall_policy.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_firewall_policy.py @@ -530,6 +530,117 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Firewall Policy instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Premium_AzureFrontDoor") + example_frontdoor_firewall_policy = azure.cdn.FrontdoorFirewallPolicy("exampleFrontdoorFirewallPolicy", + resource_group_name=example_resource_group.name, + sku_name=example_frontdoor_profile.sku_name, + enabled=True, + mode="Prevention", + redirect_url="https://www.contoso.com", + custom_block_response_status_code=403, + custom_block_response_body="PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + custom_rules=[ + azure.cdn.FrontdoorFirewallPolicyCustomRuleArgs( + name="Rule1", + enabled=True, + priority=1, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[azure.cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=[ + "10.0.1.0/24", + "10.0.0.0/24", + ], + )], + ), + azure.cdn.FrontdoorFirewallPolicyCustomRuleArgs( + name="Rule2", + enabled=True, + priority=2, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[ + azure.cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=["192.168.1.0/24"], + ), + azure.cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RequestHeader", + selector="UserAgent", + operator="Contains", + negation_condition=False, + match_values=["windows"], + transforms=[ + "Lowercase", + "Trim", + ], + ), + ], + ), + ], + managed_rules=[ + azure.cdn.FrontdoorFirewallPolicyManagedRuleArgs( + type="DefaultRuleSet", + version="1.0", + exclusions=[azure.cdn.FrontdoorFirewallPolicyManagedRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="not_suspicious", + )], + overrides=[ + azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideArgs( + rule_group_name="PHP", + rules=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="933100", + enabled=False, + action="Block", + )], + ), + azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideArgs( + rule_group_name="SQLI", + exclusions=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="really_not_suspicious", + )], + rules=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="942200", + action="Block", + exclusions=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="innocent", + )], + )], + ), + ], + ), + azure.cdn.FrontdoorFirewallPolicyManagedRuleArgs( + type="Microsoft_BotManagerRuleSet", + version="1.0", + action="Log", + ), + ]) + ``` + ## Import Front Door Firewall Policies can be imported using the `resource id`, e.g. @@ -565,6 +676,117 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Firewall Policy instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Premium_AzureFrontDoor") + example_frontdoor_firewall_policy = azure.cdn.FrontdoorFirewallPolicy("exampleFrontdoorFirewallPolicy", + resource_group_name=example_resource_group.name, + sku_name=example_frontdoor_profile.sku_name, + enabled=True, + mode="Prevention", + redirect_url="https://www.contoso.com", + custom_block_response_status_code=403, + custom_block_response_body="PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + custom_rules=[ + azure.cdn.FrontdoorFirewallPolicyCustomRuleArgs( + name="Rule1", + enabled=True, + priority=1, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[azure.cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=[ + "10.0.1.0/24", + "10.0.0.0/24", + ], + )], + ), + azure.cdn.FrontdoorFirewallPolicyCustomRuleArgs( + name="Rule2", + enabled=True, + priority=2, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[ + azure.cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=["192.168.1.0/24"], + ), + azure.cdn.FrontdoorFirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RequestHeader", + selector="UserAgent", + operator="Contains", + negation_condition=False, + match_values=["windows"], + transforms=[ + "Lowercase", + "Trim", + ], + ), + ], + ), + ], + managed_rules=[ + azure.cdn.FrontdoorFirewallPolicyManagedRuleArgs( + type="DefaultRuleSet", + version="1.0", + exclusions=[azure.cdn.FrontdoorFirewallPolicyManagedRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="not_suspicious", + )], + overrides=[ + azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideArgs( + rule_group_name="PHP", + rules=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="933100", + enabled=False, + action="Block", + )], + ), + azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideArgs( + rule_group_name="SQLI", + exclusions=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="really_not_suspicious", + )], + rules=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="942200", + action="Block", + exclusions=[azure.cdn.FrontdoorFirewallPolicyManagedRuleOverrideRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="innocent", + )], + )], + ), + ], + ), + azure.cdn.FrontdoorFirewallPolicyManagedRuleArgs( + type="Microsoft_BotManagerRuleSet", + version="1.0", + action="Log", + ), + ]) + ``` + ## Import Front Door Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_origin_group.py b/sdk/python/pulumi_azure/cdn/frontdoor_origin_group.py index 280e0295de..e52a8b7718 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_origin_group.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_origin_group.py @@ -308,6 +308,33 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Origin Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_origin_group = azure.cdn.FrontdoorOriginGroup("exampleFrontdoorOriginGroup", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + session_affinity_enabled=True, + restore_traffic_time_to_healed_or_new_endpoint_in_minutes=10, + health_probe=azure.cdn.FrontdoorOriginGroupHealthProbeArgs( + interval_in_seconds=240, + path="/healthProbe", + protocol="Https", + request_type="HEAD", + ), + load_balancing=azure.cdn.FrontdoorOriginGroupLoadBalancingArgs( + additional_latency_in_milliseconds=0, + sample_size=16, + successful_samples_required=3, + )) + ``` + ## Import Front Door Origin Groups can be imported using the `resource id`, e.g. @@ -336,6 +363,33 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Origin Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_origin_group = azure.cdn.FrontdoorOriginGroup("exampleFrontdoorOriginGroup", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + session_affinity_enabled=True, + restore_traffic_time_to_healed_or_new_endpoint_in_minutes=10, + health_probe=azure.cdn.FrontdoorOriginGroupHealthProbeArgs( + interval_in_seconds=240, + path="/healthProbe", + protocol="Https", + request_type="HEAD", + ), + load_balancing=azure.cdn.FrontdoorOriginGroupLoadBalancingArgs( + additional_latency_in_milliseconds=0, + sample_size=16, + successful_samples_required=3, + )) + ``` + ## Import Front Door Origin Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_profile.py b/sdk/python/pulumi_azure/cdn/frontdoor_profile.py index eb86ac5dd3..f475556fa0 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_profile.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_profile.py @@ -273,6 +273,21 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Profile which contains a collection of endpoints and origin groups. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor", + tags={ + "environment": "Production", + }) + ``` + ## Import Front Door Profiles can be imported using the `resource id`, e.g. @@ -298,6 +313,21 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Profile which contains a collection of endpoints and origin groups. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor", + tags={ + "environment": "Production", + }) + ``` + ## Import Front Door Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_route_disable_link_to_default_domain.py b/sdk/python/pulumi_azure/cdn/frontdoor_route_disable_link_to_default_domain.py index 72e1654d88..eedf254150 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_route_disable_link_to_default_domain.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_route_disable_link_to_default_domain.py @@ -164,6 +164,20 @@ def __init__(__self__, !>**IMPORTANT:** This resource has been deprecated and should not be used for new deployments. The `cdn.FrontdoorRouteDisableLinkToDefaultDomain` resource will be removed from the 4.0 AzureRM provider. Please use the `link_to_default_domain` field in the `cdn.FrontdoorRoute` resource to control this value. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.FrontdoorRouteDisableLinkToDefaultDomain("example", + cdn_frontdoor_route_id=azurerm_cdn_frontdoor_route["example"]["id"], + cdn_frontdoor_custom_domain_ids=[ + azurerm_cdn_frontdoor_custom_domain["contoso"]["id"], + azurerm_cdn_frontdoor_custom_domain["fabrikam"]["id"], + ]) + ``` + ## Import FrontDoor Route Disable Link To Default Domain can be imported using the `resource id`, e.g. @@ -188,6 +202,20 @@ def __init__(__self__, !>**IMPORTANT:** This resource has been deprecated and should not be used for new deployments. The `cdn.FrontdoorRouteDisableLinkToDefaultDomain` resource will be removed from the 4.0 AzureRM provider. Please use the `link_to_default_domain` field in the `cdn.FrontdoorRoute` resource to control this value. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.FrontdoorRouteDisableLinkToDefaultDomain("example", + cdn_frontdoor_route_id=azurerm_cdn_frontdoor_route["example"]["id"], + cdn_frontdoor_custom_domain_ids=[ + azurerm_cdn_frontdoor_custom_domain["contoso"]["id"], + azurerm_cdn_frontdoor_custom_domain["fabrikam"]["id"], + ]) + ``` + ## Import FrontDoor Route Disable Link To Default Domain can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_rule_set.py b/sdk/python/pulumi_azure/cdn/frontdoor_rule_set.py index ba4df9c86c..4edef45c6d 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_rule_set.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_rule_set.py @@ -133,6 +133,19 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_rule_set = azure.cdn.FrontdoorRuleSet("exampleFrontdoorRuleSet", cdn_frontdoor_profile_id=example_frontdoor_profile.id) + ``` + ## Import Front Door Rule Sets can be imported using the `resource id`, e.g. @@ -155,6 +168,19 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_rule_set = azure.cdn.FrontdoorRuleSet("exampleFrontdoorRuleSet", cdn_frontdoor_profile_id=example_frontdoor_profile.id) + ``` + ## Import Front Door Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/frontdoor_secret.py b/sdk/python/pulumi_azure/cdn/frontdoor_secret.py index 0e74cbc8a0..d1ca16978b 100644 --- a/sdk/python/pulumi_azure/cdn/frontdoor_secret.py +++ b/sdk/python/pulumi_azure/cdn/frontdoor_secret.py @@ -193,6 +193,63 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Secret. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + frontdoor = azuread.get_service_principal(display_name="Microsoft.Azure.Cdn") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + network_acls=azure.keyvault.KeyVaultNetworkAclsArgs( + default_action="Deny", + bypass="AzureServices", + ip_rules=["10.0.0.0/24"], + ), + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=frontdoor.object_id, + secret_permissions=["Get"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Get", + "Import", + "Delete", + "Purge", + ], + secret_permissions=["Get"], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("my-certificate.pfx"), + )) + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_secret = azure.cdn.FrontdoorSecret("exampleFrontdoorSecret", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + secret=azure.cdn.FrontdoorSecretSecretArgs( + customer_certificates=[azure.cdn.FrontdoorSecretSecretCustomerCertificateArgs( + key_vault_certificate_id=example_certificate.id, + )], + )) + ``` + ## Import Front Door Secrets can be imported using the `resource id`, e.g. @@ -216,6 +273,63 @@ def __init__(__self__, """ Manages a Front Door (standard/premium) Secret. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + frontdoor = azuread.get_service_principal(display_name="Microsoft.Azure.Cdn") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + network_acls=azure.keyvault.KeyVaultNetworkAclsArgs( + default_action="Deny", + bypass="AzureServices", + ip_rules=["10.0.0.0/24"], + ), + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=frontdoor.object_id, + secret_permissions=["Get"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Get", + "Import", + "Delete", + "Purge", + ], + secret_permissions=["Get"], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("my-certificate.pfx"), + )) + example_frontdoor_profile = azure.cdn.FrontdoorProfile("exampleFrontdoorProfile", + resource_group_name=example_resource_group.name, + sku_name="Standard_AzureFrontDoor") + example_frontdoor_secret = azure.cdn.FrontdoorSecret("exampleFrontdoorSecret", + cdn_frontdoor_profile_id=example_frontdoor_profile.id, + secret=azure.cdn.FrontdoorSecretSecretArgs( + customer_certificates=[azure.cdn.FrontdoorSecretSecretCustomerCertificateArgs( + key_vault_certificate_id=example_certificate.id, + )], + )) + ``` + ## Import Front Door Secrets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cdn/get_frontdoor_custom_domain.py b/sdk/python/pulumi_azure/cdn/get_frontdoor_custom_domain.py index e46f7bea66..017e49ce87 100644 --- a/sdk/python/pulumi_azure/cdn/get_frontdoor_custom_domain.py +++ b/sdk/python/pulumi_azure/cdn/get_frontdoor_custom_domain.py @@ -148,6 +148,17 @@ def get_frontdoor_custom_domain(name: Optional[str] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Custom Domain. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_custom_domain(name=azurerm_cdn_frontdoor_custom_domain["example"]["name"], + profile_name=azurerm_cdn_frontdoor_profile["example"]["name"], + resource_group_name=azurerm_cdn_frontdoor_profile["example"]["resource_group_name"]) + ``` + :param str name: The name of the Front Door Custom Domain. :param str profile_name: The name of the Front Door Profile which the Front Door Custom Domain is bound to. @@ -181,6 +192,17 @@ def get_frontdoor_custom_domain_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Custom Domain. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_custom_domain(name=azurerm_cdn_frontdoor_custom_domain["example"]["name"], + profile_name=azurerm_cdn_frontdoor_profile["example"]["name"], + resource_group_name=azurerm_cdn_frontdoor_profile["example"]["resource_group_name"]) + ``` + :param str name: The name of the Front Door Custom Domain. :param str profile_name: The name of the Front Door Profile which the Front Door Custom Domain is bound to. diff --git a/sdk/python/pulumi_azure/cdn/get_frontdoor_endpoint.py b/sdk/python/pulumi_azure/cdn/get_frontdoor_endpoint.py index 34315f24c5..55ddd793ab 100644 --- a/sdk/python/pulumi_azure/cdn/get_frontdoor_endpoint.py +++ b/sdk/python/pulumi_azure/cdn/get_frontdoor_endpoint.py @@ -114,6 +114,17 @@ def get_frontdoor_endpoint(name: Optional[str] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_endpoint(name="existing-endpoint", + profile_name="existing-cdn-profile", + resource_group_name="existing-resources") + ``` + :param str name: Specifies the name of the Front Door Endpoint. :param str profile_name: The name of the Front Door Profile within which Front Door Endpoint exists. @@ -144,6 +155,17 @@ def get_frontdoor_endpoint_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_endpoint(name="existing-endpoint", + profile_name="existing-cdn-profile", + resource_group_name="existing-resources") + ``` + :param str name: Specifies the name of the Front Door Endpoint. :param str profile_name: The name of the Front Door Profile within which Front Door Endpoint exists. diff --git a/sdk/python/pulumi_azure/cdn/get_frontdoor_firewall_policy.py b/sdk/python/pulumi_azure/cdn/get_frontdoor_firewall_policy.py index 05fb98605c..6a51ae8dc7 100644 --- a/sdk/python/pulumi_azure/cdn/get_frontdoor_firewall_policy.py +++ b/sdk/python/pulumi_azure/cdn/get_frontdoor_firewall_policy.py @@ -128,6 +128,16 @@ def get_frontdoor_firewall_policy(name: Optional[str] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_firewall_policy(name="examplecdnfdwafpolicy", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the Front Door Firewall Policy. :param str resource_group_name: The name of the resource group. @@ -156,6 +166,16 @@ def get_frontdoor_firewall_policy_output(name: Optional[pulumi.Input[str]] = Non """ Use this data source to access information about an existing Front Door (standard/premium) Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_firewall_policy(name="examplecdnfdwafpolicy", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the Front Door Firewall Policy. :param str resource_group_name: The name of the resource group. diff --git a/sdk/python/pulumi_azure/cdn/get_frontdoor_origin_group.py b/sdk/python/pulumi_azure/cdn/get_frontdoor_origin_group.py index 22c79bb9cf..548539dbd8 100644 --- a/sdk/python/pulumi_azure/cdn/get_frontdoor_origin_group.py +++ b/sdk/python/pulumi_azure/cdn/get_frontdoor_origin_group.py @@ -136,6 +136,17 @@ def get_frontdoor_origin_group(name: Optional[str] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Origin Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_origin_group(name="example-origin-group", + profile_name="example-profile", + resource_group_name="example-resources") + ``` + :param str name: Specifies the name of the Front Door Origin Group. :param str profile_name: The name of the Front Door Profile within which Front Door Origin Group exists. @@ -168,6 +179,17 @@ def get_frontdoor_origin_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Origin Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_origin_group(name="example-origin-group", + profile_name="example-profile", + resource_group_name="example-resources") + ``` + :param str name: Specifies the name of the Front Door Origin Group. :param str profile_name: The name of the Front Door Profile within which Front Door Origin Group exists. diff --git a/sdk/python/pulumi_azure/cdn/get_frontdoor_profile.py b/sdk/python/pulumi_azure/cdn/get_frontdoor_profile.py index 9d68abe0b1..8b8f0bfa56 100644 --- a/sdk/python/pulumi_azure/cdn/get_frontdoor_profile.py +++ b/sdk/python/pulumi_azure/cdn/get_frontdoor_profile.py @@ -116,6 +116,16 @@ def get_frontdoor_profile(name: Optional[str] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_profile(name="existing-cdn-profile", + resource_group_name="existing-resources") + ``` + :param str name: Specifies the name of the Front Door Profile. :param str resource_group_name: The name of the Resource Group where this Front Door Profile exists. @@ -143,6 +153,16 @@ def get_frontdoor_profile_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_profile(name="existing-cdn-profile", + resource_group_name="existing-resources") + ``` + :param str name: Specifies the name of the Front Door Profile. :param str resource_group_name: The name of the Resource Group where this Front Door Profile exists. diff --git a/sdk/python/pulumi_azure/cdn/get_frontdoor_rule_set.py b/sdk/python/pulumi_azure/cdn/get_frontdoor_rule_set.py index bcb5f7182e..9c3b81ea65 100644 --- a/sdk/python/pulumi_azure/cdn/get_frontdoor_rule_set.py +++ b/sdk/python/pulumi_azure/cdn/get_frontdoor_rule_set.py @@ -90,6 +90,17 @@ def get_frontdoor_rule_set(name: Optional[str] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_rule_set(name="existing-rule-set", + profile_name="existing-profile", + resource_group_name="existing-resources") + ``` + :param str name: Specifies the name of the Front Door Rule Set to retrieve. :param str profile_name: Specifies the name of the Front Door Profile where this Front Door Rule Set exists. @@ -118,6 +129,17 @@ def get_frontdoor_rule_set_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_rule_set(name="existing-rule-set", + profile_name="existing-profile", + resource_group_name="existing-resources") + ``` + :param str name: Specifies the name of the Front Door Rule Set to retrieve. :param str profile_name: Specifies the name of the Front Door Profile where this Front Door Rule Set exists. diff --git a/sdk/python/pulumi_azure/cdn/get_frontdoor_secret.py b/sdk/python/pulumi_azure/cdn/get_frontdoor_secret.py index f817816c58..e7d907f23a 100644 --- a/sdk/python/pulumi_azure/cdn/get_frontdoor_secret.py +++ b/sdk/python/pulumi_azure/cdn/get_frontdoor_secret.py @@ -103,6 +103,17 @@ def get_frontdoor_secret(name: Optional[str] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Secret. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_secret(name="example-secret", + profile_name="example-profile", + resource_group_name="example-resources") + ``` + :param str name: Specifies the name of the Front Door Secret. :param str profile_name: The name of the Front Door Profile within which the Front Door Secret exists. @@ -132,6 +143,17 @@ def get_frontdoor_secret_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Front Door (standard/premium) Secret. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_frontdoor_secret(name="example-secret", + profile_name="example-profile", + resource_group_name="example-resources") + ``` + :param str name: Specifies the name of the Front Door Secret. :param str profile_name: The name of the Front Door Profile within which the Front Door Secret exists. diff --git a/sdk/python/pulumi_azure/cdn/get_profile.py b/sdk/python/pulumi_azure/cdn/get_profile.py index af9e65a371..66de132142 100644 --- a/sdk/python/pulumi_azure/cdn/get_profile.py +++ b/sdk/python/pulumi_azure/cdn/get_profile.py @@ -104,6 +104,17 @@ def get_profile(name: Optional[str] = None, """ Use this data source to access information about an existing CDN Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_profile(name="myfirstcdnprofile", + resource_group_name="example-resources") + pulumi.export("cdnProfileId", example.id) + ``` + :param str name: The name of the CDN Profile. :param str resource_group_name: The name of the resource group in which the CDN Profile exists. @@ -130,6 +141,17 @@ def get_profile_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing CDN Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cdn.get_profile(name="myfirstcdnprofile", + resource_group_name="example-resources") + pulumi.export("cdnProfileId", example.id) + ``` + :param str name: The name of the CDN Profile. :param str resource_group_name: The name of the resource group in which the CDN Profile exists. diff --git a/sdk/python/pulumi_azure/cdn/profile.py b/sdk/python/pulumi_azure/cdn/profile.py index a7a1d94015..8a1b824fe4 100644 --- a/sdk/python/pulumi_azure/cdn/profile.py +++ b/sdk/python/pulumi_azure/cdn/profile.py @@ -243,6 +243,23 @@ def __init__(__self__, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_profile = azure.cdn.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_Verizon", + tags={ + "environment": "Production", + "cost_center": "MSFT", + }) + ``` + ## Import CDN Profiles can be imported using the `resource id`, e.g. @@ -266,6 +283,23 @@ def __init__(__self__, args: ProfileArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_profile = azure.cdn.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_Verizon", + tags={ + "environment": "Production", + "cost_center": "MSFT", + }) + ``` + ## Import CDN Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cognitive/account.py b/sdk/python/pulumi_azure/cognitive/account.py index 3380a73eb6..a60fe0ea89 100644 --- a/sdk/python/pulumi_azure/cognitive/account.py +++ b/sdk/python/pulumi_azure/cognitive/account.py @@ -1074,6 +1074,23 @@ def __init__(__self__, > **Note:** Version v2.65.0 of the Azure Provider and later will attempt to Purge the Cognitive Account during deletion. This feature can be disabled using the `features` block within the `provider` block, see the provider documentation on the features block for more information. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Face", + sku_name="S0", + tags={ + "Acceptance": "Test", + }) + ``` + ## Import Cognitive Service Accounts can be imported using the `resource id`, e.g. @@ -1129,6 +1146,23 @@ def __init__(__self__, > **Note:** Version v2.65.0 of the Azure Provider and later will attempt to Purge the Cognitive Account during deletion. This feature can be disabled using the `features` block within the `provider` block, see the provider documentation on the features block for more information. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Face", + sku_name="S0", + tags={ + "Acceptance": "Test", + }) + ``` + ## Import Cognitive Service Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cognitive/account_customer_managed_key.py b/sdk/python/pulumi_azure/cognitive/account_customer_managed_key.py index 1952d468e6..1afd46cff0 100644 --- a/sdk/python/pulumi_azure/cognitive/account_customer_managed_key.py +++ b/sdk/python/pulumi_azure/cognitive/account_customer_managed_key.py @@ -181,6 +181,113 @@ def __init__(__self__, > **NOTE:** It's possible to define a Customer Managed Key both within the `cognitive.Account` resource via the `customer_managed_key` block and by using the `cognitive.AccountCustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Cognitive Account, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Face", + sku_name="E0", + custom_subdomain_name="example-account", + identity=azure.cognitive.AccountIdentityArgs( + type="SystemAssigned, UserAssigned", + identity_ids=[example_user_assigned_identity.id], + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True, + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_account.identity.tenant_id, + object_id=example_account.identity.principal_id, + key_permissions=[ + "Get", + "Create", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + ], + secret_permissions=["Get"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_user_assigned_identity.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + ], + secret_permissions=["Get"], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ]) + example_account_customer_managed_key = azure.cognitive.AccountCustomerManagedKey("exampleAccountCustomerManagedKey", + cognitive_account_id=example_account.id, + key_vault_key_id=example_key.id, + identity_client_id=example_user_assigned_identity.client_id) + ``` + ## Import Customer Managed Keys for a Cognitive Account can be imported using the `resource id`, e.g. @@ -206,6 +313,113 @@ def __init__(__self__, > **NOTE:** It's possible to define a Customer Managed Key both within the `cognitive.Account` resource via the `customer_managed_key` block and by using the `cognitive.AccountCustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Cognitive Account, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Face", + sku_name="E0", + custom_subdomain_name="example-account", + identity=azure.cognitive.AccountIdentityArgs( + type="SystemAssigned, UserAssigned", + identity_ids=[example_user_assigned_identity.id], + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True, + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_account.identity.tenant_id, + object_id=example_account.identity.principal_id, + key_permissions=[ + "Get", + "Create", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + ], + secret_permissions=["Get"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_user_assigned_identity.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + ], + secret_permissions=["Get"], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ]) + example_account_customer_managed_key = azure.cognitive.AccountCustomerManagedKey("exampleAccountCustomerManagedKey", + cognitive_account_id=example_account.id, + key_vault_key_id=example_key.id, + identity_client_id=example_user_assigned_identity.client_id) + ``` + ## Import Customer Managed Keys for a Cognitive Account can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cognitive/deployment.py b/sdk/python/pulumi_azure/cognitive/deployment.py index 5f33eb3c6e..5b01204504 100644 --- a/sdk/python/pulumi_azure/cognitive/deployment.py +++ b/sdk/python/pulumi_azure/cognitive/deployment.py @@ -252,6 +252,30 @@ def __init__(__self__, """ Manages a Cognitive Services Account Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="OpenAI", + sku_name="S0") + example_deployment = azure.cognitive.Deployment("exampleDeployment", + cognitive_account_id=example_account.id, + model=azure.cognitive.DeploymentModelArgs( + format="OpenAI", + name="text-curie-001", + version="1", + ), + scale=azure.cognitive.DeploymentScaleArgs( + type="Standard", + )) + ``` + ## Import Cognitive Services Account Deployment can be imported using the `resource id`, e.g. @@ -277,6 +301,30 @@ def __init__(__self__, """ Manages a Cognitive Services Account Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cognitive.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="OpenAI", + sku_name="S0") + example_deployment = azure.cognitive.Deployment("exampleDeployment", + cognitive_account_id=example_account.id, + model=azure.cognitive.DeploymentModelArgs( + format="OpenAI", + name="text-curie-001", + version="1", + ), + scale=azure.cognitive.DeploymentScaleArgs( + type="Standard", + )) + ``` + ## Import Cognitive Services Account Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cognitive/get_account.py b/sdk/python/pulumi_azure/cognitive/get_account.py index 4632e1c289..e59918f3af 100644 --- a/sdk/python/pulumi_azure/cognitive/get_account.py +++ b/sdk/python/pulumi_azure/cognitive/get_account.py @@ -165,6 +165,17 @@ def get_account(name: Optional[str] = None, """ Use this data source to access information about an existing Cognitive Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.cognitive.get_account(name="example-account", + resource_group_name="cognitive_account_rg") + pulumi.export("primaryAccessKey", test.primary_access_key) + ``` + :param str name: Specifies the name of the Cognitive Services Account. :param str resource_group_name: Specifies the name of the resource group where the Cognitive Services Account resides. @@ -199,6 +210,17 @@ def get_account_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Cognitive Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.cognitive.get_account(name="example-account", + resource_group_name="cognitive_account_rg") + pulumi.export("primaryAccessKey", test.primary_access_key) + ``` + :param str name: Specifies the name of the Cognitive Services Account. :param str resource_group_name: Specifies the name of the resource group where the Cognitive Services Account resides. diff --git a/sdk/python/pulumi_azure/communication/email_service.py b/sdk/python/pulumi_azure/communication/email_service.py index 086bf4377b..3973a80e50 100644 --- a/sdk/python/pulumi_azure/communication/email_service.py +++ b/sdk/python/pulumi_azure/communication/email_service.py @@ -212,6 +212,18 @@ def __init__(__self__, """ Manages an Email Communication Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_email_service = azure.communication.EmailService("exampleEmailService", + resource_group_name=example_resource_group.name, + data_location="United States") + ``` + ## Import Communication Services can be imported using the `resource id`, e.g. @@ -236,6 +248,18 @@ def __init__(__self__, """ Manages an Email Communication Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_email_service = azure.communication.EmailService("exampleEmailService", + resource_group_name=example_resource_group.name, + data_location="United States") + ``` + ## Import Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/communication/get_service.py b/sdk/python/pulumi_azure/communication/get_service.py index 779032bdb6..8fcda32f50 100644 --- a/sdk/python/pulumi_azure/communication/get_service.py +++ b/sdk/python/pulumi_azure/communication/get_service.py @@ -140,6 +140,17 @@ def get_service(name: Optional[str] = None, """ Use this data source to access information about an existing Communication Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.communication.get_service(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Communication Service. * @@ -171,6 +182,17 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Communication Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.communication.get_service(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Communication Service. * diff --git a/sdk/python/pulumi_azure/communication/service.py b/sdk/python/pulumi_azure/communication/service.py index 97ea742af0..315e26593b 100644 --- a/sdk/python/pulumi_azure/communication/service.py +++ b/sdk/python/pulumi_azure/communication/service.py @@ -291,6 +291,18 @@ def __init__(__self__, """ Manages a Communication Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.communication.Service("exampleService", + resource_group_name=example_resource_group.name, + data_location="United States") + ``` + ## Import Communication Services can be imported using the `resource id`, e.g. @@ -315,6 +327,18 @@ def __init__(__self__, """ Manages a Communication Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.communication.Service("exampleService", + resource_group_name=example_resource_group.name, + data_location="United States") + ``` + ## Import Communication Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/_inputs.py b/sdk/python/pulumi_azure/compute/_inputs.py index c41d9f11e3..22dfc377e3 100644 --- a/sdk/python/pulumi_azure/compute/_inputs.py +++ b/sdk/python/pulumi_azure/compute/_inputs.py @@ -7433,6 +7433,32 @@ def __init__(__self__, *, """ :param pulumi.Input[str] type: Specifies the identity type to be assigned to the scale set. Allowable values are `SystemAssigned` and `UserAssigned`. For the `SystemAssigned` identity the scale set's Service Principal ID (SPN) can be retrieved after the scale set has been created. See [documentation](https://docs.microsoft.com/azure/active-directory/managed-service-identity/overview) for more information. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. :param pulumi.Input[Sequence[pulumi.Input[str]]] identity_ids: Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.ScaleSet("example", + resource_group_name=azurerm_resource_group["example"]["name"], + location=azurerm_resource_group["example"]["location"], + sku=azure.compute.ScaleSetSkuArgs( + name=var["vm_sku"], + tier="Standard", + capacity=var["instance_count"], + ), + identity=azure.compute.ScaleSetIdentityArgs( + type="SystemAssigned", + ), + extensions=[azure.compute.ScaleSetExtensionArgs( + name="MSILinuxExtension", + publisher="Microsoft.ManagedIdentity", + type="ManagedIdentityExtensionForLinux", + type_handler_version="1.0", + settings="{\\"port\\": 50342}", + )]) + # ... + pulumi.export("principalId", example.identity.principal_id) + ``` """ ScaleSetIdentityArgs._configure( lambda key, value: pulumi.set(__self__, key, value), @@ -7478,6 +7504,32 @@ def type(self, value: pulumi.Input[str]): def identity_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.ScaleSet("example", + resource_group_name=azurerm_resource_group["example"]["name"], + location=azurerm_resource_group["example"]["location"], + sku=azure.compute.ScaleSetSkuArgs( + name=var["vm_sku"], + tier="Standard", + capacity=var["instance_count"], + ), + identity=azure.compute.ScaleSetIdentityArgs( + type="SystemAssigned", + ), + extensions=[azure.compute.ScaleSetExtensionArgs( + name="MSILinuxExtension", + publisher="Microsoft.ManagedIdentity", + type="ManagedIdentityExtensionForLinux", + type_handler_version="1.0", + settings="{\\"port\\": 50342}", + )]) + # ... + pulumi.export("principalId", example.identity.principal_id) + ``` """ return pulumi.get(self, "identity_ids") diff --git a/sdk/python/pulumi_azure/compute/availability_set.py b/sdk/python/pulumi_azure/compute/availability_set.py index 12ca5546a1..687e3505c6 100644 --- a/sdk/python/pulumi_azure/compute/availability_set.py +++ b/sdk/python/pulumi_azure/compute/availability_set.py @@ -383,6 +383,21 @@ def __init__(__self__, """ Manages an Availability Set for Virtual Machines. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_availability_set = azure.compute.AvailabilitySet("exampleAvailabilitySet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import Availability Sets can be imported using the `resource id`, e.g. @@ -415,6 +430,21 @@ def __init__(__self__, """ Manages an Availability Set for Virtual Machines. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_availability_set = azure.compute.AvailabilitySet("exampleAvailabilitySet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import Availability Sets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/bastion_host.py b/sdk/python/pulumi_azure/compute/bastion_host.py index 847fe1df66..9f5e1e8de0 100644 --- a/sdk/python/pulumi_azure/compute/bastion_host.py +++ b/sdk/python/pulumi_azure/compute/bastion_host.py @@ -602,6 +602,38 @@ def __init__(__self__, """ Manages a Bastion Host. + ## Example Usage + + This example deploys an Azure Bastion Host Instance to a target virtual network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.224/27"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_bastion_host = azure.compute.BastionHost("exampleBastionHost", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configuration=azure.compute.BastionHostIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )) + ``` + ## Import Bastion Hosts can be imported using the `resource id`, e.g. @@ -646,6 +678,38 @@ def __init__(__self__, """ Manages a Bastion Host. + ## Example Usage + + This example deploys an Azure Bastion Host Instance to a target virtual network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.224/27"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_bastion_host = azure.compute.BastionHost("exampleBastionHost", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configuration=azure.compute.BastionHostIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )) + ``` + ## Import Bastion Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/capacity_reservation.py b/sdk/python/pulumi_azure/compute/capacity_reservation.py index a2ef81bf92..08bba68c4f 100644 --- a/sdk/python/pulumi_azure/compute/capacity_reservation.py +++ b/sdk/python/pulumi_azure/compute/capacity_reservation.py @@ -247,6 +247,24 @@ def __init__(__self__, """ Manages a Capacity Reservation within a Capacity Reservation Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_capacity_reservation_group = azure.compute.CapacityReservationGroup("exampleCapacityReservationGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_capacity_reservation = azure.compute.CapacityReservation("exampleCapacityReservation", + capacity_reservation_group_id=example_capacity_reservation_group.id, + sku=azure.compute.CapacityReservationSkuArgs( + name="Standard_D2s_v3", + capacity=1, + )) + ``` + ## Import Capacity Reservations can be imported using the `resource id`, e.g. @@ -272,6 +290,24 @@ def __init__(__self__, """ Manages a Capacity Reservation within a Capacity Reservation Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_capacity_reservation_group = azure.compute.CapacityReservationGroup("exampleCapacityReservationGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_capacity_reservation = azure.compute.CapacityReservation("exampleCapacityReservation", + capacity_reservation_group_id=example_capacity_reservation_group.id, + sku=azure.compute.CapacityReservationSkuArgs( + name="Standard_D2s_v3", + capacity=1, + )) + ``` + ## Import Capacity Reservations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/capacity_reservation_group.py b/sdk/python/pulumi_azure/compute/capacity_reservation_group.py index 45914dccbd..1139203526 100644 --- a/sdk/python/pulumi_azure/compute/capacity_reservation_group.py +++ b/sdk/python/pulumi_azure/compute/capacity_reservation_group.py @@ -244,6 +244,18 @@ def __init__(__self__, """ Manages a Capacity Reservation Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_capacity_reservation_group = azure.compute.CapacityReservationGroup("exampleCapacityReservationGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Capacity Reservation Groups can be imported using the `resource id`, e.g. @@ -269,6 +281,18 @@ def __init__(__self__, """ Manages a Capacity Reservation Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_capacity_reservation_group = azure.compute.CapacityReservationGroup("exampleCapacityReservationGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Capacity Reservation Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/data_disk_attachment.py b/sdk/python/pulumi_azure/compute/data_disk_attachment.py index 52b965202b..7dd3e8b868 100644 --- a/sdk/python/pulumi_azure/compute/data_disk_attachment.py +++ b/sdk/python/pulumi_azure/compute/data_disk_attachment.py @@ -300,6 +300,72 @@ def __init__(__self__, > **Please Note:** only Managed Disks are supported via this separate resource, Unmanaged Disks can be attached using the `storage_data_disk` block in the `compute.VirtualMachine` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + prefix = config.get("prefix") + if prefix is None: + prefix = "example" + vm_name = f"{prefix}-vm" + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + main_virtual_network = azure.network.VirtualNetwork("mainVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=main_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + main_network_interface = azure.network.NetworkInterface("mainNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=internal.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[main_network_interface.id], + vm_size="Standard_F2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="myosdisk1", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name=vm_name, + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=10) + example_data_disk_attachment = azure.compute.DataDiskAttachment("exampleDataDiskAttachment", + managed_disk_id=example_managed_disk.id, + virtual_machine_id=example_virtual_machine.id, + lun=10, + caching="ReadWrite") + ``` + ## Import Virtual Machines Data Disk Attachments can be imported using the `resource id`, e.g. @@ -330,6 +396,72 @@ def __init__(__self__, > **Please Note:** only Managed Disks are supported via this separate resource, Unmanaged Disks can be attached using the `storage_data_disk` block in the `compute.VirtualMachine` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + prefix = config.get("prefix") + if prefix is None: + prefix = "example" + vm_name = f"{prefix}-vm" + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + main_virtual_network = azure.network.VirtualNetwork("mainVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=main_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + main_network_interface = azure.network.NetworkInterface("mainNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=internal.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[main_network_interface.id], + vm_size="Standard_F2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="myosdisk1", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name=vm_name, + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=10) + example_data_disk_attachment = azure.compute.DataDiskAttachment("exampleDataDiskAttachment", + managed_disk_id=example_managed_disk.id, + virtual_machine_id=example_virtual_machine.id, + lun=10, + caching="ReadWrite") + ``` + ## Import Virtual Machines Data Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/dedicated_host.py b/sdk/python/pulumi_azure/compute/dedicated_host.py index 6d4b45e914..8c204590fa 100644 --- a/sdk/python/pulumi_azure/compute/dedicated_host.py +++ b/sdk/python/pulumi_azure/compute/dedicated_host.py @@ -373,6 +373,24 @@ def __init__(__self__, """ Manage a Dedicated Host within a Dedicated Host Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dedicated_host_group = azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + platform_fault_domain_count=2) + example_dedicated_host = azure.compute.DedicatedHost("exampleDedicatedHost", + location=example_resource_group.location, + dedicated_host_group_id=example_dedicated_host_group.id, + sku_name="DSv3-Type1", + platform_fault_domain=1) + ``` + ## Import Dedicated Hosts can be imported using the `resource id`, e.g. @@ -401,6 +419,24 @@ def __init__(__self__, """ Manage a Dedicated Host within a Dedicated Host Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dedicated_host_group = azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + platform_fault_domain_count=2) + example_dedicated_host = azure.compute.DedicatedHost("exampleDedicatedHost", + location=example_resource_group.location, + dedicated_host_group_id=example_dedicated_host_group.id, + sku_name="DSv3-Type1", + platform_fault_domain=1) + ``` + ## Import Dedicated Hosts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/dedicated_host_group.py b/sdk/python/pulumi_azure/compute/dedicated_host_group.py index 0670953da9..79b7b17c82 100644 --- a/sdk/python/pulumi_azure/compute/dedicated_host_group.py +++ b/sdk/python/pulumi_azure/compute/dedicated_host_group.py @@ -327,6 +327,19 @@ def __init__(__self__, """ Manage a Dedicated Host Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dedicated_host_group = azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + platform_fault_domain_count=1) + ``` + ## Import Dedicated Host Group can be imported using the `resource id`, e.g. @@ -354,6 +367,19 @@ def __init__(__self__, """ Manage a Dedicated Host Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dedicated_host_group = azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + platform_fault_domain_count=1) + ``` + ## Import Dedicated Host Group can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/disk_access.py b/sdk/python/pulumi_azure/compute/disk_access.py index 88b5b3d867..00224a03f8 100644 --- a/sdk/python/pulumi_azure/compute/disk_access.py +++ b/sdk/python/pulumi_azure/compute/disk_access.py @@ -207,6 +207,17 @@ def __init__(__self__, """ Manages a Disk Access. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.DiskAccess("example", + location="West Europe", + resource_group_name="example") + ``` + ## Import Disk Access resource can be imported using the `resource id`, e.g. @@ -231,6 +242,17 @@ def __init__(__self__, """ Manages a Disk Access. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.DiskAccess("example", + location="West Europe", + resource_group_name="example") + ``` + ## Import Disk Access resource can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/disk_encryption_set.py b/sdk/python/pulumi_azure/compute/disk_encryption_set.py index f767f679c5..de82312542 100644 --- a/sdk/python/pulumi_azure/compute/disk_encryption_set.py +++ b/sdk/python/pulumi_azure/compute/disk_encryption_set.py @@ -446,6 +446,150 @@ def __init__(__self__, > **NOTE:** At this time the Key Vault used to store the Active Key for this Disk Encryption Set must have both Soft Delete & Purge Protection enabled - which are not yet supported by this provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + enabled_for_disk_encryption=True, + purge_protection_enabled=True) + example_user = azure.keyvault.AccessPolicy("example-user", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_user])) + example_disk_encryption_set = azure.compute.DiskEncryptionSet("exampleDiskEncryptionSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + key_vault_key_id=example_key.id, + identity=azure.compute.DiskEncryptionSetIdentityArgs( + type="SystemAssigned", + )) + example_disk_access_policy = azure.keyvault.AccessPolicy("example-diskAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_disk_encryption_set.identity.tenant_id, + object_id=example_disk_encryption_set.identity.principal_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + ]) + example_disk_assignment = azure.authorization.Assignment("example-diskAssignment", + scope=example_key_vault.id, + role_definition_name="Key Vault Crypto Service Encryption User", + principal_id=example_disk_encryption_set.identity.principal_id) + ``` + ### With Automatic Key Rotation Enabled + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + enabled_for_disk_encryption=True, + purge_protection_enabled=True) + example_user = azure.keyvault.AccessPolicy("example-user", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_user])) + example_disk_encryption_set = azure.compute.DiskEncryptionSet("exampleDiskEncryptionSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + key_vault_key_id=example_key.versionless_id, + auto_key_rotation_enabled=True, + identity=azure.compute.DiskEncryptionSetIdentityArgs( + type="SystemAssigned", + )) + example_disk_access_policy = azure.keyvault.AccessPolicy("example-diskAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_disk_encryption_set.identity.tenant_id, + object_id=example_disk_encryption_set.identity.principal_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + ]) + example_disk_assignment = azure.authorization.Assignment("example-diskAssignment", + scope=example_key_vault.id, + role_definition_name="Key Vault Crypto Service Encryption User", + principal_id=example_disk_encryption_set.identity.principal_id) + ``` + ## Import Disk Encryption Sets can be imported using the `resource id`, e.g. @@ -481,6 +625,150 @@ def __init__(__self__, > **NOTE:** At this time the Key Vault used to store the Active Key for this Disk Encryption Set must have both Soft Delete & Purge Protection enabled - which are not yet supported by this provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + enabled_for_disk_encryption=True, + purge_protection_enabled=True) + example_user = azure.keyvault.AccessPolicy("example-user", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_user])) + example_disk_encryption_set = azure.compute.DiskEncryptionSet("exampleDiskEncryptionSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + key_vault_key_id=example_key.id, + identity=azure.compute.DiskEncryptionSetIdentityArgs( + type="SystemAssigned", + )) + example_disk_access_policy = azure.keyvault.AccessPolicy("example-diskAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_disk_encryption_set.identity.tenant_id, + object_id=example_disk_encryption_set.identity.principal_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + ]) + example_disk_assignment = azure.authorization.Assignment("example-diskAssignment", + scope=example_key_vault.id, + role_definition_name="Key Vault Crypto Service Encryption User", + principal_id=example_disk_encryption_set.identity.principal_id) + ``` + ### With Automatic Key Rotation Enabled + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + enabled_for_disk_encryption=True, + purge_protection_enabled=True) + example_user = azure.keyvault.AccessPolicy("example-user", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_user])) + example_disk_encryption_set = azure.compute.DiskEncryptionSet("exampleDiskEncryptionSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + key_vault_key_id=example_key.versionless_id, + auto_key_rotation_enabled=True, + identity=azure.compute.DiskEncryptionSetIdentityArgs( + type="SystemAssigned", + )) + example_disk_access_policy = azure.keyvault.AccessPolicy("example-diskAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_disk_encryption_set.identity.tenant_id, + object_id=example_disk_encryption_set.identity.principal_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "List", + "Decrypt", + "Sign", + ]) + example_disk_assignment = azure.authorization.Assignment("example-diskAssignment", + scope=example_key_vault.id, + role_definition_name="Key Vault Crypto Service Encryption User", + principal_id=example_disk_encryption_set.identity.principal_id) + ``` + ## Import Disk Encryption Sets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/disk_pool.py b/sdk/python/pulumi_azure/compute/disk_pool.py index 2e23bdf9f9..0114fa81f8 100644 --- a/sdk/python/pulumi_azure/compute/disk_pool.py +++ b/sdk/python/pulumi_azure/compute/disk_pool.py @@ -331,6 +331,36 @@ def __init__(__self__, !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_virtual_network.resource_group_name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Basic_B1", + subnet_id=example_subnet.id, + zones=["1"]) + ``` + ## Import Disk Pools can be imported using the `resource id`, e.g. @@ -360,6 +390,36 @@ def __init__(__self__, !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_virtual_network.resource_group_name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Basic_B1", + subnet_id=example_subnet.id, + zones=["1"]) + ``` + ## Import Disk Pools can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target.py b/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target.py index 8a15b502a9..8ad6f11dac 100644 --- a/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target.py +++ b/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target.py @@ -256,6 +256,65 @@ def __init__(__self__, !> **Note:** Each Disk Pool can have a maximum of 1 iSCSI Target. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + zones=["1"], + sku_name="Basic_B1") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + create_option="Empty", + storage_account_type="Premium_LRS", + disk_size_gb=4, + max_shares=2, + zone="1") + example_service_principal = azuread.get_service_principal(display_name="StoragePool Resource Provider") + roles = [ + "Disk Pool Operator", + "Virtual Machine Contributor", + ] + example_assignment = [] + for range in [{"value": i} for i in range(0, len(roles))]: + example_assignment.append(azure.authorization.Assignment(f"exampleAssignment-{range['value']}", + principal_id=example_service_principal.id, + role_definition_name=roles[range["value"]], + scope=example_managed_disk.id)) + example_disk_pool_managed_disk_attachment = azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", + disk_pool_id=example_disk_pool.id, + managed_disk_id=example_managed_disk.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + example_disk_pool_iscsi_target = azure.compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", + acl_mode="Dynamic", + disks_pool_id=example_disk_pool.id, + target_iqn="iqn.2021-11.com.microsoft:test", + opts=pulumi.ResourceOptions(depends_on=[example_disk_pool_managed_disk_attachment])) + ``` + ## Import iSCSI Targets can be imported using the `resource id`, e.g. @@ -284,6 +343,65 @@ def __init__(__self__, !> **Note:** Each Disk Pool can have a maximum of 1 iSCSI Target. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + zones=["1"], + sku_name="Basic_B1") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + create_option="Empty", + storage_account_type="Premium_LRS", + disk_size_gb=4, + max_shares=2, + zone="1") + example_service_principal = azuread.get_service_principal(display_name="StoragePool Resource Provider") + roles = [ + "Disk Pool Operator", + "Virtual Machine Contributor", + ] + example_assignment = [] + for range in [{"value": i} for i in range(0, len(roles))]: + example_assignment.append(azure.authorization.Assignment(f"exampleAssignment-{range['value']}", + principal_id=example_service_principal.id, + role_definition_name=roles[range["value"]], + scope=example_managed_disk.id)) + example_disk_pool_managed_disk_attachment = azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", + disk_pool_id=example_disk_pool.id, + managed_disk_id=example_managed_disk.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + example_disk_pool_iscsi_target = azure.compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", + acl_mode="Dynamic", + disks_pool_id=example_disk_pool.id, + target_iqn="iqn.2021-11.com.microsoft:test", + opts=pulumi.ResourceOptions(depends_on=[example_disk_pool_managed_disk_attachment])) + ``` + ## Import iSCSI Targets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target_lun.py b/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target_lun.py index cdceb6132e..21c694bbd0 100644 --- a/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target_lun.py +++ b/sdk/python/pulumi_azure/compute/disk_pool_iscsi_target_lun.py @@ -195,6 +195,68 @@ def __init__(__self__, !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + zones=["1"], + sku_name="Basic_B1") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + create_option="Empty", + storage_account_type="Premium_LRS", + disk_size_gb=4, + max_shares=2, + zone="1") + example_service_principal = azuread.get_service_principal(display_name="StoragePool Resource Provider") + roles = [ + "Disk Pool Operator", + "Virtual Machine Contributor", + ] + example_assignment = [] + for range in [{"value": i} for i in range(0, len(roles))]: + example_assignment.append(azure.authorization.Assignment(f"exampleAssignment-{range['value']}", + principal_id=example_service_principal.id, + role_definition_name=roles[range["value"]], + scope=example_managed_disk.id)) + example_disk_pool_managed_disk_attachment = azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", + disk_pool_id=example_disk_pool.id, + managed_disk_id=example_managed_disk.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + example_disk_pool_iscsi_target = azure.compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", + acl_mode="Dynamic", + disks_pool_id=example_disk_pool.id, + target_iqn="iqn.2021-11.com.microsoft:test", + opts=pulumi.ResourceOptions(depends_on=[example_disk_pool_managed_disk_attachment])) + example_disk_pool_iscsi_target_lun = azure.compute.DiskPoolIscsiTargetLun("exampleDiskPoolIscsiTargetLun", + iscsi_target_id=example_disk_pool_iscsi_target.id, + disk_pool_managed_disk_attachment_id=example_disk_pool_managed_disk_attachment.id) + ``` + ## Import iSCSI Target Luns can be imported using the `resource id`, e.g. @@ -220,6 +282,68 @@ def __init__(__self__, !> **Note:** Azure are officially [halting](https://learn.microsoft.com/en-us/azure/azure-vmware/attach-disk-pools-to-azure-vmware-solution-hosts?tabs=azure-cli) the preview of Azure Disk Pools, and it **will not** be made generally available. New customers will not be able to register the Microsoft.StoragePool resource provider on their subscription and deploy new Disk Pools. Existing subscriptions registered with Microsoft.StoragePool may continue to deploy and manage disk pools for the time being. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + zones=["1"], + sku_name="Basic_B1") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + create_option="Empty", + storage_account_type="Premium_LRS", + disk_size_gb=4, + max_shares=2, + zone="1") + example_service_principal = azuread.get_service_principal(display_name="StoragePool Resource Provider") + roles = [ + "Disk Pool Operator", + "Virtual Machine Contributor", + ] + example_assignment = [] + for range in [{"value": i} for i in range(0, len(roles))]: + example_assignment.append(azure.authorization.Assignment(f"exampleAssignment-{range['value']}", + principal_id=example_service_principal.id, + role_definition_name=roles[range["value"]], + scope=example_managed_disk.id)) + example_disk_pool_managed_disk_attachment = azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", + disk_pool_id=example_disk_pool.id, + managed_disk_id=example_managed_disk.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + example_disk_pool_iscsi_target = azure.compute.DiskPoolIscsiTarget("exampleDiskPoolIscsiTarget", + acl_mode="Dynamic", + disks_pool_id=example_disk_pool.id, + target_iqn="iqn.2021-11.com.microsoft:test", + opts=pulumi.ResourceOptions(depends_on=[example_disk_pool_managed_disk_attachment])) + example_disk_pool_iscsi_target_lun = azure.compute.DiskPoolIscsiTargetLun("exampleDiskPoolIscsiTargetLun", + iscsi_target_id=example_disk_pool_iscsi_target.id, + disk_pool_managed_disk_attachment_id=example_disk_pool_managed_disk_attachment.id) + ``` + ## Import iSCSI Target Luns can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/disk_pool_managed_disk_attachment.py b/sdk/python/pulumi_azure/compute/disk_pool_managed_disk_attachment.py index 73325ae3e4..d7ffac869c 100644 --- a/sdk/python/pulumi_azure/compute/disk_pool_managed_disk_attachment.py +++ b/sdk/python/pulumi_azure/compute/disk_pool_managed_disk_attachment.py @@ -148,6 +148,60 @@ def __init__(__self__, > **Note:** You must provide the StoragePool resource provider RBAC permissions to the disks that will be added to the disk pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + zones=["1"], + sku_name="Basic_B1") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + create_option="Empty", + storage_account_type="Premium_LRS", + disk_size_gb=4, + max_shares=2, + zone="1") + example_service_principal = azuread.get_service_principal(display_name="StoragePool Resource Provider") + roles = [ + "Disk Pool Operator", + "Virtual Machine Contributor", + ] + example_assignment = [] + for range in [{"value": i} for i in range(0, len(roles))]: + example_assignment.append(azure.authorization.Assignment(f"exampleAssignment-{range['value']}", + principal_id=example_service_principal.id, + role_definition_name=roles[range["value"]], + scope=example_managed_disk.id)) + example_disk_pool_managed_disk_attachment = azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", + disk_pool_id=example_disk_pool.id, + managed_disk_id=example_managed_disk.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Disks Pool Managed Disk Attachments can be imported using the `resource id`, e.g. @@ -180,6 +234,60 @@ def __init__(__self__, > **Note:** You must provide the StoragePool resource provider RBAC permissions to the disks that will be added to the disk pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="diskspool", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/read"], + name="Microsoft.StoragePool/diskPools", + ), + )]) + example_disk_pool = azure.compute.DiskPool("exampleDiskPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + zones=["1"], + sku_name="Basic_B1") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + create_option="Empty", + storage_account_type="Premium_LRS", + disk_size_gb=4, + max_shares=2, + zone="1") + example_service_principal = azuread.get_service_principal(display_name="StoragePool Resource Provider") + roles = [ + "Disk Pool Operator", + "Virtual Machine Contributor", + ] + example_assignment = [] + for range in [{"value": i} for i in range(0, len(roles))]: + example_assignment.append(azure.authorization.Assignment(f"exampleAssignment-{range['value']}", + principal_id=example_service_principal.id, + role_definition_name=roles[range["value"]], + scope=example_managed_disk.id)) + example_disk_pool_managed_disk_attachment = azure.compute.DiskPoolManagedDiskAttachment("exampleDiskPoolManagedDiskAttachment", + disk_pool_id=example_disk_pool.id, + managed_disk_id=example_managed_disk.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Disks Pool Managed Disk Attachments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/extension.py b/sdk/python/pulumi_azure/compute/extension.py index 7385caa450..511568d43a 100644 --- a/sdk/python/pulumi_azure/compute/extension.py +++ b/sdk/python/pulumi_azure/compute/extension.py @@ -35,6 +35,10 @@ def __init__(__self__, *, :param pulumi.Input[str] type: The type of extension, available types for a publisher can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. :param pulumi.Input[str] virtual_machine_id: The ID of the Virtual Machine. Changing this forces a new resource to be created :param pulumi.Input[bool] auto_upgrade_minor_version: Specifies if the platform deploys the latest minor version update to the `type_handler_version` specified. @@ -156,6 +160,10 @@ def type(self) -> pulumi.Input[str]: The type of extension, available types for a publisher can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` """ return pulumi.get(self, "type") @@ -343,6 +351,10 @@ def __init__(__self__, *, :param pulumi.Input[str] type: The type of extension, available types for a publisher can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. :param pulumi.Input[str] virtual_machine_id: The ID of the Virtual Machine. Changing this forces a new resource to be created """ @@ -559,6 +571,10 @@ def type(self) -> Optional[pulumi.Input[str]]: The type of extension, available types for a publisher can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` """ return pulumi.get(self, "type") @@ -618,6 +634,63 @@ def __init__(__self__, > **NOTE:** Custom Script Extensions require that the Azure Virtual Machine Guest Agent is running on the Virtual Machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_ssh_keys=[azure.compute.LinuxVirtualMachineAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_linux_virtual_machine.id, + publisher="Microsoft.Azure.Extensions", + type="CustomScript", + type_handler_version="2.0", + settings=\"\"\" { + "commandToExecute": "hostname && uptime" + } + \"\"\", + tags={ + "environment": "Production", + }) + ``` + ## Import Virtual Machine Extensions can be imported using the `resource id`, e.g. @@ -649,6 +722,10 @@ def __init__(__self__, :param pulumi.Input[str] type: The type of extension, available types for a publisher can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. :param pulumi.Input[str] virtual_machine_id: The ID of the Virtual Machine. Changing this forces a new resource to be created """ @@ -666,6 +743,63 @@ def __init__(__self__, > **NOTE:** Custom Script Extensions require that the Azure Virtual Machine Guest Agent is running on the Virtual Machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_ssh_keys=[azure.compute.LinuxVirtualMachineAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_linux_virtual_machine.id, + publisher="Microsoft.Azure.Extensions", + type="CustomScript", + type_handler_version="2.0", + settings=\"\"\" { + "commandToExecute": "hostname && uptime" + } + \"\"\", + tags={ + "environment": "Production", + }) + ``` + ## Import Virtual Machine Extensions can be imported using the `resource id`, e.g. @@ -790,6 +924,10 @@ def get(resource_name: str, :param pulumi.Input[str] type: The type of extension, available types for a publisher can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. :param pulumi.Input[str] virtual_machine_id: The ID of the Virtual Machine. Changing this forces a new resource to be created """ @@ -907,6 +1045,10 @@ def type(self) -> pulumi.Output[str]: The type of extension, available types for a publisher can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` """ return pulumi.get(self, "type") diff --git a/sdk/python/pulumi_azure/compute/gallery_application.py b/sdk/python/pulumi_azure/compute/gallery_application.py index b58a82eec8..974b75b8b1 100644 --- a/sdk/python/pulumi_azure/compute/gallery_application.py +++ b/sdk/python/pulumi_azure/compute/gallery_application.py @@ -446,6 +446,22 @@ def __init__(__self__, """ Manages a Gallery Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_gallery_application = azure.compute.GalleryApplication("exampleGalleryApplication", + gallery_id=example_shared_image_gallery.id, + location=example_resource_group.location, + supported_os_type="Linux") + ``` + ## Import Gallery Applications can be imported using the `resource id`, e.g. @@ -476,6 +492,22 @@ def __init__(__self__, """ Manages a Gallery Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_gallery_application = azure.compute.GalleryApplication("exampleGalleryApplication", + gallery_id=example_shared_image_gallery.id, + location=example_resource_group.location, + supported_os_type="Linux") + ``` + ## Import Gallery Applications can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/gallery_application_version.py b/sdk/python/pulumi_azure/compute/gallery_application_version.py index 936f644a7d..ec6ac983d5 100644 --- a/sdk/python/pulumi_azure/compute/gallery_application_version.py +++ b/sdk/python/pulumi_azure/compute/gallery_application_version.py @@ -454,6 +454,49 @@ def __init__(__self__, """ Manages a Gallery Application Version. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_gallery_application = azure.compute.GalleryApplication("exampleGalleryApplication", + gallery_id=example_shared_image_gallery.id, + location=example_resource_group.location, + supported_os_type="Linux") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="blob") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source_content="[scripts file content]") + example_gallery_application_version = azure.compute.GalleryApplicationVersion("exampleGalleryApplicationVersion", + gallery_application_id=example_gallery_application.id, + location=example_gallery_application.location, + manage_action=azure.compute.GalleryApplicationVersionManageActionArgs( + install="[install command]", + remove="[remove command]", + ), + source=azure.compute.GalleryApplicationVersionSourceArgs( + media_link=example_blob.id, + ), + target_regions=[azure.compute.GalleryApplicationVersionTargetRegionArgs( + name=example_gallery_application.location, + regional_replica_count=1, + )]) + ``` + ## Import Gallery Application Versions can be imported using the `resource id`, e.g. @@ -484,6 +527,49 @@ def __init__(__self__, """ Manages a Gallery Application Version. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_gallery_application = azure.compute.GalleryApplication("exampleGalleryApplication", + gallery_id=example_shared_image_gallery.id, + location=example_resource_group.location, + supported_os_type="Linux") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="blob") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source_content="[scripts file content]") + example_gallery_application_version = azure.compute.GalleryApplicationVersion("exampleGalleryApplicationVersion", + gallery_application_id=example_gallery_application.id, + location=example_gallery_application.location, + manage_action=azure.compute.GalleryApplicationVersionManageActionArgs( + install="[install command]", + remove="[remove command]", + ), + source=azure.compute.GalleryApplicationVersionSourceArgs( + media_link=example_blob.id, + ), + target_regions=[azure.compute.GalleryApplicationVersionTargetRegionArgs( + name=example_gallery_application.location, + regional_replica_count=1, + )]) + ``` + ## Import Gallery Application Versions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/get_availability_set.py b/sdk/python/pulumi_azure/compute/get_availability_set.py index c6d199b837..431997ea85 100644 --- a/sdk/python/pulumi_azure/compute/get_availability_set.py +++ b/sdk/python/pulumi_azure/compute/get_availability_set.py @@ -128,6 +128,17 @@ def get_availability_set(name: Optional[str] = None, """ Use this data source to access information about an existing Availability Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_availability_set(name="tf-appsecuritygroup", + resource_group_name="my-resource-group") + pulumi.export("availabilitySetId", example.id) + ``` + :param str name: The name of the Availability Set. :param str resource_group_name: The name of the resource group in which the Availability Set exists. @@ -156,6 +167,17 @@ def get_availability_set_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Availability Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_availability_set(name="tf-appsecuritygroup", + resource_group_name="my-resource-group") + pulumi.export("availabilitySetId", example.id) + ``` + :param str name: The name of the Availability Set. :param str resource_group_name: The name of the resource group in which the Availability Set exists. diff --git a/sdk/python/pulumi_azure/compute/get_bastion_host.py b/sdk/python/pulumi_azure/compute/get_bastion_host.py index b034f124f1..fbdcc0bc9f 100644 --- a/sdk/python/pulumi_azure/compute/get_bastion_host.py +++ b/sdk/python/pulumi_azure/compute/get_bastion_host.py @@ -204,6 +204,17 @@ def get_bastion_host(name: Optional[str] = None, """ Use this data source to access information about an existing Bastion Host. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_bastion_host(name="existing-bastion", + resource_group_name="existing-resources") + pulumi.export("id", example.id) + ``` + :param str name: The name of the Bastion Host. :param str resource_group_name: The name of the Resource Group where the Bastion Host exists. @@ -238,6 +249,17 @@ def get_bastion_host_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Bastion Host. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_bastion_host(name="existing-bastion", + resource_group_name="existing-resources") + pulumi.export("id", example.id) + ``` + :param str name: The name of the Bastion Host. :param str resource_group_name: The name of the Resource Group where the Bastion Host exists. diff --git a/sdk/python/pulumi_azure/compute/get_confidential_ledger.py b/sdk/python/pulumi_azure/compute/get_confidential_ledger.py index e36ac8b8d9..20bdf11ad6 100644 --- a/sdk/python/pulumi_azure/compute/get_confidential_ledger.py +++ b/sdk/python/pulumi_azure/compute/get_confidential_ledger.py @@ -147,6 +147,17 @@ def get_confidential_ledger(name: Optional[str] = None, """ Gets information about an existing Confidential Ledger. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.compute.get_confidential_ledger(name="example-ledger", + resource_group_name="example-resources") + pulumi.export("ledgerEndpoint", current.ledger_endpoint) + ``` + :param str name: Specifies the name of this Confidential Ledger. :param str resource_group_name: Specifies the name of the Resource Group where this Confidential Ledger exists. @@ -177,6 +188,17 @@ def get_confidential_ledger_output(name: Optional[pulumi.Input[str]] = None, """ Gets information about an existing Confidential Ledger. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.compute.get_confidential_ledger(name="example-ledger", + resource_group_name="example-resources") + pulumi.export("ledgerEndpoint", current.ledger_endpoint) + ``` + :param str name: Specifies the name of this Confidential Ledger. :param str resource_group_name: Specifies the name of the Resource Group where this Confidential Ledger exists. diff --git a/sdk/python/pulumi_azure/compute/get_dedicated_host.py b/sdk/python/pulumi_azure/compute/get_dedicated_host.py index dcaa3159cd..8996a534fb 100644 --- a/sdk/python/pulumi_azure/compute/get_dedicated_host.py +++ b/sdk/python/pulumi_azure/compute/get_dedicated_host.py @@ -102,6 +102,18 @@ def get_dedicated_host(dedicated_host_group_name: Optional[str] = None, """ Use this data source to access information about an existing Dedicated Host. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_dedicated_host(name="example-host", + dedicated_host_group_name="example-host-group", + resource_group_name="example-resources") + pulumi.export("dedicatedHostId", example.id) + ``` + :param str dedicated_host_group_name: Specifies the name of the Dedicated Host Group the Dedicated Host is located in. :param str name: Specifies the name of the Dedicated Host. @@ -131,6 +143,18 @@ def get_dedicated_host_output(dedicated_host_group_name: Optional[pulumi.Input[s """ Use this data source to access information about an existing Dedicated Host. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_dedicated_host(name="example-host", + dedicated_host_group_name="example-host-group", + resource_group_name="example-resources") + pulumi.export("dedicatedHostId", example.id) + ``` + :param str dedicated_host_group_name: Specifies the name of the Dedicated Host Group the Dedicated Host is located in. :param str name: Specifies the name of the Dedicated Host. diff --git a/sdk/python/pulumi_azure/compute/get_dedicated_host_group.py b/sdk/python/pulumi_azure/compute/get_dedicated_host_group.py index cdd16f648c..e9437de6c4 100644 --- a/sdk/python/pulumi_azure/compute/get_dedicated_host_group.py +++ b/sdk/python/pulumi_azure/compute/get_dedicated_host_group.py @@ -128,6 +128,17 @@ def get_dedicated_host_group(name: Optional[str] = None, """ Use this data source to access information about an existing Dedicated Host Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_dedicated_host_group(name="example-dedicated-host-group", + resource_group_name="example-rg") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the Dedicated Host Group. :param str resource_group_name: Specifies the name of the resource group the Dedicated Host Group is located in. @@ -156,6 +167,17 @@ def get_dedicated_host_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Dedicated Host Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_dedicated_host_group(name="example-dedicated-host-group", + resource_group_name="example-rg") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the Dedicated Host Group. :param str resource_group_name: Specifies the name of the resource group the Dedicated Host Group is located in. diff --git a/sdk/python/pulumi_azure/compute/get_disk_access.py b/sdk/python/pulumi_azure/compute/get_disk_access.py index 46d70d6675..dc0dd55e9f 100644 --- a/sdk/python/pulumi_azure/compute/get_disk_access.py +++ b/sdk/python/pulumi_azure/compute/get_disk_access.py @@ -77,6 +77,17 @@ def get_disk_access(name: Optional[str] = None, """ Use this data source to access information about an existing Disk Access. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_disk_access(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Disk Access. :param str resource_group_name: The name of the Resource Group where the Disk Access exists. @@ -101,6 +112,17 @@ def get_disk_access_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Disk Access. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_disk_access(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Disk Access. :param str resource_group_name: The name of the Resource Group where the Disk Access exists. diff --git a/sdk/python/pulumi_azure/compute/get_disk_encryption_set.py b/sdk/python/pulumi_azure/compute/get_disk_encryption_set.py index b8bab13905..adaad309a1 100644 --- a/sdk/python/pulumi_azure/compute/get_disk_encryption_set.py +++ b/sdk/python/pulumi_azure/compute/get_disk_encryption_set.py @@ -129,6 +129,17 @@ def get_disk_encryption_set(name: Optional[str] = None, """ Use this data source to access information about an existing Disk Encryption Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.compute.get_disk_encryption_set(name="example-des", + resource_group_name="example-resources") + pulumi.export("id", existing.id) + ``` + :param str name: The name of the existing Disk Encryption Set. :param str resource_group_name: The name of the Resource Group where the Disk Encryption Set exists. @@ -157,6 +168,17 @@ def get_disk_encryption_set_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Disk Encryption Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.compute.get_disk_encryption_set(name="example-des", + resource_group_name="example-resources") + pulumi.export("id", existing.id) + ``` + :param str name: The name of the existing Disk Encryption Set. :param str resource_group_name: The name of the Resource Group where the Disk Encryption Set exists. diff --git a/sdk/python/pulumi_azure/compute/get_image.py b/sdk/python/pulumi_azure/compute/get_image.py index 9c4f5d52c7..799f369785 100644 --- a/sdk/python/pulumi_azure/compute/get_image.py +++ b/sdk/python/pulumi_azure/compute/get_image.py @@ -152,6 +152,17 @@ def get_image(name: Optional[str] = None, """ Use this data source to access information about an existing Image. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + search = azure.compute.get_image(name="search-api", + resource_group_name="packerimages") + pulumi.export("imageId", search.id) + ``` + :param str name: The name of the Image. :param str name_regex: Regex pattern of the image to match. @@ -188,6 +199,17 @@ def get_image_output(name: Optional[pulumi.Input[Optional[str]]] = None, """ Use this data source to access information about an existing Image. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + search = azure.compute.get_image(name="search-api", + resource_group_name="packerimages") + pulumi.export("imageId", search.id) + ``` + :param str name: The name of the Image. :param str name_regex: Regex pattern of the image to match. diff --git a/sdk/python/pulumi_azure/compute/get_images.py b/sdk/python/pulumi_azure/compute/get_images.py index 0e51db4eb9..9c7c575c06 100644 --- a/sdk/python/pulumi_azure/compute/get_images.py +++ b/sdk/python/pulumi_azure/compute/get_images.py @@ -81,6 +81,15 @@ def get_images(resource_group_name: Optional[str] = None, """ Use this data source to access information about existing Images within a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_images(resource_group_name="example-resources") + ``` + :param str resource_group_name: The name of the Resource Group in which the Image exists. :param Mapping[str, str] tags_filter: A mapping of tags to filter the list of images against. @@ -105,6 +114,15 @@ def get_images_output(resource_group_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about existing Images within a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_images(resource_group_name="example-resources") + ``` + :param str resource_group_name: The name of the Resource Group in which the Image exists. :param Mapping[str, str] tags_filter: A mapping of tags to filter the list of images against. diff --git a/sdk/python/pulumi_azure/compute/get_managed_disk.py b/sdk/python/pulumi_azure/compute/get_managed_disk.py index f7527b8132..904bfc5cc8 100644 --- a/sdk/python/pulumi_azure/compute/get_managed_disk.py +++ b/sdk/python/pulumi_azure/compute/get_managed_disk.py @@ -258,6 +258,17 @@ def get_managed_disk(name: Optional[str] = None, """ Use this data source to access information about an existing Managed Disk. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.compute.get_managed_disk(name="example-datadisk", + resource_group_name="example-resources") + pulumi.export("id", existing.id) + ``` + :param str name: Specifies the name of the Managed Disk. :param str resource_group_name: Specifies the name of the Resource Group where this Managed Disk exists. @@ -297,6 +308,17 @@ def get_managed_disk_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Managed Disk. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.compute.get_managed_disk(name="example-datadisk", + resource_group_name="example-resources") + pulumi.export("id", existing.id) + ``` + :param str name: Specifies the name of the Managed Disk. :param str resource_group_name: Specifies the name of the Resource Group where this Managed Disk exists. diff --git a/sdk/python/pulumi_azure/compute/get_orchestrated_virtual_machine_scale_set.py b/sdk/python/pulumi_azure/compute/get_orchestrated_virtual_machine_scale_set.py index 44facd4802..ff4eeac53a 100644 --- a/sdk/python/pulumi_azure/compute/get_orchestrated_virtual_machine_scale_set.py +++ b/sdk/python/pulumi_azure/compute/get_orchestrated_virtual_machine_scale_set.py @@ -108,6 +108,17 @@ def get_orchestrated_virtual_machine_scale_set(name: Optional[str] = None, """ Use this data source to access information about an existing Orchestrated Virtual Machine Scale Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_orchestrated_virtual_machine_scale_set(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Orchestrated Virtual Machine Scale Set. :param str resource_group_name: The name of the Resource Group where the Orchestrated Virtual Machine Scale Set exists. @@ -134,6 +145,17 @@ def get_orchestrated_virtual_machine_scale_set_output(name: Optional[pulumi.Inpu """ Use this data source to access information about an existing Orchestrated Virtual Machine Scale Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_orchestrated_virtual_machine_scale_set(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Orchestrated Virtual Machine Scale Set. :param str resource_group_name: The name of the Resource Group where the Orchestrated Virtual Machine Scale Set exists. diff --git a/sdk/python/pulumi_azure/compute/get_platform_image.py b/sdk/python/pulumi_azure/compute/get_platform_image.py index d59ff9dde0..0a295e3019 100644 --- a/sdk/python/pulumi_azure/compute/get_platform_image.py +++ b/sdk/python/pulumi_azure/compute/get_platform_image.py @@ -98,6 +98,19 @@ def get_platform_image(location: Optional[str] = None, """ Use this data source to access information about a Platform Image. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_platform_image(location="West Europe", + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts") + pulumi.export("id", example.id) + ``` + :param str location: Specifies the Location to pull information about this Platform Image from. :param str offer: Specifies the Offer associated with the Platform Image. @@ -133,6 +146,19 @@ def get_platform_image_output(location: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about a Platform Image. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_platform_image(location="West Europe", + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts") + pulumi.export("id", example.id) + ``` + :param str location: Specifies the Location to pull information about this Platform Image from. :param str offer: Specifies the Offer associated with the Platform Image. diff --git a/sdk/python/pulumi_azure/compute/get_shared_image.py b/sdk/python/pulumi_azure/compute/get_shared_image.py index a624c22fc0..7e01cd8eb6 100644 --- a/sdk/python/pulumi_azure/compute/get_shared_image.py +++ b/sdk/python/pulumi_azure/compute/get_shared_image.py @@ -223,6 +223,17 @@ def get_shared_image(gallery_name: Optional[str] = None, """ Use this data source to access information about an existing Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image(gallery_name="my-image-gallery", + name="my-image", + resource_group_name="example-resources") + ``` + :param str gallery_name: The name of the Shared Image Gallery in which the Shared Image exists. :param str name: The name of the Shared Image. @@ -262,6 +273,17 @@ def get_shared_image_output(gallery_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image(gallery_name="my-image-gallery", + name="my-image", + resource_group_name="example-resources") + ``` + :param str gallery_name: The name of the Shared Image Gallery in which the Shared Image exists. :param str name: The name of the Shared Image. diff --git a/sdk/python/pulumi_azure/compute/get_shared_image_gallery.py b/sdk/python/pulumi_azure/compute/get_shared_image_gallery.py index 91aaa8c3bc..732a530a27 100644 --- a/sdk/python/pulumi_azure/compute/get_shared_image_gallery.py +++ b/sdk/python/pulumi_azure/compute/get_shared_image_gallery.py @@ -113,6 +113,16 @@ def get_shared_image_gallery(name: Optional[str] = None, """ Use this data source to access information about an existing Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image_gallery(name="my-image-gallery", + resource_group_name="example-resources") + ``` + :param str name: The name of the Shared Image Gallery. :param str resource_group_name: The name of the Resource Group in which the Shared Image Gallery exists. @@ -140,6 +150,16 @@ def get_shared_image_gallery_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image_gallery(name="my-image-gallery", + resource_group_name="example-resources") + ``` + :param str name: The name of the Shared Image Gallery. :param str resource_group_name: The name of the Resource Group in which the Shared Image Gallery exists. diff --git a/sdk/python/pulumi_azure/compute/get_shared_image_version.py b/sdk/python/pulumi_azure/compute/get_shared_image_version.py index a22080a0ff..732bdcb5c5 100644 --- a/sdk/python/pulumi_azure/compute/get_shared_image_version.py +++ b/sdk/python/pulumi_azure/compute/get_shared_image_version.py @@ -186,6 +186,18 @@ def get_shared_image_version(gallery_name: Optional[str] = None, """ Use this data source to access information about an existing Version of a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image_version(gallery_name="my-image-gallery", + image_name="my-image", + name="1.0.0", + resource_group_name="example-resources") + ``` + :param str gallery_name: The name of the Shared Image Gallery in which the Shared Image exists. :param str image_name: The name of the Shared Image in which this Version exists. @@ -232,6 +244,18 @@ def get_shared_image_version_output(gallery_name: Optional[pulumi.Input[str]] = """ Use this data source to access information about an existing Version of a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image_version(gallery_name="my-image-gallery", + image_name="my-image", + name="1.0.0", + resource_group_name="example-resources") + ``` + :param str gallery_name: The name of the Shared Image Gallery in which the Shared Image exists. :param str image_name: The name of the Shared Image in which this Version exists. diff --git a/sdk/python/pulumi_azure/compute/get_shared_image_versions.py b/sdk/python/pulumi_azure/compute/get_shared_image_versions.py index d4cb669ab0..ca528dd85b 100644 --- a/sdk/python/pulumi_azure/compute/get_shared_image_versions.py +++ b/sdk/python/pulumi_azure/compute/get_shared_image_versions.py @@ -101,6 +101,17 @@ def get_shared_image_versions(gallery_name: Optional[str] = None, """ Use this data source to access information about existing Versions of a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image_versions(gallery_name="my-image-gallery", + image_name="my-image", + resource_group_name="example-resources") + ``` + :param str gallery_name: The name of the Shared Image in which the Shared Image exists. :param str image_name: The name of the Shared Image in which this Version exists. @@ -133,6 +144,17 @@ def get_shared_image_versions_output(gallery_name: Optional[pulumi.Input[str]] = """ Use this data source to access information about existing Versions of a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_shared_image_versions(gallery_name="my-image-gallery", + image_name="my-image", + resource_group_name="example-resources") + ``` + :param str gallery_name: The name of the Shared Image in which the Shared Image exists. :param str image_name: The name of the Shared Image in which this Version exists. diff --git a/sdk/python/pulumi_azure/compute/get_snapshot.py b/sdk/python/pulumi_azure/compute/get_snapshot.py index 35f97ed80b..7145aa4227 100644 --- a/sdk/python/pulumi_azure/compute/get_snapshot.py +++ b/sdk/python/pulumi_azure/compute/get_snapshot.py @@ -165,6 +165,16 @@ def get_snapshot(name: Optional[str] = None, """ Use this data source to access information about an existing Snapshot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_snapshot(name="my-snapshot", + resource_group_name="my-resource-group") + ``` + :param str name: Specifies the name of the Snapshot. :param str resource_group_name: Specifies the name of the resource group the Snapshot is located in. @@ -197,6 +207,16 @@ def get_snapshot_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Snapshot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_snapshot(name="my-snapshot", + resource_group_name="my-resource-group") + ``` + :param str name: Specifies the name of the Snapshot. :param str resource_group_name: Specifies the name of the resource group the Snapshot is located in. diff --git a/sdk/python/pulumi_azure/compute/get_ssh_public_key.py b/sdk/python/pulumi_azure/compute/get_ssh_public_key.py index 1bcd1f8eeb..ebcb9a553b 100644 --- a/sdk/python/pulumi_azure/compute/get_ssh_public_key.py +++ b/sdk/python/pulumi_azure/compute/get_ssh_public_key.py @@ -90,6 +90,17 @@ def get_ssh_public_key(name: Optional[str] = None, """ Use this data source to access information about an existing SSH Public Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_ssh_public_key(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this SSH Public Key. :param str resource_group_name: The name of the Resource Group where the SSH Public Key exists. @@ -118,6 +129,17 @@ def get_ssh_public_key_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing SSH Public Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_ssh_public_key(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this SSH Public Key. :param str resource_group_name: The name of the Resource Group where the SSH Public Key exists. diff --git a/sdk/python/pulumi_azure/compute/get_virtual_machine.py b/sdk/python/pulumi_azure/compute/get_virtual_machine.py index b2797bf1e2..2dff170af7 100644 --- a/sdk/python/pulumi_azure/compute/get_virtual_machine.py +++ b/sdk/python/pulumi_azure/compute/get_virtual_machine.py @@ -150,6 +150,17 @@ def get_virtual_machine(name: Optional[str] = None, """ Use this data source to access information about an existing Virtual Machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_virtual_machine(name="production", + resource_group_name="networking") + pulumi.export("virtualMachineId", example.id) + ``` + :param str name: Specifies the name of the Virtual Machine. :param str resource_group_name: Specifies the name of the resource group the Virtual Machine is located in. @@ -180,6 +191,17 @@ def get_virtual_machine_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Virtual Machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_virtual_machine(name="production", + resource_group_name="networking") + pulumi.export("virtualMachineId", example.id) + ``` + :param str name: Specifies the name of the Virtual Machine. :param str resource_group_name: Specifies the name of the resource group the Virtual Machine is located in. diff --git a/sdk/python/pulumi_azure/compute/get_virtual_machine_scale_set.py b/sdk/python/pulumi_azure/compute/get_virtual_machine_scale_set.py index a763d82ecb..a3d04fa126 100644 --- a/sdk/python/pulumi_azure/compute/get_virtual_machine_scale_set.py +++ b/sdk/python/pulumi_azure/compute/get_virtual_machine_scale_set.py @@ -120,6 +120,17 @@ def get_virtual_machine_scale_set(name: Optional[str] = None, """ Use this data source to access information about an existing Virtual Machine Scale Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_virtual_machine_scale_set(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Virtual Machine Scale Set. :param str resource_group_name: The name of the Resource Group where the Virtual Machine Scale Set exists. @@ -147,6 +158,17 @@ def get_virtual_machine_scale_set_output(name: Optional[pulumi.Input[str]] = Non """ Use this data source to access information about an existing Virtual Machine Scale Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.get_virtual_machine_scale_set(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Virtual Machine Scale Set. :param str resource_group_name: The name of the Resource Group where the Virtual Machine Scale Set exists. diff --git a/sdk/python/pulumi_azure/compute/linux_virtual_machine.py b/sdk/python/pulumi_azure/compute/linux_virtual_machine.py index c370b64cb2..c6ed56cf11 100644 --- a/sdk/python/pulumi_azure/compute/linux_virtual_machine.py +++ b/sdk/python/pulumi_azure/compute/linux_virtual_machine.py @@ -2147,6 +2147,53 @@ def __init__(__self__, > In this release there's a known issue where the `public_ip_address` and `public_ip_addresses` fields may not be fully populated for Dynamic Public IP's. + ## Example Usage + + This example provisions a basic Linux Virtual Machine on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_ssh_keys=[azure.compute.LinuxVirtualMachineAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + ``` + ## Import Linux Virtual Machines can be imported using the `resource id`, e.g. @@ -2256,6 +2303,53 @@ def __init__(__self__, > In this release there's a known issue where the `public_ip_address` and `public_ip_addresses` fields may not be fully populated for Dynamic Public IP's. + ## Example Usage + + This example provisions a basic Linux Virtual Machine on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_ssh_keys=[azure.compute.LinuxVirtualMachineAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + ``` + ## Import Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/linux_virtual_machine_scale_set.py b/sdk/python/pulumi_azure/compute/linux_virtual_machine_scale_set.py index 2e52e02b46..e941987d13 100644 --- a/sdk/python/pulumi_azure/compute/linux_virtual_machine_scale_set.py +++ b/sdk/python/pulumi_azure/compute/linux_virtual_machine_scale_set.py @@ -2456,6 +2456,55 @@ def __init__(__self__, > **NOTE:** This provider will automatically update & reimage the nodes in the Scale Set (if Required) during an Update - this behaviour can be configured using the `features` setting within the Provider block. + ## Example Usage + + This example provisions a basic Linux Virtual Machine Scale Set on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + first_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_username="adminuser", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="adminuser", + public_key=first_public_key, + )], + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=internal.id, + )], + )]) + ``` + ## Import Linux Virtual Machine Scale Sets can be imported using the `resource id`, e.g. @@ -2570,6 +2619,55 @@ def __init__(__self__, > **NOTE:** This provider will automatically update & reimage the nodes in the Scale Set (if Required) during an Update - this behaviour can be configured using the `features` setting within the Provider block. + ## Example Usage + + This example provisions a basic Linux Virtual Machine Scale Set on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + first_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_username="adminuser", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="adminuser", + public_key=first_public_key, + )], + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=internal.id, + )], + )]) + ``` + ## Import Linux Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/managed_disk.py b/sdk/python/pulumi_azure/compute/managed_disk.py index a39bf31f1f..d605265046 100644 --- a/sdk/python/pulumi_azure/compute/managed_disk.py +++ b/sdk/python/pulumi_azure/compute/managed_disk.py @@ -1599,6 +1599,50 @@ def __init__(__self__, Manages a managed disk. ## Example Usage + ### With Create Empty + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1, + tags={ + "environment": "staging", + }) + ``` + ### With Create Copy + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + source = azure.compute.ManagedDisk("source", + location=example.location, + resource_group_name=example.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1, + tags={ + "environment": "staging", + }) + copy = azure.compute.ManagedDisk("copy", + location=example.location, + resource_group_name=example.name, + storage_account_type="Standard_LRS", + create_option="Copy", + source_resource_id=source.id, + disk_size_gb=1, + tags={ + "environment": "staging", + }) + ``` ## Import @@ -1689,6 +1733,50 @@ def __init__(__self__, Manages a managed disk. ## Example Usage + ### With Create Empty + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1, + tags={ + "environment": "staging", + }) + ``` + ### With Create Copy + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + source = azure.compute.ManagedDisk("source", + location=example.location, + resource_group_name=example.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1, + tags={ + "environment": "staging", + }) + copy = azure.compute.ManagedDisk("copy", + location=example.location, + resource_group_name=example.name, + storage_account_type="Standard_LRS", + create_option="Copy", + source_resource_id=source.id, + disk_size_gb=1, + tags={ + "environment": "staging", + }) + ``` ## Import diff --git a/sdk/python/pulumi_azure/compute/managed_disk_sas_token.py b/sdk/python/pulumi_azure/compute/managed_disk_sas_token.py index 817f295fdb..3547864676 100644 --- a/sdk/python/pulumi_azure/compute/managed_disk_sas_token.py +++ b/sdk/python/pulumi_azure/compute/managed_disk_sas_token.py @@ -218,6 +218,25 @@ def __init__(__self__, With the help of this resource, data from the disk can be copied from managed disk to a storage blob or to some other system without the need of azcopy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="West Europe") + test_managed_disk = azure.compute.ManagedDisk("testManagedDisk", + location=test_resource_group.location, + resource_group_name=test_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1) + test_managed_disk_sas_token = azure.compute.ManagedDiskSasToken("testManagedDiskSasToken", + managed_disk_id=test_managed_disk.id, + duration_in_seconds=300, + access_level="Read") + ``` + ## Import Disk SAS Token can be imported using the `resource id`, e.g. @@ -250,6 +269,25 @@ def __init__(__self__, With the help of this resource, data from the disk can be copied from managed disk to a storage blob or to some other system without the need of azcopy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="West Europe") + test_managed_disk = azure.compute.ManagedDisk("testManagedDisk", + location=test_resource_group.location, + resource_group_name=test_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1) + test_managed_disk_sas_token = azure.compute.ManagedDiskSasToken("testManagedDiskSasToken", + managed_disk_id=test_managed_disk.id, + duration_in_seconds=300, + access_level="Read") + ``` + ## Import Disk SAS Token can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/orchestrated_virtual_machine_scale_set.py b/sdk/python/pulumi_azure/compute/orchestrated_virtual_machine_scale_set.py index c09c0bfe81..3af50915e4 100644 --- a/sdk/python/pulumi_azure/compute/orchestrated_virtual_machine_scale_set.py +++ b/sdk/python/pulumi_azure/compute/orchestrated_virtual_machine_scale_set.py @@ -1498,6 +1498,20 @@ def __init__(__self__, > **NOTE:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_orchestrated_virtual_machine_scale_set = azure.compute.OrchestratedVirtualMachineScaleSet("exampleOrchestratedVirtualMachineScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + platform_fault_domain_count=1, + zones=["1"]) + ``` + ## Import An Orchestrated Virtual Machine Scale Set can be imported using the `resource id`, e.g. @@ -1572,6 +1586,20 @@ def __init__(__self__, > **NOTE:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_orchestrated_virtual_machine_scale_set = azure.compute.OrchestratedVirtualMachineScaleSet("exampleOrchestratedVirtualMachineScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + platform_fault_domain_count=1, + zones=["1"]) + ``` + ## Import An Orchestrated Virtual Machine Scale Set can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/outputs.py b/sdk/python/pulumi_azure/compute/outputs.py index 8fa3fd48cb..ab2182c073 100644 --- a/sdk/python/pulumi_azure/compute/outputs.py +++ b/sdk/python/pulumi_azure/compute/outputs.py @@ -7513,6 +7513,32 @@ def __init__(__self__, *, """ :param str type: Specifies the identity type to be assigned to the scale set. Allowable values are `SystemAssigned` and `UserAssigned`. For the `SystemAssigned` identity the scale set's Service Principal ID (SPN) can be retrieved after the scale set has been created. See [documentation](https://docs.microsoft.com/azure/active-directory/managed-service-identity/overview) for more information. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. :param Sequence[str] identity_ids: Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.ScaleSet("example", + resource_group_name=azurerm_resource_group["example"]["name"], + location=azurerm_resource_group["example"]["location"], + sku=azure.compute.ScaleSetSkuArgs( + name=var["vm_sku"], + tier="Standard", + capacity=var["instance_count"], + ), + identity=azure.compute.ScaleSetIdentityArgs( + type="SystemAssigned", + ), + extensions=[azure.compute.ScaleSetExtensionArgs( + name="MSILinuxExtension", + publisher="Microsoft.ManagedIdentity", + type="ManagedIdentityExtensionForLinux", + type_handler_version="1.0", + settings="{\\"port\\": 50342}", + )]) + # ... + pulumi.export("principalId", example.identity.principal_id) + ``` """ ScaleSetIdentity._configure( lambda key, value: pulumi.set(__self__, key, value), @@ -7554,6 +7580,32 @@ def type(self) -> str: def identity_ids(self) -> Optional[Sequence[str]]: """ Specifies a list of user managed identity ids to be assigned to the VMSS. Required if `type` is `UserAssigned`. + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.ScaleSet("example", + resource_group_name=azurerm_resource_group["example"]["name"], + location=azurerm_resource_group["example"]["location"], + sku=azure.compute.ScaleSetSkuArgs( + name=var["vm_sku"], + tier="Standard", + capacity=var["instance_count"], + ), + identity=azure.compute.ScaleSetIdentityArgs( + type="SystemAssigned", + ), + extensions=[azure.compute.ScaleSetExtensionArgs( + name="MSILinuxExtension", + publisher="Microsoft.ManagedIdentity", + type="ManagedIdentityExtensionForLinux", + type_handler_version="1.0", + settings="{\\"port\\": 50342}", + )]) + # ... + pulumi.export("principalId", example.identity.principal_id) + ``` """ return pulumi.get(self, "identity_ids") diff --git a/sdk/python/pulumi_azure/compute/packet_capture.py b/sdk/python/pulumi_azure/compute/packet_capture.py index a9d300977e..159b0ab7a5 100644 --- a/sdk/python/pulumi_azure/compute/packet_capture.py +++ b/sdk/python/pulumi_azure/compute/packet_capture.py @@ -379,6 +379,79 @@ def __init__(__self__, """ Configures Network Packet Capturing against a Virtual Machine using a Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + vm_size="Standard_F2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="osdisk", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="pctest-vm", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_virtual_machine.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_packet_capture = azure.compute.PacketCapture("examplePacketCapture", + network_watcher_id=example_network_watcher.id, + virtual_machine_id=example_virtual_machine.id, + storage_location=azure.compute.PacketCaptureStorageLocationArgs( + storage_account_id=example_account.id, + ), + opts=pulumi.ResourceOptions(depends_on=[example_extension])) + ``` + + > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `compute.Extension` resource. + ## Import Virtual Machine Packet Captures can be imported using the `resource id`, e.g. @@ -407,6 +480,79 @@ def __init__(__self__, """ Configures Network Packet Capturing against a Virtual Machine using a Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + vm_size="Standard_F2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="osdisk", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="pctest-vm", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_virtual_machine.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_packet_capture = azure.compute.PacketCapture("examplePacketCapture", + network_watcher_id=example_network_watcher.id, + virtual_machine_id=example_virtual_machine.id, + storage_location=azure.compute.PacketCaptureStorageLocationArgs( + storage_account_id=example_account.id, + ), + opts=pulumi.ResourceOptions(depends_on=[example_extension])) + ``` + + > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `compute.Extension` resource. + ## Import Virtual Machine Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/scale_set.py b/sdk/python/pulumi_azure/compute/scale_set.py index 963e87b0c3..d4d0712b31 100644 --- a/sdk/python/pulumi_azure/compute/scale_set.py +++ b/sdk/python/pulumi_azure/compute/scale_set.py @@ -1187,6 +1187,192 @@ def __init__(__self__, Manages a virtual machine scale set. ## Example Usage + ### With Managed Disks (Recommended) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + domain_name_label=example_resource_group.name, + tags={ + "environment": "staging", + }) + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + bpepool = azure.lb.BackendAddressPool("bpepool", loadbalancer_id=example_load_balancer.id) + lbnatpool = azure.lb.NatPool("lbnatpool", + resource_group_name=example_resource_group.name, + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port_start=50000, + frontend_port_end=50119, + backend_port=22, + frontend_ip_configuration_name="PublicIPAddress") + example_probe = azure.lb.Probe("exampleProbe", + loadbalancer_id=example_load_balancer.id, + protocol="Http", + request_path="/health", + port=8080) + example_scale_set = azure.compute.ScaleSet("exampleScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automatic_os_upgrade=True, + upgrade_policy_mode="Rolling", + rolling_upgrade_policy=azure.compute.ScaleSetRollingUpgradePolicyArgs( + max_batch_instance_percent=20, + max_unhealthy_instance_percent=20, + max_unhealthy_upgraded_instance_percent=5, + pause_time_between_batches="PT0S", + ), + health_probe_id=example_probe.id, + sku=azure.compute.ScaleSetSkuArgs( + name="Standard_F2", + tier="Standard", + capacity=2, + ), + storage_profile_image_reference=azure.compute.ScaleSetStorageProfileImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_profile_os_disk=azure.compute.ScaleSetStorageProfileOsDiskArgs( + name="", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + storage_profile_data_disks=[azure.compute.ScaleSetStorageProfileDataDiskArgs( + lun=0, + caching="ReadWrite", + create_option="Empty", + disk_size_gb=10, + )], + os_profile=azure.compute.ScaleSetOsProfileArgs( + computer_name_prefix="testvm", + admin_username="myadmin", + ), + os_profile_linux_config=azure.compute.ScaleSetOsProfileLinuxConfigArgs( + disable_password_authentication=True, + ssh_keys=[azure.compute.ScaleSetOsProfileLinuxConfigSshKeyArgs( + path="/home/myadmin/.ssh/authorized_keys", + key_data=(lambda path: open(path).read())("~/.ssh/demo_key.pub"), + )], + ), + network_profiles=[azure.compute.ScaleSetNetworkProfileArgs( + name="mynetworkprofile", + primary=True, + ip_configurations=[azure.compute.ScaleSetNetworkProfileIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + load_balancer_backend_address_pool_ids=[bpepool.id], + load_balancer_inbound_nat_rules_ids=[lbnatpool.id], + )], + )], + tags={ + "environment": "staging", + }) + ``` + ### With Unmanaged Disks + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_scale_set = azure.compute.ScaleSet("exampleScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + upgrade_policy_mode="Manual", + sku=azure.compute.ScaleSetSkuArgs( + name="Standard_F2", + tier="Standard", + capacity=2, + ), + os_profile=azure.compute.ScaleSetOsProfileArgs( + computer_name_prefix="testvm", + admin_username="myadmin", + ), + os_profile_linux_config=azure.compute.ScaleSetOsProfileLinuxConfigArgs( + disable_password_authentication=True, + ssh_keys=[azure.compute.ScaleSetOsProfileLinuxConfigSshKeyArgs( + path="/home/myadmin/.ssh/authorized_keys", + key_data=(lambda path: open(path).read())("~/.ssh/demo_key.pub"), + )], + ), + network_profiles=[azure.compute.ScaleSetNetworkProfileArgs( + name="TestNetworkProfile", + primary=True, + ip_configurations=[azure.compute.ScaleSetNetworkProfileIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + )], + )], + storage_profile_os_disk=azure.compute.ScaleSetStorageProfileOsDiskArgs( + name="osDiskProfile", + caching="ReadWrite", + create_option="FromImage", + vhd_containers=[pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}")], + ), + storage_profile_image_reference=azure.compute.ScaleSetStorageProfileImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + ``` + ## Example of storage_profile_image_reference with id + + ```python + import pulumi + import pulumi_azure as azure + + example_image = azure.compute.Image("exampleImage") + # ... + example_scale_set = azure.compute.ScaleSet("exampleScaleSet", storage_profile_image_reference=azure.compute.ScaleSetStorageProfileImageReferenceArgs( + id=example_image.id, + )) + # ... + ``` ## Import @@ -1241,6 +1427,192 @@ def __init__(__self__, Manages a virtual machine scale set. ## Example Usage + ### With Managed Disks (Recommended) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + domain_name_label=example_resource_group.name, + tags={ + "environment": "staging", + }) + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + bpepool = azure.lb.BackendAddressPool("bpepool", loadbalancer_id=example_load_balancer.id) + lbnatpool = azure.lb.NatPool("lbnatpool", + resource_group_name=example_resource_group.name, + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port_start=50000, + frontend_port_end=50119, + backend_port=22, + frontend_ip_configuration_name="PublicIPAddress") + example_probe = azure.lb.Probe("exampleProbe", + loadbalancer_id=example_load_balancer.id, + protocol="Http", + request_path="/health", + port=8080) + example_scale_set = azure.compute.ScaleSet("exampleScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + automatic_os_upgrade=True, + upgrade_policy_mode="Rolling", + rolling_upgrade_policy=azure.compute.ScaleSetRollingUpgradePolicyArgs( + max_batch_instance_percent=20, + max_unhealthy_instance_percent=20, + max_unhealthy_upgraded_instance_percent=5, + pause_time_between_batches="PT0S", + ), + health_probe_id=example_probe.id, + sku=azure.compute.ScaleSetSkuArgs( + name="Standard_F2", + tier="Standard", + capacity=2, + ), + storage_profile_image_reference=azure.compute.ScaleSetStorageProfileImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_profile_os_disk=azure.compute.ScaleSetStorageProfileOsDiskArgs( + name="", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + storage_profile_data_disks=[azure.compute.ScaleSetStorageProfileDataDiskArgs( + lun=0, + caching="ReadWrite", + create_option="Empty", + disk_size_gb=10, + )], + os_profile=azure.compute.ScaleSetOsProfileArgs( + computer_name_prefix="testvm", + admin_username="myadmin", + ), + os_profile_linux_config=azure.compute.ScaleSetOsProfileLinuxConfigArgs( + disable_password_authentication=True, + ssh_keys=[azure.compute.ScaleSetOsProfileLinuxConfigSshKeyArgs( + path="/home/myadmin/.ssh/authorized_keys", + key_data=(lambda path: open(path).read())("~/.ssh/demo_key.pub"), + )], + ), + network_profiles=[azure.compute.ScaleSetNetworkProfileArgs( + name="mynetworkprofile", + primary=True, + ip_configurations=[azure.compute.ScaleSetNetworkProfileIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + load_balancer_backend_address_pool_ids=[bpepool.id], + load_balancer_inbound_nat_rules_ids=[lbnatpool.id], + )], + )], + tags={ + "environment": "staging", + }) + ``` + ### With Unmanaged Disks + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_scale_set = azure.compute.ScaleSet("exampleScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + upgrade_policy_mode="Manual", + sku=azure.compute.ScaleSetSkuArgs( + name="Standard_F2", + tier="Standard", + capacity=2, + ), + os_profile=azure.compute.ScaleSetOsProfileArgs( + computer_name_prefix="testvm", + admin_username="myadmin", + ), + os_profile_linux_config=azure.compute.ScaleSetOsProfileLinuxConfigArgs( + disable_password_authentication=True, + ssh_keys=[azure.compute.ScaleSetOsProfileLinuxConfigSshKeyArgs( + path="/home/myadmin/.ssh/authorized_keys", + key_data=(lambda path: open(path).read())("~/.ssh/demo_key.pub"), + )], + ), + network_profiles=[azure.compute.ScaleSetNetworkProfileArgs( + name="TestNetworkProfile", + primary=True, + ip_configurations=[azure.compute.ScaleSetNetworkProfileIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + )], + )], + storage_profile_os_disk=azure.compute.ScaleSetStorageProfileOsDiskArgs( + name="osDiskProfile", + caching="ReadWrite", + create_option="FromImage", + vhd_containers=[pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}")], + ), + storage_profile_image_reference=azure.compute.ScaleSetStorageProfileImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + ``` + ## Example of storage_profile_image_reference with id + + ```python + import pulumi + import pulumi_azure as azure + + example_image = azure.compute.Image("exampleImage") + # ... + example_scale_set = azure.compute.ScaleSet("exampleScaleSet", storage_profile_image_reference=azure.compute.ScaleSetStorageProfileImageReferenceArgs( + id=example_image.id, + )) + # ... + ``` ## Import diff --git a/sdk/python/pulumi_azure/compute/scale_set_packet_capture.py b/sdk/python/pulumi_azure/compute/scale_set_packet_capture.py index 6abefa3c31..a32d2bfb05 100644 --- a/sdk/python/pulumi_azure/compute/scale_set_packet_capture.py +++ b/sdk/python/pulumi_azure/compute/scale_set_packet_capture.py @@ -420,6 +420,75 @@ def __init__(__self__, """ Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=4, + admin_username="adminuser", + admin_password="P@ssword1234!", + computer_name_prefix="my-linux-computer-name-prefix", + upgrade_mode="Automatic", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=example_subnet.id, + )], + )]) + example_virtual_machine_scale_set_extension = azure.compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", + virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True, + automatic_upgrade_enabled=True) + example_scale_set_packet_capture = azure.compute.ScaleSetPacketCapture("exampleScaleSetPacketCapture", + network_watcher_id=example_network_watcher.id, + virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id, + storage_location=azure.compute.ScaleSetPacketCaptureStorageLocationArgs( + file_path="/var/captures/packet.cap", + ), + machine_scope=azure.compute.ScaleSetPacketCaptureMachineScopeArgs( + include_instance_ids=["0"], + exclude_instance_ids=["1"], + ), + opts=pulumi.ResourceOptions(depends_on=[example_virtual_machine_scale_set_extension])) + ``` + + > **NOTE:** This Resource requires that [the Network Watcher Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine Scale Set before capturing can be enabled which can be installed via the `compute.VirtualMachineScaleSetExtension` resource. + ## Import Virtual Machine Scale Set Packet Captures can be imported using the `resource id`, e.g. @@ -449,6 +518,75 @@ def __init__(__self__, """ Configures Network Packet Capturing against a Virtual Machine Scale Set using a Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=4, + admin_username="adminuser", + admin_password="P@ssword1234!", + computer_name_prefix="my-linux-computer-name-prefix", + upgrade_mode="Automatic", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=example_subnet.id, + )], + )]) + example_virtual_machine_scale_set_extension = azure.compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", + virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True, + automatic_upgrade_enabled=True) + example_scale_set_packet_capture = azure.compute.ScaleSetPacketCapture("exampleScaleSetPacketCapture", + network_watcher_id=example_network_watcher.id, + virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id, + storage_location=azure.compute.ScaleSetPacketCaptureStorageLocationArgs( + file_path="/var/captures/packet.cap", + ), + machine_scope=azure.compute.ScaleSetPacketCaptureMachineScopeArgs( + include_instance_ids=["0"], + exclude_instance_ids=["1"], + ), + opts=pulumi.ResourceOptions(depends_on=[example_virtual_machine_scale_set_extension])) + ``` + + > **NOTE:** This Resource requires that [the Network Watcher Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine Scale Set before capturing can be enabled which can be installed via the `compute.VirtualMachineScaleSetExtension` resource. + ## Import Virtual Machine Scale Set Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/shared_image.py b/sdk/python/pulumi_azure/compute/shared_image.py index 0fc8b539fe..9cea0173f8 100644 --- a/sdk/python/pulumi_azure/compute/shared_image.py +++ b/sdk/python/pulumi_azure/compute/shared_image.py @@ -1069,6 +1069,33 @@ def __init__(__self__, """ Manages a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + description="Shared images and things.", + tags={ + "Hello": "There", + "World": "Example", + }) + example_shared_image = azure.compute.SharedImage("exampleSharedImage", + gallery_name=example_shared_image_gallery.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + identifier=azure.compute.SharedImageIdentifierArgs( + publisher="PublisherName", + offer="OfferName", + sku="ExampleSku", + )) + ``` + ## Import Shared Images can be imported using the `resource id`, e.g. @@ -1118,6 +1145,33 @@ def __init__(__self__, """ Manages a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + description="Shared images and things.", + tags={ + "Hello": "There", + "World": "Example", + }) + example_shared_image = azure.compute.SharedImage("exampleSharedImage", + gallery_name=example_shared_image_gallery.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + os_type="Linux", + identifier=azure.compute.SharedImageIdentifierArgs( + publisher="PublisherName", + offer="OfferName", + sku="ExampleSku", + )) + ``` + ## Import Shared Images can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/shared_image_gallery.py b/sdk/python/pulumi_azure/compute/shared_image_gallery.py index e21917d079..67897943a7 100644 --- a/sdk/python/pulumi_azure/compute/shared_image_gallery.py +++ b/sdk/python/pulumi_azure/compute/shared_image_gallery.py @@ -303,6 +303,23 @@ def __init__(__self__, """ Manages a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + description="Shared images and things.", + tags={ + "Hello": "There", + "World": "Example", + }) + ``` + ## Import Shared Image Galleries can be imported using the `resource id`, e.g. @@ -329,6 +346,23 @@ def __init__(__self__, """ Manages a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_shared_image_gallery = azure.compute.SharedImageGallery("exampleSharedImageGallery", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + description="Shared images and things.", + tags={ + "Hello": "There", + "World": "Example", + }) + ``` + ## Import Shared Image Galleries can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/shared_image_version.py b/sdk/python/pulumi_azure/compute/shared_image_version.py index 39d9377232..853e30f962 100644 --- a/sdk/python/pulumi_azure/compute/shared_image_version.py +++ b/sdk/python/pulumi_azure/compute/shared_image_version.py @@ -711,6 +711,30 @@ def __init__(__self__, """ Manages a Version of a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing_image = azure.compute.get_image(name="search-api", + resource_group_name="packerimages") + existing_shared_image = azure.compute.get_shared_image(name="existing-image", + gallery_name="existing_gallery", + resource_group_name="existing-resources") + example = azure.compute.SharedImageVersion("example", + gallery_name=existing_shared_image.gallery_name, + image_name=existing_shared_image.name, + resource_group_name=existing_shared_image.resource_group_name, + location=existing_shared_image.location, + managed_image_id=existing_image.id, + target_regions=[azure.compute.SharedImageVersionTargetRegionArgs( + name=existing_shared_image.location, + regional_replica_count=5, + storage_account_type="Standard_LRS", + )]) + ``` + ## Import Shared Image Versions can be imported using the `resource id`, e.g. @@ -758,6 +782,30 @@ def __init__(__self__, """ Manages a Version of a Shared Image within a Shared Image Gallery. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing_image = azure.compute.get_image(name="search-api", + resource_group_name="packerimages") + existing_shared_image = azure.compute.get_shared_image(name="existing-image", + gallery_name="existing_gallery", + resource_group_name="existing-resources") + example = azure.compute.SharedImageVersion("example", + gallery_name=existing_shared_image.gallery_name, + image_name=existing_shared_image.name, + resource_group_name=existing_shared_image.resource_group_name, + location=existing_shared_image.location, + managed_image_id=existing_image.id, + target_regions=[azure.compute.SharedImageVersionTargetRegionArgs( + name=existing_shared_image.location, + regional_replica_count=5, + storage_account_type="Standard_LRS", + )]) + ``` + ## Import Shared Image Versions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/snapshot.py b/sdk/python/pulumi_azure/compute/snapshot.py index 1f6a4cecbd..a17bb0a424 100644 --- a/sdk/python/pulumi_azure/compute/snapshot.py +++ b/sdk/python/pulumi_azure/compute/snapshot.py @@ -533,6 +533,26 @@ def __init__(__self__, """ Manages a Disk Snapshot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=10) + example_snapshot = azure.compute.Snapshot("exampleSnapshot", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + create_option="Copy", + source_uri=example_managed_disk.id) + ``` + ## Import Snapshots can be imported using the `resource id`, e.g. @@ -568,6 +588,26 @@ def __init__(__self__, """ Manages a Disk Snapshot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=10) + example_snapshot = azure.compute.Snapshot("exampleSnapshot", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + create_option="Copy", + source_uri=example_managed_disk.id) + ``` + ## Import Snapshots can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/ssh_public_key.py b/sdk/python/pulumi_azure/compute/ssh_public_key.py index d165cbc284..e7f70504b7 100644 --- a/sdk/python/pulumi_azure/compute/ssh_public_key.py +++ b/sdk/python/pulumi_azure/compute/ssh_public_key.py @@ -249,6 +249,18 @@ def __init__(__self__, """ Manages a SSH Public Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.SshPublicKey("example", + resource_group_name="example", + location="West Europe", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub")) + ``` + ## Import SSH Public Keys can be imported using the `resource id`, e.g. @@ -274,6 +286,18 @@ def __init__(__self__, """ Manages a SSH Public Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.compute.SshPublicKey("example", + resource_group_name="example", + location="West Europe", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub")) + ``` + ## Import SSH Public Keys can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/virtual_machine.py b/sdk/python/pulumi_azure/compute/virtual_machine.py index 3037a58947..ccce612121 100644 --- a/sdk/python/pulumi_azure/compute/virtual_machine.py +++ b/sdk/python/pulumi_azure/compute/virtual_machine.py @@ -1067,6 +1067,64 @@ def __init__(__self__, > **Note:** Data Disks can be attached either directly on the `compute.VirtualMachine` resource, or using the `compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur. ## Example Usage + ### From An Azure Platform Image) + + This example provisions a Virtual Machine with Managed Disks. + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + prefix = config.get("prefix") + if prefix is None: + prefix = "tfvmex" + example = azure.core.ResourceGroup("example", location="West Europe") + main_virtual_network = azure.network.VirtualNetwork("mainVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example.location, + resource_group_name=example.name) + internal = azure.network.Subnet("internal", + resource_group_name=example.name, + virtual_network_name=main_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + main_network_interface = azure.network.NetworkInterface("mainNetworkInterface", + location=example.location, + resource_group_name=example.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=internal.id, + private_ip_address_allocation="Dynamic", + )]) + main_virtual_machine = azure.compute.VirtualMachine("mainVirtualMachine", + location=example.location, + resource_group_name=example.name, + network_interface_ids=[main_network_interface.id], + vm_size="Standard_DS1_v2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="myosdisk1", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="hostname", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + ), + tags={ + "environment": "staging", + }) + ``` ## Import @@ -1129,6 +1187,64 @@ def __init__(__self__, > **Note:** Data Disks can be attached either directly on the `compute.VirtualMachine` resource, or using the `compute.DataDiskAttachment` resource - but the two cannot be used together. If both are used against the same Virtual Machine, spurious changes will occur. ## Example Usage + ### From An Azure Platform Image) + + This example provisions a Virtual Machine with Managed Disks. + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + prefix = config.get("prefix") + if prefix is None: + prefix = "tfvmex" + example = azure.core.ResourceGroup("example", location="West Europe") + main_virtual_network = azure.network.VirtualNetwork("mainVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example.location, + resource_group_name=example.name) + internal = azure.network.Subnet("internal", + resource_group_name=example.name, + virtual_network_name=main_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + main_network_interface = azure.network.NetworkInterface("mainNetworkInterface", + location=example.location, + resource_group_name=example.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=internal.id, + private_ip_address_allocation="Dynamic", + )]) + main_virtual_machine = azure.compute.VirtualMachine("mainVirtualMachine", + location=example.location, + resource_group_name=example.name, + network_interface_ids=[main_network_interface.id], + vm_size="Standard_DS1_v2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="myosdisk1", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="hostname", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + ), + tags={ + "environment": "staging", + }) + ``` ## Import diff --git a/sdk/python/pulumi_azure/compute/virtual_machine_scale_set_extension.py b/sdk/python/pulumi_azure/compute/virtual_machine_scale_set_extension.py index d0a9c600a9..2fab04e35e 100644 --- a/sdk/python/pulumi_azure/compute/virtual_machine_scale_set_extension.py +++ b/sdk/python/pulumi_azure/compute/virtual_machine_scale_set_extension.py @@ -36,6 +36,10 @@ def __init__(__self__, *, :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] virtual_machine_scale_set_id: The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. > **NOTE:** This should be the ID from the `compute.LinuxVirtualMachineScaleSet` or `compute.WindowsVirtualMachineScaleSet` resource - when using the older `compute.ScaleSet` resource extensions should instead be defined inline. @@ -172,6 +176,10 @@ def type_handler_version(self) -> pulumi.Input[str]: Specifies the version of the extension to use, available versions can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` """ return pulumi.get(self, "type_handler_version") @@ -350,6 +358,10 @@ def __init__(__self__, *, :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] virtual_machine_scale_set_id: The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. > **NOTE:** This should be the ID from the `compute.LinuxVirtualMachineScaleSet` or `compute.WindowsVirtualMachineScaleSet` resource - when using the older `compute.ScaleSet` resource extensions should instead be defined inline. @@ -581,6 +593,10 @@ def type_handler_version(self) -> Optional[pulumi.Input[str]]: Specifies the version of the extension to use, available versions can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` """ return pulumi.get(self, "type_handler_version") @@ -627,6 +643,46 @@ def __init__(__self__, > **NOTE:** This resource is not intended to be used with the `compute.ScaleSet` resource - instead it's intended for this to be used with the `compute.LinuxVirtualMachineScaleSet` and `compute.WindowsVirtualMachineScaleSet` resources. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + admin_username="adminuser", + instances=1, + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + )], + )], + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + )) + example_virtual_machine_scale_set_extension = azure.compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", + virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id, + publisher="Microsoft.Azure.Extensions", + type="CustomScript", + type_handler_version="2.0", + settings=json.dumps({ + "commandToExecute": "echo $HOSTNAME", + })) + ``` + ## Import Virtual Machine Scale Set Extensions can be imported using the `resource id`, e.g. @@ -659,6 +715,10 @@ def __init__(__self__, :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] virtual_machine_scale_set_id: The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. > **NOTE:** This should be the ID from the `compute.LinuxVirtualMachineScaleSet` or `compute.WindowsVirtualMachineScaleSet` resource - when using the older `compute.ScaleSet` resource extensions should instead be defined inline. @@ -674,6 +734,46 @@ def __init__(__self__, > **NOTE:** This resource is not intended to be used with the `compute.ScaleSet` resource - instead it's intended for this to be used with the `compute.LinuxVirtualMachineScaleSet` and `compute.WindowsVirtualMachineScaleSet` resources. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + admin_username="adminuser", + instances=1, + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + )], + )], + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + )) + example_virtual_machine_scale_set_extension = azure.compute.VirtualMachineScaleSetExtension("exampleVirtualMachineScaleSetExtension", + virtual_machine_scale_set_id=example_linux_virtual_machine_scale_set.id, + publisher="Microsoft.Azure.Extensions", + type="CustomScript", + type_handler_version="2.0", + settings=json.dumps({ + "commandToExecute": "echo $HOSTNAME", + })) + ``` + ## Import Virtual Machine Scale Set Extensions can be imported using the `resource id`, e.g. @@ -799,6 +899,10 @@ def get(resource_name: str, :param pulumi.Input[str] type_handler_version: Specifies the version of the extension to use, available versions can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` :param pulumi.Input[str] virtual_machine_scale_set_id: The ID of the Virtual Machine Scale Set. Changing this forces a new resource to be created. > **NOTE:** This should be the ID from the `compute.LinuxVirtualMachineScaleSet` or `compute.WindowsVirtualMachineScaleSet` resource - when using the older `compute.ScaleSet` resource extensions should instead be defined inline. @@ -925,6 +1029,10 @@ def type_handler_version(self) -> pulumi.Output[str]: Specifies the version of the extension to use, available versions can be found using the Azure CLI. > **Note:** The `Publisher` and `Type` of Virtual Machine Scale Set Extensions can be found using the Azure CLI, via: + + ```python + import pulumi + ``` """ return pulumi.get(self, "type_handler_version") diff --git a/sdk/python/pulumi_azure/compute/windows_virtual_machine.py b/sdk/python/pulumi_azure/compute/windows_virtual_machine.py index 088c56dd9a..37be888e47 100644 --- a/sdk/python/pulumi_azure/compute/windows_virtual_machine.py +++ b/sdk/python/pulumi_azure/compute/windows_virtual_machine.py @@ -2223,6 +2223,50 @@ def __init__(__self__, > In this release there's a known issue where the `public_ip_address` and `public_ip_addresses` fields may not be fully populated for Dynamic Public IP's. + ## Example Usage + + This example provisions a basic Windows Virtual Machine on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_windows_virtual_machine = azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + admin_password="P@$$w0rd1234!", + network_interface_ids=[example_network_interface.id], + os_disk=azure.compute.WindowsVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.WindowsVirtualMachineSourceImageReferenceArgs( + publisher="MicrosoftWindowsServer", + offer="WindowsServer", + sku="2016-Datacenter", + version="latest", + )) + ``` + ## Import Windows Virtual Machines can be imported using the `resource id`, e.g. @@ -2325,6 +2369,50 @@ def __init__(__self__, > In this release there's a known issue where the `public_ip_address` and `public_ip_addresses` fields may not be fully populated for Dynamic Public IP's. + ## Example Usage + + This example provisions a basic Windows Virtual Machine on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_windows_virtual_machine = azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + admin_password="P@$$w0rd1234!", + network_interface_ids=[example_network_interface.id], + os_disk=azure.compute.WindowsVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.WindowsVirtualMachineSourceImageReferenceArgs( + publisher="MicrosoftWindowsServer", + offer="WindowsServer", + sku="2016-Datacenter", + version="latest", + )) + ``` + ## Import Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/compute/windows_virtual_machine_scale_set.py b/sdk/python/pulumi_azure/compute/windows_virtual_machine_scale_set.py index 7c4841b0d6..cc85a26ac6 100644 --- a/sdk/python/pulumi_azure/compute/windows_virtual_machine_scale_set.py +++ b/sdk/python/pulumi_azure/compute/windows_virtual_machine_scale_set.py @@ -2541,6 +2541,51 @@ def __init__(__self__, > **NOTE:** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `compute.ScaleSet` resource instead + ## Example Usage + + This example provisions a basic Windows Virtual Machine Scale Set on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_windows_virtual_machine_scale_set = azure.compute.WindowsVirtualMachineScaleSet("exampleWindowsVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_password="P@55w0rd1234!", + admin_username="adminuser", + source_image_reference=azure.compute.WindowsVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="MicrosoftWindowsServer", + offer="WindowsServer", + sku="2016-Datacenter-Server-Core", + version="latest", + ), + os_disk=azure.compute.WindowsVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.WindowsVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.WindowsVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=internal.id, + )], + )]) + ``` + ## Import Windows Virtual Machine Scale Sets can be imported using the `resource id`, e.g. @@ -2652,6 +2697,51 @@ def __init__(__self__, > **NOTE:** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `compute.ScaleSet` resource instead + ## Example Usage + + This example provisions a basic Windows Virtual Machine Scale Set on an internal network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_windows_virtual_machine_scale_set = azure.compute.WindowsVirtualMachineScaleSet("exampleWindowsVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_password="P@55w0rd1234!", + admin_username="adminuser", + source_image_reference=azure.compute.WindowsVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="MicrosoftWindowsServer", + offer="WindowsServer", + sku="2016-Datacenter-Server-Core", + version="latest", + ), + os_disk=azure.compute.WindowsVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.WindowsVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.WindowsVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=internal.id, + )], + )]) + ``` + ## Import Windows Virtual Machine Scale Sets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/confidentialledger/ledger.py b/sdk/python/pulumi_azure/confidentialledger/ledger.py index b71a64483f..0cd7cd9f25 100644 --- a/sdk/python/pulumi_azure/confidentialledger/ledger.py +++ b/sdk/python/pulumi_azure/confidentialledger/ledger.py @@ -374,6 +374,25 @@ def __init__(__self__, """ Manages a Confidential Ledger. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example = azure.core.ResourceGroup("example", location="West Europe") + ledger = azure.confidentialledger.Ledger("ledger", + resource_group_name=example.name, + location=example.location, + ledger_type="Private", + azuread_based_service_principals=[azure.confidentialledger.LedgerAzureadBasedServicePrincipalArgs( + principal_id=current.object_id, + tenant_id=current.tenant_id, + ledger_role_name="Administrator", + )]) + ``` + ## Import Confidential Ledgers can be imported using the `resource id`, e.g. @@ -401,6 +420,25 @@ def __init__(__self__, """ Manages a Confidential Ledger. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example = azure.core.ResourceGroup("example", location="West Europe") + ledger = azure.confidentialledger.Ledger("ledger", + resource_group_name=example.name, + location=example.location, + ledger_type="Private", + azuread_based_service_principals=[azure.confidentialledger.LedgerAzureadBasedServicePrincipalArgs( + principal_id=current.object_id, + tenant_id=current.tenant_id, + ledger_role_name="Administrator", + )]) + ``` + ## Import Confidential Ledgers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/connections/api_connection.py b/sdk/python/pulumi_azure/connections/api_connection.py index da16ed79b0..19b1ec72bb 100644 --- a/sdk/python/pulumi_azure/connections/api_connection.py +++ b/sdk/python/pulumi_azure/connections/api_connection.py @@ -286,6 +286,31 @@ def __init__(__self__, """ Manages an API Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_api = azure.connections.get_managed_api_output(name="servicebus", + location=example_resource_group.location) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic") + example_api_connection = azure.connections.ApiConnection("exampleApiConnection", + resource_group_name=example_resource_group.name, + managed_api_id=example_managed_api.id, + display_name="Example 1", + parameter_values={ + "connectionString": example_namespace.default_primary_connection_string, + }, + tags={ + "Hello": "World", + }) + ``` + ## Import API Connections can be imported using the `resource id`, e.g. @@ -311,6 +336,31 @@ def __init__(__self__, """ Manages an API Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_api = azure.connections.get_managed_api_output(name="servicebus", + location=example_resource_group.location) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic") + example_api_connection = azure.connections.ApiConnection("exampleApiConnection", + resource_group_name=example_resource_group.name, + managed_api_id=example_managed_api.id, + display_name="Example 1", + parameter_values={ + "connectionString": example_namespace.default_primary_connection_string, + }, + tags={ + "Hello": "World", + }) + ``` + ## Import API Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/connections/get_managed_api.py b/sdk/python/pulumi_azure/connections/get_managed_api.py index 7f719f2bda..ee75b991b9 100644 --- a/sdk/python/pulumi_azure/connections/get_managed_api.py +++ b/sdk/python/pulumi_azure/connections/get_managed_api.py @@ -77,6 +77,17 @@ def get_managed_api(location: Optional[str] = None, """ Uses this data source to access information about an existing Managed API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.connections.get_managed_api(name="servicebus", + location="West Europe") + pulumi.export("id", example.id) + ``` + :param str location: The Azure location for this Managed API. :param str name: Specifies the name of the Managed API. @@ -101,6 +112,17 @@ def get_managed_api_output(location: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing Managed API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.connections.get_managed_api(name="servicebus", + location="West Europe") + pulumi.export("id", example.id) + ``` + :param str location: The Azure location for this Managed API. :param str name: Specifies the name of the Managed API. diff --git a/sdk/python/pulumi_azure/consumption/budget_management_group.py b/sdk/python/pulumi_azure/consumption/budget_management_group.py index 68ba4704c7..4bef67c153 100644 --- a/sdk/python/pulumi_azure/consumption/budget_management_group.py +++ b/sdk/python/pulumi_azure/consumption/budget_management_group.py @@ -368,6 +368,58 @@ def __init__(__self__, """ Manages a Consumption Budget for a Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup", display_name="example") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_budget_management_group = azure.consumption.BudgetManagementGroup("exampleBudgetManagementGroup", + management_group_id=example_group.id, + amount=1000, + time_grain="Monthly", + time_period=azure.consumption.BudgetManagementGroupTimePeriodArgs( + start_date="2022-06-01T00:00:00Z", + end_date="2022-07-01T00:00:00Z", + ), + filter=azure.consumption.BudgetManagementGroupFilterArgs( + dimensions=[azure.consumption.BudgetManagementGroupFilterDimensionArgs( + name="ResourceGroupName", + values=[example_resource_group.name], + )], + tags=[azure.consumption.BudgetManagementGroupFilterTagArgs( + name="foo", + values=[ + "bar", + "baz", + ], + )], + ), + notifications=[ + azure.consumption.BudgetManagementGroupNotificationArgs( + enabled=True, + threshold=90, + operator="EqualTo", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + azure.consumption.BudgetManagementGroupNotificationArgs( + enabled=False, + threshold=100, + operator="GreaterThan", + threshold_type="Forecasted", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + ]) + ``` + ## Import Management Group Consumption Budgets can be imported using the `resource id`, e.g. @@ -396,6 +448,58 @@ def __init__(__self__, """ Manages a Consumption Budget for a Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup", display_name="example") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_budget_management_group = azure.consumption.BudgetManagementGroup("exampleBudgetManagementGroup", + management_group_id=example_group.id, + amount=1000, + time_grain="Monthly", + time_period=azure.consumption.BudgetManagementGroupTimePeriodArgs( + start_date="2022-06-01T00:00:00Z", + end_date="2022-07-01T00:00:00Z", + ), + filter=azure.consumption.BudgetManagementGroupFilterArgs( + dimensions=[azure.consumption.BudgetManagementGroupFilterDimensionArgs( + name="ResourceGroupName", + values=[example_resource_group.name], + )], + tags=[azure.consumption.BudgetManagementGroupFilterTagArgs( + name="foo", + values=[ + "bar", + "baz", + ], + )], + ), + notifications=[ + azure.consumption.BudgetManagementGroupNotificationArgs( + enabled=True, + threshold=90, + operator="EqualTo", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + azure.consumption.BudgetManagementGroupNotificationArgs( + enabled=False, + threshold=100, + operator="GreaterThan", + threshold_type="Forecasted", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + ]) + ``` + ## Import Management Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/consumption/budget_resource_group.py b/sdk/python/pulumi_azure/consumption/budget_resource_group.py index beac08966f..8ddddd6f48 100644 --- a/sdk/python/pulumi_azure/consumption/budget_resource_group.py +++ b/sdk/python/pulumi_azure/consumption/budget_resource_group.py @@ -368,6 +368,62 @@ def __init__(__self__, """ Manages a Resource Group Consumption Budget. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_budget_resource_group = azure.consumption.BudgetResourceGroup("exampleBudgetResourceGroup", + resource_group_id=example_resource_group.id, + amount=1000, + time_grain="Monthly", + time_period=azure.consumption.BudgetResourceGroupTimePeriodArgs( + start_date="2022-06-01T00:00:00Z", + end_date="2022-07-01T00:00:00Z", + ), + filter=azure.consumption.BudgetResourceGroupFilterArgs( + dimensions=[azure.consumption.BudgetResourceGroupFilterDimensionArgs( + name="ResourceId", + values=[example_action_group.id], + )], + tags=[azure.consumption.BudgetResourceGroupFilterTagArgs( + name="foo", + values=[ + "bar", + "baz", + ], + )], + ), + notifications=[ + azure.consumption.BudgetResourceGroupNotificationArgs( + enabled=True, + threshold=90, + operator="EqualTo", + threshold_type="Forecasted", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + contact_groups=[example_action_group.id], + contact_roles=["Owner"], + ), + azure.consumption.BudgetResourceGroupNotificationArgs( + enabled=False, + threshold=100, + operator="GreaterThan", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + ]) + ``` + ## Import Resource Group Consumption Budgets can be imported using the `resource id`, e.g. @@ -396,6 +452,62 @@ def __init__(__self__, """ Manages a Resource Group Consumption Budget. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_budget_resource_group = azure.consumption.BudgetResourceGroup("exampleBudgetResourceGroup", + resource_group_id=example_resource_group.id, + amount=1000, + time_grain="Monthly", + time_period=azure.consumption.BudgetResourceGroupTimePeriodArgs( + start_date="2022-06-01T00:00:00Z", + end_date="2022-07-01T00:00:00Z", + ), + filter=azure.consumption.BudgetResourceGroupFilterArgs( + dimensions=[azure.consumption.BudgetResourceGroupFilterDimensionArgs( + name="ResourceId", + values=[example_action_group.id], + )], + tags=[azure.consumption.BudgetResourceGroupFilterTagArgs( + name="foo", + values=[ + "bar", + "baz", + ], + )], + ), + notifications=[ + azure.consumption.BudgetResourceGroupNotificationArgs( + enabled=True, + threshold=90, + operator="EqualTo", + threshold_type="Forecasted", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + contact_groups=[example_action_group.id], + contact_roles=["Owner"], + ), + azure.consumption.BudgetResourceGroupNotificationArgs( + enabled=False, + threshold=100, + operator="GreaterThan", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + ]) + ``` + ## Import Resource Group Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/consumption/budget_subscription.py b/sdk/python/pulumi_azure/consumption/budget_subscription.py index 4eb76777ca..0543dabc9e 100644 --- a/sdk/python/pulumi_azure/consumption/budget_subscription.py +++ b/sdk/python/pulumi_azure/consumption/budget_subscription.py @@ -376,6 +376,63 @@ def __init__(__self__, """ Manages a Subscription Consumption Budget. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_budget_subscription = azure.consumption.BudgetSubscription("exampleBudgetSubscription", + subscription_id=current.id, + amount=1000, + time_grain="Monthly", + time_period=azure.consumption.BudgetSubscriptionTimePeriodArgs( + start_date="2022-06-01T00:00:00Z", + end_date="2022-07-01T00:00:00Z", + ), + filter=azure.consumption.BudgetSubscriptionFilterArgs( + dimensions=[azure.consumption.BudgetSubscriptionFilterDimensionArgs( + name="ResourceGroupName", + values=[example_resource_group.name], + )], + tags=[azure.consumption.BudgetSubscriptionFilterTagArgs( + name="foo", + values=[ + "bar", + "baz", + ], + )], + ), + notifications=[ + azure.consumption.BudgetSubscriptionNotificationArgs( + enabled=True, + threshold=90, + operator="EqualTo", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + contact_groups=[example_action_group.id], + contact_roles=["Owner"], + ), + azure.consumption.BudgetSubscriptionNotificationArgs( + enabled=False, + threshold=100, + operator="GreaterThan", + threshold_type="Forecasted", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + ]) + ``` + ## Import Subscription Consumption Budgets can be imported using the `resource id`, e.g. @@ -406,6 +463,63 @@ def __init__(__self__, """ Manages a Subscription Consumption Budget. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_budget_subscription = azure.consumption.BudgetSubscription("exampleBudgetSubscription", + subscription_id=current.id, + amount=1000, + time_grain="Monthly", + time_period=azure.consumption.BudgetSubscriptionTimePeriodArgs( + start_date="2022-06-01T00:00:00Z", + end_date="2022-07-01T00:00:00Z", + ), + filter=azure.consumption.BudgetSubscriptionFilterArgs( + dimensions=[azure.consumption.BudgetSubscriptionFilterDimensionArgs( + name="ResourceGroupName", + values=[example_resource_group.name], + )], + tags=[azure.consumption.BudgetSubscriptionFilterTagArgs( + name="foo", + values=[ + "bar", + "baz", + ], + )], + ), + notifications=[ + azure.consumption.BudgetSubscriptionNotificationArgs( + enabled=True, + threshold=90, + operator="EqualTo", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + contact_groups=[example_action_group.id], + contact_roles=["Owner"], + ), + azure.consumption.BudgetSubscriptionNotificationArgs( + enabled=False, + threshold=100, + operator="GreaterThan", + threshold_type="Forecasted", + contact_emails=[ + "foo@example.com", + "bar@example.com", + ], + ), + ]) + ``` + ## Import Subscription Consumption Budgets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/consumption/get_budget_resource_group.py b/sdk/python/pulumi_azure/consumption/get_budget_resource_group.py index e022f8c833..3cfe735d2e 100644 --- a/sdk/python/pulumi_azure/consumption/get_budget_resource_group.py +++ b/sdk/python/pulumi_azure/consumption/get_budget_resource_group.py @@ -132,6 +132,17 @@ def get_budget_resource_group(name: Optional[str] = None, """ Use this data source to access information about an existing Consumption Budget for a specific resource group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.consumption.get_budget_resource_group(name="existing", + resource_group_id=azurerm_resource_group["example"]["id"]) + pulumi.export("id", example.id) + ``` + :param str name: The name of this Consumption Budget. :param str resource_group_id: The ID of the subscription. @@ -160,6 +171,17 @@ def get_budget_resource_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Consumption Budget for a specific resource group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.consumption.get_budget_resource_group(name="existing", + resource_group_id=azurerm_resource_group["example"]["id"]) + pulumi.export("id", example.id) + ``` + :param str name: The name of this Consumption Budget. :param str resource_group_id: The ID of the subscription. diff --git a/sdk/python/pulumi_azure/consumption/get_budget_subscription.py b/sdk/python/pulumi_azure/consumption/get_budget_subscription.py index 7b940f11e6..188e4ba998 100644 --- a/sdk/python/pulumi_azure/consumption/get_budget_subscription.py +++ b/sdk/python/pulumi_azure/consumption/get_budget_subscription.py @@ -132,6 +132,17 @@ def get_budget_subscription(name: Optional[str] = None, """ Use this data source to access information about an existing Consumption Budget for a specific subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.consumption.get_budget_subscription(name="existing", + subscription_id="/subscriptions/00000000-0000-0000-0000-000000000000/") + pulumi.export("id", data["azurerm_consumption_budget"]["example"]["id"]) + ``` + :param str name: The name of this Consumption Budget. :param str subscription_id: The ID of the subscription. @@ -160,6 +171,17 @@ def get_budget_subscription_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Consumption Budget for a specific subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.consumption.get_budget_subscription(name="existing", + subscription_id="/subscriptions/00000000-0000-0000-0000-000000000000/") + pulumi.export("id", data["azurerm_consumption_budget"]["example"]["id"]) + ``` + :param str name: The name of this Consumption Budget. :param str subscription_id: The ID of the subscription. diff --git a/sdk/python/pulumi_azure/containerapp/app.py b/sdk/python/pulumi_azure/containerapp/app.py index 76c3e945c4..63b3333412 100644 --- a/sdk/python/pulumi_azure/containerapp/app.py +++ b/sdk/python/pulumi_azure/containerapp/app.py @@ -577,6 +577,36 @@ def __init__(__self__, """ Manages a Container App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + example_app = azure.containerapp.App("exampleApp", + container_app_environment_id=example_environment.id, + resource_group_name=example_resource_group.name, + revision_mode="Single", + template=azure.containerapp.AppTemplateArgs( + containers=[azure.containerapp.AppTemplateContainerArgs( + name="examplecontainerapp", + image="mcr.microsoft.com/azuredocs/containerapps-helloworld:latest", + cpu=0.25, + memory="0.5Gi", + )], + )) + ``` + ## Import A Container App can be imported using the `resource id`, e.g. @@ -608,6 +638,36 @@ def __init__(__self__, """ Manages a Container App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + example_app = azure.containerapp.App("exampleApp", + container_app_environment_id=example_environment.id, + resource_group_name=example_resource_group.name, + revision_mode="Single", + template=azure.containerapp.AppTemplateArgs( + containers=[azure.containerapp.AppTemplateContainerArgs( + name="examplecontainerapp", + image="mcr.microsoft.com/azuredocs/containerapps-helloworld:latest", + cpu=0.25, + memory="0.5Gi", + )], + )) + ``` + ## Import A Container App can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerapp/environment.py b/sdk/python/pulumi_azure/containerapp/environment.py index f46340fffb..f3c3d93e7a 100644 --- a/sdk/python/pulumi_azure/containerapp/environment.py +++ b/sdk/python/pulumi_azure/containerapp/environment.py @@ -536,6 +536,24 @@ def __init__(__self__, """ Manages a Container App Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + ``` + ## Import A Container App Environment can be imported using the `resource id`, e.g. @@ -571,6 +589,24 @@ def __init__(__self__, """ Manages a Container App Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + ``` + ## Import A Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerapp/environment_dapr_component.py b/sdk/python/pulumi_azure/containerapp/environment_dapr_component.py index 0c706fa7c3..cbf20d9390 100644 --- a/sdk/python/pulumi_azure/containerapp/environment_dapr_component.py +++ b/sdk/python/pulumi_azure/containerapp/environment_dapr_component.py @@ -416,6 +416,28 @@ def __init__(__self__, """ Manages a Dapr Component for a Container App Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + example_environment_dapr_component = azure.containerapp.EnvironmentDaprComponent("exampleEnvironmentDaprComponent", + container_app_environment_id=example_environment.id, + component_type="state.azure.blobstorage", + version="v1") + ``` + ## Import A Dapr Component for a Container App Environment can be imported using the `resource id`, e.g. @@ -447,6 +469,28 @@ def __init__(__self__, """ Manages a Dapr Component for a Container App Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + example_environment_dapr_component = azure.containerapp.EnvironmentDaprComponent("exampleEnvironmentDaprComponent", + container_app_environment_id=example_environment.id, + component_type="state.azure.blobstorage", + version="v1") + ``` + ## Import A Dapr Component for a Container App Environment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerapp/environment_storage.py b/sdk/python/pulumi_azure/containerapp/environment_storage.py index 51e5ce8761..cbdba95632 100644 --- a/sdk/python/pulumi_azure/containerapp/environment_storage.py +++ b/sdk/python/pulumi_azure/containerapp/environment_storage.py @@ -301,6 +301,38 @@ def __init__(__self__, """ Manages a Container App Environment Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=5) + example_environment_storage = azure.containerapp.EnvironmentStorage("exampleEnvironmentStorage", + container_app_environment_id=example_environment.id, + account_name=example_account.name, + share_name=example_share.name, + access_key=example_account.primary_access_key, + access_mode="ReadOnly") + ``` + ## Import A Container App Environment Storage can be imported using the `resource id`, e.g. @@ -327,6 +359,38 @@ def __init__(__self__, """ Manages a Container App Environment Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_environment = azure.containerapp.Environment("exampleEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + log_analytics_workspace_id=example_analytics_workspace.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=5) + example_environment_storage = azure.containerapp.EnvironmentStorage("exampleEnvironmentStorage", + container_app_environment_id=example_environment.id, + account_name=example_account.name, + share_name=example_share.name, + access_key=example_account.primary_access_key, + access_mode="ReadOnly") + ``` + ## Import A Container App Environment Storage can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerapp/get_app.py b/sdk/python/pulumi_azure/containerapp/get_app.py index dc424e11e1..d7c9bef2f7 100644 --- a/sdk/python/pulumi_azure/containerapp/get_app.py +++ b/sdk/python/pulumi_azure/containerapp/get_app.py @@ -225,6 +225,16 @@ def get_app(name: Optional[str] = None, """ Use this data source to access information about an existing Container App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerapp.get_app(name="example-app", + resource_group_name="example-resources") + ``` + :param str name: The name of the Container App. :param str resource_group_name: The name of the Resource Group where this Container App exists. @@ -262,6 +272,16 @@ def get_app_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Container App. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerapp.get_app(name="example-app", + resource_group_name="example-resources") + ``` + :param str name: The name of the Container App. :param str resource_group_name: The name of the Resource Group where this Container App exists. diff --git a/sdk/python/pulumi_azure/containerapp/get_environment.py b/sdk/python/pulumi_azure/containerapp/get_environment.py index 898c29f5e0..1e4b4a3bfc 100644 --- a/sdk/python/pulumi_azure/containerapp/get_environment.py +++ b/sdk/python/pulumi_azure/containerapp/get_environment.py @@ -188,6 +188,16 @@ def get_environment(name: Optional[str] = None, """ Use this data source to access information about an existing Container App Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerapp.get_environment(name="example-environment", + resource_group_name="example-resources") + ``` + :param str name: The name of the Container Apps Managed Environment. :param str resource_group_name: The name of the Resource Group where this Container App Environment exists. @@ -221,6 +231,16 @@ def get_environment_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Container App Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerapp.get_environment(name="example-environment", + resource_group_name="example-resources") + ``` + :param str name: The name of the Container Apps Managed Environment. :param str resource_group_name: The name of the Resource Group where this Container App Environment exists. diff --git a/sdk/python/pulumi_azure/containerapp/get_environment_certificate.py b/sdk/python/pulumi_azure/containerapp/get_environment_certificate.py index 07740d3455..a732202fe1 100644 --- a/sdk/python/pulumi_azure/containerapp/get_environment_certificate.py +++ b/sdk/python/pulumi_azure/containerapp/get_environment_certificate.py @@ -140,6 +140,18 @@ def get_environment_certificate(container_app_environment_id: Optional[str] = No """ Use this data source to access information about an existing Container App Environment Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_environment = azure.containerapp.get_environment(name="example-environment", + resource_group_name="example-resources") + example_environment_certificate = azure.containerapp.get_environment_certificate(name="mycertificate", + container_app_environment_id=example_environment.id) + ``` + :param str container_app_environment_id: The ID of the Container App Environment to configure this Certificate on. Changing this forces a new resource to be created. :param str name: The name of the Container Apps Certificate. Changing this forces a new resource to be created. @@ -169,6 +181,18 @@ def get_environment_certificate_output(container_app_environment_id: Optional[pu """ Use this data source to access information about an existing Container App Environment Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_environment = azure.containerapp.get_environment(name="example-environment", + resource_group_name="example-resources") + example_environment_certificate = azure.containerapp.get_environment_certificate(name="mycertificate", + container_app_environment_id=example_environment.id) + ``` + :param str container_app_environment_id: The ID of the Container App Environment to configure this Certificate on. Changing this forces a new resource to be created. :param str name: The name of the Container Apps Certificate. Changing this forces a new resource to be created. diff --git a/sdk/python/pulumi_azure/containerservice/_inputs.py b/sdk/python/pulumi_azure/containerservice/_inputs.py index 5a72a1ab66..9300b06c00 100644 --- a/sdk/python/pulumi_azure/containerservice/_inputs.py +++ b/sdk/python/pulumi_azure/containerservice/_inputs.py @@ -3379,6 +3379,19 @@ def __init__(__self__, *, > **Note:** At this time ACI Connectors are not supported in Azure China. > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + + ```python + import pulumi + import pulumi_azure as azure + + virtual = azure.network.Subnet("virtual", delegations=[azure.network.SubnetDelegationArgs( + name="aciDelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + name="Microsoft.ContainerInstance/containerGroups", + ), + )]) + ``` :param pulumi.Input[Sequence[pulumi.Input['KubernetesClusterAciConnectorLinuxConnectorIdentityArgs']]] connector_identities: A `connector_identity` block is exported. The exported attributes are defined below. """ KubernetesClusterAciConnectorLinuxArgs._configure( @@ -3413,6 +3426,19 @@ def subnet_name(self) -> pulumi.Input[str]: > **Note:** At this time ACI Connectors are not supported in Azure China. > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + + ```python + import pulumi + import pulumi_azure as azure + + virtual = azure.network.Subnet("virtual", delegations=[azure.network.SubnetDelegationArgs( + name="aciDelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + name="Microsoft.ContainerInstance/containerGroups", + ), + )]) + ``` """ return pulumi.get(self, "subnet_name") diff --git a/sdk/python/pulumi_azure/containerservice/cluster_trusted_access_role_binding.py b/sdk/python/pulumi_azure/containerservice/cluster_trusted_access_role_binding.py index e571253c15..67795da0c9 100644 --- a/sdk/python/pulumi_azure/containerservice/cluster_trusted_access_role_binding.py +++ b/sdk/python/pulumi_azure/containerservice/cluster_trusted_access_role_binding.py @@ -217,6 +217,61 @@ def __init__(__self__, > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name TrustedAccessPreview` and then `az provider register -n Microsoft.ContainerService` . + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="example-value") + test = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=data["azurerm_client_config"]["example"]["tenant_id"], + sku_name="example-value", + soft_delete_retention_days="example-value") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=data["azurerm_client_config"]["example"]["tenant_id"], + object_id=data["azurerm_client_config"]["example"]["object_id"], + key_permissions="example-value") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="acctestaksexample", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="example-value", + node_count="example-value", + vm_size="example-value", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="example-value", + )) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="example-value", + account_replication_type="example-value") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + application_insights_id=example_insights.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="example-value", + )) + example_cluster_trusted_access_role_binding = azure.containerservice.ClusterTrustedAccessRoleBinding("exampleClusterTrustedAccessRoleBinding", + kubernetes_cluster_id=example_kubernetes_cluster.id, + roles="example-value", + source_resource_id=example_workspace.id) + ``` + ## Import An existing Kubernetes Cluster Trusted Access Role Binding can be imported into Terraform using the `resource id`, e.g. @@ -247,6 +302,61 @@ def __init__(__self__, > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name TrustedAccessPreview` and then `az provider register -n Microsoft.ContainerService` . + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="example-value") + test = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=data["azurerm_client_config"]["example"]["tenant_id"], + sku_name="example-value", + soft_delete_retention_days="example-value") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=data["azurerm_client_config"]["example"]["tenant_id"], + object_id=data["azurerm_client_config"]["example"]["object_id"], + key_permissions="example-value") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="acctestaksexample", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="example-value", + node_count="example-value", + vm_size="example-value", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="example-value", + )) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="example-value", + account_replication_type="example-value") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + application_insights_id=example_insights.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="example-value", + )) + example_cluster_trusted_access_role_binding = azure.containerservice.ClusterTrustedAccessRoleBinding("exampleClusterTrustedAccessRoleBinding", + kubernetes_cluster_id=example_kubernetes_cluster.id, + roles="example-value", + source_resource_id=example_workspace.id) + ``` + ## Import An existing Kubernetes Cluster Trusted Access Role Binding can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/connected_registry.py b/sdk/python/pulumi_azure/containerservice/connected_registry.py index d6354a0d40..616d3bb8b4 100644 --- a/sdk/python/pulumi_azure/containerservice/connected_registry.py +++ b/sdk/python/pulumi_azure/containerservice/connected_registry.py @@ -546,6 +546,41 @@ def __init__(__self__, """ Manages a Container Connected Registry. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + data_endpoint_enabled=True) + example_registry_scope_map = azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", + container_registry_name=example_registry.name, + resource_group_name=example_registry.resource_group_name, + actions=[ + "repositories/hello-world/content/delete", + "repositories/hello-world/content/read", + "repositories/hello-world/content/write", + "repositories/hello-world/metadata/read", + "repositories/hello-world/metadata/write", + "gateway/examplecr/config/read", + "gateway/examplecr/config/write", + "gateway/examplecr/message/read", + "gateway/examplecr/message/write", + ]) + example_registry_token = azure.containerservice.RegistryToken("exampleRegistryToken", + container_registry_name=example_registry.name, + resource_group_name=example_registry.resource_group_name, + scope_map_id=example_registry_scope_map.id) + example_connected_registry = azure.containerservice.ConnectedRegistry("exampleConnectedRegistry", + container_registry_id=example_registry.id, + sync_token_id=example_registry_token.id) + ``` + ## Import Container Connected Registries can be imported using the `resource id`, e.g. @@ -580,6 +615,41 @@ def __init__(__self__, """ Manages a Container Connected Registry. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + data_endpoint_enabled=True) + example_registry_scope_map = azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", + container_registry_name=example_registry.name, + resource_group_name=example_registry.resource_group_name, + actions=[ + "repositories/hello-world/content/delete", + "repositories/hello-world/content/read", + "repositories/hello-world/content/write", + "repositories/hello-world/metadata/read", + "repositories/hello-world/metadata/write", + "gateway/examplecr/config/read", + "gateway/examplecr/config/write", + "gateway/examplecr/message/read", + "gateway/examplecr/message/write", + ]) + example_registry_token = azure.containerservice.RegistryToken("exampleRegistryToken", + container_registry_name=example_registry.name, + resource_group_name=example_registry.resource_group_name, + scope_map_id=example_registry_scope_map.id) + example_connected_registry = azure.containerservice.ConnectedRegistry("exampleConnectedRegistry", + container_registry_id=example_registry.id, + sync_token_id=example_registry_token.id) + ``` + ## Import Container Connected Registries can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/flux_configuration.py b/sdk/python/pulumi_azure/containerservice/flux_configuration.py index b3dedc994b..19c7611c0f 100644 --- a/sdk/python/pulumi_azure/containerservice/flux_configuration.py +++ b/sdk/python/pulumi_azure/containerservice/flux_configuration.py @@ -408,6 +408,42 @@ def __init__(__self__, """ Manages a Kubernetes Flux Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location="West Europe", + resource_group_name=example_resource_group.name, + dns_prefix="example-aks", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_DS2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + )) + example_kubernetes_cluster_extension = azure.containerservice.KubernetesClusterExtension("exampleKubernetesClusterExtension", + cluster_id=azurerm_kubernetes_cluster["test"]["id"], + extension_type="microsoft.flux") + example_flux_configuration = azure.containerservice.FluxConfiguration("exampleFluxConfiguration", + cluster_id=azurerm_kubernetes_cluster["test"]["id"], + namespace="flux", + git_repository=azure.containerservice.FluxConfigurationGitRepositoryArgs( + url="https://github.com/Azure/arc-k8s-demo", + reference_type="branch", + reference_value="main", + ), + kustomizations=[azure.containerservice.FluxConfigurationKustomizationArgs( + name="kustomization-1", + )], + opts=pulumi.ResourceOptions(depends_on=[example_kubernetes_cluster_extension])) + ``` + ## Import Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. @@ -437,6 +473,42 @@ def __init__(__self__, """ Manages a Kubernetes Flux Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location="West Europe", + resource_group_name=example_resource_group.name, + dns_prefix="example-aks", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_DS2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + )) + example_kubernetes_cluster_extension = azure.containerservice.KubernetesClusterExtension("exampleKubernetesClusterExtension", + cluster_id=azurerm_kubernetes_cluster["test"]["id"], + extension_type="microsoft.flux") + example_flux_configuration = azure.containerservice.FluxConfiguration("exampleFluxConfiguration", + cluster_id=azurerm_kubernetes_cluster["test"]["id"], + namespace="flux", + git_repository=azure.containerservice.FluxConfigurationGitRepositoryArgs( + url="https://github.com/Azure/arc-k8s-demo", + reference_type="branch", + reference_value="main", + ), + kustomizations=[azure.containerservice.FluxConfigurationKustomizationArgs( + name="kustomization-1", + )], + opts=pulumi.ResourceOptions(depends_on=[example_kubernetes_cluster_extension])) + ``` + ## Import Kubernetes Flux Configuration can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/get_cluster_node_pool.py b/sdk/python/pulumi_azure/containerservice/get_cluster_node_pool.py index 543b37e4a5..5dd7ab5b64 100644 --- a/sdk/python/pulumi_azure/containerservice/get_cluster_node_pool.py +++ b/sdk/python/pulumi_azure/containerservice/get_cluster_node_pool.py @@ -355,6 +355,18 @@ def get_cluster_node_pool(kubernetes_cluster_name: Optional[str] = None, """ Use this data source to access information about an existing Kubernetes Cluster Node Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_cluster_node_pool(name="existing", + kubernetes_cluster_name="existing-cluster", + resource_group_name="existing-resource-group") + pulumi.export("id", example.id) + ``` + :param str kubernetes_cluster_name: The Name of the Kubernetes Cluster where this Node Pool is located. :param str name: The name of this Kubernetes Cluster Node Pool. @@ -405,6 +417,18 @@ def get_cluster_node_pool_output(kubernetes_cluster_name: Optional[pulumi.Input[ """ Use this data source to access information about an existing Kubernetes Cluster Node Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_cluster_node_pool(name="existing", + kubernetes_cluster_name="existing-cluster", + resource_group_name="existing-resource-group") + pulumi.export("id", example.id) + ``` + :param str kubernetes_cluster_name: The Name of the Kubernetes Cluster where this Node Pool is located. :param str name: The name of this Kubernetes Cluster Node Pool. diff --git a/sdk/python/pulumi_azure/containerservice/get_group.py b/sdk/python/pulumi_azure/containerservice/get_group.py index 415ab55269..e1617cf661 100644 --- a/sdk/python/pulumi_azure/containerservice/get_group.py +++ b/sdk/python/pulumi_azure/containerservice/get_group.py @@ -154,6 +154,19 @@ def get_group(name: Optional[str] = None, """ Use this data source to access information about an existing Container Group instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_group(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + pulumi.export("ipAddress", example.ip_address) + pulumi.export("fqdn", example.fqdn) + ``` + :param str name: The name of this Container Group instance. :param str resource_group_name: The name of the Resource Group where the Container Group instance exists. @@ -187,6 +200,19 @@ def get_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Container Group instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_group(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + pulumi.export("ipAddress", example.ip_address) + pulumi.export("fqdn", example.fqdn) + ``` + :param str name: The name of this Container Group instance. :param str resource_group_name: The name of the Resource Group where the Container Group instance exists. diff --git a/sdk/python/pulumi_azure/containerservice/get_kubernetes_cluster.py b/sdk/python/pulumi_azure/containerservice/get_kubernetes_cluster.py index bb206ee498..65bdc653f6 100644 --- a/sdk/python/pulumi_azure/containerservice/get_kubernetes_cluster.py +++ b/sdk/python/pulumi_azure/containerservice/get_kubernetes_cluster.py @@ -549,6 +549,16 @@ def get_kubernetes_cluster(name: Optional[str] = None, """ Use this data source to access information about an existing Managed Kubernetes Cluster (AKS). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_kubernetes_cluster(name="myakscluster", + resource_group_name="my-example-resource-group") + ``` + :param str name: The name of the managed Kubernetes Cluster. :param str resource_group_name: The name of the Resource Group in which the managed Kubernetes Cluster exists. @@ -612,6 +622,16 @@ def get_kubernetes_cluster_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Managed Kubernetes Cluster (AKS). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_kubernetes_cluster(name="myakscluster", + resource_group_name="my-example-resource-group") + ``` + :param str name: The name of the managed Kubernetes Cluster. :param str resource_group_name: The name of the Resource Group in which the managed Kubernetes Cluster exists. diff --git a/sdk/python/pulumi_azure/containerservice/get_kubernetes_node_pool_snapshot.py b/sdk/python/pulumi_azure/containerservice/get_kubernetes_node_pool_snapshot.py index 78bfc47141..af5b8097a7 100644 --- a/sdk/python/pulumi_azure/containerservice/get_kubernetes_node_pool_snapshot.py +++ b/sdk/python/pulumi_azure/containerservice/get_kubernetes_node_pool_snapshot.py @@ -89,6 +89,16 @@ def get_kubernetes_node_pool_snapshot(name: Optional[str] = None, """ Use this data source to access information about an existing Kubernetes Node Pool Snapshot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_kubernetes_node_pool_snapshot(name="example", + resource_group_name="example-resources") + ``` + :param str name: The name of the Kubernetes Node Pool Snapshot. :param str resource_group_name: The name of the Resource Group in which the Kubernetes Node Pool Snapshot exists. @@ -114,6 +124,16 @@ def get_kubernetes_node_pool_snapshot_output(name: Optional[pulumi.Input[str]] = """ Use this data source to access information about an existing Kubernetes Node Pool Snapshot. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_kubernetes_node_pool_snapshot(name="example", + resource_group_name="example-resources") + ``` + :param str name: The name of the Kubernetes Node Pool Snapshot. :param str resource_group_name: The name of the Resource Group in which the Kubernetes Node Pool Snapshot exists. diff --git a/sdk/python/pulumi_azure/containerservice/get_kubernetes_service_versions.py b/sdk/python/pulumi_azure/containerservice/get_kubernetes_service_versions.py index 6b73556302..e93567842a 100644 --- a/sdk/python/pulumi_azure/containerservice/get_kubernetes_service_versions.py +++ b/sdk/python/pulumi_azure/containerservice/get_kubernetes_service_versions.py @@ -102,6 +102,17 @@ def get_kubernetes_service_versions(include_preview: Optional[bool] = None, """ Use this data source to retrieve the version of Kubernetes supported by Azure Kubernetes Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.containerservice.get_kubernetes_service_versions(location="West Europe") + pulumi.export("versions", current.versions) + pulumi.export("latestVersion", current.latest_version) + ``` + :param bool include_preview: Should Preview versions of Kubernetes in AKS be included? Defaults to `true` :param str location: Specifies the location in which to query for versions. @@ -131,6 +142,17 @@ def get_kubernetes_service_versions_output(include_preview: Optional[pulumi.Inpu """ Use this data source to retrieve the version of Kubernetes supported by Azure Kubernetes Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.containerservice.get_kubernetes_service_versions(location="West Europe") + pulumi.export("versions", current.versions) + pulumi.export("latestVersion", current.latest_version) + ``` + :param bool include_preview: Should Preview versions of Kubernetes in AKS be included? Defaults to `true` :param str location: Specifies the location in which to query for versions. diff --git a/sdk/python/pulumi_azure/containerservice/get_registry.py b/sdk/python/pulumi_azure/containerservice/get_registry.py index dbc4b92eba..cf988047c2 100644 --- a/sdk/python/pulumi_azure/containerservice/get_registry.py +++ b/sdk/python/pulumi_azure/containerservice/get_registry.py @@ -164,6 +164,17 @@ def get_registry(name: Optional[str] = None, """ Use this data source to access information about an existing Container Registry. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_registry(name="testacr", + resource_group_name="test") + pulumi.export("loginServer", example.login_server) + ``` + :param str name: The name of the Container Registry. :param str resource_group_name: The Name of the Resource Group where this Container Registry exists. @@ -195,6 +206,17 @@ def get_registry_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Container Registry. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_registry(name="testacr", + resource_group_name="test") + pulumi.export("loginServer", example.login_server) + ``` + :param str name: The name of the Container Registry. :param str resource_group_name: The Name of the Resource Group where this Container Registry exists. diff --git a/sdk/python/pulumi_azure/containerservice/get_registry_scope_map.py b/sdk/python/pulumi_azure/containerservice/get_registry_scope_map.py index 226602725a..e02d971dca 100644 --- a/sdk/python/pulumi_azure/containerservice/get_registry_scope_map.py +++ b/sdk/python/pulumi_azure/containerservice/get_registry_scope_map.py @@ -99,6 +99,18 @@ def get_registry_scope_map(container_registry_name: Optional[str] = None, """ Use this data source to access information about an existing Container Registry scope map. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_registry_scope_map(name="example-scope-map", + resource_group_name="example-resource-group", + container_registry_name="example-registry") + pulumi.export("actions", example.actions) + ``` + :param str container_registry_name: The Name of the Container Registry where the token exists. :param str name: The name of the Container Registry token. @@ -128,6 +140,18 @@ def get_registry_scope_map_output(container_registry_name: Optional[pulumi.Input """ Use this data source to access information about an existing Container Registry scope map. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_registry_scope_map(name="example-scope-map", + resource_group_name="example-resource-group", + container_registry_name="example-registry") + pulumi.export("actions", example.actions) + ``` + :param str container_registry_name: The Name of the Container Registry where the token exists. :param str name: The name of the Container Registry token. diff --git a/sdk/python/pulumi_azure/containerservice/get_registry_token.py b/sdk/python/pulumi_azure/containerservice/get_registry_token.py index ffdabc618f..2baa4a530d 100644 --- a/sdk/python/pulumi_azure/containerservice/get_registry_token.py +++ b/sdk/python/pulumi_azure/containerservice/get_registry_token.py @@ -102,6 +102,18 @@ def get_registry_token(container_registry_name: Optional[str] = None, """ Use this data source to access information about an existing Container Registry token. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_registry_token(name="exampletoken", + resource_group_name="example-resource-group", + container_registry_name="example-registry") + pulumi.export("scopeMapId", example.scope_map_id) + ``` + :param str container_registry_name: The Name of the Container Registry where the token exists. :param str name: The name of the Container Registry token. @@ -131,6 +143,18 @@ def get_registry_token_output(container_registry_name: Optional[pulumi.Input[str """ Use this data source to access information about an existing Container Registry token. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.containerservice.get_registry_token(name="exampletoken", + resource_group_name="example-resource-group", + container_registry_name="example-registry") + pulumi.export("scopeMapId", example.scope_map_id) + ``` + :param str container_registry_name: The Name of the Container Registry where the token exists. :param str name: The name of the Container Registry token. diff --git a/sdk/python/pulumi_azure/containerservice/group.py b/sdk/python/pulumi_azure/containerservice/group.py index 1befc54650..7606cb4dd0 100644 --- a/sdk/python/pulumi_azure/containerservice/group.py +++ b/sdk/python/pulumi_azure/containerservice/group.py @@ -1005,6 +1005,44 @@ def __init__(__self__, > **Note** `network_profile_id` is [deprecated](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet) by Azure. For users who want to continue to manage existing `containerservice.Group` that rely on `network_profile_id`, please stay on provider versions prior to v3.16.0. Otherwise, use `subnet_ids` instead. + ## Example Usage + + This example provisions a Basic Container. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_group = azure.containerservice.Group("exampleGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_address_type="Public", + dns_name_label="aci-label", + os_type="Linux", + containers=[ + azure.containerservice.GroupContainerArgs( + name="hello-world", + image="mcr.microsoft.com/azuredocs/aci-helloworld:latest", + cpu=0.5, + memory=1.5, + ports=[azure.containerservice.GroupContainerPortArgs( + port=443, + protocol="TCP", + )], + ), + azure.containerservice.GroupContainerArgs( + name="sidecar", + image="mcr.microsoft.com/azuredocs/aci-tutorial-sidecar", + cpu=0.5, + memory=1.5, + ), + ], + tags={ + "environment": "testing", + }) + ``` + ## Import Container Group's can be imported using the `resource id`, e.g. @@ -1056,6 +1094,44 @@ def __init__(__self__, > **Note** `network_profile_id` is [deprecated](https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet) by Azure. For users who want to continue to manage existing `containerservice.Group` that rely on `network_profile_id`, please stay on provider versions prior to v3.16.0. Otherwise, use `subnet_ids` instead. + ## Example Usage + + This example provisions a Basic Container. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_group = azure.containerservice.Group("exampleGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_address_type="Public", + dns_name_label="aci-label", + os_type="Linux", + containers=[ + azure.containerservice.GroupContainerArgs( + name="hello-world", + image="mcr.microsoft.com/azuredocs/aci-helloworld:latest", + cpu=0.5, + memory=1.5, + ports=[azure.containerservice.GroupContainerPortArgs( + port=443, + protocol="TCP", + )], + ), + azure.containerservice.GroupContainerArgs( + name="sidecar", + image="mcr.microsoft.com/azuredocs/aci-tutorial-sidecar", + cpu=0.5, + memory=1.5, + ), + ], + tags={ + "environment": "testing", + }) + ``` + ## Import Container Group's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/kubernetes_cluster.py b/sdk/python/pulumi_azure/containerservice/kubernetes_cluster.py index 0bd7f9bcaa..28081579ef 100644 --- a/sdk/python/pulumi_azure/containerservice/kubernetes_cluster.py +++ b/sdk/python/pulumi_azure/containerservice/kubernetes_cluster.py @@ -147,6 +147,28 @@ def __init__(__self__, *, :param pulumi.Input[bool] private_cluster_public_fqdn_enabled: Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_zone.id, + role_definition_name="Private DNS Zone Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="aksexamplednsprefix1", + private_cluster_enabled=True, + private_dns_zone_id=example_zone.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` :param pulumi.Input[str] private_dns_zone_id: Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. :param pulumi.Input[bool] public_network_access_enabled: Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`. @@ -1063,6 +1085,28 @@ def private_cluster_public_fqdn_enabled(self) -> Optional[pulumi.Input[bool]]: Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_zone.id, + role_definition_name="Private DNS Zone Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="aksexamplednsprefix1", + private_cluster_enabled=True, + private_dns_zone_id=example_zone.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` """ return pulumi.get(self, "private_cluster_public_fqdn_enabled") @@ -1394,6 +1438,28 @@ def __init__(__self__, *, :param pulumi.Input[bool] private_cluster_public_fqdn_enabled: Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_zone.id, + role_definition_name="Private DNS Zone Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="aksexamplednsprefix1", + private_cluster_enabled=True, + private_dns_zone_id=example_zone.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` :param pulumi.Input[str] private_dns_zone_id: Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. :param pulumi.Input[str] private_fqdn: The FQDN for the Kubernetes Cluster when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster. :param pulumi.Input[bool] public_network_access_enabled: Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`. @@ -2464,6 +2530,28 @@ def private_cluster_public_fqdn_enabled(self) -> Optional[pulumi.Input[bool]]: Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_zone.id, + role_definition_name="Private DNS Zone Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="aksexamplednsprefix1", + private_cluster_enabled=True, + private_dns_zone_id=example_zone.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` """ return pulumi.get(self, "private_cluster_public_fqdn_enabled") @@ -2732,6 +2820,34 @@ def __init__(__self__, """ Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service) + ## Example Usage + + This example provisions a basic Managed Kubernetes Cluster. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="exampleaks1", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_D2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Environment": "Production", + }) + pulumi.export("clientCertificate", example_kubernetes_cluster.kube_configs[0].client_certificate) + pulumi.export("kubeConfig", example_kubernetes_cluster.kube_config_raw) + ``` + ## Import Managed Kubernetes Clusters can be imported using the `resource id`, e.g. @@ -2814,6 +2930,28 @@ def __init__(__self__, :param pulumi.Input[bool] private_cluster_public_fqdn_enabled: Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_zone.id, + role_definition_name="Private DNS Zone Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="aksexamplednsprefix1", + private_cluster_enabled=True, + private_dns_zone_id=example_zone.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` :param pulumi.Input[str] private_dns_zone_id: Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. :param pulumi.Input[bool] public_network_access_enabled: Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`. @@ -2850,6 +2988,34 @@ def __init__(__self__, """ Manages a Managed Kubernetes Cluster (also known as AKS / Azure Kubernetes Service) + ## Example Usage + + This example provisions a basic Managed Kubernetes Cluster. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="exampleaks1", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_D2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Environment": "Production", + }) + pulumi.export("clientCertificate", example_kubernetes_cluster.kube_configs[0].client_certificate) + pulumi.export("kubeConfig", example_kubernetes_cluster.kube_config_raw) + ``` + ## Import Managed Kubernetes Clusters can be imported using the `resource id`, e.g. @@ -3204,6 +3370,28 @@ def get(resource_name: str, :param pulumi.Input[bool] private_cluster_public_fqdn_enabled: Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_zone.id, + role_definition_name="Private DNS Zone Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="aksexamplednsprefix1", + private_cluster_enabled=True, + private_dns_zone_id=example_zone.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` :param pulumi.Input[str] private_dns_zone_id: Either the ID of Private DNS Zone which should be delegated to this Cluster, `System` to have AKS manage this or `None`. In case of `None` you will need to bring your own DNS server and set up resolving, otherwise, the cluster will have issues after provisioning. Changing this forces a new resource to be created. :param pulumi.Input[str] private_fqdn: The FQDN for the Kubernetes Cluster when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster. :param pulumi.Input[bool] public_network_access_enabled: Whether public network access is allowed for this Kubernetes Cluster. Defaults to `true`. @@ -3741,6 +3929,28 @@ def private_cluster_public_fqdn_enabled(self) -> pulumi.Output[Optional[bool]]: Specifies whether a Public FQDN for this Private Cluster should be added. Defaults to `false`. > **Note:** If you use BYO DNS Zone, the AKS cluster should either use a User Assigned Identity or a service principal (which is deprecated) with the `Private DNS Zone Contributor` role and access to this Private DNS Zone. If `UserAssigned` identity is used - to prevent improper resource order destruction - the cluster should depend on the role assignment, like in this example: + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_zone.id, + role_definition_name="Private DNS Zone Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="aksexamplednsprefix1", + private_cluster_enabled=True, + private_dns_zone_id=example_zone.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` """ return pulumi.get(self, "private_cluster_public_fqdn_enabled") diff --git a/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_extension.py b/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_extension.py index 235d7e8166..ee1fcbc500 100644 --- a/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_extension.py +++ b/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_extension.py @@ -496,6 +496,30 @@ def __init__(__self__, """ Manages a Kubernetes Cluster Extension. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location="West Europe", + resource_group_name=example_resource_group.name, + dns_prefix="example-aks", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_DS2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + )) + example_kubernetes_cluster_extension = azure.containerservice.KubernetesClusterExtension("exampleKubernetesClusterExtension", + cluster_id=example_kubernetes_cluster.id, + extension_type="microsoft.flux") + ``` + ## Import Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. @@ -526,6 +550,30 @@ def __init__(__self__, """ Manages a Kubernetes Cluster Extension. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location="West Europe", + resource_group_name=example_resource_group.name, + dns_prefix="example-aks", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_DS2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + )) + example_kubernetes_cluster_extension = azure.containerservice.KubernetesClusterExtension("exampleKubernetesClusterExtension", + cluster_id=example_kubernetes_cluster.id, + extension_type="microsoft.flux") + ``` + ## Import Kubernetes Cluster Extension can be imported using the `resource id` for different `cluster_resource_name`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_node_pool.py b/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_node_pool.py index 3bccc6babc..feae67f0a6 100644 --- a/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_node_pool.py +++ b/sdk/python/pulumi_azure/containerservice/kubernetes_cluster_node_pool.py @@ -1866,6 +1866,37 @@ def __init__(__self__, > **NOTE:** Multiple Node Pools are only supported when the Kubernetes Cluster is using Virtual Machine Scale Sets. + ## Example Usage + + This example provisions a basic Kubernetes Node Pool. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="exampleaks1", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_D2_v2", + ), + service_principal=azure.containerservice.KubernetesClusterServicePrincipalArgs( + client_id="00000000-0000-0000-0000-000000000000", + client_secret="00000000000000000000000000000000", + )) + example_kubernetes_cluster_node_pool = azure.containerservice.KubernetesClusterNodePool("exampleKubernetesClusterNodePool", + kubernetes_cluster_id=example_kubernetes_cluster.id, + vm_size="Standard_DS2_v2", + node_count=1, + tags={ + "Environment": "Production", + }) + ``` + ## Import Kubernetes Cluster Node Pools can be imported using the `resource id`, e.g. @@ -1956,6 +1987,37 @@ def __init__(__self__, > **NOTE:** Multiple Node Pools are only supported when the Kubernetes Cluster is using Virtual Machine Scale Sets. + ## Example Usage + + This example provisions a basic Kubernetes Node Pool. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="exampleaks1", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_D2_v2", + ), + service_principal=azure.containerservice.KubernetesClusterServicePrincipalArgs( + client_id="00000000-0000-0000-0000-000000000000", + client_secret="00000000000000000000000000000000", + )) + example_kubernetes_cluster_node_pool = azure.containerservice.KubernetesClusterNodePool("exampleKubernetesClusterNodePool", + kubernetes_cluster_id=example_kubernetes_cluster.id, + vm_size="Standard_DS2_v2", + node_count=1, + tags={ + "Environment": "Production", + }) + ``` + ## Import Kubernetes Cluster Node Pools can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/kubernetes_fleet_manager.py b/sdk/python/pulumi_azure/containerservice/kubernetes_fleet_manager.py index 3e04b3ed16..fb5cb2b0df 100644 --- a/sdk/python/pulumi_azure/containerservice/kubernetes_fleet_manager.py +++ b/sdk/python/pulumi_azure/containerservice/kubernetes_fleet_manager.py @@ -255,6 +255,17 @@ def __init__(__self__, > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name FleetResourcePreview` and then `az provider register -n Microsoft.ContainerService` . + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_fleet_manager = azure.containerservice.KubernetesFleetManager("exampleKubernetesFleetManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` ## Blocks Reference ### `hub_profile` Block @@ -300,6 +311,17 @@ def __init__(__self__, > **Note:** This Resource is in **Preview** to use this you must be opted into the Preview. You can do this by running `az feature register --namespace Microsoft.ContainerService --name FleetResourcePreview` and then `az provider register -n Microsoft.ContainerService` . + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_kubernetes_fleet_manager = azure.containerservice.KubernetesFleetManager("exampleKubernetesFleetManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` ## Blocks Reference ### `hub_profile` Block diff --git a/sdk/python/pulumi_azure/containerservice/outputs.py b/sdk/python/pulumi_azure/containerservice/outputs.py index 7f366ee8d9..707d22e390 100644 --- a/sdk/python/pulumi_azure/containerservice/outputs.py +++ b/sdk/python/pulumi_azure/containerservice/outputs.py @@ -3347,6 +3347,19 @@ def __init__(__self__, *, > **Note:** At this time ACI Connectors are not supported in Azure China. > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + + ```python + import pulumi + import pulumi_azure as azure + + virtual = azure.network.Subnet("virtual", delegations=[azure.network.SubnetDelegationArgs( + name="aciDelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + name="Microsoft.ContainerInstance/containerGroups", + ), + )]) + ``` :param Sequence['KubernetesClusterAciConnectorLinuxConnectorIdentityArgs'] connector_identities: A `connector_identity` block is exported. The exported attributes are defined below. """ KubernetesClusterAciConnectorLinux._configure( @@ -3381,6 +3394,19 @@ def subnet_name(self) -> str: > **Note:** At this time ACI Connectors are not supported in Azure China. > **Note:** AKS will add a delegation to the subnet named here. To prevent further runs from failing you should make sure that the subnet you create for virtual nodes has a delegation, like so. + + ```python + import pulumi + import pulumi_azure as azure + + virtual = azure.network.Subnet("virtual", delegations=[azure.network.SubnetDelegationArgs( + name="aciDelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + name="Microsoft.ContainerInstance/containerGroups", + ), + )]) + ``` """ return pulumi.get(self, "subnet_name") diff --git a/sdk/python/pulumi_azure/containerservice/registry.py b/sdk/python/pulumi_azure/containerservice/registry.py index 6d4b34e7b1..d7f9c0a175 100644 --- a/sdk/python/pulumi_azure/containerservice/registry.py +++ b/sdk/python/pulumi_azure/containerservice/registry.py @@ -901,6 +901,90 @@ def __init__(__self__, """ Manages an Azure Container Registry. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + acr = azure.containerservice.Registry("acr", + resource_group_name=example.name, + location=example.location, + sku="Premium", + admin_enabled=False, + georeplications=[ + azure.containerservice.RegistryGeoreplicationArgs( + location="East US", + zone_redundancy_enabled=True, + tags={}, + ), + azure.containerservice.RegistryGeoreplicationArgs( + location="North Europe", + zone_redundancy_enabled=True, + tags={}, + ), + ]) + ``` + ### Encryption) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_key = azure.keyvault.get_key(name="super-secret", + key_vault_id=data["azurerm_key_vault"]["existing"]["id"]) + acr = azure.containerservice.Registry("acr", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + identity=azure.containerservice.RegistryIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + encryption=azure.containerservice.RegistryEncryptionArgs( + enabled=True, + key_vault_key_id=example_key.id, + identity_client_id=example_user_assigned_identity.client_id, + )) + ``` + ### Attaching A Container Registry To A Kubernetes Cluster) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="exampleaks1", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_D2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Environment": "Production", + }) + example_assignment = azure.authorization.Assignment("exampleAssignment", + principal_id=example_kubernetes_cluster.kubelet_identity.object_id, + role_definition_name="AcrPull", + scope=example_registry.id, + skip_service_principal_aad_check=True) + ``` + ## Import Container Registries can be imported using the `resource id`, e.g. @@ -948,6 +1032,90 @@ def __init__(__self__, """ Manages an Azure Container Registry. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + acr = azure.containerservice.Registry("acr", + resource_group_name=example.name, + location=example.location, + sku="Premium", + admin_enabled=False, + georeplications=[ + azure.containerservice.RegistryGeoreplicationArgs( + location="East US", + zone_redundancy_enabled=True, + tags={}, + ), + azure.containerservice.RegistryGeoreplicationArgs( + location="North Europe", + zone_redundancy_enabled=True, + tags={}, + ), + ]) + ``` + ### Encryption) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_key = azure.keyvault.get_key(name="super-secret", + key_vault_id=data["azurerm_key_vault"]["existing"]["id"]) + acr = azure.containerservice.Registry("acr", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + identity=azure.containerservice.RegistryIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + encryption=azure.containerservice.RegistryEncryptionArgs( + enabled=True, + key_vault_key_id=example_key.id, + identity_client_id=example_user_assigned_identity.client_id, + )) + ``` + ### Attaching A Container Registry To A Kubernetes Cluster) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium") + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix="exampleaks1", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=1, + vm_size="Standard_D2_v2", + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Environment": "Production", + }) + example_assignment = azure.authorization.Assignment("exampleAssignment", + principal_id=example_kubernetes_cluster.kubelet_identity.object_id, + role_definition_name="AcrPull", + scope=example_registry.id, + skip_service_principal_aad_check=True) + ``` + ## Import Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/registry_agent_pool.py b/sdk/python/pulumi_azure/containerservice/registry_agent_pool.py index a30f408e98..3f3417e502 100644 --- a/sdk/python/pulumi_azure/containerservice/registry_agent_pool.py +++ b/sdk/python/pulumi_azure/containerservice/registry_agent_pool.py @@ -368,6 +368,23 @@ def __init__(__self__, """ Manages an Azure Container Registry Agent Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europ") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium") + example_registry_agent_pool = azure.containerservice.RegistryAgentPool("exampleRegistryAgentPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + container_registry_name=example_registry.name) + ``` + ## Import Azure Container Registry Agent Pool can be imported using the `resource id`, e.g. @@ -396,6 +413,23 @@ def __init__(__self__, """ Manages an Azure Container Registry Agent Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europ") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium") + example_registry_agent_pool = azure.containerservice.RegistryAgentPool("exampleRegistryAgentPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + container_registry_name=example_registry.name) + ``` + ## Import Azure Container Registry Agent Pool can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/registry_scope_map.py b/sdk/python/pulumi_azure/containerservice/registry_scope_map.py index 1068faa9da..ee0d668e64 100644 --- a/sdk/python/pulumi_azure/containerservice/registry_scope_map.py +++ b/sdk/python/pulumi_azure/containerservice/registry_scope_map.py @@ -250,6 +250,33 @@ def __init__(__self__, """ Manages an Azure Container Registry scope map. Scope Maps are a preview feature only available in Premium SKU Container registries. + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + admin_enabled=False, + georeplications=[ + azure.containerservice.RegistryGeoreplicationArgs( + location="East US", + ), + azure.containerservice.RegistryGeoreplicationArgs( + location="West Europe", + ), + ]) + example_registry_scope_map = azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", + container_registry_name=example_registry.name, + resource_group_name=example_resource_group.name, + actions=[ + "repositories/repo1/content/read", + "repositories/repo1/content/write", + ]) + ``` + ## Import Container Registries can be imported using the `resource id`, e.g. @@ -275,6 +302,33 @@ def __init__(__self__, """ Manages an Azure Container Registry scope map. Scope Maps are a preview feature only available in Premium SKU Container registries. + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + admin_enabled=False, + georeplications=[ + azure.containerservice.RegistryGeoreplicationArgs( + location="East US", + ), + azure.containerservice.RegistryGeoreplicationArgs( + location="West Europe", + ), + ]) + example_registry_scope_map = azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", + container_registry_name=example_registry.name, + resource_group_name=example_resource_group.name, + actions=[ + "repositories/repo1/content/read", + "repositories/repo1/content/write", + ]) + ``` + ## Import Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/registry_task.py b/sdk/python/pulumi_azure/containerservice/registry_task.py index f95c6abeea..369ef8fc43 100644 --- a/sdk/python/pulumi_azure/containerservice/registry_task.py +++ b/sdk/python/pulumi_azure/containerservice/registry_task.py @@ -791,6 +791,30 @@ def __init__(__self__, """ Manages a Container Registry Task. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Basic") + example_registry_task = azure.containerservice.RegistryTask("exampleRegistryTask", + container_registry_id=example_registry.id, + platform=azure.containerservice.RegistryTaskPlatformArgs( + os="Linux", + ), + docker_step=azure.containerservice.RegistryTaskDockerStepArgs( + dockerfile_path="Dockerfile", + context_path="https://github.com//#:", + context_access_token="", + image_names=["helloworld:{{.Run.ID}}"], + )) + ``` + ## Import Container Registry Tasks can be imported using the `resource id`, e.g. @@ -833,6 +857,30 @@ def __init__(__self__, """ Manages a Container Registry Task. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Basic") + example_registry_task = azure.containerservice.RegistryTask("exampleRegistryTask", + container_registry_id=example_registry.id, + platform=azure.containerservice.RegistryTaskPlatformArgs( + os="Linux", + ), + docker_step=azure.containerservice.RegistryTaskDockerStepArgs( + dockerfile_path="Dockerfile", + context_path="https://github.com//#:", + context_access_token="", + image_names=["helloworld:{{.Run.ID}}"], + )) + ``` + ## Import Container Registry Tasks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/registry_task_schedule_run_now.py b/sdk/python/pulumi_azure/containerservice/registry_task_schedule_run_now.py index 6d741e713e..d551147154 100644 --- a/sdk/python/pulumi_azure/containerservice/registry_task_schedule_run_now.py +++ b/sdk/python/pulumi_azure/containerservice/registry_task_schedule_run_now.py @@ -96,6 +96,31 @@ def __init__(__self__, """ Runs a Container Registry Task Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Basic") + example_registry_task = azure.containerservice.RegistryTask("exampleRegistryTask", + container_registry_id=example_registry.id, + platform=azure.containerservice.RegistryTaskPlatformArgs( + os="Linux", + ), + docker_step=azure.containerservice.RegistryTaskDockerStepArgs( + dockerfile_path="Dockerfile", + context_path="https://github.com//acr-build-helloworld-node#main", + context_access_token="", + image_names=["helloworld:{{.Run.ID}}"], + )) + example_registry_task_schedule_run_now = azure.containerservice.RegistryTaskScheduleRunNow("exampleRegistryTaskScheduleRunNow", container_registry_task_id=example_registry_task.id) + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] container_registry_task_id: The ID of the Container Registry Task that to be scheduled. Changing this forces a new Container Registry Task Schedule to be created. @@ -109,6 +134,31 @@ def __init__(__self__, """ Runs a Container Registry Task Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Basic") + example_registry_task = azure.containerservice.RegistryTask("exampleRegistryTask", + container_registry_id=example_registry.id, + platform=azure.containerservice.RegistryTaskPlatformArgs( + os="Linux", + ), + docker_step=azure.containerservice.RegistryTaskDockerStepArgs( + dockerfile_path="Dockerfile", + context_path="https://github.com//acr-build-helloworld-node#main", + context_access_token="", + image_names=["helloworld:{{.Run.ID}}"], + )) + example_registry_task_schedule_run_now = azure.containerservice.RegistryTaskScheduleRunNow("exampleRegistryTaskScheduleRunNow", container_registry_task_id=example_registry_task.id) + ``` + :param str resource_name: The name of the resource. :param RegistryTaskScheduleRunNowArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_azure/containerservice/registry_token.py b/sdk/python/pulumi_azure/containerservice/registry_token.py index 03c96fcb24..b0b1d599b3 100644 --- a/sdk/python/pulumi_azure/containerservice/registry_token.py +++ b/sdk/python/pulumi_azure/containerservice/registry_token.py @@ -254,6 +254,37 @@ def __init__(__self__, """ Manages an Azure Container Registry token. Tokens are a preview feature only available in Premium SKU Container registries. + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + admin_enabled=False, + georeplications=[ + azure.containerservice.RegistryGeoreplicationArgs( + location="East US", + ), + azure.containerservice.RegistryGeoreplicationArgs( + location="West Europe", + ), + ]) + example_registry_scope_map = azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", + container_registry_name=example_registry.name, + resource_group_name=example_resource_group.name, + actions=[ + "repositories/repo1/content/read", + "repositories/repo1/content/write", + ]) + example_registry_token = azure.containerservice.RegistryToken("exampleRegistryToken", + container_registry_name=example_registry.name, + resource_group_name=example_resource_group.name, + scope_map_id=example_registry_scope_map.id) + ``` + ## Import Container Registries can be imported using the `resource id`, e.g. @@ -279,6 +310,37 @@ def __init__(__self__, """ Manages an Azure Container Registry token. Tokens are a preview feature only available in Premium SKU Container registries. + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_registry = azure.containerservice.Registry("exampleRegistry", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Premium", + admin_enabled=False, + georeplications=[ + azure.containerservice.RegistryGeoreplicationArgs( + location="East US", + ), + azure.containerservice.RegistryGeoreplicationArgs( + location="West Europe", + ), + ]) + example_registry_scope_map = azure.containerservice.RegistryScopeMap("exampleRegistryScopeMap", + container_registry_name=example_registry.name, + resource_group_name=example_resource_group.name, + actions=[ + "repositories/repo1/content/read", + "repositories/repo1/content/write", + ]) + example_registry_token = azure.containerservice.RegistryToken("exampleRegistryToken", + container_registry_name=example_registry.name, + resource_group_name=example_resource_group.name, + scope_map_id=example_registry_scope_map.id) + ``` + ## Import Container Registries can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/registry_webhook.py b/sdk/python/pulumi_azure/containerservice/registry_webhook.py index 34f82a6c66..241c580a7d 100644 --- a/sdk/python/pulumi_azure/containerservice/registry_webhook.py +++ b/sdk/python/pulumi_azure/containerservice/registry_webhook.py @@ -444,6 +444,31 @@ def __init__(__self__, """ Manages an Azure Container Registry Webhook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + acr = azure.containerservice.Registry("acr", + resource_group_name=example.name, + location=example.location, + sku="Standard", + admin_enabled=False) + webhook = azure.containerservice.RegistryWebhook("webhook", + resource_group_name=example.name, + registry_name=acr.name, + location=example.location, + service_uri="https://mywebhookreceiver.example/mytag", + status="enabled", + scope="mytag:*", + actions=["push"], + custom_headers={ + "Content-Type": "application/json", + }) + ``` + ## Import Container Registry Webhooks can be imported using the `resource id`, e.g. @@ -474,6 +499,31 @@ def __init__(__self__, """ Manages an Azure Container Registry Webhook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + acr = azure.containerservice.Registry("acr", + resource_group_name=example.name, + location=example.location, + sku="Standard", + admin_enabled=False) + webhook = azure.containerservice.RegistryWebhook("webhook", + resource_group_name=example.name, + registry_name=acr.name, + location=example.location, + service_uri="https://mywebhookreceiver.example/mytag", + status="enabled", + scope="mytag:*", + actions=["push"], + custom_headers={ + "Content-Type": "application/json", + }) + ``` + ## Import Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/containerservice/registry_webook.py b/sdk/python/pulumi_azure/containerservice/registry_webook.py index 0e53335bb9..4f09718e42 100644 --- a/sdk/python/pulumi_azure/containerservice/registry_webook.py +++ b/sdk/python/pulumi_azure/containerservice/registry_webook.py @@ -449,6 +449,31 @@ def __init__(__self__, """ Manages an Azure Container Registry Webhook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + acr = azure.containerservice.Registry("acr", + resource_group_name=example.name, + location=example.location, + sku="Standard", + admin_enabled=False) + webhook = azure.containerservice.RegistryWebhook("webhook", + resource_group_name=example.name, + registry_name=acr.name, + location=example.location, + service_uri="https://mywebhookreceiver.example/mytag", + status="enabled", + scope="mytag:*", + actions=["push"], + custom_headers={ + "Content-Type": "application/json", + }) + ``` + ## Import Container Registry Webhooks can be imported using the `resource id`, e.g. @@ -479,6 +504,31 @@ def __init__(__self__, """ Manages an Azure Container Registry Webhook. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + acr = azure.containerservice.Registry("acr", + resource_group_name=example.name, + location=example.location, + sku="Standard", + admin_enabled=False) + webhook = azure.containerservice.RegistryWebhook("webhook", + resource_group_name=example.name, + registry_name=acr.name, + location=example.location, + service_uri="https://mywebhookreceiver.example/mytag", + status="enabled", + scope="mytag:*", + actions=["push"], + custom_headers={ + "Content-Type": "application/json", + }) + ``` + ## Import Container Registry Webhooks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/custom_provider.py b/sdk/python/pulumi_azure/core/custom_provider.py index f4f9e1559d..ef8735a728 100644 --- a/sdk/python/pulumi_azure/core/custom_provider.py +++ b/sdk/python/pulumi_azure/core/custom_provider.py @@ -324,6 +324,22 @@ def __init__(__self__, """ Manages an Azure Custom Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_custom_provider = azure.core.CustomProvider("exampleCustomProvider", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + resource_types=[azure.core.CustomProviderResourceTypeArgs( + name="dEf1", + endpoint="https://testendpoint.com/", + )]) + ``` + ## Import Custom Provider can be imported using the `resource id`, e.g. @@ -351,6 +367,22 @@ def __init__(__self__, """ Manages an Azure Custom Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_custom_provider = azure.core.CustomProvider("exampleCustomProvider", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + resource_types=[azure.core.CustomProviderResourceTypeArgs( + name="dEf1", + endpoint="https://testendpoint.com/", + )]) + ``` + ## Import Custom Provider can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/get_client_config.py b/sdk/python/pulumi_azure/core/get_client_config.py index da3cffdc3e..ddca84806f 100644 --- a/sdk/python/pulumi_azure/core/get_client_config.py +++ b/sdk/python/pulumi_azure/core/get_client_config.py @@ -95,6 +95,16 @@ def __await__(self): def get_client_config(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetClientConfigResult: """ Use this data source to access the configuration of the AzureRM provider. + + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + pulumi.export("accountId", current.client_id) + ``` """ __args__ = dict() opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) @@ -112,5 +122,15 @@ def get_client_config(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableG def get_client_config_output(opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetClientConfigResult]: """ Use this data source to access the configuration of the AzureRM provider. + + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + pulumi.export("accountId", current.client_id) + ``` """ ... diff --git a/sdk/python/pulumi_azure/core/get_extended_locations.py b/sdk/python/pulumi_azure/core/get_extended_locations.py index 994a2df17d..c945d32522 100644 --- a/sdk/python/pulumi_azure/core/get_extended_locations.py +++ b/sdk/python/pulumi_azure/core/get_extended_locations.py @@ -70,6 +70,15 @@ def get_extended_locations(location: Optional[str] = None, """ This data source return the available Extended Locations for a specific Azure Region. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.get_extended_locations(location="West Europe") + ``` + :param str location: The Azure location to retrieve the Extended Locations for. """ @@ -90,6 +99,15 @@ def get_extended_locations_output(location: Optional[pulumi.Input[str]] = None, """ This data source return the available Extended Locations for a specific Azure Region. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.get_extended_locations(location="West Europe") + ``` + :param str location: The Azure location to retrieve the Extended Locations for. """ diff --git a/sdk/python/pulumi_azure/core/get_resource_group.py b/sdk/python/pulumi_azure/core/get_resource_group.py index faba49ac56..ab9af9f46e 100644 --- a/sdk/python/pulumi_azure/core/get_resource_group.py +++ b/sdk/python/pulumi_azure/core/get_resource_group.py @@ -91,6 +91,16 @@ def get_resource_group(name: Optional[str] = None, """ Use this data source to access information about an existing Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.get_resource_group(name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The Name of this Resource Group. """ @@ -113,6 +123,16 @@ def get_resource_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.get_resource_group(name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The Name of this Resource Group. """ diff --git a/sdk/python/pulumi_azure/core/get_subscription.py b/sdk/python/pulumi_azure/core/get_subscription.py index 2cce887908..4b8f070757 100644 --- a/sdk/python/pulumi_azure/core/get_subscription.py +++ b/sdk/python/pulumi_azure/core/get_subscription.py @@ -145,6 +145,16 @@ def get_subscription(subscription_id: Optional[str] = None, """ Use this data source to access information about an existing Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + pulumi.export("currentSubscriptionDisplayName", current.display_name) + ``` + :param str subscription_id: Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used. """ @@ -171,6 +181,16 @@ def get_subscription_output(subscription_id: Optional[pulumi.Input[Optional[str] """ Use this data source to access information about an existing Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + pulumi.export("currentSubscriptionDisplayName", current.display_name) + ``` + :param str subscription_id: Specifies the ID of the subscription. If this argument is omitted, the subscription ID of the current Azure Resource Manager provider is used. """ diff --git a/sdk/python/pulumi_azure/core/get_subscriptions.py b/sdk/python/pulumi_azure/core/get_subscriptions.py index 840dbe37a6..1d211fe0e8 100644 --- a/sdk/python/pulumi_azure/core/get_subscriptions.py +++ b/sdk/python/pulumi_azure/core/get_subscriptions.py @@ -81,6 +81,17 @@ def get_subscriptions(display_name_contains: Optional[str] = None, """ Use this data source to access information about all the Subscriptions currently available. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + available = azure.core.get_subscriptions() + pulumi.export("availableSubscriptions", available.subscriptions) + pulumi.export("firstAvailableSubscriptionDisplayName", available.subscriptions[0].display_name) + ``` + :param str display_name_contains: A case-insensitive value which must be contained within the `display_name` field, used to filter the results :param str display_name_prefix: A case-insensitive prefix which can be used to filter on the `display_name` field @@ -105,6 +116,17 @@ def get_subscriptions_output(display_name_contains: Optional[pulumi.Input[Option """ Use this data source to access information about all the Subscriptions currently available. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + available = azure.core.get_subscriptions() + pulumi.export("availableSubscriptions", available.subscriptions) + pulumi.export("firstAvailableSubscriptionDisplayName", available.subscriptions[0].display_name) + ``` + :param str display_name_contains: A case-insensitive value which must be contained within the `display_name` field, used to filter the results :param str display_name_prefix: A case-insensitive prefix which can be used to filter on the `display_name` field diff --git a/sdk/python/pulumi_azure/core/get_template_spec_version.py b/sdk/python/pulumi_azure/core/get_template_spec_version.py index 60e4952b21..b4ed2875d5 100644 --- a/sdk/python/pulumi_azure/core/get_template_spec_version.py +++ b/sdk/python/pulumi_azure/core/get_template_spec_version.py @@ -102,6 +102,18 @@ def get_template_spec_version(name: Optional[str] = None, """ Use this data source to access information about an existing Template Spec Version. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.get_template_spec_version(name="exampleTemplateSpec", + resource_group_name="MyResourceGroup", + version="v1.0.4") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Template Spec. :param str resource_group_name: The name of the Resource Group where the Template Spec exists. @@ -131,6 +143,18 @@ def get_template_spec_version_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Template Spec Version. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.get_template_spec_version(name="exampleTemplateSpec", + resource_group_name="MyResourceGroup", + version="v1.0.4") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Template Spec. :param str resource_group_name: The name of the Resource Group where the Template Spec exists. diff --git a/sdk/python/pulumi_azure/core/get_user_assigned_identity.py b/sdk/python/pulumi_azure/core/get_user_assigned_identity.py index d9be73b9b3..65dc4fa131 100644 --- a/sdk/python/pulumi_azure/core/get_user_assigned_identity.py +++ b/sdk/python/pulumi_azure/core/get_user_assigned_identity.py @@ -131,6 +131,18 @@ def get_user_assigned_identity(name: Optional[str] = None, Use this data source to access information about an existing User Assigned Identity. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity", + resource_group_name="name_of_resource_group") + pulumi.export("uaiClientId", example.client_id) + pulumi.export("uaiPrincipalId", example.principal_id) + pulumi.export("uaiTenantId", example.tenant_id) + ``` :param str name: The name of the User Assigned Identity. @@ -162,6 +174,18 @@ def get_user_assigned_identity_output(name: Optional[pulumi.Input[str]] = None, Use this data source to access information about an existing User Assigned Identity. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity", + resource_group_name="name_of_resource_group") + pulumi.export("uaiClientId", example.client_id) + pulumi.export("uaiPrincipalId", example.principal_id) + pulumi.export("uaiTenantId", example.tenant_id) + ``` :param str name: The name of the User Assigned Identity. diff --git a/sdk/python/pulumi_azure/core/portal_tenant_configuration.py b/sdk/python/pulumi_azure/core/portal_tenant_configuration.py index a84f7671b8..73906ebaf6 100644 --- a/sdk/python/pulumi_azure/core/portal_tenant_configuration.py +++ b/sdk/python/pulumi_azure/core/portal_tenant_configuration.py @@ -112,6 +112,15 @@ def __init__(__self__, > **Note:** While assigning the role to the existing/new Service Principal at the Tenant Scope, the user assigning role must already have the `Owner` role assigned at the Tenant Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.PortalTenantConfiguration("example", private_markdown_storage_enforced=True) + ``` + ## Import Portal Tenant Configurations can be imported using the `resource id`, e.g. @@ -143,6 +152,15 @@ def __init__(__self__, > **Note:** While assigning the role to the existing/new Service Principal at the Tenant Scope, the user assigning role must already have the `Owner` role assigned at the Tenant Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.PortalTenantConfiguration("example", private_markdown_storage_enforced=True) + ``` + ## Import Portal Tenant Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_deployment_script_azure_cli.py b/sdk/python/pulumi_azure/core/resource_deployment_script_azure_cli.py index 5b98f5c5bb..01209e15a3 100644 --- a/sdk/python/pulumi_azure/core/resource_deployment_script_azure_cli.py +++ b/sdk/python/pulumi_azure/core/resource_deployment_script_azure_cli.py @@ -746,6 +746,35 @@ def __init__(__self__, """ Manages a Resource Deployment Script of Azure Cli. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_resource_deployment_script_azure_cli = azure.core.ResourceDeploymentScriptAzureCli("exampleResourceDeploymentScriptAzureCli", + resource_group_name=example_resource_group.name, + location="West Europe", + version="2.40.0", + retention_interval="P1D", + command_line="'foo' 'bar'", + cleanup_preference="OnSuccess", + force_update_tag="1", + timeout="PT30M", + script_content=" echo \\"{\\\\\\"name\\\\\\":{\\\\\\"displayName\\\\\\":\\\\\\"$1 $2\\\\\\"}}\\" > $AZ_SCRIPTS_OUTPUT_PATH\\n", + identity=azure.core.ResourceDeploymentScriptAzureCliIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "key": "value", + }) + ``` + ## Import Resource Deployment Script can be imported using the `resource id`, e.g. @@ -783,6 +812,35 @@ def __init__(__self__, """ Manages a Resource Deployment Script of Azure Cli. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_resource_deployment_script_azure_cli = azure.core.ResourceDeploymentScriptAzureCli("exampleResourceDeploymentScriptAzureCli", + resource_group_name=example_resource_group.name, + location="West Europe", + version="2.40.0", + retention_interval="P1D", + command_line="'foo' 'bar'", + cleanup_preference="OnSuccess", + force_update_tag="1", + timeout="PT30M", + script_content=" echo \\"{\\\\\\"name\\\\\\":{\\\\\\"displayName\\\\\\":\\\\\\"$1 $2\\\\\\"}}\\" > $AZ_SCRIPTS_OUTPUT_PATH\\n", + identity=azure.core.ResourceDeploymentScriptAzureCliIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "key": "value", + }) + ``` + ## Import Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_deployment_script_power_shell.py b/sdk/python/pulumi_azure/core/resource_deployment_script_power_shell.py index 99f1477fb3..6871cc1755 100644 --- a/sdk/python/pulumi_azure/core/resource_deployment_script_power_shell.py +++ b/sdk/python/pulumi_azure/core/resource_deployment_script_power_shell.py @@ -746,6 +746,40 @@ def __init__(__self__, """ Manages a Resource Deployment Script of Azure PowerShell. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_resource_deployment_script_power_shell = azure.core.ResourceDeploymentScriptPowerShell("exampleResourceDeploymentScriptPowerShell", + resource_group_name=example_resource_group.name, + location="West Europe", + version="8.3", + retention_interval="P1D", + command_line="-name \\"John Dole\\"", + cleanup_preference="OnSuccess", + force_update_tag="1", + timeout="PT30M", + script_content=\"\"\" param([string] $name) + $output = 'Hello {0}.' -f $name + Write-Output $output + $DeploymentScriptOutputs = @{} + $DeploymentScriptOutputs['text'] = $output + \"\"\", + identity=azure.core.ResourceDeploymentScriptPowerShellIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "key": "value", + }) + ``` + ## Import Resource Deployment Script can be imported using the `resource id`, e.g. @@ -783,6 +817,40 @@ def __init__(__self__, """ Manages a Resource Deployment Script of Azure PowerShell. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_resource_deployment_script_power_shell = azure.core.ResourceDeploymentScriptPowerShell("exampleResourceDeploymentScriptPowerShell", + resource_group_name=example_resource_group.name, + location="West Europe", + version="8.3", + retention_interval="P1D", + command_line="-name \\"John Dole\\"", + cleanup_preference="OnSuccess", + force_update_tag="1", + timeout="PT30M", + script_content=\"\"\" param([string] $name) + $output = 'Hello {0}.' -f $name + Write-Output $output + $DeploymentScriptOutputs = @{} + $DeploymentScriptOutputs['text'] = $output + \"\"\", + identity=azure.core.ResourceDeploymentScriptPowerShellIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "key": "value", + }) + ``` + ## Import Resource Deployment Script can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_group.py b/sdk/python/pulumi_azure/core/resource_group.py index 3dea41a97f..d14059a58f 100644 --- a/sdk/python/pulumi_azure/core/resource_group.py +++ b/sdk/python/pulumi_azure/core/resource_group.py @@ -204,6 +204,15 @@ def __init__(__self__, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + ``` + ## Import Resource Groups can be imported using the `resource id`, e.g. @@ -226,6 +235,15 @@ def __init__(__self__, args: Optional[ResourceGroupArgs] = None, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + ``` + ## Import Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_group_cost_management_export.py b/sdk/python/pulumi_azure/core/resource_group_cost_management_export.py index 96f0a7b805..b973f90dac 100644 --- a/sdk/python/pulumi_azure/core/resource_group_cost_management_export.py +++ b/sdk/python/pulumi_azure/core/resource_group_cost_management_export.py @@ -382,6 +382,34 @@ def __init__(__self__, """ Manages a Cost Management Export for a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_resource_group_cost_management_export = azure.core.ResourceGroupCostManagementExport("exampleResourceGroupCostManagementExport", + resource_group_id=example_resource_group.id, + recurrence_type="Monthly", + recurrence_period_start_date="2020-08-18T00:00:00Z", + recurrence_period_end_date="2020-09-18T00:00:00Z", + export_data_storage_location=azure.core.ResourceGroupCostManagementExportExportDataStorageLocationArgs( + container_id=example_container.resource_manager_id, + root_folder_path="/root/updated", + ), + export_data_options=azure.core.ResourceGroupCostManagementExportExportDataOptionsArgs( + type="Usage", + time_frame="WeekToDate", + )) + ``` + ## Import Cost Management Export for a Resource Group can be imported using the `resource id`, e.g. @@ -410,6 +438,34 @@ def __init__(__self__, """ Manages a Cost Management Export for a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_resource_group_cost_management_export = azure.core.ResourceGroupCostManagementExport("exampleResourceGroupCostManagementExport", + resource_group_id=example_resource_group.id, + recurrence_type="Monthly", + recurrence_period_start_date="2020-08-18T00:00:00Z", + recurrence_period_end_date="2020-09-18T00:00:00Z", + export_data_storage_location=azure.core.ResourceGroupCostManagementExportExportDataStorageLocationArgs( + container_id=example_container.resource_manager_id, + root_folder_path="/root/updated", + ), + export_data_options=azure.core.ResourceGroupCostManagementExportExportDataOptionsArgs( + type="Usage", + time_frame="WeekToDate", + )) + ``` + ## Import Cost Management Export for a Resource Group can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_group_cost_management_view.py b/sdk/python/pulumi_azure/core/resource_group_cost_management_view.py index 43449a98b6..2fad2651a0 100644 --- a/sdk/python/pulumi_azure/core/resource_group_cost_management_view.py +++ b/sdk/python/pulumi_azure/core/resource_group_cost_management_view.py @@ -449,6 +449,29 @@ def __init__(__self__, """ Manages an Azure Cost Management View for a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_group_cost_management_view = azure.core.ResourceGroupCostManagementView("exampleResourceGroupCostManagementView", + display_name="Cost View per Month", + chart_type="StackedColumn", + accumulated=False, + resource_group_id=example_resource_group.id, + report_type="Usage", + timeframe="MonthToDate", + dataset=azure.core.ResourceGroupCostManagementViewDatasetArgs( + granularity="Monthly", + aggregations=[azure.core.ResourceGroupCostManagementViewDatasetAggregationArgs( + name="totalCost", + column_name="Cost", + )], + )) + ``` + ## Import Cost Management View for a Resource Groups can be imported using the `resource id`, e.g. @@ -479,6 +502,29 @@ def __init__(__self__, """ Manages an Azure Cost Management View for a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_group_cost_management_view = azure.core.ResourceGroupCostManagementView("exampleResourceGroupCostManagementView", + display_name="Cost View per Month", + chart_type="StackedColumn", + accumulated=False, + resource_group_id=example_resource_group.id, + report_type="Usage", + timeframe="MonthToDate", + dataset=azure.core.ResourceGroupCostManagementViewDatasetArgs( + granularity="Monthly", + aggregations=[azure.core.ResourceGroupCostManagementViewDatasetAggregationArgs( + name="totalCost", + column_name="Cost", + )], + )) + ``` + ## Import Cost Management View for a Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_group_policy_assignment.py b/sdk/python/pulumi_azure/core/resource_group_policy_assignment.py index 36e831bfa9..1c92d97c68 100644 --- a/sdk/python/pulumi_azure/core/resource_group_policy_assignment.py +++ b/sdk/python/pulumi_azure/core/resource_group_policy_assignment.py @@ -608,6 +608,43 @@ def __init__(__self__, """ Manages a Resource Group Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="my-policy-definition", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_resource_group_policy_assignment = azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", + resource_group_id=example_resource_group.id, + policy_definition_id=example_definition.id, + parameters=\"\"\" { + "tagName": { + "value": "Business Unit" + }, + "tagValue": { + "value": "BU" + } + } + \"\"\") + ``` + ## Import Resource Group Policy Assignments can be imported using the `resource id`, e.g. @@ -644,6 +681,43 @@ def __init__(__self__, """ Manages a Resource Group Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="my-policy-definition", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_resource_group_policy_assignment = azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", + resource_group_id=example_resource_group.id, + policy_definition_id=example_definition.id, + parameters=\"\"\" { + "tagName": { + "value": "Business Unit" + }, + "tagValue": { + "value": "BU" + } + } + \"\"\") + ``` + ## Import Resource Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_group_policy_exemption.py b/sdk/python/pulumi_azure/core/resource_group_policy_exemption.py index 20f6abc46a..775c56a669 100644 --- a/sdk/python/pulumi_azure/core/resource_group_policy_exemption.py +++ b/sdk/python/pulumi_azure/core/resource_group_policy_exemption.py @@ -414,6 +414,29 @@ def __init__(__self__, """ Manages a Resource Group Policy Exemption. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westus") + example_policy_defintion = azure.policy.get_policy_defintion(display_name="Allowed locations") + example_resource_group_policy_assignment = azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", + resource_group_id=example_resource_group.id, + policy_definition_id=example_policy_defintion.id, + parameters=example_resource_group.location.apply(lambda location: json.dumps({ + "listOfAllowedLocations": { + "value": [location], + }, + }))) + example_resource_group_policy_exemption = azure.core.ResourceGroupPolicyExemption("exampleResourceGroupPolicyExemption", + resource_group_id=example_resource_group.id, + policy_assignment_id=example_resource_group_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. @@ -443,6 +466,29 @@ def __init__(__self__, """ Manages a Resource Group Policy Exemption. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westus") + example_policy_defintion = azure.policy.get_policy_defintion(display_name="Allowed locations") + example_resource_group_policy_assignment = azure.core.ResourceGroupPolicyAssignment("exampleResourceGroupPolicyAssignment", + resource_group_id=example_resource_group.id, + policy_definition_id=example_policy_defintion.id, + parameters=example_resource_group.location.apply(lambda location: json.dumps({ + "listOfAllowedLocations": { + "value": [location], + }, + }))) + example_resource_group_policy_exemption = azure.core.ResourceGroupPolicyExemption("exampleResourceGroupPolicyExemption", + resource_group_id=example_resource_group.id, + policy_assignment_id=example_resource_group_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_policy_assignment.py b/sdk/python/pulumi_azure/core/resource_policy_assignment.py index 3ac8460ae8..f70d62af80 100644 --- a/sdk/python/pulumi_azure/core/resource_policy_assignment.py +++ b/sdk/python/pulumi_azure/core/resource_policy_assignment.py @@ -616,6 +616,35 @@ def __init__(__self__, """ Manages a Policy Assignment to a Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_virtual_network = azure.network.get_virtual_network(name="production", + resource_group_name="networking") + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="my-policy-definition", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_resource_policy_assignment = azure.core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", + resource_id=example_virtual_network.id, + policy_definition_id=example_definition.id) + ``` + ## Import Resource Policy Assignments can be imported using the `resource id`, e.g. @@ -656,6 +685,35 @@ def __init__(__self__, """ Manages a Policy Assignment to a Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_virtual_network = azure.network.get_virtual_network(name="production", + resource_group_name="networking") + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="my-policy-definition", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_resource_policy_assignment = azure.core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", + resource_id=example_virtual_network.id, + policy_definition_id=example_definition.id) + ``` + ## Import Resource Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_policy_exemption.py b/sdk/python/pulumi_azure/core/resource_policy_exemption.py index f6459b7f6c..a2cf81b9b0 100644 --- a/sdk/python/pulumi_azure/core/resource_policy_exemption.py +++ b/sdk/python/pulumi_azure/core/resource_policy_exemption.py @@ -414,6 +414,31 @@ def __init__(__self__, """ Manages a Resource Policy Exemption. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westus") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_policy_set_definition = azure.policy.get_policy_set_definition(display_name="Audit machines with insecure password security settings") + example_resource_policy_assignment = azure.core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", + resource_id=example_virtual_network.id, + policy_definition_id=example_policy_set_definition.id, + location=example_resource_group.location, + identity=azure.core.ResourcePolicyAssignmentIdentityArgs( + type="SystemAssigned", + )) + example_resource_policy_exemption = azure.core.ResourcePolicyExemption("exampleResourcePolicyExemption", + resource_id=example_resource_policy_assignment.resource_id, + policy_assignment_id=example_resource_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. @@ -443,6 +468,31 @@ def __init__(__self__, """ Manages a Resource Policy Exemption. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westus") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_policy_set_definition = azure.policy.get_policy_set_definition(display_name="Audit machines with insecure password security settings") + example_resource_policy_assignment = azure.core.ResourcePolicyAssignment("exampleResourcePolicyAssignment", + resource_id=example_virtual_network.id, + policy_definition_id=example_policy_set_definition.id, + location=example_resource_group.location, + identity=azure.core.ResourcePolicyAssignmentIdentityArgs( + type="SystemAssigned", + )) + example_resource_policy_exemption = azure.core.ResourcePolicyExemption("exampleResourcePolicyExemption", + resource_id=example_resource_policy_assignment.resource_id, + policy_assignment_id=example_resource_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/resource_provider_registration.py b/sdk/python/pulumi_azure/core/resource_provider_registration.py index 3cc36ce84a..fc0bf5323e 100644 --- a/sdk/python/pulumi_azure/core/resource_provider_registration.py +++ b/sdk/python/pulumi_azure/core/resource_provider_registration.py @@ -128,6 +128,26 @@ def __init__(__self__, > **Note:** Adding or Removing a Preview Feature will re-register the Resource Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceProviderRegistration("example") + ``` + ### Registering A Preview Feature) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceProviderRegistration("example", features=[azure.core.ResourceProviderRegistrationFeatureArgs( + name="AKS-DataPlaneAutoApprove", + registered=True, + )]) + ``` + ## Import Resource Provider Registrations can be imported using the `resource id`, e.g. @@ -155,6 +175,26 @@ def __init__(__self__, > **Note:** Adding or Removing a Preview Feature will re-register the Resource Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceProviderRegistration("example") + ``` + ### Registering A Preview Feature) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceProviderRegistration("example", features=[azure.core.ResourceProviderRegistrationFeatureArgs( + name="AKS-DataPlaneAutoApprove", + registered=True, + )]) + ``` + ## Import Resource Provider Registrations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/subscription.py b/sdk/python/pulumi_azure/core/subscription.py index b0acbb6ec4..256a8eaced 100644 --- a/sdk/python/pulumi_azure/core/subscription.py +++ b/sdk/python/pulumi_azure/core/subscription.py @@ -324,6 +324,54 @@ def __init__(__self__, __props__=None): """ ## Example Usage + ### Creating A New Alias And Subscription For An Enrollment Account + + ```python + import pulumi + import pulumi_azure as azure + + example_enrollment_account_scope = azure.billing.get_enrollment_account_scope(billing_account_name="1234567890", + enrollment_account_name="0123456") + example_subscription = azure.core.Subscription("exampleSubscription", + subscription_name="My Example EA Subscription", + billing_scope_id=example_enrollment_account_scope.id) + ``` + ### Creating A New Alias And Subscription For A Microsoft Customer Account + + ```python + import pulumi + import pulumi_azure as azure + + example_mca_account_scope = azure.billing.get_mca_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + billing_profile_name="PE2Q-NOIT-BG7-TGB", + invoice_section_name="MTT4-OBS7-PJA-TGB") + example_subscription = azure.core.Subscription("exampleSubscription", + subscription_name="My Example MCA Subscription", + billing_scope_id=example_mca_account_scope.id) + ``` + ### Creating A New Alias And Subscription For A Microsoft Partner Account + + ```python + import pulumi + import pulumi_azure as azure + + example_mpa_account_scope = azure.billing.get_mpa_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + customer_name="2281f543-7321-4cf9-1e23-edb4Oc31a31c") + example_subscription = azure.core.Subscription("exampleSubscription", + subscription_name="My Example MPA Subscription", + billing_scope_id=example_mpa_account_scope.id) + ``` + ### Adding An Alias To An Existing Subscription + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.Subscription("example", + alias="examplesub", + subscription_id="12345678-12234-5678-9012-123456789012", + subscription_name="My Example Subscription") + ``` ## Import @@ -356,6 +404,54 @@ def __init__(__self__, opts: Optional[pulumi.ResourceOptions] = None): """ ## Example Usage + ### Creating A New Alias And Subscription For An Enrollment Account + + ```python + import pulumi + import pulumi_azure as azure + + example_enrollment_account_scope = azure.billing.get_enrollment_account_scope(billing_account_name="1234567890", + enrollment_account_name="0123456") + example_subscription = azure.core.Subscription("exampleSubscription", + subscription_name="My Example EA Subscription", + billing_scope_id=example_enrollment_account_scope.id) + ``` + ### Creating A New Alias And Subscription For A Microsoft Customer Account + + ```python + import pulumi + import pulumi_azure as azure + + example_mca_account_scope = azure.billing.get_mca_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + billing_profile_name="PE2Q-NOIT-BG7-TGB", + invoice_section_name="MTT4-OBS7-PJA-TGB") + example_subscription = azure.core.Subscription("exampleSubscription", + subscription_name="My Example MCA Subscription", + billing_scope_id=example_mca_account_scope.id) + ``` + ### Creating A New Alias And Subscription For A Microsoft Partner Account + + ```python + import pulumi + import pulumi_azure as azure + + example_mpa_account_scope = azure.billing.get_mpa_account_scope(billing_account_name="e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31", + customer_name="2281f543-7321-4cf9-1e23-edb4Oc31a31c") + example_subscription = azure.core.Subscription("exampleSubscription", + subscription_name="My Example MPA Subscription", + billing_scope_id=example_mpa_account_scope.id) + ``` + ### Adding An Alias To An Existing Subscription + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.Subscription("example", + alias="examplesub", + subscription_id="12345678-12234-5678-9012-123456789012", + subscription_name="My Example Subscription") + ``` ## Import diff --git a/sdk/python/pulumi_azure/core/subscription_cost_management_export.py b/sdk/python/pulumi_azure/core/subscription_cost_management_export.py index d69b4de79c..d23afaff96 100644 --- a/sdk/python/pulumi_azure/core/subscription_cost_management_export.py +++ b/sdk/python/pulumi_azure/core/subscription_cost_management_export.py @@ -382,6 +382,35 @@ def __init__(__self__, """ Manages a Cost Management Export for a Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_subscription = azure.core.get_subscription() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_subscription_cost_management_export = azure.core.SubscriptionCostManagementExport("exampleSubscriptionCostManagementExport", + subscription_id=example_subscription.id, + recurrence_type="Monthly", + recurrence_period_start_date="2020-08-18T00:00:00Z", + recurrence_period_end_date="2020-09-18T00:00:00Z", + export_data_storage_location=azure.core.SubscriptionCostManagementExportExportDataStorageLocationArgs( + container_id=example_container.resource_manager_id, + root_folder_path="/root/updated", + ), + export_data_options=azure.core.SubscriptionCostManagementExportExportDataOptionsArgs( + type="Usage", + time_frame="WeekToDate", + )) + ``` + ## Import Subscription Cost Management Exports can be imported using the `resource id`, e.g. @@ -410,6 +439,35 @@ def __init__(__self__, """ Manages a Cost Management Export for a Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_subscription = azure.core.get_subscription() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_subscription_cost_management_export = azure.core.SubscriptionCostManagementExport("exampleSubscriptionCostManagementExport", + subscription_id=example_subscription.id, + recurrence_type="Monthly", + recurrence_period_start_date="2020-08-18T00:00:00Z", + recurrence_period_end_date="2020-09-18T00:00:00Z", + export_data_storage_location=azure.core.SubscriptionCostManagementExportExportDataStorageLocationArgs( + container_id=example_container.resource_manager_id, + root_folder_path="/root/updated", + ), + export_data_options=azure.core.SubscriptionCostManagementExportExportDataOptionsArgs( + type="Usage", + time_frame="WeekToDate", + )) + ``` + ## Import Subscription Cost Management Exports can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/subscription_cost_management_view.py b/sdk/python/pulumi_azure/core/subscription_cost_management_view.py index 1c3768e4a8..72475607b4 100644 --- a/sdk/python/pulumi_azure/core/subscription_cost_management_view.py +++ b/sdk/python/pulumi_azure/core/subscription_cost_management_view.py @@ -449,6 +449,28 @@ def __init__(__self__, """ Manages an Azure Cost Management View for a Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.SubscriptionCostManagementView("example", + accumulated=False, + chart_type="StackedColumn", + dataset=azure.core.SubscriptionCostManagementViewDatasetArgs( + aggregations=[azure.core.SubscriptionCostManagementViewDatasetAggregationArgs( + column_name="Cost", + name="totalCost", + )], + granularity="Monthly", + ), + display_name="Cost View per Month", + report_type="Usage", + subscription_id="/subscription/00000000-0000-0000-0000-000000000000", + timeframe="MonthToDate") + ``` + ## Import Cost Management View for a Subscriptions can be imported using the `resource id`, e.g. @@ -479,6 +501,28 @@ def __init__(__self__, """ Manages an Azure Cost Management View for a Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.SubscriptionCostManagementView("example", + accumulated=False, + chart_type="StackedColumn", + dataset=azure.core.SubscriptionCostManagementViewDatasetArgs( + aggregations=[azure.core.SubscriptionCostManagementViewDatasetAggregationArgs( + column_name="Cost", + name="totalCost", + )], + granularity="Monthly", + ), + display_name="Cost View per Month", + report_type="Usage", + subscription_id="/subscription/00000000-0000-0000-0000-000000000000", + timeframe="MonthToDate") + ``` + ## Import Cost Management View for a Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/subscription_policy_assignment.py b/sdk/python/pulumi_azure/core/subscription_policy_assignment.py index 33e63d2daf..716837ebae 100644 --- a/sdk/python/pulumi_azure/core/subscription_policy_assignment.py +++ b/sdk/python/pulumi_azure/core/subscription_policy_assignment.py @@ -608,6 +608,34 @@ def __init__(__self__, """ Manages a Subscription Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="Allowed resource types", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_subscription_policy_assignment = azure.core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", + policy_definition_id=example_definition.id, + subscription_id=current.id) + ``` + ## Import Subscription Policy Assignments can be imported using the `resource id`, e.g. @@ -644,6 +672,34 @@ def __init__(__self__, """ Manages a Subscription Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="Allowed resource types", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_subscription_policy_assignment = azure.core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", + policy_definition_id=example_definition.id, + subscription_id=current.id) + ``` + ## Import Subscription Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/subscription_policy_exemption.py b/sdk/python/pulumi_azure/core/subscription_policy_exemption.py index 714e21bf92..539249120c 100644 --- a/sdk/python/pulumi_azure/core/subscription_policy_exemption.py +++ b/sdk/python/pulumi_azure/core/subscription_policy_exemption.py @@ -414,6 +414,27 @@ def __init__(__self__, """ Manages a Subscription Policy Exemption. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_subscription = azure.core.get_subscription() + example_policy_set_definition = azure.policy.get_policy_set_definition(display_name="Audit machines with insecure password security settings") + example_subscription_policy_assignment = azure.core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", + subscription_id=example_subscription.id, + policy_definition_id=example_policy_set_definition.id, + location="westus", + identity=azure.core.SubscriptionPolicyAssignmentIdentityArgs( + type="SystemAssigned", + )) + example_subscription_policy_exemption = azure.core.SubscriptionPolicyExemption("exampleSubscriptionPolicyExemption", + subscription_id=example_subscription.id, + policy_assignment_id=example_subscription_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. @@ -443,6 +464,27 @@ def __init__(__self__, """ Manages a Subscription Policy Exemption. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_subscription = azure.core.get_subscription() + example_policy_set_definition = azure.policy.get_policy_set_definition(display_name="Audit machines with insecure password security settings") + example_subscription_policy_assignment = azure.core.SubscriptionPolicyAssignment("exampleSubscriptionPolicyAssignment", + subscription_id=example_subscription.id, + policy_definition_id=example_policy_set_definition.id, + location="westus", + identity=azure.core.SubscriptionPolicyAssignmentIdentityArgs( + type="SystemAssigned", + )) + example_subscription_policy_exemption = azure.core.SubscriptionPolicyExemption("exampleSubscriptionPolicyExemption", + subscription_id=example_subscription.id, + policy_assignment_id=example_subscription_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/subscription_template_deployment.py b/sdk/python/pulumi_azure/core/subscription_template_deployment.py index 3025da90af..be7c3ad0c0 100644 --- a/sdk/python/pulumi_azure/core/subscription_template_deployment.py +++ b/sdk/python/pulumi_azure/core/subscription_template_deployment.py @@ -349,6 +349,33 @@ def __init__(__self__, """ Manages a Subscription Template Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.SubscriptionTemplateDeployment("example", + location="West Europe", + template_content=\"\"\" { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "West Europe", + "name": "some-resource-group", + "properties": {} + } + ] + } + + \"\"\") + ``` + ## Import Subscription Template Deployments can be imported using the `resource id`, e.g. @@ -376,6 +403,33 @@ def __init__(__self__, """ Manages a Subscription Template Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.SubscriptionTemplateDeployment("example", + location="West Europe", + template_content=\"\"\" { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": {}, + "variables": {}, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "apiVersion": "2018-05-01", + "location": "West Europe", + "name": "some-resource-group", + "properties": {} + } + ] + } + + \"\"\") + ``` + ## Import Subscription Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/core/template_deployment.py b/sdk/python/pulumi_azure/core/template_deployment.py index 5286e1596b..e0f7092a70 100644 --- a/sdk/python/pulumi_azure/core/template_deployment.py +++ b/sdk/python/pulumi_azure/core/template_deployment.py @@ -324,6 +324,79 @@ def __init__(__self__, This means that when deleting the `core.TemplateDeployment` resource, this provider will only remove the reference to the deployment, whilst leaving any resources created by that ARM Template Deployment. One workaround for this is to use a unique Resource Group for each ARM Template Deployment, which means deleting the Resource Group would contain any resources created within it - however this isn't ideal. [More information](https://docs.microsoft.com/en-us/rest/api/resources/deployments#Deployments_Delete). + ## Example Usage + + > **Note:** This example uses Storage Accounts and Public IP's which are natively supported by this provider - we'd highly recommend using the Native Resources where possible instead rather than an ARM Template, for the reasons outlined above. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_template_deployment = azure.core.TemplateDeployment("exampleTemplateDeployment", + resource_group_name=example_resource_group.name, + template_body=\"\"\"{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "storageAccountType": { + "type": "string", + "defaultValue": "Standard_LRS", + "allowedValues": [ + "Standard_LRS", + "Standard_GRS", + "Standard_ZRS" + ], + "metadata": { + "description": "Storage Account type" + } + } + }, + "variables": { + "location": "[resourceGroup().location]", + "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'storage')]", + "publicIPAddressName": "[concat('myPublicIp', uniquestring(resourceGroup().id))]", + "publicIPAddressType": "Dynamic", + "apiVersion": "2015-06-15", + "dnsLabelPrefix": "example-acctest" + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('storageAccountName')]", + "apiVersion": "[variables('apiVersion')]", + "location": "[variables('location')]", + "properties": { + "accountType": "[parameters('storageAccountType')]" + } + }, + { + "type": "Microsoft.Network/publicIPAddresses", + "apiVersion": "[variables('apiVersion')]", + "name": "[variables('publicIPAddressName')]", + "location": "[variables('location')]", + "properties": { + "publicIPAllocationMethod": "[variables('publicIPAddressType')]", + "dnsSettings": { + "domainNameLabel": "[variables('dnsLabelPrefix')]" + } + } + } + ], + "outputs": { + "storageAccountName": { + "type": "string", + "value": "[variables('storageAccountName')]" + } + } + } + \"\"\", + parameters={ + "storageAccountType": "Standard_GRS", + }, + deployment_mode="Incremental") + pulumi.export("storageAccountName", example_template_deployment.outputs["storageAccountName"]) + ``` ## Note This provider does not know about the individual resources created by Azure using a deployment template and therefore cannot delete these resources during a destroy. Destroying a template deployment removes the associated deployment operations, but will not delete the Azure resources created by the deployment. In order to delete these resources, the containing resource group must also be destroyed. [More information](https://docs.microsoft.com/rest/api/resources/deployments#Deployments_Delete). @@ -352,6 +425,79 @@ def __init__(__self__, This means that when deleting the `core.TemplateDeployment` resource, this provider will only remove the reference to the deployment, whilst leaving any resources created by that ARM Template Deployment. One workaround for this is to use a unique Resource Group for each ARM Template Deployment, which means deleting the Resource Group would contain any resources created within it - however this isn't ideal. [More information](https://docs.microsoft.com/en-us/rest/api/resources/deployments#Deployments_Delete). + ## Example Usage + + > **Note:** This example uses Storage Accounts and Public IP's which are natively supported by this provider - we'd highly recommend using the Native Resources where possible instead rather than an ARM Template, for the reasons outlined above. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_template_deployment = azure.core.TemplateDeployment("exampleTemplateDeployment", + resource_group_name=example_resource_group.name, + template_body=\"\"\"{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "storageAccountType": { + "type": "string", + "defaultValue": "Standard_LRS", + "allowedValues": [ + "Standard_LRS", + "Standard_GRS", + "Standard_ZRS" + ], + "metadata": { + "description": "Storage Account type" + } + } + }, + "variables": { + "location": "[resourceGroup().location]", + "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'storage')]", + "publicIPAddressName": "[concat('myPublicIp', uniquestring(resourceGroup().id))]", + "publicIPAddressType": "Dynamic", + "apiVersion": "2015-06-15", + "dnsLabelPrefix": "example-acctest" + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "name": "[variables('storageAccountName')]", + "apiVersion": "[variables('apiVersion')]", + "location": "[variables('location')]", + "properties": { + "accountType": "[parameters('storageAccountType')]" + } + }, + { + "type": "Microsoft.Network/publicIPAddresses", + "apiVersion": "[variables('apiVersion')]", + "name": "[variables('publicIPAddressName')]", + "location": "[variables('location')]", + "properties": { + "publicIPAllocationMethod": "[variables('publicIPAddressType')]", + "dnsSettings": { + "domainNameLabel": "[variables('dnsLabelPrefix')]" + } + } + } + ], + "outputs": { + "storageAccountName": { + "type": "string", + "value": "[variables('storageAccountName')]" + } + } + } + \"\"\", + parameters={ + "storageAccountType": "Standard_GRS", + }, + deployment_mode="Incremental") + pulumi.export("storageAccountName", example_template_deployment.outputs["storageAccountName"]) + ``` ## Note This provider does not know about the individual resources created by Azure using a deployment template and therefore cannot delete these resources during a destroy. Destroying a template deployment removes the associated deployment operations, but will not delete the Azure resources created by the deployment. In order to delete these resources, the containing resource group must also be destroyed. [More information](https://docs.microsoft.com/rest/api/resources/deployments#Deployments_Delete). diff --git a/sdk/python/pulumi_azure/core/tenant_template_deployment.py b/sdk/python/pulumi_azure/core/tenant_template_deployment.py index 7844227be2..c9a99c945d 100644 --- a/sdk/python/pulumi_azure/core/tenant_template_deployment.py +++ b/sdk/python/pulumi_azure/core/tenant_template_deployment.py @@ -347,6 +347,20 @@ def __init__(__self__, template_spec_version_id: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_template_spec_version = azure.core.get_template_spec_version(name="myTemplateForTenant", + resource_group_name="myResourceGroup", + version="v0.1") + example_tenant_template_deployment = azure.core.TenantTemplateDeployment("exampleTenantTemplateDeployment", + location="West Europe", + template_spec_version_id=example_template_spec_version.id) + ``` + ## Import Tenant Template Deployments can be imported using the `resource id`, e.g. @@ -372,6 +386,20 @@ def __init__(__self__, args: Optional[TenantTemplateDeploymentArgs] = None, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_template_spec_version = azure.core.get_template_spec_version(name="myTemplateForTenant", + resource_group_name="myResourceGroup", + version="v0.1") + example_tenant_template_deployment = azure.core.TenantTemplateDeployment("exampleTenantTemplateDeployment", + location="West Europe", + template_spec_version_id=example_template_spec_version.id) + ``` + ## Import Tenant Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/account.py b/sdk/python/pulumi_azure/cosmosdb/account.py index 53e23864cd..e10e46624a 100644 --- a/sdk/python/pulumi_azure/cosmosdb/account.py +++ b/sdk/python/pulumi_azure/cosmosdb/account.py @@ -1661,6 +1661,54 @@ def __init__(__self__, """ Manages a CosmosDB (formally DocumentDB) Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + rg = azure.core.ResourceGroup("rg", location="westus") + ri = random.RandomInteger("ri", + min=10000, + max=99999) + db = azure.cosmosdb.Account("db", + location=azurerm_resource_group["example"]["location"], + resource_group_name=azurerm_resource_group["example"]["name"], + offer_type="Standard", + kind="MongoDB", + enable_automatic_failover=True, + capabilities=[ + azure.cosmosdb.AccountCapabilityArgs( + name="EnableAggregationPipeline", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="mongoEnableDocLevelTTL", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="MongoDBv3.4", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongo", + ), + ], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=300, + max_staleness_prefix=100000, + ), + geo_locations=[ + azure.cosmosdb.AccountGeoLocationArgs( + location="eastus", + failover_priority=1, + ), + azure.cosmosdb.AccountGeoLocationArgs( + location="westus", + failover_priority=0, + ), + ]) + ``` + ## Import CosmosDB Accounts can be imported using the `resource id`, e.g. @@ -1724,6 +1772,54 @@ def __init__(__self__, """ Manages a CosmosDB (formally DocumentDB) Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + rg = azure.core.ResourceGroup("rg", location="westus") + ri = random.RandomInteger("ri", + min=10000, + max=99999) + db = azure.cosmosdb.Account("db", + location=azurerm_resource_group["example"]["location"], + resource_group_name=azurerm_resource_group["example"]["name"], + offer_type="Standard", + kind="MongoDB", + enable_automatic_failover=True, + capabilities=[ + azure.cosmosdb.AccountCapabilityArgs( + name="EnableAggregationPipeline", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="mongoEnableDocLevelTTL", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="MongoDBv3.4", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongo", + ), + ], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=300, + max_staleness_prefix=100000, + ), + geo_locations=[ + azure.cosmosdb.AccountGeoLocationArgs( + location="eastus", + failover_priority=1, + ), + azure.cosmosdb.AccountGeoLocationArgs( + location="westus", + failover_priority=0, + ), + ]) + ``` + ## Import CosmosDB Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/cassandra_cluster.py b/sdk/python/pulumi_azure/cosmosdb/cassandra_cluster.py index b4034d0087..fdcddf2583 100644 --- a/sdk/python/pulumi_azure/cosmosdb/cassandra_cluster.py +++ b/sdk/python/pulumi_azure/cosmosdb/cassandra_cluster.py @@ -623,6 +623,39 @@ def __init__(__self__, > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: + ```python + import pulumi + ``` + + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service_principal = azuread.get_service_principal(display_name="Azure Cosmos DB") + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_virtual_network.id, + role_definition_name="Network Contributor", + principal_id=example_service_principal.object_id) + example_cassandra_cluster = azure.cosmosdb.CassandraCluster("exampleCassandraCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + delegated_management_subnet_id=example_subnet.id, + default_admin_password="Password1234", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Cassandra Clusters can be imported using the `resource id`, e.g. @@ -661,6 +694,39 @@ def __init__(__self__, > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: + ```python + import pulumi + ``` + + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service_principal = azuread.get_service_principal(display_name="Azure Cosmos DB") + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_virtual_network.id, + role_definition_name="Network Contributor", + principal_id=example_service_principal.object_id) + example_cassandra_cluster = azure.cosmosdb.CassandraCluster("exampleCassandraCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + delegated_management_subnet_id=example_subnet.id, + default_admin_password="Password1234", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Cassandra Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/cassandra_datacenter.py b/sdk/python/pulumi_azure/cosmosdb/cassandra_datacenter.py index c524761207..f249b86fe9 100644 --- a/sdk/python/pulumi_azure/cosmosdb/cassandra_datacenter.py +++ b/sdk/python/pulumi_azure/cosmosdb/cassandra_datacenter.py @@ -550,6 +550,47 @@ def __init__(__self__, > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: + ```python + import pulumi + ``` + + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service_principal = azuread.get_service_principal(display_name="Azure Cosmos DB") + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_virtual_network.id, + role_definition_name="Network Contributor", + principal_id=example_service_principal.object_id) + example_cassandra_cluster = azure.cosmosdb.CassandraCluster("exampleCassandraCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + delegated_management_subnet_id=example_subnet.id, + default_admin_password="Password1234", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + example_cassandra_datacenter = azure.cosmosdb.CassandraDatacenter("exampleCassandraDatacenter", + location=example_cassandra_cluster.location, + cassandra_cluster_id=example_cassandra_cluster.id, + delegated_management_subnet_id=example_subnet.id, + node_count=3, + disk_count=4, + sku_name="Standard_DS14_v2", + availability_zones_enabled=False) + ``` + ## Import Cassandra Datacenters can be imported using the `resource id`, e.g. @@ -586,6 +627,47 @@ def __init__(__self__, > **NOTE:** In order for the `Azure Managed Instances for Apache Cassandra` to work properly the product requires the `Azure Cosmos DB` Application ID to be present and working in your tenant. If the `Azure Cosmos DB` Application ID is missing in your environment you will need to have an administrator of your tenant run the following command to add the `Azure Cosmos DB` Application ID to your tenant: + ```python + import pulumi + ``` + + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service_principal = azuread.get_service_principal(display_name="Azure Cosmos DB") + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_virtual_network.id, + role_definition_name="Network Contributor", + principal_id=example_service_principal.object_id) + example_cassandra_cluster = azure.cosmosdb.CassandraCluster("exampleCassandraCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + delegated_management_subnet_id=example_subnet.id, + default_admin_password="Password1234", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + example_cassandra_datacenter = azure.cosmosdb.CassandraDatacenter("exampleCassandraDatacenter", + location=example_cassandra_cluster.location, + cassandra_cluster_id=example_cassandra_cluster.id, + delegated_management_subnet_id=example_subnet.id, + node_count=3, + disk_count=4, + sku_name="Standard_DS14_v2", + availability_zones_enabled=False) + ``` + ## Import Cassandra Datacenters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/cassandra_keyspace.py b/sdk/python/pulumi_azure/cosmosdb/cassandra_keyspace.py index f036436c28..3ecefb2d2c 100644 --- a/sdk/python/pulumi_azure/cosmosdb/cassandra_keyspace.py +++ b/sdk/python/pulumi_azure/cosmosdb/cassandra_keyspace.py @@ -263,6 +263,33 @@ def __init__(__self__, """ Manages a Cassandra KeySpace within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + offer_type="Standard", + capabilities=[azure.cosmosdb.AccountCapabilityArgs( + name="EnableCassandra", + )], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_cassandra_keyspace = azure.cosmosdb.CassandraKeyspace("exampleCassandraKeyspace", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import Cosmos Cassandra KeySpace can be imported using the `resource id`, e.g. @@ -290,6 +317,33 @@ def __init__(__self__, """ Manages a Cassandra KeySpace within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + offer_type="Standard", + capabilities=[azure.cosmosdb.AccountCapabilityArgs( + name="EnableCassandra", + )], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_cassandra_keyspace = azure.cosmosdb.CassandraKeyspace("exampleCassandraKeyspace", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import Cosmos Cassandra KeySpace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/cassandra_table.py b/sdk/python/pulumi_azure/cosmosdb/cassandra_table.py index 0daf066793..b964242fbd 100644 --- a/sdk/python/pulumi_azure/cosmosdb/cassandra_table.py +++ b/sdk/python/pulumi_azure/cosmosdb/cassandra_table.py @@ -325,6 +325,50 @@ def __init__(__self__, """ Manages a Cassandra Table within a Cosmos DB Cassandra Keyspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + offer_type="Standard", + capabilities=[azure.cosmosdb.AccountCapabilityArgs( + name="EnableCassandra", + )], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_cassandra_keyspace = azure.cosmosdb.CassandraKeyspace("exampleCassandraKeyspace", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_cassandra_table = azure.cosmosdb.CassandraTable("exampleCassandraTable", + cassandra_keyspace_id=example_cassandra_keyspace.id, + schema=azure.cosmosdb.CassandraTableSchemaArgs( + columns=[ + azure.cosmosdb.CassandraTableSchemaColumnArgs( + name="test1", + type="ascii", + ), + azure.cosmosdb.CassandraTableSchemaColumnArgs( + name="test2", + type="int", + ), + ], + partition_keys=[azure.cosmosdb.CassandraTableSchemaPartitionKeyArgs( + name="test1", + )], + )) + ``` + ## Import Cosmos Cassandra Table can be imported using the `resource id`, e.g. @@ -352,6 +396,50 @@ def __init__(__self__, """ Manages a Cassandra Table within a Cosmos DB Cassandra Keyspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + offer_type="Standard", + capabilities=[azure.cosmosdb.AccountCapabilityArgs( + name="EnableCassandra", + )], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_cassandra_keyspace = azure.cosmosdb.CassandraKeyspace("exampleCassandraKeyspace", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_cassandra_table = azure.cosmosdb.CassandraTable("exampleCassandraTable", + cassandra_keyspace_id=example_cassandra_keyspace.id, + schema=azure.cosmosdb.CassandraTableSchemaArgs( + columns=[ + azure.cosmosdb.CassandraTableSchemaColumnArgs( + name="test1", + type="ascii", + ), + azure.cosmosdb.CassandraTableSchemaColumnArgs( + name="test2", + type="int", + ), + ], + partition_keys=[azure.cosmosdb.CassandraTableSchemaPartitionKeyArgs( + name="test1", + )], + )) + ``` + ## Import Cosmos Cassandra Table can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/get_account.py b/sdk/python/pulumi_azure/cosmosdb/get_account.py index 21176702da..456fffd588 100644 --- a/sdk/python/pulumi_azure/cosmosdb/get_account.py +++ b/sdk/python/pulumi_azure/cosmosdb/get_account.py @@ -315,6 +315,17 @@ def get_account(name: Optional[str] = None, """ Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + pulumi.export("cosmosdbAccountEndpoint", example.endpoint) + ``` + :param str name: Specifies the name of the CosmosDB Account. :param str resource_group_name: Specifies the name of the resource group in which the CosmosDB Account resides. @@ -359,6 +370,17 @@ def get_account_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + pulumi.export("cosmosdbAccountEndpoint", example.endpoint) + ``` + :param str name: Specifies the name of the CosmosDB Account. :param str resource_group_name: Specifies the name of the resource group in which the CosmosDB Account resides. diff --git a/sdk/python/pulumi_azure/cosmosdb/get_mongo_database.py b/sdk/python/pulumi_azure/cosmosdb/get_mongo_database.py index aa34038782..c7cf78b951 100644 --- a/sdk/python/pulumi_azure/cosmosdb/get_mongo_database.py +++ b/sdk/python/pulumi_azure/cosmosdb/get_mongo_database.py @@ -90,6 +90,18 @@ def get_mongo_database(account_name: Optional[str] = None, """ Use this data source to access information about an existing Cosmos DB Mongo Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_mongo_database(name="test-cosmosdb-mongo-db", + resource_group_name="test-cosmosdb-account-rg", + account_name="test-cosmosdb-account") + pulumi.export("id", example.id) + ``` + :param str account_name: The name of the Cosmos DB Account where the Mongo Database exists. :param str name: The name of this Cosmos DB Mongo Database. @@ -118,6 +130,18 @@ def get_mongo_database_output(account_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Cosmos DB Mongo Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_mongo_database(name="test-cosmosdb-mongo-db", + resource_group_name="test-cosmosdb-account-rg", + account_name="test-cosmosdb-account") + pulumi.export("id", example.id) + ``` + :param str account_name: The name of the Cosmos DB Account where the Mongo Database exists. :param str name: The name of this Cosmos DB Mongo Database. diff --git a/sdk/python/pulumi_azure/cosmosdb/get_restorable_database_accounts.py b/sdk/python/pulumi_azure/cosmosdb/get_restorable_database_accounts.py index 202fb5d57b..60a08f6773 100644 --- a/sdk/python/pulumi_azure/cosmosdb/get_restorable_database_accounts.py +++ b/sdk/python/pulumi_azure/cosmosdb/get_restorable_database_accounts.py @@ -84,6 +84,17 @@ def get_restorable_database_accounts(location: Optional[str] = None, """ Use this data source to access information about Cosmos DB Restorable Database Accounts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_restorable_database_accounts(name="example-ca", + location="West Europe") + pulumi.export("id", example.id) + ``` + :param str location: The location where the Cosmos DB Database Account. :param str name: The name of this Cosmos DB Database Account. @@ -108,6 +119,17 @@ def get_restorable_database_accounts_output(location: Optional[pulumi.Input[str] """ Use this data source to access information about Cosmos DB Restorable Database Accounts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_restorable_database_accounts(name="example-ca", + location="West Europe") + pulumi.export("id", example.id) + ``` + :param str location: The location where the Cosmos DB Database Account. :param str name: The name of this Cosmos DB Database Account. diff --git a/sdk/python/pulumi_azure/cosmosdb/get_sql_database.py b/sdk/python/pulumi_azure/cosmosdb/get_sql_database.py index e777972e26..5fa79d8c54 100644 --- a/sdk/python/pulumi_azure/cosmosdb/get_sql_database.py +++ b/sdk/python/pulumi_azure/cosmosdb/get_sql_database.py @@ -103,6 +103,17 @@ def get_sql_database(account_name: Optional[str] = None, """ Use this data source to access information about an existing CosmosDB SQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_sql_database(account_name="tfex-cosmosdb-sql-database-account-name", + name="tfex-cosmosdb-sql-database", + resource_group_name="tfex-cosmosdb-sql-database-rg") + ``` + :param str account_name: The name of the Cosmos DB SQL Database to create the table within. :param str name: Specifies the name of the Cosmos DB SQL Database. @@ -132,6 +143,17 @@ def get_sql_database_output(account_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing CosmosDB SQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_sql_database(account_name="tfex-cosmosdb-sql-database-account-name", + name="tfex-cosmosdb-sql-database", + resource_group_name="tfex-cosmosdb-sql-database-rg") + ``` + :param str account_name: The name of the Cosmos DB SQL Database to create the table within. :param str name: Specifies the name of the Cosmos DB SQL Database. diff --git a/sdk/python/pulumi_azure/cosmosdb/get_sql_role_definition.py b/sdk/python/pulumi_azure/cosmosdb/get_sql_role_definition.py index 27f3f62e90..fdab55ce88 100644 --- a/sdk/python/pulumi_azure/cosmosdb/get_sql_role_definition.py +++ b/sdk/python/pulumi_azure/cosmosdb/get_sql_role_definition.py @@ -127,6 +127,17 @@ def get_sql_role_definition(account_name: Optional[str] = None, """ Use this data source to access information about an existing Cosmos DB SQL Role Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_sql_role_definition(account_name="tfex-cosmosdb-sql-role-definition-account-name", + resource_group_name="tfex-cosmosdb-sql-role-definition-rg", + role_definition_id="00000000-0000-0000-0000-000000000000") + ``` + :param str account_name: The name of the Cosmos DB Account. :param str resource_group_name: The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. @@ -158,6 +169,17 @@ def get_sql_role_definition_output(account_name: Optional[pulumi.Input[str]] = N """ Use this data source to access information about an existing Cosmos DB SQL Role Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.cosmosdb.get_sql_role_definition(account_name="tfex-cosmosdb-sql-role-definition-account-name", + resource_group_name="tfex-cosmosdb-sql-role-definition-rg", + role_definition_id="00000000-0000-0000-0000-000000000000") + ``` + :param str account_name: The name of the Cosmos DB Account. :param str resource_group_name: The name of the Resource Group in which the Cosmos DB SQL Role Definition is created. diff --git a/sdk/python/pulumi_azure/cosmosdb/gremlin_database.py b/sdk/python/pulumi_azure/cosmosdb/gremlin_database.py index 6254a23b0d..a443c76a35 100644 --- a/sdk/python/pulumi_azure/cosmosdb/gremlin_database.py +++ b/sdk/python/pulumi_azure/cosmosdb/gremlin_database.py @@ -271,6 +271,20 @@ def __init__(__self__, """ Manages a Gremlin Database within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_gremlin_database = azure.cosmosdb.GremlinDatabase("exampleGremlinDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import CosmosDB Gremlin Databases can be imported using the `resource id`, e.g. @@ -300,6 +314,20 @@ def __init__(__self__, """ Manages a Gremlin Database within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_gremlin_database = azure.cosmosdb.GremlinDatabase("exampleGremlinDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import CosmosDB Gremlin Databases can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/gremlin_graph.py b/sdk/python/pulumi_azure/cosmosdb/gremlin_graph.py index 9fff46d152..c460d58301 100644 --- a/sdk/python/pulumi_azure/cosmosdb/gremlin_graph.py +++ b/sdk/python/pulumi_azure/cosmosdb/gremlin_graph.py @@ -585,6 +585,43 @@ def __init__(__self__, """ Manages a Gremlin Graph within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_gremlin_database = azure.cosmosdb.GremlinDatabase("exampleGremlinDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_gremlin_graph = azure.cosmosdb.GremlinGraph("exampleGremlinGraph", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_gremlin_database.name, + partition_key_path="/Example", + throughput=400, + index_policy=azure.cosmosdb.GremlinGraphIndexPolicyArgs( + automatic=True, + indexing_mode="consistent", + included_paths=["/*"], + excluded_paths=["/\\"_etag\\"/?"], + ), + conflict_resolution_policy=azure.cosmosdb.GremlinGraphConflictResolutionPolicyArgs( + mode="LastWriterWins", + conflict_resolution_path="/_ts", + ), + unique_keys=[azure.cosmosdb.GremlinGraphUniqueKeyArgs( + paths=[ + "/definition/id1", + "/definition/id2", + ], + )]) + ``` + + > **NOTE:** The CosmosDB Account needs to have the `EnableGremlin` capability enabled to use this resource - which can be done by adding this to the `capabilities` list within the `cosmosdb.Account` resource. + ## Import Cosmos Gremlin Graphs can be imported using the `resource id`, e.g. @@ -619,6 +656,43 @@ def __init__(__self__, """ Manages a Gremlin Graph within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_gremlin_database = azure.cosmosdb.GremlinDatabase("exampleGremlinDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_gremlin_graph = azure.cosmosdb.GremlinGraph("exampleGremlinGraph", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_gremlin_database.name, + partition_key_path="/Example", + throughput=400, + index_policy=azure.cosmosdb.GremlinGraphIndexPolicyArgs( + automatic=True, + indexing_mode="consistent", + included_paths=["/*"], + excluded_paths=["/\\"_etag\\"/?"], + ), + conflict_resolution_policy=azure.cosmosdb.GremlinGraphConflictResolutionPolicyArgs( + mode="LastWriterWins", + conflict_resolution_path="/_ts", + ), + unique_keys=[azure.cosmosdb.GremlinGraphUniqueKeyArgs( + paths=[ + "/definition/id1", + "/definition/id2", + ], + )]) + ``` + + > **NOTE:** The CosmosDB Account needs to have the `EnableGremlin` capability enabled to use this resource - which can be done by adding this to the `capabilities` list within the `cosmosdb.Account` resource. + ## Import Cosmos Gremlin Graphs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/mongo_collection.py b/sdk/python/pulumi_azure/cosmosdb/mongo_collection.py index 8c86c6647e..880ba7807f 100644 --- a/sdk/python/pulumi_azure/cosmosdb/mongo_collection.py +++ b/sdk/python/pulumi_azure/cosmosdb/mongo_collection.py @@ -461,6 +461,30 @@ def __init__(__self__, """ Manages a Mongo Collection within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_mongo_collection = azure.cosmosdb.MongoCollection("exampleMongoCollection", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_mongo_database.name, + default_ttl_seconds=777, + shard_key="uniqueKey", + throughput=400, + indices=[azure.cosmosdb.MongoCollectionIndexArgs( + keys=["_id"], + unique=True, + )]) + ``` + ## Import CosmosDB Mongo Collection can be imported using the `resource id`, e.g. @@ -489,6 +513,30 @@ def __init__(__self__, """ Manages a Mongo Collection within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_mongo_collection = azure.cosmosdb.MongoCollection("exampleMongoCollection", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_mongo_database.name, + default_ttl_seconds=777, + shard_key="uniqueKey", + throughput=400, + indices=[azure.cosmosdb.MongoCollectionIndexArgs( + keys=["_id"], + unique=True, + )]) + ``` + ## Import CosmosDB Mongo Collection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/mongo_database.py b/sdk/python/pulumi_azure/cosmosdb/mongo_database.py index 9fffe497cb..e4a1024768 100644 --- a/sdk/python/pulumi_azure/cosmosdb/mongo_database.py +++ b/sdk/python/pulumi_azure/cosmosdb/mongo_database.py @@ -271,6 +271,20 @@ def __init__(__self__, """ Manages a Mongo Database within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import Cosmos Mongo Database can be imported using the `resource id`, e.g. @@ -300,6 +314,20 @@ def __init__(__self__, """ Manages a Mongo Database within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import Cosmos Mongo Database can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/mongo_role_definition.py b/sdk/python/pulumi_azure/cosmosdb/mongo_role_definition.py index b3aa21660f..7fa5e80708 100644 --- a/sdk/python/pulumi_azure/cosmosdb/mongo_role_definition.py +++ b/sdk/python/pulumi_azure/cosmosdb/mongo_role_definition.py @@ -226,6 +226,41 @@ def __init__(__self__, """ Manages a Cosmos DB Mongo Role Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="MongoDB", + capabilities=[ + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongo", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongoRoleBasedAccessControl", + ), + ], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_mongo_role_definition = azure.cosmosdb.MongoRoleDefinition("exampleMongoRoleDefinition", + cosmos_mongo_database_id=example_mongo_database.id, + role_name="example-roledefinition") + ``` + ## Import Cosmos DB Mongo Role Definitions can be imported using the `resource id`, e.g. @@ -252,6 +287,41 @@ def __init__(__self__, """ Manages a Cosmos DB Mongo Role Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="MongoDB", + capabilities=[ + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongo", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongoRoleBasedAccessControl", + ), + ], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_mongo_role_definition = azure.cosmosdb.MongoRoleDefinition("exampleMongoRoleDefinition", + cosmos_mongo_database_id=example_mongo_database.id, + role_name="example-roledefinition") + ``` + ## Import Cosmos DB Mongo Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/mongo_user_definition.py b/sdk/python/pulumi_azure/cosmosdb/mongo_user_definition.py index 125d6e8d9d..1e9f89145d 100644 --- a/sdk/python/pulumi_azure/cosmosdb/mongo_user_definition.py +++ b/sdk/python/pulumi_azure/cosmosdb/mongo_user_definition.py @@ -221,6 +221,42 @@ def __init__(__self__, """ Manages a Cosmos DB Mongo User Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="MongoDB", + capabilities=[ + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongo", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongoRoleBasedAccessControl", + ), + ], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_mongo_user_definition = azure.cosmosdb.MongoUserDefinition("exampleMongoUserDefinition", + cosmos_mongo_database_id=example_mongo_database.id, + username="myUserName", + password="myPassword") + ``` + ## Import Cosmos DB Mongo User Definitions can be imported using the `resource id`, e.g. @@ -247,6 +283,42 @@ def __init__(__self__, """ Manages a Cosmos DB Mongo User Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="MongoDB", + capabilities=[ + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongo", + ), + azure.cosmosdb.AccountCapabilityArgs( + name="EnableMongoRoleBasedAccessControl", + ), + ], + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_mongo_database = azure.cosmosdb.MongoDatabase("exampleMongoDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_mongo_user_definition = azure.cosmosdb.MongoUserDefinition("exampleMongoUserDefinition", + cosmos_mongo_database_id=example_mongo_database.id, + username="myUserName", + password="myPassword") + ``` + ## Import Cosmos DB Mongo User Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/notebook_workspace.py b/sdk/python/pulumi_azure/cosmosdb/notebook_workspace.py index 4803c8dc15..9438b81158 100644 --- a/sdk/python/pulumi_azure/cosmosdb/notebook_workspace.py +++ b/sdk/python/pulumi_azure/cosmosdb/notebook_workspace.py @@ -201,6 +201,30 @@ def __init__(__self__, > **NOTE:** However, CosmosDb Notebook feature no longer uses the permanent notebook workspace being referred to the public surface in the RP (have since moved to temporary notebooks workspaces which are short-lived <1 hour). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_notebook_workspace = azure.cosmosdb.NotebookWorkspace("exampleNotebookWorkspace", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + ``` + ## Import =SQL Notebook Workspaces can be imported using the `resource id`, e.g. @@ -230,6 +254,30 @@ def __init__(__self__, > **NOTE:** However, CosmosDb Notebook feature no longer uses the permanent notebook workspace being referred to the public surface in the RP (have since moved to temporary notebooks workspaces which are short-lived <1 hour). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_notebook_workspace = azure.cosmosdb.NotebookWorkspace("exampleNotebookWorkspace", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + ``` + ## Import =SQL Notebook Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/postgresql_cluster.py b/sdk/python/pulumi_azure/cosmosdb/postgresql_cluster.py index 3582034be2..67551a2cb2 100644 --- a/sdk/python/pulumi_azure/cosmosdb/postgresql_cluster.py +++ b/sdk/python/pulumi_azure/cosmosdb/postgresql_cluster.py @@ -1020,6 +1020,22 @@ def __init__(__self__, """ Manages an Azure Cosmos DB for PostgreSQL Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=0) + ``` + ## Import Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. @@ -1065,6 +1081,22 @@ def __init__(__self__, """ Manages an Azure Cosmos DB for PostgreSQL Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=0) + ``` + ## Import Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/postgresql_coordinator_configuration.py b/sdk/python/pulumi_azure/cosmosdb/postgresql_coordinator_configuration.py index 99377e5e9a..06098d32ac 100644 --- a/sdk/python/pulumi_azure/cosmosdb/postgresql_coordinator_configuration.py +++ b/sdk/python/pulumi_azure/cosmosdb/postgresql_coordinator_configuration.py @@ -171,6 +171,27 @@ def __init__(__self__, """ Sets a Coordinator Configuration value on Azure Cosmos DB for PostgreSQL Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.core.ResourceGroup("test", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=azurerm_resource_group["example"]["name"], + location=azurerm_resource_group["example"]["location"], + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=2, + node_storage_quota_in_mb=131072, + node_vcores=2) + example_postgresql_coordinator_configuration = azure.cosmosdb.PostgresqlCoordinatorConfiguration("examplePostgresqlCoordinatorConfiguration", + cluster_id=example_postgresql_cluster.id, + value="on") + ``` + ## Import Coordinator Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. @@ -194,6 +215,27 @@ def __init__(__self__, """ Sets a Coordinator Configuration value on Azure Cosmos DB for PostgreSQL Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.core.ResourceGroup("test", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=azurerm_resource_group["example"]["name"], + location=azurerm_resource_group["example"]["location"], + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=2, + node_storage_quota_in_mb=131072, + node_vcores=2) + example_postgresql_coordinator_configuration = azure.cosmosdb.PostgresqlCoordinatorConfiguration("examplePostgresqlCoordinatorConfiguration", + cluster_id=example_postgresql_cluster.id, + value="on") + ``` + ## Import Coordinator Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/postgresql_firewall_rule.py b/sdk/python/pulumi_azure/cosmosdb/postgresql_firewall_rule.py index b3c138a376..6a7ca93675 100644 --- a/sdk/python/pulumi_azure/cosmosdb/postgresql_firewall_rule.py +++ b/sdk/python/pulumi_azure/cosmosdb/postgresql_firewall_rule.py @@ -217,6 +217,26 @@ def __init__(__self__, """ Manages an Azure Cosmos DB for PostgreSQL Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=0) + example_postgresql_firewall_rule = azure.cosmosdb.PostgresqlFirewallRule("examplePostgresqlFirewallRule", + cluster_id=example_postgresql_cluster.id, + start_ip_address="10.0.17.62", + end_ip_address="10.0.17.64") + ``` + ## Import Azure Cosmos DB for PostgreSQL Firewall Rules can be imported using the `resource id`, e.g. @@ -241,6 +261,26 @@ def __init__(__self__, """ Manages an Azure Cosmos DB for PostgreSQL Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=0) + example_postgresql_firewall_rule = azure.cosmosdb.PostgresqlFirewallRule("examplePostgresqlFirewallRule", + cluster_id=example_postgresql_cluster.id, + start_ip_address="10.0.17.62", + end_ip_address="10.0.17.64") + ``` + ## Import Azure Cosmos DB for PostgreSQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/postgresql_node_configuration.py b/sdk/python/pulumi_azure/cosmosdb/postgresql_node_configuration.py index 032f783f5a..16dd2b7aa2 100644 --- a/sdk/python/pulumi_azure/cosmosdb/postgresql_node_configuration.py +++ b/sdk/python/pulumi_azure/cosmosdb/postgresql_node_configuration.py @@ -171,6 +171,27 @@ def __init__(__self__, """ Sets a Node Configuration value on Azure Cosmos DB for PostgreSQL Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=2, + node_storage_quota_in_mb=131072, + node_vcores=2) + example_postgresql_node_configuration = azure.cosmosdb.PostgresqlNodeConfiguration("examplePostgresqlNodeConfiguration", + cluster_id=example_postgresql_cluster.id, + value="on") + ``` + ## Import Node Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. @@ -194,6 +215,27 @@ def __init__(__self__, """ Sets a Node Configuration value on Azure Cosmos DB for PostgreSQL Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=2, + node_storage_quota_in_mb=131072, + node_vcores=2) + example_postgresql_node_configuration = azure.cosmosdb.PostgresqlNodeConfiguration("examplePostgresqlNodeConfiguration", + cluster_id=example_postgresql_cluster.id, + value="on") + ``` + ## Import Node Configurations on Azure Cosmos DB for PostgreSQL Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/postgresql_role.py b/sdk/python/pulumi_azure/cosmosdb/postgresql_role.py index c58806d632..d8f4eb0b68 100644 --- a/sdk/python/pulumi_azure/cosmosdb/postgresql_role.py +++ b/sdk/python/pulumi_azure/cosmosdb/postgresql_role.py @@ -171,6 +171,25 @@ def __init__(__self__, """ Manages an Azure Cosmos DB for PostgreSQL Role. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=0) + example_postgresql_role = azure.cosmosdb.PostgresqlRole("examplePostgresqlRole", + cluster_id=example_postgresql_cluster.id, + password="H@Sh1CoR3!") + ``` + ## Import Azure Cosmos DB for PostgreSQL Roles can be imported using the `resource id`, e.g. @@ -194,6 +213,25 @@ def __init__(__self__, """ Manages an Azure Cosmos DB for PostgreSQL Role. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_postgresql_cluster = azure.cosmosdb.PostgresqlCluster("examplePostgresqlCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login_password="H@Sh1CoR3!", + coordinator_storage_quota_in_mb=131072, + coordinator_vcore_count=2, + node_count=0) + example_postgresql_role = azure.cosmosdb.PostgresqlRole("examplePostgresqlRole", + cluster_id=example_postgresql_cluster.id, + password="H@Sh1CoR3!") + ``` + ## Import Azure Cosmos DB for PostgreSQL Roles can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_container.py b/sdk/python/pulumi_azure/cosmosdb/sql_container.py index 03bfe68da5..8ca4922d57 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_container.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_container.py @@ -593,6 +593,46 @@ def __init__(__self__, """ Manages a SQL Container within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition/id", + partition_key_version=1, + throughput=400, + indexing_policy=azure.cosmosdb.SqlContainerIndexingPolicyArgs( + indexing_mode="consistent", + included_paths=[ + azure.cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs( + path="/*", + ), + azure.cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs( + path="/included/?", + ), + ], + excluded_paths=[azure.cosmosdb.SqlContainerIndexingPolicyExcludedPathArgs( + path="/excluded/?", + )], + ), + unique_keys=[azure.cosmosdb.SqlContainerUniqueKeyArgs( + paths=[ + "/definition/idlong", + "/definition/idshort", + ], + )]) + ``` + ## Import Cosmos SQL Containers can be imported using the `resource id`, e.g. @@ -628,6 +668,46 @@ def __init__(__self__, """ Manages a SQL Container within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition/id", + partition_key_version=1, + throughput=400, + indexing_policy=azure.cosmosdb.SqlContainerIndexingPolicyArgs( + indexing_mode="consistent", + included_paths=[ + azure.cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs( + path="/*", + ), + azure.cosmosdb.SqlContainerIndexingPolicyIncludedPathArgs( + path="/included/?", + ), + ], + excluded_paths=[azure.cosmosdb.SqlContainerIndexingPolicyExcludedPathArgs( + path="/excluded/?", + )], + ), + unique_keys=[azure.cosmosdb.SqlContainerUniqueKeyArgs( + paths=[ + "/definition/idlong", + "/definition/idshort", + ], + )]) + ``` + ## Import Cosmos SQL Containers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_database.py b/sdk/python/pulumi_azure/cosmosdb/sql_database.py index 9075eb30fb..f114dde0ea 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_database.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_database.py @@ -255,6 +255,20 @@ def __init__(__self__, """ Manages a SQL Database within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import Cosmos SQL Database can be imported using the `resource id`, e.g. @@ -281,6 +295,20 @@ def __init__(__self__, """ Manages a SQL Database within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import Cosmos SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_dedicated_gateway.py b/sdk/python/pulumi_azure/cosmosdb/sql_dedicated_gateway.py index 4a98880160..1d76cca6da 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_dedicated_gateway.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_dedicated_gateway.py @@ -180,6 +180,31 @@ def __init__(__self__, """ Manages a SQL Dedicated Gateway within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_dedicated_gateway = azure.cosmosdb.SqlDedicatedGateway("exampleSqlDedicatedGateway", + cosmosdb_account_id=example_account.id, + instance_count=1, + instance_size="Cosmos.D4s") + ``` + ## Import CosmosDB SQL Dedicated Gateways can be imported using the `resource id`, e.g. @@ -203,6 +228,31 @@ def __init__(__self__, """ Manages a SQL Dedicated Gateway within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_dedicated_gateway = azure.cosmosdb.SqlDedicatedGateway("exampleSqlDedicatedGateway", + cosmosdb_account_id=example_account.id, + instance_count=1, + instance_size="Cosmos.D4s") + ``` + ## Import CosmosDB SQL Dedicated Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_function.py b/sdk/python/pulumi_azure/cosmosdb/sql_function.py index f7b4d020e6..5d49570db5 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_function.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_function.py @@ -171,6 +171,28 @@ def __init__(__self__, """ Manages an SQL User Defined Function. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/id") + example_sql_function = azure.cosmosdb.SqlFunction("exampleSqlFunction", + container_id=example_sql_container.id, + body="function trigger(){}") + ``` + ## Import SQL User Defined Functions can be imported using the `resource id`, e.g. @@ -194,6 +216,28 @@ def __init__(__self__, """ Manages an SQL User Defined Function. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/id") + example_sql_function = azure.cosmosdb.SqlFunction("exampleSqlFunction", + container_id=example_sql_container.id, + body="function trigger(){}") + ``` + ## Import SQL User Defined Functions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_role_assignment.py b/sdk/python/pulumi_azure/cosmosdb/sql_role_assignment.py index 33c149fa6b..299e206273 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_role_assignment.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_role_assignment.py @@ -297,6 +297,42 @@ def __init__(__self__, """ Manages a Cosmos DB SQL Role Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_role_definition = azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + type="CustomRole", + assignable_scopes=[example_account.id], + permissions=[azure.cosmosdb.SqlRoleDefinitionPermissionArgs( + data_actions=["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"], + )]) + example_sql_role_assignment = azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + role_definition_id=example_sql_role_definition.id, + principal_id=current.object_id, + scope=example_account.id) + ``` + ## Import Cosmos DB SQL Role Assignments can be imported using the `resource id`, e.g. @@ -323,6 +359,42 @@ def __init__(__self__, """ Manages a Cosmos DB SQL Role Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_role_definition = azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + type="CustomRole", + assignable_scopes=[example_account.id], + permissions=[azure.cosmosdb.SqlRoleDefinitionPermissionArgs( + data_actions=["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"], + )]) + example_sql_role_assignment = azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + role_definition_id=example_sql_role_definition.id, + principal_id=current.object_id, + scope=example_account.id) + ``` + ## Import Cosmos DB SQL Role Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_role_definition.py b/sdk/python/pulumi_azure/cosmosdb/sql_role_definition.py index ab76636b76..ff69fa891a 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_role_definition.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_role_definition.py @@ -343,6 +343,36 @@ def __init__(__self__, """ Manages a Cosmos DB SQL Role Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_role_definition = azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition", + role_definition_id="84cf3a8b-4122-4448-bce2-fa423cfe0a15", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + assignable_scopes=[example_account.id.apply(lambda id: f"{id}/dbs/sales")], + permissions=[azure.cosmosdb.SqlRoleDefinitionPermissionArgs( + data_actions=["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"], + )]) + ``` + ## Import Cosmos DB SQL Role Definitions can be imported using the `resource id`, e.g. @@ -372,6 +402,36 @@ def __init__(__self__, """ Manages a Cosmos DB SQL Role Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_role_definition = azure.cosmosdb.SqlRoleDefinition("exampleSqlRoleDefinition", + role_definition_id="84cf3a8b-4122-4448-bce2-fa423cfe0a15", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + assignable_scopes=[example_account.id.apply(lambda id: f"{id}/dbs/sales")], + permissions=[azure.cosmosdb.SqlRoleDefinitionPermissionArgs( + data_actions=["Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read"], + )]) + ``` + ## Import Cosmos DB SQL Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_stored_procedure.py b/sdk/python/pulumi_azure/cosmosdb/sql_stored_procedure.py index 5d7f505645..8ce5ab2e1b 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_stored_procedure.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_stored_procedure.py @@ -297,6 +297,31 @@ def __init__(__self__, """ Manages a SQL Stored Procedure within a Cosmos DB Account SQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/id") + example_sql_stored_procedure = azure.cosmosdb.SqlStoredProcedure("exampleSqlStoredProcedure", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + container_name=example_sql_container.name, + body=" function () { var context = getContext(); var response = context.getResponse(); response.setBody('Hello, World'); }\\n") + ``` + ## Import CosmosDB SQL Stored Procedures can be imported using the `resource id`, e.g. @@ -323,6 +348,31 @@ def __init__(__self__, """ Manages a SQL Stored Procedure within a Cosmos DB Account SQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/id") + example_sql_stored_procedure = azure.cosmosdb.SqlStoredProcedure("exampleSqlStoredProcedure", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + container_name=example_sql_container.name, + body=" function () { var context = getContext(); var response = context.getResponse(); response.setBody('Hello, World'); }\\n") + ``` + ## Import CosmosDB SQL Stored Procedures can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/sql_trigger.py b/sdk/python/pulumi_azure/cosmosdb/sql_trigger.py index 3ecd8d8cb3..6c3b152674 100644 --- a/sdk/python/pulumi_azure/cosmosdb/sql_trigger.py +++ b/sdk/python/pulumi_azure/cosmosdb/sql_trigger.py @@ -247,6 +247,30 @@ def __init__(__self__, """ Manages an SQL Trigger. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/id") + example_sql_trigger = azure.cosmosdb.SqlTrigger("exampleSqlTrigger", + container_id=example_sql_container.id, + body="function trigger(){}", + operation="Delete", + type="Post") + ``` + ## Import SQL Triggers can be imported using the `resource id`, e.g. @@ -272,6 +296,30 @@ def __init__(__self__, """ Manages an SQL Trigger. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/id") + example_sql_trigger = azure.cosmosdb.SqlTrigger("exampleSqlTrigger", + container_id=example_sql_container.id, + body="function trigger(){}", + operation="Delete", + type="Post") + ``` + ## Import SQL Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/cosmosdb/table.py b/sdk/python/pulumi_azure/cosmosdb/table.py index 8415cb4dc2..f35f8a3788 100644 --- a/sdk/python/pulumi_azure/cosmosdb/table.py +++ b/sdk/python/pulumi_azure/cosmosdb/table.py @@ -271,6 +271,20 @@ def __init__(__self__, """ Manages a Table within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_table = azure.cosmosdb.Table("exampleTable", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import CosmosDB Tables can be imported using the `resource id`, e.g. @@ -300,6 +314,20 @@ def __init__(__self__, """ Manages a Table within a Cosmos DB Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_table = azure.cosmosdb.Table("exampleTable", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + ``` + ## Import CosmosDB Tables can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/costmanagement/anomaly_alert.py b/sdk/python/pulumi_azure/costmanagement/anomaly_alert.py index 09255db31e..f5a2ebae01 100644 --- a/sdk/python/pulumi_azure/costmanagement/anomaly_alert.py +++ b/sdk/python/pulumi_azure/costmanagement/anomaly_alert.py @@ -254,6 +254,18 @@ def __init__(__self__, """ Manages a Cost Anomaly Alert. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.costmanagement.AnomalyAlert("example", + display_name="Alert DisplayName", + email_addresses=["example@test.net"], + email_subject="My Test Anomaly Alert") + ``` + ## Import Cost Anomaly Alerts can be imported using the `resource id`, e.g. @@ -279,6 +291,18 @@ def __init__(__self__, """ Manages a Cost Anomaly Alert. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.costmanagement.AnomalyAlert("example", + display_name="Alert DisplayName", + email_addresses=["example@test.net"], + email_subject="My Test Anomaly Alert") + ``` + ## Import Cost Anomaly Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/costmanagement/scheduled_action.py b/sdk/python/pulumi_azure/costmanagement/scheduled_action.py index 2dea7fe269..b2bdc66c00 100644 --- a/sdk/python/pulumi_azure/costmanagement/scheduled_action.py +++ b/sdk/python/pulumi_azure/costmanagement/scheduled_action.py @@ -624,6 +624,24 @@ def __init__(__self__, """ Manages an Azure Cost Management Scheduled Action. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.costmanagement.ScheduledAction("example", + display_name="Report Last 6 Months", + email_address_sender="platformteam@test.com", + email_addresses=["example@example.com"], + email_subject="Cost Management Report", + end_date="2023-02-02T00:00:00Z", + frequency="Daily", + message="Hi all, take a look at last 6 months spending!", + start_date="2023-01-02T00:00:00Z", + view_id="/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService") + ``` + ## Import Azure Cost Management Scheduled Actions can be imported using the `resource id`, e.g. @@ -658,6 +676,24 @@ def __init__(__self__, """ Manages an Azure Cost Management Scheduled Action. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.costmanagement.ScheduledAction("example", + display_name="Report Last 6 Months", + email_address_sender="platformteam@test.com", + email_addresses=["example@example.com"], + email_subject="Cost Management Report", + end_date="2023-02-02T00:00:00Z", + frequency="Daily", + message="Hi all, take a look at last 6 months spending!", + start_date="2023-01-02T00:00:00Z", + view_id="/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService") + ``` + ## Import Azure Cost Management Scheduled Actions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dashboard/azurerm_portal_dashboard.py b/sdk/python/pulumi_azure/dashboard/azurerm_portal_dashboard.py index fe12940ad0..a66f0025a1 100644 --- a/sdk/python/pulumi_azure/dashboard/azurerm_portal_dashboard.py +++ b/sdk/python/pulumi_azure/dashboard/azurerm_portal_dashboard.py @@ -117,6 +117,17 @@ def azurerm_portal_dashboard(dashboard_properties: Optional[str] = None, """ Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `portal.Dashboard` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.portal.get_dashboard(name="existing-dashboard", + resource_group_name="dashboard-rg") + pulumi.export("id", data["azurerm_dashboard"]["example"]["id"]) + ``` + :param str dashboard_properties: JSON data representing dashboard body. :param str display_name: Specifies the display name of the shared Azure Portal Dashboard. @@ -151,6 +162,17 @@ def azurerm_portal_dashboard_output(dashboard_properties: Optional[pulumi.Input[ """ Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `portal.Dashboard` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.portal.get_dashboard(name="existing-dashboard", + resource_group_name="dashboard-rg") + pulumi.export("id", data["azurerm_dashboard"]["example"]["id"]) + ``` + :param str dashboard_properties: JSON data representing dashboard body. :param str display_name: Specifies the display name of the shared Azure Portal Dashboard. diff --git a/sdk/python/pulumi_azure/dashboard/dashboard.py b/sdk/python/pulumi_azure/dashboard/dashboard.py index b006020384..e0fdd76d26 100644 --- a/sdk/python/pulumi_azure/dashboard/dashboard.py +++ b/sdk/python/pulumi_azure/dashboard/dashboard.py @@ -263,6 +263,141 @@ def __init__(__self__, !> **Note:** The `portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `portal.PortalDashboard` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + md_content = config.get("mdContent") + if md_content is None: + md_content = "# Hello all :)" + video_link = config.get("videoLink") + if video_link is None: + video_link = "https://www.youtube.com/watch?v=......" + current = azure.core.get_subscription() + example = azure.core.ResourceGroup("example", location="West Europe") + my_board = azure.portal.Dashboard("my-board", + resource_group_name=example.name, + location=example.location, + tags={ + "source": "managed", + }, + dashboard_properties=f\"\"\"{{ + "lenses": {{ + "0": {{ + "order": 0, + "parts": {{ + "0": {{ + "position": {{ + "x": 0, + "y": 0, + "rowSpan": 2, + "colSpan": 3 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": {{ + "content": {{ + "settings": {{ + "content": "{md_content}", + "subtitle": "", + "title": "" + }} + }} + }} + }} + }}, + "1": {{ + "position": {{ + "x": 5, + "y": 0, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/VideoPart", + "settings": {{ + "content": {{ + "settings": {{ + "title": "Important Information", + "subtitle": "", + "src": "{video_link}", + "autoplay": true + }} + }} + }} + }} + }}, + "2": {{ + "position": {{ + "x": 0, + "y": 4, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [ + {{ + "name": "ComponentId", + "value": "/subscriptions/{current.subscription_id}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" + }} + ], + "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", + "settings": {{}}, + "asset": {{ + "idInputName": "ComponentId", + "type": "ApplicationInsights" + }} + }} + }} + }} + }} + }}, + "metadata": {{ + "model": {{ + "timeRange": {{ + "value": {{ + "relative": {{ + "duration": 24, + "timeUnit": 1 + }} + }}, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + }}, + "filterLocale": {{ + "value": "en-us" + }}, + "filters": {{ + "value": {{ + "MsPortalFx_TimeRange": {{ + "model": {{ + "format": "utc", + "granularity": "auto", + "relative": "24h" + }}, + "displayCache": {{ + "name": "UTC Time", + "value": "Past 24 hours" + }}, + "filteredPartIds": [ + "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" + ] + }} + }} + }} + }} + }} + }} + \"\"\") + ``` + + It is recommended to follow the steps outlined + [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + ## Import Dashboards can be imported using the `resource id`, e.g. @@ -294,6 +429,141 @@ def __init__(__self__, !> **Note:** The `portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `portal.PortalDashboard` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + md_content = config.get("mdContent") + if md_content is None: + md_content = "# Hello all :)" + video_link = config.get("videoLink") + if video_link is None: + video_link = "https://www.youtube.com/watch?v=......" + current = azure.core.get_subscription() + example = azure.core.ResourceGroup("example", location="West Europe") + my_board = azure.portal.Dashboard("my-board", + resource_group_name=example.name, + location=example.location, + tags={ + "source": "managed", + }, + dashboard_properties=f\"\"\"{{ + "lenses": {{ + "0": {{ + "order": 0, + "parts": {{ + "0": {{ + "position": {{ + "x": 0, + "y": 0, + "rowSpan": 2, + "colSpan": 3 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": {{ + "content": {{ + "settings": {{ + "content": "{md_content}", + "subtitle": "", + "title": "" + }} + }} + }} + }} + }}, + "1": {{ + "position": {{ + "x": 5, + "y": 0, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/VideoPart", + "settings": {{ + "content": {{ + "settings": {{ + "title": "Important Information", + "subtitle": "", + "src": "{video_link}", + "autoplay": true + }} + }} + }} + }} + }}, + "2": {{ + "position": {{ + "x": 0, + "y": 4, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [ + {{ + "name": "ComponentId", + "value": "/subscriptions/{current.subscription_id}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" + }} + ], + "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", + "settings": {{}}, + "asset": {{ + "idInputName": "ComponentId", + "type": "ApplicationInsights" + }} + }} + }} + }} + }} + }}, + "metadata": {{ + "model": {{ + "timeRange": {{ + "value": {{ + "relative": {{ + "duration": 24, + "timeUnit": 1 + }} + }}, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + }}, + "filterLocale": {{ + "value": "en-us" + }}, + "filters": {{ + "value": {{ + "MsPortalFx_TimeRange": {{ + "model": {{ + "format": "utc", + "granularity": "auto", + "relative": "24h" + }}, + "displayCache": {{ + "name": "UTC Time", + "value": "Past 24 hours" + }}, + "filteredPartIds": [ + "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" + ] + }} + }} + }} + }} + }} + }} + \"\"\") + ``` + + It is recommended to follow the steps outlined + [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + ## Import Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dashboard/grafana.py b/sdk/python/pulumi_azure/dashboard/grafana.py index f94334445b..6f74efcd9e 100644 --- a/sdk/python/pulumi_azure/dashboard/grafana.py +++ b/sdk/python/pulumi_azure/dashboard/grafana.py @@ -587,6 +587,27 @@ def __init__(__self__, """ Manages a Dashboard Grafana. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_grafana = azure.dashboard.Grafana("exampleGrafana", + resource_group_name=example_resource_group.name, + location="West Europe", + api_key_enabled=True, + deterministic_outbound_ip_enabled=True, + public_network_access_enabled=False, + identity=azure.dashboard.GrafanaIdentityArgs( + type="SystemAssigned", + ), + tags={ + "key": "value", + }) + ``` + ## Import Dashboard Grafana can be imported using the `resource id`, e.g. @@ -619,6 +640,27 @@ def __init__(__self__, """ Manages a Dashboard Grafana. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_grafana = azure.dashboard.Grafana("exampleGrafana", + resource_group_name=example_resource_group.name, + location="West Europe", + api_key_enabled=True, + deterministic_outbound_ip_enabled=True, + public_network_access_enabled=False, + identity=azure.dashboard.GrafanaIdentityArgs( + type="SystemAssigned", + ), + tags={ + "key": "value", + }) + ``` + ## Import Dashboard Grafana can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/databasemigration/get_project.py b/sdk/python/pulumi_azure/databasemigration/get_project.py index 6720437a0e..31affbbd78 100644 --- a/sdk/python/pulumi_azure/databasemigration/get_project.py +++ b/sdk/python/pulumi_azure/databasemigration/get_project.py @@ -126,6 +126,18 @@ def get_project(name: Optional[str] = None, """ Use this data source to access information about an existing Database Migration Project. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databasemigration.get_project(name="example-dbms-project", + resource_group_name="example-rg", + service_name="example-dbms") + pulumi.export("name", example.name) + ``` + :param str name: Name of the database migration project. :param str resource_group_name: Name of the resource group where resource belongs to. @@ -157,6 +169,18 @@ def get_project_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Database Migration Project. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databasemigration.get_project(name="example-dbms-project", + resource_group_name="example-rg", + service_name="example-dbms") + pulumi.export("name", example.name) + ``` + :param str name: Name of the database migration project. :param str resource_group_name: Name of the resource group where resource belongs to. diff --git a/sdk/python/pulumi_azure/databasemigration/get_service.py b/sdk/python/pulumi_azure/databasemigration/get_service.py index 1b007aff48..c2e370ba83 100644 --- a/sdk/python/pulumi_azure/databasemigration/get_service.py +++ b/sdk/python/pulumi_azure/databasemigration/get_service.py @@ -116,6 +116,17 @@ def get_service(name: Optional[str] = None, """ Use this data source to access information about an existing Database Migration Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databasemigration.get_service(name="example-dms", + resource_group_name="example-rg") + pulumi.export("azurermDmsId", example.id) + ``` + :param str name: Specify the name of the database migration service. :param str resource_group_name: Specifies the Name of the Resource Group within which the database migration service exists @@ -143,6 +154,17 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Database Migration Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databasemigration.get_service(name="example-dms", + resource_group_name="example-rg") + pulumi.export("azurermDmsId", example.id) + ``` + :param str name: Specify the name of the database migration service. :param str resource_group_name: Specifies the Name of the Resource Group within which the database migration service exists diff --git a/sdk/python/pulumi_azure/databasemigration/project.py b/sdk/python/pulumi_azure/databasemigration/project.py index 619f1605ba..2bbec1a4a8 100644 --- a/sdk/python/pulumi_azure/databasemigration/project.py +++ b/sdk/python/pulumi_azure/databasemigration/project.py @@ -335,6 +335,34 @@ def __init__(__self__, > **NOTE:** Destroying a Database Migration Project will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service = azure.databasemigration.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + subnet_id=example_subnet.id, + sku_name="Standard_1vCores") + example_project = azure.databasemigration.Project("exampleProject", + service_name=example_service.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + source_platform="SQL", + target_platform="SQLDB") + ``` + ## Import Database Migration Projects can be imported using the `resource id`, e.g. @@ -364,6 +392,34 @@ def __init__(__self__, > **NOTE:** Destroying a Database Migration Project will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service = azure.databasemigration.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + subnet_id=example_subnet.id, + sku_name="Standard_1vCores") + example_project = azure.databasemigration.Project("exampleProject", + service_name=example_service.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + source_platform="SQL", + target_platform="SQLDB") + ``` + ## Import Database Migration Projects can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/databasemigration/service.py b/sdk/python/pulumi_azure/databasemigration/service.py index 217e0b1574..add778bcd6 100644 --- a/sdk/python/pulumi_azure/databasemigration/service.py +++ b/sdk/python/pulumi_azure/databasemigration/service.py @@ -293,6 +293,28 @@ def __init__(__self__, > **NOTE:** Destroying a Database Migration Service will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provide. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service = azure.databasemigration.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + subnet_id=example_subnet.id, + sku_name="Standard_1vCores") + ``` + ## Import Database Migration Services can be imported using the `resource id`, e.g. @@ -321,6 +343,28 @@ def __init__(__self__, > **NOTE:** Destroying a Database Migration Service will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provide. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_service = azure.databasemigration.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + subnet_id=example_subnet.id, + sku_name="Standard_1vCores") + ``` + ## Import Database Migration Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/databoxedge/device.py b/sdk/python/pulumi_azure/databoxedge/device.py index 1d0df76d50..25fd0250c5 100644 --- a/sdk/python/pulumi_azure/databoxedge/device.py +++ b/sdk/python/pulumi_azure/databoxedge/device.py @@ -271,6 +271,19 @@ def __init__(__self__, """ Manages a Databox Edge Device. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + ``` + ## Import Databox Edge Devices can be imported using the `resource id`, e.g. @@ -296,6 +309,19 @@ def __init__(__self__, """ Manages a Databox Edge Device. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + ``` + ## Import Databox Edge Devices can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/databoxedge/get_device.py b/sdk/python/pulumi_azure/databoxedge/get_device.py index 7a0d0d31d0..54098e07c0 100644 --- a/sdk/python/pulumi_azure/databoxedge/get_device.py +++ b/sdk/python/pulumi_azure/databoxedge/get_device.py @@ -117,6 +117,16 @@ def get_device(name: Optional[str] = None, """ Get information about a Databox Edge Device. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databoxedge.get_device(name="example-device", + resource_group_name="example-rg") + ``` + :param str name: The name which should be used for this Databox Edge Device. Changing this forces a new Databox Edge Device to be created. :param str resource_group_name: The name of the Resource Group where the Databox Edge Device should exist. Changing this forces a new Databox Edge Device to be created. @@ -144,6 +154,16 @@ def get_device_output(name: Optional[pulumi.Input[str]] = None, """ Get information about a Databox Edge Device. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databoxedge.get_device(name="example-device", + resource_group_name="example-rg") + ``` + :param str name: The name which should be used for this Databox Edge Device. Changing this forces a new Databox Edge Device to be created. :param str resource_group_name: The name of the Resource Group where the Databox Edge Device should exist. Changing this forces a new Databox Edge Device to be created. diff --git a/sdk/python/pulumi_azure/databoxedge/order.py b/sdk/python/pulumi_azure/databoxedge/order.py index 90bfa31f90..f77a9fcc4a 100644 --- a/sdk/python/pulumi_azure/databoxedge/order.py +++ b/sdk/python/pulumi_azure/databoxedge/order.py @@ -338,6 +338,35 @@ def __init__(__self__, !> Creation of Databox Edge Order is not supported by the Azure API - as such the `databoxedge.Order` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + example_order = azure.databoxedge.Order("exampleOrder", + resource_group_name=example_resource_group.name, + device_name=example_device.name, + contact=azure.databoxedge.OrderContactArgs( + name="TerraForm Test", + emails=["creator4983@FlynnsArcade.com"], + company_name="Flynn's Arcade", + phone_number="(800) 555-1234", + ), + shipment_address=azure.databoxedge.OrderShipmentAddressArgs( + addresses=["One Microsoft Way"], + city="Redmond", + postal_code="98052", + state="WA", + country="United States", + )) + ``` + ## Import Databox Edge Orders can be imported using the `resource id`, e.g. @@ -364,6 +393,35 @@ def __init__(__self__, !> Creation of Databox Edge Order is not supported by the Azure API - as such the `databoxedge.Order` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + example_order = azure.databoxedge.Order("exampleOrder", + resource_group_name=example_resource_group.name, + device_name=example_device.name, + contact=azure.databoxedge.OrderContactArgs( + name="TerraForm Test", + emails=["creator4983@FlynnsArcade.com"], + company_name="Flynn's Arcade", + phone_number="(800) 555-1234", + ), + shipment_address=azure.databoxedge.OrderShipmentAddressArgs( + addresses=["One Microsoft Way"], + city="Redmond", + postal_code="98052", + state="WA", + country="United States", + )) + ``` + ## Import Databox Edge Orders can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/databricks/access_connector.py b/sdk/python/pulumi_azure/databricks/access_connector.py index 7e1df32943..3da34f066d 100644 --- a/sdk/python/pulumi_azure/databricks/access_connector.py +++ b/sdk/python/pulumi_azure/databricks/access_connector.py @@ -246,6 +246,24 @@ def __init__(__self__, """ Manages a Databricks Access Connector + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_access_connector = azure.databricks.AccessConnector("exampleAccessConnector", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.databricks.AccessConnectorIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Environment": "Production", + }) + ``` + ## Import Databricks Access Connectors can be imported using the `resource id`, e.g. @@ -271,6 +289,24 @@ def __init__(__self__, """ Manages a Databricks Access Connector + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_access_connector = azure.databricks.AccessConnector("exampleAccessConnector", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.databricks.AccessConnectorIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Environment": "Production", + }) + ``` + ## Import Databricks Access Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/databricks/get_workspace.py b/sdk/python/pulumi_azure/databricks/get_workspace.py index a4cda1898c..78e71f5c0f 100644 --- a/sdk/python/pulumi_azure/databricks/get_workspace.py +++ b/sdk/python/pulumi_azure/databricks/get_workspace.py @@ -154,6 +154,17 @@ def get_workspace(name: Optional[str] = None, """ Use this data source to access information about an existing Databricks workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databricks.get_workspace(name="example-workspace", + resource_group_name="example-rg") + pulumi.export("databricksWorkspaceId", example.workspace_id) + ``` + :param str name: The name of the Databricks Workspace. :param str resource_group_name: The Name of the Resource Group where the Databricks Workspace exists. @@ -187,6 +198,17 @@ def get_workspace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Databricks workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databricks.get_workspace(name="example-workspace", + resource_group_name="example-rg") + pulumi.export("databricksWorkspaceId", example.workspace_id) + ``` + :param str name: The name of the Databricks Workspace. :param str resource_group_name: The Name of the Resource Group where the Databricks Workspace exists. diff --git a/sdk/python/pulumi_azure/databricks/get_workspace_private_endpoint_connection.py b/sdk/python/pulumi_azure/databricks/get_workspace_private_endpoint_connection.py index 94f058e7d9..505c82a66e 100644 --- a/sdk/python/pulumi_azure/databricks/get_workspace_private_endpoint_connection.py +++ b/sdk/python/pulumi_azure/databricks/get_workspace_private_endpoint_connection.py @@ -87,6 +87,17 @@ def get_workspace_private_endpoint_connection(private_endpoint_id: Optional[str] """ Use this data source to access information on an existing Databricks Workspace private endpoint connection state. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databricks.get_workspace_private_endpoint_connection(workspace_id=azurerm_databricks_workspace["example"]["id"], + private_endpoint_id=azurerm_private_endpoint["example"]["id"]) + pulumi.export("databricksWorkspacePrivateEndpointConnectionStatus", example.connections[0].status) + ``` + :param str private_endpoint_id: The resource ID of the Private Endpoint. :param str workspace_id: The resource ID of the Databricks Workspace. @@ -111,6 +122,17 @@ def get_workspace_private_endpoint_connection_output(private_endpoint_id: Option """ Use this data source to access information on an existing Databricks Workspace private endpoint connection state. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.databricks.get_workspace_private_endpoint_connection(workspace_id=azurerm_databricks_workspace["example"]["id"], + private_endpoint_id=azurerm_private_endpoint["example"]["id"]) + pulumi.export("databricksWorkspacePrivateEndpointConnectionStatus", example.connections[0].status) + ``` + :param str private_endpoint_id: The resource ID of the Private Endpoint. :param str workspace_id: The resource ID of the Databricks Workspace. diff --git a/sdk/python/pulumi_azure/databricks/virtual_network_peering.py b/sdk/python/pulumi_azure/databricks/virtual_network_peering.py index 2bfc8bb194..208660ef28 100644 --- a/sdk/python/pulumi_azure/databricks/virtual_network_peering.py +++ b/sdk/python/pulumi_azure/databricks/virtual_network_peering.py @@ -483,6 +483,34 @@ def __init__(__self__, """ Manages a Databricks Virtual Network Peering + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + remote_virtual_network = azure.network.VirtualNetwork("remoteVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.1.0/24"], + location=example_resource_group.location) + example_workspace = azure.databricks.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + example_virtual_network_peering = azure.databricks.VirtualNetworkPeering("exampleVirtualNetworkPeering", + resource_group_name=example_resource_group.name, + workspace_id=example_workspace.id, + remote_address_space_prefixes=remote_virtual_network.address_spaces, + remote_virtual_network_id=remote_virtual_network.id, + allow_virtual_network_access=True) + remote_virtual_network_peering = azure.network.VirtualNetworkPeering("remoteVirtualNetworkPeering", + resource_group_name=example_resource_group.name, + virtual_network_name=remote_virtual_network.name, + remote_virtual_network_id=example_virtual_network_peering.virtual_network_id, + allow_virtual_network_access=True) + ``` + ## Import Databrick Virtual Network Peerings can be imported using the `resource id`, e.g. @@ -516,6 +544,34 @@ def __init__(__self__, """ Manages a Databricks Virtual Network Peering + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + remote_virtual_network = azure.network.VirtualNetwork("remoteVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.1.0/24"], + location=example_resource_group.location) + example_workspace = azure.databricks.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + example_virtual_network_peering = azure.databricks.VirtualNetworkPeering("exampleVirtualNetworkPeering", + resource_group_name=example_resource_group.name, + workspace_id=example_workspace.id, + remote_address_space_prefixes=remote_virtual_network.address_spaces, + remote_virtual_network_id=remote_virtual_network.id, + allow_virtual_network_access=True) + remote_virtual_network_peering = azure.network.VirtualNetworkPeering("remoteVirtualNetworkPeering", + resource_group_name=example_resource_group.name, + virtual_network_name=remote_virtual_network.name, + remote_virtual_network_id=example_virtual_network_peering.virtual_network_id, + allow_virtual_network_access=True) + ``` + ## Import Databrick Virtual Network Peerings can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datadog/monitor.py b/sdk/python/pulumi_azure/datadog/monitor.py index 626a2e58ff..e0383b91ab 100644 --- a/sdk/python/pulumi_azure/datadog/monitor.py +++ b/sdk/python/pulumi_azure/datadog/monitor.py @@ -430,10 +430,47 @@ def __init__(__self__, Manages a datadog Monitor. ## Example Usage + ### Monitor creation with linking to Datadog organization + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US 2") + example_monitor = azure.datadog.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datadog_organization=azure.datadog.MonitorDatadogOrganizationArgs( + api_key="XXXX", + application_key="XXXX", + ), + user=azure.datadog.MonitorUserArgs( + name="Example", + email="abc@xyz.com", + ), + sku_name="Linked", + identity=azure.datadog.MonitorIdentityArgs( + type="SystemAssigned", + )) + ``` ## Role Assignment To enable metrics flow, perform role assignment on the identity created above. `Monitoring reader(43d0d8ad-25c7-4714-9337-8ba259a9fe05)` role is required . + ### Role assignment on the monitor created + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + monitoring_reader = azure.authorization.get_role_definition(name="Monitoring Reader") + example = azure.authorization.Assignment("example", + scope=primary.id, + role_definition_id=monitoring_reader.role_definition_id, + principal_id=azurerm_datadog_monitor["example"]["identity"][0]["principal_id"]) + ``` + ## Import Datadog Monitors can be imported using the `resource id`, e.g. @@ -464,10 +501,47 @@ def __init__(__self__, Manages a datadog Monitor. ## Example Usage + ### Monitor creation with linking to Datadog organization + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US 2") + example_monitor = azure.datadog.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datadog_organization=azure.datadog.MonitorDatadogOrganizationArgs( + api_key="XXXX", + application_key="XXXX", + ), + user=azure.datadog.MonitorUserArgs( + name="Example", + email="abc@xyz.com", + ), + sku_name="Linked", + identity=azure.datadog.MonitorIdentityArgs( + type="SystemAssigned", + )) + ``` ## Role Assignment To enable metrics flow, perform role assignment on the identity created above. `Monitoring reader(43d0d8ad-25c7-4714-9337-8ba259a9fe05)` role is required . + ### Role assignment on the monitor created + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + monitoring_reader = azure.authorization.get_role_definition(name="Monitoring Reader") + example = azure.authorization.Assignment("example", + scope=primary.id, + role_definition_id=monitoring_reader.role_definition_id, + principal_id=azurerm_datadog_monitor["example"]["identity"][0]["principal_id"]) + ``` + ## Import Datadog Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datadog/monitor_sso_configuration.py b/sdk/python/pulumi_azure/datadog/monitor_sso_configuration.py index c48b849120..b812210621 100644 --- a/sdk/python/pulumi_azure/datadog/monitor_sso_configuration.py +++ b/sdk/python/pulumi_azure/datadog/monitor_sso_configuration.py @@ -238,6 +238,32 @@ def __init__(__self__, Manages SingleSignOn on the datadog Monitor. ## Example Usage + ### Enabling SSO on monitor + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US 2") + example_monitor = azure.datadog.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datadog_organization=azure.datadog.MonitorDatadogOrganizationArgs( + api_key="XXXX", + application_key="XXXX", + ), + user=azure.datadog.MonitorUserArgs( + name="Example", + email="abc@xyz.com", + ), + sku_name="Linked", + identity=azure.datadog.MonitorIdentityArgs( + type="SystemAssigned", + )) + example_monitor_sso_configuration = azure.datadog.MonitorSsoConfiguration("exampleMonitorSsoConfiguration", + datadog_monitor_id=example_monitor.id, + single_sign_on_enabled="Enable", + enterprise_application_id="XXXX") + ``` ## Import @@ -264,6 +290,32 @@ def __init__(__self__, Manages SingleSignOn on the datadog Monitor. ## Example Usage + ### Enabling SSO on monitor + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US 2") + example_monitor = azure.datadog.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datadog_organization=azure.datadog.MonitorDatadogOrganizationArgs( + api_key="XXXX", + application_key="XXXX", + ), + user=azure.datadog.MonitorUserArgs( + name="Example", + email="abc@xyz.com", + ), + sku_name="Linked", + identity=azure.datadog.MonitorIdentityArgs( + type="SystemAssigned", + )) + example_monitor_sso_configuration = azure.datadog.MonitorSsoConfiguration("exampleMonitorSsoConfiguration", + datadog_monitor_id=example_monitor.id, + single_sign_on_enabled="Enable", + enterprise_application_id="XXXX") + ``` ## Import diff --git a/sdk/python/pulumi_azure/datadog/monitor_tag_rule.py b/sdk/python/pulumi_azure/datadog/monitor_tag_rule.py index a8a39cb0af..e7c7b780e3 100644 --- a/sdk/python/pulumi_azure/datadog/monitor_tag_rule.py +++ b/sdk/python/pulumi_azure/datadog/monitor_tag_rule.py @@ -210,6 +210,40 @@ def __init__(__self__, Manages TagRules on the datadog Monitor. ## Example Usage + ### Adding TagRules on monitor + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US 2") + example_monitor = azure.datadog.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datadog_organization=azure.datadog.MonitorDatadogOrganizationArgs( + api_key="XXXX", + application_key="XXXX", + ), + user=azure.datadog.MonitorUserArgs( + name="Example", + email="abc@xyz.com", + ), + sku_name="Linked", + identity=azure.datadog.MonitorIdentityArgs( + type="SystemAssigned", + )) + example_monitor_tag_rule = azure.datadog.MonitorTagRule("exampleMonitorTagRule", + datadog_monitor_id=example_monitor.id, + logs=[azure.datadog.MonitorTagRuleLogArgs( + subscription_log_enabled=True, + )], + metrics=[azure.datadog.MonitorTagRuleMetricArgs( + filters=[azure.datadog.MonitorTagRuleMetricFilterArgs( + name="Test", + value="Logs", + action="Include", + )], + )]) + ``` ## Import @@ -236,6 +270,40 @@ def __init__(__self__, Manages TagRules on the datadog Monitor. ## Example Usage + ### Adding TagRules on monitor + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US 2") + example_monitor = azure.datadog.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datadog_organization=azure.datadog.MonitorDatadogOrganizationArgs( + api_key="XXXX", + application_key="XXXX", + ), + user=azure.datadog.MonitorUserArgs( + name="Example", + email="abc@xyz.com", + ), + sku_name="Linked", + identity=azure.datadog.MonitorIdentityArgs( + type="SystemAssigned", + )) + example_monitor_tag_rule = azure.datadog.MonitorTagRule("exampleMonitorTagRule", + datadog_monitor_id=example_monitor.id, + logs=[azure.datadog.MonitorTagRuleLogArgs( + subscription_log_enabled=True, + )], + metrics=[azure.datadog.MonitorTagRuleMetricArgs( + filters=[azure.datadog.MonitorTagRuleMetricFilterArgs( + name="Test", + value="Logs", + action="Include", + )], + )]) + ``` ## Import diff --git a/sdk/python/pulumi_azure/datafactory/custom_dataset.py b/sdk/python/pulumi_azure/datafactory/custom_dataset.py index 3e4921597d..dc53fdab81 100644 --- a/sdk/python/pulumi_azure/datafactory/custom_dataset.py +++ b/sdk/python/pulumi_azure/datafactory/custom_dataset.py @@ -487,6 +487,91 @@ def __init__(__self__, """ Manages a Dataset inside an Azure Data Factory. This is a generic resource that supports all different Dataset Types. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString":"{primary_connection_string}" + }} + \"\"\")) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_custom_dataset = azure.datafactory.CustomDataset("exampleCustomDataset", + data_factory_id=example_factory.id, + type="Json", + linked_service=azure.datafactory.CustomDatasetLinkedServiceArgs( + name=example_linked_custom_service.name, + parameters={ + "key1": "value1", + }, + ), + type_properties_json=example_container.name.apply(lambda name: f\"\"\"{{ + "location": {{ + "container":"{name}", + "fileName":"foo.txt", + "folderPath": "foo/bar/", + "type":"AzureBlobStorageLocation" + }}, + "encodingName":"UTF-8" + }} + \"\"\"), + description="test description", + annotations=[ + "test1", + "test2", + "test3", + ], + folder="testFolder", + parameters={ + "foo": "test1", + "Bar": "Test2", + }, + additional_properties={ + "foo": "test1", + "bar": "test2", + }, + schema_json=\"\"\"{ + "type": "object", + "properties": { + "name": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + }, + "age": { + "type": "integer" + } + } + } + \"\"\") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. @@ -518,6 +603,91 @@ def __init__(__self__, """ Manages a Dataset inside an Azure Data Factory. This is a generic resource that supports all different Dataset Types. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString":"{primary_connection_string}" + }} + \"\"\")) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_custom_dataset = azure.datafactory.CustomDataset("exampleCustomDataset", + data_factory_id=example_factory.id, + type="Json", + linked_service=azure.datafactory.CustomDatasetLinkedServiceArgs( + name=example_linked_custom_service.name, + parameters={ + "key1": "value1", + }, + ), + type_properties_json=example_container.name.apply(lambda name: f\"\"\"{{ + "location": {{ + "container":"{name}", + "fileName":"foo.txt", + "folderPath": "foo/bar/", + "type":"AzureBlobStorageLocation" + }}, + "encodingName":"UTF-8" + }} + \"\"\"), + description="test description", + annotations=[ + "test1", + "test2", + "test3", + ], + folder="testFolder", + parameters={ + "foo": "test1", + "Bar": "Test2", + }, + additional_properties={ + "foo": "test1", + "bar": "test2", + }, + schema_json=\"\"\"{ + "type": "object", + "properties": { + "name": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + } + } + }, + "age": { + "type": "integer" + } + } + } + \"\"\") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/data_flow.py b/sdk/python/pulumi_azure/datafactory/data_flow.py index a36dad091a..f7a864f5da 100644 --- a/sdk/python/pulumi_azure/datafactory/data_flow.py +++ b/sdk/python/pulumi_azure/datafactory/data_flow.py @@ -437,6 +437,138 @@ def __init__(__self__, """ Manages a Data Flow inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString": "{primary_connection_string}" + }} + \"\"\")) + example1_dataset_json = azure.datafactory.DatasetJson("example1DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="foo.txt", + ), + encoding="UTF-8") + example2_dataset_json = azure.datafactory.DatasetJson("example2DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="bar.txt", + ), + encoding="UTF-8") + example1_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example1FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example2_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example2FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example_data_flow = azure.datafactory.DataFlow("exampleDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.DataFlowSourceArgs( + name="source1", + flowlet=azure.datafactory.DataFlowSourceFlowletArgs( + name=example1_flowlet_data_flow.name, + parameters={ + "Key1": "value1", + }, + ), + dataset=azure.datafactory.DataFlowSourceDatasetArgs( + name=example1_dataset_json.name, + ), + )], + sinks=[azure.datafactory.DataFlowSinkArgs( + name="sink1", + flowlet=azure.datafactory.DataFlowSinkFlowletArgs( + name=example2_flowlet_data_flow.name, + parameters={ + "Key1": "value1", + }, + ), + dataset=azure.datafactory.DataFlowSinkDatasetArgs( + name=example2_dataset_json.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + ``` + ## Import Data Factory Data Flow can be imported using the `resource id`, e.g. @@ -467,6 +599,138 @@ def __init__(__self__, """ Manages a Data Flow inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString": "{primary_connection_string}" + }} + \"\"\")) + example1_dataset_json = azure.datafactory.DatasetJson("example1DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="foo.txt", + ), + encoding="UTF-8") + example2_dataset_json = azure.datafactory.DatasetJson("example2DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="bar.txt", + ), + encoding="UTF-8") + example1_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example1FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example2_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example2FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example_data_flow = azure.datafactory.DataFlow("exampleDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.DataFlowSourceArgs( + name="source1", + flowlet=azure.datafactory.DataFlowSourceFlowletArgs( + name=example1_flowlet_data_flow.name, + parameters={ + "Key1": "value1", + }, + ), + dataset=azure.datafactory.DataFlowSourceDatasetArgs( + name=example1_dataset_json.name, + ), + )], + sinks=[azure.datafactory.DataFlowSinkArgs( + name="sink1", + flowlet=azure.datafactory.DataFlowSinkFlowletArgs( + name=example2_flowlet_data_flow.name, + parameters={ + "Key1": "value1", + }, + ), + dataset=azure.datafactory.DataFlowSinkDatasetArgs( + name=example2_dataset_json.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + ``` + ## Import Data Factory Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_azure_blob.py b/sdk/python/pulumi_azure/datafactory/dataset_azure_blob.py index a283c7ccee..c52f8e3db0 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_azure_blob.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_azure_blob.py @@ -571,6 +571,28 @@ def __init__(__self__, """ Manages an Azure Blob Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + example_dataset_azure_blob = azure.datafactory.DatasetAzureBlob("exampleDatasetAzureBlob", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_azure_blob_storage.name, + path="foo", + filename="bar.png") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. @@ -606,6 +628,28 @@ def __init__(__self__, """ Manages an Azure Blob Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + example_dataset_azure_blob = azure.datafactory.DatasetAzureBlob("exampleDatasetAzureBlob", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_azure_blob_storage.name, + path="foo", + filename="bar.png") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_azure_sql_table.py b/sdk/python/pulumi_azure/datafactory/dataset_azure_sql_table.py index 43ab9f83c5..fc9f712b88 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_azure_sql_table.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_azure_sql_table.py @@ -481,6 +481,24 @@ def __init__(__self__, """ Manages an Azure SQL Table Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_sql_database = azure.datafactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;Initial Catalog=test;User ID=test;Password=test") + example_dataset_azure_sql_table = azure.datafactory.DatasetAzureSqlTable("exampleDatasetAzureSqlTable", + data_factory_id=example_factory.id, + linked_service_id=example_linked_service_azure_sql_database.id) + ``` + ## Import Data Factory Azure SQL Table Datasets can be imported using the `resource id`, e.g. @@ -512,6 +530,24 @@ def __init__(__self__, """ Manages an Azure SQL Table Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_sql_database = azure.datafactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;Initial Catalog=test;User ID=test;Password=test") + example_dataset_azure_sql_table = azure.datafactory.DatasetAzureSqlTable("exampleDatasetAzureSqlTable", + data_factory_id=example_factory.id, + linked_service_id=example_linked_service_azure_sql_database.id) + ``` + ## Import Data Factory Azure SQL Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_binary.py b/sdk/python/pulumi_azure/datafactory/dataset_binary.py index ba8206b0fd..fb86c2cfe5 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_binary.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_binary.py @@ -534,6 +534,32 @@ def __init__(__self__, """ Manages a Data Factory Binary Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sftp = azure.datafactory.LinkedServiceSftp("exampleLinkedServiceSftp", + data_factory_id=example_factory.id, + authentication_type="Basic", + host="http://www.bing.com", + port=22, + username="foo", + password="bar") + example_dataset_binary = azure.datafactory.DatasetBinary("exampleDatasetBinary", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_sftp.name, + sftp_server_location=azure.datafactory.DatasetBinarySftpServerLocationArgs( + path="/test/", + filename="**", + )) + ``` + ## Import Data Factory Binary Datasets can be imported using the `resource id`, e.g. @@ -568,6 +594,32 @@ def __init__(__self__, """ Manages a Data Factory Binary Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sftp = azure.datafactory.LinkedServiceSftp("exampleLinkedServiceSftp", + data_factory_id=example_factory.id, + authentication_type="Basic", + host="http://www.bing.com", + port=22, + username="foo", + password="bar") + example_dataset_binary = azure.datafactory.DatasetBinary("exampleDatasetBinary", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_sftp.name, + sftp_server_location=azure.datafactory.DatasetBinarySftpServerLocationArgs( + path="/test/", + filename="**", + )) + ``` + ## Import Data Factory Binary Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_cosmos_db_api.py b/sdk/python/pulumi_azure/datafactory/dataset_cosmos_db_api.py index 459fc03a29..8dd9066796 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_cosmos_db_api.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_cosmos_db_api.py @@ -456,6 +456,28 @@ def __init__(__self__, """ Manages an Azure Cosmos DB SQL API Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_cosmos_db = azure.datafactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", + data_factory_id=example_factory.id, + account_endpoint=example_account.endpoint, + database="foo") + example_dataset_cosmos_db_api = azure.datafactory.DatasetCosmosDBApi("exampleDatasetCosmosDBApi", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_cosmos_db.name, + collection_name="bar") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. @@ -488,6 +510,28 @@ def __init__(__self__, """ Manages an Azure Cosmos DB SQL API Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_cosmos_db = azure.datafactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", + data_factory_id=example_factory.id, + account_endpoint=example_account.endpoint, + database="foo") + example_dataset_cosmos_db_api = azure.datafactory.DatasetCosmosDBApi("exampleDatasetCosmosDBApi", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_cosmos_db.name, + collection_name="bar") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_delimited_text.py b/sdk/python/pulumi_azure/datafactory/dataset_delimited_text.py index dcd8cb97e9..77aacc5f06 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_delimited_text.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_delimited_text.py @@ -911,6 +911,37 @@ def __init__(__self__, """ Manages an Azure Delimited Text Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_delimited_text = azure.datafactory.DatasetDelimitedText("exampleDatasetDelimitedText", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + http_server_location=azure.datafactory.DatasetDelimitedTextHttpServerLocationArgs( + relative_url="http://www.bing.com", + path="foo/bar/", + filename="fizz.txt", + ), + column_delimiter=",", + row_delimiter="NEW", + encoding="UTF-8", + quote_character="x", + escape_character="f", + first_row_as_header=True, + null_value="NULL") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. @@ -956,6 +987,37 @@ def __init__(__self__, """ Manages an Azure Delimited Text Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_delimited_text = azure.datafactory.DatasetDelimitedText("exampleDatasetDelimitedText", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + http_server_location=azure.datafactory.DatasetDelimitedTextHttpServerLocationArgs( + relative_url="http://www.bing.com", + path="foo/bar/", + filename="fizz.txt", + ), + column_delimiter=",", + row_delimiter="NEW", + encoding="UTF-8", + quote_character="x", + escape_character="f", + first_row_as_header=True, + null_value="NULL") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_http.py b/sdk/python/pulumi_azure/datafactory/dataset_http.py index a385dfd4b9..30aa91b395 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_http.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_http.py @@ -538,6 +538,28 @@ def __init__(__self__, """ Manages an Azure HTTP Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_http = azure.datafactory.DatasetHttp("exampleDatasetHttp", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + relative_url="http://www.bing.com", + request_body="foo=bar", + request_method="POST") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. @@ -572,6 +594,28 @@ def __init__(__self__, """ Manages an Azure HTTP Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_http = azure.datafactory.DatasetHttp("exampleDatasetHttp", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + relative_url="http://www.bing.com", + request_body="foo=bar", + request_method="POST") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_json.py b/sdk/python/pulumi_azure/datafactory/dataset_json.py index 2a185453df..92da416110 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_json.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_json.py @@ -542,6 +542,31 @@ def __init__(__self__, """ Manages an Azure JSON Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_json = azure.datafactory.DatasetJson("exampleDatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + http_server_location=azure.datafactory.DatasetJsonHttpServerLocationArgs( + relative_url="/fizz/buzz/", + path="foo/bar/", + filename="foo.txt", + ), + encoding="UTF-8") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. @@ -578,6 +603,31 @@ def __init__(__self__, """ Manages an Azure JSON Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_json = azure.datafactory.DatasetJson("exampleDatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + http_server_location=azure.datafactory.DatasetJsonHttpServerLocationArgs( + relative_url="/fizz/buzz/", + path="foo/bar/", + filename="foo.txt", + ), + encoding="UTF-8") + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_mysql.py b/sdk/python/pulumi_azure/datafactory/dataset_mysql.py index 76e85bb1c4..bd52791d0e 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_mysql.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_mysql.py @@ -456,6 +456,24 @@ def __init__(__self__, """ Manages a MySQL Dataset inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_mysql = azure.datafactory.LinkedServiceMysql("exampleLinkedServiceMysql", + data_factory_id=example_factory.id, + connection_string="Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test") + example_dataset_mysql = azure.datafactory.DatasetMysql("exampleDatasetMysql", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_mysql.name) + ``` + ## Import Data Factory MySQL Datasets can be imported using the `resource id`, e.g. @@ -488,6 +506,24 @@ def __init__(__self__, """ Manages a MySQL Dataset inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_mysql = azure.datafactory.LinkedServiceMysql("exampleLinkedServiceMysql", + data_factory_id=example_factory.id, + connection_string="Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test") + example_dataset_mysql = azure.datafactory.DatasetMysql("exampleDatasetMysql", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_mysql.name) + ``` + ## Import Data Factory MySQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_parquet.py b/sdk/python/pulumi_azure/datafactory/dataset_parquet.py index c28cf90a63..c722140dbc 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_parquet.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_parquet.py @@ -628,6 +628,30 @@ def __init__(__self__, """ Manages an Azure Parquet Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_parquet = azure.datafactory.DatasetParquet("exampleDatasetParquet", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + http_server_location=azure.datafactory.DatasetParquetHttpServerLocationArgs( + relative_url="http://www.bing.com", + path="foo/bar/", + filename="fizz.txt", + )) + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. @@ -666,6 +690,30 @@ def __init__(__self__, """ Manages an Azure Parquet Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="https://www.bing.com") + example_dataset_parquet = azure.datafactory.DatasetParquet("exampleDatasetParquet", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_web.name, + http_server_location=azure.datafactory.DatasetParquetHttpServerLocationArgs( + relative_url="http://www.bing.com", + path="foo/bar/", + filename="fizz.txt", + )) + ``` + ## Import Data Factory Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_postgresql.py b/sdk/python/pulumi_azure/datafactory/dataset_postgresql.py index 41b926dc61..641bb568d1 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_postgresql.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_postgresql.py @@ -448,6 +448,24 @@ def __init__(__self__, """ Manages a PostgreSQL Dataset inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_postgresql = azure.datafactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", + data_factory_id=example_factory.id, + connection_string="Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example") + example_dataset_postgresql = azure.datafactory.DatasetPostgresql("exampleDatasetPostgresql", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_postgresql.name) + ``` + ## Import Data Factory PostgreSQL Datasets can be imported using the `resource id`, e.g. @@ -478,6 +496,24 @@ def __init__(__self__, """ Manages a PostgreSQL Dataset inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_postgresql = azure.datafactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", + data_factory_id=example_factory.id, + connection_string="Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example") + example_dataset_postgresql = azure.datafactory.DatasetPostgresql("exampleDatasetPostgresql", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_postgresql.name) + ``` + ## Import Data Factory PostgreSQL Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/dataset_snowflake.py b/sdk/python/pulumi_azure/datafactory/dataset_snowflake.py index 81c594778d..1544a68370 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_snowflake.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_snowflake.py @@ -489,6 +489,26 @@ def __init__(__self__, """ Manages a Snowflake Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_snowflake = azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", + data_factory_id=example_factory.id, + connection_string="jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh") + example_dataset_snowflake = azure.datafactory.DatasetSnowflake("exampleDatasetSnowflake", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_snowflake.name, + schema_name="foo_schema", + table_name="foo_table") + ``` + ## Import Data Factory Snowflake Datasets can be imported using the `resource id`, @@ -522,6 +542,26 @@ def __init__(__self__, """ Manages a Snowflake Dataset inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_snowflake = azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", + data_factory_id=example_factory.id, + connection_string="jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh") + example_dataset_snowflake = azure.datafactory.DatasetSnowflake("exampleDatasetSnowflake", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_snowflake.name, + schema_name="foo_schema", + table_name="foo_table") + ``` + ## Import Data Factory Snowflake Datasets can be imported using the `resource id`, diff --git a/sdk/python/pulumi_azure/datafactory/dataset_sql_server_table.py b/sdk/python/pulumi_azure/datafactory/dataset_sql_server_table.py index 3ef5ad9c1d..9df45423fc 100644 --- a/sdk/python/pulumi_azure/datafactory/dataset_sql_server_table.py +++ b/sdk/python/pulumi_azure/datafactory/dataset_sql_server_table.py @@ -448,6 +448,24 @@ def __init__(__self__, """ Manages a SQL Server Table Dataset inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sql_server = azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test") + example_dataset_sql_server_table = azure.datafactory.DatasetSqlServerTable("exampleDatasetSqlServerTable", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_sql_server.name) + ``` + ## Import Data Factory SQL Server Table Datasets can be imported using the `resource id`, e.g. @@ -478,6 +496,24 @@ def __init__(__self__, """ Manages a SQL Server Table Dataset inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sql_server = azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test") + example_dataset_sql_server_table = azure.datafactory.DatasetSqlServerTable("exampleDatasetSqlServerTable", + data_factory_id=example_factory.id, + linked_service_name=example_linked_service_sql_server.name) + ``` + ## Import Data Factory SQL Server Table Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/factory.py b/sdk/python/pulumi_azure/datafactory/factory.py index 9414e124f1..3d150a2b07 100644 --- a/sdk/python/pulumi_azure/datafactory/factory.py +++ b/sdk/python/pulumi_azure/datafactory/factory.py @@ -574,6 +574,18 @@ def __init__(__self__, """ Manages an Azure Data Factory (Version 2). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Data Factory can be imported using the `resource id`, e.g. @@ -607,6 +619,18 @@ def __init__(__self__, """ Manages an Azure Data Factory (Version 2). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Data Factory can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/flowlet_data_flow.py b/sdk/python/pulumi_azure/datafactory/flowlet_data_flow.py index 067009aa43..e9196f01f9 100644 --- a/sdk/python/pulumi_azure/datafactory/flowlet_data_flow.py +++ b/sdk/python/pulumi_azure/datafactory/flowlet_data_flow.py @@ -437,6 +437,132 @@ def __init__(__self__, """ Manages a Flowlet Data Flow inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString": "{primary_connection_string}" + }} + \"\"\")) + example1_dataset_json = azure.datafactory.DatasetJson("example1DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="foo.txt", + ), + encoding="UTF-8") + example2_dataset_json = azure.datafactory.DatasetJson("example2DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="bar.txt", + ), + encoding="UTF-8") + example1_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example1FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example2_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example2FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example_flowlet_data_flow = azure.datafactory.FlowletDataFlow("exampleFlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + flowlet=azure.datafactory.FlowletDataFlowSourceFlowletArgs( + name=example1_flowlet_data_flow.name, + ), + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + flowlet=azure.datafactory.FlowletDataFlowSinkFlowletArgs( + name=example2_flowlet_data_flow.name, + ), + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + ``` + ## Import Data Factory Flowlet Data Flow can be imported using the `resource id`, e.g. @@ -467,6 +593,132 @@ def __init__(__self__, """ Manages a Flowlet Data Flow inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString": "{primary_connection_string}" + }} + \"\"\")) + example1_dataset_json = azure.datafactory.DatasetJson("example1DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="foo.txt", + ), + encoding="UTF-8") + example2_dataset_json = azure.datafactory.DatasetJson("example2DatasetJson", + data_factory_id=example_factory.id, + linked_service_name=example_linked_custom_service.name, + azure_blob_storage_location=azure.datafactory.DatasetJsonAzureBlobStorageLocationArgs( + container="container", + path="foo/bar/", + filename="bar.txt", + ), + encoding="UTF-8") + example1_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example1FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example2_flowlet_data_flow = azure.datafactory.FlowletDataFlow("example2FlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + example_flowlet_data_flow = azure.datafactory.FlowletDataFlow("exampleFlowletDataFlow", + data_factory_id=example_factory.id, + sources=[azure.datafactory.FlowletDataFlowSourceArgs( + name="source1", + flowlet=azure.datafactory.FlowletDataFlowSourceFlowletArgs( + name=example1_flowlet_data_flow.name, + ), + linked_service=azure.datafactory.FlowletDataFlowSourceLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + sinks=[azure.datafactory.FlowletDataFlowSinkArgs( + name="sink1", + flowlet=azure.datafactory.FlowletDataFlowSinkFlowletArgs( + name=example2_flowlet_data_flow.name, + ), + linked_service=azure.datafactory.FlowletDataFlowSinkLinkedServiceArgs( + name=example_linked_custom_service.name, + ), + )], + script=\"\"\"source( + allowSchemaDrift: true, + validateSchema: false, + limit: 100, + ignoreNoFilesFound: false, + documentForm: 'documentPerLine') ~> source1 + source1 sink( + allowSchemaDrift: true, + validateSchema: false, + skipDuplicateMapInputs: true, + skipDuplicateMapOutputs: true) ~> sink1 + \"\"\") + ``` + ## Import Data Factory Flowlet Data Flow can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/get_factory.py b/sdk/python/pulumi_azure/datafactory/get_factory.py index 8d8771ecb3..55076ebcd7 100644 --- a/sdk/python/pulumi_azure/datafactory/get_factory.py +++ b/sdk/python/pulumi_azure/datafactory/get_factory.py @@ -129,6 +129,17 @@ def get_factory(name: Optional[str] = None, """ Use this data source to access information about an existing Azure Data Factory (Version 2). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datafactory.get_factory(name="existing-adf", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Azure Data Factory. :param str resource_group_name: The name of the Resource Group where the Azure Data Factory exists. @@ -157,6 +168,17 @@ def get_factory_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Azure Data Factory (Version 2). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datafactory.get_factory(name="existing-adf", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Azure Data Factory. :param str resource_group_name: The name of the Resource Group where the Azure Data Factory exists. diff --git a/sdk/python/pulumi_azure/datafactory/integration_runtime_managed.py b/sdk/python/pulumi_azure/datafactory/integration_runtime_managed.py index 379caeb4c6..ee593c7f3b 100644 --- a/sdk/python/pulumi_azure/datafactory/integration_runtime_managed.py +++ b/sdk/python/pulumi_azure/datafactory/integration_runtime_managed.py @@ -536,6 +536,22 @@ def __init__(__self__, > **NOTE:** The `datafactory.IntegrationRuntimeManaged` resource has been superseded by the `datafactory.IntegrationRuntimeSsis` resource. We recommend using the `datafactory.IntegrationRuntimeSsis` resource for new deployments. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_managed = azure.datafactory.IntegrationRuntimeManaged("exampleIntegrationRuntimeManaged", + data_factory_id=example_factory.id, + location=example_resource_group.location, + node_size="Standard_D8_v3") + ``` + ## Import Data Factory Integration Managed Runtimes can be imported using the `resource id`, e.g. @@ -570,6 +586,22 @@ def __init__(__self__, > **NOTE:** The `datafactory.IntegrationRuntimeManaged` resource has been superseded by the `datafactory.IntegrationRuntimeSsis` resource. We recommend using the `datafactory.IntegrationRuntimeSsis` resource for new deployments. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_managed = azure.datafactory.IntegrationRuntimeManaged("exampleIntegrationRuntimeManaged", + data_factory_id=example_factory.id, + location=example_resource_group.location, + node_size="Standard_D8_v3") + ``` + ## Import Data Factory Integration Managed Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/integration_runtime_rule.py b/sdk/python/pulumi_azure/datafactory/integration_runtime_rule.py index 5509a420c0..0010778c51 100644 --- a/sdk/python/pulumi_azure/datafactory/integration_runtime_rule.py +++ b/sdk/python/pulumi_azure/datafactory/integration_runtime_rule.py @@ -412,6 +412,21 @@ def __init__(__self__, """ Manages a Data Factory Azure Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_rule = azure.datafactory.IntegrationRuntimeRule("exampleIntegrationRuntimeRule", + data_factory_id=example_factory.id, + location=example_resource_group.location) + ``` + ## Import Data Factory Azure Integration Runtimes can be imported using the `resource id`, e.g. @@ -441,6 +456,21 @@ def __init__(__self__, """ Manages a Data Factory Azure Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_rule = azure.datafactory.IntegrationRuntimeRule("exampleIntegrationRuntimeRule", + data_factory_id=example_factory.id, + location=example_resource_group.location) + ``` + ## Import Data Factory Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/integration_runtime_self_hosted.py b/sdk/python/pulumi_azure/datafactory/integration_runtime_self_hosted.py index 18a2b7a1fc..1beee371e9 100644 --- a/sdk/python/pulumi_azure/datafactory/integration_runtime_self_hosted.py +++ b/sdk/python/pulumi_azure/datafactory/integration_runtime_self_hosted.py @@ -253,6 +253,19 @@ def __init__(__self__, """ Manages a Data Factory Self-hosted Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_self_hosted = azure.datafactory.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", data_factory_id=example_factory.id) + ``` + ## Import Data Factories can be imported using the `resource id`, e.g. @@ -277,6 +290,19 @@ def __init__(__self__, """ Manages a Data Factory Self-hosted Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_self_hosted = azure.datafactory.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", data_factory_id=example_factory.id) + ``` + ## Import Data Factories can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/integration_runtime_ssis.py b/sdk/python/pulumi_azure/datafactory/integration_runtime_ssis.py index 7b86ac5947..7d40cb14bc 100644 --- a/sdk/python/pulumi_azure/datafactory/integration_runtime_ssis.py +++ b/sdk/python/pulumi_azure/datafactory/integration_runtime_ssis.py @@ -694,6 +694,22 @@ def __init__(__self__, """ Manages a Data Factory Azure-SSIS Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_ssis = azure.datafactory.IntegrationRuntimeSsis("exampleIntegrationRuntimeSsis", + data_factory_id=example_factory.id, + location=example_resource_group.location, + node_size="Standard_D8_v3") + ``` + ## Import Data Factory Azure-SSIS Integration Runtimes can be imported using the `resource id`, e.g. @@ -730,6 +746,22 @@ def __init__(__self__, """ Manages a Data Factory Azure-SSIS Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_integration_runtime_ssis = azure.datafactory.IntegrationRuntimeSsis("exampleIntegrationRuntimeSsis", + data_factory_id=example_factory.id, + location=example_resource_group.location, + node_size="Standard_D8_v3") + ``` + ## Import Data Factory Azure-SSIS Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_custom_service.py b/sdk/python/pulumi_azure/datafactory/linked_custom_service.py index e6953a775e..b4fa1f206d 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_custom_service.py +++ b/sdk/python/pulumi_azure/datafactory/linked_custom_service.py @@ -408,6 +408,44 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a resource and Azure Data Factory. This is a generic resource that supports all different Linked Service Types. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + description="test description", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString":"{primary_connection_string}" + }} + \"\"\"), + parameters={ + "foo": "bar", + "Env": "Test", + }, + annotations=[ + "test1", + "test2", + "test3", + ]) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -437,6 +475,44 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a resource and Azure Data Factory. This is a generic resource that supports all different Linked Service Types. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_linked_custom_service = azure.datafactory.LinkedCustomService("exampleLinkedCustomService", + data_factory_id=example_factory.id, + type="AzureBlobStorage", + description="test description", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString":"{primary_connection_string}" + }} + \"\"\"), + parameters={ + "foo": "bar", + "Env": "Test", + }, + annotations=[ + "test1", + "test2", + "test3", + ]) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_azure_blob_storage.py b/sdk/python/pulumi_azure/datafactory/linked_service_azure_blob_storage.py index 1c57fa4303..8e3b739a23 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_azure_blob_storage.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_azure_blob_storage.py @@ -795,6 +795,59 @@ def __init__(__self__, """ Manages a Linked Service (connection) between an Azure Blob Storage Account and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + ``` + ### With SAS URI And SAS Token + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + current = azure.core.get_client_config() + test_factory = azure.datafactory.Factory("testFactory", + location=example.location, + resource_group_name=example.name) + test_key_vault = azure.keyvault.KeyVault("testKeyVault", + location=example.location, + resource_group_name=example.name, + tenant_id=current.tenant_id, + sku_name="standard") + test_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("testLinkedServiceKeyVault", + data_factory_id=test_factory.id, + key_vault_id=test_key_vault.id) + test_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("testLinkedServiceAzureBlobStorage", + data_factory_id=test_factory.id, + sas_uri="https://example.blob.core.windows.net", + key_vault_sas_token=azure.datafactory.LinkedServiceAzureBlobStorageKeyVaultSasTokenArgs( + linked_service_name=test_linked_service_key_vault.name, + secret_name="secret", + )) + test_datafactory_linked_service_azure_blob_storage_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("testDatafactory/linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage", + data_factory_id=test_factory.id, + service_endpoint="https://example.blob.core.windows.net", + service_principal_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + service_principal_linked_key_vault_key=azure.datafactory.LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKeyArgs( + linked_service_name=test_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -837,6 +890,59 @@ def __init__(__self__, """ Manages a Linked Service (connection) between an Azure Blob Storage Account and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("exampleLinkedServiceAzureBlobStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + ``` + ### With SAS URI And SAS Token + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + current = azure.core.get_client_config() + test_factory = azure.datafactory.Factory("testFactory", + location=example.location, + resource_group_name=example.name) + test_key_vault = azure.keyvault.KeyVault("testKeyVault", + location=example.location, + resource_group_name=example.name, + tenant_id=current.tenant_id, + sku_name="standard") + test_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("testLinkedServiceKeyVault", + data_factory_id=test_factory.id, + key_vault_id=test_key_vault.id) + test_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("testLinkedServiceAzureBlobStorage", + data_factory_id=test_factory.id, + sas_uri="https://example.blob.core.windows.net", + key_vault_sas_token=azure.datafactory.LinkedServiceAzureBlobStorageKeyVaultSasTokenArgs( + linked_service_name=test_linked_service_key_vault.name, + secret_name="secret", + )) + test_datafactory_linked_service_azure_blob_storage_linked_service_azure_blob_storage = azure.datafactory.LinkedServiceAzureBlobStorage("testDatafactory/linkedServiceAzureBlobStorageLinkedServiceAzureBlobStorage", + data_factory_id=test_factory.id, + service_endpoint="https://example.blob.core.windows.net", + service_principal_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + service_principal_linked_key_vault_key=azure.datafactory.LinkedServiceAzureBlobStorageServicePrincipalLinkedKeyVaultKeyArgs( + linked_service_name=test_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_azure_databricks.py b/sdk/python/pulumi_azure/datafactory/linked_service_azure_databricks.py index 52c521c8b8..e6308e441d 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_azure_databricks.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_azure_databricks.py @@ -617,6 +617,78 @@ def __init__(__self__, Manages a Linked Service (connection) between Azure Databricks and Azure Data Factory. ## Example Usage + ### With Managed Identity & New Cluster + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + #Create a Linked Service using managed identity and new cluster config + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + #Create a databricks instance + example_workspace = azure.databricks.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + msi_linked = azure.datafactory.LinkedServiceAzureDatabricks("msiLinked", + data_factory_id=example_factory.id, + description="ADB Linked Service via MSI", + adb_domain=example_workspace.workspace_url.apply(lambda workspace_url: f"https://{workspace_url}"), + msi_work_space_resource_id=example_workspace.id, + new_cluster_config=azure.datafactory.LinkedServiceAzureDatabricksNewClusterConfigArgs( + node_type="Standard_NC12", + cluster_version="5.5.x-gpu-scala2.11", + min_number_of_workers=1, + max_number_of_workers=5, + driver_node_type="Standard_NC12", + log_destination="dbfs:/logs", + custom_tags={ + "custom_tag1": "sct_value_1", + "custom_tag2": "sct_value_2", + }, + spark_config={ + "config1": "value1", + "config2": "value2", + }, + spark_environment_variables={ + "envVar1": "value1", + "envVar2": "value2", + }, + init_scripts=[ + "init.sh", + "init2.sh", + ], + )) + ``` + ### With Access Token & Existing Cluster + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + #Link to an existing cluster via access token + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + #Create a databricks instance + example_workspace = azure.databricks.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + at_linked = azure.datafactory.LinkedServiceAzureDatabricks("atLinked", + data_factory_id=example_factory.id, + description="ADB Linked Service via Access Token", + existing_cluster_id="0308-201146-sly615", + access_token="SomeDatabricksAccessToken", + adb_domain=example_workspace.workspace_url.apply(lambda workspace_url: f"https://{workspace_url}")) + ``` ## Import @@ -653,6 +725,78 @@ def __init__(__self__, Manages a Linked Service (connection) between Azure Databricks and Azure Data Factory. ## Example Usage + ### With Managed Identity & New Cluster + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + #Create a Linked Service using managed identity and new cluster config + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + #Create a databricks instance + example_workspace = azure.databricks.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + msi_linked = azure.datafactory.LinkedServiceAzureDatabricks("msiLinked", + data_factory_id=example_factory.id, + description="ADB Linked Service via MSI", + adb_domain=example_workspace.workspace_url.apply(lambda workspace_url: f"https://{workspace_url}"), + msi_work_space_resource_id=example_workspace.id, + new_cluster_config=azure.datafactory.LinkedServiceAzureDatabricksNewClusterConfigArgs( + node_type="Standard_NC12", + cluster_version="5.5.x-gpu-scala2.11", + min_number_of_workers=1, + max_number_of_workers=5, + driver_node_type="Standard_NC12", + log_destination="dbfs:/logs", + custom_tags={ + "custom_tag1": "sct_value_1", + "custom_tag2": "sct_value_2", + }, + spark_config={ + "config1": "value1", + "config2": "value2", + }, + spark_environment_variables={ + "envVar1": "value1", + "envVar2": "value2", + }, + init_scripts=[ + "init.sh", + "init2.sh", + ], + )) + ``` + ### With Access Token & Existing Cluster + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + #Link to an existing cluster via access token + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + #Create a databricks instance + example_workspace = azure.databricks.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + at_linked = azure.datafactory.LinkedServiceAzureDatabricks("atLinked", + data_factory_id=example_factory.id, + description="ADB Linked Service via Access Token", + existing_cluster_id="0308-201146-sly615", + access_token="SomeDatabricksAccessToken", + adb_domain=example_workspace.workspace_url.apply(lambda workspace_url: f"https://{workspace_url}")) + ``` ## Import diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_azure_file_storage.py b/sdk/python/pulumi_azure/datafactory/linked_service_azure_file_storage.py index 32fa899215..68d9c60f84 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_azure_file_storage.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_azure_file_storage.py @@ -575,6 +575,23 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_file_storage = azure.datafactory.LinkedServiceAzureFileStorage("exampleLinkedServiceAzureFileStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -610,6 +627,23 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_file_storage = azure.datafactory.LinkedServiceAzureFileStorage("exampleLinkedServiceAzureFileStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_azure_function.py b/sdk/python/pulumi_azure/datafactory/linked_service_azure_function.py index ed73ff7c8f..34e4169bef 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_azure_function.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_azure_function.py @@ -452,6 +452,24 @@ def __init__(__self__, """ Manages a Linked Service (connection) between an Azure Function and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_function_app = azure.appservice.get_function_app_output(name="test-azure-functions", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_function = azure.datafactory.LinkedServiceAzureFunction("exampleLinkedServiceAzureFunction", + data_factory_id=example_factory.id, + url=example_function_app.apply(lambda example_function_app: f"https://{example_function_app.default_hostname}"), + key="foo") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -484,6 +502,24 @@ def __init__(__self__, """ Manages a Linked Service (connection) between an Azure Function and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_function_app = azure.appservice.get_function_app_output(name="test-azure-functions", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_function = azure.datafactory.LinkedServiceAzureFunction("exampleLinkedServiceAzureFunction", + data_factory_id=example_factory.id, + url=example_function_app.apply(lambda example_function_app: f"https://{example_function_app.default_hostname}"), + key="foo") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_azure_sql_database.py b/sdk/python/pulumi_azure/datafactory/linked_service_azure_sql_database.py index c396208861..583095c90d 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_azure_sql_database.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_azure_sql_database.py @@ -615,6 +615,21 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Azure SQL Database and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_sql_database = azure.datafactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", + data_factory_id=example_factory.id, + connection_string="data source=serverhostname;initial catalog=master;user id=testUser;Password=test;integrated security=False;encrypt=True;connection timeout=30") + ``` + ## Import Data Factory Azure SQL Database Linked Service's can be imported using the `resource id`, e.g. @@ -649,6 +664,21 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Azure SQL Database and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_sql_database = azure.datafactory.LinkedServiceAzureSqlDatabase("exampleLinkedServiceAzureSqlDatabase", + data_factory_id=example_factory.id, + connection_string="data source=serverhostname;initial catalog=master;user id=testUser;Password=test;integrated security=False;encrypt=True;connection timeout=30") + ``` + ## Import Data Factory Azure SQL Database Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_azure_table_storage.py b/sdk/python/pulumi_azure/datafactory/linked_service_azure_table_storage.py index ad11547d87..d38e2ab2ac 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_azure_table_storage.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_azure_table_storage.py @@ -376,6 +376,23 @@ def __init__(__self__, """ Manages a Linked Service (connection) between an Azure Table Storage and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_table_storage = azure.datafactory.LinkedServiceAzureTableStorage("exampleLinkedServiceAzureTableStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -406,6 +423,23 @@ def __init__(__self__, """ Manages a Linked Service (connection) between an Azure Table Storage and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.get_account_output(name="storageaccountname", + resource_group_name=example_resource_group.name) + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_azure_table_storage = azure.datafactory.LinkedServiceAzureTableStorage("exampleLinkedServiceAzureTableStorage", + data_factory_id=example_factory.id, + connection_string=example_account.primary_connection_string) + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db.py b/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db.py index 6c4d8bc303..2a1377f810 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db.py @@ -494,6 +494,25 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a CosmosDB and Azure Data Factory using SQL API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_cosmos_db = azure.datafactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", + data_factory_id=example_factory.id, + account_endpoint=example_account.endpoint, + account_key=example_account.primary_key, + database="foo") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -527,6 +546,25 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a CosmosDB and Azure Data Factory using SQL API. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.cosmosdb.get_account(name="tfex-cosmosdb-account", + resource_group_name="tfex-cosmosdb-account-rg") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_cosmos_db = azure.datafactory.LinkedServiceCosmosDb("exampleLinkedServiceCosmosDb", + data_factory_id=example_factory.id, + account_endpoint=example_account.endpoint, + account_key=example_account.primary_key, + database="foo") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db_mongo_api.py b/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db_mongo_api.py index caf25a020b..63e7a935c5 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db_mongo_api.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_cosmos_db_mongo_api.py @@ -455,6 +455,22 @@ def __init__(__self__, > **Note:** All arguments including the client secret will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_cosmos_db_mongo_api = azure.datafactory.LinkedServiceCosmosDbMongoApi("exampleLinkedServiceCosmosDbMongoApi", + data_factory_id=example_factory.id, + connection_string="mongodb://testinstance:testkey@testinstance.documents.azure.com:10255/?ssl=true", + database="foo") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -489,6 +505,22 @@ def __init__(__self__, > **Note:** All arguments including the client secret will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_cosmos_db_mongo_api = azure.datafactory.LinkedServiceCosmosDbMongoApi("exampleLinkedServiceCosmosDbMongoApi", + data_factory_id=example_factory.id, + connection_string="mongodb://testinstance:testkey@testinstance.documents.azure.com:10255/?ssl=true", + database="foo") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_data_lake_storage_gen2.py b/sdk/python/pulumi_azure/datafactory/linked_service_data_lake_storage_gen2.py index b969d7426b..557e5da0b5 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_data_lake_storage_gen2.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_data_lake_storage_gen2.py @@ -589,6 +589,25 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Data Lake Storage Gen2 and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + current = azure.core.get_client_config() + example_linked_service_data_lake_storage_gen2 = azure.datafactory.LinkedServiceDataLakeStorageGen2("exampleLinkedServiceDataLakeStorageGen2", + data_factory_id=example_factory.id, + service_principal_id=current.client_id, + service_principal_key="exampleKey", + tenant="11111111-1111-1111-1111-111111111111", + url="https://datalakestoragegen2") + ``` + ## Import Data Factory Data Lake Storage Gen2 Linked Services can be imported using the `resource id`, e.g. @@ -628,6 +647,25 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Data Lake Storage Gen2 and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + current = azure.core.get_client_config() + example_linked_service_data_lake_storage_gen2 = azure.datafactory.LinkedServiceDataLakeStorageGen2("exampleLinkedServiceDataLakeStorageGen2", + data_factory_id=example_factory.id, + service_principal_id=current.client_id, + service_principal_key="exampleKey", + tenant="11111111-1111-1111-1111-111111111111", + url="https://datalakestoragegen2") + ``` + ## Import Data Factory Data Lake Storage Gen2 Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_key_vault.py b/sdk/python/pulumi_azure/datafactory/linked_service_key_vault.py index b640126d07..6d7f1b02c0 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_key_vault.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_key_vault.py @@ -368,6 +368,27 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Key Vault and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + ``` + ## Import Data Factory Key Vault Linked Service's can be imported using the `resource id`, e.g. @@ -396,6 +417,27 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Key Vault and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + ``` + ## Import Data Factory Key Vault Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_kusto.py b/sdk/python/pulumi_azure/datafactory/linked_service_kusto.py index 88996b48e7..f9d55e7e65 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_kusto.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_kusto.py @@ -594,6 +594,45 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a Kusto Cluster and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_linked_service_kusto = azure.datafactory.LinkedServiceKusto("exampleLinkedServiceKusto", + data_factory_id=example_factory.id, + kusto_endpoint=example_cluster.uri, + kusto_database_name=example_database.name, + use_managed_identity=True) + example_database_principal_assignment = azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + database_name=example_database.name, + tenant_id=example_factory.identity.tenant_id, + principal_id=example_factory.identity.principal_id, + principal_type="App", + role="Viewer") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -633,6 +672,45 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a Kusto Cluster and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datafactory.FactoryIdentityArgs( + type="SystemAssigned", + )) + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_linked_service_kusto = azure.datafactory.LinkedServiceKusto("exampleLinkedServiceKusto", + data_factory_id=example_factory.id, + kusto_endpoint=example_cluster.uri, + kusto_database_name=example_database.name, + use_managed_identity=True) + example_database_principal_assignment = azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + database_name=example_database.name, + tenant_id=example_factory.identity.tenant_id, + principal_id=example_factory.identity.principal_id, + principal_type="App", + role="Viewer") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_mysql.py b/sdk/python/pulumi_azure/datafactory/linked_service_mysql.py index bd516cfb33..2e9cdd7c9a 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_mysql.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_mysql.py @@ -368,6 +368,21 @@ def __init__(__self__, """ Manages a Linked Service (connection) between MySQL and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_mysql = azure.datafactory.LinkedServiceMysql("exampleLinkedServiceMysql", + data_factory_id=example_factory.id, + connection_string="Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test") + ``` + ## Import Data Factory MySQL Linked Service's can be imported using the `resource id`, e.g. @@ -396,6 +411,21 @@ def __init__(__self__, """ Manages a Linked Service (connection) between MySQL and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_mysql = azure.datafactory.LinkedServiceMysql("exampleLinkedServiceMysql", + data_factory_id=example_factory.id, + connection_string="Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test") + ``` + ## Import Data Factory MySQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_odata.py b/sdk/python/pulumi_azure/datafactory/linked_service_odata.py index fa88daacbc..c59017fcc2 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_odata.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_odata.py @@ -409,6 +409,28 @@ def __init__(__self__, > **Note:** All arguments including the connection_string will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + anonymous = azure.datafactory.LinkedServiceOdata("anonymous", + data_factory_id=example_factory.id, + url="https://services.odata.org/v4/TripPinServiceRW/People") + basic_auth = azure.datafactory.LinkedServiceOdata("basicAuth", + data_factory_id=example_factory.id, + url="https://services.odata.org/v4/TripPinServiceRW/People", + basic_authentication=azure.datafactory.LinkedServiceOdataBasicAuthenticationArgs( + username="emma", + password="Ch4ngeM3!", + )) + ``` + ## Import Data Factory OData Linked Service's can be imported using the `resource id`, e.g. @@ -440,6 +462,28 @@ def __init__(__self__, > **Note:** All arguments including the connection_string will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + anonymous = azure.datafactory.LinkedServiceOdata("anonymous", + data_factory_id=example_factory.id, + url="https://services.odata.org/v4/TripPinServiceRW/People") + basic_auth = azure.datafactory.LinkedServiceOdata("basicAuth", + data_factory_id=example_factory.id, + url="https://services.odata.org/v4/TripPinServiceRW/People", + basic_authentication=azure.datafactory.LinkedServiceOdataBasicAuthenticationArgs( + username="emma", + password="Ch4ngeM3!", + )) + ``` + ## Import Data Factory OData Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_odbc.py b/sdk/python/pulumi_azure/datafactory/linked_service_odbc.py index a116157bcb..1000e48738 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_odbc.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_odbc.py @@ -413,6 +413,28 @@ def __init__(__self__, > **Note:** All arguments including the connection_string will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + anonymous = azure.datafactory.LinkedServiceOdbc("anonymous", + data_factory_id=example_factory.id, + connection_string="Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;") + basic_auth = azure.datafactory.LinkedServiceOdbc("basicAuth", + data_factory_id=example_factory.id, + connection_string="Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;", + basic_authentication=azure.datafactory.LinkedServiceOdbcBasicAuthenticationArgs( + username="onrylmz", + password="Ch4ngeM3!", + )) + ``` + ## Import Data Factory ODBC Linked Service's can be imported using the `resource id`, e.g. @@ -444,6 +466,28 @@ def __init__(__self__, > **Note:** All arguments including the connection_string will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + anonymous = azure.datafactory.LinkedServiceOdbc("anonymous", + data_factory_id=example_factory.id, + connection_string="Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;") + basic_auth = azure.datafactory.LinkedServiceOdbc("basicAuth", + data_factory_id=example_factory.id, + connection_string="Driver={SQL Server};Server=test;Database=test;Uid=test;Pwd=test;", + basic_authentication=azure.datafactory.LinkedServiceOdbcBasicAuthenticationArgs( + username="onrylmz", + password="Ch4ngeM3!", + )) + ``` + ## Import Data Factory ODBC Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_postgresql.py b/sdk/python/pulumi_azure/datafactory/linked_service_postgresql.py index ea712a89a5..bc3a7f2364 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_postgresql.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_postgresql.py @@ -368,6 +368,21 @@ def __init__(__self__, """ Manages a Linked Service (connection) between PostgreSQL and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_postgresql = azure.datafactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", + data_factory_id=example_factory.id, + connection_string="Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example") + ``` + ## Import Data Factory PostgreSQL Linked Service's can be imported using the `resource id`, e.g. @@ -396,6 +411,21 @@ def __init__(__self__, """ Manages a Linked Service (connection) between PostgreSQL and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_postgresql = azure.datafactory.LinkedServicePostgresql("exampleLinkedServicePostgresql", + data_factory_id=example_factory.id, + connection_string="Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example") + ``` + ## Import Data Factory PostgreSQL Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_sftp.py b/sdk/python/pulumi_azure/datafactory/linked_service_sftp.py index 785fe4aaf3..6260d192b7 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_sftp.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_sftp.py @@ -610,6 +610,25 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sftp = azure.datafactory.LinkedServiceSftp("exampleLinkedServiceSftp", + data_factory_id=example_factory.id, + authentication_type="Basic", + host="http://www.bing.com", + port=22, + username="foo", + password="bar") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -646,6 +665,25 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a SFTP Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sftp = azure.datafactory.LinkedServiceSftp("exampleLinkedServiceSftp", + data_factory_id=example_factory.id, + authentication_type="Basic", + host="http://www.bing.com", + port=22, + username="foo", + password="bar") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_snowflake.py b/sdk/python/pulumi_azure/datafactory/linked_service_snowflake.py index 2d5e775120..8ed828c2cb 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_snowflake.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_snowflake.py @@ -411,6 +411,48 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Snowflake and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_snowflake = azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", + data_factory_id=example_factory.id, + connection_string="jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh") + ``` + ### With Password In Key Vault + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + example_linked_service_snowflake = azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", + data_factory_id=example_factory.id, + connection_string="jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + key_vault_password=azure.datafactory.LinkedServiceSnowflakeKeyVaultPasswordArgs( + linked_service_name=example_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory Snowflake Linked Service's can be imported using the `resource id`, e.g. @@ -440,6 +482,48 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Snowflake and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_snowflake = azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", + data_factory_id=example_factory.id, + connection_string="jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh") + ``` + ### With Password In Key Vault + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + example_linked_service_snowflake = azure.datafactory.LinkedServiceSnowflake("exampleLinkedServiceSnowflake", + data_factory_id=example_factory.id, + connection_string="jdbc:snowflake://account.region.snowflakecomputing.com/?user=user&db=db&warehouse=wh", + key_vault_password=azure.datafactory.LinkedServiceSnowflakeKeyVaultPasswordArgs( + linked_service_name=example_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory Snowflake Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_sql_server.py b/sdk/python/pulumi_azure/datafactory/linked_service_sql_server.py index e79446a7cc..7af8d172d4 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_sql_server.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_sql_server.py @@ -492,6 +492,48 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a SQL Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sql_server = azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test") + ``` + ### With Password In Key Vault + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + example_linked_service_sql_server = azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + key_vault_password=azure.datafactory.LinkedServiceSqlServerKeyVaultPasswordArgs( + linked_service_name=example_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory SQL Server Linked Service's can be imported using the `resource id`, e.g. @@ -523,6 +565,48 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a SQL Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_sql_server = azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test") + ``` + ### With Password In Key Vault + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + example_linked_service_sql_server = azure.datafactory.LinkedServiceSqlServer("exampleLinkedServiceSqlServer", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + key_vault_password=azure.datafactory.LinkedServiceSqlServerKeyVaultPasswordArgs( + linked_service_name=example_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory SQL Server Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_synapse.py b/sdk/python/pulumi_azure/datafactory/linked_service_synapse.py index 58977a754f..c144c1a158 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_synapse.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_synapse.py @@ -419,6 +419,48 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Synapse and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_synapse = azure.datafactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test") + ``` + ### With Password In Key Vault + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + example_linked_service_synapse = azure.datafactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + key_vault_password=azure.datafactory.LinkedServiceSynapseKeyVaultPasswordArgs( + linked_service_name=example_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory Synapse Linked Service's can be imported using the `resource id`, e.g. @@ -450,6 +492,48 @@ def __init__(__self__, """ Manages a Linked Service (connection) between Synapse and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_synapse = azure.datafactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;Password=test") + ``` + ### With Password In Key Vault + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_key_vault = azure.datafactory.LinkedServiceKeyVault("exampleLinkedServiceKeyVault", + data_factory_id=example_factory.id, + key_vault_id=example_key_vault.id) + example_linked_service_synapse = azure.datafactory.LinkedServiceSynapse("exampleLinkedServiceSynapse", + data_factory_id=example_factory.id, + connection_string="Integrated Security=False;Data Source=test;Initial Catalog=test;User ID=test;", + key_vault_password=azure.datafactory.LinkedServiceSynapseKeyVaultPasswordArgs( + linked_service_name=example_linked_service_key_vault.name, + secret_name="secret", + )) + ``` + ## Import Data Factory Synapse Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/linked_service_web.py b/sdk/python/pulumi_azure/datafactory/linked_service_web.py index 56727b0055..b298b65cfc 100644 --- a/sdk/python/pulumi_azure/datafactory/linked_service_web.py +++ b/sdk/python/pulumi_azure/datafactory/linked_service_web.py @@ -488,6 +488,22 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a Web Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="http://www.bing.com") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. @@ -521,6 +537,22 @@ def __init__(__self__, """ Manages a Linked Service (connection) between a Web Server and Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_linked_service_web = azure.datafactory.LinkedServiceWeb("exampleLinkedServiceWeb", + data_factory_id=example_factory.id, + authentication_type="Anonymous", + url="http://www.bing.com") + ``` + ## Import Data Factory Linked Service's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/managed_private_endpoint.py b/sdk/python/pulumi_azure/datafactory/managed_private_endpoint.py index 76866baf41..5aaeb277ff 100644 --- a/sdk/python/pulumi_azure/datafactory/managed_private_endpoint.py +++ b/sdk/python/pulumi_azure/datafactory/managed_private_endpoint.py @@ -261,6 +261,29 @@ def __init__(__self__, """ Manages a Data Factory Managed Private Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + managed_virtual_network_enabled=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_managed_private_endpoint = azure.datafactory.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", + data_factory_id=example_factory.id, + target_resource_id=example_account.id, + subresource_name="blob") + ``` + ## Import Data Factory Managed Private Endpoint can be imported using the `resource id`, e.g. @@ -288,6 +311,29 @@ def __init__(__self__, """ Manages a Data Factory Managed Private Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + managed_virtual_network_enabled=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_managed_private_endpoint = azure.datafactory.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", + data_factory_id=example_factory.id, + target_resource_id=example_account.id, + subresource_name="blob") + ``` + ## Import Data Factory Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/pipeline.py b/sdk/python/pulumi_azure/datafactory/pipeline.py index 79ebc02bbe..2972daf59d 100644 --- a/sdk/python/pulumi_azure/datafactory/pipeline.py +++ b/sdk/python/pulumi_azure/datafactory/pipeline.py @@ -437,6 +437,44 @@ def __init__(__self__, """ Manages a Pipeline inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + ``` + ### With Activities + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.datafactory.Pipeline("test", + data_factory_id=azurerm_data_factory["test"]["id"], + variables={ + "bob": "item1", + }, + activities_json=\"\"\"[ + { + "name": "Append variable1", + "type": "AppendVariable", + "dependsOn": [], + "userProperties": [], + "typeProperties": { + "variableName": "bob", + "value": "something" + } + } + ] + \"\"\") + ``` + ## Import Data Factory Pipeline's can be imported using the `resource id`, e.g. @@ -467,6 +505,44 @@ def __init__(__self__, """ Manages a Pipeline inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + ``` + ### With Activities + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.datafactory.Pipeline("test", + data_factory_id=azurerm_data_factory["test"]["id"], + variables={ + "bob": "item1", + }, + activities_json=\"\"\"[ + { + "name": "Append variable1", + "type": "AppendVariable", + "dependsOn": [], + "userProperties": [], + "typeProperties": { + "variableName": "bob", + "value": "something" + } + } + ] + \"\"\") + ``` + ## Import Data Factory Pipeline's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/trigger_blob_event.py b/sdk/python/pulumi_azure/datafactory/trigger_blob_event.py index 6d207e30c8..0eabf13474 100644 --- a/sdk/python/pulumi_azure/datafactory/trigger_blob_event.py +++ b/sdk/python/pulumi_azure/datafactory/trigger_blob_event.py @@ -536,6 +536,50 @@ def __init__(__self__, """ Manages a Blob Event Trigger inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_trigger_blob_event = azure.datafactory.TriggerBlobEvent("exampleTriggerBlobEvent", + data_factory_id=example_factory.id, + storage_account_id=example_account.id, + events=[ + "Microsoft.Storage.BlobCreated", + "Microsoft.Storage.BlobDeleted", + ], + blob_path_ends_with=".txt", + ignore_empty_blobs=True, + activated=True, + annotations=[ + "test1", + "test2", + "test3", + ], + description="example description", + pipelines=[azure.datafactory.TriggerBlobEventPipelineArgs( + name=example_pipeline.name, + parameters={ + "Env": "Prod", + }, + )], + additional_properties={ + "foo": "foo1", + "bar": "bar2", + }) + ``` + ## Import Data Factory Blob Event Trigger can be imported using the `resource id`, e.g. @@ -570,6 +614,50 @@ def __init__(__self__, """ Manages a Blob Event Trigger inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_trigger_blob_event = azure.datafactory.TriggerBlobEvent("exampleTriggerBlobEvent", + data_factory_id=example_factory.id, + storage_account_id=example_account.id, + events=[ + "Microsoft.Storage.BlobCreated", + "Microsoft.Storage.BlobDeleted", + ], + blob_path_ends_with=".txt", + ignore_empty_blobs=True, + activated=True, + annotations=[ + "test1", + "test2", + "test3", + ], + description="example description", + pipelines=[azure.datafactory.TriggerBlobEventPipelineArgs( + name=example_pipeline.name, + parameters={ + "Env": "Prod", + }, + )], + additional_properties={ + "foo": "foo1", + "bar": "bar2", + }) + ``` + ## Import Data Factory Blob Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/trigger_custom_event.py b/sdk/python/pulumi_azure/datafactory/trigger_custom_event.py index ae32e4637b..ef5e588e7f 100644 --- a/sdk/python/pulumi_azure/datafactory/trigger_custom_event.py +++ b/sdk/python/pulumi_azure/datafactory/trigger_custom_event.py @@ -495,6 +495,47 @@ def __init__(__self__, """ Manages a Custom Event Trigger inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_custom_event = azure.datafactory.TriggerCustomEvent("exampleTriggerCustomEvent", + data_factory_id=example_factory.id, + eventgrid_topic_id=example_topic.id, + events=[ + "event1", + "event2", + ], + subject_begins_with="abc", + subject_ends_with="xyz", + annotations=[ + "example1", + "example2", + "example3", + ], + description="example description", + pipelines=[azure.datafactory.TriggerCustomEventPipelineArgs( + name=example_pipeline.name, + parameters={ + "Env": "Prod", + }, + )], + additional_properties={ + "foo": "foo1", + "bar": "bar2", + }) + ``` + ## Import Data Factory Custom Event Trigger can be imported using the `resource id`, e.g. @@ -528,6 +569,47 @@ def __init__(__self__, """ Manages a Custom Event Trigger inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_custom_event = azure.datafactory.TriggerCustomEvent("exampleTriggerCustomEvent", + data_factory_id=example_factory.id, + eventgrid_topic_id=example_topic.id, + events=[ + "event1", + "event2", + ], + subject_begins_with="abc", + subject_ends_with="xyz", + annotations=[ + "example1", + "example2", + "example3", + ], + description="example description", + pipelines=[azure.datafactory.TriggerCustomEventPipelineArgs( + name=example_pipeline.name, + parameters={ + "Env": "Prod", + }, + )], + additional_properties={ + "foo": "foo1", + "bar": "bar2", + }) + ``` + ## Import Data Factory Custom Event Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/trigger_schedule.py b/sdk/python/pulumi_azure/datafactory/trigger_schedule.py index 5fb5a2ba58..02e79fd811 100644 --- a/sdk/python/pulumi_azure/datafactory/trigger_schedule.py +++ b/sdk/python/pulumi_azure/datafactory/trigger_schedule.py @@ -599,6 +599,24 @@ def __init__(__self__, """ Manages a Trigger Schedule inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_trigger_schedule = azure.datafactory.TriggerSchedule("exampleTriggerSchedule", + data_factory_id=example_factory.id, + pipeline_name=example_pipeline.name, + interval=5, + frequency="Day") + ``` + ## Import Data Factory Schedule Trigger can be imported using the `resource id`, e.g. @@ -633,6 +651,24 @@ def __init__(__self__, """ Manages a Trigger Schedule inside a Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_trigger_schedule = azure.datafactory.TriggerSchedule("exampleTriggerSchedule", + data_factory_id=example_factory.id, + pipeline_name=example_pipeline.name, + interval=5, + frequency="Day") + ``` + ## Import Data Factory Schedule Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datafactory/trigger_tumbling_window.py b/sdk/python/pulumi_azure/datafactory/trigger_tumbling_window.py index 8eae0577a1..01551b072f 100644 --- a/sdk/python/pulumi_azure/datafactory/trigger_tumbling_window.py +++ b/sdk/python/pulumi_azure/datafactory/trigger_tumbling_window.py @@ -640,6 +640,50 @@ def __init__(__self__, """ Manages a Tumbling Window Trigger inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_trigger_tumbling_window = azure.datafactory.TriggerTumblingWindow("exampleTriggerTumblingWindow", + data_factory_id=example_factory.id, + start_time="2022-09-21T00:00:00Z", + end_time="2022-09-21T08:00:00Z", + frequency="Minute", + interval=15, + delay="16:00:00", + annotations=[ + "example1", + "example2", + "example3", + ], + description="example description", + retry=azure.datafactory.TriggerTumblingWindowRetryArgs( + count=1, + interval=30, + ), + pipeline=azure.datafactory.TriggerTumblingWindowPipelineArgs( + name=example_pipeline.name, + parameters={ + "Env": "Prod", + }, + ), + trigger_dependencies=[azure.datafactory.TriggerTumblingWindowTriggerDependencyArgs( + size="24:00:00", + offset="-24:00:00", + )], + additional_properties={ + "foo": "value1", + "bar": "value2", + }) + ``` + ## Import Data Factory Tumbling Window Trigger can be imported using the `resource id`, e.g. @@ -675,6 +719,50 @@ def __init__(__self__, """ Manages a Tumbling Window Trigger inside an Azure Data Factory. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_factory = azure.datafactory.Factory("exampleFactory", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pipeline = azure.datafactory.Pipeline("examplePipeline", data_factory_id=example_factory.id) + example_trigger_tumbling_window = azure.datafactory.TriggerTumblingWindow("exampleTriggerTumblingWindow", + data_factory_id=example_factory.id, + start_time="2022-09-21T00:00:00Z", + end_time="2022-09-21T08:00:00Z", + frequency="Minute", + interval=15, + delay="16:00:00", + annotations=[ + "example1", + "example2", + "example3", + ], + description="example description", + retry=azure.datafactory.TriggerTumblingWindowRetryArgs( + count=1, + interval=30, + ), + pipeline=azure.datafactory.TriggerTumblingWindowPipelineArgs( + name=example_pipeline.name, + parameters={ + "Env": "Prod", + }, + ), + trigger_dependencies=[azure.datafactory.TriggerTumblingWindowTriggerDependencyArgs( + size="24:00:00", + offset="-24:00:00", + )], + additional_properties={ + "foo": "value1", + "bar": "value2", + }) + ``` + ## Import Data Factory Tumbling Window Trigger can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/backup_instance_blog_storage.py b/sdk/python/pulumi_azure/dataprotection/backup_instance_blog_storage.py index 01125080fe..0a14751569 100644 --- a/sdk/python/pulumi_azure/dataprotection/backup_instance_blog_storage.py +++ b/sdk/python/pulumi_azure/dataprotection/backup_instance_blog_storage.py @@ -254,6 +254,41 @@ def __init__(__self__, """ Manages a Backup Instance Blob Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant", + identity=azure.dataprotection.BackupVaultIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_account.id, + role_definition_name="Storage Account Backup Contributor", + principal_id=example_backup_vault.identity.principal_id) + example_backup_policy_blob_storage = azure.dataprotection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", + vault_id=example_backup_vault.id, + retention_duration="P30D") + example_backup_instance_blog_storage = azure.dataprotection.BackupInstanceBlogStorage("exampleBackupInstanceBlogStorage", + vault_id=example_backup_vault.id, + location=example_resource_group.location, + storage_account_id=example_account.id, + backup_policy_id=example_backup_policy_blob_storage.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Backup Instance Blob Storages can be imported using the `resource id`, e.g. @@ -279,6 +314,41 @@ def __init__(__self__, """ Manages a Backup Instance Blob Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant", + identity=azure.dataprotection.BackupVaultIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_account.id, + role_definition_name="Storage Account Backup Contributor", + principal_id=example_backup_vault.identity.principal_id) + example_backup_policy_blob_storage = azure.dataprotection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", + vault_id=example_backup_vault.id, + retention_duration="P30D") + example_backup_instance_blog_storage = azure.dataprotection.BackupInstanceBlogStorage("exampleBackupInstanceBlogStorage", + vault_id=example_backup_vault.id, + location=example_resource_group.location, + storage_account_id=example_account.id, + backup_policy_id=example_backup_policy_blob_storage.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Backup Instance Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/backup_instance_disk.py b/sdk/python/pulumi_azure/dataprotection/backup_instance_disk.py index 79bcabbe6b..fceb987940 100644 --- a/sdk/python/pulumi_azure/dataprotection/backup_instance_disk.py +++ b/sdk/python/pulumi_azure/dataprotection/backup_instance_disk.py @@ -296,6 +296,47 @@ def __init__(__self__, """ Manages a Backup Instance to back up Disk. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1) + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant", + identity=azure.dataprotection.BackupVaultIdentityArgs( + type="SystemAssigned", + )) + example1 = azure.authorization.Assignment("example1", + scope=example_resource_group.id, + role_definition_name="Disk Snapshot Contributor", + principal_id=example_backup_vault.identity.principal_id) + example2 = azure.authorization.Assignment("example2", + scope=example_managed_disk.id, + role_definition_name="Disk Backup Reader", + principal_id=example_backup_vault.identity.principal_id) + example_backup_policy_disk = azure.dataprotection.BackupPolicyDisk("exampleBackupPolicyDisk", + vault_id=example_backup_vault.id, + backup_repeating_time_intervals=["R/2021-05-19T06:33:16+00:00/PT4H"], + default_retention_duration="P7D") + example_backup_instance_disk = azure.dataprotection.BackupInstanceDisk("exampleBackupInstanceDisk", + location=example_backup_vault.location, + vault_id=example_backup_vault.id, + disk_id=example_managed_disk.id, + snapshot_resource_group_name=example_resource_group.name, + backup_policy_id=example_backup_policy_disk.id) + ``` + ## Import Backup Instance Disks can be imported using the `resource id`, e.g. @@ -322,6 +363,47 @@ def __init__(__self__, """ Manages a Backup Instance to back up Disk. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_disk = azure.compute.ManagedDisk("exampleManagedDisk", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account_type="Standard_LRS", + create_option="Empty", + disk_size_gb=1) + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant", + identity=azure.dataprotection.BackupVaultIdentityArgs( + type="SystemAssigned", + )) + example1 = azure.authorization.Assignment("example1", + scope=example_resource_group.id, + role_definition_name="Disk Snapshot Contributor", + principal_id=example_backup_vault.identity.principal_id) + example2 = azure.authorization.Assignment("example2", + scope=example_managed_disk.id, + role_definition_name="Disk Backup Reader", + principal_id=example_backup_vault.identity.principal_id) + example_backup_policy_disk = azure.dataprotection.BackupPolicyDisk("exampleBackupPolicyDisk", + vault_id=example_backup_vault.id, + backup_repeating_time_intervals=["R/2021-05-19T06:33:16+00:00/PT4H"], + default_retention_duration="P7D") + example_backup_instance_disk = azure.dataprotection.BackupInstanceDisk("exampleBackupInstanceDisk", + location=example_backup_vault.location, + vault_id=example_backup_vault.id, + disk_id=example_managed_disk.id, + snapshot_resource_group_name=example_resource_group.name, + backup_policy_id=example_backup_policy_disk.id) + ``` + ## Import Backup Instance Disks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/backup_instance_postgresql.py b/sdk/python/pulumi_azure/dataprotection/backup_instance_postgresql.py index 80c61174d2..cf2b7e5df0 100644 --- a/sdk/python/pulumi_azure/dataprotection/backup_instance_postgresql.py +++ b/sdk/python/pulumi_azure/dataprotection/backup_instance_postgresql.py @@ -297,6 +297,102 @@ def __init__(__self__, > **Note:** Before using this resource, there are some prerequisite permissions for configure backup and restore. See more details from . + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + auto_grow_enabled=True, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + example_database = azure.postgresql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="UTF8", + collation="English_United States.1252") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant", + identity=azure.dataprotection.BackupVaultIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_backup_vault.identity.tenant_id, + object_id=example_backup_vault.identity.principal_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + ), + ]) + example_secret = azure.keyvault.Secret("exampleSecret", + value=pulumi.Output.all(example_server.name, example_database.name, example_server.name).apply(lambda exampleServerName, exampleDatabaseName, exampleServerName1: f"Server={example_server_name}.postgres.database.azure.com;Database={example_database_name};Port=5432;User Id=psqladmin@{example_server_name1};Password=H@Sh1CoR3!;Ssl Mode=Require;"), + key_vault_id=example_key_vault.id) + example_backup_policy_postgresql = azure.dataprotection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", + resource_group_name=example_resource_group.name, + vault_name=example_backup_vault.name, + backup_repeating_time_intervals=["R/2021-05-23T02:30:00+00:00/P1W"], + default_retention_duration="P4M") + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_server.id, + role_definition_name="Reader", + principal_id=example_backup_vault.identity.principal_id) + example_backup_instance_postgresql = azure.dataprotection.BackupInstancePostgresql("exampleBackupInstancePostgresql", + location=example_resource_group.location, + vault_id=example_backup_vault.id, + database_id=example_database.id, + backup_policy_id=example_backup_policy_postgresql.id, + database_credential_key_vault_secret_id=example_secret.versionless_id) + ``` + ## Import Backup Instance PostgreSQL can be imported using the `resource id`, e.g. @@ -325,6 +421,102 @@ def __init__(__self__, > **Note:** Before using this resource, there are some prerequisite permissions for configure backup and restore. See more details from . + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + auto_grow_enabled=True, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + example_database = azure.postgresql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="UTF8", + collation="English_United States.1252") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant", + identity=azure.dataprotection.BackupVaultIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_backup_vault.identity.tenant_id, + object_id=example_backup_vault.identity.principal_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + ), + ]) + example_secret = azure.keyvault.Secret("exampleSecret", + value=pulumi.Output.all(example_server.name, example_database.name, example_server.name).apply(lambda exampleServerName, exampleDatabaseName, exampleServerName1: f"Server={example_server_name}.postgres.database.azure.com;Database={example_database_name};Port=5432;User Id=psqladmin@{example_server_name1};Password=H@Sh1CoR3!;Ssl Mode=Require;"), + key_vault_id=example_key_vault.id) + example_backup_policy_postgresql = azure.dataprotection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", + resource_group_name=example_resource_group.name, + vault_name=example_backup_vault.name, + backup_repeating_time_intervals=["R/2021-05-23T02:30:00+00:00/P1W"], + default_retention_duration="P4M") + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_server.id, + role_definition_name="Reader", + principal_id=example_backup_vault.identity.principal_id) + example_backup_instance_postgresql = azure.dataprotection.BackupInstancePostgresql("exampleBackupInstancePostgresql", + location=example_resource_group.location, + vault_id=example_backup_vault.id, + database_id=example_database.id, + backup_policy_id=example_backup_policy_postgresql.id, + database_credential_key_vault_secret_id=example_secret.versionless_id) + ``` + ## Import Backup Instance PostgreSQL can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/backup_policy_blob_storage.py b/sdk/python/pulumi_azure/dataprotection/backup_policy_blob_storage.py index 5eacf41dac..67fcbe990e 100644 --- a/sdk/python/pulumi_azure/dataprotection/backup_policy_blob_storage.py +++ b/sdk/python/pulumi_azure/dataprotection/backup_policy_blob_storage.py @@ -175,6 +175,23 @@ def __init__(__self__, """ Manages a Backup Policy Blob Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + example_backup_policy_blob_storage = azure.dataprotection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", + vault_id=example_backup_vault.id, + retention_duration="P30D") + ``` + ## Import Backup Policy Blob Storages can be imported using the `resource id`, e.g. @@ -198,6 +215,23 @@ def __init__(__self__, """ Manages a Backup Policy Blob Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + example_backup_policy_blob_storage = azure.dataprotection.BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", + vault_id=example_backup_vault.id, + retention_duration="P30D") + ``` + ## Import Backup Policy Blob Storages can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/backup_policy_disk.py b/sdk/python/pulumi_azure/dataprotection/backup_policy_disk.py index 48ca0f7477..c42569e790 100644 --- a/sdk/python/pulumi_azure/dataprotection/backup_policy_disk.py +++ b/sdk/python/pulumi_azure/dataprotection/backup_policy_disk.py @@ -260,6 +260,42 @@ def __init__(__self__, """ Manages a Backup Policy Disk. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + example_backup_policy_disk = azure.dataprotection.BackupPolicyDisk("exampleBackupPolicyDisk", + vault_id=example_backup_vault.id, + backup_repeating_time_intervals=["R/2021-05-19T06:33:16+00:00/PT4H"], + default_retention_duration="P7D", + retention_rules=[ + azure.dataprotection.BackupPolicyDiskRetentionRuleArgs( + name="Daily", + duration="P7D", + priority=25, + criteria=azure.dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs( + absolute_criteria="FirstOfDay", + ), + ), + azure.dataprotection.BackupPolicyDiskRetentionRuleArgs( + name="Weekly", + duration="P7D", + priority=20, + criteria=azure.dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs( + absolute_criteria="FirstOfWeek", + ), + ), + ]) + ``` + ## Import Backup Policy Disks can be imported using the `resource id`, e.g. @@ -285,6 +321,42 @@ def __init__(__self__, """ Manages a Backup Policy Disk. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + example_backup_policy_disk = azure.dataprotection.BackupPolicyDisk("exampleBackupPolicyDisk", + vault_id=example_backup_vault.id, + backup_repeating_time_intervals=["R/2021-05-19T06:33:16+00:00/PT4H"], + default_retention_duration="P7D", + retention_rules=[ + azure.dataprotection.BackupPolicyDiskRetentionRuleArgs( + name="Daily", + duration="P7D", + priority=25, + criteria=azure.dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs( + absolute_criteria="FirstOfDay", + ), + ), + azure.dataprotection.BackupPolicyDiskRetentionRuleArgs( + name="Weekly", + duration="P7D", + priority=20, + criteria=azure.dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs( + absolute_criteria="FirstOfWeek", + ), + ), + ]) + ``` + ## Import Backup Policy Disks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/backup_policy_postgresql.py b/sdk/python/pulumi_azure/dataprotection/backup_policy_postgresql.py index dfc5a01fb4..2770815e24 100644 --- a/sdk/python/pulumi_azure/dataprotection/backup_policy_postgresql.py +++ b/sdk/python/pulumi_azure/dataprotection/backup_policy_postgresql.py @@ -302,6 +302,57 @@ def __init__(__self__, """ Manages a Backup Policy to back up PostgreSQL. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + example_backup_policy_postgresql = azure.dataprotection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", + resource_group_name=example_resource_group.name, + vault_name=example_backup_vault.name, + backup_repeating_time_intervals=["R/2021-05-23T02:30:00+00:00/P1W"], + default_retention_duration="P4M", + retention_rules=[ + azure.dataprotection.BackupPolicyPostgresqlRetentionRuleArgs( + name="weekly", + duration="P6M", + priority=20, + criteria=azure.dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs( + absolute_criteria="FirstOfWeek", + ), + ), + azure.dataprotection.BackupPolicyPostgresqlRetentionRuleArgs( + name="thursday", + duration="P1W", + priority=25, + criteria=azure.dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs( + days_of_weeks=["Thursday"], + scheduled_backup_times=["2021-05-23T02:30:00Z"], + ), + ), + azure.dataprotection.BackupPolicyPostgresqlRetentionRuleArgs( + name="monthly", + duration="P1D", + priority=15, + criteria=azure.dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs( + weeks_of_months=[ + "First", + "Last", + ], + days_of_weeks=["Tuesday"], + scheduled_backup_times=["2021-05-23T02:30:00Z"], + ), + ), + ]) + ``` + ## Import Backup Policy PostgreSQL's can be imported using the `resource id`, e.g. @@ -328,6 +379,57 @@ def __init__(__self__, """ Manages a Backup Policy to back up PostgreSQL. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + example_backup_policy_postgresql = azure.dataprotection.BackupPolicyPostgresql("exampleBackupPolicyPostgresql", + resource_group_name=example_resource_group.name, + vault_name=example_backup_vault.name, + backup_repeating_time_intervals=["R/2021-05-23T02:30:00+00:00/P1W"], + default_retention_duration="P4M", + retention_rules=[ + azure.dataprotection.BackupPolicyPostgresqlRetentionRuleArgs( + name="weekly", + duration="P6M", + priority=20, + criteria=azure.dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs( + absolute_criteria="FirstOfWeek", + ), + ), + azure.dataprotection.BackupPolicyPostgresqlRetentionRuleArgs( + name="thursday", + duration="P1W", + priority=25, + criteria=azure.dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs( + days_of_weeks=["Thursday"], + scheduled_backup_times=["2021-05-23T02:30:00Z"], + ), + ), + azure.dataprotection.BackupPolicyPostgresqlRetentionRuleArgs( + name="monthly", + duration="P1D", + priority=15, + criteria=azure.dataprotection.BackupPolicyPostgresqlRetentionRuleCriteriaArgs( + weeks_of_months=[ + "First", + "Last", + ], + days_of_weeks=["Tuesday"], + scheduled_backup_times=["2021-05-23T02:30:00Z"], + ), + ), + ]) + ``` + ## Import Backup Policy PostgreSQL's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/backup_vault.py b/sdk/python/pulumi_azure/dataprotection/backup_vault.py index 4e957d8ddb..ce4cfaf65e 100644 --- a/sdk/python/pulumi_azure/dataprotection/backup_vault.py +++ b/sdk/python/pulumi_azure/dataprotection/backup_vault.py @@ -326,6 +326,20 @@ def __init__(__self__, """ Manages a Backup Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + ``` + ## Import Backup Vaults can be imported using the `resource id`, e.g. @@ -353,6 +367,20 @@ def __init__(__self__, """ Manages a Backup Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_backup_vault = azure.dataprotection.BackupVault("exampleBackupVault", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + datastore_type="VaultStore", + redundancy="LocallyRedundant") + ``` + ## Import Backup Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dataprotection/get_backup_vault.py b/sdk/python/pulumi_azure/dataprotection/get_backup_vault.py index 6b6c9315aa..21f985211c 100644 --- a/sdk/python/pulumi_azure/dataprotection/get_backup_vault.py +++ b/sdk/python/pulumi_azure/dataprotection/get_backup_vault.py @@ -129,6 +129,18 @@ def get_backup_vault(name: Optional[str] = None, """ Use this data source to access information about an existing Backup Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dataprotection.get_backup_vault(name="existing-backup-vault", + resource_group_name="existing-resource-group") + pulumi.export("azurermDataProtectionBackupVaultId", data["azurerm_vpn_gateway"]["example"]["id"]) + pulumi.export("azurermDataProtectionBackupVaultPrincipalId", example.identities[0].principal_id) + ``` + :param str name: Specifies the name of the Backup Vault. :param str resource_group_name: The name of the Resource Group where the Backup Vault exists. @@ -157,6 +169,18 @@ def get_backup_vault_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Backup Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dataprotection.get_backup_vault(name="existing-backup-vault", + resource_group_name="existing-resource-group") + pulumi.export("azurermDataProtectionBackupVaultId", data["azurerm_vpn_gateway"]["example"]["id"]) + pulumi.export("azurermDataProtectionBackupVaultPrincipalId", example.identities[0].principal_id) + ``` + :param str name: Specifies the name of the Backup Vault. :param str resource_group_name: The name of the Resource Group where the Backup Vault exists. diff --git a/sdk/python/pulumi_azure/dataprotection/resource_guard.py b/sdk/python/pulumi_azure/dataprotection/resource_guard.py index a5ad920c3f..c5095ffdae 100644 --- a/sdk/python/pulumi_azure/dataprotection/resource_guard.py +++ b/sdk/python/pulumi_azure/dataprotection/resource_guard.py @@ -248,6 +248,18 @@ def __init__(__self__, """ Manages a Resource Guard. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_guard = azure.dataprotection.ResourceGuard("exampleResourceGuard", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Resource Guards can be imported using the `resource id`, e.g. @@ -273,6 +285,18 @@ def __init__(__self__, """ Manages a Resource Guard. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_guard = azure.dataprotection.ResourceGuard("exampleResourceGuard", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datashare/account.py b/sdk/python/pulumi_azure/datashare/account.py index ac9e1644dd..fd42339f9b 100644 --- a/sdk/python/pulumi_azure/datashare/account.py +++ b/sdk/python/pulumi_azure/datashare/account.py @@ -247,6 +247,24 @@ def __init__(__self__, """ Manages a Data Share Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Data Share Accounts can be imported using the `resource id`, e.g. @@ -272,6 +290,24 @@ def __init__(__self__, """ Manages a Data Share Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Data Share Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datashare/dataset_blob_storage.py b/sdk/python/pulumi_azure/datashare/dataset_blob_storage.py index 9c12d66965..0778cdd100 100644 --- a/sdk/python/pulumi_azure/datashare/dataset_blob_storage.py +++ b/sdk/python/pulumi_azure/datashare/dataset_blob_storage.py @@ -321,6 +321,48 @@ def __init__(__self__, """ Manages a Data Share Blob Storage Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="CopyBased") + example_storage_account_account = azure.storage.Account("exampleStorage/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="RAGRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_storage / account_account["name"], + container_access_type="container") + example_service_principal = azuread.get_service_principal_output(display_name=example_account.name) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_storage / account_account["id"], + role_definition_name="Storage Blob Data Reader", + principal_id=example_service_principal.object_id) + example_dataset_blob_storage = azure.datashare.DatasetBlobStorage("exampleDatasetBlobStorage", + data_share_id=example_share.id, + container_name=example_container.name, + storage_account=azure.datashare.DatasetBlobStorageStorageAccountArgs( + name=example_storage / account_account["name"], + resource_group_name=example_storage / account_account["resourceGroupName"], + subscription_id="00000000-0000-0000-0000-000000000000", + ), + file_path="myfile.txt", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Blob Storage Datasets can be imported using the `resource id`, e.g. @@ -347,6 +389,48 @@ def __init__(__self__, """ Manages a Data Share Blob Storage Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="CopyBased") + example_storage_account_account = azure.storage.Account("exampleStorage/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="RAGRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_storage / account_account["name"], + container_access_type="container") + example_service_principal = azuread.get_service_principal_output(display_name=example_account.name) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_storage / account_account["id"], + role_definition_name="Storage Blob Data Reader", + principal_id=example_service_principal.object_id) + example_dataset_blob_storage = azure.datashare.DatasetBlobStorage("exampleDatasetBlobStorage", + data_share_id=example_share.id, + container_name=example_container.name, + storage_account=azure.datashare.DatasetBlobStorageStorageAccountArgs( + name=example_storage / account_account["name"], + resource_group_name=example_storage / account_account["resourceGroupName"], + subscription_id="00000000-0000-0000-0000-000000000000", + ), + file_path="myfile.txt", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Blob Storage Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datashare/dataset_data_lake_gen2.py b/sdk/python/pulumi_azure/datashare/dataset_data_lake_gen2.py index 3fb9e860bf..c967024467 100644 --- a/sdk/python/pulumi_azure/datashare/dataset_data_lake_gen2.py +++ b/sdk/python/pulumi_azure/datashare/dataset_data_lake_gen2.py @@ -319,6 +319,43 @@ def __init__(__self__, """ Manages a Data Share Data Lake Gen2 Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="CopyBased") + example_storage_account_account = azure.storage.Account("exampleStorage/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_storage / account_account["id"]) + example_service_principal = azuread.get_service_principal_output(display_name=example_account.name) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_storage / account_account["id"], + role_definition_name="Storage Blob Data Reader", + principal_id=example_service_principal.object_id) + example_dataset_data_lake_gen2 = azure.datashare.DatasetDataLakeGen2("exampleDatasetDataLakeGen2", + share_id=example_share.id, + storage_account_id=example_storage / account_account["id"], + file_system_name=example_data_lake_gen2_filesystem.name, + file_path="myfile.txt", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Data Lake Gen2 Datasets can be imported using the `resource id`, e.g. @@ -345,6 +382,43 @@ def __init__(__self__, """ Manages a Data Share Data Lake Gen2 Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="CopyBased") + example_storage_account_account = azure.storage.Account("exampleStorage/accountAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_storage / account_account["id"]) + example_service_principal = azuread.get_service_principal_output(display_name=example_account.name) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_storage / account_account["id"], + role_definition_name="Storage Blob Data Reader", + principal_id=example_service_principal.object_id) + example_dataset_data_lake_gen2 = azure.datashare.DatasetDataLakeGen2("exampleDatasetDataLakeGen2", + share_id=example_share.id, + storage_account_id=example_storage / account_account["id"], + file_system_name=example_data_lake_gen2_filesystem.name, + file_path="myfile.txt", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Data Lake Gen2 Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datashare/dataset_kusto_cluster.py b/sdk/python/pulumi_azure/datashare/dataset_kusto_cluster.py index 01703f703d..6b528b5def 100644 --- a/sdk/python/pulumi_azure/datashare/dataset_kusto_cluster.py +++ b/sdk/python/pulumi_azure/datashare/dataset_kusto_cluster.py @@ -215,6 +215,39 @@ def __init__(__self__, """ Manages a Data Share Kusto Cluster Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="InPlace") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_cluster.id, + role_definition_name="Contributor", + principal_id=example_account.identity.principal_id) + example_dataset_kusto_cluster = azure.datashare.DatasetKustoCluster("exampleDatasetKustoCluster", + share_id=example_share.id, + kusto_cluster_id=example_cluster.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Kusto Cluster Datasets can be imported using the `resource id`, e.g. @@ -238,6 +271,39 @@ def __init__(__self__, """ Manages a Data Share Kusto Cluster Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="InPlace") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_cluster.id, + role_definition_name="Contributor", + principal_id=example_account.identity.principal_id) + example_dataset_kusto_cluster = azure.datashare.DatasetKustoCluster("exampleDatasetKustoCluster", + share_id=example_share.id, + kusto_cluster_id=example_cluster.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Kusto Cluster Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datashare/dataset_kusto_database.py b/sdk/python/pulumi_azure/datashare/dataset_kusto_database.py index 0aed49fdca..4fbcc84ac1 100644 --- a/sdk/python/pulumi_azure/datashare/dataset_kusto_database.py +++ b/sdk/python/pulumi_azure/datashare/dataset_kusto_database.py @@ -215,6 +215,43 @@ def __init__(__self__, """ Manages a Data Share Kusto Database Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="InPlace") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_cluster.id, + role_definition_name="Contributor", + principal_id=example_account.identity.principal_id) + example_dataset_kusto_database = azure.datashare.DatasetKustoDatabase("exampleDatasetKustoDatabase", + share_id=example_share.id, + kusto_database_id=example_database.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Kusto Database Datasets can be imported using the `resource id`, e.g. @@ -238,6 +275,43 @@ def __init__(__self__, """ Manages a Data Share Kusto Database Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + )) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="InPlace") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_cluster.id, + role_definition_name="Contributor", + principal_id=example_account.identity.principal_id) + example_dataset_kusto_database = azure.datashare.DatasetKustoDatabase("exampleDatasetKustoDatabase", + share_id=example_share.id, + kusto_database_id=example_database.id, + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Data Share Kusto Database Datasets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/datashare/get_account.py b/sdk/python/pulumi_azure/datashare/get_account.py index d6e66dc2af..cee881f19e 100644 --- a/sdk/python/pulumi_azure/datashare/get_account.py +++ b/sdk/python/pulumi_azure/datashare/get_account.py @@ -93,6 +93,17 @@ def get_account(name: Optional[str] = None, """ Use this data source to access information about an existing Data Share Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_account(name="example-account", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Account. :param str resource_group_name: The name of the Resource Group where the Data Share Account exists. @@ -118,6 +129,17 @@ def get_account_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Data Share Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_account(name="example-account", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Account. :param str resource_group_name: The name of the Resource Group where the Data Share Account exists. diff --git a/sdk/python/pulumi_azure/datashare/get_dataset_blob_storage.py b/sdk/python/pulumi_azure/datashare/get_dataset_blob_storage.py index 4ce0645ecb..618895b199 100644 --- a/sdk/python/pulumi_azure/datashare/get_dataset_blob_storage.py +++ b/sdk/python/pulumi_azure/datashare/get_dataset_blob_storage.py @@ -132,6 +132,17 @@ def get_dataset_blob_storage(data_share_id: Optional[str] = None, """ Use this data source to access information about an existing Data Share Blob Storage Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_blob_storage(name="example-dsbsds", + data_share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str data_share_id: The ID of the Data Share in which this Data Share Blob Storage Dataset should be created. :param str name: The name of this Data Share Blob Storage Dataset. @@ -160,6 +171,17 @@ def get_dataset_blob_storage_output(data_share_id: Optional[pulumi.Input[str]] = """ Use this data source to access information about an existing Data Share Blob Storage Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_blob_storage(name="example-dsbsds", + data_share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str data_share_id: The ID of the Data Share in which this Data Share Blob Storage Dataset should be created. :param str name: The name of this Data Share Blob Storage Dataset. diff --git a/sdk/python/pulumi_azure/datashare/get_dataset_data_lake_gen2.py b/sdk/python/pulumi_azure/datashare/get_dataset_data_lake_gen2.py index 6c34a40328..6502ece00e 100644 --- a/sdk/python/pulumi_azure/datashare/get_dataset_data_lake_gen2.py +++ b/sdk/python/pulumi_azure/datashare/get_dataset_data_lake_gen2.py @@ -128,6 +128,17 @@ def get_dataset_data_lake_gen2(name: Optional[str] = None, """ Use this data source to access information about an existing Data Share Data Lake Gen2 Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_data_lake_gen2(name="example-dsdlg2ds", + share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Data Lake Gen2 Dataset. :param str share_id: The resource ID of the Data Share where this Data Share Data Lake Gen2 Dataset should be created. @@ -156,6 +167,17 @@ def get_dataset_data_lake_gen2_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Data Share Data Lake Gen2 Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_data_lake_gen2(name="example-dsdlg2ds", + share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Data Lake Gen2 Dataset. :param str share_id: The resource ID of the Data Share where this Data Share Data Lake Gen2 Dataset should be created. diff --git a/sdk/python/pulumi_azure/datashare/get_dataset_kusto_cluster.py b/sdk/python/pulumi_azure/datashare/get_dataset_kusto_cluster.py index 16b8624e37..32754cfa90 100644 --- a/sdk/python/pulumi_azure/datashare/get_dataset_kusto_cluster.py +++ b/sdk/python/pulumi_azure/datashare/get_dataset_kusto_cluster.py @@ -104,6 +104,17 @@ def get_dataset_kusto_cluster(name: Optional[str] = None, """ Use this data source to access information about an existing Data Share Kusto Cluster Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_kusto_cluster(name="example-dskc", + share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Kusto Cluster Dataset. :param str share_id: The resource ID of the Data Share where this Data Share Kusto Cluster Dataset should be created. @@ -130,6 +141,17 @@ def get_dataset_kusto_cluster_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Data Share Kusto Cluster Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_kusto_cluster(name="example-dskc", + share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Kusto Cluster Dataset. :param str share_id: The resource ID of the Data Share where this Data Share Kusto Cluster Dataset should be created. diff --git a/sdk/python/pulumi_azure/datashare/get_dataset_kusto_database.py b/sdk/python/pulumi_azure/datashare/get_dataset_kusto_database.py index c47b51641b..feefabe698 100644 --- a/sdk/python/pulumi_azure/datashare/get_dataset_kusto_database.py +++ b/sdk/python/pulumi_azure/datashare/get_dataset_kusto_database.py @@ -104,6 +104,17 @@ def get_dataset_kusto_database(name: Optional[str] = None, """ Use this data source to access information about an existing Data Share Kusto Database Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_kusto_database(name="example-dskdds", + share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Kusto Database Dataset. :param str share_id: The resource ID of the Data Share where this Data Share Kusto Database Dataset should be created. @@ -130,6 +141,17 @@ def get_dataset_kusto_database_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Data Share Kusto Database Dataset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.datashare.get_dataset_kusto_database(name="example-dskdds", + share_id="example-share-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Data Share Kusto Database Dataset. :param str share_id: The resource ID of the Data Share where this Data Share Kusto Database Dataset should be created. diff --git a/sdk/python/pulumi_azure/datashare/get_share.py b/sdk/python/pulumi_azure/datashare/get_share.py index 30c822c3b5..3da7f2c2fa 100644 --- a/sdk/python/pulumi_azure/datashare/get_share.py +++ b/sdk/python/pulumi_azure/datashare/get_share.py @@ -120,6 +120,19 @@ def get_share(account_id: Optional[str] = None, """ Use this data source to access information about an existing Data Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.datashare.get_account(name="example-account", + resource_group_name="example-resource-group") + example_share = azure.datashare.get_share(name="existing", + account_id=example_account.id) + pulumi.export("id", example_share.id) + ``` + :param str account_id: The ID of the Data Share account in which the Data Share is created. :param str name: The name of this Data Share. @@ -147,6 +160,19 @@ def get_share_output(account_id: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Data Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.datashare.get_account(name="example-account", + resource_group_name="example-resource-group") + example_share = azure.datashare.get_share(name="existing", + account_id=example_account.id) + pulumi.export("id", example_share.id) + ``` + :param str account_id: The ID of the Data Share account in which the Data Share is created. :param str name: The name of this Data Share. diff --git a/sdk/python/pulumi_azure/datashare/share.py b/sdk/python/pulumi_azure/datashare/share.py index f29f562cf1..be0b3e4dee 100644 --- a/sdk/python/pulumi_azure/datashare/share.py +++ b/sdk/python/pulumi_azure/datashare/share.py @@ -288,6 +288,34 @@ def __init__(__self__, """ Manages a Data Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + ), + tags={ + "foo": "bar", + }) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="CopyBased", + description="example desc", + terms="example terms", + snapshot_schedule=azure.datashare.ShareSnapshotScheduleArgs( + name="example-ss", + recurrence="Day", + start_time="2020-04-17T04:47:52.9614956Z", + )) + ``` + ## Import Data Shares can be imported using the `resource id`, e.g. @@ -314,6 +342,34 @@ def __init__(__self__, """ Manages a Data Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.datashare.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + identity=azure.datashare.AccountIdentityArgs( + type="SystemAssigned", + ), + tags={ + "foo": "bar", + }) + example_share = azure.datashare.Share("exampleShare", + account_id=example_account.id, + kind="CopyBased", + description="example desc", + terms="example terms", + snapshot_schedule=azure.datashare.ShareSnapshotScheduleArgs( + name="example-ss", + recurrence="Day", + start_time="2020-04-17T04:47:52.9614956Z", + )) + ``` + ## Import Data Shares can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/desktopvirtualization/application.py b/sdk/python/pulumi_azure/desktopvirtualization/application.py index 1ebd55265f..26034a353c 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/application.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/application.py @@ -455,6 +455,43 @@ def __init__(__self__, """ Manages a Virtual Desktop Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + pooledbreadthfirst = azure.desktopvirtualization.HostPool("pooledbreadthfirst", + location=example.location, + resource_group_name=example.name, + type="Pooled", + load_balancer_type="BreadthFirst") + personalautomatic = azure.desktopvirtualization.HostPool("personalautomatic", + location=example.location, + resource_group_name=example.name, + type="Personal", + personal_desktop_assignment_type="Automatic", + load_balancer_type="BreadthFirst") + remoteapp = azure.desktopvirtualization.ApplicationGroup("remoteapp", + location=example.location, + resource_group_name=example.name, + type="RemoteApp", + host_pool_id=pooledbreadthfirst.id, + friendly_name="TestAppGroup", + description="Acceptance Test: An application group") + chrome = azure.desktopvirtualization.Application("chrome", + application_group_id=remoteapp.id, + friendly_name="Google Chrome", + description="Chromium based web browser", + path="C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe", + command_line_argument_policy="DoNotAllow", + command_line_arguments="--incognito", + show_in_portal=False, + icon_path="C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe", + icon_index=0) + ``` + ## Import Virtual Desktop Application can be imported using the `resource id`, e.g. @@ -485,6 +522,43 @@ def __init__(__self__, """ Manages a Virtual Desktop Application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + pooledbreadthfirst = azure.desktopvirtualization.HostPool("pooledbreadthfirst", + location=example.location, + resource_group_name=example.name, + type="Pooled", + load_balancer_type="BreadthFirst") + personalautomatic = azure.desktopvirtualization.HostPool("personalautomatic", + location=example.location, + resource_group_name=example.name, + type="Personal", + personal_desktop_assignment_type="Automatic", + load_balancer_type="BreadthFirst") + remoteapp = azure.desktopvirtualization.ApplicationGroup("remoteapp", + location=example.location, + resource_group_name=example.name, + type="RemoteApp", + host_pool_id=pooledbreadthfirst.id, + friendly_name="TestAppGroup", + description="Acceptance Test: An application group") + chrome = azure.desktopvirtualization.Application("chrome", + application_group_id=remoteapp.id, + friendly_name="Google Chrome", + description="Chromium based web browser", + path="C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe", + command_line_argument_policy="DoNotAllow", + command_line_arguments="--incognito", + show_in_portal=False, + icon_path="C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe", + icon_index=0) + ``` + ## Import Virtual Desktop Application can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/desktopvirtualization/application_group.py b/sdk/python/pulumi_azure/desktopvirtualization/application_group.py index 521050f6e7..78d6d3470f 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/application_group.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/application_group.py @@ -406,6 +406,40 @@ def __init__(__self__, """ Manages a Virtual Desktop Application Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + pooledbreadthfirst = azure.desktopvirtualization.HostPool("pooledbreadthfirst", + location=example.location, + resource_group_name=example.name, + type="Pooled", + load_balancer_type="BreadthFirst") + personalautomatic = azure.desktopvirtualization.HostPool("personalautomatic", + location=example.location, + resource_group_name=example.name, + type="Personal", + personal_desktop_assignment_type="Automatic", + load_balancer_type="BreadthFirst") + remoteapp = azure.desktopvirtualization.ApplicationGroup("remoteapp", + location=example.location, + resource_group_name=example.name, + type="RemoteApp", + host_pool_id=pooledbreadthfirst.id, + friendly_name="TestAppGroup", + description="Acceptance Test: An application group") + desktopapp = azure.desktopvirtualization.ApplicationGroup("desktopapp", + location=example.location, + resource_group_name=example.name, + type="Desktop", + host_pool_id=personalautomatic.id, + friendly_name="TestAppGroup", + description="Acceptance Test: An application group") + ``` + ## Import Virtual Desktop Application Groups can be imported using the `resource id`, e.g. @@ -435,6 +469,40 @@ def __init__(__self__, """ Manages a Virtual Desktop Application Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + pooledbreadthfirst = azure.desktopvirtualization.HostPool("pooledbreadthfirst", + location=example.location, + resource_group_name=example.name, + type="Pooled", + load_balancer_type="BreadthFirst") + personalautomatic = azure.desktopvirtualization.HostPool("personalautomatic", + location=example.location, + resource_group_name=example.name, + type="Personal", + personal_desktop_assignment_type="Automatic", + load_balancer_type="BreadthFirst") + remoteapp = azure.desktopvirtualization.ApplicationGroup("remoteapp", + location=example.location, + resource_group_name=example.name, + type="RemoteApp", + host_pool_id=pooledbreadthfirst.id, + friendly_name="TestAppGroup", + description="Acceptance Test: An application group") + desktopapp = azure.desktopvirtualization.ApplicationGroup("desktopapp", + location=example.location, + resource_group_name=example.name, + type="Desktop", + host_pool_id=personalautomatic.id, + friendly_name="TestAppGroup", + description="Acceptance Test: An application group") + ``` + ## Import Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool.py b/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool.py index 36a2294580..51cbf9aa8c 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool.py @@ -225,6 +225,16 @@ def get_host_pool(name: Optional[str] = None, """ Use this data source to access information about an existing Virtual Desktop Host Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.desktopvirtualization.get_host_pool(name="example-pool", + resource_group_name="example-resources") + ``` + :param str name: The name of the Virtual Desktop Host Pool to retrieve. :param str resource_group_name: The name of the resource group where the Virtual Desktop Host Pool exists. @@ -261,6 +271,16 @@ def get_host_pool_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Virtual Desktop Host Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.desktopvirtualization.get_host_pool(name="example-pool", + resource_group_name="example-resources") + ``` + :param str name: The name of the Virtual Desktop Host Pool to retrieve. :param str resource_group_name: The name of the resource group where the Virtual Desktop Host Pool exists. diff --git a/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool_registration_info.py b/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool_registration_info.py index 11990a4a67..a300ad0eaa 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool_registration_info.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/get_host_pool_registration_info.py @@ -156,6 +156,24 @@ def __init__(__self__, """ Manages the Registration Info for a Virtual Desktop Host Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westeurope") + example_host_pool = azure.desktopvirtualization.HostPool("exampleHostPool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Pooled", + validate_environment=True, + load_balancer_type="BreadthFirst") + exampleget_host_pool_registration_info = azure.desktopvirtualization.GetHostPoolRegistrationInfo("examplegetHostPoolRegistrationInfo", + hostpool_id=example_host_pool.id, + expiration_date="2022-01-01T23:40:52Z") + ``` + ## Import AVD Registration Infos can be imported using the `resource id`, e.g. @@ -178,6 +196,24 @@ def __init__(__self__, """ Manages the Registration Info for a Virtual Desktop Host Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westeurope") + example_host_pool = azure.desktopvirtualization.HostPool("exampleHostPool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Pooled", + validate_environment=True, + load_balancer_type="BreadthFirst") + exampleget_host_pool_registration_info = azure.desktopvirtualization.GetHostPoolRegistrationInfo("examplegetHostPoolRegistrationInfo", + hostpool_id=example_host_pool.id, + expiration_date="2022-01-01T23:40:52Z") + ``` + ## Import AVD Registration Infos can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/desktopvirtualization/host_pool.py b/sdk/python/pulumi_azure/desktopvirtualization/host_pool.py index 289c4409f4..67a953930c 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/host_pool.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/host_pool.py @@ -674,6 +674,33 @@ def __init__(__self__, """ Manages a Virtual Desktop Host Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_host_pool = azure.desktopvirtualization.HostPool("exampleHostPool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + friendly_name="pooleddepthfirst", + validate_environment=True, + start_vm_on_connect=True, + custom_rdp_properties="audiocapturemode:i:1;audiomode:i:0;", + description="Acceptance Test: A pooled host pool - pooleddepthfirst", + type="Pooled", + maximum_sessions_allowed=50, + load_balancer_type="DepthFirst", + scheduled_agent_updates=azure.desktopvirtualization.HostPoolScheduledAgentUpdatesArgs( + enabled=True, + schedules=[azure.desktopvirtualization.HostPoolScheduledAgentUpdatesScheduleArgs( + day_of_week="Saturday", + hour_of_day=2, + )], + )) + ``` + ## Import Virtual Desktop Host Pools can be imported using the `resource id`, e.g. text @@ -714,6 +741,33 @@ def __init__(__self__, """ Manages a Virtual Desktop Host Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_host_pool = azure.desktopvirtualization.HostPool("exampleHostPool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + friendly_name="pooleddepthfirst", + validate_environment=True, + start_vm_on_connect=True, + custom_rdp_properties="audiocapturemode:i:1;audiomode:i:0;", + description="Acceptance Test: A pooled host pool - pooleddepthfirst", + type="Pooled", + maximum_sessions_allowed=50, + load_balancer_type="DepthFirst", + scheduled_agent_updates=azure.desktopvirtualization.HostPoolScheduledAgentUpdatesArgs( + enabled=True, + schedules=[azure.desktopvirtualization.HostPoolScheduledAgentUpdatesScheduleArgs( + day_of_week="Saturday", + hour_of_day=2, + )], + )) + ``` + ## Import Virtual Desktop Host Pools can be imported using the `resource id`, e.g. text diff --git a/sdk/python/pulumi_azure/desktopvirtualization/scaling_plan.py b/sdk/python/pulumi_azure/desktopvirtualization/scaling_plan.py index b15721de0b..9f6e50e9b7 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/scaling_plan.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/scaling_plan.py @@ -455,6 +455,90 @@ def __init__(__self__, > **Note** Scaling Plans require specific permissions to be granted to the Windows Virtual Desktop application before a 'host_pool' can be configured. [Required Permissions for Scaling Plans](https://docs.microsoft.com/azure/virtual-desktop/autoscale-scaling-plan#create-a-custom-rbac-role). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + import pulumi_random as random + + example_random_uuid = random.RandomUuid("exampleRandomUuid") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + scope=example_resource_group.id, + description="AVD AutoScale Role", + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=[ + "Microsoft.Insights/eventtypes/values/read", + "Microsoft.Compute/virtualMachines/deallocate/action", + "Microsoft.Compute/virtualMachines/restart/action", + "Microsoft.Compute/virtualMachines/powerOff/action", + "Microsoft.Compute/virtualMachines/start/action", + "Microsoft.Compute/virtualMachines/read", + "Microsoft.DesktopVirtualization/hostpools/read", + "Microsoft.DesktopVirtualization/hostpools/write", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/read", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/write", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + ], + not_actions=[], + )], + assignable_scopes=[example_resource_group.id]) + example_service_principal = azuread.get_service_principal(display_name="Windows Virtual Desktop") + example_assignment = azure.authorization.Assignment("exampleAssignment", + name=example_random_uuid.result, + scope=example_resource_group.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_service_principal.id, + skip_service_principal_aad_check=True) + example_host_pool = azure.desktopvirtualization.HostPool("exampleHostPool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Pooled", + validate_environment=True, + load_balancer_type="BreadthFirst") + example_scaling_plan = azure.desktopvirtualization.ScalingPlan("exampleScalingPlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + friendly_name="Scaling Plan Example", + description="Example Scaling Plan", + time_zone="GMT Standard Time", + schedules=[azure.desktopvirtualization.ScalingPlanScheduleArgs( + name="Weekdays", + days_of_weeks=[ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + ], + ramp_up_start_time="05:00", + ramp_up_load_balancing_algorithm="BreadthFirst", + ramp_up_minimum_hosts_percent=20, + ramp_up_capacity_threshold_percent=10, + peak_start_time="09:00", + peak_load_balancing_algorithm="BreadthFirst", + ramp_down_start_time="19:00", + ramp_down_load_balancing_algorithm="DepthFirst", + ramp_down_minimum_hosts_percent=10, + ramp_down_force_logoff_users=False, + ramp_down_wait_time_minutes=45, + ramp_down_notification_message="Please log off in the next 45 minutes...", + ramp_down_capacity_threshold_percent=5, + ramp_down_stop_hosts_when="ZeroSessions", + off_peak_start_time="22:00", + off_peak_load_balancing_algorithm="DepthFirst", + )], + host_pools=[azure.desktopvirtualization.ScalingPlanHostPoolArgs( + hostpool_id=example_host_pool.id, + scaling_plan_enabled=True, + )]) + ``` + ## Import Virtual Desktop Scaling Plans can be imported using the `resource id`, e.g. @@ -491,6 +575,90 @@ def __init__(__self__, > **Note** Scaling Plans require specific permissions to be granted to the Windows Virtual Desktop application before a 'host_pool' can be configured. [Required Permissions for Scaling Plans](https://docs.microsoft.com/azure/virtual-desktop/autoscale-scaling-plan#create-a-custom-rbac-role). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + import pulumi_random as random + + example_random_uuid = random.RandomUuid("exampleRandomUuid") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + scope=example_resource_group.id, + description="AVD AutoScale Role", + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=[ + "Microsoft.Insights/eventtypes/values/read", + "Microsoft.Compute/virtualMachines/deallocate/action", + "Microsoft.Compute/virtualMachines/restart/action", + "Microsoft.Compute/virtualMachines/powerOff/action", + "Microsoft.Compute/virtualMachines/start/action", + "Microsoft.Compute/virtualMachines/read", + "Microsoft.DesktopVirtualization/hostpools/read", + "Microsoft.DesktopVirtualization/hostpools/write", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/read", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/write", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/delete", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/sendMessage/action", + "Microsoft.DesktopVirtualization/hostpools/sessionhosts/usersessions/read", + ], + not_actions=[], + )], + assignable_scopes=[example_resource_group.id]) + example_service_principal = azuread.get_service_principal(display_name="Windows Virtual Desktop") + example_assignment = azure.authorization.Assignment("exampleAssignment", + name=example_random_uuid.result, + scope=example_resource_group.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_service_principal.id, + skip_service_principal_aad_check=True) + example_host_pool = azure.desktopvirtualization.HostPool("exampleHostPool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Pooled", + validate_environment=True, + load_balancer_type="BreadthFirst") + example_scaling_plan = azure.desktopvirtualization.ScalingPlan("exampleScalingPlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + friendly_name="Scaling Plan Example", + description="Example Scaling Plan", + time_zone="GMT Standard Time", + schedules=[azure.desktopvirtualization.ScalingPlanScheduleArgs( + name="Weekdays", + days_of_weeks=[ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + ], + ramp_up_start_time="05:00", + ramp_up_load_balancing_algorithm="BreadthFirst", + ramp_up_minimum_hosts_percent=20, + ramp_up_capacity_threshold_percent=10, + peak_start_time="09:00", + peak_load_balancing_algorithm="BreadthFirst", + ramp_down_start_time="19:00", + ramp_down_load_balancing_algorithm="DepthFirst", + ramp_down_minimum_hosts_percent=10, + ramp_down_force_logoff_users=False, + ramp_down_wait_time_minutes=45, + ramp_down_notification_message="Please log off in the next 45 minutes...", + ramp_down_capacity_threshold_percent=5, + ramp_down_stop_hosts_when="ZeroSessions", + off_peak_start_time="22:00", + off_peak_load_balancing_algorithm="DepthFirst", + )], + host_pools=[azure.desktopvirtualization.ScalingPlanHostPoolArgs( + hostpool_id=example_host_pool.id, + scaling_plan_enabled=True, + )]) + ``` + ## Import Virtual Desktop Scaling Plans can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/desktopvirtualization/workspace.py b/sdk/python/pulumi_azure/desktopvirtualization/workspace.py index 9793a93078..24f2034038 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/workspace.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/workspace.py @@ -326,6 +326,20 @@ def __init__(__self__, """ Manages a Virtual Desktop Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + workspace = azure.desktopvirtualization.Workspace("workspace", + location=example.location, + resource_group_name=example.name, + friendly_name="FriendlyName", + description="A description of my workspace") + ``` + ## Import Virtual Desktop Workspaces can be imported using the `resource id`, e.g. @@ -353,6 +367,20 @@ def __init__(__self__, """ Manages a Virtual Desktop Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + workspace = azure.desktopvirtualization.Workspace("workspace", + location=example.location, + resource_group_name=example.name, + friendly_name="FriendlyName", + description="A description of my workspace") + ``` + ## Import Virtual Desktop Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/desktopvirtualization/workspace_application_group_association.py b/sdk/python/pulumi_azure/desktopvirtualization/workspace_application_group_association.py index 6dfc456d59..92cb12110d 100644 --- a/sdk/python/pulumi_azure/desktopvirtualization/workspace_application_group_association.py +++ b/sdk/python/pulumi_azure/desktopvirtualization/workspace_application_group_association.py @@ -138,6 +138,31 @@ def __init__(__self__, """ Manages a Virtual Desktop Workspace Application Group Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + pooledbreadthfirst = azure.desktopvirtualization.HostPool("pooledbreadthfirst", + location=example.location, + resource_group_name=example.name, + type="Pooled", + load_balancer_type="BreadthFirst") + remoteapp = azure.desktopvirtualization.ApplicationGroup("remoteapp", + location=example.location, + resource_group_name=example.name, + type="RemoteApp", + host_pool_id=pooledbreadthfirst.id) + workspace = azure.desktopvirtualization.Workspace("workspace", + location=example.location, + resource_group_name=example.name) + workspaceremoteapp = azure.desktopvirtualization.WorkspaceApplicationGroupAssociation("workspaceremoteapp", + workspace_id=workspace.id, + application_group_id=remoteapp.id) + ``` + ## Import Associations between Virtual Desktop Workspaces and Virtual Desktop Application Groups can be imported using the `resource id`, e.g. @@ -160,6 +185,31 @@ def __init__(__self__, """ Manages a Virtual Desktop Workspace Application Group Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + pooledbreadthfirst = azure.desktopvirtualization.HostPool("pooledbreadthfirst", + location=example.location, + resource_group_name=example.name, + type="Pooled", + load_balancer_type="BreadthFirst") + remoteapp = azure.desktopvirtualization.ApplicationGroup("remoteapp", + location=example.location, + resource_group_name=example.name, + type="RemoteApp", + host_pool_id=pooledbreadthfirst.id) + workspace = azure.desktopvirtualization.Workspace("workspace", + location=example.location, + resource_group_name=example.name) + workspaceremoteapp = azure.desktopvirtualization.WorkspaceApplicationGroupAssociation("workspaceremoteapp", + workspace_id=workspace.id, + application_group_id=remoteapp.id) + ``` + ## Import Associations between Virtual Desktop Workspaces and Virtual Desktop Application Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devcenter/dev_center.py b/sdk/python/pulumi_azure/devcenter/dev_center.py index 196a923a25..751568a121 100644 --- a/sdk/python/pulumi_azure/devcenter/dev_center.py +++ b/sdk/python/pulumi_azure/devcenter/dev_center.py @@ -268,6 +268,20 @@ def __init__(__self__, Manages a Dev Center. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_dev_center = azure.devcenter.DevCenter("exampleDevCenter", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` ## Blocks Reference ### `identity` Block @@ -311,6 +325,20 @@ def __init__(__self__, Manages a Dev Center. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_dev_center = azure.devcenter.DevCenter("exampleDevCenter", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` ## Blocks Reference ### `identity` Block diff --git a/sdk/python/pulumi_azure/devcenter/project.py b/sdk/python/pulumi_azure/devcenter/project.py index b899d01547..28438bc544 100644 --- a/sdk/python/pulumi_azure/devcenter/project.py +++ b/sdk/python/pulumi_azure/devcenter/project.py @@ -349,6 +349,25 @@ def __init__(__self__, Manages a Dev Center Project. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dev_center = azure.devcenter.DevCenter("exampleDevCenter", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.devcenter.DevCenterIdentityArgs( + type="example-value", + )) + example_project = azure.devcenter.Project("exampleProject", + dev_center_id=example_dev_center.id, + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import An existing Dev Center Project can be imported into Terraform using the `resource id`, e.g. @@ -380,6 +399,25 @@ def __init__(__self__, Manages a Dev Center Project. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dev_center = azure.devcenter.DevCenter("exampleDevCenter", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.devcenter.DevCenterIdentityArgs( + type="example-value", + )) + example_project = azure.devcenter.Project("exampleProject", + dev_center_id=example_dev_center.id, + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import An existing Dev Center Project can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devtest/get_lab.py b/sdk/python/pulumi_azure/devtest/get_lab.py index fbe555d956..e952c8442b 100644 --- a/sdk/python/pulumi_azure/devtest/get_lab.py +++ b/sdk/python/pulumi_azure/devtest/get_lab.py @@ -176,6 +176,17 @@ def get_lab(name: Optional[str] = None, """ Use this data source to access information about an existing Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.devtest.get_lab(name="example-lab", + resource_group_name="example-resources") + pulumi.export("uniqueIdentifier", example.unique_identifier) + ``` + :param str name: The name of the Dev Test Lab. :param str resource_group_name: The Name of the Resource Group where the Dev Test Lab exists. @@ -208,6 +219,17 @@ def get_lab_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.devtest.get_lab(name="example-lab", + resource_group_name="example-resources") + pulumi.export("uniqueIdentifier", example.unique_identifier) + ``` + :param str name: The name of the Dev Test Lab. :param str resource_group_name: The Name of the Resource Group where the Dev Test Lab exists. diff --git a/sdk/python/pulumi_azure/devtest/get_virtual_network.py b/sdk/python/pulumi_azure/devtest/get_virtual_network.py index dad8040cd9..f4f2490815 100644 --- a/sdk/python/pulumi_azure/devtest/get_virtual_network.py +++ b/sdk/python/pulumi_azure/devtest/get_virtual_network.py @@ -115,6 +115,18 @@ def get_virtual_network(lab_name: Optional[str] = None, """ Use this data source to access information about an existing Dev Test Lab Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.devtest.get_virtual_network(name="example-network", + lab_name="examplelab", + resource_group_name="example-resource") + pulumi.export("labSubnetName", example.allowed_subnets[0].lab_subnet_name) + ``` + :param str lab_name: Specifies the name of the Dev Test Lab. :param str name: Specifies the name of the Virtual Network. @@ -145,6 +157,18 @@ def get_virtual_network_output(lab_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Dev Test Lab Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.devtest.get_virtual_network(name="example-network", + lab_name="examplelab", + resource_group_name="example-resource") + pulumi.export("labSubnetName", example.allowed_subnets[0].lab_subnet_name) + ``` + :param str lab_name: Specifies the name of the Dev Test Lab. :param str name: Specifies the name of the Virtual Network. diff --git a/sdk/python/pulumi_azure/devtest/global_vm_shutdown_schedule.py b/sdk/python/pulumi_azure/devtest/global_vm_shutdown_schedule.py index 2677c85fe4..0f4f5f7efe 100644 --- a/sdk/python/pulumi_azure/devtest/global_vm_shutdown_schedule.py +++ b/sdk/python/pulumi_azure/devtest/global_vm_shutdown_schedule.py @@ -333,6 +333,61 @@ def __init__(__self__, this resource applies only to standard VMs, not DevTest Lab VMs. To manage automated shutdown schedules for DevTest Lab VMs, reference the `devtest.Schedule` resource + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + size="Standard_B2s", + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + name="myosdisk-example", + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False) + example_global_vm_shutdown_schedule = azure.devtest.GlobalVMShutdownSchedule("exampleGlobalVMShutdownSchedule", + virtual_machine_id=example_linux_virtual_machine.id, + location=example_resource_group.location, + enabled=True, + daily_recurrence_time="1100", + timezone="Pacific Standard Time", + notification_settings=azure.devtest.GlobalVMShutdownScheduleNotificationSettingsArgs( + enabled=True, + time_in_minutes=60, + webhook_url="https://sample-webhook-url.example.com", + )) + ``` + ## Import An existing Dev Test Global Shutdown Schedule can be imported using the `resource id`, e.g. @@ -364,6 +419,61 @@ def __init__(__self__, this resource applies only to standard VMs, not DevTest Lab VMs. To manage automated shutdown schedules for DevTest Lab VMs, reference the `devtest.Schedule` resource + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + size="Standard_B2s", + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + name="myosdisk-example", + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False) + example_global_vm_shutdown_schedule = azure.devtest.GlobalVMShutdownSchedule("exampleGlobalVMShutdownSchedule", + virtual_machine_id=example_linux_virtual_machine.id, + location=example_resource_group.location, + enabled=True, + daily_recurrence_time="1100", + timezone="Pacific Standard Time", + notification_settings=azure.devtest.GlobalVMShutdownScheduleNotificationSettingsArgs( + enabled=True, + time_in_minutes=60, + webhook_url="https://sample-webhook-url.example.com", + )) + ``` + ## Import An existing Dev Test Global Shutdown Schedule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devtest/lab.py b/sdk/python/pulumi_azure/devtest/lab.py index ccf8c8e2f3..91e70fcffa 100644 --- a/sdk/python/pulumi_azure/devtest/lab.py +++ b/sdk/python/pulumi_azure/devtest/lab.py @@ -388,6 +388,21 @@ def __init__(__self__, """ Manages a Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + ``` + ## Import Dev Test Labs can be imported using the `resource id`, e.g. @@ -415,6 +430,21 @@ def __init__(__self__, """ Manages a Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + ``` + ## Import Dev Test Labs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devtest/linux_virtual_machine.py b/sdk/python/pulumi_azure/devtest/linux_virtual_machine.py index 01bb315b6a..9c4b516986 100644 --- a/sdk/python/pulumi_azure/devtest/linux_virtual_machine.py +++ b/sdk/python/pulumi_azure/devtest/linux_virtual_machine.py @@ -795,6 +795,45 @@ def __init__(__self__, """ Manages a Linux Virtual Machine within a Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_virtual_network = azure.devtest.VirtualNetwork("exampleVirtualNetwork", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + subnet=azure.devtest.VirtualNetworkSubnetArgs( + use_public_ip_address="Allow", + use_in_virtual_machine_creation="Allow", + )) + example_linux_virtual_machine = azure.devtest.LinuxVirtualMachine("exampleLinuxVirtualMachine", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_DS2", + username="exampleuser99", + ssh_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + lab_virtual_network_id=example_virtual_network.id, + lab_subnet_name=example_virtual_network.subnet.name, + storage_type="Premium", + notes="Some notes about this Virtual Machine.", + gallery_image_reference=azure.devtest.LinuxVirtualMachineGalleryImageReferenceArgs( + offer="UbuntuServer", + publisher="Canonical", + sku="18.04-LTS", + version="latest", + )) + ``` + ## Import Dev Test Linux Virtual Machines can be imported using the `resource id`, e.g. @@ -838,6 +877,45 @@ def __init__(__self__, """ Manages a Linux Virtual Machine within a Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_virtual_network = azure.devtest.VirtualNetwork("exampleVirtualNetwork", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + subnet=azure.devtest.VirtualNetworkSubnetArgs( + use_public_ip_address="Allow", + use_in_virtual_machine_creation="Allow", + )) + example_linux_virtual_machine = azure.devtest.LinuxVirtualMachine("exampleLinuxVirtualMachine", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_DS2", + username="exampleuser99", + ssh_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + lab_virtual_network_id=example_virtual_network.id, + lab_subnet_name=example_virtual_network.subnet.name, + storage_type="Premium", + notes="Some notes about this Virtual Machine.", + gallery_image_reference=azure.devtest.LinuxVirtualMachineGalleryImageReferenceArgs( + offer="UbuntuServer", + publisher="Canonical", + sku="18.04-LTS", + version="latest", + )) + ``` + ## Import Dev Test Linux Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devtest/policy.py b/sdk/python/pulumi_azure/devtest/policy.py index e961281c48..d75e2d1bba 100644 --- a/sdk/python/pulumi_azure/devtest/policy.py +++ b/sdk/python/pulumi_azure/devtest/policy.py @@ -412,6 +412,31 @@ def __init__(__self__, """ Manages a Policy within a Dev Test Policy Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_policy = azure.devtest.Policy("examplePolicy", + policy_set_name="default", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + fact_data="", + threshold="999", + evaluator_type="MaxValuePolicy", + tags={ + "Acceptance": "Test", + }) + ``` + ## Import Dev Test Policies can be imported using the `resource id`, e.g. @@ -441,6 +466,31 @@ def __init__(__self__, """ Manages a Policy within a Dev Test Policy Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_policy = azure.devtest.Policy("examplePolicy", + policy_set_name="default", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + fact_data="", + threshold="999", + evaluator_type="MaxValuePolicy", + tags={ + "Acceptance": "Test", + }) + ``` + ## Import Dev Test Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devtest/schedule.py b/sdk/python/pulumi_azure/devtest/schedule.py index dad9e82e6e..f1328ecda5 100644 --- a/sdk/python/pulumi_azure/devtest/schedule.py +++ b/sdk/python/pulumi_azure/devtest/schedule.py @@ -537,6 +537,35 @@ def __init__(__self__, """ Manages automated startup and shutdown schedules for Azure Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_schedule = azure.devtest.Schedule("exampleSchedule", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + lab_name=example_lab.name, + weekly_recurrence=azure.devtest.ScheduleWeeklyRecurrenceArgs( + time="1100", + week_days=[ + "Monday", + "Tuesday", + ], + ), + time_zone_id="Pacific Standard Time", + task_type="LabVmsStartupTask", + notification_settings=azure.devtest.ScheduleNotificationSettingsArgs(), + tags={ + "environment": "Production", + }) + ``` + ## Import DevTest Schedule's can be imported using the `resource id`, e.g. @@ -569,6 +598,35 @@ def __init__(__self__, """ Manages automated startup and shutdown schedules for Azure Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_schedule = azure.devtest.Schedule("exampleSchedule", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + lab_name=example_lab.name, + weekly_recurrence=azure.devtest.ScheduleWeeklyRecurrenceArgs( + time="1100", + week_days=[ + "Monday", + "Tuesday", + ], + ), + time_zone_id="Pacific Standard Time", + task_type="LabVmsStartupTask", + notification_settings=azure.devtest.ScheduleNotificationSettingsArgs(), + tags={ + "environment": "Production", + }) + ``` + ## Import DevTest Schedule's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devtest/virtual_network.py b/sdk/python/pulumi_azure/devtest/virtual_network.py index a677445f30..cdb698bc8f 100644 --- a/sdk/python/pulumi_azure/devtest/virtual_network.py +++ b/sdk/python/pulumi_azure/devtest/virtual_network.py @@ -308,6 +308,28 @@ def __init__(__self__, """ Manages a Virtual Network within a DevTest Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_virtual_network = azure.devtest.VirtualNetwork("exampleVirtualNetwork", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + subnet=azure.devtest.VirtualNetworkSubnetArgs( + use_public_ip_address="Allow", + use_in_virtual_machine_creation="Allow", + )) + ``` + ## Import DevTest Virtual Networks can be imported using the `resource id`, e.g. @@ -334,6 +356,28 @@ def __init__(__self__, """ Manages a Virtual Network within a DevTest Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_virtual_network = azure.devtest.VirtualNetwork("exampleVirtualNetwork", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + subnet=azure.devtest.VirtualNetworkSubnetArgs( + use_public_ip_address="Allow", + use_in_virtual_machine_creation="Allow", + )) + ``` + ## Import DevTest Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/devtest/windows_virtual_machine.py b/sdk/python/pulumi_azure/devtest/windows_virtual_machine.py index a3fbed4062..61829b6d1c 100644 --- a/sdk/python/pulumi_azure/devtest/windows_virtual_machine.py +++ b/sdk/python/pulumi_azure/devtest/windows_virtual_machine.py @@ -747,6 +747,45 @@ def __init__(__self__, """ Manages a Windows Virtual Machine within a Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_virtual_network = azure.devtest.VirtualNetwork("exampleVirtualNetwork", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + subnet=azure.devtest.VirtualNetworkSubnetArgs( + use_public_ip_address="Allow", + use_in_virtual_machine_creation="Allow", + )) + example_windows_virtual_machine = azure.devtest.WindowsVirtualMachine("exampleWindowsVirtualMachine", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_DS2", + username="exampleuser99", + password="Pa$w0rd1234!", + lab_virtual_network_id=example_virtual_network.id, + lab_subnet_name=example_virtual_network.subnet.name, + storage_type="Premium", + notes="Some notes about this Virtual Machine.", + gallery_image_reference=azure.devtest.WindowsVirtualMachineGalleryImageReferenceArgs( + offer="WindowsServer", + publisher="MicrosoftWindowsServer", + sku="2019-Datacenter", + version="latest", + )) + ``` + ## Import DevTest Windows Virtual Machines can be imported using the `resource id`, e.g. @@ -787,6 +826,45 @@ def __init__(__self__, """ Manages a Windows Virtual Machine within a Dev Test Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.devtest.Lab("exampleLab", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Sydney": "Australia", + }) + example_virtual_network = azure.devtest.VirtualNetwork("exampleVirtualNetwork", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + subnet=azure.devtest.VirtualNetworkSubnetArgs( + use_public_ip_address="Allow", + use_in_virtual_machine_creation="Allow", + )) + example_windows_virtual_machine = azure.devtest.WindowsVirtualMachine("exampleWindowsVirtualMachine", + lab_name=example_lab.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_DS2", + username="exampleuser99", + password="Pa$w0rd1234!", + lab_virtual_network_id=example_virtual_network.id, + lab_subnet_name=example_virtual_network.subnet.name, + storage_type="Premium", + notes="Some notes about this Virtual Machine.", + gallery_image_reference=azure.devtest.WindowsVirtualMachineGalleryImageReferenceArgs( + offer="WindowsServer", + publisher="MicrosoftWindowsServer", + sku="2019-Datacenter", + version="latest", + )) + ``` + ## Import DevTest Windows Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/digitaltwins/endpoint_event_grid.py b/sdk/python/pulumi_azure/digitaltwins/endpoint_event_grid.py index bd3b627b0d..cd692f406e 100644 --- a/sdk/python/pulumi_azure/digitaltwins/endpoint_event_grid.py +++ b/sdk/python/pulumi_azure/digitaltwins/endpoint_event_grid.py @@ -300,6 +300,26 @@ def __init__(__self__, """ Manages a Digital Twins Event Grid Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_endpoint_event_grid = azure.digitaltwins.EndpointEventGrid("exampleEndpointEventGrid", + digital_twins_id=example_instance.id, + eventgrid_topic_endpoint=example_topic.endpoint, + eventgrid_topic_primary_access_key=example_topic.primary_access_key, + eventgrid_topic_secondary_access_key=example_topic.secondary_access_key) + ``` + ## Import Digital Twins Eventgrid Endpoints can be imported using the `resource id`, e.g. @@ -326,6 +346,26 @@ def __init__(__self__, """ Manages a Digital Twins Event Grid Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_endpoint_event_grid = azure.digitaltwins.EndpointEventGrid("exampleEndpointEventGrid", + digital_twins_id=example_instance.id, + eventgrid_topic_endpoint=example_topic.endpoint, + eventgrid_topic_primary_access_key=example_topic.primary_access_key, + eventgrid_topic_secondary_access_key=example_topic.secondary_access_key) + ``` + ## Import Digital Twins Eventgrid Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/digitaltwins/endpoint_event_hub.py b/sdk/python/pulumi_azure/digitaltwins/endpoint_event_hub.py index be3d8d41d1..825f5ea188 100644 --- a/sdk/python/pulumi_azure/digitaltwins/endpoint_event_hub.py +++ b/sdk/python/pulumi_azure/digitaltwins/endpoint_event_hub.py @@ -258,6 +258,38 @@ def __init__(__self__, """ Manages a Digital Twins Event Hub Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=False, + send=True, + manage=False) + example_endpoint_event_hub = azure.digitaltwins.EndpointEventHub("exampleEndpointEventHub", + digital_twins_id=example_instance.id, + eventhub_primary_connection_string=example_authorization_rule.primary_connection_string, + eventhub_secondary_connection_string=example_authorization_rule.secondary_connection_string) + ``` + ## Import Digital Twins Eventhub Endpoints can be imported using the `resource id`, e.g. @@ -283,6 +315,38 @@ def __init__(__self__, """ Manages a Digital Twins Event Hub Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=False, + send=True, + manage=False) + example_endpoint_event_hub = azure.digitaltwins.EndpointEventHub("exampleEndpointEventHub", + digital_twins_id=example_instance.id, + eventhub_primary_connection_string=example_authorization_rule.primary_connection_string, + eventhub_secondary_connection_string=example_authorization_rule.secondary_connection_string) + ``` + ## Import Digital Twins Eventhub Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/digitaltwins/endpoint_servicebus.py b/sdk/python/pulumi_azure/digitaltwins/endpoint_servicebus.py index a4ecdc08bb..104350d242 100644 --- a/sdk/python/pulumi_azure/digitaltwins/endpoint_servicebus.py +++ b/sdk/python/pulumi_azure/digitaltwins/endpoint_servicebus.py @@ -258,6 +258,32 @@ def __init__(__self__, """ Manages a Digital Twins Service Bus Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=False, + send=True, + manage=False) + example_endpoint_servicebus = azure.digitaltwins.EndpointServicebus("exampleEndpointServicebus", + digital_twins_id=example_instance.id, + servicebus_primary_connection_string=example_topic_authorization_rule.primary_connection_string, + servicebus_secondary_connection_string=example_topic_authorization_rule.secondary_connection_string) + ``` + ## Import Digital Twins Service Bus Endpoints can be imported using the `resource id`, e.g. @@ -283,6 +309,32 @@ def __init__(__self__, """ Manages a Digital Twins Service Bus Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=False, + send=True, + manage=False) + example_endpoint_servicebus = azure.digitaltwins.EndpointServicebus("exampleEndpointServicebus", + digital_twins_id=example_instance.id, + servicebus_primary_connection_string=example_topic_authorization_rule.primary_connection_string, + servicebus_secondary_connection_string=example_topic_authorization_rule.secondary_connection_string) + ``` + ## Import Digital Twins Service Bus Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/digitaltwins/get_instance.py b/sdk/python/pulumi_azure/digitaltwins/get_instance.py index 47980bffff..48b9c9acf3 100644 --- a/sdk/python/pulumi_azure/digitaltwins/get_instance.py +++ b/sdk/python/pulumi_azure/digitaltwins/get_instance.py @@ -104,6 +104,17 @@ def get_instance(name: Optional[str] = None, """ Use this data source to access information about an existing Digital Twins instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.digitaltwins.get_instance(name="existing-digital-twins", + resource_group_name="existing-resgroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Digital Twins instance. :param str resource_group_name: The name of the Resource Group where the Digital Twins instance exists. @@ -130,6 +141,17 @@ def get_instance_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Digital Twins instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.digitaltwins.get_instance(name="existing-digital-twins", + resource_group_name="existing-resgroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Digital Twins instance. :param str resource_group_name: The name of the Resource Group where the Digital Twins instance exists. diff --git a/sdk/python/pulumi_azure/digitaltwins/instance.py b/sdk/python/pulumi_azure/digitaltwins/instance.py index 4c80ad885d..a74a8bd10f 100644 --- a/sdk/python/pulumi_azure/digitaltwins/instance.py +++ b/sdk/python/pulumi_azure/digitaltwins/instance.py @@ -266,6 +266,21 @@ def __init__(__self__, """ Manages a Digital Twins instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "foo": "bar", + }) + ``` + ## Import Digital Twins instances can be imported using the `resource id`, e.g. @@ -291,6 +306,21 @@ def __init__(__self__, """ Manages a Digital Twins instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "foo": "bar", + }) + ``` + ## Import Digital Twins instances can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/digitaltwins/time_series_database_connection.py b/sdk/python/pulumi_azure/digitaltwins/time_series_database_connection.py index 56440691b8..1ef7a0d94c 100644 --- a/sdk/python/pulumi_azure/digitaltwins/time_series_database_connection.py +++ b/sdk/python/pulumi_azure/digitaltwins/time_series_database_connection.py @@ -467,6 +467,76 @@ def __init__(__self__, """ Manages a Digital Twins Time Series Database Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.digitaltwins.InstanceIdentityArgs( + type="SystemAssigned", + )) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=7) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + database_contributor = azure.authorization.Assignment("databaseContributor", + scope=example_database.id, + principal_id=example_instance.identity.principal_id, + role_definition_name="Contributor") + eventhub_data_owner = azure.authorization.Assignment("eventhubDataOwner", + scope=example_event_hub.id, + principal_id=example_instance.identity.principal_id, + role_definition_name="Azure Event Hubs Data Owner") + example_database_principal_assignment = azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + database_name=example_database.name, + tenant_id=example_instance.identity.tenant_id, + principal_id=example_instance.identity.principal_id, + principal_type="App", + role="Admin") + example_time_series_database_connection = azure.digitaltwins.TimeSeriesDatabaseConnection("exampleTimeSeriesDatabaseConnection", + digital_twins_id=example_instance.id, + eventhub_name=example_event_hub.name, + eventhub_namespace_id=example_event_hub_namespace.id, + eventhub_namespace_endpoint_uri=example_event_hub_namespace.name.apply(lambda name: f"sb://{name}.servicebus.windows.net"), + eventhub_consumer_group_name=example_consumer_group.name, + kusto_cluster_id=example_cluster.id, + kusto_cluster_uri=example_cluster.uri, + kusto_database_name=example_database.name, + kusto_table_name="exampleTable", + opts=pulumi.ResourceOptions(depends_on=[ + database_contributor, + eventhub_data_owner, + example_database_principal_assignment, + ])) + ``` + ## Import Digital Twins Time Series Database Connections can be imported using the `resource id`, e.g. @@ -497,6 +567,76 @@ def __init__(__self__, """ Manages a Digital Twins Time Series Database Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_instance = azure.digitaltwins.Instance("exampleInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.digitaltwins.InstanceIdentityArgs( + type="SystemAssigned", + )) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=7) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + database_contributor = azure.authorization.Assignment("databaseContributor", + scope=example_database.id, + principal_id=example_instance.identity.principal_id, + role_definition_name="Contributor") + eventhub_data_owner = azure.authorization.Assignment("eventhubDataOwner", + scope=example_event_hub.id, + principal_id=example_instance.identity.principal_id, + role_definition_name="Azure Event Hubs Data Owner") + example_database_principal_assignment = azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + database_name=example_database.name, + tenant_id=example_instance.identity.tenant_id, + principal_id=example_instance.identity.principal_id, + principal_type="App", + role="Admin") + example_time_series_database_connection = azure.digitaltwins.TimeSeriesDatabaseConnection("exampleTimeSeriesDatabaseConnection", + digital_twins_id=example_instance.id, + eventhub_name=example_event_hub.name, + eventhub_namespace_id=example_event_hub_namespace.id, + eventhub_namespace_endpoint_uri=example_event_hub_namespace.name.apply(lambda name: f"sb://{name}.servicebus.windows.net"), + eventhub_consumer_group_name=example_consumer_group.name, + kusto_cluster_id=example_cluster.id, + kusto_cluster_uri=example_cluster.uri, + kusto_database_name=example_database.name, + kusto_table_name="exampleTable", + opts=pulumi.ResourceOptions(depends_on=[ + database_contributor, + eventhub_data_owner, + example_database_principal_assignment, + ])) + ``` + ## Import Digital Twins Time Series Database Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/a_record.py b/sdk/python/pulumi_azure/dns/a_record.py index 4f0c1c4a54..f02245254b 100644 --- a/sdk/python/pulumi_azure/dns/a_record.py +++ b/sdk/python/pulumi_azure/dns/a_record.py @@ -360,6 +360,40 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_a_record = azure.dns.ARecord("exampleARecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["10.0.180.17"]) + ``` + ### Alias Record) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic", + ip_version="IPv4") + example_a_record = azure.dns.ARecord("exampleARecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + target_resource_id=example_public_ip.id) + ``` + ## Import A records can be imported using the `resource id`, e.g. @@ -389,6 +423,40 @@ def __init__(__self__, args: ARecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_a_record = azure.dns.ARecord("exampleARecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["10.0.180.17"]) + ``` + ### Alias Record) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic", + ip_version="IPv4") + example_a_record = azure.dns.ARecord("exampleARecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + target_resource_id=example_public_ip.id) + ``` + ## Import A records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/aaaa_record.py b/sdk/python/pulumi_azure/dns/aaaa_record.py index 5e2208a509..588aaa0d21 100644 --- a/sdk/python/pulumi_azure/dns/aaaa_record.py +++ b/sdk/python/pulumi_azure/dns/aaaa_record.py @@ -352,6 +352,40 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_aaaa_record = azure.dns.AaaaRecord("exampleAaaaRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["2001:db8::1:0:0:1"]) + ``` + ### Alias Record) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic", + ip_version="IPv6") + example_aaaa_record = azure.dns.AaaaRecord("exampleAaaaRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + target_resource_id=example_public_ip.id) + ``` + ## Import AAAA records can be imported using the `resource id`, e.g. @@ -379,6 +413,40 @@ def __init__(__self__, args: AaaaRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_aaaa_record = azure.dns.AaaaRecord("exampleAaaaRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["2001:db8::1:0:0:1"]) + ``` + ### Alias Record) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic", + ip_version="IPv6") + example_aaaa_record = azure.dns.AaaaRecord("exampleAaaaRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + target_resource_id=example_public_ip.id) + ``` + ## Import AAAA records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/c_name_record.py b/sdk/python/pulumi_azure/dns/c_name_record.py index f346d51366..4dd8c6eb96 100644 --- a/sdk/python/pulumi_azure/dns/c_name_record.py +++ b/sdk/python/pulumi_azure/dns/c_name_record.py @@ -352,6 +352,40 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + record="contoso.com") + ``` + ### Alias Record) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + target = azure.dns.CNameRecord("target", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + record="contoso.com") + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + target_resource_id=target.id) + ``` + ## Import CNAME records can be imported using the `resource id`, e.g. @@ -379,6 +413,40 @@ def __init__(__self__, args: CNameRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + record="contoso.com") + ``` + ### Alias Record) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + target = azure.dns.CNameRecord("target", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + record="contoso.com") + example_c_name_record = azure.dns.CNameRecord("exampleCNameRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + target_resource_id=target.id) + ``` + ## Import CNAME records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/caa_record.py b/sdk/python/pulumi_azure/dns/caa_record.py index e53fff285b..e72c14dd4a 100644 --- a/sdk/python/pulumi_azure/dns/caa_record.py +++ b/sdk/python/pulumi_azure/dns/caa_record.py @@ -306,6 +306,45 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_caa_record = azure.dns.CaaRecord("exampleCaaRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="issue", + value="example.com", + ), + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="issue", + value="example.net", + ), + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="issuewild", + value=";", + ), + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="iodef", + value="mailto:user@nonexisting.tld", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import CAA records can be imported using the `resource id`, e.g. @@ -330,6 +369,45 @@ def __init__(__self__, args: CaaRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_caa_record = azure.dns.CaaRecord("exampleCaaRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="issue", + value="example.com", + ), + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="issue", + value="example.net", + ), + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="issuewild", + value=";", + ), + azure.dns.CaaRecordRecordArgs( + flags=0, + tag="iodef", + value="mailto:user@nonexisting.tld", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import CAA records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/get_a_record.py b/sdk/python/pulumi_azure/dns/get_a_record.py index 91884e8972..c8a21b053a 100644 --- a/sdk/python/pulumi_azure/dns/get_a_record.py +++ b/sdk/python/pulumi_azure/dns/get_a_record.py @@ -136,7 +136,18 @@ def get_a_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetARecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.get_a_record(name="test", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsARecordId", example.id) + ``` + :param str name: The name of the DNS A Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -167,7 +178,18 @@ def get_a_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetARecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.get_a_record(name="test", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsARecordId", example.id) + ``` + :param str name: The name of the DNS A Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_aaaa_record.py b/sdk/python/pulumi_azure/dns/get_aaaa_record.py index 959e8dca36..b64ddcfb10 100644 --- a/sdk/python/pulumi_azure/dns/get_aaaa_record.py +++ b/sdk/python/pulumi_azure/dns/get_aaaa_record.py @@ -136,7 +136,18 @@ def get_aaaa_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAAAARecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.AaaaRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsAaaaRecordId", example.id) + ``` + :param str name: The name of the DNS AAAA Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -167,7 +178,18 @@ def get_aaaa_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetAAAARecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.AaaaRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsAaaaRecordId", example.id) + ``` + :param str name: The name of the DNS AAAA Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_caa_record.py b/sdk/python/pulumi_azure/dns/get_caa_record.py index 2de82553b5..a98b9367bf 100644 --- a/sdk/python/pulumi_azure/dns/get_caa_record.py +++ b/sdk/python/pulumi_azure/dns/get_caa_record.py @@ -125,7 +125,18 @@ def get_caa_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCAARecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.CaaRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsCaaRecordId", example.id) + ``` + :param str name: The name of the DNS CAA Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -155,7 +166,18 @@ def get_caa_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCAARecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.CaaRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsCaaRecordId", example.id) + ``` + :param str name: The name of the DNS CAA Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_cname_record.py b/sdk/python/pulumi_azure/dns/get_cname_record.py index 81256a3730..0f6b34d412 100644 --- a/sdk/python/pulumi_azure/dns/get_cname_record.py +++ b/sdk/python/pulumi_azure/dns/get_cname_record.py @@ -136,7 +136,18 @@ def get_cname_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCnameRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.CNameRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsCnameRecordId", example.id) + ``` + :param str name: The name of the DNS CNAME Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -167,7 +178,18 @@ def get_cname_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCnameRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.CNameRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsCnameRecordId", example.id) + ``` + :param str name: The name of the DNS CNAME Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_mx_record.py b/sdk/python/pulumi_azure/dns/get_mx_record.py index 55c3236c92..e6f2fba6d5 100644 --- a/sdk/python/pulumi_azure/dns/get_mx_record.py +++ b/sdk/python/pulumi_azure/dns/get_mx_record.py @@ -125,7 +125,18 @@ def get_mx_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetMxRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.MxRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsMxRecordId", example.id) + ``` + :param str name: The name of the DNS MX Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -155,7 +166,18 @@ def get_mx_record_output(name: Optional[pulumi.Input[Optional[str]]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetMxRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.MxRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsMxRecordId", example.id) + ``` + :param str name: The name of the DNS MX Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_ns_record.py b/sdk/python/pulumi_azure/dns/get_ns_record.py index 2188c9ef1d..94e2e913ea 100644 --- a/sdk/python/pulumi_azure/dns/get_ns_record.py +++ b/sdk/python/pulumi_azure/dns/get_ns_record.py @@ -124,7 +124,18 @@ def get_ns_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetNsRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.NsRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsNsRecordId", example.id) + ``` + :param str name: The name of the DNS NS Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -154,7 +165,18 @@ def get_ns_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetNsRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.NsRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsNsRecordId", example.id) + ``` + :param str name: The name of the DNS NS Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_ptr_record.py b/sdk/python/pulumi_azure/dns/get_ptr_record.py index 5de9dbdd06..6e2de226d6 100644 --- a/sdk/python/pulumi_azure/dns/get_ptr_record.py +++ b/sdk/python/pulumi_azure/dns/get_ptr_record.py @@ -124,7 +124,18 @@ def get_ptr_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPtrRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.PtrRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsPtrRecordId", example.id) + ``` + :param str name: The name of the DNS PTR Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -154,7 +165,18 @@ def get_ptr_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetPtrRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.PtrRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsPtrRecordId", example.id) + ``` + :param str name: The name of the DNS PTR Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_srv_record.py b/sdk/python/pulumi_azure/dns/get_srv_record.py index d37ca806c3..155cc8ee7a 100644 --- a/sdk/python/pulumi_azure/dns/get_srv_record.py +++ b/sdk/python/pulumi_azure/dns/get_srv_record.py @@ -125,7 +125,18 @@ def get_srv_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSrvRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.SrvRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsSrvRecordId", example.id) + ``` + :param str name: The name of the DNS SRV Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -155,7 +166,18 @@ def get_srv_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetSrvRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.SrvRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsSrvRecordId", example.id) + ``` + :param str name: The name of the DNS SRV Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_txt_record.py b/sdk/python/pulumi_azure/dns/get_txt_record.py index e9482b7094..996ece8fd5 100644 --- a/sdk/python/pulumi_azure/dns/get_txt_record.py +++ b/sdk/python/pulumi_azure/dns/get_txt_record.py @@ -125,7 +125,18 @@ def get_txt_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTxtRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.TxtRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsTxtRecordId", example.id) + ``` + :param str name: The name of the DNS TXT Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. @@ -155,7 +166,18 @@ def get_txt_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetTxtRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.TxtRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("dnsTxtRecordId", example.id) + ``` + :param str name: The name of the DNS TXT Record. :param str resource_group_name: Specifies the resource group where the DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/dns/get_zone.py b/sdk/python/pulumi_azure/dns/get_zone.py index 7554aad4be..8e84c3efba 100644 --- a/sdk/python/pulumi_azure/dns/get_zone.py +++ b/sdk/python/pulumi_azure/dns/get_zone.py @@ -116,6 +116,17 @@ def get_zone(name: Optional[str] = None, """ Use this data source to access information about an existing DNS Zone. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.get_zone(name="search-eventhubns", + resource_group_name="search-service") + pulumi.export("dnsZoneId", example.id) + ``` + :param str name: The name of the DNS Zone. :param str resource_group_name: The Name of the Resource Group where the DNS Zone exists. @@ -145,6 +156,17 @@ def get_zone_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing DNS Zone. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.dns.get_zone(name="search-eventhubns", + resource_group_name="search-service") + pulumi.export("dnsZoneId", example.id) + ``` + :param str name: The name of the DNS Zone. :param str resource_group_name: The Name of the Resource Group where the DNS Zone exists. diff --git a/sdk/python/pulumi_azure/dns/mx_record.py b/sdk/python/pulumi_azure/dns/mx_record.py index a022f05c2c..28d506ef4c 100644 --- a/sdk/python/pulumi_azure/dns/mx_record.py +++ b/sdk/python/pulumi_azure/dns/mx_record.py @@ -306,6 +306,33 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_mx_record = azure.dns.MxRecord("exampleMxRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + azure.dns.MxRecordRecordArgs( + preference="10", + exchange="mail1.contoso.com", + ), + azure.dns.MxRecordRecordArgs( + preference="20", + exchange="mail2.contoso.com", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import MX records can be imported using the `resource id`, e.g. @@ -330,6 +357,33 @@ def __init__(__self__, args: MxRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_mx_record = azure.dns.MxRecord("exampleMxRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + azure.dns.MxRecordRecordArgs( + preference="10", + exchange="mail1.contoso.com", + ), + azure.dns.MxRecordRecordArgs( + preference="20", + exchange="mail2.contoso.com", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import MX records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/ns_record.py b/sdk/python/pulumi_azure/dns/ns_record.py index 3b8680ba1e..783ecb188e 100644 --- a/sdk/python/pulumi_azure/dns/ns_record.py +++ b/sdk/python/pulumi_azure/dns/ns_record.py @@ -304,6 +304,27 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_ns_record = azure.dns.NsRecord("exampleNsRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + "ns1.contoso.com.", + "ns2.contoso.com.", + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import NS records can be imported using the `resource id`, e.g. @@ -328,6 +349,27 @@ def __init__(__self__, args: NsRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_ns_record = azure.dns.NsRecord("exampleNsRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + "ns1.contoso.com.", + "ns2.contoso.com.", + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import NS records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/ptr_record.py b/sdk/python/pulumi_azure/dns/ptr_record.py index 7e006fea47..8cafc5806d 100644 --- a/sdk/python/pulumi_azure/dns/ptr_record.py +++ b/sdk/python/pulumi_azure/dns/ptr_record.py @@ -304,6 +304,21 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_ptr_record = azure.dns.PtrRecord("examplePtrRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["yourdomain.com"]) + ``` + ## Import PTR records can be imported using the `resource id`, e.g. @@ -328,6 +343,21 @@ def __init__(__self__, args: PtrRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_ptr_record = azure.dns.PtrRecord("examplePtrRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["yourdomain.com"]) + ``` + ## Import PTR records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/srv_record.py b/sdk/python/pulumi_azure/dns/srv_record.py index c3e8871f8e..9b1fe55747 100644 --- a/sdk/python/pulumi_azure/dns/srv_record.py +++ b/sdk/python/pulumi_azure/dns/srv_record.py @@ -306,6 +306,29 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_srv_record = azure.dns.SrvRecord("exampleSrvRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[azure.dns.SrvRecordRecordArgs( + priority=1, + weight=5, + port=8080, + target="target1.contoso.com", + )], + tags={ + "Environment": "Production", + }) + ``` + ## Import SRV records can be imported using the `resource id`, e.g. @@ -330,6 +353,29 @@ def __init__(__self__, args: SrvRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_srv_record = azure.dns.SrvRecord("exampleSrvRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[azure.dns.SrvRecordRecordArgs( + priority=1, + weight=5, + port=8080, + target="target1.contoso.com", + )], + tags={ + "Environment": "Production", + }) + ``` + ## Import SRV records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/txt_record.py b/sdk/python/pulumi_azure/dns/txt_record.py index fa18bd5220..0b59898a28 100644 --- a/sdk/python/pulumi_azure/dns/txt_record.py +++ b/sdk/python/pulumi_azure/dns/txt_record.py @@ -306,6 +306,31 @@ def __init__(__self__, zone_name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_txt_record = azure.dns.TxtRecord("exampleTxtRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + azure.dns.TxtRecordRecordArgs( + value="google-site-authenticator", + ), + azure.dns.TxtRecordRecordArgs( + value="more site information here", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import TXT records can be imported using the `resource id`, e.g. @@ -330,6 +355,31 @@ def __init__(__self__, args: TxtRecordArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.dns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_txt_record = azure.dns.TxtRecord("exampleTxtRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=[ + azure.dns.TxtRecordRecordArgs( + value="google-site-authenticator", + ), + azure.dns.TxtRecordRecordArgs( + value="more site information here", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import TXT records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/dns/zone.py b/sdk/python/pulumi_azure/dns/zone.py index 58277e36da..14374e0e76 100644 --- a/sdk/python/pulumi_azure/dns/zone.py +++ b/sdk/python/pulumi_azure/dns/zone.py @@ -273,6 +273,16 @@ def __init__(__self__, """ Enables you to manage DNS zones within Azure DNS. These zones are hosted on Azure's name servers to which you can delegate the zone from the parent domain. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + example_public = azure.dns.Zone("example-public", resource_group_name=example.name) + ``` + ## Import DNS Zones can be imported using the `resource id`, e.g. @@ -297,6 +307,16 @@ def __init__(__self__, """ Enables you to manage DNS zones within Azure DNS. These zones are hosted on Azure's name servers to which you can delegate the zone from the parent domain. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + example_public = azure.dns.Zone("example-public", resource_group_name=example.name) + ``` + ## Import DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/domainservices/get_service.py b/sdk/python/pulumi_azure/domainservices/get_service.py index 38defc232b..9cda151812 100644 --- a/sdk/python/pulumi_azure/domainservices/get_service.py +++ b/sdk/python/pulumi_azure/domainservices/get_service.py @@ -240,6 +240,16 @@ def get_service(name: Optional[str] = None, > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.domainservices.get_service(name="example-aadds", + resource_group_name="example-aadds-rg") + ``` + :param str name: The display name for your managed Active Directory Domain Service resource. Changing this forces a new resource to be created. :param str resource_group_name: The name of the Resource Group in which the Domain Service should exist. Changing this forces a new resource to be created. @@ -283,6 +293,16 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.domainservices.get_service(name="example-aadds", + resource_group_name="example-aadds-rg") + ``` + :param str name: The display name for your managed Active Directory Domain Service resource. Changing this forces a new resource to be created. :param str resource_group_name: The name of the Resource Group in which the Domain Service should exist. Changing this forces a new resource to be created. diff --git a/sdk/python/pulumi_azure/domainservices/replica_set.py b/sdk/python/pulumi_azure/domainservices/replica_set.py index ab94530355..b127d423cf 100644 --- a/sdk/python/pulumi_azure/domainservices/replica_set.py +++ b/sdk/python/pulumi_azure/domainservices/replica_set.py @@ -235,6 +235,208 @@ def __init__(__self__, """ Manages a Replica Set for an Active Directory Domain Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West Europe") + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + address_spaces=["10.0.1.0/16"]) + primary_subnet = azure.network.Subnet("primarySubnet", + resource_group_name=primary_resource_group.name, + virtual_network_name=primary_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + primary_network_security_group = azure.network.NetworkSecurityGroup("primaryNetworkSecurityGroup", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + security_rules=[ + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowSyncWithAzureAD", + priority=101, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="443", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowRD", + priority=201, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="3389", + source_address_prefix="CorpNetSaw", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowPSRemoting", + priority=301, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="5986", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowLDAPS", + priority=401, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="636", + source_address_prefix="*", + destination_address_prefix="*", + ), + ]) + primary_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("primarySubnetNetworkSecurityGroupAssociation", + subnet_id=primary_subnet.id, + network_security_group_id=primary_network_security_group.id) + dc_admins = azuread.Group("dcAdmins", + display_name="aad-dc-administrators", + security_enabled=True) + admin_user = azuread.User("adminUser", + user_principal_name="dc-admin@hashicorp-example.net", + display_name="DC Administrator", + password="Pa55w0Rd!!1") + admin_group_member = azuread.GroupMember("adminGroupMember", + group_object_id=dc_admins.object_id, + member_object_id=admin_user.object_id) + example_service_principal = azuread.ServicePrincipal("exampleServicePrincipal", application_id="2565bd9d-da50-47d4-8b85-4c97f669dc36") + # published app for domain services + aadds = azure.core.ResourceGroup("aadds", location="westeurope") + example_service = azure.domainservices.Service("exampleService", + location=aadds.location, + resource_group_name=aadds.name, + domain_name="widgetslogin.net", + sku="Enterprise", + filtered_sync_enabled=False, + initial_replica_set=azure.domainservices.ServiceInitialReplicaSetArgs( + location=primary_virtual_network.location, + subnet_id=primary_subnet.id, + ), + notifications=azure.domainservices.ServiceNotificationsArgs( + additional_recipients=[ + "notifyA@example.net", + "notifyB@example.org", + ], + notify_dc_admins=True, + notify_global_admins=True, + ), + security=azure.domainservices.ServiceSecurityArgs( + sync_kerberos_passwords=True, + sync_ntlm_passwords=True, + sync_on_prem_passwords=True, + ), + tags={ + "Environment": "prod", + }, + opts=pulumi.ResourceOptions(depends_on=[ + example_service_principal, + primary_subnet_network_security_group_association, + ])) + replica_resource_group = azure.core.ResourceGroup("replicaResourceGroup", location="North Europe") + replica_virtual_network = azure.network.VirtualNetwork("replicaVirtualNetwork", + location=replica_resource_group.location, + resource_group_name=replica_resource_group.name, + address_spaces=["10.20.0.0/16"]) + aadds_replica_subnet = azure.network.Subnet("aaddsReplicaSubnet", + resource_group_name=replica_resource_group.name, + virtual_network_name=replica_virtual_network.name, + address_prefixes=["10.20.0.0/24"]) + aadds_replica_network_security_group = azure.network.NetworkSecurityGroup("aaddsReplicaNetworkSecurityGroup", + location=replica_resource_group.location, + resource_group_name=replica_resource_group.name, + security_rules=[ + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowSyncWithAzureAD", + priority=101, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="443", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowRD", + priority=201, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="3389", + source_address_prefix="CorpNetSaw", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowPSRemoting", + priority=301, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="5986", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowLDAPS", + priority=401, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="636", + source_address_prefix="*", + destination_address_prefix="*", + ), + ]) + replica_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("replicaSubnetNetworkSecurityGroupAssociation", + subnet_id=aadds_replica_subnet.id, + network_security_group_id=aadds_replica_network_security_group.id) + primary_replica = azure.network.VirtualNetworkPeering("primaryReplica", + resource_group_name=primary_virtual_network.resource_group_name, + virtual_network_name=primary_virtual_network.name, + remote_virtual_network_id=replica_virtual_network.id, + allow_forwarded_traffic=True, + allow_gateway_transit=False, + allow_virtual_network_access=True, + use_remote_gateways=False) + replica_primary = azure.network.VirtualNetworkPeering("replicaPrimary", + resource_group_name=replica_virtual_network.resource_group_name, + virtual_network_name=replica_virtual_network.name, + remote_virtual_network_id=primary_virtual_network.id, + allow_forwarded_traffic=True, + allow_gateway_transit=False, + allow_virtual_network_access=True, + use_remote_gateways=False) + replica_virtual_network_dns_servers = azure.network.VirtualNetworkDnsServers("replicaVirtualNetworkDnsServers", + virtual_network_id=replica_virtual_network.id, + dns_servers=example_service.initial_replica_set.domain_controller_ip_addresses) + replica_replica_set = azure.domainservices.ReplicaSet("replicaReplicaSet", + domain_service_id=example_service.id, + location=replica_resource_group.location, + subnet_id=aadds_replica_subnet.id, + opts=pulumi.ResourceOptions(depends_on=[ + replica_subnet_network_security_group_association, + primary_replica, + replica_primary, + ])) + ``` + ## Import Domain Service Replica Sets can be imported using the resource ID of the parent Domain Service and the Replica Set ID, e.g. @@ -258,6 +460,208 @@ def __init__(__self__, """ Manages a Replica Set for an Active Directory Domain Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West Europe") + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + address_spaces=["10.0.1.0/16"]) + primary_subnet = azure.network.Subnet("primarySubnet", + resource_group_name=primary_resource_group.name, + virtual_network_name=primary_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + primary_network_security_group = azure.network.NetworkSecurityGroup("primaryNetworkSecurityGroup", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + security_rules=[ + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowSyncWithAzureAD", + priority=101, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="443", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowRD", + priority=201, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="3389", + source_address_prefix="CorpNetSaw", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowPSRemoting", + priority=301, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="5986", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowLDAPS", + priority=401, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="636", + source_address_prefix="*", + destination_address_prefix="*", + ), + ]) + primary_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("primarySubnetNetworkSecurityGroupAssociation", + subnet_id=primary_subnet.id, + network_security_group_id=primary_network_security_group.id) + dc_admins = azuread.Group("dcAdmins", + display_name="aad-dc-administrators", + security_enabled=True) + admin_user = azuread.User("adminUser", + user_principal_name="dc-admin@hashicorp-example.net", + display_name="DC Administrator", + password="Pa55w0Rd!!1") + admin_group_member = azuread.GroupMember("adminGroupMember", + group_object_id=dc_admins.object_id, + member_object_id=admin_user.object_id) + example_service_principal = azuread.ServicePrincipal("exampleServicePrincipal", application_id="2565bd9d-da50-47d4-8b85-4c97f669dc36") + # published app for domain services + aadds = azure.core.ResourceGroup("aadds", location="westeurope") + example_service = azure.domainservices.Service("exampleService", + location=aadds.location, + resource_group_name=aadds.name, + domain_name="widgetslogin.net", + sku="Enterprise", + filtered_sync_enabled=False, + initial_replica_set=azure.domainservices.ServiceInitialReplicaSetArgs( + location=primary_virtual_network.location, + subnet_id=primary_subnet.id, + ), + notifications=azure.domainservices.ServiceNotificationsArgs( + additional_recipients=[ + "notifyA@example.net", + "notifyB@example.org", + ], + notify_dc_admins=True, + notify_global_admins=True, + ), + security=azure.domainservices.ServiceSecurityArgs( + sync_kerberos_passwords=True, + sync_ntlm_passwords=True, + sync_on_prem_passwords=True, + ), + tags={ + "Environment": "prod", + }, + opts=pulumi.ResourceOptions(depends_on=[ + example_service_principal, + primary_subnet_network_security_group_association, + ])) + replica_resource_group = azure.core.ResourceGroup("replicaResourceGroup", location="North Europe") + replica_virtual_network = azure.network.VirtualNetwork("replicaVirtualNetwork", + location=replica_resource_group.location, + resource_group_name=replica_resource_group.name, + address_spaces=["10.20.0.0/16"]) + aadds_replica_subnet = azure.network.Subnet("aaddsReplicaSubnet", + resource_group_name=replica_resource_group.name, + virtual_network_name=replica_virtual_network.name, + address_prefixes=["10.20.0.0/24"]) + aadds_replica_network_security_group = azure.network.NetworkSecurityGroup("aaddsReplicaNetworkSecurityGroup", + location=replica_resource_group.location, + resource_group_name=replica_resource_group.name, + security_rules=[ + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowSyncWithAzureAD", + priority=101, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="443", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowRD", + priority=201, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="3389", + source_address_prefix="CorpNetSaw", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowPSRemoting", + priority=301, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="5986", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowLDAPS", + priority=401, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="636", + source_address_prefix="*", + destination_address_prefix="*", + ), + ]) + replica_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("replicaSubnetNetworkSecurityGroupAssociation", + subnet_id=aadds_replica_subnet.id, + network_security_group_id=aadds_replica_network_security_group.id) + primary_replica = azure.network.VirtualNetworkPeering("primaryReplica", + resource_group_name=primary_virtual_network.resource_group_name, + virtual_network_name=primary_virtual_network.name, + remote_virtual_network_id=replica_virtual_network.id, + allow_forwarded_traffic=True, + allow_gateway_transit=False, + allow_virtual_network_access=True, + use_remote_gateways=False) + replica_primary = azure.network.VirtualNetworkPeering("replicaPrimary", + resource_group_name=replica_virtual_network.resource_group_name, + virtual_network_name=replica_virtual_network.name, + remote_virtual_network_id=primary_virtual_network.id, + allow_forwarded_traffic=True, + allow_gateway_transit=False, + allow_virtual_network_access=True, + use_remote_gateways=False) + replica_virtual_network_dns_servers = azure.network.VirtualNetworkDnsServers("replicaVirtualNetworkDnsServers", + virtual_network_id=replica_virtual_network.id, + dns_servers=example_service.initial_replica_set.domain_controller_ip_addresses) + replica_replica_set = azure.domainservices.ReplicaSet("replicaReplicaSet", + domain_service_id=example_service.id, + location=replica_resource_group.location, + subnet_id=aadds_replica_subnet.id, + opts=pulumi.ResourceOptions(depends_on=[ + replica_subnet_network_security_group_association, + primary_replica, + replica_primary, + ])) + ``` + ## Import Domain Service Replica Sets can be imported using the resource ID of the parent Domain Service and the Replica Set ID, e.g. diff --git a/sdk/python/pulumi_azure/domainservices/service.py b/sdk/python/pulumi_azure/domainservices/service.py index c819adb820..ce456a9c5a 100644 --- a/sdk/python/pulumi_azure/domainservices/service.py +++ b/sdk/python/pulumi_azure/domainservices/service.py @@ -612,6 +612,118 @@ def __init__(__self__, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + deploy_resource_group = azure.core.ResourceGroup("deployResourceGroup", location="West Europe") + deploy_virtual_network = azure.network.VirtualNetwork("deployVirtualNetwork", + location=deploy_resource_group.location, + resource_group_name=deploy_resource_group.name, + address_spaces=["10.0.1.0/16"]) + deploy_subnet = azure.network.Subnet("deploySubnet", + resource_group_name=deploy_resource_group.name, + virtual_network_name=deploy_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + deploy_network_security_group = azure.network.NetworkSecurityGroup("deployNetworkSecurityGroup", + location=deploy_resource_group.location, + resource_group_name=deploy_resource_group.name, + security_rules=[ + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowSyncWithAzureAD", + priority=101, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="443", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowRD", + priority=201, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="3389", + source_address_prefix="CorpNetSaw", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowPSRemoting", + priority=301, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="5986", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowLDAPS", + priority=401, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="636", + source_address_prefix="*", + destination_address_prefix="*", + ), + ]) + deploy_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("deploySubnetNetworkSecurityGroupAssociation", + subnet_id=deploy_subnet.id, + network_security_group_id=deploy_network_security_group.id) + dc_admins = azuread.Group("dcAdmins", + display_name="AAD DC Administrators", + security_enabled=True) + admin_user = azuread.User("adminUser", + user_principal_name="dc-admin@hashicorp-example.com", + display_name="DC Administrator", + password="Pa55w0Rd!!1") + admin_group_member = azuread.GroupMember("adminGroupMember", + group_object_id=dc_admins.object_id, + member_object_id=admin_user.object_id) + example_service_principal = azuread.ServicePrincipal("exampleServicePrincipal", application_id="2565bd9d-da50-47d4-8b85-4c97f669dc36") + # published app for domain services + aadds = azure.core.ResourceGroup("aadds", location="westeurope") + example_service = azure.domainservices.Service("exampleService", + location=aadds.location, + resource_group_name=aadds.name, + domain_name="widgetslogin.net", + sku="Enterprise", + filtered_sync_enabled=False, + initial_replica_set=azure.domainservices.ServiceInitialReplicaSetArgs( + subnet_id=deploy_subnet.id, + ), + notifications=azure.domainservices.ServiceNotificationsArgs( + additional_recipients=[ + "notifyA@example.net", + "notifyB@example.org", + ], + notify_dc_admins=True, + notify_global_admins=True, + ), + security=azure.domainservices.ServiceSecurityArgs( + sync_kerberos_passwords=True, + sync_ntlm_passwords=True, + sync_on_prem_passwords=True, + ), + tags={ + "Environment": "prod", + }, + opts=pulumi.ResourceOptions(depends_on=[ + example_service_principal, + deploy_subnet_network_security_group_association, + ])) + ``` + ## Import Domain Services can be imported using the resource ID, together with the Replica Set ID that you wish to designate as the initial replica set, e.g. @@ -642,6 +754,118 @@ def __init__(__self__, args: ServiceArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + deploy_resource_group = azure.core.ResourceGroup("deployResourceGroup", location="West Europe") + deploy_virtual_network = azure.network.VirtualNetwork("deployVirtualNetwork", + location=deploy_resource_group.location, + resource_group_name=deploy_resource_group.name, + address_spaces=["10.0.1.0/16"]) + deploy_subnet = azure.network.Subnet("deploySubnet", + resource_group_name=deploy_resource_group.name, + virtual_network_name=deploy_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + deploy_network_security_group = azure.network.NetworkSecurityGroup("deployNetworkSecurityGroup", + location=deploy_resource_group.location, + resource_group_name=deploy_resource_group.name, + security_rules=[ + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowSyncWithAzureAD", + priority=101, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="443", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowRD", + priority=201, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="3389", + source_address_prefix="CorpNetSaw", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowPSRemoting", + priority=301, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="5986", + source_address_prefix="AzureActiveDirectoryDomainServices", + destination_address_prefix="*", + ), + azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="AllowLDAPS", + priority=401, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="636", + source_address_prefix="*", + destination_address_prefix="*", + ), + ]) + deploy_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("deploySubnetNetworkSecurityGroupAssociation", + subnet_id=deploy_subnet.id, + network_security_group_id=deploy_network_security_group.id) + dc_admins = azuread.Group("dcAdmins", + display_name="AAD DC Administrators", + security_enabled=True) + admin_user = azuread.User("adminUser", + user_principal_name="dc-admin@hashicorp-example.com", + display_name="DC Administrator", + password="Pa55w0Rd!!1") + admin_group_member = azuread.GroupMember("adminGroupMember", + group_object_id=dc_admins.object_id, + member_object_id=admin_user.object_id) + example_service_principal = azuread.ServicePrincipal("exampleServicePrincipal", application_id="2565bd9d-da50-47d4-8b85-4c97f669dc36") + # published app for domain services + aadds = azure.core.ResourceGroup("aadds", location="westeurope") + example_service = azure.domainservices.Service("exampleService", + location=aadds.location, + resource_group_name=aadds.name, + domain_name="widgetslogin.net", + sku="Enterprise", + filtered_sync_enabled=False, + initial_replica_set=azure.domainservices.ServiceInitialReplicaSetArgs( + subnet_id=deploy_subnet.id, + ), + notifications=azure.domainservices.ServiceNotificationsArgs( + additional_recipients=[ + "notifyA@example.net", + "notifyB@example.org", + ], + notify_dc_admins=True, + notify_global_admins=True, + ), + security=azure.domainservices.ServiceSecurityArgs( + sync_kerberos_passwords=True, + sync_ntlm_passwords=True, + sync_on_prem_passwords=True, + ), + tags={ + "Environment": "prod", + }, + opts=pulumi.ResourceOptions(depends_on=[ + example_service_principal, + deploy_subnet_network_security_group_association, + ])) + ``` + ## Import Domain Services can be imported using the resource ID, together with the Replica Set ID that you wish to designate as the initial replica set, e.g. diff --git a/sdk/python/pulumi_azure/domainservices/service_trust.py b/sdk/python/pulumi_azure/domainservices/service_trust.py index 79f85af5ec..11f7cd62eb 100644 --- a/sdk/python/pulumi_azure/domainservices/service_trust.py +++ b/sdk/python/pulumi_azure/domainservices/service_trust.py @@ -255,6 +255,24 @@ def __init__(__self__, """ Manages a Active Directory Domain Service Trust. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.domainservices.get_service(name="example-ds", + resource_group_name="example-rg") + example_service_trust = azure.domainservices.ServiceTrust("exampleServiceTrust", + domain_service_id=example_service.id, + trusted_domain_fqdn="example.com", + trusted_domain_dns_ips=[ + "10.1.0.3", + "10.1.0.4", + ], + password="Password123") + ``` + ## Import Active Directory Domain Service Trusts can be imported using the `resource id`, e.g. @@ -280,6 +298,24 @@ def __init__(__self__, """ Manages a Active Directory Domain Service Trust. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_service = azure.domainservices.get_service(name="example-ds", + resource_group_name="example-rg") + example_service_trust = azure.domainservices.ServiceTrust("exampleServiceTrust", + domain_service_id=example_service.id, + trusted_domain_fqdn="example.com", + trusted_domain_dns_ips=[ + "10.1.0.3", + "10.1.0.4", + ], + password="Password123") + ``` + ## Import Active Directory Domain Service Trusts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/elasticcloud/elasticsearch.py b/sdk/python/pulumi_azure/elasticcloud/elasticsearch.py index b858b49aa1..65a3afcc04 100644 --- a/sdk/python/pulumi_azure/elasticcloud/elasticsearch.py +++ b/sdk/python/pulumi_azure/elasticcloud/elasticsearch.py @@ -491,6 +491,20 @@ def __init__(__self__, """ Manages an Elasticsearch in Elastic Cloud. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="West Europe") + test_elasticsearch = azure.elasticcloud.Elasticsearch("testElasticsearch", + resource_group_name=test_resource_group.name, + location=test_resource_group.location, + sku_name="ess-monthly-consumption_Monthly", + elastic_cloud_email_address="user@example.com") + ``` + ## Import Elasticsearch's can be imported using the `resource id`, e.g. @@ -519,6 +533,20 @@ def __init__(__self__, """ Manages an Elasticsearch in Elastic Cloud. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="West Europe") + test_elasticsearch = azure.elasticcloud.Elasticsearch("testElasticsearch", + resource_group_name=test_resource_group.name, + location=test_resource_group.location, + sku_name="ess-monthly-consumption_Monthly", + elastic_cloud_email_address="user@example.com") + ``` + ## Import Elasticsearch's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/elasticcloud/get_elasticsearch.py b/sdk/python/pulumi_azure/elasticcloud/get_elasticsearch.py index a084551915..92e541b892 100644 --- a/sdk/python/pulumi_azure/elasticcloud/get_elasticsearch.py +++ b/sdk/python/pulumi_azure/elasticcloud/get_elasticsearch.py @@ -218,6 +218,18 @@ def get_elasticsearch(logs: Optional[Sequence[pulumi.InputType['GetElasticsearch """ Use this data source to access information about an existing Elasticsearch resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.elasticcloud.get_elasticsearch(name="my-elastic-search", + resource_group_name="example-resources") + pulumi.export("elasticsearchEndpoint", example.elasticsearch_service_url) + pulumi.export("kibanaEndpoint", example.kibana_service_url) + ``` + :param Sequence[pulumi.InputType['GetElasticsearchLogArgs']] logs: A `logs` block as defined below. :param str name: The name of the Elasticsearch resource. @@ -256,6 +268,18 @@ def get_elasticsearch_output(logs: Optional[pulumi.Input[Optional[Sequence[pulum """ Use this data source to access information about an existing Elasticsearch resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.elasticcloud.get_elasticsearch(name="my-elastic-search", + resource_group_name="example-resources") + pulumi.export("elasticsearchEndpoint", example.elasticsearch_service_url) + pulumi.export("kibanaEndpoint", example.kibana_service_url) + ``` + :param Sequence[pulumi.InputType['GetElasticsearchLogArgs']] logs: A `logs` block as defined below. :param str name: The name of the Elasticsearch resource. diff --git a/sdk/python/pulumi_azure/eventgrid/domain.py b/sdk/python/pulumi_azure/eventgrid/domain.py index 72afd17add..a70b775235 100644 --- a/sdk/python/pulumi_azure/eventgrid/domain.py +++ b/sdk/python/pulumi_azure/eventgrid/domain.py @@ -632,6 +632,21 @@ def __init__(__self__, """ Manages an EventGrid Domain + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_domain = azure.eventgrid.Domain("exampleDomain", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Domains can be imported using the `resource id`, e.g. @@ -665,6 +680,21 @@ def __init__(__self__, """ Manages an EventGrid Domain + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_domain = azure.eventgrid.Domain("exampleDomain", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventgrid/domain_topic.py b/sdk/python/pulumi_azure/eventgrid/domain_topic.py index 7239461e4f..2d886b2583 100644 --- a/sdk/python/pulumi_azure/eventgrid/domain_topic.py +++ b/sdk/python/pulumi_azure/eventgrid/domain_topic.py @@ -175,6 +175,24 @@ def __init__(__self__, """ Manages an EventGrid Domain Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_domain = azure.eventgrid.Domain("exampleDomain", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + example_domain_topic = azure.eventgrid.DomainTopic("exampleDomainTopic", + domain_name=example_domain.name, + resource_group_name=example_resource_group.name) + ``` + ## Import EventGrid Domain Topics can be imported using the `resource id`, e.g. @@ -198,6 +216,24 @@ def __init__(__self__, """ Manages an EventGrid Domain Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_domain = azure.eventgrid.Domain("exampleDomain", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + example_domain_topic = azure.eventgrid.DomainTopic("exampleDomainTopic", + domain_name=example_domain.name, + resource_group_name=example_resource_group.name) + ``` + ## Import EventGrid Domain Topics can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventgrid/event_subscription.py b/sdk/python/pulumi_azure/eventgrid/event_subscription.py index 426dada844..2a55165626 100644 --- a/sdk/python/pulumi_azure/eventgrid/event_subscription.py +++ b/sdk/python/pulumi_azure/eventgrid/event_subscription.py @@ -922,6 +922,30 @@ def __init__(__self__, """ Manages an EventGrid Event Subscription + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + example_event_subscription = azure.eventgrid.EventSubscription("exampleEventSubscription", + scope=example_resource_group.id, + storage_queue_endpoint=azure.eventgrid.EventSubscriptionStorageQueueEndpointArgs( + storage_account_id=example_account.id, + queue_name=example_queue.name, + )) + ``` + ## Import EventGrid Event Subscription's can be imported using the `resource id`, e.g. @@ -967,6 +991,30 @@ def __init__(__self__, """ Manages an EventGrid Event Subscription + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + example_event_subscription = azure.eventgrid.EventSubscription("exampleEventSubscription", + scope=example_resource_group.id, + storage_queue_endpoint=azure.eventgrid.EventSubscriptionStorageQueueEndpointArgs( + storage_account_id=example_account.id, + queue_name=example_queue.name, + )) + ``` + ## Import EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventgrid/get_domain.py b/sdk/python/pulumi_azure/eventgrid/get_domain.py index a0ed73d210..1487f08b75 100644 --- a/sdk/python/pulumi_azure/eventgrid/get_domain.py +++ b/sdk/python/pulumi_azure/eventgrid/get_domain.py @@ -201,6 +201,17 @@ def get_domain(name: Optional[str] = None, """ Use this data source to access information about an existing EventGrid Domain + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_domain(name="my-eventgrid-domain", + resource_group_name="example-resources") + pulumi.export("eventgridDomainMappingTopic", example.input_mapping_fields[0].topic) + ``` + :param str name: The name of the EventGrid Domain resource. :param str resource_group_name: The name of the resource group in which the EventGrid Domain exists. @@ -235,6 +246,17 @@ def get_domain_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventGrid Domain + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_domain(name="my-eventgrid-domain", + resource_group_name="example-resources") + pulumi.export("eventgridDomainMappingTopic", example.input_mapping_fields[0].topic) + ``` + :param str name: The name of the EventGrid Domain resource. :param str resource_group_name: The name of the resource group in which the EventGrid Domain exists. diff --git a/sdk/python/pulumi_azure/eventgrid/get_domain_topic.py b/sdk/python/pulumi_azure/eventgrid/get_domain_topic.py index 1802dd6725..d71c36ed04 100644 --- a/sdk/python/pulumi_azure/eventgrid/get_domain_topic.py +++ b/sdk/python/pulumi_azure/eventgrid/get_domain_topic.py @@ -81,6 +81,16 @@ def get_domain_topic(domain_name: Optional[str] = None, """ Use this data source to access information about an existing EventGrid Domain Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_domain_topic(name="my-eventgrid-domain-topic", + resource_group_name="example-resources") + ``` + :param str domain_name: The name of the EventGrid Domain Topic domain. :param str name: The name of the EventGrid Domain Topic resource. @@ -108,6 +118,16 @@ def get_domain_topic_output(domain_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventGrid Domain Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_domain_topic(name="my-eventgrid-domain-topic", + resource_group_name="example-resources") + ``` + :param str domain_name: The name of the EventGrid Domain Topic domain. :param str name: The name of the EventGrid Domain Topic resource. diff --git a/sdk/python/pulumi_azure/eventgrid/get_system_topic.py b/sdk/python/pulumi_azure/eventgrid/get_system_topic.py index 1efda8bd8e..1d78b4dcee 100644 --- a/sdk/python/pulumi_azure/eventgrid/get_system_topic.py +++ b/sdk/python/pulumi_azure/eventgrid/get_system_topic.py @@ -138,6 +138,16 @@ def get_system_topic(name: Optional[str] = None, """ Use this data source to access information about an existing EventGrid System Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_system_topic(name="eventgrid-system-topic", + resource_group_name="example-resources") + ``` + :param str name: The name of the EventGrid System Topic resource. :param str resource_group_name: The name of the resource group in which the EventGrid System Topic exists. @@ -167,6 +177,16 @@ def get_system_topic_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventGrid System Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_system_topic(name="eventgrid-system-topic", + resource_group_name="example-resources") + ``` + :param str name: The name of the EventGrid System Topic resource. :param str resource_group_name: The name of the resource group in which the EventGrid System Topic exists. diff --git a/sdk/python/pulumi_azure/eventgrid/get_topic.py b/sdk/python/pulumi_azure/eventgrid/get_topic.py index c7aa247984..8431f2a504 100644 --- a/sdk/python/pulumi_azure/eventgrid/get_topic.py +++ b/sdk/python/pulumi_azure/eventgrid/get_topic.py @@ -122,6 +122,16 @@ def get_topic(name: Optional[str] = None, """ Use this data source to access information about an existing EventGrid Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_topic(name="my-eventgrid-topic", + resource_group_name="example-resources") + ``` + :param str name: The name of the EventGrid Topic resource. :param str resource_group_name: The name of the resource group in which the EventGrid Topic exists. @@ -150,6 +160,16 @@ def get_topic_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventGrid Topic + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventgrid.get_topic(name="my-eventgrid-topic", + resource_group_name="example-resources") + ``` + :param str name: The name of the EventGrid Topic resource. :param str resource_group_name: The name of the resource group in which the EventGrid Topic exists. diff --git a/sdk/python/pulumi_azure/eventgrid/system_topic.py b/sdk/python/pulumi_azure/eventgrid/system_topic.py index 4751f9a02f..aae2ba9ccf 100644 --- a/sdk/python/pulumi_azure/eventgrid/system_topic.py +++ b/sdk/python/pulumi_azure/eventgrid/system_topic.py @@ -366,6 +366,28 @@ def __init__(__self__, """ Manages an Event Grid System Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_system_topic = azure.eventgrid.SystemTopic("exampleSystemTopic", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + source_arm_resource_id=example_account.id, + topic_type="Microsoft.Storage.StorageAccounts") + ``` + ## Import Event Grid System Topic can be imported using the `resource id`, e.g. @@ -397,6 +419,28 @@ def __init__(__self__, """ Manages an Event Grid System Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_system_topic = azure.eventgrid.SystemTopic("exampleSystemTopic", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + source_arm_resource_id=example_account.id, + topic_type="Microsoft.Storage.StorageAccounts") + ``` + ## Import Event Grid System Topic can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventgrid/system_topic_event_subscription.py b/sdk/python/pulumi_azure/eventgrid/system_topic_event_subscription.py index fc902f629a..52d184b120 100644 --- a/sdk/python/pulumi_azure/eventgrid/system_topic_event_subscription.py +++ b/sdk/python/pulumi_azure/eventgrid/system_topic_event_subscription.py @@ -968,6 +968,36 @@ def __init__(__self__, """ Manages an EventGrid System Topic Event Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + example_system_topic = azure.eventgrid.SystemTopic("exampleSystemTopic", + location="Global", + resource_group_name=example_resource_group.name, + source_arm_resource_id=example_resource_group.id, + topic_type="Microsoft.Resources.ResourceGroups") + example_system_topic_event_subscription = azure.eventgrid.SystemTopicEventSubscription("exampleSystemTopicEventSubscription", + system_topic=example_system_topic.name, + resource_group_name=example_resource_group.name, + storage_queue_endpoint=azure.eventgrid.SystemTopicEventSubscriptionStorageQueueEndpointArgs( + storage_account_id=example_account.id, + queue_name=example_queue.name, + )) + ``` + ## Import EventGrid System Topic Event Subscriptions can be imported using the `resource id`, e.g. @@ -1014,6 +1044,36 @@ def __init__(__self__, """ Manages an EventGrid System Topic Event Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + example_system_topic = azure.eventgrid.SystemTopic("exampleSystemTopic", + location="Global", + resource_group_name=example_resource_group.name, + source_arm_resource_id=example_resource_group.id, + topic_type="Microsoft.Resources.ResourceGroups") + example_system_topic_event_subscription = azure.eventgrid.SystemTopicEventSubscription("exampleSystemTopicEventSubscription", + system_topic=example_system_topic.name, + resource_group_name=example_resource_group.name, + storage_queue_endpoint=azure.eventgrid.SystemTopicEventSubscriptionStorageQueueEndpointArgs( + storage_account_id=example_account.id, + queue_name=example_queue.name, + )) + ``` + ## Import EventGrid System Topic Event Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventgrid/topic.py b/sdk/python/pulumi_azure/eventgrid/topic.py index 55125f00af..4a94b78bb4 100644 --- a/sdk/python/pulumi_azure/eventgrid/topic.py +++ b/sdk/python/pulumi_azure/eventgrid/topic.py @@ -552,6 +552,21 @@ def __init__(__self__, > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Topic's can be imported using the `resource id`, e.g. @@ -585,6 +600,21 @@ def __init__(__self__, > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/authorization_rule.py b/sdk/python/pulumi_azure/eventhub/authorization_rule.py index b4287d564c..4af255d435 100644 --- a/sdk/python/pulumi_azure/eventhub/authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/authorization_rule.py @@ -456,6 +456,35 @@ def __init__(__self__, """ Manages a Event Hubs authorization Rule within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + ``` + ## Import EventHub Authorization Rules can be imported using the `resource id`, e.g. @@ -485,6 +514,35 @@ def __init__(__self__, """ Manages a Event Hubs authorization Rule within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + ``` + ## Import EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/cluster.py b/sdk/python/pulumi_azure/eventhub/cluster.py index 99264ea2e1..2d3342c193 100644 --- a/sdk/python/pulumi_azure/eventhub/cluster.py +++ b/sdk/python/pulumi_azure/eventhub/cluster.py @@ -249,6 +249,19 @@ def __init__(__self__, """ Manages an EventHub Cluster + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test = azure.eventhub.Cluster("test", + resource_group_name=example.name, + location=example.location, + sku_name="Dedicated_1") + ``` + ## Import EventHub Cluster's can be imported using the `resource id`, e.g. @@ -274,6 +287,19 @@ def __init__(__self__, """ Manages an EventHub Cluster + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test = azure.eventhub.Cluster("test", + resource_group_name=example.name, + location=example.location, + sku_name="Dedicated_1") + ``` + ## Import EventHub Cluster's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/consumer_group.py b/sdk/python/pulumi_azure/eventhub/consumer_group.py index 86b31d974d..cce159ed59 100644 --- a/sdk/python/pulumi_azure/eventhub/consumer_group.py +++ b/sdk/python/pulumi_azure/eventhub/consumer_group.py @@ -258,6 +258,33 @@ def __init__(__self__, """ Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + user_metadata="some-meta-data") + ``` + ## Import EventHub Consumer Groups can be imported using the `resource id`, e.g. @@ -283,6 +310,33 @@ def __init__(__self__, """ Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + user_metadata="some-meta-data") + ``` + ## Import EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/domain.py b/sdk/python/pulumi_azure/eventhub/domain.py index 7254bef697..f02fb73f5b 100644 --- a/sdk/python/pulumi_azure/eventhub/domain.py +++ b/sdk/python/pulumi_azure/eventhub/domain.py @@ -637,6 +637,21 @@ def __init__(__self__, """ Manages an EventGrid Domain + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_domain = azure.eventgrid.Domain("exampleDomain", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Domains can be imported using the `resource id`, e.g. @@ -670,6 +685,21 @@ def __init__(__self__, """ Manages an EventGrid Domain + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_domain = azure.eventgrid.Domain("exampleDomain", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Domains can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/event_grid_topic.py b/sdk/python/pulumi_azure/eventhub/event_grid_topic.py index 92f7f49e57..f66667b6cb 100644 --- a/sdk/python/pulumi_azure/eventhub/event_grid_topic.py +++ b/sdk/python/pulumi_azure/eventhub/event_grid_topic.py @@ -557,6 +557,21 @@ def __init__(__self__, > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Topic's can be imported using the `resource id`, e.g. @@ -590,6 +605,21 @@ def __init__(__self__, > **Note:** at this time EventGrid Topic's are only available in a limited number of regions. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_topic = azure.eventgrid.Topic("exampleTopic", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import EventGrid Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/event_hub.py b/sdk/python/pulumi_azure/eventhub/event_hub.py index 3c592ffe77..211d4ef120 100644 --- a/sdk/python/pulumi_azure/eventhub/event_hub.py +++ b/sdk/python/pulumi_azure/eventhub/event_hub.py @@ -383,6 +383,28 @@ def __init__(__self__, """ Manages a Event Hubs as a nested resource within a Event Hubs namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + ``` + ## Import EventHubs can be imported using the `resource id`, e.g. @@ -416,6 +438,28 @@ def __init__(__self__, """ Manages a Event Hubs as a nested resource within a Event Hubs namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + ``` + ## Import EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/event_hub_authorization_rule.py b/sdk/python/pulumi_azure/eventhub/event_hub_authorization_rule.py index 8c2f4b35bf..3f5f6448e8 100644 --- a/sdk/python/pulumi_azure/eventhub/event_hub_authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/event_hub_authorization_rule.py @@ -461,6 +461,35 @@ def __init__(__self__, """ Manages a Event Hubs authorization Rule within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + ``` + ## Import EventHub Authorization Rules can be imported using the `resource id`, e.g. @@ -490,6 +519,35 @@ def __init__(__self__, """ Manages a Event Hubs authorization Rule within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + ``` + ## Import EventHub Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/event_hub_consumer_group.py b/sdk/python/pulumi_azure/eventhub/event_hub_consumer_group.py index 25fe7dd6bc..c5900ab430 100644 --- a/sdk/python/pulumi_azure/eventhub/event_hub_consumer_group.py +++ b/sdk/python/pulumi_azure/eventhub/event_hub_consumer_group.py @@ -263,6 +263,33 @@ def __init__(__self__, """ Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + user_metadata="some-meta-data") + ``` + ## Import EventHub Consumer Groups can be imported using the `resource id`, e.g. @@ -288,6 +315,33 @@ def __init__(__self__, """ Manages a Event Hubs Consumer Group as a nested resource within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + user_metadata="some-meta-data") + ``` + ## Import EventHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/event_hub_namespace.py b/sdk/python/pulumi_azure/eventhub/event_hub_namespace.py index 1de30fff7e..6b126926f2 100644 --- a/sdk/python/pulumi_azure/eventhub/event_hub_namespace.py +++ b/sdk/python/pulumi_azure/eventhub/event_hub_namespace.py @@ -777,6 +777,23 @@ def __init__(__self__, """ Manages an EventHub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=2, + tags={ + "environment": "Production", + }) + ``` + ## Import EventHub Namespaces can be imported using the `resource id`, e.g. @@ -814,6 +831,23 @@ def __init__(__self__, """ Manages an EventHub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=2, + tags={ + "environment": "Production", + }) + ``` + ## Import EventHub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/event_hub_namespace_authorization_rule.py b/sdk/python/pulumi_azure/eventhub/event_hub_namespace_authorization_rule.py index 20f42885a2..31278ff52d 100644 --- a/sdk/python/pulumi_azure/eventhub/event_hub_namespace_authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/event_hub_namespace_authorization_rule.py @@ -414,6 +414,29 @@ def __init__(__self__, """ Manages an Authorization Rule for an Event Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub_namespace_authorization_rule = azure.eventhub.EventHubNamespaceAuthorizationRule("exampleEventHubNamespaceAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + ``` + ## Import EventHub Namespace Authorization Rules can be imported using the `resource id`, e.g. @@ -442,6 +465,29 @@ def __init__(__self__, """ Manages an Authorization Rule for an Event Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic", + capacity=2, + tags={ + "environment": "Production", + }) + example_event_hub_namespace_authorization_rule = azure.eventhub.EventHubNamespaceAuthorizationRule("exampleEventHubNamespaceAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + ``` + ## Import EventHub Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/event_subscription.py b/sdk/python/pulumi_azure/eventhub/event_subscription.py index 638885606d..e14d0d6bf3 100644 --- a/sdk/python/pulumi_azure/eventhub/event_subscription.py +++ b/sdk/python/pulumi_azure/eventhub/event_subscription.py @@ -927,6 +927,30 @@ def __init__(__self__, """ Manages an EventGrid Event Subscription + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + example_event_subscription = azure.eventgrid.EventSubscription("exampleEventSubscription", + scope=example_resource_group.id, + storage_queue_endpoint=azure.eventgrid.EventSubscriptionStorageQueueEndpointArgs( + storage_account_id=example_account.id, + queue_name=example_queue.name, + )) + ``` + ## Import EventGrid Event Subscription's can be imported using the `resource id`, e.g. @@ -972,6 +996,30 @@ def __init__(__self__, """ Manages an EventGrid Event Subscription + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + example_event_subscription = azure.eventgrid.EventSubscription("exampleEventSubscription", + scope=example_resource_group.id, + storage_queue_endpoint=azure.eventgrid.EventSubscriptionStorageQueueEndpointArgs( + storage_account_id=example_account.id, + queue_name=example_queue.name, + )) + ``` + ## Import EventGrid Event Subscription's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/eventhub_namespace_disaster_recovery_config.py b/sdk/python/pulumi_azure/eventhub/eventhub_namespace_disaster_recovery_config.py index 7f31584fa7..72f5ed878a 100644 --- a/sdk/python/pulumi_azure/eventhub/eventhub_namespace_disaster_recovery_config.py +++ b/sdk/python/pulumi_azure/eventhub/eventhub_namespace_disaster_recovery_config.py @@ -217,6 +217,27 @@ def __init__(__self__, """ Manages an Disaster Recovery Config for an Event Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.eventhub.EventHubNamespace("primary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + secondary = azure.eventhub.EventHubNamespace("secondary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_eventhub_namespace_disaster_recovery_config = azure.eventhub.EventhubNamespaceDisasterRecoveryConfig("exampleEventhubNamespaceDisasterRecoveryConfig", + resource_group_name=example_resource_group.name, + namespace_name=primary.name, + partner_namespace_id=secondary.id) + ``` + ## Import EventHubs can be imported using the `resource id`, e.g. @@ -241,6 +262,27 @@ def __init__(__self__, """ Manages an Disaster Recovery Config for an Event Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.eventhub.EventHubNamespace("primary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + secondary = azure.eventhub.EventHubNamespace("secondary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_eventhub_namespace_disaster_recovery_config = azure.eventhub.EventhubNamespaceDisasterRecoveryConfig("exampleEventhubNamespaceDisasterRecoveryConfig", + resource_group_name=example_resource_group.name, + namespace_name=primary.name, + partner_namespace_id=secondary.id) + ``` + ## Import EventHubs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/get_authorization_rule.py b/sdk/python/pulumi_azure/eventhub/get_authorization_rule.py index e084594f09..26557f4fac 100644 --- a/sdk/python/pulumi_azure/eventhub/get_authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/get_authorization_rule.py @@ -190,6 +190,18 @@ def get_authorization_rule(eventhub_name: Optional[str] = None, """ Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.eventhub.get_authorization_rule(name="test", + namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test"]["name"], + resource_group_name=azurerm_resource_group["test"]["name"]) + ``` + :param str eventhub_name: Specifies the name of the EventHub. :param str name: Specifies the name of the EventHub Authorization Rule resource. be created. @@ -236,6 +248,18 @@ def get_authorization_rule_output(eventhub_name: Optional[pulumi.Input[str]] = N """ Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.eventhub.get_authorization_rule(name="test", + namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test"]["name"], + resource_group_name=azurerm_resource_group["test"]["name"]) + ``` + :param str eventhub_name: Specifies the name of the EventHub. :param str name: Specifies the name of the EventHub Authorization Rule resource. be created. diff --git a/sdk/python/pulumi_azure/eventhub/get_cluster.py b/sdk/python/pulumi_azure/eventhub/get_cluster.py index c7063c0b7c..6220ade2c3 100644 --- a/sdk/python/pulumi_azure/eventhub/get_cluster.py +++ b/sdk/python/pulumi_azure/eventhub/get_cluster.py @@ -92,6 +92,17 @@ def get_cluster(name: Optional[str] = None, """ Use this data source to access information about an existing EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_cluster(name="search-eventhub", + resource_group_name="search-service") + pulumi.export("eventhubId", example.id) + ``` + :param str name: The name of this EventHub Cluster. :param str resource_group_name: The name of the Resource Group where the EventHub Cluster exists. @@ -117,6 +128,17 @@ def get_cluster_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_cluster(name="search-eventhub", + resource_group_name="search-service") + pulumi.export("eventhubId", example.id) + ``` + :param str name: The name of this EventHub Cluster. :param str resource_group_name: The name of the Resource Group where the EventHub Cluster exists. diff --git a/sdk/python/pulumi_azure/eventhub/get_consume_group.py b/sdk/python/pulumi_azure/eventhub/get_consume_group.py index c601b8b9a3..a19a15b96f 100644 --- a/sdk/python/pulumi_azure/eventhub/get_consume_group.py +++ b/sdk/python/pulumi_azure/eventhub/get_consume_group.py @@ -100,6 +100,18 @@ def get_consume_group(eventhub_name: Optional[str] = None, """ Use this data source to access information about an existing Event Hubs Consumer Group within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.eventhub.get_consume_group(name=azurerm_eventhub_consumer_group["test"]["name"], + namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test"]["name"], + resource_group_name=azurerm_resource_group["test"]["name"]) + ``` + :param str eventhub_name: Specifies the name of the EventHub. :param str name: Specifies the name of the EventHub Consumer Group resource. @@ -132,6 +144,18 @@ def get_consume_group_output(eventhub_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Event Hubs Consumer Group within an Event Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.eventhub.get_consume_group(name=azurerm_eventhub_consumer_group["test"]["name"], + namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test"]["name"], + resource_group_name=azurerm_resource_group["test"]["name"]) + ``` + :param str eventhub_name: Specifies the name of the EventHub. :param str name: Specifies the name of the EventHub Consumer Group resource. diff --git a/sdk/python/pulumi_azure/eventhub/get_event_hub.py b/sdk/python/pulumi_azure/eventhub/get_event_hub.py index 408cac976f..526448355d 100644 --- a/sdk/python/pulumi_azure/eventhub/get_event_hub.py +++ b/sdk/python/pulumi_azure/eventhub/get_event_hub.py @@ -102,6 +102,18 @@ def get_event_hub(name: Optional[str] = None, """ Use this data source to access information about an existing EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_event_hub(name="search-eventhub", + resource_group_name="search-service", + namespace_name="search-eventhubns") + pulumi.export("eventhubId", example.id) + ``` + :param str name: The name of this EventHub. :param str namespace_name: The name of the EventHub Namespace where the EventHub exists. @@ -131,6 +143,18 @@ def get_event_hub_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_event_hub(name="search-eventhub", + resource_group_name="search-service", + namespace_name="search-eventhubns") + pulumi.export("eventhubId", example.id) + ``` + :param str name: The name of this EventHub. :param str namespace_name: The name of the EventHub Namespace where the EventHub exists. diff --git a/sdk/python/pulumi_azure/eventhub/get_eventhub_namespace.py b/sdk/python/pulumi_azure/eventhub/get_eventhub_namespace.py index 8bcdbccf9b..fc9d020f36 100644 --- a/sdk/python/pulumi_azure/eventhub/get_eventhub_namespace.py +++ b/sdk/python/pulumi_azure/eventhub/get_eventhub_namespace.py @@ -251,6 +251,17 @@ def get_eventhub_namespace(name: Optional[str] = None, """ Use this data source to access information about an existing EventHub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_namespace(name="search-eventhubns", + resource_group_name="search-service") + pulumi.export("eventhubNamespaceId", example.id) + ``` + :param str name: The name of the EventHub Namespace. :param str resource_group_name: The Name of the Resource Group where the EventHub Namespace exists. @@ -290,6 +301,17 @@ def get_eventhub_namespace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventHub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_namespace(name="search-eventhubns", + resource_group_name="search-service") + pulumi.export("eventhubNamespaceId", example.id) + ``` + :param str name: The name of the EventHub Namespace. :param str resource_group_name: The Name of the Resource Group where the EventHub Namespace exists. diff --git a/sdk/python/pulumi_azure/eventhub/get_namespace.py b/sdk/python/pulumi_azure/eventhub/get_namespace.py index cb0b1d7a49..0344f8fcb3 100644 --- a/sdk/python/pulumi_azure/eventhub/get_namespace.py +++ b/sdk/python/pulumi_azure/eventhub/get_namespace.py @@ -249,6 +249,17 @@ def get_namespace(name: Optional[str] = None, """ Use this data source to access information about an existing EventHub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_namespace(name="search-eventhubns", + resource_group_name="search-service") + pulumi.export("eventhubNamespaceId", example.id) + ``` + :param str name: The name of the EventHub Namespace. :param str resource_group_name: The Name of the Resource Group where the EventHub Namespace exists. @@ -287,6 +298,17 @@ def get_namespace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing EventHub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_namespace(name="search-eventhubns", + resource_group_name="search-service") + pulumi.export("eventhubNamespaceId", example.id) + ``` + :param str name: The name of the EventHub Namespace. :param str resource_group_name: The Name of the Resource Group where the EventHub Namespace exists. diff --git a/sdk/python/pulumi_azure/eventhub/get_namespace_authorization_rule.py b/sdk/python/pulumi_azure/eventhub/get_namespace_authorization_rule.py index 52b37d0381..aa9321acec 100644 --- a/sdk/python/pulumi_azure/eventhub/get_namespace_authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/get_namespace_authorization_rule.py @@ -186,6 +186,18 @@ def get_namespace_authorization_rule(name: Optional[str] = None, """ Use this data source to access information about an Authorization Rule for an Event Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_namespace_authorization_rule(name="navi", + resource_group_name="example-resources", + namespace_name="example-ns") + pulumi.export("eventhubAuthorizationRuleId", data["azurem_eventhub_namespace_authorization_rule"]["example"]["id"]) + ``` + :param str name: The name of the EventHub Authorization Rule resource. :param str namespace_name: Specifies the name of the EventHub Namespace. @@ -222,6 +234,18 @@ def get_namespace_authorization_rule_output(name: Optional[pulumi.Input[str]] = """ Use this data source to access information about an Authorization Rule for an Event Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.eventhub.get_namespace_authorization_rule(name="navi", + resource_group_name="example-resources", + namespace_name="example-ns") + pulumi.export("eventhubAuthorizationRuleId", data["azurem_eventhub_namespace_authorization_rule"]["example"]["id"]) + ``` + :param str name: The name of the EventHub Authorization Rule resource. :param str namespace_name: Specifies the name of the EventHub Namespace. diff --git a/sdk/python/pulumi_azure/eventhub/get_service_bus_namespace.py b/sdk/python/pulumi_azure/eventhub/get_service_bus_namespace.py index 3efad5990a..444a44bd23 100644 --- a/sdk/python/pulumi_azure/eventhub/get_service_bus_namespace.py +++ b/sdk/python/pulumi_azure/eventhub/get_service_bus_namespace.py @@ -192,6 +192,17 @@ def get_service_bus_namespace(name: Optional[str] = None, """ Use this data source to access information about an existing ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_namespace(name="examplenamespace", + resource_group_name="example-resources") + pulumi.export("location", example.location) + ``` + :param str name: Specifies the name of the ServiceBus Namespace. :param str resource_group_name: Specifies the name of the Resource Group where the ServiceBus Namespace exists. @@ -226,6 +237,17 @@ def get_service_bus_namespace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_namespace(name="examplenamespace", + resource_group_name="example-resources") + pulumi.export("location", example.location) + ``` + :param str name: Specifies the name of the ServiceBus Namespace. :param str resource_group_name: Specifies the name of the Resource Group where the ServiceBus Namespace exists. diff --git a/sdk/python/pulumi_azure/eventhub/namespace.py b/sdk/python/pulumi_azure/eventhub/namespace.py index 1747c3872e..fb47f046cd 100644 --- a/sdk/python/pulumi_azure/eventhub/namespace.py +++ b/sdk/python/pulumi_azure/eventhub/namespace.py @@ -674,6 +674,22 @@ def __init__(__self__, """ Manages a ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + ``` + ## Import Service Bus Namespace can be imported using the `resource id`, e.g. @@ -708,6 +724,22 @@ def __init__(__self__, """ Manages a ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + ``` + ## Import Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/namespace_authorization_rule.py b/sdk/python/pulumi_azure/eventhub/namespace_authorization_rule.py index 1c86bbfa00..3110a443c6 100644 --- a/sdk/python/pulumi_azure/eventhub/namespace_authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/namespace_authorization_rule.py @@ -377,6 +377,27 @@ def __init__(__self__, """ Manages a ServiceBus Namespace authorization Rule within a ServiceBus. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + namespace_id=example_namespace.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. @@ -404,6 +425,27 @@ def __init__(__self__, """ Manages a ServiceBus Namespace authorization Rule within a ServiceBus. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + namespace_id=example_namespace.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/namespace_customer_managed_key.py b/sdk/python/pulumi_azure/eventhub/namespace_customer_managed_key.py index 551dafad3d..4f9c1cd63f 100644 --- a/sdk/python/pulumi_azure/eventhub/namespace_customer_managed_key.py +++ b/sdk/python/pulumi_azure/eventhub/namespace_customer_managed_key.py @@ -181,6 +181,75 @@ def __init__(__self__, !> **Note:** In 2.x versions of the Azure Provider during deletion this resource will **delete and recreate the parent EventHub Namespace which may involve data loss** as it's not possible to remove the Customer Managed Key from the EventHub Namespace once it's been added. Version 3.0 of the Azure Provider will change this so that the Delete operation is a noop, requiring the parent EventHub Namespace is deleted/recreated to remove the Customer Managed Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.eventhub.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Dedicated_1") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + dedicated_cluster_id=example_cluster.id, + identity=azure.eventhub.EventHubNamespaceIdentityArgs( + type="SystemAssigned", + )) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_event_hub_namespace.identity.tenant_id, + object_id=example_event_hub_namespace.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ]) + example2 = azure.keyvault.AccessPolicy("example2", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + example_access_policy, + example2, + ])) + example_namespace_customer_managed_key = azure.eventhub.NamespaceCustomerManagedKey("exampleNamespaceCustomerManagedKey", + eventhub_namespace_id=example_event_hub_namespace.id, + key_vault_key_ids=[example_key.id]) + ``` + ## Import Customer Managed Keys for a EventHub Namespace can be imported using the `resource id`, e.g. @@ -206,6 +275,75 @@ def __init__(__self__, !> **Note:** In 2.x versions of the Azure Provider during deletion this resource will **delete and recreate the parent EventHub Namespace which may involve data loss** as it's not possible to remove the Customer Managed Key from the EventHub Namespace once it's been added. Version 3.0 of the Azure Provider will change this so that the Delete operation is a noop, requiring the parent EventHub Namespace is deleted/recreated to remove the Customer Managed Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.eventhub.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Dedicated_1") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + dedicated_cluster_id=example_cluster.id, + identity=azure.eventhub.EventHubNamespaceIdentityArgs( + type="SystemAssigned", + )) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_event_hub_namespace.identity.tenant_id, + object_id=example_event_hub_namespace.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ]) + example2 = azure.keyvault.AccessPolicy("example2", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + example_access_policy, + example2, + ])) + example_namespace_customer_managed_key = azure.eventhub.NamespaceCustomerManagedKey("exampleNamespaceCustomerManagedKey", + eventhub_namespace_id=example_event_hub_namespace.id, + key_vault_key_ids=[example_key.id]) + ``` + ## Import Customer Managed Keys for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/namespace_schema_group.py b/sdk/python/pulumi_azure/eventhub/namespace_schema_group.py index 0f748c162c..acd368817e 100644 --- a/sdk/python/pulumi_azure/eventhub/namespace_schema_group.py +++ b/sdk/python/pulumi_azure/eventhub/namespace_schema_group.py @@ -215,6 +215,23 @@ def __init__(__self__, schema_type: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="East US") + test_event_hub_namespace = azure.eventhub.EventHubNamespace("testEventHubNamespace", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku="Standard") + test_namespace_schema_group = azure.eventhub.NamespaceSchemaGroup("testNamespaceSchemaGroup", + namespace_id=test_event_hub_namespace.id, + schema_compatibility="Forward", + schema_type="Avro") + ``` + ## Import Schema Group for a EventHub Namespace can be imported using the `resource id`, e.g. @@ -237,6 +254,23 @@ def __init__(__self__, args: NamespaceSchemaGroupArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="East US") + test_event_hub_namespace = azure.eventhub.EventHubNamespace("testEventHubNamespace", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku="Standard") + test_namespace_schema_group = azure.eventhub.NamespaceSchemaGroup("testNamespaceSchemaGroup", + namespace_id=test_event_hub_namespace.id, + schema_compatibility="Forward", + schema_type="Avro") + ``` + ## Import Schema Group for a EventHub Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/queue.py b/sdk/python/pulumi_azure/eventhub/queue.py index f92b2cb1ec..02d10a4d4d 100644 --- a/sdk/python/pulumi_azure/eventhub/queue.py +++ b/sdk/python/pulumi_azure/eventhub/queue.py @@ -838,6 +838,25 @@ def __init__(__self__, """ Manages a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Queue can be imported using the `resource id`, e.g. @@ -880,6 +899,25 @@ def __init__(__self__, """ Manages a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/queue_authorization_rule.py b/sdk/python/pulumi_azure/eventhub/queue_authorization_rule.py index 1b5456c882..d9592ce5ea 100644 --- a/sdk/python/pulumi_azure/eventhub/queue_authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/queue_authorization_rule.py @@ -377,6 +377,30 @@ def __init__(__self__, """ Manages an Authorization Rule for a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_queue_authorization_rule = azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", + queue_id=example_queue.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. @@ -404,6 +428,30 @@ def __init__(__self__, """ Manages an Authorization Rule for a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_queue_authorization_rule = azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", + queue_id=example_queue.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/subscription.py b/sdk/python/pulumi_azure/eventhub/subscription.py index 6a65053b5d..3402020d6a 100644 --- a/sdk/python/pulumi_azure/eventhub/subscription.py +++ b/sdk/python/pulumi_azure/eventhub/subscription.py @@ -678,6 +678,28 @@ def __init__(__self__, """ Manages a ServiceBus Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + ``` + ## Import Service Bus Subscriptions can be imported using the `resource id`, e.g. @@ -715,6 +737,28 @@ def __init__(__self__, """ Manages a ServiceBus Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + ``` + ## Import Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/subscription_rule.py b/sdk/python/pulumi_azure/eventhub/subscription_rule.py index 37804bfa02..8c181a1eee 100644 --- a/sdk/python/pulumi_azure/eventhub/subscription_rule.py +++ b/sdk/python/pulumi_azure/eventhub/subscription_rule.py @@ -318,6 +318,62 @@ def __init__(__self__, Manages a ServiceBus Subscription Rule. ## Example Usage + ### SQL Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="SqlFilter", + sql_filter="colour = 'red'") + ``` + ### Correlation Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="CorrelationFilter", + correlation_filter=azure.servicebus.SubscriptionRuleCorrelationFilterArgs( + correlation_id="high", + label="red", + properties={ + "customProperty": "value", + }, + )) + ``` ## Import @@ -346,6 +402,62 @@ def __init__(__self__, Manages a ServiceBus Subscription Rule. ## Example Usage + ### SQL Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="SqlFilter", + sql_filter="colour = 'red'") + ``` + ### Correlation Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="CorrelationFilter", + correlation_filter=azure.servicebus.SubscriptionRuleCorrelationFilterArgs( + correlation_id="high", + label="red", + properties={ + "customProperty": "value", + }, + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/eventhub/topic.py b/sdk/python/pulumi_azure/eventhub/topic.py index e03e451bcb..08b23ca7fb 100644 --- a/sdk/python/pulumi_azure/eventhub/topic.py +++ b/sdk/python/pulumi_azure/eventhub/topic.py @@ -639,6 +639,25 @@ def __init__(__self__, **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Topics can be imported using the `resource id`, e.g. @@ -679,6 +698,25 @@ def __init__(__self__, **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/eventhub/topic_authorization_rule.py b/sdk/python/pulumi_azure/eventhub/topic_authorization_rule.py index 93e4fcbd6e..225a6df293 100644 --- a/sdk/python/pulumi_azure/eventhub/topic_authorization_rule.py +++ b/sdk/python/pulumi_azure/eventhub/topic_authorization_rule.py @@ -377,6 +377,28 @@ def __init__(__self__, """ Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=True, + send=False, + manage=False) + ``` + ## Import ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. @@ -404,6 +426,28 @@ def __init__(__self__, """ Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=True, + send=False, + manage=False) + ``` + ## Import ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/fluidrelay/server.py b/sdk/python/pulumi_azure/fluidrelay/server.py index 4838ebfe69..c356d8f062 100644 --- a/sdk/python/pulumi_azure/fluidrelay/server.py +++ b/sdk/python/pulumi_azure/fluidrelay/server.py @@ -407,6 +407,18 @@ def __init__(__self__, """ Manages a Fluid Relay Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.fluidrelay.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Fluid Relay Servers can be imported using the `resource id`, e.g. @@ -433,6 +445,18 @@ def __init__(__self__, """ Manages a Fluid Relay Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.fluidrelay.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Fluid Relay Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/frontdoor/firewall_policy.py b/sdk/python/pulumi_azure/frontdoor/firewall_policy.py index 6d19e7e5f0..9c6ec1c307 100644 --- a/sdk/python/pulumi_azure/frontdoor/firewall_policy.py +++ b/sdk/python/pulumi_azure/frontdoor/firewall_policy.py @@ -487,6 +487,112 @@ def __init__(__self__, tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_firewall_policy = azure.frontdoor.FirewallPolicy("exampleFirewallPolicy", + resource_group_name=example_resource_group.name, + enabled=True, + mode="Prevention", + redirect_url="https://www.contoso.com", + custom_block_response_status_code=403, + custom_block_response_body="PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + custom_rules=[ + azure.frontdoor.FirewallPolicyCustomRuleArgs( + name="Rule1", + enabled=True, + priority=1, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[azure.frontdoor.FirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=[ + "192.168.1.0/24", + "10.0.0.0/24", + ], + )], + ), + azure.frontdoor.FirewallPolicyCustomRuleArgs( + name="Rule2", + enabled=True, + priority=2, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[ + azure.frontdoor.FirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=["192.168.1.0/24"], + ), + azure.frontdoor.FirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RequestHeader", + selector="UserAgent", + operator="Contains", + negation_condition=False, + match_values=["windows"], + transforms=[ + "Lowercase", + "Trim", + ], + ), + ], + ), + ], + managed_rules=[ + azure.frontdoor.FirewallPolicyManagedRuleArgs( + type="DefaultRuleSet", + version="1.0", + exclusions=[azure.frontdoor.FirewallPolicyManagedRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="not_suspicious", + )], + overrides=[ + azure.frontdoor.FirewallPolicyManagedRuleOverrideArgs( + rule_group_name="PHP", + rules=[azure.frontdoor.FirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="933100", + enabled=False, + action="Block", + )], + ), + azure.frontdoor.FirewallPolicyManagedRuleOverrideArgs( + rule_group_name="SQLI", + exclusions=[azure.frontdoor.FirewallPolicyManagedRuleOverrideExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="really_not_suspicious", + )], + rules=[azure.frontdoor.FirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="942200", + action="Block", + exclusions=[azure.frontdoor.FirewallPolicyManagedRuleOverrideRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="innocent", + )], + )], + ), + ], + ), + azure.frontdoor.FirewallPolicyManagedRuleArgs( + type="Microsoft_BotManagerRuleSet", + version="1.0", + ), + ]) + ``` + ## Import FrontDoor Web Application Firewall Policy can be imported using the `resource id`, e.g. @@ -515,6 +621,112 @@ def __init__(__self__, args: FirewallPolicyArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_firewall_policy = azure.frontdoor.FirewallPolicy("exampleFirewallPolicy", + resource_group_name=example_resource_group.name, + enabled=True, + mode="Prevention", + redirect_url="https://www.contoso.com", + custom_block_response_status_code=403, + custom_block_response_body="PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==", + custom_rules=[ + azure.frontdoor.FirewallPolicyCustomRuleArgs( + name="Rule1", + enabled=True, + priority=1, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[azure.frontdoor.FirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=[ + "192.168.1.0/24", + "10.0.0.0/24", + ], + )], + ), + azure.frontdoor.FirewallPolicyCustomRuleArgs( + name="Rule2", + enabled=True, + priority=2, + rate_limit_duration_in_minutes=1, + rate_limit_threshold=10, + type="MatchRule", + action="Block", + match_conditions=[ + azure.frontdoor.FirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RemoteAddr", + operator="IPMatch", + negation_condition=False, + match_values=["192.168.1.0/24"], + ), + azure.frontdoor.FirewallPolicyCustomRuleMatchConditionArgs( + match_variable="RequestHeader", + selector="UserAgent", + operator="Contains", + negation_condition=False, + match_values=["windows"], + transforms=[ + "Lowercase", + "Trim", + ], + ), + ], + ), + ], + managed_rules=[ + azure.frontdoor.FirewallPolicyManagedRuleArgs( + type="DefaultRuleSet", + version="1.0", + exclusions=[azure.frontdoor.FirewallPolicyManagedRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="not_suspicious", + )], + overrides=[ + azure.frontdoor.FirewallPolicyManagedRuleOverrideArgs( + rule_group_name="PHP", + rules=[azure.frontdoor.FirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="933100", + enabled=False, + action="Block", + )], + ), + azure.frontdoor.FirewallPolicyManagedRuleOverrideArgs( + rule_group_name="SQLI", + exclusions=[azure.frontdoor.FirewallPolicyManagedRuleOverrideExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="really_not_suspicious", + )], + rules=[azure.frontdoor.FirewallPolicyManagedRuleOverrideRuleArgs( + rule_id="942200", + action="Block", + exclusions=[azure.frontdoor.FirewallPolicyManagedRuleOverrideRuleExclusionArgs( + match_variable="QueryStringArgNames", + operator="Equals", + selector="innocent", + )], + )], + ), + ], + ), + azure.frontdoor.FirewallPolicyManagedRuleArgs( + type="Microsoft_BotManagerRuleSet", + version="1.0", + ), + ]) + ``` + ## Import FrontDoor Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/frontdoor/frontdoor.py b/sdk/python/pulumi_azure/frontdoor/frontdoor.py index ce5474c355..2f8fc10ef5 100644 --- a/sdk/python/pulumi_azure/frontdoor/frontdoor.py +++ b/sdk/python/pulumi_azure/frontdoor/frontdoor.py @@ -677,6 +677,51 @@ def __init__(__self__, * Use Front Door to improve application performance with SSL offload and routing requests to the fastest available application backend. * Use Front Door for application layer security and DDoS protection for your application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor = azure.frontdoor.Frontdoor("exampleFrontdoor", + resource_group_name=example_resource_group.name, + routing_rules=[azure.frontdoor.FrontdoorRoutingRuleArgs( + name="exampleRoutingRule1", + accepted_protocols=[ + "Http", + "Https", + ], + patterns_to_matches=["/*"], + frontend_endpoints=["exampleFrontendEndpoint1"], + forwarding_configuration=azure.frontdoor.FrontdoorRoutingRuleForwardingConfigurationArgs( + forwarding_protocol="MatchRequest", + backend_pool_name="exampleBackendBing", + ), + )], + backend_pool_load_balancings=[azure.frontdoor.FrontdoorBackendPoolLoadBalancingArgs( + name="exampleLoadBalancingSettings1", + )], + backend_pool_health_probes=[azure.frontdoor.FrontdoorBackendPoolHealthProbeArgs( + name="exampleHealthProbeSetting1", + )], + backend_pools=[azure.frontdoor.FrontdoorBackendPoolArgs( + name="exampleBackendBing", + backends=[azure.frontdoor.FrontdoorBackendPoolBackendArgs( + host_header="www.bing.com", + address="www.bing.com", + http_port=80, + https_port=443, + )], + load_balancing_name="exampleLoadBalancingSettings1", + health_probe_name="exampleHealthProbeSetting1", + )], + frontend_endpoints=[azure.frontdoor.FrontdoorFrontendEndpointArgs( + name="exampleFrontendEndpoint1", + host_name="example-FrontDoor.azurefd.net", + )]) + ``` + ## Import Front Doors can be imported using the `resource id`, e.g. @@ -720,6 +765,51 @@ def __init__(__self__, * Use Front Door to improve application performance with SSL offload and routing requests to the fastest available application backend. * Use Front Door for application layer security and DDoS protection for your application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor = azure.frontdoor.Frontdoor("exampleFrontdoor", + resource_group_name=example_resource_group.name, + routing_rules=[azure.frontdoor.FrontdoorRoutingRuleArgs( + name="exampleRoutingRule1", + accepted_protocols=[ + "Http", + "Https", + ], + patterns_to_matches=["/*"], + frontend_endpoints=["exampleFrontendEndpoint1"], + forwarding_configuration=azure.frontdoor.FrontdoorRoutingRuleForwardingConfigurationArgs( + forwarding_protocol="MatchRequest", + backend_pool_name="exampleBackendBing", + ), + )], + backend_pool_load_balancings=[azure.frontdoor.FrontdoorBackendPoolLoadBalancingArgs( + name="exampleLoadBalancingSettings1", + )], + backend_pool_health_probes=[azure.frontdoor.FrontdoorBackendPoolHealthProbeArgs( + name="exampleHealthProbeSetting1", + )], + backend_pools=[azure.frontdoor.FrontdoorBackendPoolArgs( + name="exampleBackendBing", + backends=[azure.frontdoor.FrontdoorBackendPoolBackendArgs( + host_header="www.bing.com", + address="www.bing.com", + http_port=80, + https_port=443, + )], + load_balancing_name="exampleLoadBalancingSettings1", + health_probe_name="exampleHealthProbeSetting1", + )], + frontend_endpoints=[azure.frontdoor.FrontdoorFrontendEndpointArgs( + name="exampleFrontendEndpoint1", + host_name="example-FrontDoor.azurefd.net", + )]) + ``` + ## Import Front Doors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/frontdoor/rules_engine.py b/sdk/python/pulumi_azure/frontdoor/rules_engine.py index 4f080bc8ee..ecbe8cda6b 100644 --- a/sdk/python/pulumi_azure/frontdoor/rules_engine.py +++ b/sdk/python/pulumi_azure/frontdoor/rules_engine.py @@ -267,6 +267,89 @@ def __init__(__self__, Manages an Azure Front Door (classic) Rules Engine configuration and rules. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor = azure.frontdoor.Frontdoor("exampleFrontdoor", + resource_group_name=example_resource_group.name, + backend_pools=[azure.frontdoor.FrontdoorBackendPoolArgs( + name="exampleBackendBing", + load_balancing_name="exampleLoadBalancingSettings1", + health_probe_name="exampleHealthProbeSetting1", + backends=[azure.frontdoor.FrontdoorBackendPoolBackendArgs( + host_header="www.bing.com", + address="www.bing.com", + http_port=80, + https_port=443, + )], + )], + backend_pool_health_probes=[azure.frontdoor.FrontdoorBackendPoolHealthProbeArgs( + name="exampleHealthProbeSetting1", + )], + backend_pool_load_balancings=[azure.frontdoor.FrontdoorBackendPoolLoadBalancingArgs( + name="exampleLoadBalancingSettings1", + )], + frontend_endpoints=[azure.frontdoor.FrontdoorFrontendEndpointArgs( + name="exampleFrontendEndpoint1", + host_name="example-FrontDoor.azurefd.net", + )], + routing_rules=[azure.frontdoor.FrontdoorRoutingRuleArgs( + name="exampleRoutingRule1", + accepted_protocols=[ + "Http", + "Https", + ], + patterns_to_matches=["/*"], + frontend_endpoints=["exampleFrontendEndpoint1"], + )]) + example_rules_engine = azure.frontdoor.RulesEngine("exampleRulesEngine", + frontdoor_name=example_frontdoor.name, + resource_group_name=example_frontdoor.resource_group_name, + rules=[ + azure.frontdoor.RulesEngineRuleArgs( + name="debuggingoutput", + priority=1, + action=azure.frontdoor.RulesEngineRuleActionArgs( + response_headers=[azure.frontdoor.RulesEngineRuleActionResponseHeaderArgs( + header_action_type="Append", + header_name="X-TEST-HEADER", + value="Append Header Rule", + )], + ), + ), + azure.frontdoor.RulesEngineRuleArgs( + name="overwriteorigin", + priority=2, + match_conditions=[azure.frontdoor.RulesEngineRuleMatchConditionArgs( + variable="RequestMethod", + operator="Equal", + values=[ + "GET", + "POST", + ], + )], + action=azure.frontdoor.RulesEngineRuleActionArgs( + response_headers=[ + azure.frontdoor.RulesEngineRuleActionResponseHeaderArgs( + header_action_type="Overwrite", + header_name="Access-Control-Allow-Origin", + value="*", + ), + azure.frontdoor.RulesEngineRuleActionResponseHeaderArgs( + header_action_type="Overwrite", + header_name="Access-Control-Allow-Credentials", + value="true", + ), + ], + ), + ), + ]) + ``` + ## Import Azure Front Door Rules Engine's can be imported using the `resource id`, e.g. @@ -294,6 +377,89 @@ def __init__(__self__, Manages an Azure Front Door (classic) Rules Engine configuration and rules. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_frontdoor = azure.frontdoor.Frontdoor("exampleFrontdoor", + resource_group_name=example_resource_group.name, + backend_pools=[azure.frontdoor.FrontdoorBackendPoolArgs( + name="exampleBackendBing", + load_balancing_name="exampleLoadBalancingSettings1", + health_probe_name="exampleHealthProbeSetting1", + backends=[azure.frontdoor.FrontdoorBackendPoolBackendArgs( + host_header="www.bing.com", + address="www.bing.com", + http_port=80, + https_port=443, + )], + )], + backend_pool_health_probes=[azure.frontdoor.FrontdoorBackendPoolHealthProbeArgs( + name="exampleHealthProbeSetting1", + )], + backend_pool_load_balancings=[azure.frontdoor.FrontdoorBackendPoolLoadBalancingArgs( + name="exampleLoadBalancingSettings1", + )], + frontend_endpoints=[azure.frontdoor.FrontdoorFrontendEndpointArgs( + name="exampleFrontendEndpoint1", + host_name="example-FrontDoor.azurefd.net", + )], + routing_rules=[azure.frontdoor.FrontdoorRoutingRuleArgs( + name="exampleRoutingRule1", + accepted_protocols=[ + "Http", + "Https", + ], + patterns_to_matches=["/*"], + frontend_endpoints=["exampleFrontendEndpoint1"], + )]) + example_rules_engine = azure.frontdoor.RulesEngine("exampleRulesEngine", + frontdoor_name=example_frontdoor.name, + resource_group_name=example_frontdoor.resource_group_name, + rules=[ + azure.frontdoor.RulesEngineRuleArgs( + name="debuggingoutput", + priority=1, + action=azure.frontdoor.RulesEngineRuleActionArgs( + response_headers=[azure.frontdoor.RulesEngineRuleActionResponseHeaderArgs( + header_action_type="Append", + header_name="X-TEST-HEADER", + value="Append Header Rule", + )], + ), + ), + azure.frontdoor.RulesEngineRuleArgs( + name="overwriteorigin", + priority=2, + match_conditions=[azure.frontdoor.RulesEngineRuleMatchConditionArgs( + variable="RequestMethod", + operator="Equal", + values=[ + "GET", + "POST", + ], + )], + action=azure.frontdoor.RulesEngineRuleActionArgs( + response_headers=[ + azure.frontdoor.RulesEngineRuleActionResponseHeaderArgs( + header_action_type="Overwrite", + header_name="Access-Control-Allow-Origin", + value="*", + ), + azure.frontdoor.RulesEngineRuleActionResponseHeaderArgs( + header_action_type="Overwrite", + header_name="Access-Control-Allow-Credentials", + value="true", + ), + ], + ), + ), + ]) + ``` + ## Import Azure Front Door Rules Engine's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/graph/account.py b/sdk/python/pulumi_azure/graph/account.py index 67f0c51972..9141d34f30 100644 --- a/sdk/python/pulumi_azure/graph/account.py +++ b/sdk/python/pulumi_azure/graph/account.py @@ -234,6 +234,23 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `graph.ServicesAccount` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_application = azuread.Application("exampleApplication", display_name="example-app") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.graph.Account("exampleAccount", + resource_group_name=example_resource_group.name, + application_id=example_application.application_id, + tags={ + "environment": "Production", + }) + ``` + ## Import An existing Account can be imported into Terraform using the `resource id`, e.g. @@ -260,6 +277,23 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `graph.ServicesAccount` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_application = azuread.Application("exampleApplication", display_name="example-app") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.graph.Account("exampleAccount", + resource_group_name=example_resource_group.name, + application_id=example_application.application_id, + tags={ + "environment": "Production", + }) + ``` + ## Import An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/graph/services_account.py b/sdk/python/pulumi_azure/graph/services_account.py index a326243143..300c075c4b 100644 --- a/sdk/python/pulumi_azure/graph/services_account.py +++ b/sdk/python/pulumi_azure/graph/services_account.py @@ -232,6 +232,23 @@ def __init__(__self__, """ Manages a Microsoft Graph Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_application = azuread.Application("exampleApplication", display_name="example-app") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_services_account = azure.graph.ServicesAccount("exampleServicesAccount", + resource_group_name=example_resource_group.name, + application_id=example_application.application_id, + tags={ + "environment": "Production", + }) + ``` + ## Import An existing Account can be imported into Terraform using the `resource id`, e.g. @@ -256,6 +273,23 @@ def __init__(__self__, """ Manages a Microsoft Graph Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_application = azuread.Application("exampleApplication", display_name="example-app") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_services_account = azure.graph.ServicesAccount("exampleServicesAccount", + resource_group_name=example_resource_group.name, + application_id=example_application.application_id, + tags={ + "environment": "Production", + }) + ``` + ## Import An existing Account can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hdinsight/get_cluster.py b/sdk/python/pulumi_azure/hdinsight/get_cluster.py index eb84a2a0a4..2c6d483946 100644 --- a/sdk/python/pulumi_azure/hdinsight/get_cluster.py +++ b/sdk/python/pulumi_azure/hdinsight/get_cluster.py @@ -213,6 +213,17 @@ def get_cluster(name: Optional[str] = None, """ Use this data source to access information about an existing HDInsight Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.hdinsight.get_cluster(name="example", + resource_group_name="example-resources") + pulumi.export("httpsEndpoint", example.https_endpoint) + ``` + :param str name: Specifies the name of this HDInsight Cluster. :param str resource_group_name: Specifies the name of the Resource Group in which this HDInsight Cluster exists. @@ -248,6 +259,17 @@ def get_cluster_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing HDInsight Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.hdinsight.get_cluster(name="example", + resource_group_name="example-resources") + pulumi.export("httpsEndpoint", example.https_endpoint) + ``` + :param str name: Specifies the name of this HDInsight Cluster. :param str resource_group_name: Specifies the name of the Resource Group in which this HDInsight Cluster exists. diff --git a/sdk/python/pulumi_azure/hdinsight/h_base_cluster.py b/sdk/python/pulumi_azure/hdinsight/h_base_cluster.py index 8865be5062..d54686043e 100644 --- a/sdk/python/pulumi_azure/hdinsight/h_base_cluster.py +++ b/sdk/python/pulumi_azure/hdinsight/h_base_cluster.py @@ -849,6 +849,58 @@ def __init__(__self__, """ Manages a HDInsight HBase Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_h_base_cluster = azure.hdinsight.HBaseCluster("exampleHBaseCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.HBaseClusterComponentVersionArgs( + hbase="1.1", + ), + gateway=azure.hdinsight.HBaseClusterGatewayArgs( + username="acctestusrgw", + password="Password123!", + ), + storage_accounts=[azure.hdinsight.HBaseClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.HBaseClusterRolesArgs( + head_node=azure.hdinsight.HBaseClusterRolesHeadNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.HBaseClusterRolesWorkerNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.HBaseClusterRolesZookeeperNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight HBase Clusters can be imported using the `resource id`, e.g. @@ -890,6 +942,58 @@ def __init__(__self__, """ Manages a HDInsight HBase Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_h_base_cluster = azure.hdinsight.HBaseCluster("exampleHBaseCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.HBaseClusterComponentVersionArgs( + hbase="1.1", + ), + gateway=azure.hdinsight.HBaseClusterGatewayArgs( + username="acctestusrgw", + password="Password123!", + ), + storage_accounts=[azure.hdinsight.HBaseClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.HBaseClusterRolesArgs( + head_node=azure.hdinsight.HBaseClusterRolesHeadNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.HBaseClusterRolesWorkerNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.HBaseClusterRolesZookeeperNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight HBase Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hdinsight/hadoop_cluster.py b/sdk/python/pulumi_azure/hdinsight/hadoop_cluster.py index 50bef2a59c..a51187367c 100644 --- a/sdk/python/pulumi_azure/hdinsight/hadoop_cluster.py +++ b/sdk/python/pulumi_azure/hdinsight/hadoop_cluster.py @@ -849,6 +849,58 @@ def __init__(__self__, """ Manages a HDInsight Hadoop Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_hadoop_cluster = azure.hdinsight.HadoopCluster("exampleHadoopCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.HadoopClusterComponentVersionArgs( + hadoop="2.7", + ), + gateway=azure.hdinsight.HadoopClusterGatewayArgs( + username="acctestusrgw", + password="PAssword123!", + ), + storage_accounts=[azure.hdinsight.HadoopClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.HadoopClusterRolesArgs( + head_node=azure.hdinsight.HadoopClusterRolesHeadNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.HadoopClusterRolesWorkerNodeArgs( + vm_size="Standard_D4_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.HadoopClusterRolesZookeeperNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Hadoop Clusters can be imported using the `resource id`, e.g. @@ -890,6 +942,58 @@ def __init__(__self__, """ Manages a HDInsight Hadoop Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_hadoop_cluster = azure.hdinsight.HadoopCluster("exampleHadoopCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.HadoopClusterComponentVersionArgs( + hadoop="2.7", + ), + gateway=azure.hdinsight.HadoopClusterGatewayArgs( + username="acctestusrgw", + password="PAssword123!", + ), + storage_accounts=[azure.hdinsight.HadoopClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.HadoopClusterRolesArgs( + head_node=azure.hdinsight.HadoopClusterRolesHeadNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.HadoopClusterRolesWorkerNodeArgs( + vm_size="Standard_D4_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.HadoopClusterRolesZookeeperNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Hadoop Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hdinsight/interactive_query_cluster.py b/sdk/python/pulumi_azure/hdinsight/interactive_query_cluster.py index 60e022dd62..8e94d8e6ca 100644 --- a/sdk/python/pulumi_azure/hdinsight/interactive_query_cluster.py +++ b/sdk/python/pulumi_azure/hdinsight/interactive_query_cluster.py @@ -890,6 +890,58 @@ def __init__(__self__, """ Manages a HDInsight Interactive Query Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_interactive_query_cluster = azure.hdinsight.InteractiveQueryCluster("exampleInteractiveQueryCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.InteractiveQueryClusterComponentVersionArgs( + interactive_hive="2.1", + ), + gateway=azure.hdinsight.InteractiveQueryClusterGatewayArgs( + username="acctestusrgw", + password="Password!", + ), + storage_accounts=[azure.hdinsight.InteractiveQueryClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.InteractiveQueryClusterRolesArgs( + head_node=azure.hdinsight.InteractiveQueryClusterRolesHeadNodeArgs( + vm_size="Standard_D13_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.InteractiveQueryClusterRolesWorkerNodeArgs( + vm_size="Standard_D14_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.InteractiveQueryClusterRolesZookeeperNodeArgs( + vm_size="Standard_A4_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Interactive Query Clusters can be imported using the `resource id`, e.g. @@ -932,6 +984,58 @@ def __init__(__self__, """ Manages a HDInsight Interactive Query Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_interactive_query_cluster = azure.hdinsight.InteractiveQueryCluster("exampleInteractiveQueryCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.InteractiveQueryClusterComponentVersionArgs( + interactive_hive="2.1", + ), + gateway=azure.hdinsight.InteractiveQueryClusterGatewayArgs( + username="acctestusrgw", + password="Password!", + ), + storage_accounts=[azure.hdinsight.InteractiveQueryClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.InteractiveQueryClusterRolesArgs( + head_node=azure.hdinsight.InteractiveQueryClusterRolesHeadNodeArgs( + vm_size="Standard_D13_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.InteractiveQueryClusterRolesWorkerNodeArgs( + vm_size="Standard_D14_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.InteractiveQueryClusterRolesZookeeperNodeArgs( + vm_size="Standard_A4_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Interactive Query Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hdinsight/kafka_cluster.py b/sdk/python/pulumi_azure/hdinsight/kafka_cluster.py index 479d9b82d3..be690a23d6 100644 --- a/sdk/python/pulumi_azure/hdinsight/kafka_cluster.py +++ b/sdk/python/pulumi_azure/hdinsight/kafka_cluster.py @@ -963,6 +963,59 @@ def __init__(__self__, """ Manages a HDInsight Kafka Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_kafka_cluster = azure.hdinsight.KafkaCluster("exampleKafkaCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="4.0", + tier="Standard", + component_version=azure.hdinsight.KafkaClusterComponentVersionArgs( + kafka="2.1", + ), + gateway=azure.hdinsight.KafkaClusterGatewayArgs( + username="acctestusrgw", + password="Password123!", + ), + storage_accounts=[azure.hdinsight.KafkaClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.KafkaClusterRolesArgs( + head_node=azure.hdinsight.KafkaClusterRolesHeadNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.KafkaClusterRolesWorkerNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + number_of_disks_per_node=3, + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.KafkaClusterRolesZookeeperNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Kafka Clusters can be imported using the `resource id`, e.g. @@ -1006,6 +1059,59 @@ def __init__(__self__, """ Manages a HDInsight Kafka Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_kafka_cluster = azure.hdinsight.KafkaCluster("exampleKafkaCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="4.0", + tier="Standard", + component_version=azure.hdinsight.KafkaClusterComponentVersionArgs( + kafka="2.1", + ), + gateway=azure.hdinsight.KafkaClusterGatewayArgs( + username="acctestusrgw", + password="Password123!", + ), + storage_accounts=[azure.hdinsight.KafkaClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.KafkaClusterRolesArgs( + head_node=azure.hdinsight.KafkaClusterRolesHeadNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.KafkaClusterRolesWorkerNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + number_of_disks_per_node=3, + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.KafkaClusterRolesZookeeperNodeArgs( + vm_size="Standard_D3_V2", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Kafka Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hdinsight/spark_cluster.py b/sdk/python/pulumi_azure/hdinsight/spark_cluster.py index 8878c1b9af..aa09b7a37d 100644 --- a/sdk/python/pulumi_azure/hdinsight/spark_cluster.py +++ b/sdk/python/pulumi_azure/hdinsight/spark_cluster.py @@ -890,6 +890,58 @@ def __init__(__self__, """ Manages a HDInsight Spark Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_spark_cluster = azure.hdinsight.SparkCluster("exampleSparkCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.SparkClusterComponentVersionArgs( + spark="2.3", + ), + gateway=azure.hdinsight.SparkClusterGatewayArgs( + username="acctestusrgw", + password="Password123!", + ), + storage_accounts=[azure.hdinsight.SparkClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.SparkClusterRolesArgs( + head_node=azure.hdinsight.SparkClusterRolesHeadNodeArgs( + vm_size="Standard_A3", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.SparkClusterRolesWorkerNodeArgs( + vm_size="Standard_A3", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.SparkClusterRolesZookeeperNodeArgs( + vm_size="Medium", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Spark Clusters can be imported using the `resource id`, e.g. @@ -932,6 +984,58 @@ def __init__(__self__, """ Manages a HDInsight Spark Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_spark_cluster = azure.hdinsight.SparkCluster("exampleSparkCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_version="3.6", + tier="Standard", + component_version=azure.hdinsight.SparkClusterComponentVersionArgs( + spark="2.3", + ), + gateway=azure.hdinsight.SparkClusterGatewayArgs( + username="acctestusrgw", + password="Password123!", + ), + storage_accounts=[azure.hdinsight.SparkClusterStorageAccountArgs( + storage_container_id=example_container.id, + storage_account_key=example_account.primary_access_key, + is_default=True, + )], + roles=azure.hdinsight.SparkClusterRolesArgs( + head_node=azure.hdinsight.SparkClusterRolesHeadNodeArgs( + vm_size="Standard_A3", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + worker_node=azure.hdinsight.SparkClusterRolesWorkerNodeArgs( + vm_size="Standard_A3", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + target_instance_count=3, + ), + zookeeper_node=azure.hdinsight.SparkClusterRolesZookeeperNodeArgs( + vm_size="Medium", + username="acctestusrvm", + password="AccTestvdSC4daf986!", + ), + )) + ``` + ## Import HDInsight Spark Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/healthcare/dicom_service.py b/sdk/python/pulumi_azure/healthcare/dicom_service.py index 6abaecb6cd..3426bbeb31 100644 --- a/sdk/python/pulumi_azure/healthcare/dicom_service.py +++ b/sdk/python/pulumi_azure/healthcare/dicom_service.py @@ -341,6 +341,26 @@ def __init__(__self__, """ Manages a Healthcare DICOM Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_workspace = azure.healthcare.Workspace("testWorkspace", + resource_group_name="tfex-resource_group", + location="east us") + test_dicom_service = azure.healthcare.DicomService("testDicomService", + workspace_id=test_workspace.id, + location="east us", + identity=azure.healthcare.DicomServiceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "environment": "None", + }) + ``` + ## Import Healthcare DICOM Service can be imported using the resource`id`, e.g. @@ -367,6 +387,26 @@ def __init__(__self__, """ Manages a Healthcare DICOM Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_workspace = azure.healthcare.Workspace("testWorkspace", + resource_group_name="tfex-resource_group", + location="east us") + test_dicom_service = azure.healthcare.DicomService("testDicomService", + workspace_id=test_workspace.id, + location="east us", + identity=azure.healthcare.DicomServiceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "environment": "None", + }) + ``` + ## Import Healthcare DICOM Service can be imported using the resource`id`, e.g. diff --git a/sdk/python/pulumi_azure/healthcare/fhir_service.py b/sdk/python/pulumi_azure/healthcare/fhir_service.py index c5005093d2..f942cdc433 100644 --- a/sdk/python/pulumi_azure/healthcare/fhir_service.py +++ b/sdk/python/pulumi_azure/healthcare/fhir_service.py @@ -584,6 +584,48 @@ def __init__(__self__, """ Manages a Healthcare FHIR (Fast Healthcare Interoperability Resources) Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_workspace = azure.healthcare.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_fhir_service = azure.healthcare.FhirService("exampleFhirService", + location="east us", + resource_group_name="tfex-resource_group", + workspace_id=example_workspace.id, + kind="fhir-R4", + authentication=azure.healthcare.FhirServiceAuthenticationArgs( + authority="https://login.microsoftonline.com/tenantId", + audience="https://tfexfhir.fhir.azurehealthcareapis.com", + ), + access_policy_object_ids=[current.object_id], + identity=azure.healthcare.FhirServiceIdentityArgs( + type="SystemAssigned", + ), + container_registry_login_server_urls=["tfex-container_registry_login_server"], + cors=azure.healthcare.FhirServiceCorsArgs( + allowed_origins=[ + "https://tfex.com:123", + "https://tfex1.com:3389", + ], + allowed_headers=["*"], + allowed_methods=[ + "GET", + "DELETE", + "PUT", + ], + max_age_in_seconds=3600, + credentials_allowed=True, + ), + configuration_export_storage_account_name="storage_account_name") + ``` + ## Import Healthcare FHIR Service can be imported using the resource`id`, e.g. @@ -617,6 +659,48 @@ def __init__(__self__, """ Manages a Healthcare FHIR (Fast Healthcare Interoperability Resources) Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_workspace = azure.healthcare.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_fhir_service = azure.healthcare.FhirService("exampleFhirService", + location="east us", + resource_group_name="tfex-resource_group", + workspace_id=example_workspace.id, + kind="fhir-R4", + authentication=azure.healthcare.FhirServiceAuthenticationArgs( + authority="https://login.microsoftonline.com/tenantId", + audience="https://tfexfhir.fhir.azurehealthcareapis.com", + ), + access_policy_object_ids=[current.object_id], + identity=azure.healthcare.FhirServiceIdentityArgs( + type="SystemAssigned", + ), + container_registry_login_server_urls=["tfex-container_registry_login_server"], + cors=azure.healthcare.FhirServiceCorsArgs( + allowed_origins=[ + "https://tfex.com:123", + "https://tfex1.com:3389", + ], + allowed_headers=["*"], + allowed_methods=[ + "GET", + "DELETE", + "PUT", + ], + max_age_in_seconds=3600, + credentials_allowed=True, + ), + configuration_export_storage_account_name="storage_account_name") + ``` + ## Import Healthcare FHIR Service can be imported using the resource`id`, e.g. diff --git a/sdk/python/pulumi_azure/healthcare/get_dicom_service.py b/sdk/python/pulumi_azure/healthcare/get_dicom_service.py index 219d590704..fdd59827b0 100644 --- a/sdk/python/pulumi_azure/healthcare/get_dicom_service.py +++ b/sdk/python/pulumi_azure/healthcare/get_dicom_service.py @@ -135,6 +135,17 @@ def get_dicom_service(name: Optional[str] = None, """ Use this data source to access information about an existing Healthcare DICOM Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_dicom_service(name="example-healthcare_dicom_service", + workspace_id=data["azurerm_healthcare_workspace"]["example"]["id"]) + pulumi.export("azurermHealthcareDicomService", example.id) + ``` + :param str name: The name of the Healthcare DICOM Service :param str workspace_id: The id of the Healthcare Workspace in which the Healthcare DICOM Service exists. @@ -164,6 +175,17 @@ def get_dicom_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Healthcare DICOM Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_dicom_service(name="example-healthcare_dicom_service", + workspace_id=data["azurerm_healthcare_workspace"]["example"]["id"]) + pulumi.export("azurermHealthcareDicomService", example.id) + ``` + :param str name: The name of the Healthcare DICOM Service :param str workspace_id: The id of the Healthcare Workspace in which the Healthcare DICOM Service exists. diff --git a/sdk/python/pulumi_azure/healthcare/get_medtech_service.py b/sdk/python/pulumi_azure/healthcare/get_medtech_service.py index e2df4f809d..9d7f21a164 100644 --- a/sdk/python/pulumi_azure/healthcare/get_medtech_service.py +++ b/sdk/python/pulumi_azure/healthcare/get_medtech_service.py @@ -129,6 +129,17 @@ def get_medtech_service(name: Optional[str] = None, """ Use this data source to access information about an existing Healthcare Med Tech Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_medtech_service(name="tfexmedtech", + workspace_id="tfexwks") + pulumi.export("azurermHealthcareMedtechServiceId", example.id) + ``` + :param str name: The name of the Healthcare Med Tech Service. :param str workspace_id: The id of the Healthcare Workspace in which the Healthcare Med Tech Service exists. @@ -157,6 +168,17 @@ def get_medtech_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Healthcare Med Tech Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_medtech_service(name="tfexmedtech", + workspace_id="tfexwks") + pulumi.export("azurermHealthcareMedtechServiceId", example.id) + ``` + :param str name: The name of the Healthcare Med Tech Service. :param str workspace_id: The id of the Healthcare Workspace in which the Healthcare Med Tech Service exists. diff --git a/sdk/python/pulumi_azure/healthcare/get_service.py b/sdk/python/pulumi_azure/healthcare/get_service.py index de70412763..852b8e5128 100644 --- a/sdk/python/pulumi_azure/healthcare/get_service.py +++ b/sdk/python/pulumi_azure/healthcare/get_service.py @@ -163,6 +163,18 @@ def get_service(location: Optional[str] = None, """ Use this data source to access information about an existing Healthcare Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_service(name="example-healthcare_service", + resource_group_name="example-resources", + location="westus2") + pulumi.export("healthcareServiceId", example.id) + ``` + :param str location: The Azure Region where the Service is located. :param str name: Specifies the name of the Healthcare Service. @@ -197,6 +209,18 @@ def get_service_output(location: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Healthcare Service + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_service(name="example-healthcare_service", + resource_group_name="example-resources", + location="westus2") + pulumi.export("healthcareServiceId", example.id) + ``` + :param str location: The Azure Region where the Service is located. :param str name: Specifies the name of the Healthcare Service. diff --git a/sdk/python/pulumi_azure/healthcare/get_workspace.py b/sdk/python/pulumi_azure/healthcare/get_workspace.py index 45593320e4..373c7493ba 100644 --- a/sdk/python/pulumi_azure/healthcare/get_workspace.py +++ b/sdk/python/pulumi_azure/healthcare/get_workspace.py @@ -92,6 +92,17 @@ def get_workspace(name: Optional[str] = None, """ Use this data source to access information about an existing Healthcare Workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_workspace(name="example-healthcare_service", + resource_group_name="example-resources") + pulumi.export("healthcareWorkspaceId", example.id) + ``` + :param str name: The name of the Healthcare Workspace. :param str resource_group_name: The name of the Resource Group in which the Healthcare Workspace exists. @@ -117,6 +128,17 @@ def get_workspace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Healthcare Workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.healthcare.get_workspace(name="example-healthcare_service", + resource_group_name="example-resources") + pulumi.export("healthcareWorkspaceId", example.id) + ``` + :param str name: The name of the Healthcare Workspace. :param str resource_group_name: The name of the Resource Group in which the Healthcare Workspace exists. diff --git a/sdk/python/pulumi_azure/healthcare/medtech_service.py b/sdk/python/pulumi_azure/healthcare/medtech_service.py index 635046465c..1e622784b1 100644 --- a/sdk/python/pulumi_azure/healthcare/medtech_service.py +++ b/sdk/python/pulumi_azure/healthcare/medtech_service.py @@ -414,6 +414,45 @@ def __init__(__self__, """ Manages a Healthcare Med Tech Service. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_workspace = azure.healthcare.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_medtech_service = azure.healthcare.MedtechService("exampleMedtechService", + workspace_id=example_workspace.id, + location="east us", + identity=azure.healthcare.MedtechServiceIdentityArgs( + type="SystemAssigned", + ), + eventhub_namespace_name="example-eventhub-namespace", + eventhub_name="example-eventhub", + eventhub_consumer_group_name="$Default", + device_mapping_json=json.dumps({ + "templateType": "CollectionContent", + "template": [{ + "templateType": "JsonPathContent", + "template": { + "typeName": "heartrate", + "typeMatchExpression": "$..[?(@heartrate)]", + "deviceIdExpression": "$.deviceid", + "timestampExpression": "$.measurementdatetime", + "values": [{ + "required": "true", + "valueExpression": "$.heartrate", + "valueName": "hr", + }], + }, + }], + })) + ``` + ## Import Healthcare Med Tech Service can be imported using the resource`id`, e.g. @@ -443,6 +482,45 @@ def __init__(__self__, """ Manages a Healthcare Med Tech Service. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_workspace = azure.healthcare.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_medtech_service = azure.healthcare.MedtechService("exampleMedtechService", + workspace_id=example_workspace.id, + location="east us", + identity=azure.healthcare.MedtechServiceIdentityArgs( + type="SystemAssigned", + ), + eventhub_namespace_name="example-eventhub-namespace", + eventhub_name="example-eventhub", + eventhub_consumer_group_name="$Default", + device_mapping_json=json.dumps({ + "templateType": "CollectionContent", + "template": [{ + "templateType": "JsonPathContent", + "template": { + "typeName": "heartrate", + "typeMatchExpression": "$..[?(@heartrate)]", + "deviceIdExpression": "$.deviceid", + "timestampExpression": "$.measurementdatetime", + "values": [{ + "required": "true", + "valueExpression": "$.heartrate", + "valueName": "hr", + }], + }, + }], + })) + ``` + ## Import Healthcare Med Tech Service can be imported using the resource`id`, e.g. diff --git a/sdk/python/pulumi_azure/healthcare/medtech_service_fhir_destination.py b/sdk/python/pulumi_azure/healthcare/medtech_service_fhir_destination.py index 8aec6e353e..97214343f1 100644 --- a/sdk/python/pulumi_azure/healthcare/medtech_service_fhir_destination.py +++ b/sdk/python/pulumi_azure/healthcare/medtech_service_fhir_destination.py @@ -296,6 +296,76 @@ def __init__(__self__, """ Manages a Healthcare Med Tech Service Fhir Destination. + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_workspace = azure.healthcare.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=1, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_fhir_service = azure.healthcare.FhirService("exampleFhirService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_id=example_workspace.id, + kind="fhir-R4", + authentication=azure.healthcare.FhirServiceAuthenticationArgs( + authority="https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + audience="https://examplefhir.fhir.azurehealthcareapis.com", + )) + example_medtech_service = azure.healthcare.MedtechService("exampleMedtechService", + workspace_id=example_workspace.id, + location=example_resource_group.location, + eventhub_namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + eventhub_consumer_group_name=example_consumer_group.name, + device_mapping_json=json.dumps({ + "templateType": "CollectionContent", + "template": [], + })) + example_medtech_service_fhir_destination = azure.healthcare.MedtechServiceFhirDestination("exampleMedtechServiceFhirDestination", + location="east us", + medtech_service_id=example_medtech_service.id, + destination_fhir_service_id=example_fhir_service.id, + destination_identity_resolution_type="Create", + destination_fhir_mapping_json=json.dumps({ + "templateType": "CollectionFhirTemplate", + "template": [{ + "templateType": "CodeValueFhir", + "template": { + "codes": [{ + "code": "8867-4", + "system": "http://loinc.org", + "display": "Heart rate", + }], + "periodInterval": 60, + "typeName": "heartrate", + "value": { + "defaultPeriod": 5000, + "unit": "count/min", + "valueName": "hr", + "valueType": "SampledData", + }, + }, + }], + })) + ``` + ## Import Healthcare Med Tech Service Fhir Destination can be imported using the resource`id`, e.g. @@ -322,6 +392,76 @@ def __init__(__self__, """ Manages a Healthcare Med Tech Service Fhir Destination. + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_workspace = azure.healthcare.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=1, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_fhir_service = azure.healthcare.FhirService("exampleFhirService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_id=example_workspace.id, + kind="fhir-R4", + authentication=azure.healthcare.FhirServiceAuthenticationArgs( + authority="https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + audience="https://examplefhir.fhir.azurehealthcareapis.com", + )) + example_medtech_service = azure.healthcare.MedtechService("exampleMedtechService", + workspace_id=example_workspace.id, + location=example_resource_group.location, + eventhub_namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + eventhub_consumer_group_name=example_consumer_group.name, + device_mapping_json=json.dumps({ + "templateType": "CollectionContent", + "template": [], + })) + example_medtech_service_fhir_destination = azure.healthcare.MedtechServiceFhirDestination("exampleMedtechServiceFhirDestination", + location="east us", + medtech_service_id=example_medtech_service.id, + destination_fhir_service_id=example_fhir_service.id, + destination_identity_resolution_type="Create", + destination_fhir_mapping_json=json.dumps({ + "templateType": "CollectionFhirTemplate", + "template": [{ + "templateType": "CodeValueFhir", + "template": { + "codes": [{ + "code": "8867-4", + "system": "http://loinc.org", + "display": "Heart rate", + }], + "periodInterval": 60, + "typeName": "heartrate", + "value": { + "defaultPeriod": 5000, + "unit": "count/min", + "valueName": "hr", + "valueType": "SampledData", + }, + }, + }], + })) + ``` + ## Import Healthcare Med Tech Service Fhir Destination can be imported using the resource`id`, e.g. diff --git a/sdk/python/pulumi_azure/healthcare/service.py b/sdk/python/pulumi_azure/healthcare/service.py index 69163c4ae0..9ac686d80f 100644 --- a/sdk/python/pulumi_azure/healthcare/service.py +++ b/sdk/python/pulumi_azure/healthcare/service.py @@ -500,6 +500,46 @@ def __init__(__self__, """ Manages a Healthcare Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example = azure.healthcare.Service("example", + resource_group_name="sample-resource-group", + location="westus2", + kind="fhir-R4", + cosmosdb_throughput=2000, + access_policy_object_ids=current.object_id, + tags={ + "environment": "testenv", + "purpose": "AcceptanceTests", + }, + authentication_configuration=azure.healthcare.ServiceAuthenticationConfigurationArgs( + authority="https://login.microsoftonline.com/$%7Bdata.azurerm_client_config.current.tenant_id%7D", + audience="https://azurehealthcareapis.com/", + smart_proxy_enabled=True, + ), + cors_configuration=azure.healthcare.ServiceCorsConfigurationArgs( + allowed_origins=[ + "http://www.example.com", + "http://www.example2.com", + ], + allowed_headers=[ + "x-tempo-*", + "x-tempo2-*", + ], + allowed_methods=[ + "GET", + "PUT", + ], + max_age_in_seconds=500, + allow_credentials=True, + )) + ``` + ## Import Healthcare Service can be imported using the resource`id`, e.g. @@ -534,6 +574,46 @@ def __init__(__self__, """ Manages a Healthcare Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example = azure.healthcare.Service("example", + resource_group_name="sample-resource-group", + location="westus2", + kind="fhir-R4", + cosmosdb_throughput=2000, + access_policy_object_ids=current.object_id, + tags={ + "environment": "testenv", + "purpose": "AcceptanceTests", + }, + authentication_configuration=azure.healthcare.ServiceAuthenticationConfigurationArgs( + authority="https://login.microsoftonline.com/$%7Bdata.azurerm_client_config.current.tenant_id%7D", + audience="https://azurehealthcareapis.com/", + smart_proxy_enabled=True, + ), + cors_configuration=azure.healthcare.ServiceCorsConfigurationArgs( + allowed_origins=[ + "http://www.example.com", + "http://www.example2.com", + ], + allowed_headers=[ + "x-tempo-*", + "x-tempo2-*", + ], + allowed_methods=[ + "GET", + "PUT", + ], + max_age_in_seconds=500, + allow_credentials=True, + )) + ``` + ## Import Healthcare Service can be imported using the resource`id`, e.g. diff --git a/sdk/python/pulumi_azure/healthcare/workspace.py b/sdk/python/pulumi_azure/healthcare/workspace.py index 64f8bcd19b..95342421b1 100644 --- a/sdk/python/pulumi_azure/healthcare/workspace.py +++ b/sdk/python/pulumi_azure/healthcare/workspace.py @@ -225,6 +225,17 @@ def __init__(__self__, """ Manages a Healthcare workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.healthcare.Workspace("test", + location="east us", + resource_group_name="tfex-resource_group") + ``` + ## Import Healthcare Workspaces can be imported using the resource`id`, e.g. @@ -249,6 +260,17 @@ def __init__(__self__, """ Manages a Healthcare workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.healthcare.Workspace("test", + location="east us", + resource_group_name="tfex-resource_group") + ``` + ## Import Healthcare Workspaces can be imported using the resource`id`, e.g. diff --git a/sdk/python/pulumi_azure/hpc/cache.py b/sdk/python/pulumi_azure/hpc/cache.py index 8876475e30..bef77f28a7 100644 --- a/sdk/python/pulumi_azure/hpc/cache.py +++ b/sdk/python/pulumi_azure/hpc/cache.py @@ -779,6 +779,29 @@ def __init__(__self__, > **Note:** By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_cache = azure.hpc.Cache("exampleCache", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cache_size_in_gb=3072, + subnet_id=example_subnet.id, + sku_name="Standard_2G") + ``` + ## Import HPC Caches can be imported using the `resource id`, e.g. @@ -824,6 +847,29 @@ def __init__(__self__, > **Note:** By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_cache = azure.hpc.Cache("exampleCache", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cache_size_in_gb=3072, + subnet_id=example_subnet.id, + sku_name="Standard_2G") + ``` + ## Import HPC Caches can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hpc/cache_access_policy.py b/sdk/python/pulumi_azure/hpc/cache_access_policy.py index e504379359..6326b3dca9 100644 --- a/sdk/python/pulumi_azure/hpc/cache_access_policy.py +++ b/sdk/python/pulumi_azure/hpc/cache_access_policy.py @@ -177,6 +177,35 @@ def __init__(__self__, """ Manages a HPC Cache Access Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_cache = azure.hpc.Cache("exampleCache", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cache_size_in_gb=3072, + subnet_id=example_subnet.id, + sku_name="Standard_2G") + example_cache_access_policy = azure.hpc.CacheAccessPolicy("exampleCacheAccessPolicy", + hpc_cache_id=example_cache.id, + access_rules=[azure.hpc.CacheAccessPolicyAccessRuleArgs( + scope="default", + access="rw", + )]) + ``` + ## Import HPC Cache Access Policies can be imported using the `resource id`, e.g. @@ -200,6 +229,35 @@ def __init__(__self__, """ Manages a HPC Cache Access Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_cache = azure.hpc.Cache("exampleCache", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cache_size_in_gb=3072, + subnet_id=example_subnet.id, + sku_name="Standard_2G") + example_cache_access_policy = azure.hpc.CacheAccessPolicy("exampleCacheAccessPolicy", + hpc_cache_id=example_cache.id, + access_rules=[azure.hpc.CacheAccessPolicyAccessRuleArgs( + scope="default", + access="rw", + )]) + ``` + ## Import HPC Cache Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hpc/cache_blob_target.py b/sdk/python/pulumi_azure/hpc/cache_blob_target.py index 5976614d99..9743f59336 100644 --- a/sdk/python/pulumi_azure/hpc/cache_blob_target.py +++ b/sdk/python/pulumi_azure/hpc/cache_blob_target.py @@ -310,6 +310,50 @@ def __init__(__self__, > **NOTE:**: By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_cache = azure.hpc.Cache("exampleCache", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cache_size_in_gb=3072, + subnet_id=example_subnet.id, + sku_name="Standard_2G") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_service_principal = azuread.get_service_principal(display_name="HPC Cache Resource Provider") + example_storage_account_contrib = azure.authorization.Assignment("exampleStorageAccountContrib", + scope=example_account.id, + role_definition_name="Storage Account Contributor", + principal_id=example_service_principal.object_id) + example_storage_blob_data_contrib = azure.authorization.Assignment("exampleStorageBlobDataContrib", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_service_principal.object_id) + example_cache_blob_target = azure.hpc.CacheBlobTarget("exampleCacheBlobTarget", + resource_group_name=example_resource_group.name, + cache_name=example_cache.name, + storage_container_id=example_container.resource_manager_id, + namespace_path="/blob_storage") + ``` + ## Import Blob Targets within an HPC Cache can be imported using the `resource id`, e.g. @@ -340,6 +384,50 @@ def __init__(__self__, > **NOTE:**: By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_cache = azure.hpc.Cache("exampleCache", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cache_size_in_gb=3072, + subnet_id=example_subnet.id, + sku_name="Standard_2G") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_service_principal = azuread.get_service_principal(display_name="HPC Cache Resource Provider") + example_storage_account_contrib = azure.authorization.Assignment("exampleStorageAccountContrib", + scope=example_account.id, + role_definition_name="Storage Account Contributor", + principal_id=example_service_principal.object_id) + example_storage_blob_data_contrib = azure.authorization.Assignment("exampleStorageBlobDataContrib", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_service_principal.object_id) + example_cache_blob_target = azure.hpc.CacheBlobTarget("exampleCacheBlobTarget", + resource_group_name=example_resource_group.name, + cache_name=example_cache.name, + storage_container_id=example_container.resource_manager_id, + namespace_path="/blob_storage") + ``` + ## Import Blob Targets within an HPC Cache can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hsm/module.py b/sdk/python/pulumi_azure/hsm/module.py index 0b08125517..a7fe7179fe 100644 --- a/sdk/python/pulumi_azure/hsm/module.py +++ b/sdk/python/pulumi_azure/hsm/module.py @@ -424,6 +424,73 @@ def __init__(__self__, > **Note:** If the quota is not enough in some region, please submit the quota request to service team. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.2.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.2.0.0/24"]) + example2 = azure.network.Subnet("example2", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.2.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="first", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.HardwareSecurityModules/dedicatedHSMs", + actions=[ + "Microsoft.Network/networkinterfaces/*", + "Microsoft.Network/virtualNetworks/subnets/join/action", + ], + ), + )]) + example3 = azure.network.Subnet("example3", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.2.255.0/26"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic") + example_virtual_network_gateway = azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="ExpressRoute", + vpn_type="PolicyBased", + sku="Standard", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=example_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=example3.id, + )]) + example_module = azure.hsm.Module("exampleModule", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="payShield10K_LMK1_CPS60", + management_network_profile=azure.hsm.ModuleManagementNetworkProfileArgs( + network_interface_private_ip_addresses=["10.2.1.7"], + subnet_id=example2.id, + ), + network_profile=azure.hsm.ModuleNetworkProfileArgs( + network_interface_private_ip_addresses=["10.2.1.8"], + subnet_id=example2.id, + ), + stamp_id="stamp2", + tags={ + "env": "Test", + }, + opts=pulumi.ResourceOptions(depends_on=[example_virtual_network_gateway])) + ``` + ## Import Dedicated Hardware Security Module can be imported using the `resource id`, e.g. @@ -459,6 +526,73 @@ def __init__(__self__, > **Note:** If the quota is not enough in some region, please submit the quota request to service team. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.2.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.2.0.0/24"]) + example2 = azure.network.Subnet("example2", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.2.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="first", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.HardwareSecurityModules/dedicatedHSMs", + actions=[ + "Microsoft.Network/networkinterfaces/*", + "Microsoft.Network/virtualNetworks/subnets/join/action", + ], + ), + )]) + example3 = azure.network.Subnet("example3", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.2.255.0/26"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic") + example_virtual_network_gateway = azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="ExpressRoute", + vpn_type="PolicyBased", + sku="Standard", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=example_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=example3.id, + )]) + example_module = azure.hsm.Module("exampleModule", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="payShield10K_LMK1_CPS60", + management_network_profile=azure.hsm.ModuleManagementNetworkProfileArgs( + network_interface_private_ip_addresses=["10.2.1.7"], + subnet_id=example2.id, + ), + network_profile=azure.hsm.ModuleNetworkProfileArgs( + network_interface_private_ip_addresses=["10.2.1.8"], + subnet_id=example2.id, + ), + stamp_id="stamp2", + tags={ + "env": "Test", + }, + opts=pulumi.ResourceOptions(depends_on=[example_virtual_network_gateway])) + ``` + ## Import Dedicated Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/hybrid/get_compute_machine.py b/sdk/python/pulumi_azure/hybrid/get_compute_machine.py index 16e93f2469..aa66b564bd 100644 --- a/sdk/python/pulumi_azure/hybrid/get_compute_machine.py +++ b/sdk/python/pulumi_azure/hybrid/get_compute_machine.py @@ -412,6 +412,17 @@ def get_compute_machine(name: Optional[str] = None, > **Note:** The Data Source `hybrid_get_compute_machine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `arcmachine_get` Data Source. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.hybrid.get_compute_machine(name="existing-hcmachine", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this hybrid compute machine. :param str resource_group_name: The name of the Resource Group where the Hybrid Compute exists. @@ -467,6 +478,17 @@ def get_compute_machine_output(name: Optional[pulumi.Input[str]] = None, > **Note:** The Data Source `hybrid_get_compute_machine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `arcmachine_get` Data Source. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.hybrid.get_compute_machine(name="existing-hcmachine", + resource_group_name="existing-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this hybrid compute machine. :param str resource_group_name: The name of the Resource Group where the Hybrid Compute exists. diff --git a/sdk/python/pulumi_azure/iot/certificate.py b/sdk/python/pulumi_azure/iot/certificate.py index e3b4c497e3..fc6a491321 100644 --- a/sdk/python/pulumi_azure/iot/certificate.py +++ b/sdk/python/pulumi_azure/iot/certificate.py @@ -258,6 +258,28 @@ def __init__(__self__, """ Manages an IotHub Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + )) + example_certificate = azure.iot.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + is_verified=True, + certificate_content=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.cer")) + ``` + ## Import IoTHub Certificates can be imported using the `resource id`, e.g. @@ -283,6 +305,28 @@ def __init__(__self__, """ Manages an IotHub Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + )) + example_certificate = azure.iot.Certificate("exampleCertificate", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + is_verified=True, + certificate_content=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.cer")) + ``` + ## Import IoTHub Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/consumer_group.py b/sdk/python/pulumi_azure/iot/consumer_group.py index 5af28f8c99..a6ba733291 100644 --- a/sdk/python/pulumi_azure/iot/consumer_group.py +++ b/sdk/python/pulumi_azure/iot/consumer_group.py @@ -217,6 +217,29 @@ def __init__(__self__, """ Manages a Consumer Group within an IotHub + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + ), + tags={ + "purpose": "testing", + }) + example_consumer_group = azure.iot.ConsumerGroup("exampleConsumerGroup", + iothub_name=example_io_t_hub.name, + eventhub_endpoint_name="events", + resource_group_name=example_resource_group.name) + ``` + ## Import IoTHub Consumer Groups can be imported using the `resource id`, e.g. @@ -241,6 +264,29 @@ def __init__(__self__, """ Manages a Consumer Group within an IotHub + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + ), + tags={ + "purpose": "testing", + }) + example_consumer_group = azure.iot.ConsumerGroup("exampleConsumerGroup", + iothub_name=example_io_t_hub.name, + eventhub_endpoint_name="events", + resource_group_name=example_resource_group.name) + ``` + ## Import IoTHub Consumer Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/dps_shared_access_policy.py b/sdk/python/pulumi_azure/iot/dps_shared_access_policy.py index e4b466eb24..e1227709d2 100644 --- a/sdk/python/pulumi_azure/iot/dps_shared_access_policy.py +++ b/sdk/python/pulumi_azure/iot/dps_shared_access_policy.py @@ -492,6 +492,27 @@ def __init__(__self__, """ Manages an IotHub Device Provisioning Service Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_iot_hub_dps = azure.iot.IotHubDps("exampleIotHubDps", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IotHubDpsSkuArgs( + name="S1", + capacity=1, + )) + example_dps_shared_access_policy = azure.iot.DpsSharedAccessPolicy("exampleDpsSharedAccessPolicy", + resource_group_name=example_resource_group.name, + iothub_dps_name=example_iot_hub_dps.name, + enrollment_write=True, + enrollment_read=True) + ``` + ## Import IoTHub Device Provisioning Service Shared Access Policies can be imported using the `resource id`, e.g. @@ -528,6 +549,27 @@ def __init__(__self__, """ Manages an IotHub Device Provisioning Service Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_iot_hub_dps = azure.iot.IotHubDps("exampleIotHubDps", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IotHubDpsSkuArgs( + name="S1", + capacity=1, + )) + example_dps_shared_access_policy = azure.iot.DpsSharedAccessPolicy("exampleDpsSharedAccessPolicy", + resource_group_name=example_resource_group.name, + iothub_dps_name=example_iot_hub_dps.name, + enrollment_write=True, + enrollment_read=True) + ``` + ## Import IoTHub Device Provisioning Service Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/endpoint_cosmosdb_account.py b/sdk/python/pulumi_azure/iot/endpoint_cosmosdb_account.py index fecfcb1dbd..05da4447ba 100644 --- a/sdk/python/pulumi_azure/iot/endpoint_cosmosdb_account.py +++ b/sdk/python/pulumi_azure/iot/endpoint_cosmosdb_account.py @@ -573,6 +573,53 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition/id") + example_endpoint_cosmosdb_account = azure.iot.EndpointCosmosdbAccount("exampleEndpointCosmosdbAccount", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + container_name=example_sql_container.name, + database_name=example_sql_database.name, + endpoint_uri=example_account.endpoint, + primary_key=example_account.primary_key, + secondary_key=example_account.secondary_key) + ``` + ## Import IoTHub Cosmos DB Account Endpoint can be imported using the `resource id`, e.g. @@ -613,6 +660,53 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Strong", + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/definition/id") + example_endpoint_cosmosdb_account = azure.iot.EndpointCosmosdbAccount("exampleEndpointCosmosdbAccount", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + container_name=example_sql_container.name, + database_name=example_sql_database.name, + endpoint_uri=example_account.endpoint, + primary_key=example_account.primary_key, + secondary_key=example_account.secondary_key) + ``` + ## Import IoTHub Cosmos DB Account Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/endpoint_eventhub.py b/sdk/python/pulumi_azure/iot/endpoint_eventhub.py index 2471ae63ee..ddb985a8ef 100644 --- a/sdk/python/pulumi_azure/iot/endpoint_eventhub.py +++ b/sdk/python/pulumi_azure/iot/endpoint_eventhub.py @@ -390,6 +390,45 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=False, + send=True, + manage=False) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_endpoint_eventhub = azure.iot.EndpointEventhub("exampleEndpointEventhub", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + connection_string=example_authorization_rule.primary_connection_string) + ``` + ## Import IoTHub EventHub Endpoint can be imported using the `resource id`, e.g. @@ -422,6 +461,45 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Basic") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=False, + send=True, + manage=False) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_endpoint_eventhub = azure.iot.EndpointEventhub("exampleEndpointEventhub", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + connection_string=example_authorization_rule.primary_connection_string) + ``` + ## Import IoTHub EventHub Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/endpoint_servicebus_queue.py b/sdk/python/pulumi_azure/iot/endpoint_servicebus_queue.py index 4a951803ff..8374f91e49 100644 --- a/sdk/python/pulumi_azure/iot/endpoint_servicebus_queue.py +++ b/sdk/python/pulumi_azure/iot/endpoint_servicebus_queue.py @@ -390,6 +390,41 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_queue_authorization_rule = azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", + queue_id=example_queue.id, + listen=False, + send=True, + manage=False) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_endpoint_servicebus_queue = azure.iot.EndpointServicebusQueue("exampleEndpointServicebusQueue", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + connection_string=example_queue_authorization_rule.primary_connection_string) + ``` + ## Import IoTHub ServiceBus Queue Endpoint can be imported using the `resource id`, e.g. g @@ -422,6 +457,41 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_queue_authorization_rule = azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", + queue_id=example_queue.id, + listen=False, + send=True, + manage=False) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_endpoint_servicebus_queue = azure.iot.EndpointServicebusQueue("exampleEndpointServicebusQueue", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + connection_string=example_queue_authorization_rule.primary_connection_string) + ``` + ## Import IoTHub ServiceBus Queue Endpoint can be imported using the `resource id`, e.g. g diff --git a/sdk/python/pulumi_azure/iot/endpoint_servicebus_topic.py b/sdk/python/pulumi_azure/iot/endpoint_servicebus_topic.py index 26ad13a900..3c3f74f40c 100644 --- a/sdk/python/pulumi_azure/iot/endpoint_servicebus_topic.py +++ b/sdk/python/pulumi_azure/iot/endpoint_servicebus_topic.py @@ -390,6 +390,39 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=False, + send=True, + manage=False) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_endpoint_servicebus_topic = azure.iot.EndpointServicebusTopic("exampleEndpointServicebusTopic", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + connection_string=example_topic_authorization_rule.primary_connection_string) + ``` + ## Import IoTHub ServiceBus Topic Endpoint can be imported using the `resource id`, e.g. @@ -422,6 +455,39 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=False, + send=True, + manage=False) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + ), + tags={ + "purpose": "example", + }) + example_endpoint_servicebus_topic = azure.iot.EndpointServicebusTopic("exampleEndpointServicebusTopic", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + connection_string=example_topic_authorization_rule.primary_connection_string) + ``` + ## Import IoTHub ServiceBus Topic Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/endpoint_storage_container.py b/sdk/python/pulumi_azure/iot/endpoint_storage_container.py index bce11b1e61..8bae7a195f 100644 --- a/sdk/python/pulumi_azure/iot/endpoint_storage_container.py +++ b/sdk/python/pulumi_azure/iot/endpoint_storage_container.py @@ -551,6 +551,39 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_endpoint_storage_container = azure.iot.EndpointStorageContainer("exampleEndpointStorageContainer", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + container_name="acctestcont", + connection_string=example_account.primary_blob_connection_string, + file_name_format="{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + batch_frequency_in_seconds=60, + max_chunk_size_in_bytes=10485760, + encoding="JSON") + ``` + ## Import IoTHub Storage Container Endpoint can be imported using the `resource id`, e.g. @@ -587,6 +620,39 @@ def __init__(__self__, > **NOTE:** Endpoints can be defined either directly on the `iot.IoTHub` resource, or using the `azurerm_iothub_endpoint_*` resources - but the two ways of defining the endpoints cannot be used together. If both are used against the same IoTHub, spurious changes will occur. Also, defining a `azurerm_iothub_endpoint_*` resource and another endpoint of a different type directly on the `iot.IoTHub` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_endpoint_storage_container = azure.iot.EndpointStorageContainer("exampleEndpointStorageContainer", + resource_group_name=example_resource_group.name, + iothub_id=example_io_t_hub.id, + container_name="acctestcont", + connection_string=example_account.primary_blob_connection_string, + file_name_format="{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + batch_frequency_in_seconds=60, + max_chunk_size_in_bytes=10485760, + encoding="JSON") + ``` + ## Import IoTHub Storage Container Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/file_upload.py b/sdk/python/pulumi_azure/iot/file_upload.py index 8732c0d723..220d0b7b4a 100644 --- a/sdk/python/pulumi_azure/iot/file_upload.py +++ b/sdk/python/pulumi_azure/iot/file_upload.py @@ -477,6 +477,34 @@ def __init__(__self__, > **NOTE:** File upload can be defined either directly on the `iot.IoTHub` resource, or using the `iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_file_upload = azure.iot.FileUpload("exampleFileUpload", + iothub_id=example_io_t_hub.id, + connection_string=example_account.primary_blob_connection_string, + container_name=example_container.name) + ``` + ## Import IoT Hub File Uploads can be imported using the `resource id`, e.g. @@ -511,6 +539,34 @@ def __init__(__self__, > **NOTE:** File upload can be defined either directly on the `iot.IoTHub` resource, or using the `iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_file_upload = azure.iot.FileUpload("exampleFileUpload", + iothub_id=example_io_t_hub.id, + connection_string=example_account.primary_blob_connection_string, + container_name=example_container.name) + ``` + ## Import IoT Hub File Uploads can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/get_dps.py b/sdk/python/pulumi_azure/iot/get_dps.py index f15d0687b4..dc55162d1e 100644 --- a/sdk/python/pulumi_azure/iot/get_dps.py +++ b/sdk/python/pulumi_azure/iot/get_dps.py @@ -138,6 +138,16 @@ def get_dps(name: Optional[str] = None, """ Use this data source to access information about an existing IotHub Device Provisioning Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_dps(name="iot_hub_dps_test", + resource_group_name="iothub_dps_rg") + ``` + :param str name: Specifies the name of the Iot Device Provisioning Service resource. :param str resource_group_name: The name of the resource group under which the Iot Device Provisioning Service is located in. @@ -169,6 +179,16 @@ def get_dps_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing IotHub Device Provisioning Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_dps(name="iot_hub_dps_test", + resource_group_name="iothub_dps_rg") + ``` + :param str name: Specifies the name of the Iot Device Provisioning Service resource. :param str resource_group_name: The name of the resource group under which the Iot Device Provisioning Service is located in. diff --git a/sdk/python/pulumi_azure/iot/get_dps_shared_access_policy.py b/sdk/python/pulumi_azure/iot/get_dps_shared_access_policy.py index 34c03e59d4..6980e1b027 100644 --- a/sdk/python/pulumi_azure/iot/get_dps_shared_access_policy.py +++ b/sdk/python/pulumi_azure/iot/get_dps_shared_access_policy.py @@ -126,6 +126,17 @@ def get_dps_shared_access_policy(iothub_dps_name: Optional[str] = None, """ Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_dps_shared_access_policy(name="example", + resource_group_name=azurerm_resource_group["example"]["name"], + iothub_dps_name=azurerm_iothub_dps["example"]["name"]) + ``` + :param str iothub_dps_name: Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs. :param str name: Specifies the name of the IotHub Shared Access Policy. @@ -157,6 +168,17 @@ def get_dps_shared_access_policy_output(iothub_dps_name: Optional[pulumi.Input[s """ Use this data source to access information about an existing IotHub Device Provisioning Service Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_dps_shared_access_policy(name="example", + resource_group_name=azurerm_resource_group["example"]["name"], + iothub_dps_name=azurerm_iothub_dps["example"]["name"]) + ``` + :param str iothub_dps_name: Specifies the name of the IoT Hub Device Provisioning service to which the Shared Access Policy belongs. :param str name: Specifies the name of the IotHub Shared Access Policy. diff --git a/sdk/python/pulumi_azure/iot/get_iot_hub.py b/sdk/python/pulumi_azure/iot/get_iot_hub.py index 8cc0d5c5e7..f2bb6aa628 100644 --- a/sdk/python/pulumi_azure/iot/get_iot_hub.py +++ b/sdk/python/pulumi_azure/iot/get_iot_hub.py @@ -103,6 +103,17 @@ def get_iot_hub(name: Optional[str] = None, """ Use this data source to access information about an existing IoTHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_iot_hub(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this IoTHub. :param str resource_group_name: The name of the Resource Group where the IoTHub exists. @@ -132,6 +143,17 @@ def get_iot_hub_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing IoTHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_iot_hub(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this IoTHub. :param str resource_group_name: The name of the Resource Group where the IoTHub exists. diff --git a/sdk/python/pulumi_azure/iot/get_shared_access_policy.py b/sdk/python/pulumi_azure/iot/get_shared_access_policy.py index 65a72576ea..7f3ca279b6 100644 --- a/sdk/python/pulumi_azure/iot/get_shared_access_policy.py +++ b/sdk/python/pulumi_azure/iot/get_shared_access_policy.py @@ -126,6 +126,17 @@ def get_shared_access_policy(iothub_name: Optional[str] = None, """ Use this data source to access information about an existing IotHub Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_shared_access_policy(name="example", + resource_group_name=azurerm_resource_group["example"]["name"], + iothub_name=azurerm_iothub["example"]["name"]) + ``` + :param str iothub_name: The name of the IoTHub to which this Shared Access Policy belongs. :param str name: Specifies the name of the IotHub Shared Access Policy resource. @@ -157,6 +168,17 @@ def get_shared_access_policy_output(iothub_name: Optional[pulumi.Input[str]] = N """ Use this data source to access information about an existing IotHub Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.iot.get_shared_access_policy(name="example", + resource_group_name=azurerm_resource_group["example"]["name"], + iothub_name=azurerm_iothub["example"]["name"]) + ``` + :param str iothub_name: The name of the IoTHub to which this Shared Access Policy belongs. :param str name: Specifies the name of the IotHub Shared Access Policy resource. diff --git a/sdk/python/pulumi_azure/iot/io_t_hub.py b/sdk/python/pulumi_azure/iot/io_t_hub.py index 95f2d0cfec..e29c221614 100644 --- a/sdk/python/pulumi_azure/iot/io_t_hub.py +++ b/sdk/python/pulumi_azure/iot/io_t_hub.py @@ -938,6 +938,98 @@ def __init__(__self__, > **NOTE:** File upload can be defined either directly on the `iot.IoTHub` resource, or using the `iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Basic") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + resource_group_name=example_resource_group.name, + namespace_name=example_event_hub_namespace.name, + partition_count=2, + message_retention=1) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + resource_group_name=example_resource_group.name, + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + send=True) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + local_authentication_enabled=False, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + ), + endpoints=[ + azure.iot.IoTHubEndpointArgs( + type="AzureIotHub.StorageContainer", + connection_string=example_account.primary_blob_connection_string, + name="export", + batch_frequency_in_seconds=60, + max_chunk_size_in_bytes=10485760, + container_name=example_container.name, + encoding="Avro", + file_name_format="{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + ), + azure.iot.IoTHubEndpointArgs( + type="AzureIotHub.EventHub", + connection_string=example_authorization_rule.primary_connection_string, + name="export2", + ), + ], + routes=[ + azure.iot.IoTHubRouteArgs( + name="export", + source="DeviceMessages", + condition="true", + endpoint_names=["export"], + enabled=True, + ), + azure.iot.IoTHubRouteArgs( + name="export2", + source="DeviceMessages", + condition="true", + endpoint_names=["export2"], + enabled=True, + ), + ], + enrichments=[azure.iot.IoTHubEnrichmentArgs( + key="tenant", + value="$twin.tags.Tenant", + endpoint_names=[ + "export", + "export2", + ], + )], + cloud_to_device=azure.iot.IoTHubCloudToDeviceArgs( + max_delivery_count=30, + default_ttl="PT1H", + feedbacks=[azure.iot.IoTHubCloudToDeviceFeedbackArgs( + time_to_live="PT1H10M", + max_delivery_count=15, + lock_duration="PT30S", + )], + ), + tags={ + "purpose": "testing", + }) + ``` + ## Import IoTHubs can be imported using the `resource id`, e.g. @@ -988,6 +1080,98 @@ def __init__(__self__, > **NOTE:** File upload can be defined either directly on the `iot.IoTHub` resource, or using the `iot.FileUpload` resource - but the two cannot be used together. If both are used against the same IoTHub, spurious changes will occur. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Basic") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + resource_group_name=example_resource_group.name, + namespace_name=example_event_hub_namespace.name, + partition_count=2, + message_retention=1) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + resource_group_name=example_resource_group.name, + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + send=True) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + local_authentication_enabled=False, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + ), + endpoints=[ + azure.iot.IoTHubEndpointArgs( + type="AzureIotHub.StorageContainer", + connection_string=example_account.primary_blob_connection_string, + name="export", + batch_frequency_in_seconds=60, + max_chunk_size_in_bytes=10485760, + container_name=example_container.name, + encoding="Avro", + file_name_format="{iothub}/{partition}_{YYYY}_{MM}_{DD}_{HH}_{mm}", + ), + azure.iot.IoTHubEndpointArgs( + type="AzureIotHub.EventHub", + connection_string=example_authorization_rule.primary_connection_string, + name="export2", + ), + ], + routes=[ + azure.iot.IoTHubRouteArgs( + name="export", + source="DeviceMessages", + condition="true", + endpoint_names=["export"], + enabled=True, + ), + azure.iot.IoTHubRouteArgs( + name="export2", + source="DeviceMessages", + condition="true", + endpoint_names=["export2"], + enabled=True, + ), + ], + enrichments=[azure.iot.IoTHubEnrichmentArgs( + key="tenant", + value="$twin.tags.Tenant", + endpoint_names=[ + "export", + "export2", + ], + )], + cloud_to_device=azure.iot.IoTHubCloudToDeviceArgs( + max_delivery_count=30, + default_ttl="PT1H", + feedbacks=[azure.iot.IoTHubCloudToDeviceFeedbackArgs( + time_to_live="PT1H10M", + max_delivery_count=15, + lock_duration="PT30S", + )], + ), + tags={ + "purpose": "testing", + }) + ``` + ## Import IoTHubs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/iot_hub_certificate.py b/sdk/python/pulumi_azure/iot/iot_hub_certificate.py index cd89d5af9c..e4287e3032 100644 --- a/sdk/python/pulumi_azure/iot/iot_hub_certificate.py +++ b/sdk/python/pulumi_azure/iot/iot_hub_certificate.py @@ -258,6 +258,27 @@ def __init__(__self__, """ Manages an IotHub Device Provisioning Service Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_iot_hub_dps = azure.iot.IotHubDps("exampleIotHubDps", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IotHubDpsSkuArgs( + name="S1", + capacity=1, + )) + example_iot_hub_certificate = azure.iot.IotHubCertificate("exampleIotHubCertificate", + resource_group_name=example_resource_group.name, + iot_dps_name=example_iot_hub_dps.name, + certificate_content=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.cer")) + ``` + ## Import IoTHub Device Provisioning Service Certificates can be imported using the `resource id`, e.g. @@ -283,6 +304,27 @@ def __init__(__self__, """ Manages an IotHub Device Provisioning Service Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_iot_hub_dps = azure.iot.IotHubDps("exampleIotHubDps", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IotHubDpsSkuArgs( + name="S1", + capacity=1, + )) + example_iot_hub_certificate = azure.iot.IotHubCertificate("exampleIotHubCertificate", + resource_group_name=example_resource_group.name, + iot_dps_name=example_iot_hub_dps.name, + certificate_content=(lambda path: base64.b64encode(open(path).read().encode()).decode())("example.cer")) + ``` + ## Import IoTHub Device Provisioning Service Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/iot_hub_device_update_account.py b/sdk/python/pulumi_azure/iot/iot_hub_device_update_account.py index 9ca9dbf632..fe88d28245 100644 --- a/sdk/python/pulumi_azure/iot/iot_hub_device_update_account.py +++ b/sdk/python/pulumi_azure/iot/iot_hub_device_update_account.py @@ -344,6 +344,24 @@ def __init__(__self__, """ Manages an IoT Hub Device Update Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_iot_hub_device_update_account = azure.iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.iot.IotHubDeviceUpdateAccountIdentityArgs( + type="SystemAssigned", + ), + tags={ + "key": "value", + }) + ``` + ## Import IoT Hub Device Update Account can be imported using the `resource id`, e.g. @@ -371,6 +389,24 @@ def __init__(__self__, """ Manages an IoT Hub Device Update Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_iot_hub_device_update_account = azure.iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.iot.IotHubDeviceUpdateAccountIdentityArgs( + type="SystemAssigned", + ), + tags={ + "key": "value", + }) + ``` + ## Import IoT Hub Device Update Account can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/iot_hub_device_update_instance.py b/sdk/python/pulumi_azure/iot/iot_hub_device_update_instance.py index 4c40badde9..cd0b7a5b8a 100644 --- a/sdk/python/pulumi_azure/iot/iot_hub_device_update_instance.py +++ b/sdk/python/pulumi_azure/iot/iot_hub_device_update_instance.py @@ -296,6 +296,41 @@ def __init__(__self__, """ Manages an IoT Hub Device Update Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_iot_hub_device_update_account = azure.iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_iot_hub_device_update_instance = azure.iot.IotHubDeviceUpdateInstance("exampleIotHubDeviceUpdateInstance", + device_update_account_id=example_iot_hub_device_update_account.id, + iothub_id=example_io_t_hub.id, + diagnostic_enabled=True, + diagnostic_storage_account=azure.iot.IotHubDeviceUpdateInstanceDiagnosticStorageAccountArgs( + connection_string=example_account.primary_connection_string, + id=example_account.id, + ), + tags={ + "key": "value", + }) + ``` + ## Import IoT Hub Device Update Instance can be imported using the `resource id`, e.g. @@ -322,6 +357,41 @@ def __init__(__self__, """ Manages an IoT Hub Device Update Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_iot_hub_device_update_account = azure.iot.IotHubDeviceUpdateAccount("exampleIotHubDeviceUpdateAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_iot_hub_device_update_instance = azure.iot.IotHubDeviceUpdateInstance("exampleIotHubDeviceUpdateInstance", + device_update_account_id=example_iot_hub_device_update_account.id, + iothub_id=example_io_t_hub.id, + diagnostic_enabled=True, + diagnostic_storage_account=azure.iot.IotHubDeviceUpdateInstanceDiagnosticStorageAccountArgs( + connection_string=example_account.primary_connection_string, + id=example_account.id, + ), + tags={ + "key": "value", + }) + ``` + ## Import IoT Hub Device Update Instance can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/iot_hub_dps.py b/sdk/python/pulumi_azure/iot/iot_hub_dps.py index b64b874e02..e844c051fb 100644 --- a/sdk/python/pulumi_azure/iot/iot_hub_dps.py +++ b/sdk/python/pulumi_azure/iot/iot_hub_dps.py @@ -512,6 +512,23 @@ def __init__(__self__, """ Manages an IotHub Device Provisioning Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_iot_hub_dps = azure.iot.IotHubDps("exampleIotHubDps", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_policy="Hashed", + sku=azure.iot.IotHubDpsSkuArgs( + name="S1", + capacity=1, + )) + ``` + ## Import IoT Device Provisioning Service can be imported using the `resource id`, e.g. @@ -542,6 +559,23 @@ def __init__(__self__, """ Manages an IotHub Device Provisioning Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_iot_hub_dps = azure.iot.IotHubDps("exampleIotHubDps", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_policy="Hashed", + sku=azure.iot.IotHubDpsSkuArgs( + name="S1", + capacity=1, + )) + ``` + ## Import IoT Device Provisioning Service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/security_device_group.py b/sdk/python/pulumi_azure/iot/security_device_group.py index f6145b4276..041330cafb 100644 --- a/sdk/python/pulumi_azure/iot/security_device_group.py +++ b/sdk/python/pulumi_azure/iot/security_device_group.py @@ -217,6 +217,39 @@ def __init__(__self__, """ Manages a Iot Security Device Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_security_solution = azure.iot.SecuritySolution("exampleSecuritySolution", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + display_name="Iot Security Solution", + iothub_ids=[example_io_t_hub.id]) + example_security_device_group = azure.iot.SecurityDeviceGroup("exampleSecurityDeviceGroup", + iothub_id=example_io_t_hub.id, + allow_rule=azure.iot.SecurityDeviceGroupAllowRuleArgs( + connection_to_ips_not_alloweds=["10.0.0.0/24"], + ), + range_rules=[azure.iot.SecurityDeviceGroupRangeRuleArgs( + type="ActiveConnectionsNotInAllowedRange", + min=0, + max=30, + duration="PT5M", + )], + opts=pulumi.ResourceOptions(depends_on=[example_security_solution])) + ``` + ## Import Iot Security Device Group can be imported using the `resource id`, e.g. @@ -241,6 +274,39 @@ def __init__(__self__, """ Manages a Iot Security Device Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_security_solution = azure.iot.SecuritySolution("exampleSecuritySolution", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + display_name="Iot Security Solution", + iothub_ids=[example_io_t_hub.id]) + example_security_device_group = azure.iot.SecurityDeviceGroup("exampleSecurityDeviceGroup", + iothub_id=example_io_t_hub.id, + allow_rule=azure.iot.SecurityDeviceGroupAllowRuleArgs( + connection_to_ips_not_alloweds=["10.0.0.0/24"], + ), + range_rules=[azure.iot.SecurityDeviceGroupRangeRuleArgs( + type="ActiveConnectionsNotInAllowedRange", + min=0, + max=30, + duration="PT5M", + )], + opts=pulumi.ResourceOptions(depends_on=[example_security_solution])) + ``` + ## Import Iot Security Device Group can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/security_solution.py b/sdk/python/pulumi_azure/iot/security_solution.py index 09e7319331..d4d28c584c 100644 --- a/sdk/python/pulumi_azure/iot/security_solution.py +++ b/sdk/python/pulumi_azure/iot/security_solution.py @@ -658,6 +658,27 @@ def __init__(__self__, """ Manages an iot security solution. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_security_solution = azure.iot.SecuritySolution("exampleSecuritySolution", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + display_name="Iot Security Solution", + iothub_ids=[example_io_t_hub.id]) + ``` + ## Import Iot Security Solution can be imported using the `resource id`, e.g. @@ -693,6 +714,27 @@ def __init__(__self__, """ Manages an iot security solution. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_security_solution = azure.iot.SecuritySolution("exampleSecuritySolution", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + display_name="Iot Security Solution", + iothub_ids=[example_io_t_hub.id]) + ``` + ## Import Iot Security Solution can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/shared_access_policy.py b/sdk/python/pulumi_azure/iot/shared_access_policy.py index 826b5f61df..89ec99597b 100644 --- a/sdk/python/pulumi_azure/iot/shared_access_policy.py +++ b/sdk/python/pulumi_azure/iot/shared_access_policy.py @@ -435,6 +435,27 @@ def __init__(__self__, """ Manages an IotHub Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_shared_access_policy = azure.iot.SharedAccessPolicy("exampleSharedAccessPolicy", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + registry_read=True, + registry_write=True) + ``` + ## Import IoTHub Shared Access Policies can be imported using the `resource id`, e.g. @@ -466,6 +487,27 @@ def __init__(__self__, """ Manages an IotHub Shared Access Policy + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_shared_access_policy = azure.iot.SharedAccessPolicy("exampleSharedAccessPolicy", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + registry_read=True, + registry_write=True) + ``` + ## Import IoTHub Shared Access Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/time_series_insights_access_policy.py b/sdk/python/pulumi_azure/iot/time_series_insights_access_policy.py index 40d92aa6df..bc303eee0d 100644 --- a/sdk/python/pulumi_azure/iot/time_series_insights_access_policy.py +++ b/sdk/python/pulumi_azure/iot/time_series_insights_access_policy.py @@ -250,6 +250,24 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Access Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_time_series_insights_standard_environment = azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="S1_1", + data_retention_time="P30D") + example_time_series_insights_access_policy = azure.iot.TimeSeriesInsightsAccessPolicy("exampleTimeSeriesInsightsAccessPolicy", + time_series_insights_environment_id=example_time_series_insights_standard_environment.name, + principal_object_id="aGUID", + roles=["Reader"]) + ``` + ## Import Azure IoT Time Series Insights Access Policy can be imported using the `resource id`, e.g. @@ -275,6 +293,24 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Access Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_time_series_insights_standard_environment = azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="S1_1", + data_retention_time="P30D") + example_time_series_insights_access_policy = azure.iot.TimeSeriesInsightsAccessPolicy("exampleTimeSeriesInsightsAccessPolicy", + time_series_insights_environment_id=example_time_series_insights_standard_environment.name, + principal_object_id="aGUID", + roles=["Reader"]) + ``` + ## Import Azure IoT Time Series Insights Access Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/time_series_insights_event_source_eventhub.py b/sdk/python/pulumi_azure/iot/time_series_insights_event_source_eventhub.py index ad252aa63f..afad1df445 100644 --- a/sdk/python/pulumi_azure/iot/time_series_insights_event_source_eventhub.py +++ b/sdk/python/pulumi_azure/iot/time_series_insights_event_source_eventhub.py @@ -500,6 +500,58 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights EventHub Event Source. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=7) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_time_series_insights_gen2_environment = azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="L1", + id_properties=["id"], + storage=azure.iot.TimeSeriesInsightsGen2EnvironmentStorageArgs( + name=example_account.name, + key=example_account.primary_access_key, + )) + example_time_series_insights_event_source_eventhub = azure.iot.TimeSeriesInsightsEventSourceEventhub("exampleTimeSeriesInsightsEventSourceEventhub", + location=example_resource_group.location, + environment_id=example_time_series_insights_gen2_environment.id, + eventhub_name=example_event_hub.name, + namespace_name=example_event_hub_namespace.name, + shared_access_key=example_authorization_rule.primary_key, + shared_access_key_name=example_authorization_rule.name, + consumer_group_name=example_consumer_group.name, + event_source_resource_id=example_event_hub.id) + ``` + ## Import Azure IoT Time Series Insights EventHub Event Source can be imported using the `resource id`, e.g. @@ -531,6 +583,58 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights EventHub Event Source. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=7) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_time_series_insights_gen2_environment = azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="L1", + id_properties=["id"], + storage=azure.iot.TimeSeriesInsightsGen2EnvironmentStorageArgs( + name=example_account.name, + key=example_account.primary_access_key, + )) + example_time_series_insights_event_source_eventhub = azure.iot.TimeSeriesInsightsEventSourceEventhub("exampleTimeSeriesInsightsEventSourceEventhub", + location=example_resource_group.location, + environment_id=example_time_series_insights_gen2_environment.id, + eventhub_name=example_event_hub.name, + namespace_name=example_event_hub_namespace.name, + shared_access_key=example_authorization_rule.primary_key, + shared_access_key_name=example_authorization_rule.name, + consumer_group_name=example_consumer_group.name, + event_source_resource_id=example_event_hub.id) + ``` + ## Import Azure IoT Time Series Insights EventHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/time_series_insights_event_source_iothub.py b/sdk/python/pulumi_azure/iot/time_series_insights_event_source_iothub.py index 732c8a4779..cd8cbcb084 100644 --- a/sdk/python/pulumi_azure/iot/time_series_insights_event_source_iothub.py +++ b/sdk/python/pulumi_azure/iot/time_series_insights_event_source_iothub.py @@ -458,6 +458,48 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights IoTHub Event Source. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + )) + example_consumer_group = azure.iot.ConsumerGroup("exampleConsumerGroup", + iothub_name=example_io_t_hub.name, + eventhub_endpoint_name="events", + resource_group_name=example_resource_group.name) + storage = azure.storage.Account("storage", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_time_series_insights_gen2_environment = azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="L1", + id_properties=["id"], + storage=azure.iot.TimeSeriesInsightsGen2EnvironmentStorageArgs( + name=storage.name, + key=storage.primary_access_key, + )) + example_time_series_insights_event_source_iothub = azure.iot.TimeSeriesInsightsEventSourceIothub("exampleTimeSeriesInsightsEventSourceIothub", + location=example_resource_group.location, + environment_id=example_time_series_insights_gen2_environment.id, + iothub_name=example_io_t_hub.name, + shared_access_key=example_io_t_hub.shared_access_policies[0].primary_key, + shared_access_key_name=example_io_t_hub.shared_access_policies[0].key_name, + consumer_group_name=example_consumer_group.name, + event_source_resource_id=example_io_t_hub.id) + ``` + ## Import Azure IoT Time Series Insights IoTHub Event Source can be imported using the `resource id`, e.g. @@ -488,6 +530,48 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights IoTHub Event Source. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + )) + example_consumer_group = azure.iot.ConsumerGroup("exampleConsumerGroup", + iothub_name=example_io_t_hub.name, + eventhub_endpoint_name="events", + resource_group_name=example_resource_group.name) + storage = azure.storage.Account("storage", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_time_series_insights_gen2_environment = azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="L1", + id_properties=["id"], + storage=azure.iot.TimeSeriesInsightsGen2EnvironmentStorageArgs( + name=storage.name, + key=storage.primary_access_key, + )) + example_time_series_insights_event_source_iothub = azure.iot.TimeSeriesInsightsEventSourceIothub("exampleTimeSeriesInsightsEventSourceIothub", + location=example_resource_group.location, + environment_id=example_time_series_insights_gen2_environment.id, + iothub_name=example_io_t_hub.name, + shared_access_key=example_io_t_hub.shared_access_policies[0].primary_key, + shared_access_key_name=example_io_t_hub.shared_access_policies[0].key_name, + consumer_group_name=example_consumer_group.name, + event_source_resource_id=example_io_t_hub.id) + ``` + ## Import Azure IoT Time Series Insights IoTHub Event Source can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/time_series_insights_gen2_environment.py b/sdk/python/pulumi_azure/iot/time_series_insights_gen2_environment.py index 9c0507d3f9..834bedfc0c 100644 --- a/sdk/python/pulumi_azure/iot/time_series_insights_gen2_environment.py +++ b/sdk/python/pulumi_azure/iot/time_series_insights_gen2_environment.py @@ -392,6 +392,30 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Gen2 Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + storage = azure.storage.Account("storage", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_time_series_insights_gen2_environment = azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="L1", + warm_store_data_retention_time="P30D", + id_properties=["id"], + storage=azure.iot.TimeSeriesInsightsGen2EnvironmentStorageArgs( + name=storage.name, + key=storage.primary_access_key, + )) + ``` + ## Import Azure IoT Time Series Insights Gen2 Environment can be imported using the `resource id`, e.g. @@ -420,6 +444,30 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Gen2 Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + storage = azure.storage.Account("storage", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_time_series_insights_gen2_environment = azure.iot.TimeSeriesInsightsGen2Environment("exampleTimeSeriesInsightsGen2Environment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="L1", + warm_store_data_retention_time="P30D", + id_properties=["id"], + storage=azure.iot.TimeSeriesInsightsGen2EnvironmentStorageArgs( + name=storage.name, + key=storage.primary_access_key, + )) + ``` + ## Import Azure IoT Time Series Insights Gen2 Environment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/time_series_insights_reference_data_set.py b/sdk/python/pulumi_azure/iot/time_series_insights_reference_data_set.py index 75719c9441..19116b42c6 100644 --- a/sdk/python/pulumi_azure/iot/time_series_insights_reference_data_set.py +++ b/sdk/python/pulumi_azure/iot/time_series_insights_reference_data_set.py @@ -292,6 +292,27 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Reference Data Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_time_series_insights_standard_environment = azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="S1_1", + data_retention_time="P30D") + example_time_series_insights_reference_data_set = azure.iot.TimeSeriesInsightsReferenceDataSet("exampleTimeSeriesInsightsReferenceDataSet", + time_series_insights_environment_id=example_time_series_insights_standard_environment.id, + location=example_resource_group.location, + key_properties=[azure.iot.TimeSeriesInsightsReferenceDataSetKeyPropertyArgs( + name="keyProperty1", + type="String", + )]) + ``` + ## Import Azure IoT Time Series Insights Reference Data Set can be imported using the `resource id`, e.g. @@ -318,6 +339,27 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Reference Data Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_time_series_insights_standard_environment = azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="S1_1", + data_retention_time="P30D") + example_time_series_insights_reference_data_set = azure.iot.TimeSeriesInsightsReferenceDataSet("exampleTimeSeriesInsightsReferenceDataSet", + time_series_insights_environment_id=example_time_series_insights_standard_environment.id, + location=example_resource_group.location, + key_properties=[azure.iot.TimeSeriesInsightsReferenceDataSetKeyPropertyArgs( + name="keyProperty1", + type="String", + )]) + ``` + ## Import Azure IoT Time Series Insights Reference Data Set can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iot/time_series_insights_standard_environment.py b/sdk/python/pulumi_azure/iot/time_series_insights_standard_environment.py index 2d9b03e192..f547b86818 100644 --- a/sdk/python/pulumi_azure/iot/time_series_insights_standard_environment.py +++ b/sdk/python/pulumi_azure/iot/time_series_insights_standard_environment.py @@ -373,6 +373,20 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Standard Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_time_series_insights_standard_environment = azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="S1_1", + data_retention_time="P30D") + ``` + ## Import Azure IoT Time Series Insights Standard Environment can be imported using the `resource id`, e.g. @@ -401,6 +415,20 @@ def __init__(__self__, """ Manages an Azure IoT Time Series Insights Standard Environment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_time_series_insights_standard_environment = azure.iot.TimeSeriesInsightsStandardEnvironment("exampleTimeSeriesInsightsStandardEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="S1_1", + data_retention_time="P30D") + ``` + ## Import Azure IoT Time Series Insights Standard Environment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iotcentral/application.py b/sdk/python/pulumi_azure/iotcentral/application.py index 2fd89b2d37..b690b41f48 100644 --- a/sdk/python/pulumi_azure/iotcentral/application.py +++ b/sdk/python/pulumi_azure/iotcentral/application.py @@ -452,6 +452,25 @@ def __init__(__self__, """ Manages an IoT Central Application + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_application = azure.iotcentral.Application("exampleApplication", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sub_domain="example-iotcentral-app-subdomain", + display_name="example-iotcentral-app-display-name", + sku="ST1", + template="iotc-default@1.0.0", + tags={ + "Foo": "Bar", + }) + ``` + ## Import The IoT Central Application can be imported using the `resource id`, e.g. @@ -484,6 +503,25 @@ def __init__(__self__, """ Manages an IoT Central Application + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_application = azure.iotcentral.Application("exampleApplication", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sub_domain="example-iotcentral-app-subdomain", + display_name="example-iotcentral-app-display-name", + sku="ST1", + template="iotc-default@1.0.0", + tags={ + "Foo": "Bar", + }) + ``` + ## Import The IoT Central Application can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/iotcentral/application_network_rule_set.py b/sdk/python/pulumi_azure/iotcentral/application_network_rule_set.py index ce5dff3efe..78e9a0a821 100644 --- a/sdk/python/pulumi_azure/iotcentral/application_network_rule_set.py +++ b/sdk/python/pulumi_azure/iotcentral/application_network_rule_set.py @@ -221,6 +221,36 @@ def __init__(__self__, """ Manages an IoT Central Application Network Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_application = azure.iotcentral.Application("exampleApplication", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sub_domain="example-iotcentral-app-subdomain", + display_name="example-iotcentral-app-display-name", + sku="ST1", + tags={ + "Foo": "Bar", + }) + example_application_network_rule_set = azure.iotcentral.ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet", + iotcentral_application_id=example_application.id, + ip_rules=[ + azure.iotcentral.ApplicationNetworkRuleSetIpRuleArgs( + name="rule1", + ip_mask="10.0.1.0/24", + ), + azure.iotcentral.ApplicationNetworkRuleSetIpRuleArgs( + name="rule2", + ip_mask="10.1.1.0/24", + ), + ]) + ``` + ## Import IoT Central Application Network Rule Sets can be imported using the `resource id`, e.g. @@ -245,6 +275,36 @@ def __init__(__self__, """ Manages an IoT Central Application Network Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_application = azure.iotcentral.Application("exampleApplication", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sub_domain="example-iotcentral-app-subdomain", + display_name="example-iotcentral-app-display-name", + sku="ST1", + tags={ + "Foo": "Bar", + }) + example_application_network_rule_set = azure.iotcentral.ApplicationNetworkRuleSet("exampleApplicationNetworkRuleSet", + iotcentral_application_id=example_application.id, + ip_rules=[ + azure.iotcentral.ApplicationNetworkRuleSetIpRuleArgs( + name="rule1", + ip_mask="10.0.1.0/24", + ), + azure.iotcentral.ApplicationNetworkRuleSetIpRuleArgs( + name="rule2", + ip_mask="10.1.1.0/24", + ), + ]) + ``` + ## Import IoT Central Application Network Rule Sets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/keyvault/_inputs.py b/sdk/python/pulumi_azure/keyvault/_inputs.py index 0208b42db5..f04a866009 100644 --- a/sdk/python/pulumi_azure/keyvault/_inputs.py +++ b/sdk/python/pulumi_azure/keyvault/_inputs.py @@ -54,6 +54,9 @@ def __init__(__self__, *, > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ @@ -97,6 +100,9 @@ def password(self) -> Optional[pulumi.Input[str]]: > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ @@ -889,6 +895,9 @@ def __init__(__self__, *, > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ @@ -932,6 +941,9 @@ def password(self) -> Optional[pulumi.Input[str]]: > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ diff --git a/sdk/python/pulumi_azure/keyvault/access_policy.py b/sdk/python/pulumi_azure/keyvault/access_policy.py index 5a5b3cf77d..f3ffaf0e4c 100644 --- a/sdk/python/pulumi_azure/keyvault/access_policy.py +++ b/sdk/python/pulumi_azure/keyvault/access_policy.py @@ -389,6 +389,39 @@ def __init__(__self__, > **NOTE:** Azure permits a maximum of 1024 Access Policies per Key Vault - [more information can be found in this document](https://docs.microsoft.com/azure/key-vault/key-vault-secure-your-key-vault#data-plane-access-control). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=["Get"], + secret_permissions=["Get"]) + example_service_principal = azuread.get_service_principal(display_name="example-app") + example_principal = azure.keyvault.AccessPolicy("example-principal", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_service_principal.object_id, + key_permissions=[ + "Get", + "List", + "Encrypt", + "Decrypt", + ]) + ``` + ## Import Key Vault Access Policies can be imported using the Resource ID of the Key Vault, plus some additional metadata. If both an `object_id` and `application_id` are specified, then the Access Policy can be imported using the following code @@ -429,6 +462,39 @@ def __init__(__self__, > **NOTE:** Azure permits a maximum of 1024 Access Policies per Key Vault - [more information can be found in this document](https://docs.microsoft.com/azure/key-vault/key-vault-secure-your-key-vault#data-plane-access-control). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=["Get"], + secret_permissions=["Get"]) + example_service_principal = azuread.get_service_principal(display_name="example-app") + example_principal = azure.keyvault.AccessPolicy("example-principal", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_service_principal.object_id, + key_permissions=[ + "Get", + "List", + "Encrypt", + "Decrypt", + ]) + ``` + ## Import Key Vault Access Policies can be imported using the Resource ID of the Key Vault, plus some additional metadata. If both an `object_id` and `application_id` are specified, then the Access Policy can be imported using the following code diff --git a/sdk/python/pulumi_azure/keyvault/certifiate.py b/sdk/python/pulumi_azure/keyvault/certifiate.py index c8af3d9875..f966d89f1b 100644 --- a/sdk/python/pulumi_azure/keyvault/certifiate.py +++ b/sdk/python/pulumi_azure/keyvault/certifiate.py @@ -465,6 +465,180 @@ def __init__(__self__, ======= > > > > > > > 8d78c87098 (Update-documentation) ## Example Usage + ### Importing A PFX) + + > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + ``` + ### Generating a new certificate + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "Purge", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + extended_key_usages=["1.3.6.1.5.5.7.3.1"], + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject_alternative_names=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs( + dns_names=[ + "internal.contoso.com", + "domain.hello.world", + ], + ), + subject="CN=hello-world", + validity_in_months=12, + ), + )) + ``` ## Import @@ -499,6 +673,180 @@ def __init__(__self__, ======= > > > > > > > 8d78c87098 (Update-documentation) ## Example Usage + ### Importing A PFX) + + > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + ``` + ### Generating a new certificate + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "Purge", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + extended_key_usages=["1.3.6.1.5.5.7.3.1"], + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject_alternative_names=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs( + dns_names=[ + "internal.contoso.com", + "domain.hello.world", + ], + ), + subject="CN=hello-world", + validity_in_months=12, + ), + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/keyvault/certificate.py b/sdk/python/pulumi_azure/keyvault/certificate.py index 9839800e9b..5589092554 100644 --- a/sdk/python/pulumi_azure/keyvault/certificate.py +++ b/sdk/python/pulumi_azure/keyvault/certificate.py @@ -460,6 +460,180 @@ def __init__(__self__, ======= > > > > > > > 8d78c87098 (Update-documentation) ## Example Usage + ### Importing A PFX) + + > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + ``` + ### Generating a new certificate + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "Purge", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + extended_key_usages=["1.3.6.1.5.5.7.3.1"], + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject_alternative_names=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs( + dns_names=[ + "internal.contoso.com", + "domain.hello.world", + ], + ), + subject="CN=hello-world", + validity_in_months=12, + ), + )) + ``` ## Import @@ -494,6 +668,180 @@ def __init__(__self__, ======= > > > > > > > 8d78c87098 (Update-documentation) ## Example Usage + ### Importing A PFX) + + > **Note:** this example assumed the PFX file is located in the same directory at `certificate-to-import.pfx`. + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + ``` + ### Generating a new certificate + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "Purge", + "SetIssuers", + "Update", + ], + key_permissions=[ + "Backup", + "Create", + "Decrypt", + "Delete", + "Encrypt", + "Get", + "Import", + "List", + "Purge", + "Recover", + "Restore", + "Sign", + "UnwrapKey", + "Update", + "Verify", + "WrapKey", + ], + secret_permissions=[ + "Backup", + "Delete", + "Get", + "List", + "Purge", + "Recover", + "Restore", + "Set", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate_policy=azure.keyvault.CertificateCertificatePolicyArgs( + issuer_parameters=azure.keyvault.CertificateCertificatePolicyIssuerParametersArgs( + name="Self", + ), + key_properties=azure.keyvault.CertificateCertificatePolicyKeyPropertiesArgs( + exportable=True, + key_size=2048, + key_type="RSA", + reuse_key=True, + ), + lifetime_actions=[azure.keyvault.CertificateCertificatePolicyLifetimeActionArgs( + action=azure.keyvault.CertificateCertificatePolicyLifetimeActionActionArgs( + action_type="AutoRenew", + ), + trigger=azure.keyvault.CertificateCertificatePolicyLifetimeActionTriggerArgs( + days_before_expiry=30, + ), + )], + secret_properties=azure.keyvault.CertificateCertificatePolicySecretPropertiesArgs( + content_type="application/x-pkcs12", + ), + x509_certificate_properties=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesArgs( + extended_key_usages=["1.3.6.1.5.5.7.3.1"], + key_usages=[ + "cRLSign", + "dataEncipherment", + "digitalSignature", + "keyAgreement", + "keyCertSign", + "keyEncipherment", + ], + subject_alternative_names=azure.keyvault.CertificateCertificatePolicyX509CertificatePropertiesSubjectAlternativeNamesArgs( + dns_names=[ + "internal.contoso.com", + "domain.hello.world", + ], + ), + subject="CN=hello-world", + validity_in_months=12, + ), + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/keyvault/certificate_contacts.py b/sdk/python/pulumi_azure/keyvault/certificate_contacts.py index 770f6ddd59..9e3aa788a9 100644 --- a/sdk/python/pulumi_azure/keyvault/certificate_contacts.py +++ b/sdk/python/pulumi_azure/keyvault/certificate_contacts.py @@ -140,6 +140,41 @@ def __init__(__self__, > **Note:** It's possible to define Key Vault Certificate Contacts both within the `keyvault.KeyVault` resource via the `contact` block and by using the `keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=["ManageContacts"], + key_permissions=["Create"], + secret_permissions=["Set"]) + example_certificate_contacts = azure.keyvault.CertificateContacts("exampleCertificateContacts", + key_vault_id=example_key_vault.id, + contacts=[ + azure.keyvault.CertificateContactsContactArgs( + email="example@example.com", + name="example", + phone="01234567890", + ), + azure.keyvault.CertificateContactsContactArgs( + email="example2@example.com", + ), + ], + opts=pulumi.ResourceOptions(depends_on=[example_access_policy])) + ``` + ## Import Key Vault Certificate Contacts can be imported using the `resource id`, e.g. @@ -166,6 +201,41 @@ def __init__(__self__, > **Note:** It's possible to define Key Vault Certificate Contacts both within the `keyvault.KeyVault` resource via the `contact` block and by using the `keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=["ManageContacts"], + key_permissions=["Create"], + secret_permissions=["Set"]) + example_certificate_contacts = azure.keyvault.CertificateContacts("exampleCertificateContacts", + key_vault_id=example_key_vault.id, + contacts=[ + azure.keyvault.CertificateContactsContactArgs( + email="example@example.com", + name="example", + phone="01234567890", + ), + azure.keyvault.CertificateContactsContactArgs( + email="example2@example.com", + ), + ], + opts=pulumi.ResourceOptions(depends_on=[example_access_policy])) + ``` + ## Import Key Vault Certificate Contacts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/keyvault/certificate_issuer.py b/sdk/python/pulumi_azure/keyvault/certificate_issuer.py index 630f9612ae..a559c59a6b 100644 --- a/sdk/python/pulumi_azure/keyvault/certificate_issuer.py +++ b/sdk/python/pulumi_azure/keyvault/certificate_issuer.py @@ -333,6 +333,27 @@ def __init__(__self__, """ Manages a Key Vault Certificate Issuer. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="standard", + tenant_id=current.tenant_id) + example_certificate_issuer = azure.keyvault.CertificateIssuer("exampleCertificateIssuer", + org_id="ExampleOrgName", + key_vault_id=example_key_vault.id, + provider_name="DigiCert", + account_id="0000", + password="example-password") + ``` + ## Import Key Vault Certificate Issuers can be imported using the `resource id`, e.g. @@ -360,6 +381,27 @@ def __init__(__self__, """ Manages a Key Vault Certificate Issuer. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="standard", + tenant_id=current.tenant_id) + example_certificate_issuer = azure.keyvault.CertificateIssuer("exampleCertificateIssuer", + org_id="ExampleOrgName", + key_vault_id=example_key_vault.id, + provider_name="DigiCert", + account_id="0000", + password="example-password") + ``` + ## Import Key Vault Certificate Issuers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/keyvault/get_access_policy.py b/sdk/python/pulumi_azure/keyvault/get_access_policy.py index f31011c177..e6da0b0800 100644 --- a/sdk/python/pulumi_azure/keyvault/get_access_policy.py +++ b/sdk/python/pulumi_azure/keyvault/get_access_policy.py @@ -94,6 +94,16 @@ def get_access_policy(name: Optional[str] = None, """ Use this data source to access information about the permissions from the Management Key Vault Templates. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + contributor = azure.keyvault.get_access_policy(name="Key Management") + pulumi.export("accessPolicyKeyPermissions", contributor.key_permissions) + ``` + :param str name: Specifies the name of the Management Template. Possible values are: `Key Management`, `Secret Management`, `Certificate Management`, `Key & Secret Management`, `Key & Certificate Management`, @@ -118,6 +128,16 @@ def get_access_policy_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about the permissions from the Management Key Vault Templates. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + contributor = azure.keyvault.get_access_policy(name="Key Management") + pulumi.export("accessPolicyKeyPermissions", contributor.key_permissions) + ``` + :param str name: Specifies the name of the Management Template. Possible values are: `Key Management`, `Secret Management`, `Certificate Management`, `Key & Secret Management`, `Key & Certificate Management`, diff --git a/sdk/python/pulumi_azure/keyvault/get_certificate.py b/sdk/python/pulumi_azure/keyvault/get_certificate.py index 802e106f1a..a3f03eedbc 100644 --- a/sdk/python/pulumi_azure/keyvault/get_certificate.py +++ b/sdk/python/pulumi_azure/keyvault/get_certificate.py @@ -229,6 +229,19 @@ def get_certificate(key_vault_id: Optional[str] = None, """ Use this data source to access information about an existing Key Vault Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name="examplekv", + resource_group_name="some-resource-group") + example_certificate = azure.keyvault.get_certificate(name="secret-sauce", + key_vault_id=example_key_vault.id) + pulumi.export("certificateThumbprint", example_certificate.thumbprint) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance where the Secret resides, available on the `keyvault.KeyVault` Data Source / Resource. :param str name: Specifies the name of the Key Vault Certificate. @@ -270,6 +283,19 @@ def get_certificate_output(key_vault_id: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Key Vault Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name="examplekv", + resource_group_name="some-resource-group") + example_certificate = azure.keyvault.get_certificate(name="secret-sauce", + key_vault_id=example_key_vault.id) + pulumi.export("certificateThumbprint", example_certificate.thumbprint) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance where the Secret resides, available on the `keyvault.KeyVault` Data Source / Resource. :param str name: Specifies the name of the Key Vault Certificate. diff --git a/sdk/python/pulumi_azure/keyvault/get_certificate_data.py b/sdk/python/pulumi_azure/keyvault/get_certificate_data.py index 66566071c1..7c319abdb2 100644 --- a/sdk/python/pulumi_azure/keyvault/get_certificate_data.py +++ b/sdk/python/pulumi_azure/keyvault/get_certificate_data.py @@ -164,6 +164,19 @@ def get_certificate_data(key_vault_id: Optional[str] = None, > **Note:** This data source uses the `GetSecret` function of the Azure API, to get the key of the certificate. Therefore you need secret/get permission + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name="examplekv", + resource_group_name="some-resource-group") + example_certificate_data = azure.keyvault.get_certificate_data(name="secret-sauce", + key_vault_id=example_key_vault.id) + pulumi.export("examplePem", example_certificate_data.pem) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance where the Secret resides, available on the `keyvault.KeyVault` Data Source / Resource. :param str name: Specifies the name of the Key Vault Secret. @@ -202,6 +215,19 @@ def get_certificate_data_output(key_vault_id: Optional[pulumi.Input[str]] = None > **Note:** This data source uses the `GetSecret` function of the Azure API, to get the key of the certificate. Therefore you need secret/get permission + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name="examplekv", + resource_group_name="some-resource-group") + example_certificate_data = azure.keyvault.get_certificate_data(name="secret-sauce", + key_vault_id=example_key_vault.id) + pulumi.export("examplePem", example_certificate_data.pem) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance where the Secret resides, available on the `keyvault.KeyVault` Data Source / Resource. :param str name: Specifies the name of the Key Vault Secret. diff --git a/sdk/python/pulumi_azure/keyvault/get_certificate_issuer.py b/sdk/python/pulumi_azure/keyvault/get_certificate_issuer.py index 01611ebc37..87d5d13854 100644 --- a/sdk/python/pulumi_azure/keyvault/get_certificate_issuer.py +++ b/sdk/python/pulumi_azure/keyvault/get_certificate_issuer.py @@ -117,6 +117,19 @@ def get_certificate_issuer(key_vault_id: Optional[str] = None, """ Use this data source to access information about an existing Key Vault Certificate Issuer. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name="mykeyvault", + resource_group_name="some-resource-group") + example_certificate_issuer = azure.keyvault.get_certificate_issuer(name="existing", + key_vault_id=example_key_vault.id) + pulumi.export("id", example_certificate_issuer.id) + ``` + :param str key_vault_id: The ID of the Key Vault in which to locate the Certificate Issuer. :param str name: The name of the Key Vault Certificate Issuer. @@ -144,6 +157,19 @@ def get_certificate_issuer_output(key_vault_id: Optional[pulumi.Input[str]] = No """ Use this data source to access information about an existing Key Vault Certificate Issuer. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name="mykeyvault", + resource_group_name="some-resource-group") + example_certificate_issuer = azure.keyvault.get_certificate_issuer(name="existing", + key_vault_id=example_key_vault.id) + pulumi.export("id", example_certificate_issuer.id) + ``` + :param str key_vault_id: The ID of the Key Vault in which to locate the Certificate Issuer. :param str name: The name of the Key Vault Certificate Issuer. diff --git a/sdk/python/pulumi_azure/keyvault/get_key.py b/sdk/python/pulumi_azure/keyvault/get_key.py index c3b5af9cf1..29efc53d6c 100644 --- a/sdk/python/pulumi_azure/keyvault/get_key.py +++ b/sdk/python/pulumi_azure/keyvault/get_key.py @@ -248,6 +248,17 @@ def get_key(key_vault_id: Optional[str] = None, """ Use this data source to access information about an existing Key Vault Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_key(name="secret-sauce", + key_vault_id=data["azurerm_key_vault"]["existing"]["id"]) + pulumi.export("keyType", example.key_type) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance where the Secret resides, available on the `keyvault.KeyVault` Data Source / Resource. @@ -288,6 +299,17 @@ def get_key_output(key_vault_id: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Key Vault Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_key(name="secret-sauce", + key_vault_id=data["azurerm_key_vault"]["existing"]["id"]) + pulumi.export("keyType", example.key_type) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance where the Secret resides, available on the `keyvault.KeyVault` Data Source / Resource. diff --git a/sdk/python/pulumi_azure/keyvault/get_key_vault.py b/sdk/python/pulumi_azure/keyvault/get_key_vault.py index ef9e6dcb08..e8182e1f07 100644 --- a/sdk/python/pulumi_azure/keyvault/get_key_vault.py +++ b/sdk/python/pulumi_azure/keyvault/get_key_vault.py @@ -222,6 +222,17 @@ def get_key_vault(name: Optional[str] = None, """ Use this data source to access information about an existing Key Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_key_vault(name="mykeyvault", + resource_group_name="some-resource-group") + pulumi.export("vaultUri", example.vault_uri) + ``` + :param str name: Specifies the name of the Key Vault. :param str resource_group_name: The name of the Resource Group in which the Key Vault exists. @@ -258,6 +269,17 @@ def get_key_vault_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Key Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_key_vault(name="mykeyvault", + resource_group_name="some-resource-group") + pulumi.export("vaultUri", example.vault_uri) + ``` + :param str name: Specifies the name of the Key Vault. :param str resource_group_name: The name of the Resource Group in which the Key Vault exists. diff --git a/sdk/python/pulumi_azure/keyvault/get_managed_hardware_security_module.py b/sdk/python/pulumi_azure/keyvault/get_managed_hardware_security_module.py index 61bc4ed4ea..3d3fa1297e 100644 --- a/sdk/python/pulumi_azure/keyvault/get_managed_hardware_security_module.py +++ b/sdk/python/pulumi_azure/keyvault/get_managed_hardware_security_module.py @@ -164,6 +164,17 @@ def get_managed_hardware_security_module(name: Optional[str] = None, """ Use this data source to access information about an existing Key Vault Managed Hardware Security Module. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_managed_hardware_security_module(name="mykeyvaultHsm", + resource_group_name="some-resource-group") + pulumi.export("hsmUri", example.hsm_uri) + ``` + :param str name: The name of the Key Vault Managed Hardware Security Module. :param str resource_group_name: The name of the Resource Group in which the Key Vault Managed Hardware Security Module exists. @@ -195,6 +206,17 @@ def get_managed_hardware_security_module_output(name: Optional[pulumi.Input[str] """ Use this data source to access information about an existing Key Vault Managed Hardware Security Module. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_managed_hardware_security_module(name="mykeyvaultHsm", + resource_group_name="some-resource-group") + pulumi.export("hsmUri", example.hsm_uri) + ``` + :param str name: The name of the Key Vault Managed Hardware Security Module. :param str resource_group_name: The name of the Resource Group in which the Key Vault Managed Hardware Security Module exists. diff --git a/sdk/python/pulumi_azure/keyvault/get_secret.py b/sdk/python/pulumi_azure/keyvault/get_secret.py index e6fc33abbd..dde73aa17f 100644 --- a/sdk/python/pulumi_azure/keyvault/get_secret.py +++ b/sdk/python/pulumi_azure/keyvault/get_secret.py @@ -174,6 +174,17 @@ def get_secret(key_vault_id: Optional[str] = None, """ Use this data source to access information about an existing Key Vault Secret. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_secret(name="secret-sauce", + key_vault_id=data["azurerm_key_vault"]["existing"]["id"]) + pulumi.export("secretValue", example.value) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance to fetch secret names from, available on the `keyvault.KeyVault` Data Source / Resource. :param str name: Specifies the name of the Key Vault Secret. @@ -211,6 +222,17 @@ def get_secret_output(key_vault_id: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Key Vault Secret. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.keyvault.get_secret(name="secret-sauce", + key_vault_id=data["azurerm_key_vault"]["existing"]["id"]) + pulumi.export("secretValue", example.value) + ``` + :param str key_vault_id: Specifies the ID of the Key Vault instance to fetch secret names from, available on the `keyvault.KeyVault` Data Source / Resource. :param str name: Specifies the name of the Key Vault Secret. diff --git a/sdk/python/pulumi_azure/keyvault/key.py b/sdk/python/pulumi_azure/keyvault/key.py index 10360f78a2..ccf4c0c1d1 100644 --- a/sdk/python/pulumi_azure/keyvault/key.py +++ b/sdk/python/pulumi_azure/keyvault/key.py @@ -652,6 +652,55 @@ def __init__(__self__, > **Note:** To use this resource, your client should have RBAC roles with permissions like `Key Vault Crypto Officer` or `Key Vault Administrator` or an assigned Key Vault Access Policy with permissions `Create`,`Delete`,`Get`,`Purge`,`Recover`,`Update` and `GetRotationPolicy` for keys without Rotation Policy. Include `SetRotationPolicy` for keys with Rotation Policy. > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Key resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_keys_on_destroy` for more information. + ### Additional Examples + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "GetRotationPolicy", + "SetRotationPolicy", + ], + secret_permissions=["Set"], + )]) + generated = azure.keyvault.Key("generated", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + rotation_policy=azure.keyvault.KeyRotationPolicyArgs( + automatic=azure.keyvault.KeyRotationPolicyAutomaticArgs( + time_before_expiry="P30D", + ), + expire_after="P90D", + notify_before_expiry="P29D", + )) + ``` ## Import @@ -688,6 +737,55 @@ def __init__(__self__, > **Note:** To use this resource, your client should have RBAC roles with permissions like `Key Vault Crypto Officer` or `Key Vault Administrator` or an assigned Key Vault Access Policy with permissions `Create`,`Delete`,`Get`,`Purge`,`Recover`,`Update` and `GetRotationPolicy` for keys without Rotation Policy. Include `SetRotationPolicy` for keys with Rotation Policy. > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Key resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_keys_on_destroy` for more information. + ### Additional Examples + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Delete", + "Get", + "Purge", + "Recover", + "Update", + "GetRotationPolicy", + "SetRotationPolicy", + ], + secret_permissions=["Set"], + )]) + generated = azure.keyvault.Key("generated", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + rotation_policy=azure.keyvault.KeyRotationPolicyArgs( + automatic=azure.keyvault.KeyRotationPolicyAutomaticArgs( + time_before_expiry="P30D", + ), + expire_after="P90D", + notify_before_expiry="P29D", + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/keyvault/key_vault.py b/sdk/python/pulumi_azure/keyvault/key_vault.py index 9e441d1da0..f837b2b01c 100644 --- a/sdk/python/pulumi_azure/keyvault/key_vault.py +++ b/sdk/python/pulumi_azure/keyvault/key_vault.py @@ -757,6 +757,31 @@ def __init__(__self__, > **Note:** It's possible to define Key Vault Certificate Contacts both within the `keyvault.KeyVault` resource via the `contact` block and by using the `keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=["Get"], + secret_permissions=["Get"], + storage_permissions=["Get"], + )]) + ``` + ## Import Key Vault's can be imported using the `resource id`, e.g. @@ -807,6 +832,31 @@ def __init__(__self__, > **Note:** It's possible to define Key Vault Certificate Contacts both within the `keyvault.KeyVault` resource via the `contact` block and by using the `keyvault.CertificateContacts` resource. However it's not possible to use both methods to manage Certificate Contacts within a KeyVault, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=["Get"], + secret_permissions=["Get"], + storage_permissions=["Get"], + )]) + ``` + ## Import Key Vault's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/keyvault/managed_hardware_security_module.py b/sdk/python/pulumi_azure/keyvault/managed_hardware_security_module.py index c7e0eac3f7..ba342b65c7 100644 --- a/sdk/python/pulumi_azure/keyvault/managed_hardware_security_module.py +++ b/sdk/python/pulumi_azure/keyvault/managed_hardware_security_module.py @@ -623,6 +623,27 @@ def __init__(__self__, > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Managed Hardware Security Module resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_hardware_security_modules_on_destroy` for more information. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_hardware_security_module = azure.keyvault.ManagedHardwareSecurityModule("exampleManagedHardwareSecurityModule", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Standard_B1", + purge_protection_enabled=False, + soft_delete_retention_days=90, + tenant_id=current.tenant_id, + admin_object_ids=[current.object_id], + tags={ + "Env": "Test", + }) + ``` + ## Import Key Vault Managed Hardware Security Module can be imported using the `resource id`, e.g. @@ -658,6 +679,27 @@ def __init__(__self__, > **Note:** The Azure Provider includes a Feature Toggle which will purge a Key Vault Managed Hardware Security Module resource on destroy, rather than the default soft-delete. See `purge_soft_deleted_hardware_security_modules_on_destroy` for more information. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_hardware_security_module = azure.keyvault.ManagedHardwareSecurityModule("exampleManagedHardwareSecurityModule", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Standard_B1", + purge_protection_enabled=False, + soft_delete_retention_days=90, + tenant_id=current.tenant_id, + admin_object_ids=[current.object_id], + tags={ + "Env": "Test", + }) + ``` + ## Import Key Vault Managed Hardware Security Module can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/keyvault/managed_storage_account.py b/sdk/python/pulumi_azure/keyvault/managed_storage_account.py index 7370fa67d8..76d78946c6 100644 --- a/sdk/python/pulumi_azure/keyvault/managed_storage_account.py +++ b/sdk/python/pulumi_azure/keyvault/managed_storage_account.py @@ -344,6 +344,100 @@ def __init__(__self__, """ Manages a Key Vault Managed Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=[ + "Get", + "Delete", + ], + storage_permissions=[ + "Get", + "List", + "Set", + "SetSAS", + "GetSAS", + "DeleteSAS", + "Update", + "RegenerateKey", + ], + )]) + example_managed_storage_account = azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + storage_account_key="key1", + regenerate_key_automatically=False, + regeneration_period="P1D") + ``` + ### Automatically Regenerate Storage Account Access Key) + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + test = azuread.get_service_principal(application_id="cfa8b339-82a2-471a-a3c9-0fc0be7a4093") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=[ + "Get", + "Delete", + ], + storage_permissions=[ + "Get", + "List", + "Set", + "SetSAS", + "GetSAS", + "DeleteSAS", + "Update", + "RegenerateKey", + ], + )]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_account.id, + role_definition_name="Storage Account Key Operator Service Role", + principal_id=test.id) + example_managed_storage_account = azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + storage_account_key="key1", + regenerate_key_automatically=True, + regeneration_period="P1D", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Key Vault Managed Storage Accounts can be imported using the `resource id`, e.g. @@ -373,6 +467,100 @@ def __init__(__self__, """ Manages a Key Vault Managed Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=[ + "Get", + "Delete", + ], + storage_permissions=[ + "Get", + "List", + "Set", + "SetSAS", + "GetSAS", + "DeleteSAS", + "Update", + "RegenerateKey", + ], + )]) + example_managed_storage_account = azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + storage_account_key="key1", + regenerate_key_automatically=False, + regeneration_period="P1D") + ``` + ### Automatically Regenerate Storage Account Access Key) + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + test = azuread.get_service_principal(application_id="cfa8b339-82a2-471a-a3c9-0fc0be7a4093") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=[ + "Get", + "Delete", + ], + storage_permissions=[ + "Get", + "List", + "Set", + "SetSAS", + "GetSAS", + "DeleteSAS", + "Update", + "RegenerateKey", + ], + )]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_account.id, + role_definition_name="Storage Account Key Operator Service Role", + principal_id=test.id) + example_managed_storage_account = azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + storage_account_key="key1", + regenerate_key_automatically=True, + regeneration_period="P1D", + opts=pulumi.ResourceOptions(depends_on=[example_assignment])) + ``` + ## Import Key Vault Managed Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/keyvault/managed_storage_account_sas_token_definition.py b/sdk/python/pulumi_azure/keyvault/managed_storage_account_sas_token_definition.py index 60dc5d6251..104bc3321c 100644 --- a/sdk/python/pulumi_azure/keyvault/managed_storage_account_sas_token_definition.py +++ b/sdk/python/pulumi_azure/keyvault/managed_storage_account_sas_token_definition.py @@ -316,6 +316,82 @@ def __init__(__self__, """ Manages a Key Vault Managed Storage Account SAS Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_client_config = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_account_sas = azure.storage.get_account_sas_output(connection_string=example_account.primary_connection_string, + https_only=True, + resource_types=azure.storage.GetAccountSASResourceTypesArgs( + service=True, + container=False, + object=False, + ), + services=azure.storage.GetAccountSASServicesArgs( + blob=True, + queue=False, + table=False, + file=False, + ), + start="2021-04-30T00:00:00Z", + expiry="2023-04-30T00:00:00Z", + permissions=azure.storage.GetAccountSASPermissionsArgs( + read=True, + write=True, + delete=False, + list=False, + add=True, + create=True, + update=False, + process=False, + tag=False, + filter=False, + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=example_client_config.tenant_id, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_client_config.tenant_id, + object_id=example_client_config.object_id, + secret_permissions=[ + "Get", + "Delete", + ], + storage_permissions=[ + "Get", + "List", + "Set", + "SetSAS", + "GetSAS", + "DeleteSAS", + "Update", + "RegenerateKey", + ], + )]) + example_managed_storage_account = azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + storage_account_key="key1", + regenerate_key_automatically=False, + regeneration_period="P1D") + example_managed_storage_account_sas_token_definition = azure.keyvault.ManagedStorageAccountSasTokenDefinition("exampleManagedStorageAccountSasTokenDefinition", + validity_period="P1D", + managed_storage_account_id=example_managed_storage_account.id, + sas_template_uri=example_account_sas.sas, + sas_type="account") + ``` + ## Import Key Vaults can be imported using the `resource id`, e.g. @@ -342,6 +418,82 @@ def __init__(__self__, """ Manages a Key Vault Managed Storage Account SAS Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_client_config = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_account_sas = azure.storage.get_account_sas_output(connection_string=example_account.primary_connection_string, + https_only=True, + resource_types=azure.storage.GetAccountSASResourceTypesArgs( + service=True, + container=False, + object=False, + ), + services=azure.storage.GetAccountSASServicesArgs( + blob=True, + queue=False, + table=False, + file=False, + ), + start="2021-04-30T00:00:00Z", + expiry="2023-04-30T00:00:00Z", + permissions=azure.storage.GetAccountSASPermissionsArgs( + read=True, + write=True, + delete=False, + list=False, + add=True, + create=True, + update=False, + process=False, + tag=False, + filter=False, + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=example_client_config.tenant_id, + sku_name="standard", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_client_config.tenant_id, + object_id=example_client_config.object_id, + secret_permissions=[ + "Get", + "Delete", + ], + storage_permissions=[ + "Get", + "List", + "Set", + "SetSAS", + "GetSAS", + "DeleteSAS", + "Update", + "RegenerateKey", + ], + )]) + example_managed_storage_account = azure.keyvault.ManagedStorageAccount("exampleManagedStorageAccount", + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + storage_account_key="key1", + regenerate_key_automatically=False, + regeneration_period="P1D") + example_managed_storage_account_sas_token_definition = azure.keyvault.ManagedStorageAccountSasTokenDefinition("exampleManagedStorageAccountSasTokenDefinition", + validity_period="P1D", + managed_storage_account_id=example_managed_storage_account.id, + sas_template_uri=example_account_sas.sas, + sas_type="account") + ``` + ## Import Key Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/keyvault/outputs.py b/sdk/python/pulumi_azure/keyvault/outputs.py index 9436d8af15..8959ed312d 100644 --- a/sdk/python/pulumi_azure/keyvault/outputs.py +++ b/sdk/python/pulumi_azure/keyvault/outputs.py @@ -69,6 +69,9 @@ def __init__(__self__, *, > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ @@ -108,6 +111,9 @@ def password(self) -> Optional[str]: > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ @@ -930,6 +936,9 @@ def __init__(__self__, *, > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ @@ -969,6 +978,9 @@ def password(self) -> Optional[str]: > **NOTE:** A PEM certificate is already base64 encoded. To successfully import, the `contents` property should include a PEM encoded X509 certificate and a private_key in pkcs8 format. There should only be linux style `\\n` line endings and the whole block should have the PEM begin/end blocks around the certificate data and the private key data. To convert a private key to pkcs8 format with openssl use: + ```python + import pulumi + ``` The PEM content should look something like: """ diff --git a/sdk/python/pulumi_azure/keyvault/secret.py b/sdk/python/pulumi_azure/keyvault/secret.py index f53df6b685..37d34a4649 100644 --- a/sdk/python/pulumi_azure/keyvault/secret.py +++ b/sdk/python/pulumi_azure/keyvault/secret.py @@ -425,6 +425,39 @@ def __init__(__self__, ======= > > > > > > > 8d78c87098 (Update-documentation) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + )]) + example_secret = azure.keyvault.Secret("exampleSecret", + value="szechuan", + key_vault_id=example_key_vault.id) + ``` ## Import @@ -463,6 +496,39 @@ def __init__(__self__, ======= > > > > > > > 8d78c87098 (Update-documentation) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + ], + secret_permissions=[ + "Set", + "Get", + "Delete", + "Purge", + "Recover", + ], + )]) + example_secret = azure.keyvault.Secret("exampleSecret", + value="szechuan", + key_vault_id=example_key_vault.id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/kusto/attached_database_configuration.py b/sdk/python/pulumi_azure/kusto/attached_database_configuration.py index e65b4dc4c7..c61506fedc 100644 --- a/sdk/python/pulumi_azure/kusto/attached_database_configuration.py +++ b/sdk/python/pulumi_azure/kusto/attached_database_configuration.py @@ -396,6 +396,51 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Attached Database Configuration + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + follower_cluster = azure.kusto.Cluster("followerCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + followed_cluster = azure.kusto.Cluster("followedCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + followed_database = azure.kusto.Database("followedDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=follower_cluster.name) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=follower_cluster.name) + example_attached_database_configuration = azure.kusto.AttachedDatabaseConfiguration("exampleAttachedDatabaseConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=follower_cluster.name, + cluster_resource_id=followed_cluster.id, + database_name=example_database.name, + sharing=azure.kusto.AttachedDatabaseConfigurationSharingArgs( + external_tables_to_excludes=["ExternalTable2"], + external_tables_to_includes=["ExternalTable1"], + materialized_views_to_excludes=["MaterializedViewTable2"], + materialized_views_to_includes=["MaterializedViewTable1"], + tables_to_excludes=["Table2"], + tables_to_includes=["Table1"], + )) + ``` + ## Import Kusto Attached Database Configurations can be imported using the `resource id`, e.g. @@ -424,6 +469,51 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Attached Database Configuration + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + follower_cluster = azure.kusto.Cluster("followerCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + followed_cluster = azure.kusto.Cluster("followedCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + followed_database = azure.kusto.Database("followedDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=follower_cluster.name) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=follower_cluster.name) + example_attached_database_configuration = azure.kusto.AttachedDatabaseConfiguration("exampleAttachedDatabaseConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=follower_cluster.name, + cluster_resource_id=followed_cluster.id, + database_name=example_database.name, + sharing=azure.kusto.AttachedDatabaseConfigurationSharingArgs( + external_tables_to_excludes=["ExternalTable2"], + external_tables_to_includes=["ExternalTable1"], + materialized_views_to_excludes=["MaterializedViewTable2"], + materialized_views_to_includes=["MaterializedViewTable1"], + tables_to_excludes=["Table2"], + tables_to_includes=["Table1"], + )) + ``` + ## Import Kusto Attached Database Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/cluster.py b/sdk/python/pulumi_azure/kusto/cluster.py index ef527de26d..a0cce7f7cc 100644 --- a/sdk/python/pulumi_azure/kusto/cluster.py +++ b/sdk/python/pulumi_azure/kusto/cluster.py @@ -990,6 +990,25 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Cluster + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + ), + tags={ + "Environment": "Production", + }) + ``` + ## Import Kusto Clusters can be imported using the `resource id`, e.g. @@ -1035,6 +1054,25 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Cluster + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + ), + tags={ + "Environment": "Production", + }) + ``` + ## Import Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/cluster_customer_managed_key.py b/sdk/python/pulumi_azure/kusto/cluster_customer_managed_key.py index 33433fdd50..1bd542308a 100644 --- a/sdk/python/pulumi_azure/kusto/cluster_customer_managed_key.py +++ b/sdk/python/pulumi_azure/kusto/cluster_customer_managed_key.py @@ -262,6 +262,74 @@ def __init__(__self__, """ Manages a Customer Managed Key for a Kusto Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + ), + identity=azure.kusto.ClusterIdentityArgs( + type="SystemAssigned", + )) + cluster = azure.keyvault.AccessPolicy("cluster", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_cluster.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Recover", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + cluster, + ])) + example_cluster_customer_managed_key = azure.kusto.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", + cluster_id=example_cluster.id, + key_vault_id=example_key_vault.id, + key_name=example_key.name, + key_version=example_key.version) + ``` + ## Import Customer Managed Keys for a Kusto Cluster can be imported using the `resource id`, e.g. @@ -287,6 +355,74 @@ def __init__(__self__, """ Manages a Customer Managed Key for a Kusto Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + ), + identity=azure.kusto.ClusterIdentityArgs( + type="SystemAssigned", + )) + cluster = azure.keyvault.AccessPolicy("cluster", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_cluster.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Recover", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + cluster, + ])) + example_cluster_customer_managed_key = azure.kusto.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", + cluster_id=example_cluster.id, + key_vault_id=example_key_vault.id, + key_name=example_key.name, + key_version=example_key.version) + ``` + ## Import Customer Managed Keys for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/cluster_managed_private_endpoint.py b/sdk/python/pulumi_azure/kusto/cluster_managed_private_endpoint.py index 04570b0b99..9d90c6d41c 100644 --- a/sdk/python/pulumi_azure/kusto/cluster_managed_private_endpoint.py +++ b/sdk/python/pulumi_azure/kusto/cluster_managed_private_endpoint.py @@ -341,6 +341,35 @@ def __init__(__self__, """ Manages a Managed Private Endpoint for a Kusto Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_cluster_managed_private_endpoint = azure.kusto.ClusterManagedPrivateEndpoint("exampleClusterManagedPrivateEndpoint", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + private_link_resource_id=example_account.id, + private_link_resource_region=example_account.location, + group_id="blob", + request_message="Please Approve") + ``` + ## Import Managed Private Endpoint for a Kusto Cluster can be imported using the `resource id`, e.g. @@ -368,6 +397,35 @@ def __init__(__self__, """ Manages a Managed Private Endpoint for a Kusto Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_cluster_managed_private_endpoint = azure.kusto.ClusterManagedPrivateEndpoint("exampleClusterManagedPrivateEndpoint", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + private_link_resource_id=example_account.id, + private_link_resource_region=example_account.location, + group_id="blob", + request_message="Please Approve") + ``` + ## Import Managed Private Endpoint for a Kusto Cluster can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/cluster_principal_assignment.py b/sdk/python/pulumi_azure/kusto/cluster_principal_assignment.py index 804168f32a..82998c4d76 100644 --- a/sdk/python/pulumi_azure/kusto/cluster_principal_assignment.py +++ b/sdk/python/pulumi_azure/kusto/cluster_principal_assignment.py @@ -379,6 +379,30 @@ def __init__(__self__, """ Manages a Kusto Cluster Principal Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_cluster_principal_assignment = azure.kusto.ClusterPrincipalAssignment("exampleClusterPrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + tenant_id=current.tenant_id, + principal_id=current.client_id, + principal_type="App", + role="AllDatabasesAdmin") + ``` + ## Import Data Explorer Cluster Principal Assignments can be imported using the `resource id`, e.g. @@ -406,6 +430,30 @@ def __init__(__self__, """ Manages a Kusto Cluster Principal Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_cluster_principal_assignment = azure.kusto.ClusterPrincipalAssignment("exampleClusterPrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + tenant_id=current.tenant_id, + principal_id=current.client_id, + principal_type="App", + role="AllDatabasesAdmin") + ``` + ## Import Data Explorer Cluster Principal Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/cosmosdb_data_connection.py b/sdk/python/pulumi_azure/kusto/cosmosdb_data_connection.py index 11a1832103..8cacc09ddb 100644 --- a/sdk/python/pulumi_azure/kusto/cosmosdb_data_connection.py +++ b/sdk/python/pulumi_azure/kusto/cosmosdb_data_connection.py @@ -378,6 +378,87 @@ def __init__(__self__, """ Manages a Kusto / Cosmos Database Data Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + builtin = azure.authorization.get_role_definition(role_definition_id="fbdf93bf-df7d-467e-a4d2-9458aa1360c8") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + ), + identity=azure.kusto.ClusterIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_resource_group.id, + role_definition_name=builtin.name, + principal_id=example_cluster.identity.principal_id) + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Session", + max_interval_in_seconds=5, + max_staleness_prefix=100, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/part", + throughput=400) + example_sql_role_definition = azure.cosmosdb.get_sql_role_definition_output(role_definition_id="00000000-0000-0000-0000-000000000001", + resource_group_name=example_resource_group.name, + account_name=example_account.name) + example_sql_role_assignment = azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + role_definition_id=example_sql_role_definition.id, + principal_id=example_cluster.identity.principal_id, + scope=example_account.id) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_script = azure.kusto.Script("exampleScript", + database_id=example_database.id, + script_content=\"\"\".create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime) + .create table TestTable ingestion json mapping "TestMapping" + '[' + ' {"column":"Id","path":"$.id"},' + ' {"column":"Name","path":"$.name"},' + ' {"column":"_ts","path":"$._ts"},' + ' {"column":"_timestamp","path":"$._ts", "transform":"DateTimeFromUnixSeconds"}' + ']' + .alter table TestTable policy ingestionbatching "{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}" + \"\"\") + example_cosmosdb_data_connection = azure.kusto.CosmosdbDataConnection("exampleCosmosdbDataConnection", + location=example_resource_group.location, + cosmosdb_container_id=example_sql_container.id, + kusto_database_id=example_database.id, + managed_identity_id=example_cluster.id, + table_name="TestTable", + mapping_rule_name="TestMapping", + retrieval_start_date="2023-06-26T12:00:00.6554616Z") + ``` + ## Import Kusto / Cosmos Database Data Connection can be imported using the `resource id`, e.g. @@ -406,6 +487,87 @@ def __init__(__self__, """ Manages a Kusto / Cosmos Database Data Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + builtin = azure.authorization.get_role_definition(role_definition_id="fbdf93bf-df7d-467e-a4d2-9458aa1360c8") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + ), + identity=azure.kusto.ClusterIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=example_resource_group.id, + role_definition_name=builtin.name, + principal_id=example_cluster.identity.principal_id) + example_account = azure.cosmosdb.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="Session", + max_interval_in_seconds=5, + max_staleness_prefix=100, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="/part", + throughput=400) + example_sql_role_definition = azure.cosmosdb.get_sql_role_definition_output(role_definition_id="00000000-0000-0000-0000-000000000001", + resource_group_name=example_resource_group.name, + account_name=example_account.name) + example_sql_role_assignment = azure.cosmosdb.SqlRoleAssignment("exampleSqlRoleAssignment", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + role_definition_id=example_sql_role_definition.id, + principal_id=example_cluster.identity.principal_id, + scope=example_account.id) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_script = azure.kusto.Script("exampleScript", + database_id=example_database.id, + script_content=\"\"\".create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime) + .create table TestTable ingestion json mapping "TestMapping" + '[' + ' {"column":"Id","path":"$.id"},' + ' {"column":"Name","path":"$.name"},' + ' {"column":"_ts","path":"$._ts"},' + ' {"column":"_timestamp","path":"$._ts", "transform":"DateTimeFromUnixSeconds"}' + ']' + .alter table TestTable policy ingestionbatching "{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}" + \"\"\") + example_cosmosdb_data_connection = azure.kusto.CosmosdbDataConnection("exampleCosmosdbDataConnection", + location=example_resource_group.location, + cosmosdb_container_id=example_sql_container.id, + kusto_database_id=example_database.id, + managed_identity_id=example_cluster.id, + table_name="TestTable", + mapping_rule_name="TestMapping", + retrieval_start_date="2023-06-26T12:00:00.6554616Z") + ``` + ## Import Kusto / Cosmos Database Data Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/database.py b/sdk/python/pulumi_azure/kusto/database.py index 2ad460e226..c26fddbb42 100644 --- a/sdk/python/pulumi_azure/kusto/database.py +++ b/sdk/python/pulumi_azure/kusto/database.py @@ -312,6 +312,28 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Database + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + cluster = azure.kusto.Cluster("cluster", + location=example.location, + resource_group_name=example.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + database = azure.kusto.Database("database", + resource_group_name=example.name, + location=example.location, + cluster_name=cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + ``` + ## Import Kusto Clusters can be imported using the `resource id`, e.g. @@ -338,6 +360,28 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Database + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + cluster = azure.kusto.Cluster("cluster", + location=example.location, + resource_group_name=example.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + database = azure.kusto.Database("database", + resource_group_name=example.name, + location=example.location, + cluster_name=cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + ``` + ## Import Kusto Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/database_principal_assignment.py b/sdk/python/pulumi_azure/kusto/database_principal_assignment.py index 276df148f0..6a35636d8d 100644 --- a/sdk/python/pulumi_azure/kusto/database_principal_assignment.py +++ b/sdk/python/pulumi_azure/kusto/database_principal_assignment.py @@ -421,6 +421,37 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Database Principal Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + example_database_principal_assignment = azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + database_name=example_database.name, + tenant_id=current.tenant_id, + principal_id=current.client_id, + principal_type="App", + role="Viewer") + ``` + ## Import Kusto Database Principal Assignment can be imported using the `resource id`, e.g. @@ -449,6 +480,37 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Database Principal Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + example_database_principal_assignment = azure.kusto.DatabasePrincipalAssignment("exampleDatabasePrincipalAssignment", + resource_group_name=example_resource_group.name, + cluster_name=example_cluster.name, + database_name=example_database.name, + tenant_id=current.tenant_id, + principal_id=current.client_id, + principal_type="App", + role="Viewer") + ``` + ## Import Kusto Database Principal Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/event_grid_data_connection.py b/sdk/python/pulumi_azure/kusto/event_grid_data_connection.py index e9def95d0a..295874d31c 100644 --- a/sdk/python/pulumi_azure/kusto/event_grid_data_connection.py +++ b/sdk/python/pulumi_azure/kusto/event_grid_data_connection.py @@ -708,6 +708,70 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Event Grid Data Connection + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=1, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_event_subscription = azure.eventgrid.EventSubscription("exampleEventSubscription", + scope=example_account.id, + eventhub_endpoint_id=example_event_hub.id, + event_delivery_schema="EventGridSchema", + included_event_types=[ + "Microsoft.Storage.BlobCreated", + "Microsoft.Storage.BlobRenamed", + ], + retry_policy=azure.eventgrid.EventSubscriptionRetryPolicyArgs( + event_time_to_live=144, + max_delivery_attempts=10, + )) + example_event_grid_data_connection = azure.kusto.EventGridDataConnection("exampleEventGridDataConnection", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + database_name=example_database.name, + storage_account_id=example_account.id, + eventhub_id=example_event_hub.id, + eventhub_consumer_group_name=example_consumer_group.name, + table_name="my-table", + mapping_rule_name="my-table-mapping", + data_format="JSON", + opts=pulumi.ResourceOptions(depends_on=[example_event_subscription])) + ``` + ## Import Kusto Event Grid Data Connections can be imported using the `resource id`, e.g. @@ -744,6 +808,70 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) Event Grid Data Connection + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=1, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_event_subscription = azure.eventgrid.EventSubscription("exampleEventSubscription", + scope=example_account.id, + eventhub_endpoint_id=example_event_hub.id, + event_delivery_schema="EventGridSchema", + included_event_types=[ + "Microsoft.Storage.BlobCreated", + "Microsoft.Storage.BlobRenamed", + ], + retry_policy=azure.eventgrid.EventSubscriptionRetryPolicyArgs( + event_time_to_live=144, + max_delivery_attempts=10, + )) + example_event_grid_data_connection = azure.kusto.EventGridDataConnection("exampleEventGridDataConnection", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + database_name=example_database.name, + storage_account_id=example_account.id, + eventhub_id=example_event_hub.id, + eventhub_consumer_group_name=example_consumer_group.name, + table_name="my-table", + mapping_rule_name="my-table-mapping", + data_format="JSON", + opts=pulumi.ResourceOptions(depends_on=[example_event_subscription])) + ``` + ## Import Kusto Event Grid Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/eventhub_data_connection.py b/sdk/python/pulumi_azure/kusto/eventhub_data_connection.py index 8b405ba635..a30aba7f52 100644 --- a/sdk/python/pulumi_azure/kusto/eventhub_data_connection.py +++ b/sdk/python/pulumi_azure/kusto/eventhub_data_connection.py @@ -621,6 +621,52 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) EventHub Data Connection + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + cluster = azure.kusto.Cluster("cluster", + location=example.location, + resource_group_name=example.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + database = azure.kusto.Database("database", + resource_group_name=example.name, + location=example.location, + cluster_name=cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + eventhub_ns = azure.eventhub.EventHubNamespace("eventhubNs", + location=example.location, + resource_group_name=example.name, + sku="Standard") + eventhub = azure.eventhub.EventHub("eventhub", + namespace_name=eventhub_ns.name, + resource_group_name=example.name, + partition_count=1, + message_retention=1) + consumer_group = azure.eventhub.ConsumerGroup("consumerGroup", + namespace_name=eventhub_ns.name, + eventhub_name=eventhub.name, + resource_group_name=example.name) + eventhub_connection = azure.kusto.EventhubDataConnection("eventhubConnection", + resource_group_name=example.name, + location=example.location, + cluster_name=cluster.name, + database_name=database.name, + eventhub_id=eventhub.id, + consumer_group=consumer_group.name, + table_name="my-table", + mapping_rule_name="my-table-mapping", + data_format="JSON") + #(Optional) + ``` + ## Import Kusto EventHub Data Connections can be imported using the `resource id`, e.g. @@ -655,6 +701,52 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) EventHub Data Connection + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + cluster = azure.kusto.Cluster("cluster", + location=example.location, + resource_group_name=example.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + database = azure.kusto.Database("database", + resource_group_name=example.name, + location=example.location, + cluster_name=cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + eventhub_ns = azure.eventhub.EventHubNamespace("eventhubNs", + location=example.location, + resource_group_name=example.name, + sku="Standard") + eventhub = azure.eventhub.EventHub("eventhub", + namespace_name=eventhub_ns.name, + resource_group_name=example.name, + partition_count=1, + message_retention=1) + consumer_group = azure.eventhub.ConsumerGroup("consumerGroup", + namespace_name=eventhub_ns.name, + eventhub_name=eventhub.name, + resource_group_name=example.name) + eventhub_connection = azure.kusto.EventhubDataConnection("eventhubConnection", + resource_group_name=example.name, + location=example.location, + cluster_name=cluster.name, + database_name=database.name, + eventhub_id=eventhub.id, + consumer_group=consumer_group.name, + table_name="my-table", + mapping_rule_name="my-table-mapping", + data_format="JSON") + #(Optional) + ``` + ## Import Kusto EventHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/get_cluster.py b/sdk/python/pulumi_azure/kusto/get_cluster.py index 89a712d863..af5bfef4ef 100644 --- a/sdk/python/pulumi_azure/kusto/get_cluster.py +++ b/sdk/python/pulumi_azure/kusto/get_cluster.py @@ -110,6 +110,16 @@ def get_cluster(name: Optional[str] = None, """ Use this data source to access information about an existing Kusto (also known as Azure Data Explorer) Cluster + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.kusto.get_cluster(name="kustocluster", + resource_group_name="test_resource_group") + ``` + :param str name: Specifies the name of the Kusto Cluster. :param str resource_group_name: The name of the Resource Group where the Kusto Cluster exists. @@ -137,6 +147,16 @@ def get_cluster_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Kusto (also known as Azure Data Explorer) Cluster + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.kusto.get_cluster(name="kustocluster", + resource_group_name="test_resource_group") + ``` + :param str name: Specifies the name of the Kusto Cluster. :param str resource_group_name: The name of the Resource Group where the Kusto Cluster exists. diff --git a/sdk/python/pulumi_azure/kusto/get_database.py b/sdk/python/pulumi_azure/kusto/get_database.py index 39c09d0f90..07bb15c771 100644 --- a/sdk/python/pulumi_azure/kusto/get_database.py +++ b/sdk/python/pulumi_azure/kusto/get_database.py @@ -126,6 +126,17 @@ def get_database(cluster_name: Optional[str] = None, """ Use this data source to access information about an existing Kusto Database + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.kusto.get_database(cluster_name="test_cluster", + name="my-kusto-database", + resource_group_name="test_resource_group") + ``` + :param str cluster_name: The name of the Kusto Cluster this database is added to. :param str name: The name of the Kusto Database. @@ -157,6 +168,17 @@ def get_database_output(cluster_name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Kusto Database + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.kusto.get_database(cluster_name="test_cluster", + name="my-kusto-database", + resource_group_name="test_resource_group") + ``` + :param str cluster_name: The name of the Kusto Cluster this database is added to. :param str name: The name of the Kusto Database. diff --git a/sdk/python/pulumi_azure/kusto/iot_hub_data_connection.py b/sdk/python/pulumi_azure/kusto/iot_hub_data_connection.py index dcd35747d3..67161551bd 100644 --- a/sdk/python/pulumi_azure/kusto/iot_hub_data_connection.py +++ b/sdk/python/pulumi_azure/kusto/iot_hub_data_connection.py @@ -585,6 +585,59 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) IotHub Data Connection + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + )) + example_shared_access_policy = azure.iot.SharedAccessPolicy("exampleSharedAccessPolicy", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + registry_read=True) + example_consumer_group = azure.iot.ConsumerGroup("exampleConsumerGroup", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + eventhub_endpoint_name="events") + example_iot_hub_data_connection = azure.kusto.IotHubDataConnection("exampleIotHubDataConnection", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + database_name=example_database.name, + iothub_id=example_io_t_hub.id, + consumer_group=example_consumer_group.name, + shared_access_policy_name=example_shared_access_policy.name, + event_system_properties=[ + "message-id", + "sequence-number", + "to", + ], + table_name="my-table", + mapping_rule_name="my-table-mapping", + data_format="JSON") + ``` + ## Import Kusto IotHub Data Connections can be imported using the `resource id`, e.g. @@ -618,6 +671,59 @@ def __init__(__self__, """ Manages a Kusto (also known as Azure Data Explorer) IotHub Data Connection + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Standard_D13_v2", + capacity=2, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + hot_cache_period="P7D", + soft_delete_period="P31D") + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="B1", + capacity=1, + )) + example_shared_access_policy = azure.iot.SharedAccessPolicy("exampleSharedAccessPolicy", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + registry_read=True) + example_consumer_group = azure.iot.ConsumerGroup("exampleConsumerGroup", + resource_group_name=example_resource_group.name, + iothub_name=example_io_t_hub.name, + eventhub_endpoint_name="events") + example_iot_hub_data_connection = azure.kusto.IotHubDataConnection("exampleIotHubDataConnection", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name, + database_name=example_database.name, + iothub_id=example_io_t_hub.id, + consumer_group=example_consumer_group.name, + shared_access_policy_name=example_shared_access_policy.name, + event_system_properties=[ + "message-id", + "sequence-number", + "to", + ], + table_name="my-table", + mapping_rule_name="my-table-mapping", + data_format="JSON") + ``` + ## Import Kusto IotHub Data Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/kusto/script.py b/sdk/python/pulumi_azure/kusto/script.py index 27d0313fca..328cb8f8ad 100644 --- a/sdk/python/pulumi_azure/kusto/script.py +++ b/sdk/python/pulumi_azure/kusto/script.py @@ -334,6 +334,58 @@ def __init__(__self__, """ Manages a Kusto Script. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source_content=".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)") + example_account_blob_container_sas = azure.storage.get_account_blob_container_sas_output(connection_string=example_account.primary_connection_string, + container_name=example_container.name, + https_only=True, + start="2017-03-21", + expiry="2022-03-21", + permissions=azure.storage.GetAccountBlobContainerSASPermissionsArgs( + read=True, + add=False, + create=False, + write=True, + delete=False, + list=True, + )) + example_script = azure.kusto.Script("exampleScript", + database_id=example_database.id, + url=example_blob.id, + sas_token=example_account_blob_container_sas.sas, + continue_on_errors_enabled=True, + force_an_update_when_value_changed="first") + ``` + ## Import Kusto Scripts can be imported using the `resource id`, e.g. @@ -361,6 +413,58 @@ def __init__(__self__, """ Manages a Kusto Script. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.kusto.Cluster("exampleCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.kusto.ClusterSkuArgs( + name="Dev(No SLA)_Standard_D11_v2", + capacity=1, + )) + example_database = azure.kusto.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + cluster_name=example_cluster.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source_content=".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)") + example_account_blob_container_sas = azure.storage.get_account_blob_container_sas_output(connection_string=example_account.primary_connection_string, + container_name=example_container.name, + https_only=True, + start="2017-03-21", + expiry="2022-03-21", + permissions=azure.storage.GetAccountBlobContainerSASPermissionsArgs( + read=True, + add=False, + create=False, + write=True, + delete=False, + list=True, + )) + example_script = azure.kusto.Script("exampleScript", + database_id=example_database.id, + url=example_blob.id, + sas_token=example_account_blob_container_sas.sas, + continue_on_errors_enabled=True, + force_an_update_when_value_changed="first") + ``` + ## Import Kusto Scripts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lab/lab.py b/sdk/python/pulumi_azure/lab/lab.py index 0463138efc..df01d7836b 100644 --- a/sdk/python/pulumi_azure/lab/lab.py +++ b/sdk/python/pulumi_azure/lab/lab.py @@ -561,6 +561,38 @@ def __init__(__self__, """ Manages a Lab Service Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.lab.Lab("exampleLab", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + title="Test Title", + security=azure.lab.LabSecurityArgs( + open_access_enabled=False, + ), + virtual_machine=azure.lab.LabVirtualMachineArgs( + admin_user=azure.lab.LabVirtualMachineAdminUserArgs( + username="testadmin", + password="Password1234!", + ), + image_reference=azure.lab.LabVirtualMachineImageReferenceArgs( + offer="0001-com-ubuntu-server-focal", + publisher="canonical", + sku="20_04-lts", + version="latest", + ), + sku=azure.lab.LabVirtualMachineSkuArgs( + name="Classic_Fsv2_2_4GB_128_S_SSD", + capacity=0, + ), + )) + ``` + ## Import Lab Service Labs can be imported using the `resource id`, e.g. @@ -594,6 +626,38 @@ def __init__(__self__, """ Manages a Lab Service Lab. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.lab.Lab("exampleLab", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + title="Test Title", + security=azure.lab.LabSecurityArgs( + open_access_enabled=False, + ), + virtual_machine=azure.lab.LabVirtualMachineArgs( + admin_user=azure.lab.LabVirtualMachineAdminUserArgs( + username="testadmin", + password="Password1234!", + ), + image_reference=azure.lab.LabVirtualMachineImageReferenceArgs( + offer="0001-com-ubuntu-server-focal", + publisher="canonical", + sku="20_04-lts", + version="latest", + ), + sku=azure.lab.LabVirtualMachineSkuArgs( + name="Classic_Fsv2_2_4GB_128_S_SSD", + capacity=0, + ), + )) + ``` + ## Import Lab Service Labs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lab/schedule.py b/sdk/python/pulumi_azure/lab/schedule.py index 6c435717d2..4c9f4ad599 100644 --- a/sdk/python/pulumi_azure/lab/schedule.py +++ b/sdk/python/pulumi_azure/lab/schedule.py @@ -334,6 +334,42 @@ def __init__(__self__, """ Manages a Lab Service Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.lab.Lab("exampleLab", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + title="Test Title", + security=azure.lab.LabSecurityArgs( + open_access_enabled=False, + ), + virtual_machine=azure.lab.LabVirtualMachineArgs( + admin_user=azure.lab.LabVirtualMachineAdminUserArgs( + username="testadmin", + password="Password1234!", + ), + image_reference=azure.lab.LabVirtualMachineImageReferenceArgs( + offer="0001-com-ubuntu-server-focal", + publisher="canonical", + sku="20_04-lts", + version="latest", + ), + sku=azure.lab.LabVirtualMachineSkuArgs( + name="Classic_Fsv2_2_4GB_128_S_SSD", + capacity=1, + ), + )) + example_schedule = azure.lab.Schedule("exampleSchedule", + lab_id=example_lab.id, + stop_time="2022-11-28T00:00:00Z", + time_zone="America/Los_Angeles") + ``` + ## Import Lab Service Schedules can be imported using the `resource id`, e.g. @@ -361,6 +397,42 @@ def __init__(__self__, """ Manages a Lab Service Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.lab.Lab("exampleLab", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + title="Test Title", + security=azure.lab.LabSecurityArgs( + open_access_enabled=False, + ), + virtual_machine=azure.lab.LabVirtualMachineArgs( + admin_user=azure.lab.LabVirtualMachineAdminUserArgs( + username="testadmin", + password="Password1234!", + ), + image_reference=azure.lab.LabVirtualMachineImageReferenceArgs( + offer="0001-com-ubuntu-server-focal", + publisher="canonical", + sku="20_04-lts", + version="latest", + ), + sku=azure.lab.LabVirtualMachineSkuArgs( + name="Classic_Fsv2_2_4GB_128_S_SSD", + capacity=1, + ), + )) + example_schedule = azure.lab.Schedule("exampleSchedule", + lab_id=example_lab.id, + stop_time="2022-11-28T00:00:00Z", + time_zone="America/Los_Angeles") + ``` + ## Import Lab Service Schedules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lab/service_plan.py b/sdk/python/pulumi_azure/lab/service_plan.py index e64832ed7e..59a7caf915 100644 --- a/sdk/python/pulumi_azure/lab/service_plan.py +++ b/sdk/python/pulumi_azure/lab/service_plan.py @@ -462,6 +462,19 @@ def __init__(__self__, > **Note:** Before using this resource, it's required to submit the request of registering the provider with Azure CLI `az provider register --namespace Microsoft.LabServices`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.lab.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allowed_regions=[example_resource_group.location]) + ``` + ## Import Lab Service Plans can be imported using the `resource id`, e.g. @@ -496,6 +509,19 @@ def __init__(__self__, > **Note:** Before using this resource, it's required to submit the request of registering the provider with Azure CLI `az provider register --namespace Microsoft.LabServices`. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service_plan = azure.lab.ServicePlan("exampleServicePlan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allowed_regions=[example_resource_group.location]) + ``` + ## Import Lab Service Plans can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lab/user.py b/sdk/python/pulumi_azure/lab/user.py index 8aba19f9e4..23d08cb479 100644 --- a/sdk/python/pulumi_azure/lab/user.py +++ b/sdk/python/pulumi_azure/lab/user.py @@ -212,6 +212,41 @@ def __init__(__self__, """ Manages a Lab Service User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.lab.Lab("exampleLab", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + title="Test Title", + security=azure.lab.LabSecurityArgs( + open_access_enabled=False, + ), + virtual_machine=azure.lab.LabVirtualMachineArgs( + admin_user=azure.lab.LabVirtualMachineAdminUserArgs( + username="testadmin", + password="Password1234!", + ), + image_reference=azure.lab.LabVirtualMachineImageReferenceArgs( + offer="0001-com-ubuntu-server-focal", + publisher="canonical", + sku="20_04-lts", + version="latest", + ), + sku=azure.lab.LabVirtualMachineSkuArgs( + name="Classic_Fsv2_2_4GB_128_S_SSD", + capacity=1, + ), + )) + example_user = azure.lab.User("exampleUser", + lab_id=example_lab.id, + email="terraform-acctest@hashicorp.com") + ``` + ## Import Lab Service Users can be imported using the `resource id`, e.g. @@ -236,6 +271,41 @@ def __init__(__self__, """ Manages a Lab Service User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_lab = azure.lab.Lab("exampleLab", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + title="Test Title", + security=azure.lab.LabSecurityArgs( + open_access_enabled=False, + ), + virtual_machine=azure.lab.LabVirtualMachineArgs( + admin_user=azure.lab.LabVirtualMachineAdminUserArgs( + username="testadmin", + password="Password1234!", + ), + image_reference=azure.lab.LabVirtualMachineImageReferenceArgs( + offer="0001-com-ubuntu-server-focal", + publisher="canonical", + sku="20_04-lts", + version="latest", + ), + sku=azure.lab.LabVirtualMachineSkuArgs( + name="Classic_Fsv2_2_4GB_128_S_SSD", + capacity=1, + ), + )) + example_user = azure.lab.User("exampleUser", + lab_id=example_lab.id, + email="terraform-acctest@hashicorp.com") + ``` + ## Import Lab Service Users can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lb/backend_address_pool.py b/sdk/python/pulumi_azure/lb/backend_address_pool.py index 3ef4ce6627..2a61a62890 100644 --- a/sdk/python/pulumi_azure/lb/backend_address_pool.py +++ b/sdk/python/pulumi_azure/lb/backend_address_pool.py @@ -299,6 +299,27 @@ def __init__(__self__, > **NOTE:** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + ``` + ## Import Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. @@ -325,6 +346,27 @@ def __init__(__self__, > **NOTE:** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + ``` + ## Import Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lb/backend_address_pool_address.py b/sdk/python/pulumi_azure/lb/backend_address_pool_address.py index b883056959..16de81b375 100644 --- a/sdk/python/pulumi_azure/lb/backend_address_pool_address.py +++ b/sdk/python/pulumi_azure/lb/backend_address_pool_address.py @@ -288,6 +288,32 @@ def __init__(__self__, > **Note:** Backend Addresses can only be added to a `Standard` SKU Load Balancer. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_virtual_network = azure.network.get_virtual_network(name="example-network", + resource_group_name="example-resources") + example_lb = azure.lb.get_lb(name="example-lb", + resource_group_name="example-resources") + example_backend_address_pool = azure.lb.get_backend_address_pool(name="first", + loadbalancer_id=example_lb.id) + example_backend_address_pool_address = azure.lb.BackendAddressPoolAddress("exampleBackendAddressPoolAddress", + backend_address_pool_id=example_backend_address_pool.id, + virtual_network_id=example_virtual_network.id, + ip_address="10.0.0.1") + backend_pool_cr = azure.lb.get_backend_address_pool(name="globalLBBackendPool", + loadbalancer_id=example_lb.id) + example_1 = azure.lb.BackendAddressPoolAddress("example-1", + backend_address_pool_id=backend_pool_cr.id, + backend_address_ip_configuration_id=azurerm_lb["backend-lb-R1"]["frontend_ip_configuration"][0]["id"]) + example_2 = azure.lb.BackendAddressPoolAddress("example-2", + backend_address_pool_id=backend_pool_cr.id, + backend_address_ip_configuration_id=azurerm_lb["backend-lb-R2"]["frontend_ip_configuration"][0]["id"]) + ``` + ## Import Backend Address Pool Addresses can be imported using the `resource id`, e.g. @@ -317,6 +343,32 @@ def __init__(__self__, > **Note:** Backend Addresses can only be added to a `Standard` SKU Load Balancer. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_virtual_network = azure.network.get_virtual_network(name="example-network", + resource_group_name="example-resources") + example_lb = azure.lb.get_lb(name="example-lb", + resource_group_name="example-resources") + example_backend_address_pool = azure.lb.get_backend_address_pool(name="first", + loadbalancer_id=example_lb.id) + example_backend_address_pool_address = azure.lb.BackendAddressPoolAddress("exampleBackendAddressPoolAddress", + backend_address_pool_id=example_backend_address_pool.id, + virtual_network_id=example_virtual_network.id, + ip_address="10.0.0.1") + backend_pool_cr = azure.lb.get_backend_address_pool(name="globalLBBackendPool", + loadbalancer_id=example_lb.id) + example_1 = azure.lb.BackendAddressPoolAddress("example-1", + backend_address_pool_id=backend_pool_cr.id, + backend_address_ip_configuration_id=azurerm_lb["backend-lb-R1"]["frontend_ip_configuration"][0]["id"]) + example_2 = azure.lb.BackendAddressPoolAddress("example-2", + backend_address_pool_id=backend_pool_cr.id, + backend_address_ip_configuration_id=azurerm_lb["backend-lb-R2"]["frontend_ip_configuration"][0]["id"]) + ``` + ## Import Backend Address Pool Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lb/get_backend_address_pool.py b/sdk/python/pulumi_azure/lb/get_backend_address_pool.py index 9a5f526a1e..4f79ef2089 100644 --- a/sdk/python/pulumi_azure/lb/get_backend_address_pool.py +++ b/sdk/python/pulumi_azure/lb/get_backend_address_pool.py @@ -132,6 +132,20 @@ def get_backend_address_pool(loadbalancer_id: Optional[str] = None, """ Use this data source to access information about an existing Load Balancer's Backend Address Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_lb = azure.lb.get_lb(name="example-lb", + resource_group_name="example-resources") + example_backend_address_pool = azure.lb.get_backend_address_pool(name="first", + loadbalancer_id=example_lb.id) + pulumi.export("backendAddressPoolId", example_backend_address_pool.id) + pulumi.export("backendIpConfigurationIds", [__item["id"] for __item in data["azurerm_lb_backend_address_pool"]["beap"]["backend_ip_configurations"]]) + ``` + :param str loadbalancer_id: The ID of the Load Balancer in which the Backend Address Pool exists. :param str name: Specifies the name of the Backend Address Pool. @@ -160,6 +174,20 @@ def get_backend_address_pool_output(loadbalancer_id: Optional[pulumi.Input[str]] """ Use this data source to access information about an existing Load Balancer's Backend Address Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_lb = azure.lb.get_lb(name="example-lb", + resource_group_name="example-resources") + example_backend_address_pool = azure.lb.get_backend_address_pool(name="first", + loadbalancer_id=example_lb.id) + pulumi.export("backendAddressPoolId", example_backend_address_pool.id) + pulumi.export("backendIpConfigurationIds", [__item["id"] for __item in data["azurerm_lb_backend_address_pool"]["beap"]["backend_ip_configurations"]]) + ``` + :param str loadbalancer_id: The ID of the Load Balancer in which the Backend Address Pool exists. :param str name: Specifies the name of the Backend Address Pool. diff --git a/sdk/python/pulumi_azure/lb/get_lb.py b/sdk/python/pulumi_azure/lb/get_lb.py index 66f0ffb02b..f39f95ac2d 100644 --- a/sdk/python/pulumi_azure/lb/get_lb.py +++ b/sdk/python/pulumi_azure/lb/get_lb.py @@ -144,6 +144,17 @@ def get_lb(name: Optional[str] = None, """ Use this data source to access information about an existing Load Balancer + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.lb.get_lb(name="example-lb", + resource_group_name="example-resources") + pulumi.export("loadbalancerId", example.id) + ``` + :param str name: Specifies the name of the Load Balancer. :param str resource_group_name: The name of the Resource Group in which the Load Balancer exists. @@ -173,6 +184,17 @@ def get_lb_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Load Balancer + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.lb.get_lb(name="example-lb", + resource_group_name="example-resources") + pulumi.export("loadbalancerId", example.id) + ``` + :param str name: Specifies the name of the Load Balancer. :param str resource_group_name: The name of the Resource Group in which the Load Balancer exists. diff --git a/sdk/python/pulumi_azure/lb/get_lb_outbound_rule.py b/sdk/python/pulumi_azure/lb/get_lb_outbound_rule.py index fb833bee5c..8c2c3204d2 100644 --- a/sdk/python/pulumi_azure/lb/get_lb_outbound_rule.py +++ b/sdk/python/pulumi_azure/lb/get_lb_outbound_rule.py @@ -144,6 +144,17 @@ def get_lb_outbound_rule(loadbalancer_id: Optional[str] = None, """ Use this data source to access information about an existing Load Balancer Outbound Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.lb.get_lb_outbound_rule(name="existing_lb_outbound_rule", + loadbalancer_id="existing_load_balancer_id") + pulumi.export("id", example.id) + ``` + :param str loadbalancer_id: The ID of the Load Balancer in which the Outbound Rule exists. :param str name: The name of this Load Balancer Outbound Rule. @@ -173,6 +184,17 @@ def get_lb_outbound_rule_output(loadbalancer_id: Optional[pulumi.Input[str]] = N """ Use this data source to access information about an existing Load Balancer Outbound Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.lb.get_lb_outbound_rule(name="existing_lb_outbound_rule", + loadbalancer_id="existing_load_balancer_id") + pulumi.export("id", example.id) + ``` + :param str loadbalancer_id: The ID of the Load Balancer in which the Outbound Rule exists. :param str name: The name of this Load Balancer Outbound Rule. diff --git a/sdk/python/pulumi_azure/lb/load_balancer.py b/sdk/python/pulumi_azure/lb/load_balancer.py index a634fd2088..67c444cccd 100644 --- a/sdk/python/pulumi_azure/lb/load_balancer.py +++ b/sdk/python/pulumi_azure/lb/load_balancer.py @@ -417,6 +417,26 @@ def __init__(__self__, """ Manages a Load Balancer Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + ``` + ## Import Load Balancers can be imported using the `resource id`, e.g. @@ -447,6 +467,26 @@ def __init__(__self__, """ Manages a Load Balancer Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + ``` + ## Import Load Balancers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lb/nat_pool.py b/sdk/python/pulumi_azure/lb/nat_pool.py index b7ae4d2d90..43dcc3127a 100644 --- a/sdk/python/pulumi_azure/lb/nat_pool.py +++ b/sdk/python/pulumi_azure/lb/nat_pool.py @@ -524,6 +524,34 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_nat_pool = azure.lb.NatPool("exampleNatPool", + resource_group_name=example_resource_group.name, + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port_start=80, + frontend_port_end=81, + backend_port=8080, + frontend_ip_configuration_name="PublicIPAddress") + ``` + ## Import Load Balancer NAT Pools can be imported using the `resource id`, e.g. @@ -559,6 +587,34 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_nat_pool = azure.lb.NatPool("exampleNatPool", + resource_group_name=example_resource_group.name, + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port_start=80, + frontend_port_end=81, + backend_port=8080, + frontend_ip_configuration_name="PublicIPAddress") + ``` + ## Import Load Balancer NAT Pools can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lb/outbound_rule.py b/sdk/python/pulumi_azure/lb/outbound_rule.py index 555bb03f6b..007a53fb27 100644 --- a/sdk/python/pulumi_azure/lb/outbound_rule.py +++ b/sdk/python/pulumi_azure/lb/outbound_rule.py @@ -381,6 +381,34 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration and a Backend Address Pool Attached. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + example_outbound_rule = azure.lb.OutboundRule("exampleOutboundRule", + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + backend_address_pool_id=example_backend_address_pool.id, + frontend_ip_configurations=[azure.lb.OutboundRuleFrontendIpConfigurationArgs( + name="PublicIPAddress", + )]) + ``` + ## Import Load Balancer Outbound Rules can be imported using the `resource id`, e.g. @@ -411,6 +439,34 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration and a Backend Address Pool Attached. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + example_outbound_rule = azure.lb.OutboundRule("exampleOutboundRule", + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + backend_address_pool_id=example_backend_address_pool.id, + frontend_ip_configurations=[azure.lb.OutboundRuleFrontendIpConfigurationArgs( + name="PublicIPAddress", + )]) + ``` + ## Import Load Balancer Outbound Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lb/probe.py b/sdk/python/pulumi_azure/lb/probe.py index 25397098bb..502df834e8 100644 --- a/sdk/python/pulumi_azure/lb/probe.py +++ b/sdk/python/pulumi_azure/lb/probe.py @@ -390,6 +390,29 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_probe = azure.lb.Probe("exampleProbe", + loadbalancer_id=example_load_balancer.id, + port=22) + ``` + ## Import Load Balancer Probes can be imported using the `resource id`, e.g. @@ -420,6 +443,29 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_probe = azure.lb.Probe("exampleProbe", + loadbalancer_id=example_load_balancer.id, + port=22) + ``` + ## Import Load Balancer Probes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lb/rule.py b/sdk/python/pulumi_azure/lb/rule.py index 9705e85c06..bfa9632ddf 100644 --- a/sdk/python/pulumi_azure/lb/rule.py +++ b/sdk/python/pulumi_azure/lb/rule.py @@ -610,6 +610,32 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location="West US", + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location="West US", + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_rule = azure.lb.Rule("exampleRule", + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port=3389, + backend_port=3389, + frontend_ip_configuration_name="PublicIPAddress") + ``` + ## Import Load Balancer Rules can be imported using the `resource id`, e.g. @@ -647,6 +673,32 @@ def __init__(__self__, > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location="West US", + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location="West US", + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="PublicIPAddress", + public_ip_address_id=example_public_ip.id, + )]) + example_rule = azure.lb.Rule("exampleRule", + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port=3389, + backend_port=3389, + frontend_ip_configuration_name="PublicIPAddress") + ``` + ## Import Load Balancer Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lighthouse/assignment.py b/sdk/python/pulumi_azure/lighthouse/assignment.py index 84462d619d..0b4c102811 100644 --- a/sdk/python/pulumi_azure/lighthouse/assignment.py +++ b/sdk/python/pulumi_azure/lighthouse/assignment.py @@ -171,6 +171,18 @@ def __init__(__self__, """ Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Assignment to a subscription, or to a resource group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example = azure.lighthouse.Assignment("example", + scope=primary.id, + lighthouse_definition_id="/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000") + ``` + ## Import Lighthouse Assignments can be imported using the `resource id`, e.g. @@ -194,6 +206,18 @@ def __init__(__self__, """ Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Assignment to a subscription, or to a resource group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example = azure.lighthouse.Assignment("example", + scope=primary.id, + lighthouse_definition_id="/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000") + ``` + ## Import Lighthouse Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/lighthouse/definition.py b/sdk/python/pulumi_azure/lighthouse/definition.py index 3d4c2dee47..4b305b662b 100644 --- a/sdk/python/pulumi_azure/lighthouse/definition.py +++ b/sdk/python/pulumi_azure/lighthouse/definition.py @@ -367,6 +367,24 @@ def __init__(__self__, """ Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + contributor = azure.authorization.get_role_definition(role_definition_id="b24988ac-6180-42a0-ab88-20f7382dd24c") + example = azure.lighthouse.Definition("example", + description="This is a lighthouse definition created IaC", + managing_tenant_id="00000000-0000-0000-0000-000000000000", + scope="/subscriptions/00000000-0000-0000-0000-000000000000", + authorizations=[azure.lighthouse.DefinitionAuthorizationArgs( + principal_id="00000000-0000-0000-0000-000000000000", + role_definition_id=contributor.role_definition_id, + principal_display_name="Tier 1 Support", + )]) + ``` + ## Import Lighthouse Definitions can be imported using the `resource id`, e.g. @@ -395,6 +413,24 @@ def __init__(__self__, """ Manages a [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + contributor = azure.authorization.get_role_definition(role_definition_id="b24988ac-6180-42a0-ab88-20f7382dd24c") + example = azure.lighthouse.Definition("example", + description="This is a lighthouse definition created IaC", + managing_tenant_id="00000000-0000-0000-0000-000000000000", + scope="/subscriptions/00000000-0000-0000-0000-000000000000", + authorizations=[azure.lighthouse.DefinitionAuthorizationArgs( + principal_id="00000000-0000-0000-0000-000000000000", + role_definition_id=contributor.role_definition_id, + principal_display_name="Tier 1 Support", + )]) + ``` + ## Import Lighthouse Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loadtest/load_test.py b/sdk/python/pulumi_azure/loadtest/load_test.py index 92aa39fb99..02dd92a9e6 100644 --- a/sdk/python/pulumi_azure/loadtest/load_test.py +++ b/sdk/python/pulumi_azure/loadtest/load_test.py @@ -305,6 +305,20 @@ def __init__(__self__, Manages a Load Test Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_load_test = azure.loadtest.LoadTest("exampleLoadTest", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` ## Blocks Reference ### `identity` Block @@ -349,6 +363,20 @@ def __init__(__self__, Manages a Load Test Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_load_test = azure.loadtest.LoadTest("exampleLoadTest", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` ## Blocks Reference ### `identity` Block diff --git a/sdk/python/pulumi_azure/loganalytics/cluster.py b/sdk/python/pulumi_azure/loganalytics/cluster.py index 3d44892703..515cb794e1 100644 --- a/sdk/python/pulumi_azure/loganalytics/cluster.py +++ b/sdk/python/pulumi_azure/loganalytics/cluster.py @@ -318,6 +318,21 @@ def __init__(__self__, Manages a Log Analytics Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.loganalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.loganalytics.ClusterIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Log Analytics Clusters can be imported using the `resource id`, e.g. @@ -348,6 +363,21 @@ def __init__(__self__, Manages a Log Analytics Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.loganalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.loganalytics.ClusterIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Log Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/cluster_customer_managed_key.py b/sdk/python/pulumi_azure/loganalytics/cluster_customer_managed_key.py index 9a707fbece..bc33160d18 100644 --- a/sdk/python/pulumi_azure/loganalytics/cluster_customer_managed_key.py +++ b/sdk/python/pulumi_azure/loganalytics/cluster_customer_managed_key.py @@ -138,6 +138,66 @@ def __init__(__self__, """ Manages a Log Analytics Cluster Customer Managed Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_cluster = azure.loganalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.loganalytics.ClusterIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "GetRotationPolicy", + ], + secret_permissions=["Set"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_cluster.identity.tenant_id, + object_id=example_cluster.identity.principal_id, + key_permissions=[ + "Get", + "Unwrapkey", + "Wrapkey", + ], + ), + ], + tags={ + "environment": "Production", + }) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ]) + example_cluster_customer_managed_key = azure.loganalytics.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", + log_analytics_cluster_id=example_cluster.id, + key_vault_key_id=example_key.id) + ``` + ## Import Log Analytics Cluster Customer Managed Keys can be imported using the `resource id`, e.g. @@ -160,6 +220,66 @@ def __init__(__self__, """ Manages a Log Analytics Cluster Customer Managed Key. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_cluster = azure.loganalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.loganalytics.ClusterIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "GetRotationPolicy", + ], + secret_permissions=["Set"], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_cluster.identity.tenant_id, + object_id=example_cluster.identity.principal_id, + key_permissions=[ + "Get", + "Unwrapkey", + "Wrapkey", + ], + ), + ], + tags={ + "environment": "Production", + }) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ]) + example_cluster_customer_managed_key = azure.loganalytics.ClusterCustomerManagedKey("exampleClusterCustomerManagedKey", + log_analytics_cluster_id=example_cluster.id, + key_vault_key_id=example_key.id) + ``` + ## Import Log Analytics Cluster Customer Managed Keys can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/data_export_rule.py b/sdk/python/pulumi_azure/loganalytics/data_export_rule.py index 778c420f54..fd336586c1 100644 --- a/sdk/python/pulumi_azure/loganalytics/data_export_rule.py +++ b/sdk/python/pulumi_azure/loganalytics/data_export_rule.py @@ -316,6 +316,31 @@ def __init__(__self__, """ Manages a Log Analytics Data Export Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_data_export_rule = azure.loganalytics.DataExportRule("exampleDataExportRule", + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + destination_resource_id=example_account.id, + table_names=["Heartbeat"], + enabled=True) + ``` + ## Import Log Analytics Data Export Rule can be imported using the `resource id`, e.g. @@ -342,6 +367,31 @@ def __init__(__self__, """ Manages a Log Analytics Data Export Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_data_export_rule = azure.loganalytics.DataExportRule("exampleDataExportRule", + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + destination_resource_id=example_account.id, + table_names=["Heartbeat"], + enabled=True) + ``` + ## Import Log Analytics Data Export Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/data_source_windows_event.py b/sdk/python/pulumi_azure/loganalytics/data_source_windows_event.py index 4a8dd832ce..5b5925ca7a 100644 --- a/sdk/python/pulumi_azure/loganalytics/data_source_windows_event.py +++ b/sdk/python/pulumi_azure/loganalytics/data_source_windows_event.py @@ -259,6 +259,24 @@ def __init__(__self__, """ Manages a Log Analytics Windows Event DataSource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_data_source_windows_event = azure.loganalytics.DataSourceWindowsEvent("exampleDataSourceWindowsEvent", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name, + event_log_name="Application", + event_types=["Error"]) + ``` + ## Import Log Analytics Windows Event DataSources can be imported using the `resource id`, e.g. @@ -284,6 +302,24 @@ def __init__(__self__, """ Manages a Log Analytics Windows Event DataSource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_data_source_windows_event = azure.loganalytics.DataSourceWindowsEvent("exampleDataSourceWindowsEvent", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name, + event_log_name="Application", + event_types=["Error"]) + ``` + ## Import Log Analytics Windows Event DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/data_source_windows_performance_counter.py b/sdk/python/pulumi_azure/loganalytics/data_source_windows_performance_counter.py index 113803ffb2..ddd2ab0b0b 100644 --- a/sdk/python/pulumi_azure/loganalytics/data_source_windows_performance_counter.py +++ b/sdk/python/pulumi_azure/loganalytics/data_source_windows_performance_counter.py @@ -343,6 +343,26 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Windows Performance Counter DataSource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_data_source_windows_performance_counter = azure.loganalytics.DataSourceWindowsPerformanceCounter("exampleDataSourceWindowsPerformanceCounter", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name, + object_name="CPU", + instance_name="*", + counter_name="CPU", + interval_seconds=10) + ``` + ## Import Log Analytics Windows Performance Counter DataSources can be imported using the `resource id`, e.g. @@ -370,6 +390,26 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Windows Performance Counter DataSource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_data_source_windows_performance_counter = azure.loganalytics.DataSourceWindowsPerformanceCounter("exampleDataSourceWindowsPerformanceCounter", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name, + object_name="CPU", + instance_name="*", + counter_name="CPU", + interval_seconds=10) + ``` + ## Import Log Analytics Windows Performance Counter DataSources can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/linked_service.py b/sdk/python/pulumi_azure/loganalytics/linked_service.py index 31fd485da8..248b233227 100644 --- a/sdk/python/pulumi_azure/loganalytics/linked_service.py +++ b/sdk/python/pulumi_azure/loganalytics/linked_service.py @@ -246,6 +246,31 @@ def __init__(__self__, """ Manages a Log Analytics Linked Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic", + tags={ + "environment": "development", + }) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_linked_service = azure.loganalytics.LinkedService("exampleLinkedService", + resource_group_name=example_resource_group.name, + workspace_id=example_analytics_workspace.id, + read_access_id=example_account.id) + ``` + ## Import Log Analytics Workspaces can be imported using the `resource id`, e.g. @@ -272,6 +297,31 @@ def __init__(__self__, """ Manages a Log Analytics Linked Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.automation.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic", + tags={ + "environment": "development", + }) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_linked_service = azure.loganalytics.LinkedService("exampleLinkedService", + resource_group_name=example_resource_group.name, + workspace_id=example_analytics_workspace.id, + read_access_id=example_account.id) + ``` + ## Import Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/linked_storage_account.py b/sdk/python/pulumi_azure/loganalytics/linked_storage_account.py index 3c1be51dfb..bf177e090c 100644 --- a/sdk/python/pulumi_azure/loganalytics/linked_storage_account.py +++ b/sdk/python/pulumi_azure/loganalytics/linked_storage_account.py @@ -230,6 +230,29 @@ def __init__(__self__, """ Manages a Log Analytics Linked Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_linked_storage_account = azure.loganalytics.LinkedStorageAccount("exampleLinkedStorageAccount", + data_source_type="CustomLogs", + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + storage_account_ids=[example_account.id]) + ``` + ## Import Log Analytics Linked Storage Accounts can be imported using the `resource id`, e.g. @@ -256,6 +279,29 @@ def __init__(__self__, """ Manages a Log Analytics Linked Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_linked_storage_account = azure.loganalytics.LinkedStorageAccount("exampleLinkedStorageAccount", + data_source_type="CustomLogs", + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + storage_account_ids=[example_account.id]) + ``` + ## Import Log Analytics Linked Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/query_pack.py b/sdk/python/pulumi_azure/loganalytics/query_pack.py index bdd959a754..1cb35b0e47 100644 --- a/sdk/python/pulumi_azure/loganalytics/query_pack.py +++ b/sdk/python/pulumi_azure/loganalytics/query_pack.py @@ -207,6 +207,18 @@ def __init__(__self__, """ Manages a Log Analytics Query Pack. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_query_pack = azure.loganalytics.QueryPack("exampleQueryPack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Log Analytics Query Packs can be imported using the `resource id`, e.g. @@ -231,6 +243,18 @@ def __init__(__self__, """ Manages a Log Analytics Query Pack. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_query_pack = azure.loganalytics.QueryPack("exampleQueryPack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Log Analytics Query Packs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/saved_search.py b/sdk/python/pulumi_azure/loganalytics/saved_search.py index dfc1ae76e4..afc700e097 100644 --- a/sdk/python/pulumi_azure/loganalytics/saved_search.py +++ b/sdk/python/pulumi_azure/loganalytics/saved_search.py @@ -370,6 +370,25 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Saved Search. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_saved_search = azure.loganalytics.SavedSearch("exampleSavedSearch", + log_analytics_workspace_id=example_analytics_workspace.id, + category="exampleCategory", + display_name="exampleDisplayName", + query="exampleQuery") + ``` + ## Import Log Analytics Saved Searches can be imported using the `resource id`, e.g. @@ -398,6 +417,25 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Saved Search. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_saved_search = azure.loganalytics.SavedSearch("exampleSavedSearch", + log_analytics_workspace_id=example_analytics_workspace.id, + category="exampleCategory", + display_name="exampleDisplayName", + query="exampleQuery") + ``` + ## Import Log Analytics Saved Searches can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/loganalytics/storage_insights.py b/sdk/python/pulumi_azure/loganalytics/storage_insights.py index 9ddee863f3..4d87920941 100644 --- a/sdk/python/pulumi_azure/loganalytics/storage_insights.py +++ b/sdk/python/pulumi_azure/loganalytics/storage_insights.py @@ -341,6 +341,30 @@ def __init__(__self__, """ Manages a Log Analytics Storage Insights resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_storage_insights = azure.loganalytics.StorageInsights("exampleStorageInsights", + resource_group_name=example_resource_group.name, + workspace_id=example_analytics_workspace.id, + storage_account_id=example_account.id, + storage_account_key=example_account.primary_access_key) + ``` + ## Import Log Analytics Storage Insight Configs can be imported using the `resource id`, e.g. @@ -368,6 +392,30 @@ def __init__(__self__, """ Manages a Log Analytics Storage Insights resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_storage_insights = azure.loganalytics.StorageInsights("exampleStorageInsights", + resource_group_name=example_resource_group.name, + workspace_id=example_analytics_workspace.id, + storage_account_id=example_account.id, + storage_account_key=example_account.primary_access_key) + ``` + ## Import Log Analytics Storage Insight Configs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/action_custom.py b/sdk/python/pulumi_azure/logicapps/action_custom.py index 5d269860e1..cb5448eb05 100644 --- a/sdk/python/pulumi_azure/logicapps/action_custom.py +++ b/sdk/python/pulumi_azure/logicapps/action_custom.py @@ -179,6 +179,35 @@ def __init__(__self__, """ Manages a Custom Action within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_action_custom = azure.logicapps.ActionCustom("exampleActionCustom", + logic_app_id=example_workflow.id, + body=\"\"\"{ + "description": "A variable to configure the auto expiration age in days. Configured in negative number. Default is -30 (30 days old).", + "inputs": { + "variables": [ + { + "name": "ExpirationAgeInDays", + "type": "Integer", + "value": -30 + } + ] + }, + "runAfter": {}, + "type": "InitializeVariable" + } + \"\"\") + ``` + ## Import Logic App Custom Actions can be imported using the `resource id`, e.g. @@ -204,6 +233,35 @@ def __init__(__self__, """ Manages a Custom Action within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_action_custom = azure.logicapps.ActionCustom("exampleActionCustom", + logic_app_id=example_workflow.id, + body=\"\"\"{ + "description": "A variable to configure the auto expiration age in days. Configured in negative number. Default is -30 (30 days old).", + "inputs": { + "variables": [ + { + "name": "ExpirationAgeInDays", + "type": "Integer", + "value": -30 + } + ] + }, + "runAfter": {}, + "type": "InitializeVariable" + } + \"\"\") + ``` + ## Import Logic App Custom Actions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/action_http.py b/sdk/python/pulumi_azure/logicapps/action_http.py index 6ba64ca78a..e496f4a6ad 100644 --- a/sdk/python/pulumi_azure/logicapps/action_http.py +++ b/sdk/python/pulumi_azure/logicapps/action_http.py @@ -371,6 +371,22 @@ def __init__(__self__, """ Manages an HTTP Action within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_action_http = azure.logicapps.ActionHttp("exampleActionHttp", + logic_app_id=example_workflow.id, + method="GET", + uri="http://example.com/some-webhook") + ``` + ## Import Logic App HTTP Actions can be imported using the `resource id`, e.g. @@ -401,6 +417,22 @@ def __init__(__self__, """ Manages an HTTP Action within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_action_http = azure.logicapps.ActionHttp("exampleActionHttp", + logic_app_id=example_workflow.id, + method="GET", + uri="http://example.com/some-webhook") + ``` + ## Import Logic App HTTP Actions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/get_integration_account.py b/sdk/python/pulumi_azure/logicapps/get_integration_account.py index 5133bbee85..87c322873c 100644 --- a/sdk/python/pulumi_azure/logicapps/get_integration_account.py +++ b/sdk/python/pulumi_azure/logicapps/get_integration_account.py @@ -104,6 +104,17 @@ def get_integration_account(name: Optional[str] = None, """ Use this data source to access information about an existing Logic App Integration Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.logicapps.get_integration_account(name="example-account", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Logic App Integration Account. :param str resource_group_name: The name of the Resource Group where the Logic App Integration Account exists. @@ -130,6 +141,17 @@ def get_integration_account_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Logic App Integration Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.logicapps.get_integration_account(name="example-account", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Logic App Integration Account. :param str resource_group_name: The name of the Resource Group where the Logic App Integration Account exists. diff --git a/sdk/python/pulumi_azure/logicapps/get_standard.py b/sdk/python/pulumi_azure/logicapps/get_standard.py index 17bbf88561..d2627814ac 100644 --- a/sdk/python/pulumi_azure/logicapps/get_standard.py +++ b/sdk/python/pulumi_azure/logicapps/get_standard.py @@ -294,6 +294,17 @@ def get_standard(name: Optional[str] = None, """ Use this data source to access information about an existing Logic App Standard instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.logicapps.get_standard(name="logicappstd", + resource_group_name="example-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Logic App. :param str resource_group_name: The name of the Resource Group where the Logic App exists. @@ -345,6 +356,17 @@ def get_standard_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Logic App Standard instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.logicapps.get_standard(name="logicappstd", + resource_group_name="example-rg") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Logic App. :param str resource_group_name: The name of the Resource Group where the Logic App exists. diff --git a/sdk/python/pulumi_azure/logicapps/get_workflow.py b/sdk/python/pulumi_azure/logicapps/get_workflow.py index de5d71b35e..6242d7aa12 100644 --- a/sdk/python/pulumi_azure/logicapps/get_workflow.py +++ b/sdk/python/pulumi_azure/logicapps/get_workflow.py @@ -213,6 +213,17 @@ def get_workflow(name: Optional[str] = None, """ Use this data source to access information about an existing Logic App Workflow. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.logicapps.get_workflow(name="workflow1", + resource_group_name="my-resource-group") + pulumi.export("accessEndpoint", example.access_endpoint) + ``` + :param str name: The name of the Logic App Workflow. :param str resource_group_name: The name of the Resource Group in which the Logic App Workflow exists. @@ -248,6 +259,17 @@ def get_workflow_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Logic App Workflow. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.logicapps.get_workflow(name="workflow1", + resource_group_name="my-resource-group") + pulumi.export("accessEndpoint", example.access_endpoint) + ``` + :param str name: The name of the Logic App Workflow. :param str resource_group_name: The name of the Resource Group in which the Logic App Workflow exists. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account.py b/sdk/python/pulumi_azure/logicapps/integration_account.py index 635bea9338..decc61820b 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account.py @@ -290,6 +290,22 @@ def __init__(__self__, """ Manages a Logic App Integration Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Standard", + tags={ + "foo": "bar", + }) + ``` + ## Import Logic App Integration Accounts can be imported using the `resource id`, e.g. @@ -316,6 +332,22 @@ def __init__(__self__, """ Manages a Logic App Integration Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Standard", + tags={ + "foo": "bar", + }) + ``` + ## Import Logic App Integration Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_agreement.py b/sdk/python/pulumi_azure/logicapps/integration_account_agreement.py index a4e24b3ee6..d69c954d59 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_agreement.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_agreement.py @@ -462,6 +462,48 @@ def __init__(__self__, """ Manages a Logic App Integration Account Agreement. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test_integration_account = azure.logicapps.IntegrationAccount("testIntegrationAccount", + location=example.location, + resource_group_name=example.name, + sku_name="Standard") + host = azure.logicapps.IntegrationAccountPartner("host", + resource_group_name=example.name, + integration_account_name=test_integration_account.name, + business_identities=[azure.logicapps.IntegrationAccountPartnerBusinessIdentityArgs( + qualifier="AS2Identity", + value="FabrikamNY", + )]) + guest = azure.logicapps.IntegrationAccountPartner("guest", + resource_group_name=example.name, + integration_account_name=test_integration_account.name, + business_identities=[azure.logicapps.IntegrationAccountPartnerBusinessIdentityArgs( + qualifier="AS2Identity", + value="FabrikamDC", + )]) + test_integration_account_agreement = azure.logicapps.IntegrationAccountAgreement("testIntegrationAccountAgreement", + resource_group_name=example.name, + integration_account_name=test_integration_account.name, + agreement_type="AS2", + host_partner_name=host.name, + guest_partner_name=guest.name, + content=(lambda path: open(path).read())("testdata/integration_account_agreement_content_as2.json"), + host_identity=azure.logicapps.IntegrationAccountAgreementHostIdentityArgs( + qualifier="AS2Identity", + value="FabrikamNY", + ), + guest_identity=azure.logicapps.IntegrationAccountAgreementGuestIdentityArgs( + qualifier="AS2Identity", + value="FabrikamDC", + )) + ``` + ## Import Logic App Integration Account Agreements can be imported using the `resource id`, e.g. @@ -492,6 +534,48 @@ def __init__(__self__, """ Manages a Logic App Integration Account Agreement. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test_integration_account = azure.logicapps.IntegrationAccount("testIntegrationAccount", + location=example.location, + resource_group_name=example.name, + sku_name="Standard") + host = azure.logicapps.IntegrationAccountPartner("host", + resource_group_name=example.name, + integration_account_name=test_integration_account.name, + business_identities=[azure.logicapps.IntegrationAccountPartnerBusinessIdentityArgs( + qualifier="AS2Identity", + value="FabrikamNY", + )]) + guest = azure.logicapps.IntegrationAccountPartner("guest", + resource_group_name=example.name, + integration_account_name=test_integration_account.name, + business_identities=[azure.logicapps.IntegrationAccountPartnerBusinessIdentityArgs( + qualifier="AS2Identity", + value="FabrikamDC", + )]) + test_integration_account_agreement = azure.logicapps.IntegrationAccountAgreement("testIntegrationAccountAgreement", + resource_group_name=example.name, + integration_account_name=test_integration_account.name, + agreement_type="AS2", + host_partner_name=host.name, + guest_partner_name=guest.name, + content=(lambda path: open(path).read())("testdata/integration_account_agreement_content_as2.json"), + host_identity=azure.logicapps.IntegrationAccountAgreementHostIdentityArgs( + qualifier="AS2Identity", + value="FabrikamNY", + ), + guest_identity=azure.logicapps.IntegrationAccountAgreementGuestIdentityArgs( + qualifier="AS2Identity", + value="FabrikamDC", + )) + ``` + ## Import Logic App Integration Account Agreements can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_assembly.py b/sdk/python/pulumi_azure/logicapps/integration_account_assembly.py index f30ba97f46..0d05519afb 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_assembly.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_assembly.py @@ -373,6 +373,25 @@ def __init__(__self__, """ Manages a Logic App Integration Account Assembly. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_integration_account_assembly = azure.logicapps.IntegrationAccountAssembly("exampleIntegrationAccountAssembly", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + assembly_name="TestAssembly", + content=(lambda path: base64.b64encode(open(path).read().encode()).decode())("testdata/log4net.dll")) + ``` + ## Import Logic App Integration Account Assemblies can be imported using the `resource id`, e.g. @@ -401,6 +420,25 @@ def __init__(__self__, """ Manages a Logic App Integration Account Assembly. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_integration_account_assembly = azure.logicapps.IntegrationAccountAssembly("exampleIntegrationAccountAssembly", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + assembly_name="TestAssembly", + content=(lambda path: base64.b64encode(open(path).read().encode()).decode())("testdata/log4net.dll")) + ``` + ## Import Logic App Integration Account Assemblies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_batch_configuration.py b/sdk/python/pulumi_azure/logicapps/integration_account_batch_configuration.py index d44db31878..b4bc701ecb 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_batch_configuration.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_batch_configuration.py @@ -298,6 +298,26 @@ def __init__(__self__, """ Manages a Logic App Integration Account Batch Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_batch_configuration = azure.logicapps.IntegrationAccountBatchConfiguration("exampleIntegrationAccountBatchConfiguration", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + batch_group_name="TestBatchGroup", + release_criteria=azure.logicapps.IntegrationAccountBatchConfigurationReleaseCriteriaArgs( + message_count=80, + )) + ``` + ## Import Logic App Integration Account Batch Configurations can be imported using the `resource id`, e.g. @@ -324,6 +344,26 @@ def __init__(__self__, """ Manages a Logic App Integration Account Batch Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_batch_configuration = azure.logicapps.IntegrationAccountBatchConfiguration("exampleIntegrationAccountBatchConfiguration", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + batch_group_name="TestBatchGroup", + release_criteria=azure.logicapps.IntegrationAccountBatchConfigurationReleaseCriteriaArgs( + message_count=80, + )) + ``` + ## Import Logic App Integration Account Batch Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_certificate.py b/sdk/python/pulumi_azure/logicapps/integration_account_certificate.py index 1c89ef9a39..0507cf0ac8 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_certificate.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_certificate.py @@ -296,6 +296,23 @@ def __init__(__self__, """ Manages a Logic App Integration Account Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_certificate = azure.logicapps.IntegrationAccountCertificate("exampleIntegrationAccountCertificate", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + public_certificate="MIIDbzCCAlegAwIBAgIJAIzjRD36sIbbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAl0ZXJyYWZvcm0xFTATBgNVBAMMDHRlcnJhZm9ybS5pbzAgFw0xNzA0MjEyMDA1MjdaGA8yMTE3MDMyODIwMDUyN1owTTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAoMCXRlcnJhZm9ybTEVMBMGA1UEAwwMdGVycmFmb3JtLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3L9L5szT4+FLykTFNyyPjy/k3BQTYAfRQzP2dhnsuUKm3cdPC0NyZ+wEXIUGhoDO2YG6EYChOl8fsDqDOjloSUGKqYw++nlpHIuUgJx8IxxG2XkALCjFU7EmF+w7kn76d0ezpEIYxnLP+KG2DVornoEt1aLhv1MLmpgEZZPhDbMSLhSYWeTVRMayXLwqtfgnDumQSB+8d/1JuJqrSI4pD12JozVThzb6hsjfb6RMX4epPmrGn0PbTPEEA6awmsxBCXB0s13nNQt/O0hLM2agwvAyozilQV+s616Ckgk6DJoUkqZhDy7vPYMIRSr98fBws6zkrV6tTLjmD8xAvobePQIDAQABo1AwTjAdBgNVHQ4EFgQUXIqO421zMMmbcRRX9wctZFCQuPIwHwYDVR0jBBgwFoAUXIqO421zMMmbcRRX9wctZFCQuPIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAr82NeT3BYJOKLlUL6Om5LjUF66ewcJjG9ltdvyQwVneMcq7t5UAPxgChzqNRVk4da8PzkXpjBJyWezHupdJNX3XqeUk2kSxqQ6/gmhqvfI3y7djrwoO6jvMEY26WqtkTNORWDP3THJJVimC3zV+KMU5UBVrEzhOVhHSU709lBP75o0BBn3xGsPqSq9k8IotIFfyAc6a+XP3+ZMpvh7wqAUml7vWa5wlcXExCx39h1balfDSLGNC4swWPCp9AMnQR0p+vMay9hNP1Eh+9QYUai14d5KS3cFV+KxE1cJR5HD/iLltnnOEbpMsB0eVOZWkFvE7Y5lW0oVSAfin5TwTJMQ==") + ``` + ## Import Logic App Integration Account Certificates can be imported using the `resource id`, e.g. @@ -322,6 +339,23 @@ def __init__(__self__, """ Manages a Logic App Integration Account Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_certificate = azure.logicapps.IntegrationAccountCertificate("exampleIntegrationAccountCertificate", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + public_certificate="MIIDbzCCAlegAwIBAgIJAIzjRD36sIbbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAl0ZXJyYWZvcm0xFTATBgNVBAMMDHRlcnJhZm9ybS5pbzAgFw0xNzA0MjEyMDA1MjdaGA8yMTE3MDMyODIwMDUyN1owTTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxEjAQBgNVBAoMCXRlcnJhZm9ybTEVMBMGA1UEAwwMdGVycmFmb3JtLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3L9L5szT4+FLykTFNyyPjy/k3BQTYAfRQzP2dhnsuUKm3cdPC0NyZ+wEXIUGhoDO2YG6EYChOl8fsDqDOjloSUGKqYw++nlpHIuUgJx8IxxG2XkALCjFU7EmF+w7kn76d0ezpEIYxnLP+KG2DVornoEt1aLhv1MLmpgEZZPhDbMSLhSYWeTVRMayXLwqtfgnDumQSB+8d/1JuJqrSI4pD12JozVThzb6hsjfb6RMX4epPmrGn0PbTPEEA6awmsxBCXB0s13nNQt/O0hLM2agwvAyozilQV+s616Ckgk6DJoUkqZhDy7vPYMIRSr98fBws6zkrV6tTLjmD8xAvobePQIDAQABo1AwTjAdBgNVHQ4EFgQUXIqO421zMMmbcRRX9wctZFCQuPIwHwYDVR0jBBgwFoAUXIqO421zMMmbcRRX9wctZFCQuPIwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAr82NeT3BYJOKLlUL6Om5LjUF66ewcJjG9ltdvyQwVneMcq7t5UAPxgChzqNRVk4da8PzkXpjBJyWezHupdJNX3XqeUk2kSxqQ6/gmhqvfI3y7djrwoO6jvMEY26WqtkTNORWDP3THJJVimC3zV+KMU5UBVrEzhOVhHSU709lBP75o0BBn3xGsPqSq9k8IotIFfyAc6a+XP3+ZMpvh7wqAUml7vWa5wlcXExCx39h1balfDSLGNC4swWPCp9AMnQR0p+vMay9hNP1Eh+9QYUai14d5KS3cFV+KxE1cJR5HD/iLltnnOEbpMsB0eVOZWkFvE7Y5lW0oVSAfin5TwTJMQ==") + ``` + ## Import Logic App Integration Account Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_map.py b/sdk/python/pulumi_azure/logicapps/integration_account_map.py index 9604d88c96..38b0373ac4 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_map.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_map.py @@ -292,6 +292,24 @@ def __init__(__self__, """ Manages a Logic App Integration Account Map. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_map = azure.logicapps.IntegrationAccountMap("exampleIntegrationAccountMap", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + map_type="Xslt", + content=(lambda path: open(path).read())("testdata/integration_account_map_content.xsd")) + ``` + ## Import Logic App Integration Account Maps can be imported using the `resource id`, e.g. @@ -318,6 +336,24 @@ def __init__(__self__, """ Manages a Logic App Integration Account Map. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_map = azure.logicapps.IntegrationAccountMap("exampleIntegrationAccountMap", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + map_type="Xslt", + content=(lambda path: open(path).read())("testdata/integration_account_map_content.xsd")) + ``` + ## Import Logic App Integration Account Maps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_partner.py b/sdk/python/pulumi_azure/logicapps/integration_account_partner.py index d31ec1d0de..6bbdba961a 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_partner.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_partner.py @@ -256,6 +256,26 @@ def __init__(__self__, """ Manages a Logic App Integration Account Partner. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_partner = azure.logicapps.IntegrationAccountPartner("exampleIntegrationAccountPartner", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + business_identities=[azure.logicapps.IntegrationAccountPartnerBusinessIdentityArgs( + qualifier="ZZ", + value="AA", + )]) + ``` + ## Import Logic App Integration Account Partners can be imported using the `resource id`, e.g. @@ -281,6 +301,26 @@ def __init__(__self__, """ Manages a Logic App Integration Account Partner. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_integration_account_partner = azure.logicapps.IntegrationAccountPartner("exampleIntegrationAccountPartner", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + business_identities=[azure.logicapps.IntegrationAccountPartnerBusinessIdentityArgs( + qualifier="ZZ", + value="AA", + )]) + ``` + ## Import Logic App Integration Account Partners can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_schema.py b/sdk/python/pulumi_azure/logicapps/integration_account_schema.py index f566ac767b..6bdc133043 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_schema.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_schema.py @@ -291,6 +291,23 @@ def __init__(__self__, """ Manages a Logic App Integration Account Schema. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_integration_account_schema = azure.logicapps.IntegrationAccountSchema("exampleIntegrationAccountSchema", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + content=(lambda path: open(path).read())("testdata/integration_account_schema_content.xsd")) + ``` + ## Import Logic App Integration Account Schemas can be imported using the `resource id`, e.g. @@ -317,6 +334,23 @@ def __init__(__self__, """ Manages a Logic App Integration Account Schema. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_integration_account_schema = azure.logicapps.IntegrationAccountSchema("exampleIntegrationAccountSchema", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + content=(lambda path: open(path).read())("testdata/integration_account_schema_content.xsd")) + ``` + ## Import Logic App Integration Account Schemas can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/integration_account_session.py b/sdk/python/pulumi_azure/logicapps/integration_account_session.py index 1abb8ffbf8..25e7e99752 100644 --- a/sdk/python/pulumi_azure/logicapps/integration_account_session.py +++ b/sdk/python/pulumi_azure/logicapps/integration_account_session.py @@ -213,6 +213,26 @@ def __init__(__self__, """ Manages a Logic App Integration Account Session. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_integration_account_session = azure.logicapps.IntegrationAccountSession("exampleIntegrationAccountSession", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + content=\"\"\" { + "controlNumber": "1234" + } + \"\"\") + ``` + ## Import Logic App Integration Account Sessions can be imported using the `resource id`, e.g. @@ -237,6 +257,26 @@ def __init__(__self__, """ Manages a Logic App Integration Account Session. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_integration_account = azure.logicapps.IntegrationAccount("exampleIntegrationAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Basic") + example_integration_account_session = azure.logicapps.IntegrationAccountSession("exampleIntegrationAccountSession", + resource_group_name=example_resource_group.name, + integration_account_name=example_integration_account.name, + content=\"\"\" { + "controlNumber": "1234" + } + \"\"\") + ``` + ## Import Logic App Integration Account Sessions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/interation_service_environment.py b/sdk/python/pulumi_azure/logicapps/interation_service_environment.py index bcec6df6d0..a2e0ce9c77 100644 --- a/sdk/python/pulumi_azure/logicapps/interation_service_environment.py +++ b/sdk/python/pulumi_azure/logicapps/interation_service_environment.py @@ -422,6 +422,55 @@ def __init__(__self__, !> **NOTE:** The `logicapps.InterationServiceEnvironment` resource is deprecated and will be removed in v4.0 of the Azure Provider. The underlying Azure Service is being retired on 2024-08-31 and new instances cannot be provisioned by default after 2022-11-01. More information on the retirement and how to migrate to Logic Apps Standard [can be found here](https://aka.ms/isedeprecation). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/22"]) + isesubnet1 = azure.network.Subnet("isesubnet1", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/27"], + delegations=[azure.network.SubnetDelegationArgs( + name="integrationServiceEnvironments", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Logic/integrationServiceEnvironments", + ), + )]) + isesubnet2 = azure.network.Subnet("isesubnet2", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.32/27"]) + isesubnet3 = azure.network.Subnet("isesubnet3", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.64/27"]) + isesubnet4 = azure.network.Subnet("isesubnet4", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.96/27"]) + example_interation_service_environment = azure.logicapps.InterationServiceEnvironment("exampleInterationServiceEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Developer_0", + access_endpoint_type="Internal", + virtual_network_subnet_ids=[ + isesubnet1.id, + isesubnet2.id, + isesubnet3.id, + isesubnet4.id, + ], + tags={ + "environment": "development", + }) + ``` + ## Import Integration Service Environments can be imported using the `resource id`, e.g. @@ -453,6 +502,55 @@ def __init__(__self__, !> **NOTE:** The `logicapps.InterationServiceEnvironment` resource is deprecated and will be removed in v4.0 of the Azure Provider. The underlying Azure Service is being retired on 2024-08-31 and new instances cannot be provisioned by default after 2022-11-01. More information on the retirement and how to migrate to Logic Apps Standard [can be found here](https://aka.ms/isedeprecation). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/22"]) + isesubnet1 = azure.network.Subnet("isesubnet1", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/27"], + delegations=[azure.network.SubnetDelegationArgs( + name="integrationServiceEnvironments", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Logic/integrationServiceEnvironments", + ), + )]) + isesubnet2 = azure.network.Subnet("isesubnet2", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.32/27"]) + isesubnet3 = azure.network.Subnet("isesubnet3", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.64/27"]) + isesubnet4 = azure.network.Subnet("isesubnet4", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.96/27"]) + example_interation_service_environment = azure.logicapps.InterationServiceEnvironment("exampleInterationServiceEnvironment", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Developer_0", + access_endpoint_type="Internal", + virtual_network_subnet_ids=[ + isesubnet1.id, + isesubnet2.id, + isesubnet3.id, + isesubnet4.id, + ], + tags={ + "environment": "development", + }) + ``` + ## Import Integration Service Environments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/standard.py b/sdk/python/pulumi_azure/logicapps/standard.py index 1b434d8636..c81d516156 100644 --- a/sdk/python/pulumi_azure/logicapps/standard.py +++ b/sdk/python/pulumi_azure/logicapps/standard.py @@ -967,6 +967,75 @@ def __init__(__self__, Manages a Logic App (Standard / Single Tenant) ## Example Usage + ### With App Service Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="elastic", + sku=azure.appservice.PlanSkuArgs( + tier="WorkflowStandard", + size="WS1", + )) + example_standard = azure.logicapps.Standard("exampleStandard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + app_settings={ + "FUNCTIONS_WORKER_RUNTIME": "node", + "WEBSITE_NODE_DEFAULT_VERSION": "~18", + }) + ``` + ### For Container Mode) + + > **Note:** You must set `appservice.Plan` `kind` to `Linux` and `reserved` to `true` when used with `linux_fx_version` + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Linux", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="WorkflowStandard", + size="WS1", + )) + example_standard = azure.logicapps.Standard("exampleStandard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.logicapps.StandardSiteConfigArgs( + linux_fx_version="DOCKER|mcr.microsoft.com/azure-functions/dotnet:3.0-appservice", + ), + app_settings={ + "DOCKER_REGISTRY_SERVER_URL": "https://.azurecr.io", + "DOCKER_REGISTRY_SERVER_USERNAME": "username", + "DOCKER_REGISTRY_SERVER_PASSWORD": "password", + }) + ``` ## Import @@ -1009,6 +1078,75 @@ def __init__(__self__, Manages a Logic App (Standard / Single Tenant) ## Example Usage + ### With App Service Plan) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="elastic", + sku=azure.appservice.PlanSkuArgs( + tier="WorkflowStandard", + size="WS1", + )) + example_standard = azure.logicapps.Standard("exampleStandard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + app_settings={ + "FUNCTIONS_WORKER_RUNTIME": "node", + "WEBSITE_NODE_DEFAULT_VERSION": "~18", + }) + ``` + ### For Container Mode) + + > **Note:** You must set `appservice.Plan` `kind` to `Linux` and `reserved` to `true` when used with `linux_fx_version` + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="Linux", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="WorkflowStandard", + size="WS1", + )) + example_standard = azure.logicapps.Standard("exampleStandard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + site_config=azure.logicapps.StandardSiteConfigArgs( + linux_fx_version="DOCKER|mcr.microsoft.com/azure-functions/dotnet:3.0-appservice", + ), + app_settings={ + "DOCKER_REGISTRY_SERVER_URL": "https://.azurecr.io", + "DOCKER_REGISTRY_SERVER_USERNAME": "username", + "DOCKER_REGISTRY_SERVER_PASSWORD": "password", + }) + ``` ## Import diff --git a/sdk/python/pulumi_azure/logicapps/trigger_custom.py b/sdk/python/pulumi_azure/logicapps/trigger_custom.py index b0485daee7..c5d08868bd 100644 --- a/sdk/python/pulumi_azure/logicapps/trigger_custom.py +++ b/sdk/python/pulumi_azure/logicapps/trigger_custom.py @@ -179,6 +179,28 @@ def __init__(__self__, """ Manages a Custom Trigger within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_custom = azure.logicapps.TriggerCustom("exampleTriggerCustom", + logic_app_id=example_workflow.id, + body=\"\"\"{ + "recurrence": { + "frequency": "Day", + "interval": 1 + }, + "type": "Recurrence" + } + \"\"\") + ``` + ## Import Logic App Custom Triggers can be imported using the `resource id`, e.g. @@ -204,6 +226,28 @@ def __init__(__self__, """ Manages a Custom Trigger within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_custom = azure.logicapps.TriggerCustom("exampleTriggerCustom", + logic_app_id=example_workflow.id, + body=\"\"\"{ + "recurrence": { + "frequency": "Day", + "interval": 1 + }, + "type": "Recurrence" + } + \"\"\") + ``` + ## Import Logic App Custom Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/trigger_http_request.py b/sdk/python/pulumi_azure/logicapps/trigger_http_request.py index a3fe7cd44d..99917d43fd 100644 --- a/sdk/python/pulumi_azure/logicapps/trigger_http_request.py +++ b/sdk/python/pulumi_azure/logicapps/trigger_http_request.py @@ -285,6 +285,29 @@ def __init__(__self__, """ Manages a HTTP Request Trigger within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_http_request = azure.logicapps.TriggerHttpRequest("exampleTriggerHttpRequest", + logic_app_id=example_workflow.id, + schema=\"\"\"{ + "type": "object", + "properties": { + "hello": { + "type": "string" + } + } + } + \"\"\") + ``` + ## Import Logic App HTTP Request Triggers can be imported using the `resource id`, e.g. @@ -314,6 +337,29 @@ def __init__(__self__, """ Manages a HTTP Request Trigger within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_http_request = azure.logicapps.TriggerHttpRequest("exampleTriggerHttpRequest", + logic_app_id=example_workflow.id, + schema=\"\"\"{ + "type": "object", + "properties": { + "hello": { + "type": "string" + } + } + } + \"\"\") + ``` + ## Import Logic App HTTP Request Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/trigger_recurrence.py b/sdk/python/pulumi_azure/logicapps/trigger_recurrence.py index 5e33ab98e5..97d2e5371c 100644 --- a/sdk/python/pulumi_azure/logicapps/trigger_recurrence.py +++ b/sdk/python/pulumi_azure/logicapps/trigger_recurrence.py @@ -338,6 +338,22 @@ def __init__(__self__, """ Manages a Recurrence Trigger within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_recurrence = azure.logicapps.TriggerRecurrence("exampleTriggerRecurrence", + logic_app_id=example_workflow.id, + frequency="Day", + interval=1) + ``` + ## Import Logic App Recurrence Triggers can be imported using the `resource id`, e.g. @@ -367,6 +383,22 @@ def __init__(__self__, """ Manages a Recurrence Trigger within a Logic App Workflow + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_trigger_recurrence = azure.logicapps.TriggerRecurrence("exampleTriggerRecurrence", + logic_app_id=example_workflow.id, + frequency="Day", + interval=1) + ``` + ## Import Logic App Recurrence Triggers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/logicapps/workflow.py b/sdk/python/pulumi_azure/logicapps/workflow.py index 18147974b7..3f53a80708 100644 --- a/sdk/python/pulumi_azure/logicapps/workflow.py +++ b/sdk/python/pulumi_azure/logicapps/workflow.py @@ -674,6 +674,18 @@ def __init__(__self__, """ Manages a Logic App Workflow. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Logic App Workflows can be imported using the `resource id`, e.g. @@ -709,6 +721,18 @@ def __init__(__self__, """ Manages a Logic App Workflow. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workflow = azure.logicapps.Workflow("exampleWorkflow", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Logic App Workflows can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/machinelearning/compute_cluster.py b/sdk/python/pulumi_azure/machinelearning/compute_cluster.py index a53ee06f3f..2f331729f8 100644 --- a/sdk/python/pulumi_azure/machinelearning/compute_cluster.py +++ b/sdk/python/pulumi_azure/machinelearning/compute_cluster.py @@ -611,6 +611,66 @@ def __init__(__self__, Manages a Machine Learning Compute Cluster. **NOTE:** At this point in time the resource cannot be updated (not supported by the backend Azure Go SDK). Therefore it can only be created and deleted, not updated. At the moment, there is also no possibility to specify ssh User Account Credentials to ssh into the compute cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.1.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"]) + test = azure.machinelearning.ComputeCluster("test", + location=example_resource_group.location, + vm_priority="LowPriority", + vm_size="Standard_DS2_v2", + machine_learning_workspace_id=example_workspace.id, + subnet_resource_id=example_subnet.id, + scale_settings=azure.machinelearning.ComputeClusterScaleSettingsArgs( + min_node_count=0, + max_node_count=1, + scale_down_nodes_after_idle_duration="PT30S", + ), + identity=azure.machinelearning.ComputeClusterIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Machine Learning Compute Clusters can be imported using the `resource id`, e.g. @@ -646,6 +706,66 @@ def __init__(__self__, Manages a Machine Learning Compute Cluster. **NOTE:** At this point in time the resource cannot be updated (not supported by the backend Azure Go SDK). Therefore it can only be created and deleted, not updated. At the moment, there is also no possibility to specify ssh User Account Credentials to ssh into the compute cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.1.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"]) + test = azure.machinelearning.ComputeCluster("test", + location=example_resource_group.location, + vm_priority="LowPriority", + vm_size="Standard_DS2_v2", + machine_learning_workspace_id=example_workspace.id, + subnet_resource_id=example_subnet.id, + scale_settings=azure.machinelearning.ComputeClusterScaleSettingsArgs( + min_node_count=0, + max_node_count=1, + scale_down_nodes_after_idle_duration="PT30S", + ), + identity=azure.machinelearning.ComputeClusterIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Machine Learning Compute Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/machinelearning/compute_instance.py b/sdk/python/pulumi_azure/machinelearning/compute_instance.py index d82ba5a1fa..a7d5e8114b 100644 --- a/sdk/python/pulumi_azure/machinelearning/compute_instance.py +++ b/sdk/python/pulumi_azure/machinelearning/compute_instance.py @@ -567,6 +567,69 @@ def __init__(__self__, """ Manages a Machine Learning Compute Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.1.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"]) + config = pulumi.Config() + ssh_key = config.get("sshKey") + if ssh_key is None: + ssh_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" + example_compute_instance = azure.machinelearning.ComputeInstance("exampleComputeInstance", + location=example_resource_group.location, + machine_learning_workspace_id=example_workspace.id, + virtual_machine_size="STANDARD_DS2_V2", + authorization_type="personal", + ssh=azure.machinelearning.ComputeInstanceSshArgs( + public_key=ssh_key, + ), + subnet_resource_id=example_subnet.id, + description="foo", + tags={ + "foo": "bar", + }) + ``` + ## Import Machine Learning Compute Instances can be imported using the `resource id`, e.g. @@ -600,6 +663,69 @@ def __init__(__self__, """ Manages a Machine Learning Compute Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.1.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"]) + config = pulumi.Config() + ssh_key = config.get("sshKey") + if ssh_key is None: + ssh_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld" + example_compute_instance = azure.machinelearning.ComputeInstance("exampleComputeInstance", + location=example_resource_group.location, + machine_learning_workspace_id=example_workspace.id, + virtual_machine_size="STANDARD_DS2_V2", + authorization_type="personal", + ssh=azure.machinelearning.ComputeInstanceSshArgs( + public_key=ssh_key, + ), + subnet_resource_id=example_subnet.id, + description="foo", + tags={ + "foo": "bar", + }) + ``` + ## Import Machine Learning Compute Instances can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/machinelearning/datastore_blobstorage.py b/sdk/python/pulumi_azure/machinelearning/datastore_blobstorage.py index 1e7fd33f5f..a0385bc3de 100644 --- a/sdk/python/pulumi_azure/machinelearning/datastore_blobstorage.py +++ b/sdk/python/pulumi_azure/machinelearning/datastore_blobstorage.py @@ -430,6 +430,45 @@ def __init__(__self__, Manages a Machine Learning Blob Storage DataStore. ## Example Usage + ### With Azure Blob + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_datastore_blobstorage = azure.machinelearning.DatastoreBlobstorage("exampleDatastoreBlobstorage", + workspace_id=example_workspace.id, + storage_container_id=example_container.resource_manager_id, + account_key=example_account.primary_access_key) + ``` ## Import @@ -465,6 +504,45 @@ def __init__(__self__, Manages a Machine Learning Blob Storage DataStore. ## Example Usage + ### With Azure Blob + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_datastore_blobstorage = azure.machinelearning.DatastoreBlobstorage("exampleDatastoreBlobstorage", + workspace_id=example_workspace.id, + storage_container_id=example_container.resource_manager_id, + account_key=example_account.primary_access_key) + ``` ## Import diff --git a/sdk/python/pulumi_azure/machinelearning/datastore_datalake_gen2.py b/sdk/python/pulumi_azure/machinelearning/datastore_datalake_gen2.py index 7035a15a1e..63b9ad931f 100644 --- a/sdk/python/pulumi_azure/machinelearning/datastore_datalake_gen2.py +++ b/sdk/python/pulumi_azure/machinelearning/datastore_datalake_gen2.py @@ -474,6 +474,45 @@ def __init__(__self__, """ Manages a Machine Learning Data Lake Gen2 DataStore. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_datastore_datalake_gen2 = azure.machinelearning.DatastoreDatalakeGen2("exampleDatastoreDatalakeGen2", + workspace_id=example_workspace.id, + storage_container_id=example_container.resource_manager_id) + ``` + ## Import Machine Learning DataStores can be imported using the `resource id`, e.g. @@ -504,6 +543,45 @@ def __init__(__self__, """ Manages a Machine Learning Data Lake Gen2 DataStore. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_datastore_datalake_gen2 = azure.machinelearning.DatastoreDatalakeGen2("exampleDatastoreDatalakeGen2", + workspace_id=example_workspace.id, + storage_container_id=example_container.resource_manager_id) + ``` + ## Import Machine Learning DataStores can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/machinelearning/get_workspace.py b/sdk/python/pulumi_azure/machinelearning/get_workspace.py index 542d97c97b..1e3f43a458 100644 --- a/sdk/python/pulumi_azure/machinelearning/get_workspace.py +++ b/sdk/python/pulumi_azure/machinelearning/get_workspace.py @@ -105,6 +105,17 @@ def get_workspace(name: Optional[str] = None, """ Use this data source to access information about an existing Machine Learning Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.machinelearning.get_workspace(name="example-workspace", + resource_group_name="example-resources") + pulumi.export("id", azurerm_machine_learning_workspace["existing"]["id"]) + ``` + :param str name: The name of the Machine Learning Workspace exists. :param str resource_group_name: The name of the Resource Group where the Machine Learning Workspace exists. @@ -131,6 +142,17 @@ def get_workspace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Machine Learning Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.machinelearning.get_workspace(name="example-workspace", + resource_group_name="example-resources") + pulumi.export("id", azurerm_machine_learning_workspace["existing"]["id"]) + ``` + :param str name: The name of the Machine Learning Workspace exists. :param str resource_group_name: The name of the Resource Group where the Machine Learning Workspace exists. diff --git a/sdk/python/pulumi_azure/machinelearning/inference_cluster.py b/sdk/python/pulumi_azure/machinelearning/inference_cluster.py index a28e6b1094..85a18f0862 100644 --- a/sdk/python/pulumi_azure/machinelearning/inference_cluster.py +++ b/sdk/python/pulumi_azure/machinelearning/inference_cluster.py @@ -413,6 +413,74 @@ def __init__(__self__, > **NOTE:** The Machine Learning Inference Cluster resource is used to attach an existing AKS cluster to the Machine Learning Workspace, it doesn't create the AKS cluster itself. Therefore it can only be created and deleted, not updated. Any change to the configuration will recreate the resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.1.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"]) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix_private_cluster="prefix", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=3, + vm_size="Standard_D3_v2", + vnet_subnet_id=example_subnet.id, + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + )) + example_inference_cluster = azure.machinelearning.InferenceCluster("exampleInferenceCluster", + location=example_resource_group.location, + cluster_purpose="FastProd", + kubernetes_cluster_id=example_kubernetes_cluster.id, + description="This is an example cluster used with Terraform", + machine_learning_workspace_id=example_workspace.id, + tags={ + "stage": "example", + }) + ``` + ## Import Machine Learning Inference Clusters can be imported using the `resource id`, e.g. @@ -446,6 +514,74 @@ def __init__(__self__, > **NOTE:** The Machine Learning Inference Cluster resource is used to attach an existing AKS cluster to the Machine Learning Workspace, it doesn't create the AKS cluster itself. Therefore it can only be created and deleted, not updated. Any change to the configuration will recreate the resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.1.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"]) + example_kubernetes_cluster = azure.containerservice.KubernetesCluster("exampleKubernetesCluster", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + dns_prefix_private_cluster="prefix", + default_node_pool=azure.containerservice.KubernetesClusterDefaultNodePoolArgs( + name="default", + node_count=3, + vm_size="Standard_D3_v2", + vnet_subnet_id=example_subnet.id, + ), + identity=azure.containerservice.KubernetesClusterIdentityArgs( + type="SystemAssigned", + )) + example_inference_cluster = azure.machinelearning.InferenceCluster("exampleInferenceCluster", + location=example_resource_group.location, + cluster_purpose="FastProd", + kubernetes_cluster_id=example_kubernetes_cluster.id, + description="This is an example cluster used with Terraform", + machine_learning_workspace_id=example_workspace.id, + tags={ + "stage": "example", + }) + ``` + ## Import Machine Learning Inference Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/machinelearning/synapse_spark.py b/sdk/python/pulumi_azure/machinelearning/synapse_spark.py index a588470c91..3a4ae195d2 100644 --- a/sdk/python/pulumi_azure/machinelearning/synapse_spark.py +++ b/sdk/python/pulumi_azure/machinelearning/synapse_spark.py @@ -366,6 +366,66 @@ def __init__(__self__, """ Manages the linked service to link an Azure Machine learning workspace to an Azure Synapse workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_synapse_workspace_workspace = azure.synapse.Workspace("exampleSynapse/workspaceWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_spark_pool = azure.synapse.SparkPool("exampleSparkPool", + synapse_workspace_id=example_synapse / workspace_workspace["id"], + node_size_family="MemoryOptimized", + node_size="Small", + node_count=3) + example_synapse_spark = azure.machinelearning.SynapseSpark("exampleSynapseSpark", + machine_learning_workspace_id=example_workspace.id, + location=example_resource_group.location, + synapse_spark_pool_id=example_spark_pool.id, + identity=azure.machinelearning.SynapseSparkIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Machine Learning Synapse Sparks can be imported using the `resource id`, e.g. @@ -394,6 +454,66 @@ def __init__(__self__, """ Manages the linked service to link an Azure Machine learning workspace to an Azure Synapse workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", + location="west europe", + tags={ + "stage": "example", + }) + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_synapse_workspace_workspace = azure.synapse.Workspace("exampleSynapse/workspaceWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_spark_pool = azure.synapse.SparkPool("exampleSparkPool", + synapse_workspace_id=example_synapse / workspace_workspace["id"], + node_size_family="MemoryOptimized", + node_size="Small", + node_count=3) + example_synapse_spark = azure.machinelearning.SynapseSpark("exampleSynapseSpark", + machine_learning_workspace_id=example_workspace.id, + location=example_resource_group.location, + synapse_spark_pool_id=example_spark_pool.id, + identity=azure.machinelearning.SynapseSparkIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Machine Learning Synapse Sparks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/machinelearning/workspace.py b/sdk/python/pulumi_azure/machinelearning/workspace.py index 288c1fc27b..18449cb580 100644 --- a/sdk/python/pulumi_azure/machinelearning/workspace.py +++ b/sdk/python/pulumi_azure/machinelearning/workspace.py @@ -890,6 +890,237 @@ def __init__(__self__, v1_legacy_mode_enabled: Optional[pulumi.Input[bool]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + ``` + ### With Data Encryption + + > **NOTE:** The Key Vault must enable purge protection. + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + example_key_vault, + example_access_policy, + ])) + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + encryption=azure.machinelearning.WorkspaceEncryptionArgs( + key_vault_id=example_key_vault.id, + key_id=example_key.id, + )) + ``` + ### With User Assigned Identity And Data Encryption + + > **NOTE:** The Key Vault must enable purge protection. + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_identity = azure.keyvault.AccessPolicy("example-identity", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "WrapKey", + "UnwrapKey", + "Get", + "Recover", + ], + secret_permissions=[ + "Get", + "List", + "Set", + "Delete", + "Recover", + "Backup", + "Restore", + ]) + example_sp = azure.keyvault.AccessPolicy("example-sp", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Recover", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + test = azuread.get_service_principal(display_name="Azure Cosmos DB") + example_cosmosdb = azure.keyvault.AccessPolicy("example-cosmosdb", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=test.object_id, + key_permissions=[ + "Get", + "Recover", + "UnwrapKey", + "WrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + test, + current, + ])) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + example_key_vault, + example_sp, + ])) + example_role1 = azure.authorization.Assignment("example-role1", + scope=example_key_vault.id, + role_definition_name="Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_role2 = azure.authorization.Assignment("example-role2", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_role3 = azure.authorization.Assignment("example-role3", + scope=example_account.id, + role_definition_name="Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_role4 = azure.authorization.Assignment("example-role4", + scope=example_insights.id, + role_definition_name="Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + high_business_impact=True, + primary_user_assigned_identity=example_user_assigned_identity.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + encryption=azure.machinelearning.WorkspaceEncryptionArgs( + user_assigned_identity_id=example_user_assigned_identity.id, + key_vault_id=example_key_vault.id, + key_id=example_key.id, + ), + opts=pulumi.ResourceOptions(depends_on=[ + example_role1, + example_role2, + example_role3, + example_role4, + example_cosmosdb, + ])) + ``` + ## Import Machine Learning Workspace can be imported using the `resource id`, e.g. @@ -933,6 +1164,237 @@ def __init__(__self__, args: WorkspaceArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + ``` + ### With Data Encryption + + > **NOTE:** The Key Vault must enable purge protection. + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_access_policy = azure.keyvault.AccessPolicy("exampleAccessPolicy", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + example_key_vault, + example_access_policy, + ])) + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + encryption=azure.machinelearning.WorkspaceEncryptionArgs( + key_vault_id=example_key_vault.id, + key_id=example_key.id, + )) + ``` + ### With User Assigned Identity And Data Encryption + + > **NOTE:** The Key Vault must enable purge protection. + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="GRS") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_identity = azure.keyvault.AccessPolicy("example-identity", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "WrapKey", + "UnwrapKey", + "Get", + "Recover", + ], + secret_permissions=[ + "Get", + "List", + "Set", + "Delete", + "Recover", + "Backup", + "Restore", + ]) + example_sp = azure.keyvault.AccessPolicy("example-sp", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Recover", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + test = azuread.get_service_principal(display_name="Azure Cosmos DB") + example_cosmosdb = azure.keyvault.AccessPolicy("example-cosmosdb", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=test.object_id, + key_permissions=[ + "Get", + "Recover", + "UnwrapKey", + "WrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + test, + current, + ])) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + example_key_vault, + example_sp, + ])) + example_role1 = azure.authorization.Assignment("example-role1", + scope=example_key_vault.id, + role_definition_name="Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_role2 = azure.authorization.Assignment("example-role2", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_role3 = azure.authorization.Assignment("example-role3", + scope=example_account.id, + role_definition_name="Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_role4 = azure.authorization.Assignment("example-role4", + scope=example_insights.id, + role_definition_name="Contributor", + principal_id=example_user_assigned_identity.principal_id) + example_workspace = azure.machinelearning.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_insights_id=example_insights.id, + key_vault_id=example_key_vault.id, + storage_account_id=example_account.id, + high_business_impact=True, + primary_user_assigned_identity=example_user_assigned_identity.id, + identity=azure.machinelearning.WorkspaceIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + encryption=azure.machinelearning.WorkspaceEncryptionArgs( + user_assigned_identity_id=example_user_assigned_identity.id, + key_vault_id=example_key_vault.id, + key_id=example_key.id, + ), + opts=pulumi.ResourceOptions(depends_on=[ + example_role1, + example_role2, + example_role3, + example_role4, + example_cosmosdb, + ])) + ``` + ## Import Machine Learning Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/maintenance/assignment_dedicated_host.py b/sdk/python/pulumi_azure/maintenance/assignment_dedicated_host.py index d71ef2b9f2..d3c2f6ba58 100644 --- a/sdk/python/pulumi_azure/maintenance/assignment_dedicated_host.py +++ b/sdk/python/pulumi_azure/maintenance/assignment_dedicated_host.py @@ -175,6 +175,32 @@ def __init__(__self__, """ Manages a maintenance assignment to Dedicated Host. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dedicated_host_group = azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + platform_fault_domain_count=2) + example_dedicated_host = azure.compute.DedicatedHost("exampleDedicatedHost", + location=example_resource_group.location, + dedicated_host_group_id=example_dedicated_host_group.id, + sku_name="DSv3-Type1", + platform_fault_domain=1) + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="Host") + example_assignment_dedicated_host = azure.maintenance.AssignmentDedicatedHost("exampleAssignmentDedicatedHost", + location=example_resource_group.location, + maintenance_configuration_id=example_configuration.id, + dedicated_host_id=example_dedicated_host.id) + ``` + ## Import Maintenance Assignment can be imported using the `resource id`, e.g. @@ -198,6 +224,32 @@ def __init__(__self__, """ Manages a maintenance assignment to Dedicated Host. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_dedicated_host_group = azure.compute.DedicatedHostGroup("exampleDedicatedHostGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + platform_fault_domain_count=2) + example_dedicated_host = azure.compute.DedicatedHost("exampleDedicatedHost", + location=example_resource_group.location, + dedicated_host_group_id=example_dedicated_host_group.id, + sku_name="DSv3-Type1", + platform_fault_domain=1) + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="Host") + example_assignment_dedicated_host = azure.maintenance.AssignmentDedicatedHost("exampleAssignmentDedicatedHost", + location=example_resource_group.location, + maintenance_configuration_id=example_configuration.id, + dedicated_host_id=example_dedicated_host.id) + ``` + ## Import Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine.py b/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine.py index fd59ba05f9..d5e4d9a975 100644 --- a/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine.py +++ b/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine.py @@ -175,6 +175,59 @@ def __init__(__self__, """ Manages a maintenance assignment to virtual machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_ssh_keys=[azure.compute.LinuxVirtualMachineAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="All") + example_assignment_virtual_machine = azure.maintenance.AssignmentVirtualMachine("exampleAssignmentVirtualMachine", + location=example_resource_group.location, + maintenance_configuration_id=example_configuration.id, + virtual_machine_id=example_linux_virtual_machine.id) + ``` + ## Import Maintenance Assignment can be imported using the `resource id`, e.g. @@ -198,6 +251,59 @@ def __init__(__self__, """ Manages a maintenance assignment to virtual machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_ssh_keys=[azure.compute.LinuxVirtualMachineAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="All") + example_assignment_virtual_machine = azure.maintenance.AssignmentVirtualMachine("exampleAssignmentVirtualMachine", + location=example_resource_group.location, + maintenance_configuration_id=example_configuration.id, + virtual_machine_id=example_linux_virtual_machine.id) + ``` + ## Import Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine_scale_set.py b/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine_scale_set.py index 319285fbf3..d0c76a47f6 100644 --- a/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine_scale_set.py +++ b/sdk/python/pulumi_azure/maintenance/assignment_virtual_machine_scale_set.py @@ -175,6 +175,120 @@ def __init__(__self__, """ Manages a maintenance assignment to a virtual machine scale set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="internal", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + example_probe = azure.lb.Probe("exampleProbe", + loadbalancer_id=example_load_balancer.id, + port=22, + protocol="Tcp") + example_rule = azure.lb.Rule("exampleRule", + loadbalancer_id=example_load_balancer.id, + probe_id=example_probe.id, + frontend_ip_configuration_name="internal", + protocol="Tcp", + frontend_port=22, + backend_port=22) + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="OSImage", + visibility="Custom", + window=azure.maintenance.ConfigurationWindowArgs( + start_date_time="2021-12-31 00:00", + expiration_date_time="9999-12-31 00:00", + duration="06:00", + time_zone="Pacific Standard Time", + recur_every="1Days", + )) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + )) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_username="adminuser", + admin_password="P@ssword1234!", + upgrade_mode="Automatic", + health_probe_id=example_probe.id, + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=example_subnet.id, + load_balancer_backend_address_pool_ids=[example_backend_address_pool.id], + )], + )], + automatic_os_upgrade_policy=azure.compute.LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyArgs( + disable_automatic_rollback=True, + enable_automatic_os_upgrade=True, + ), + rolling_upgrade_policy=azure.compute.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs( + max_batch_instance_percent=20, + max_unhealthy_instance_percent=20, + max_unhealthy_upgraded_instance_percent=20, + pause_time_between_batches="PT0S", + ), + opts=pulumi.ResourceOptions(depends_on=["azurerm_lb_rule.example"])) + example_assignment_virtual_machine_scale_set = azure.maintenance.AssignmentVirtualMachineScaleSet("exampleAssignmentVirtualMachineScaleSet", + location=example_resource_group.location, + maintenance_configuration_id=example_configuration.id, + virtual_machine_scale_set_id=example_linux_virtual_machine.id) + ``` + ## Import Maintenance Assignment can be imported using the `resource id`, e.g. @@ -198,6 +312,120 @@ def __init__(__self__, """ Manages a maintenance assignment to a virtual machine scale set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="internal", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + example_probe = azure.lb.Probe("exampleProbe", + loadbalancer_id=example_load_balancer.id, + port=22, + protocol="Tcp") + example_rule = azure.lb.Rule("exampleRule", + loadbalancer_id=example_load_balancer.id, + probe_id=example_probe.id, + frontend_ip_configuration_name="internal", + protocol="Tcp", + frontend_port=22, + backend_port=22) + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="OSImage", + visibility="Custom", + window=azure.maintenance.ConfigurationWindowArgs( + start_date_time="2021-12-31 00:00", + expiration_date_time="9999-12-31 00:00", + duration="06:00", + time_zone="Pacific Standard Time", + recur_every="1Days", + )) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + )) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_username="adminuser", + admin_password="P@ssword1234!", + upgrade_mode="Automatic", + health_probe_id=example_probe.id, + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=example_subnet.id, + load_balancer_backend_address_pool_ids=[example_backend_address_pool.id], + )], + )], + automatic_os_upgrade_policy=azure.compute.LinuxVirtualMachineScaleSetAutomaticOsUpgradePolicyArgs( + disable_automatic_rollback=True, + enable_automatic_os_upgrade=True, + ), + rolling_upgrade_policy=azure.compute.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs( + max_batch_instance_percent=20, + max_unhealthy_instance_percent=20, + max_unhealthy_upgraded_instance_percent=20, + pause_time_between_batches="PT0S", + ), + opts=pulumi.ResourceOptions(depends_on=["azurerm_lb_rule.example"])) + example_assignment_virtual_machine_scale_set = azure.maintenance.AssignmentVirtualMachineScaleSet("exampleAssignmentVirtualMachineScaleSet", + location=example_resource_group.location, + maintenance_configuration_id=example_configuration.id, + virtual_machine_scale_set_id=example_linux_virtual_machine.id) + ``` + ## Import Maintenance Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/maintenance/configuration.py b/sdk/python/pulumi_azure/maintenance/configuration.py index 4362824aeb..cb98294414 100644 --- a/sdk/python/pulumi_azure/maintenance/configuration.py +++ b/sdk/python/pulumi_azure/maintenance/configuration.py @@ -448,6 +448,22 @@ def __init__(__self__, """ Manages a maintenance configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="SQLDB", + tags={ + "Env": "prod", + }) + ``` + ## Import Maintenance Configuration can be imported using the `resource id`, e.g. @@ -480,6 +496,22 @@ def __init__(__self__, """ Manages a maintenance configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_configuration = azure.maintenance.Configuration("exampleConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + scope="SQLDB", + tags={ + "Env": "prod", + }) + ``` + ## Import Maintenance Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/maintenance/get_configuration.py b/sdk/python/pulumi_azure/maintenance/get_configuration.py index 062c9276e3..bc48acbc3c 100644 --- a/sdk/python/pulumi_azure/maintenance/get_configuration.py +++ b/sdk/python/pulumi_azure/maintenance/get_configuration.py @@ -165,6 +165,17 @@ def get_configuration(name: Optional[str] = None, """ Use this data source to access information about an existing Maintenance Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.maintenance.get_configuration(name="example-mc", + resource_group_name="example-resources") + pulumi.export("id", azurerm_maintenance_configuration["existing"]["id"]) + ``` + :param str name: Specifies the name of the Maintenance Configuration. :param str resource_group_name: Specifies the name of the Resource Group where this Maintenance Configuration exists. @@ -196,6 +207,17 @@ def get_configuration_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Maintenance Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.maintenance.get_configuration(name="example-mc", + resource_group_name="example-resources") + pulumi.export("id", azurerm_maintenance_configuration["existing"]["id"]) + ``` + :param str name: Specifies the name of the Maintenance Configuration. :param str resource_group_name: Specifies the name of the Resource Group where this Maintenance Configuration exists. diff --git a/sdk/python/pulumi_azure/maintenance/get_public_configurations.py b/sdk/python/pulumi_azure/maintenance/get_public_configurations.py index 6b011260d1..a2d9caaf63 100644 --- a/sdk/python/pulumi_azure/maintenance/get_public_configurations.py +++ b/sdk/python/pulumi_azure/maintenance/get_public_configurations.py @@ -97,6 +97,18 @@ def get_public_configurations(location: Optional[str] = None, """ Use this data source to access information about existing Public Maintenance Configurations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.maintenance.get_public_configurations(location="West Europe", + scope="SQLManagedInstance", + recur_every="Monday-Thursday") + pulumi.export("name", existing.configs[0].name) + ``` + :param str location: The Azure location to filter the list of Public Maintenance Configurations against. :param str recur_every: The recurring window to filter the list of Public Maintenance Configurations against. Possible values are `Monday-Thursday` and `Friday-Sunday` @@ -125,6 +137,18 @@ def get_public_configurations_output(location: Optional[pulumi.Input[Optional[st """ Use this data source to access information about existing Public Maintenance Configurations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + existing = azure.maintenance.get_public_configurations(location="West Europe", + scope="SQLManagedInstance", + recur_every="Monday-Thursday") + pulumi.export("name", existing.configs[0].name) + ``` + :param str location: The Azure location to filter the list of Public Maintenance Configurations against. :param str recur_every: The recurring window to filter the list of Public Maintenance Configurations against. Possible values are `Monday-Thursday` and `Friday-Sunday` diff --git a/sdk/python/pulumi_azure/managedapplication/application.py b/sdk/python/pulumi_azure/managedapplication/application.py index 8dc7f27cb2..b9dd8080b0 100644 --- a/sdk/python/pulumi_azure/managedapplication/application.py +++ b/sdk/python/pulumi_azure/managedapplication/application.py @@ -483,6 +483,46 @@ def __init__(__self__, """ Manages a Managed Application. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + current = azure.core.get_client_config() + builtin = azure.authorization.get_role_definition(name="Contributor") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_definition = azure.managedapplication.Definition("exampleDefinition", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + lock_level="ReadOnly", + package_file_uri="https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + display_name="TestManagedAppDefinition", + description="Test Managed App Definition", + authorizations=[azure.managedapplication.DefinitionAuthorizationArgs( + service_principal_id=current.object_id, + role_definition_id=builtin.id.split("/")[len(builtin.id.split("/")) - 1], + )]) + example_application = azure.managedapplication.Application("exampleApplication", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="ServiceCatalog", + managed_resource_group_name="infrastructureGroup", + application_definition_id=example_definition.id, + parameter_values=example_resource_group.location.apply(lambda location: json.dumps({ + "location": { + "value": location, + }, + "storageAccountNamePrefix": { + "value": "storeNamePrefix", + }, + "storageAccountType": { + "value": "Standard_LRS", + }, + }))) + ``` + ## Import Managed Application can be imported using the `resource id`, e.g. @@ -515,6 +555,46 @@ def __init__(__self__, """ Manages a Managed Application. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + current = azure.core.get_client_config() + builtin = azure.authorization.get_role_definition(name="Contributor") + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_definition = azure.managedapplication.Definition("exampleDefinition", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + lock_level="ReadOnly", + package_file_uri="https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + display_name="TestManagedAppDefinition", + description="Test Managed App Definition", + authorizations=[azure.managedapplication.DefinitionAuthorizationArgs( + service_principal_id=current.object_id, + role_definition_id=builtin.id.split("/")[len(builtin.id.split("/")) - 1], + )]) + example_application = azure.managedapplication.Application("exampleApplication", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="ServiceCatalog", + managed_resource_group_name="infrastructureGroup", + application_definition_id=example_definition.id, + parameter_values=example_resource_group.location.apply(lambda location: json.dumps({ + "location": { + "value": location, + }, + "storageAccountNamePrefix": { + "value": "storeNamePrefix", + }, + "storageAccountType": { + "value": "Standard_LRS", + }, + }))) + ``` + ## Import Managed Application can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/managedapplication/definition.py b/sdk/python/pulumi_azure/managedapplication/definition.py index 5b692e328c..7fc1c14f52 100644 --- a/sdk/python/pulumi_azure/managedapplication/definition.py +++ b/sdk/python/pulumi_azure/managedapplication/definition.py @@ -539,6 +539,27 @@ def __init__(__self__, """ Manages a Managed Application Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_definition = azure.managedapplication.Definition("exampleDefinition", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + lock_level="ReadOnly", + package_file_uri="https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + display_name="TestManagedApplicationDefinition", + description="Test Managed Application Definition", + authorizations=[azure.managedapplication.DefinitionAuthorizationArgs( + service_principal_id=current.object_id, + role_definition_id="a094b430-dad3-424d-ae58-13f72fd72591", + )]) + ``` + ## Import Managed Application Definition can be imported using the `resource id`, e.g. @@ -573,6 +594,27 @@ def __init__(__self__, """ Manages a Managed Application Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_definition = azure.managedapplication.Definition("exampleDefinition", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + lock_level="ReadOnly", + package_file_uri="https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip", + display_name="TestManagedApplicationDefinition", + description="Test Managed Application Definition", + authorizations=[azure.managedapplication.DefinitionAuthorizationArgs( + service_principal_id=current.object_id, + role_definition_id="a094b430-dad3-424d-ae58-13f72fd72591", + )]) + ``` + ## Import Managed Application Definition can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/managedapplication/get_definition.py b/sdk/python/pulumi_azure/managedapplication/get_definition.py index 11eb801758..2287f92341 100644 --- a/sdk/python/pulumi_azure/managedapplication/get_definition.py +++ b/sdk/python/pulumi_azure/managedapplication/get_definition.py @@ -77,6 +77,17 @@ def get_definition(name: Optional[str] = None, """ Uses this data source to access information about an existing Managed Application Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.managedapplication.get_definition(name="examplemanagedappdef", + resource_group_name="exampleresources") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the Managed Application Definition. :param str resource_group_name: Specifies the name of the Resource Group where this Managed Application Definition exists. @@ -101,6 +112,17 @@ def get_definition_output(name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing Managed Application Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.managedapplication.get_definition(name="examplemanagedappdef", + resource_group_name="exampleresources") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the Managed Application Definition. :param str resource_group_name: Specifies the name of the Resource Group where this Managed Application Definition exists. diff --git a/sdk/python/pulumi_azure/management/get_group.py b/sdk/python/pulumi_azure/management/get_group.py index bf7398af4c..7aea96ea0c 100644 --- a/sdk/python/pulumi_azure/management/get_group.py +++ b/sdk/python/pulumi_azure/management/get_group.py @@ -128,6 +128,16 @@ def get_group(display_name: Optional[str] = None, """ Use this data source to access information about an existing Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + pulumi.export("displayName", example.display_name) + ``` + :param str display_name: Specifies the display name of this Management Group. @@ -158,6 +168,16 @@ def get_group_output(display_name: Optional[pulumi.Input[Optional[str]]] = None, """ Use this data source to access information about an existing Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + pulumi.export("displayName", example.display_name) + ``` + :param str display_name: Specifies the display name of this Management Group. diff --git a/sdk/python/pulumi_azure/management/group.py b/sdk/python/pulumi_azure/management/group.py index 27ad143df8..4840403911 100644 --- a/sdk/python/pulumi_azure/management/group.py +++ b/sdk/python/pulumi_azure/management/group.py @@ -224,6 +224,23 @@ def __init__(__self__, !> **Note:** Configuring `subscription_ids` is not supported when using the `management.GroupSubscriptionAssociation` resource, results will be unpredictable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_parent = azure.management.Group("exampleParent", + display_name="ParentGroup", + subscription_ids=[current.subscription_id]) + example_child = azure.management.Group("exampleChild", + display_name="ChildGroup", + parent_management_group_id=example_parent.id, + subscription_ids=[current.subscription_id]) + # other subscription IDs can go here + ``` + ## Import Management Groups can be imported using the `management group resource id`, e.g. @@ -252,6 +269,23 @@ def __init__(__self__, !> **Note:** Configuring `subscription_ids` is not supported when using the `management.GroupSubscriptionAssociation` resource, results will be unpredictable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_parent = azure.management.Group("exampleParent", + display_name="ParentGroup", + subscription_ids=[current.subscription_id]) + example_child = azure.management.Group("exampleChild", + display_name="ChildGroup", + parent_management_group_id=example_parent.id, + subscription_ids=[current.subscription_id]) + # other subscription IDs can go here + ``` + ## Import Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/python/pulumi_azure/management/group_policy_assignment.py b/sdk/python/pulumi_azure/management/group_policy_assignment.py index 89d9a5d388..b0e2db077a 100644 --- a/sdk/python/pulumi_azure/management/group_policy_assignment.py +++ b/sdk/python/pulumi_azure/management/group_policy_assignment.py @@ -608,6 +608,35 @@ def __init__(__self__, """ Manages a Policy Assignment to a Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup", display_name="Some Management Group") + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="my-policy-definition", + management_group_id=example_group.id, + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_group_policy_assignment = azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment", + policy_definition_id=example_definition.id, + management_group_id=example_group.id) + ``` + ## Import Management Group Policy Assignments can be imported using the `resource id`, e.g. @@ -644,6 +673,35 @@ def __init__(__self__, """ Manages a Policy Assignment to a Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup", display_name="Some Management Group") + example_definition = azure.policy.Definition("exampleDefinition", + policy_type="Custom", + mode="All", + display_name="my-policy-definition", + management_group_id=example_group.id, + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "equals": "westeurope" + } + }, + "then": { + "effect": "Deny" + } + } + \"\"\") + example_group_policy_assignment = azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment", + policy_definition_id=example_definition.id, + management_group_id=example_group.id) + ``` + ## Import Management Group Policy Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/management/group_policy_exemption.py b/sdk/python/pulumi_azure/management/group_policy_exemption.py index 0676cae699..3554d31bc9 100644 --- a/sdk/python/pulumi_azure/management/group_policy_exemption.py +++ b/sdk/python/pulumi_azure/management/group_policy_exemption.py @@ -414,6 +414,27 @@ def __init__(__self__, """ Manages a Management Group Policy Exemption. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup", display_name="Example MgmtGroup") + example_policy_set_definition = azure.policy.get_policy_set_definition(display_name="Audit machines with insecure password security settings") + example_group_policy_assignment = azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment", + management_group_id=example_group.id, + policy_definition_id=example_policy_set_definition.id, + location="westus", + identity=azure.management.GroupPolicyAssignmentIdentityArgs( + type="SystemAssigned", + )) + example_group_policy_exemption = azure.management.GroupPolicyExemption("exampleGroupPolicyExemption", + management_group_id=example_group.id, + policy_assignment_id=example_group_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. @@ -443,6 +464,27 @@ def __init__(__self__, """ Manages a Management Group Policy Exemption. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup", display_name="Example MgmtGroup") + example_policy_set_definition = azure.policy.get_policy_set_definition(display_name="Audit machines with insecure password security settings") + example_group_policy_assignment = azure.management.GroupPolicyAssignment("exampleGroupPolicyAssignment", + management_group_id=example_group.id, + policy_definition_id=example_policy_set_definition.id, + location="westus", + identity=azure.management.GroupPolicyAssignmentIdentityArgs( + type="SystemAssigned", + )) + example_group_policy_exemption = azure.management.GroupPolicyExemption("exampleGroupPolicyExemption", + management_group_id=example_group.id, + policy_assignment_id=example_group_policy_assignment.id, + exemption_category="Mitigated") + ``` + ## Import Policy Exemptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/management/group_subscription_association.py b/sdk/python/pulumi_azure/management/group_subscription_association.py index 1d16d0ed27..a45c7a9ed7 100644 --- a/sdk/python/pulumi_azure/management/group_subscription_association.py +++ b/sdk/python/pulumi_azure/management/group_subscription_association.py @@ -140,6 +140,19 @@ def __init__(__self__, !> **Note:** When using this resource, configuring `subscription_ids` on the `management.Group` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="exampleManagementGroup") + example_subscription = azure.core.get_subscription(subscription_id="12345678-1234-1234-1234-123456789012") + example_group_subscription_association = azure.management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", + management_group_id=example_group.id, + subscription_id=example_subscription.id) + ``` + ## Import Managements can be imported using the `resource id`, e.g. @@ -164,6 +177,19 @@ def __init__(__self__, !> **Note:** When using this resource, configuring `subscription_ids` on the `management.Group` resource is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="exampleManagementGroup") + example_subscription = azure.core.get_subscription(subscription_id="12345678-1234-1234-1234-123456789012") + example_group_subscription_association = azure.management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", + management_group_id=example_group.id, + subscription_id=example_subscription.id) + ``` + ## Import Managements can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/management/group_template_deployment.py b/sdk/python/pulumi_azure/management/group_template_deployment.py index 9fbe54bfae..0f7598c778 100644 --- a/sdk/python/pulumi_azure/management/group_template_deployment.py +++ b/sdk/python/pulumi_azure/management/group_template_deployment.py @@ -395,6 +395,85 @@ def __init__(__self__, > **Note:** Deployments to a Management Group are always Incrementally applied. Existing resources that are not part of the template will not be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_group_template_deployment = azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", + location="West Europe", + management_group_id=example_group.id, + template_content=\"\"\"{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "policyAssignmentName": { + "type": "string", + "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]", + "metadata": { + "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides." + } + }, + "policyDefinitionID": { + "type": "string", + "metadata": { + "description": "Specifies the ID of the policy definition or policy set definition being assigned." + } + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/policyAssignments", + "name": "[parameters('policyAssignmentName')]", + "apiVersion": "2019-09-01", + "properties": { + "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]", + "policyDefinitionId": "[parameters('policyDefinitionID')]" + } + } + ] + } + \"\"\", + parameters_content=\"\"\"{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "policyDefinitionID": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a" + } + } + } + \"\"\") + ``` + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_group_template_deployment = azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", + location="West Europe", + management_group_id=example_group.id, + template_content=(lambda path: open(path).read())("templates/example-deploy-template.json"), + parameters_content=(lambda path: open(path).read())("templates/example-deploy-params.json")) + ``` + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_template_spec_version = azure.core.get_template_spec_version(name="exampleTemplateForManagementGroup", + resource_group_name="exampleResourceGroup", + version="v1.0.9") + example_group_template_deployment = azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", + location="West Europe", + management_group_id=example_group.id, + template_spec_version_id=example_template_spec_version.id) + ``` + ## Import Management Group Template Deployments can be imported using the `resource id`, e.g. @@ -427,6 +506,85 @@ def __init__(__self__, > **Note:** Deployments to a Management Group are always Incrementally applied. Existing resources that are not part of the template will not be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_group_template_deployment = azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", + location="West Europe", + management_group_id=example_group.id, + template_content=\"\"\"{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "policyAssignmentName": { + "type": "string", + "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]", + "metadata": { + "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides." + } + }, + "policyDefinitionID": { + "type": "string", + "metadata": { + "description": "Specifies the ID of the policy definition or policy set definition being assigned." + } + } + }, + "resources": [ + { + "type": "Microsoft.Authorization/policyAssignments", + "name": "[parameters('policyAssignmentName')]", + "apiVersion": "2019-09-01", + "properties": { + "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]", + "policyDefinitionId": "[parameters('policyDefinitionID')]" + } + } + ] + } + \"\"\", + parameters_content=\"\"\"{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "policyDefinitionID": { + "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a" + } + } + } + \"\"\") + ``` + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_group_template_deployment = azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", + location="West Europe", + management_group_id=example_group.id, + template_content=(lambda path: open(path).read())("templates/example-deploy-template.json"), + parameters_content=(lambda path: open(path).read())("templates/example-deploy-params.json")) + ``` + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_template_spec_version = azure.core.get_template_spec_version(name="exampleTemplateForManagementGroup", + resource_group_name="exampleResourceGroup", + version="v1.0.9") + example_group_template_deployment = azure.management.GroupTemplateDeployment("exampleGroupTemplateDeployment", + location="West Europe", + management_group_id=example_group.id, + template_spec_version_id=example_template_spec_version.id) + ``` + ## Import Management Group Template Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/management/lock.py b/sdk/python/pulumi_azure/management/lock.py index 213e8a645c..0aff564590 100644 --- a/sdk/python/pulumi_azure/management/lock.py +++ b/sdk/python/pulumi_azure/management/lock.py @@ -217,6 +217,47 @@ def __init__(__self__, Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. ## Example Usage + ### Subscription Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + subscription_level = azure.management.Lock("subscription-level", + scope=current.id, + lock_level="CanNotDelete", + notes="Items can't be deleted in this subscription!") + ``` + ### Resource Group Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + resource_group_level = azure.management.Lock("resource-group-level", + scope=example.id, + lock_level="ReadOnly", + notes="This Resource Group is Read-Only") + ``` + ### Resource Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + idle_timeout_in_minutes=30) + public_ip = azure.management.Lock("public-ip", + scope=example_public_ip.id, + lock_level="CanNotDelete", + notes="Locked because it's needed by a third-party") + ``` ## Import @@ -245,6 +286,47 @@ def __init__(__self__, Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. ## Example Usage + ### Subscription Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + subscription_level = azure.management.Lock("subscription-level", + scope=current.id, + lock_level="CanNotDelete", + notes="Items can't be deleted in this subscription!") + ``` + ### Resource Group Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + resource_group_level = azure.management.Lock("resource-group-level", + scope=example.id, + lock_level="ReadOnly", + notes="This Resource Group is Read-Only") + ``` + ### Resource Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + idle_timeout_in_minutes=30) + public_ip = azure.management.Lock("public-ip", + scope=example_public_ip.id, + lock_level="CanNotDelete", + notes="Locked because it's needed by a third-party") + ``` ## Import diff --git a/sdk/python/pulumi_azure/management/private_link.py b/sdk/python/pulumi_azure/management/private_link.py index 4a69acd899..8d224646ad 100644 --- a/sdk/python/pulumi_azure/management/private_link.py +++ b/sdk/python/pulumi_azure/management/private_link.py @@ -170,6 +170,18 @@ def __init__(__self__, """ Manages a Resource Management Private Link to restrict access for managing resources in the tenant. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_link = azure.management.PrivateLink("examplePrivateLink", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import An existing Resource Management Private Link can be imported into Terraform using the `resource id`, e.g. @@ -193,6 +205,18 @@ def __init__(__self__, """ Manages a Resource Management Private Link to restrict access for managing resources in the tenant. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_link = azure.management.PrivateLink("examplePrivateLink", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import An existing Resource Management Private Link can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/managementgroups/get_management_group.py b/sdk/python/pulumi_azure/managementgroups/get_management_group.py index 6dc8d91b92..52bb3c7550 100644 --- a/sdk/python/pulumi_azure/managementgroups/get_management_group.py +++ b/sdk/python/pulumi_azure/managementgroups/get_management_group.py @@ -130,6 +130,16 @@ def get_management_group(display_name: Optional[str] = None, """ Use this data source to access information about an existing Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + pulumi.export("displayName", example.display_name) + ``` + :param str display_name: Specifies the display name of this Management Group. @@ -161,6 +171,16 @@ def get_management_group_output(display_name: Optional[pulumi.Input[Optional[str """ Use this data source to access information about an existing Management Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + pulumi.export("displayName", example.display_name) + ``` + :param str display_name: Specifies the display name of this Management Group. diff --git a/sdk/python/pulumi_azure/managementgroups/management_group.py b/sdk/python/pulumi_azure/managementgroups/management_group.py index 1b62ec4af1..1351233575 100644 --- a/sdk/python/pulumi_azure/managementgroups/management_group.py +++ b/sdk/python/pulumi_azure/managementgroups/management_group.py @@ -229,6 +229,23 @@ def __init__(__self__, !> **Note:** Configuring `subscription_ids` is not supported when using the `management.GroupSubscriptionAssociation` resource, results will be unpredictable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_parent = azure.management.Group("exampleParent", + display_name="ParentGroup", + subscription_ids=[current.subscription_id]) + example_child = azure.management.Group("exampleChild", + display_name="ChildGroup", + parent_management_group_id=example_parent.id, + subscription_ids=[current.subscription_id]) + # other subscription IDs can go here + ``` + ## Import Management Groups can be imported using the `management group resource id`, e.g. @@ -257,6 +274,23 @@ def __init__(__self__, !> **Note:** Configuring `subscription_ids` is not supported when using the `management.GroupSubscriptionAssociation` resource, results will be unpredictable. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_parent = azure.management.Group("exampleParent", + display_name="ParentGroup", + subscription_ids=[current.subscription_id]) + example_child = azure.management.Group("exampleChild", + display_name="ChildGroup", + parent_management_group_id=example_parent.id, + subscription_ids=[current.subscription_id]) + # other subscription IDs can go here + ``` + ## Import Management Groups can be imported using the `management group resource id`, e.g. diff --git a/sdk/python/pulumi_azure/managementresource/manangement_lock.py b/sdk/python/pulumi_azure/managementresource/manangement_lock.py index b16f3d00fa..59f7eea8d5 100644 --- a/sdk/python/pulumi_azure/managementresource/manangement_lock.py +++ b/sdk/python/pulumi_azure/managementresource/manangement_lock.py @@ -222,6 +222,47 @@ def __init__(__self__, Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. ## Example Usage + ### Subscription Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + subscription_level = azure.management.Lock("subscription-level", + scope=current.id, + lock_level="CanNotDelete", + notes="Items can't be deleted in this subscription!") + ``` + ### Resource Group Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + resource_group_level = azure.management.Lock("resource-group-level", + scope=example.id, + lock_level="ReadOnly", + notes="This Resource Group is Read-Only") + ``` + ### Resource Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + idle_timeout_in_minutes=30) + public_ip = azure.management.Lock("public-ip", + scope=example_public_ip.id, + lock_level="CanNotDelete", + notes="Locked because it's needed by a third-party") + ``` ## Import @@ -250,6 +291,47 @@ def __init__(__self__, Manages a Management Lock which is scoped to a Subscription, Resource Group or Resource. ## Example Usage + ### Subscription Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + subscription_level = azure.management.Lock("subscription-level", + scope=current.id, + lock_level="CanNotDelete", + notes="Items can't be deleted in this subscription!") + ``` + ### Resource Group Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + resource_group_level = azure.management.Lock("resource-group-level", + scope=example.id, + lock_level="ReadOnly", + notes="This Resource Group is Read-Only") + ``` + ### Resource Level Lock) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + idle_timeout_in_minutes=30) + public_ip = azure.management.Lock("public-ip", + scope=example_public_ip.id, + lock_level="CanNotDelete", + notes="Locked because it's needed by a third-party") + ``` ## Import diff --git a/sdk/python/pulumi_azure/maps/account.py b/sdk/python/pulumi_azure/maps/account.py index 07a9c9b574..6d39a2c02f 100644 --- a/sdk/python/pulumi_azure/maps/account.py +++ b/sdk/python/pulumi_azure/maps/account.py @@ -321,6 +321,22 @@ def __init__(__self__, """ Manages an Azure Maps Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.maps.Account("exampleAccount", + resource_group_name=example_resource_group.name, + sku_name="S1", + local_authentication_enabled=True, + tags={ + "environment": "Test", + }) + ``` + ## Import A Maps Account can be imported using the `resource id`, e.g. @@ -348,6 +364,22 @@ def __init__(__self__, """ Manages an Azure Maps Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.maps.Account("exampleAccount", + resource_group_name=example_resource_group.name, + sku_name="S1", + local_authentication_enabled=True, + tags={ + "environment": "Test", + }) + ``` + ## Import A Maps Account can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/maps/creator.py b/sdk/python/pulumi_azure/maps/creator.py index 40087e2910..2f9b752f31 100644 --- a/sdk/python/pulumi_azure/maps/creator.py +++ b/sdk/python/pulumi_azure/maps/creator.py @@ -249,6 +249,28 @@ def __init__(__self__, """ Manages an Azure Maps Creator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.maps.Account("exampleAccount", + resource_group_name=example_resource_group.name, + sku_name="G2", + tags={ + "environment": "Test", + }) + example_creator = azure.maps.Creator("exampleCreator", + maps_account_id=example_account.id, + location=example_resource_group.location, + storage_units=1, + tags={ + "environment": "Test", + }) + ``` + ## Import An Azure Maps Creators can be imported using the `resource id`, e.g. @@ -274,6 +296,28 @@ def __init__(__self__, """ Manages an Azure Maps Creator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.maps.Account("exampleAccount", + resource_group_name=example_resource_group.name, + sku_name="G2", + tags={ + "environment": "Test", + }) + example_creator = azure.maps.Creator("exampleCreator", + maps_account_id=example_account.id, + location=example_resource_group.location, + storage_units=1, + tags={ + "environment": "Test", + }) + ``` + ## Import An Azure Maps Creators can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/maps/get_account.py b/sdk/python/pulumi_azure/maps/get_account.py index 8228bde389..bb8775ae91 100644 --- a/sdk/python/pulumi_azure/maps/get_account.py +++ b/sdk/python/pulumi_azure/maps/get_account.py @@ -126,6 +126,17 @@ def get_account(name: Optional[str] = None, """ Use this data source to access information about an existing Azure Maps Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.maps.get_account(name="production", + resource_group_name="maps") + pulumi.export("mapsAccountId", example.id) + ``` + :param str name: Specifies the name of the Maps Account. :param str resource_group_name: Specifies the name of the Resource Group in which the Maps Account is located. @@ -156,6 +167,17 @@ def get_account_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Azure Maps Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.maps.get_account(name="production", + resource_group_name="maps") + pulumi.export("mapsAccountId", example.id) + ``` + :param str name: Specifies the name of the Maps Account. :param str resource_group_name: Specifies the name of the Resource Group in which the Maps Account is located. diff --git a/sdk/python/pulumi_azure/mariadb/configuration.py b/sdk/python/pulumi_azure/mariadb/configuration.py index a4830efad4..84a54ca9ac 100644 --- a/sdk/python/pulumi_azure/mariadb/configuration.py +++ b/sdk/python/pulumi_azure/mariadb/configuration.py @@ -214,6 +214,28 @@ def __init__(__self__, """ Sets a MariaDB Configuration value on a MariaDB Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + ssl_enforcement_enabled=True, + administrator_login="mariadbadmin", + administrator_login_password="H@Sh1CoR3!", + version="10.2") + example_configuration = azure.mariadb.Configuration("exampleConfiguration", + name="interactive_timeout", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + value="600") + ``` + ## Import MariaDB Configurations can be imported using the `resource id`, e.g. @@ -238,6 +260,28 @@ def __init__(__self__, """ Sets a MariaDB Configuration value on a MariaDB Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + ssl_enforcement_enabled=True, + administrator_login="mariadbadmin", + administrator_login_password="H@Sh1CoR3!", + version="10.2") + example_configuration = azure.mariadb.Configuration("exampleConfiguration", + name="interactive_timeout", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + value="600") + ``` + ## Import MariaDB Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mariadb/database.py b/sdk/python/pulumi_azure/mariadb/database.py index cfdcfbfb1c..e6c3a59880 100644 --- a/sdk/python/pulumi_azure/mariadb/database.py +++ b/sdk/python/pulumi_azure/mariadb/database.py @@ -251,6 +251,31 @@ def __init__(__self__, """ Manages a MariaDB Database within a MariaDB Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=51200, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + administrator_login="acctestun", + administrator_login_password="H@Sh1CoR3!", + version="10.2", + ssl_enforcement_enabled=True) + example_database = azure.mariadb.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="utf8mb4", + collation="utf8mb4_unicode_520_ci") + ``` + ## Import MariaDB Database's can be imported using the `resource id`, e.g. @@ -276,6 +301,31 @@ def __init__(__self__, """ Manages a MariaDB Database within a MariaDB Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=51200, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + administrator_login="acctestun", + administrator_login_password="H@Sh1CoR3!", + version="10.2", + ssl_enforcement_enabled=True) + example_database = azure.mariadb.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="utf8mb4", + collation="utf8mb4_unicode_520_ci") + ``` + ## Import MariaDB Database's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mariadb/firewall_rule.py b/sdk/python/pulumi_azure/mariadb/firewall_rule.py index 22a97af15c..ba32464f34 100644 --- a/sdk/python/pulumi_azure/mariadb/firewall_rule.py +++ b/sdk/python/pulumi_azure/mariadb/firewall_rule.py @@ -268,6 +268,30 @@ def __init__(__self__, Manages a Firewall Rule for a MariaDB Server ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mariadb.FirewallRule("example", + end_ip_address="40.112.8.12", + resource_group_name="test-rg", + server_name="test-server", + start_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mariadb.FirewallRule("example", + end_ip_address="40.112.255.255", + resource_group_name="test-rg", + server_name="test-server", + start_ip_address="40.112.0.0") + ``` ## Import @@ -297,6 +321,30 @@ def __init__(__self__, Manages a Firewall Rule for a MariaDB Server ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mariadb.FirewallRule("example", + end_ip_address="40.112.8.12", + resource_group_name="test-rg", + server_name="test-server", + start_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mariadb.FirewallRule("example", + end_ip_address="40.112.255.255", + resource_group_name="test-rg", + server_name="test-server", + start_ip_address="40.112.0.0") + ``` ## Import diff --git a/sdk/python/pulumi_azure/mariadb/get_maria_db_server.py b/sdk/python/pulumi_azure/mariadb/get_maria_db_server.py index 6c7f532d0c..8bfc110331 100644 --- a/sdk/python/pulumi_azure/mariadb/get_maria_db_server.py +++ b/sdk/python/pulumi_azure/mariadb/get_maria_db_server.py @@ -165,6 +165,17 @@ def get_maria_db_server(name: Optional[str] = None, """ Use this data source to access information about an existing MariaDB Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + db_server = azure.mariadb.get_maria_db_server(name="mariadb-server", + resource_group_name=azurerm_mariadb_server["example"]["resource_group_name"]) + pulumi.export("mariadbServerId", data["azurerm_mariadb_server"]["example"]["id"]) + ``` + :param str name: The name of the MariaDB Server to retrieve information about. :param str resource_group_name: The name of the resource group where the MariaDB Server exists. @@ -196,6 +207,17 @@ def get_maria_db_server_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing MariaDB Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + db_server = azure.mariadb.get_maria_db_server(name="mariadb-server", + resource_group_name=azurerm_mariadb_server["example"]["resource_group_name"]) + pulumi.export("mariadbServerId", data["azurerm_mariadb_server"]["example"]["id"]) + ``` + :param str name: The name of the MariaDB Server to retrieve information about. :param str resource_group_name: The name of the resource group where the MariaDB Server exists. diff --git a/sdk/python/pulumi_azure/mariadb/server.py b/sdk/python/pulumi_azure/mariadb/server.py index c03bc96a43..13abea042a 100644 --- a/sdk/python/pulumi_azure/mariadb/server.py +++ b/sdk/python/pulumi_azure/mariadb/server.py @@ -806,6 +806,29 @@ def __init__(__self__, """ Manages a MariaDB Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mariadbadmin", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="10.2", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + ``` + ## Import MariaDB Server's can be imported using the `resource id`, e.g. @@ -846,6 +869,29 @@ def __init__(__self__, """ Manages a MariaDB Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mariadbadmin", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="10.2", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + ``` + ## Import MariaDB Server's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mariadb/virtual_network_rule.py b/sdk/python/pulumi_azure/mariadb/virtual_network_rule.py index df0c6de41c..fd52a7e324 100644 --- a/sdk/python/pulumi_azure/mariadb/virtual_network_rule.py +++ b/sdk/python/pulumi_azure/mariadb/virtual_network_rule.py @@ -251,6 +251,36 @@ def __init__(__self__, > **NOTE:** MariaDB Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mariadb/concepts-data-access-security-vnet) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mariadbadminun", + administrator_login_password="H@Sh1CoR3!", + version="10.2", + ssl_enforcement_enabled=True, + sku_name="GP_Gen5_2") + example_virtual_network_rule = azure.mariadb.VirtualNetworkRule("exampleVirtualNetworkRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=internal.id) + ``` + ## Import MariaDB Virtual Network Rules can be imported using the `resource id`, e.g. @@ -285,6 +315,36 @@ def __init__(__self__, > **NOTE:** MariaDB Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mariadb/concepts-data-access-security-vnet) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.mariadb.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mariadbadminun", + administrator_login_password="H@Sh1CoR3!", + version="10.2", + ssl_enforcement_enabled=True, + sku_name="GP_Gen5_2") + example_virtual_network_rule = azure.mariadb.VirtualNetworkRule("exampleVirtualNetworkRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=internal.id) + ``` + ## Import MariaDB Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/marketplace/agreement.py b/sdk/python/pulumi_azure/marketplace/agreement.py index 5bfc723711..103c7e6aee 100644 --- a/sdk/python/pulumi_azure/marketplace/agreement.py +++ b/sdk/python/pulumi_azure/marketplace/agreement.py @@ -200,6 +200,18 @@ def __init__(__self__, """ Allows accepting the Legal Terms for a Marketplace Image. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + barracuda = azure.marketplace.Agreement("barracuda", + offer="waf", + plan="hourly", + publisher="barracudanetworks") + ``` + ## Import Marketplace Agreement can be imported using the `resource id`, e.g. @@ -223,6 +235,18 @@ def __init__(__self__, """ Allows accepting the Legal Terms for a Marketplace Image. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + barracuda = azure.marketplace.Agreement("barracuda", + offer="waf", + plan="hourly", + publisher="barracudanetworks") + ``` + ## Import Marketplace Agreement can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/marketplace/get_agreement.py b/sdk/python/pulumi_azure/marketplace/get_agreement.py index b75c2d5f93..654817dbdf 100644 --- a/sdk/python/pulumi_azure/marketplace/get_agreement.py +++ b/sdk/python/pulumi_azure/marketplace/get_agreement.py @@ -96,6 +96,18 @@ def get_agreement(offer: Optional[str] = None, """ Uses this data source to access information about an existing Marketplace Agreement. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + barracuda = azure.marketplace.get_agreement(publisher="barracudanetworks", + offer="waf", + plan="hourly") + pulumi.export("azurermMarketplaceAgreementId", data["azurerm_marketplace_agreement"]["id"]) + ``` + :param str offer: The Offer of the Marketplace Image. :param str plan: The Plan of the Marketplace Image. @@ -125,6 +137,18 @@ def get_agreement_output(offer: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing Marketplace Agreement. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + barracuda = azure.marketplace.get_agreement(publisher="barracudanetworks", + offer="waf", + plan="hourly") + pulumi.export("azurermMarketplaceAgreementId", data["azurerm_marketplace_agreement"]["id"]) + ``` + :param str offer: The Offer of the Marketplace Image. :param str plan: The Plan of the Marketplace Image. diff --git a/sdk/python/pulumi_azure/media/account_filter.py b/sdk/python/pulumi_azure/media/account_filter.py index 4d37d6b3a2..aae21e94e5 100644 --- a/sdk/python/pulumi_azure/media/account_filter.py +++ b/sdk/python/pulumi_azure/media/account_filter.py @@ -300,6 +300,74 @@ def __init__(__self__, """ Manages a Media Services Account Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_account_filter = azure.media.AccountFilter("exampleAccountFilter", + resource_group_name=azurerm_resource_group["test"]["name"], + media_services_account_name=azurerm_media_services_account["test"]["name"], + first_quality_bitrate=128000, + presentation_time_range=azure.media.AccountFilterPresentationTimeRangeArgs( + start_in_units=0, + end_in_units=15, + presentation_window_in_units=90, + live_backoff_in_units=0, + unit_timescale_in_milliseconds=1000, + force_end=False, + ), + track_selections=[ + azure.media.AccountFilterTrackSelectionArgs( + conditions=[ + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Audio", + ), + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Language", + operation="NotEqual", + value="en", + ), + azure.media.AccountFilterTrackSelectionConditionArgs( + property="FourCC", + operation="NotEqual", + value="EC-3", + ), + ], + ), + azure.media.AccountFilterTrackSelectionArgs( + conditions=[ + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Video", + ), + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Bitrate", + operation="Equal", + value="3000000-5000000", + ), + ], + ), + ]) + ``` + ## Import Account Filters can be imported using the `resource id`, e.g. @@ -326,6 +394,74 @@ def __init__(__self__, """ Manages a Media Services Account Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_account_filter = azure.media.AccountFilter("exampleAccountFilter", + resource_group_name=azurerm_resource_group["test"]["name"], + media_services_account_name=azurerm_media_services_account["test"]["name"], + first_quality_bitrate=128000, + presentation_time_range=azure.media.AccountFilterPresentationTimeRangeArgs( + start_in_units=0, + end_in_units=15, + presentation_window_in_units=90, + live_backoff_in_units=0, + unit_timescale_in_milliseconds=1000, + force_end=False, + ), + track_selections=[ + azure.media.AccountFilterTrackSelectionArgs( + conditions=[ + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Audio", + ), + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Language", + operation="NotEqual", + value="en", + ), + azure.media.AccountFilterTrackSelectionConditionArgs( + property="FourCC", + operation="NotEqual", + value="EC-3", + ), + ], + ), + azure.media.AccountFilterTrackSelectionArgs( + conditions=[ + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Video", + ), + azure.media.AccountFilterTrackSelectionConditionArgs( + property="Bitrate", + operation="Equal", + value="3000000-5000000", + ), + ], + ), + ]) + ``` + ## Import Account Filters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/asset.py b/sdk/python/pulumi_azure/media/asset.py index 66127e5d57..0df5b5cd57 100644 --- a/sdk/python/pulumi_azure/media/asset.py +++ b/sdk/python/pulumi_azure/media/asset.py @@ -331,6 +331,31 @@ def __init__(__self__, """ Manages a Media Asset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Asset description") + ``` + ## Import Media Assets can be imported using the `resource id`, e.g. @@ -358,6 +383,31 @@ def __init__(__self__, """ Manages a Media Asset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Asset description") + ``` + ## Import Media Assets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/asset_filter.py b/sdk/python/pulumi_azure/media/asset_filter.py index 12b83ce9d7..2102760deb 100644 --- a/sdk/python/pulumi_azure/media/asset_filter.py +++ b/sdk/python/pulumi_azure/media/asset_filter.py @@ -258,6 +258,77 @@ def __init__(__self__, """ Manages an Azure Media Asset Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Asset description") + example_asset_filter = azure.media.AssetFilter("exampleAssetFilter", + asset_id=example_asset.id, + first_quality_bitrate=128000, + presentation_time_range=azure.media.AssetFilterPresentationTimeRangeArgs( + start_in_units=0, + end_in_units=15, + presentation_window_in_units=90, + live_backoff_in_units=0, + unit_timescale_in_miliseconds=1000, + force_end=False, + ), + track_selections=[ + azure.media.AssetFilterTrackSelectionArgs( + conditions=[ + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Audio", + ), + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Language", + operation="NotEqual", + value="en", + ), + azure.media.AssetFilterTrackSelectionConditionArgs( + property="FourCC", + operation="NotEqual", + value="EC-3", + ), + ], + ), + azure.media.AssetFilterTrackSelectionArgs( + conditions=[ + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Video", + ), + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Bitrate", + operation="Equal", + value="3000000-5000000", + ), + ], + ), + ]) + ``` + ## Import Asset Filters can be imported using the `resource id`, e.g. @@ -283,6 +354,77 @@ def __init__(__self__, """ Manages an Azure Media Asset Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Asset description") + example_asset_filter = azure.media.AssetFilter("exampleAssetFilter", + asset_id=example_asset.id, + first_quality_bitrate=128000, + presentation_time_range=azure.media.AssetFilterPresentationTimeRangeArgs( + start_in_units=0, + end_in_units=15, + presentation_window_in_units=90, + live_backoff_in_units=0, + unit_timescale_in_miliseconds=1000, + force_end=False, + ), + track_selections=[ + azure.media.AssetFilterTrackSelectionArgs( + conditions=[ + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Audio", + ), + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Language", + operation="NotEqual", + value="en", + ), + azure.media.AssetFilterTrackSelectionConditionArgs( + property="FourCC", + operation="NotEqual", + value="EC-3", + ), + ], + ), + azure.media.AssetFilterTrackSelectionArgs( + conditions=[ + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Type", + operation="Equal", + value="Video", + ), + azure.media.AssetFilterTrackSelectionConditionArgs( + property="Bitrate", + operation="Equal", + value="3000000-5000000", + ), + ], + ), + ]) + ``` + ## Import Asset Filters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/content_key_policy.py b/sdk/python/pulumi_azure/media/content_key_policy.py index dbbda95ded..ba0fd366a2 100644 --- a/sdk/python/pulumi_azure/media/content_key_policy.py +++ b/sdk/python/pulumi_azure/media/content_key_policy.py @@ -256,6 +256,110 @@ def __init__(__self__, """ Manages a Content Key Policy. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_content_key_policy = azure.media.ContentKeyPolicy("exampleContentKeyPolicy", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + policy_options=[ + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="fairPlay", + fairplay_configuration=azure.media.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs( + ask="bb566284cc124a21c435a92cd3c108c4", + pfx="MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + pfx_password="password", + rental_duration_seconds=2249, + rental_and_lease_key_type="PersistentUnlimited", + ), + open_restriction_enabled=True, + ), + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="playReady", + playready_configuration_licenses=[azure.media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicenseArgs( + allow_test_devices=True, + begin_date="2017-10-16T18:22:53Z", + security_level="SL150", + play_right=azure.media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightArgs( + scms_restriction=2, + digital_video_only_content_restriction=False, + image_constraint_for_analog_component_video_restriction=False, + image_constraint_for_analog_computer_monitor_restriction=False, + allow_passing_video_content_to_unknown_output="NotAllowed", + uncompressed_digital_video_opl=100, + uncompressed_digital_audio_opl=100, + analog_video_opl=150, + compressed_digital_audio_opl=250, + compressed_digital_video_opl=400, + explicit_analog_television_output_restriction=azure.media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightExplicitAnalogTelevisionOutputRestrictionArgs( + best_effort_enforced=True, + control_bits=3, + ), + ), + license_type="Persistent", + content_type="UltraVioletDownload", + content_key_location_from_header_enabled=True, + )], + open_restriction_enabled=True, + ), + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="clearKey", + clear_key_configuration_enabled=True, + token_restriction=azure.media.ContentKeyPolicyPolicyOptionTokenRestrictionArgs( + issuer="urn:issuer", + audience="urn:audience", + token_type="Swt", + primary_symmetric_token_key="AAAAAAAAAAAAAAAAAAAAAA==", + alternate_keys=[ + azure.media.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs( + rsa_token_key_exponent="AQAB", + rsa_token_key_modulus="AQAD", + ), + azure.media.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs( + symmetric_token_key="BBAAAAAAAAAAAAAAAAAAAA==", + ), + ], + ), + ), + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="widevine", + widevine_configuration_template=json.dumps({ + "allowed_track_types": "SD_HD", + "content_key_specs": [{ + "track_type": "SD", + "security_level": 1, + "required_output_protection": { + "hdcp": "HDCP_V2", + }, + }], + "policy_overrides": { + "can_play": True, + "can_persist": True, + "can_renew": False, + }, + }), + open_restriction_enabled=True, + ), + ]) + ``` + ## Import Content Key Policy can be imported using the `resource id`, e.g. @@ -281,6 +385,110 @@ def __init__(__self__, """ Manages a Content Key Policy. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_content_key_policy = azure.media.ContentKeyPolicy("exampleContentKeyPolicy", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + policy_options=[ + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="fairPlay", + fairplay_configuration=azure.media.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs( + ask="bb566284cc124a21c435a92cd3c108c4", + pfx="MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + pfx_password="password", + rental_duration_seconds=2249, + rental_and_lease_key_type="PersistentUnlimited", + ), + open_restriction_enabled=True, + ), + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="playReady", + playready_configuration_licenses=[azure.media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicenseArgs( + allow_test_devices=True, + begin_date="2017-10-16T18:22:53Z", + security_level="SL150", + play_right=azure.media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightArgs( + scms_restriction=2, + digital_video_only_content_restriction=False, + image_constraint_for_analog_component_video_restriction=False, + image_constraint_for_analog_computer_monitor_restriction=False, + allow_passing_video_content_to_unknown_output="NotAllowed", + uncompressed_digital_video_opl=100, + uncompressed_digital_audio_opl=100, + analog_video_opl=150, + compressed_digital_audio_opl=250, + compressed_digital_video_opl=400, + explicit_analog_television_output_restriction=azure.media.ContentKeyPolicyPolicyOptionPlayreadyConfigurationLicensePlayRightExplicitAnalogTelevisionOutputRestrictionArgs( + best_effort_enforced=True, + control_bits=3, + ), + ), + license_type="Persistent", + content_type="UltraVioletDownload", + content_key_location_from_header_enabled=True, + )], + open_restriction_enabled=True, + ), + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="clearKey", + clear_key_configuration_enabled=True, + token_restriction=azure.media.ContentKeyPolicyPolicyOptionTokenRestrictionArgs( + issuer="urn:issuer", + audience="urn:audience", + token_type="Swt", + primary_symmetric_token_key="AAAAAAAAAAAAAAAAAAAAAA==", + alternate_keys=[ + azure.media.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs( + rsa_token_key_exponent="AQAB", + rsa_token_key_modulus="AQAD", + ), + azure.media.ContentKeyPolicyPolicyOptionTokenRestrictionAlternateKeyArgs( + symmetric_token_key="BBAAAAAAAAAAAAAAAAAAAA==", + ), + ], + ), + ), + azure.media.ContentKeyPolicyPolicyOptionArgs( + name="widevine", + widevine_configuration_template=json.dumps({ + "allowed_track_types": "SD_HD", + "content_key_specs": [{ + "track_type": "SD", + "security_level": 1, + "required_output_protection": { + "hdcp": "HDCP_V2", + }, + }], + "policy_overrides": { + "can_play": True, + "can_persist": True, + "can_renew": False, + }, + }), + open_restriction_enabled=True, + ), + ]) + ``` + ## Import Content Key Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/job.py b/sdk/python/pulumi_azure/media/job.py index 4e0cce3dac..53934b7139 100644 --- a/sdk/python/pulumi_azure/media/job.py +++ b/sdk/python/pulumi_azure/media/job.py @@ -377,6 +377,58 @@ def __init__(__self__, """ Manages a Media Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_transform = azure.media.Transform("exampleTransform", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="My transform description", + outputs=[azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="ContinueJob", + builtin_preset=azure.media.TransformOutputBuiltinPresetArgs( + preset_name="AACGoodQualityAudio", + ), + )]) + input = azure.media.Asset("input", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Input Asset description") + output = azure.media.Asset("output", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Output Asset description") + example_job = azure.media.Job("exampleJob", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + transform_name=example_transform.name, + description="My Job description", + priority="Normal", + input_asset=azure.media.JobInputAssetArgs( + name=input.name, + ), + output_assets=[azure.media.JobOutputAssetArgs( + name=output.name, + )]) + ``` + ## Import Media Jobs can be imported using the `resource id`, e.g. @@ -405,6 +457,58 @@ def __init__(__self__, """ Manages a Media Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_transform = azure.media.Transform("exampleTransform", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="My transform description", + outputs=[azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="ContinueJob", + builtin_preset=azure.media.TransformOutputBuiltinPresetArgs( + preset_name="AACGoodQualityAudio", + ), + )]) + input = azure.media.Asset("input", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Input Asset description") + output = azure.media.Asset("output", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Output Asset description") + example_job = azure.media.Job("exampleJob", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + transform_name=example_transform.name, + description="My Job description", + priority="Normal", + input_asset=azure.media.JobInputAssetArgs( + name=input.name, + ), + output_assets=[azure.media.JobOutputAssetArgs( + name=output.name, + )]) + ``` + ## Import Media Jobs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/live_event.py b/sdk/python/pulumi_azure/media/live_event.py index 35a040aba6..2f80c1e8ae 100644 --- a/sdk/python/pulumi_azure/media/live_event.py +++ b/sdk/python/pulumi_azure/media/live_event.py @@ -646,6 +646,57 @@ def __init__(__self__, """ Manages a Live Event. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_live_event = azure.media.LiveEvent("exampleLiveEvent", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + description="My Event Description", + input=azure.media.LiveEventInputArgs( + streaming_protocol="RTMP", + ip_access_control_allows=[azure.media.LiveEventInputIpAccessControlAllowArgs( + name="AllowAll", + address="0.0.0.0", + subnet_prefix_length=0, + )], + ), + encoding=azure.media.LiveEventEncodingArgs( + type="Standard", + preset_name="Default720p", + stretch_mode="AutoFit", + key_frame_interval="PT2S", + ), + preview=azure.media.LiveEventPreviewArgs( + ip_access_control_allows=[azure.media.LiveEventPreviewIpAccessControlAllowArgs( + name="AllowAll", + address="0.0.0.0", + subnet_prefix_length=0, + )], + ), + stream_options=["LowLatency"], + use_static_hostname=True, + hostname_prefix="special-event", + transcription_languages=["en-US"]) + ``` + ## Import Live Events can be imported using the `resource id`, e.g. @@ -681,6 +732,57 @@ def __init__(__self__, """ Manages a Live Event. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_live_event = azure.media.LiveEvent("exampleLiveEvent", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + description="My Event Description", + input=azure.media.LiveEventInputArgs( + streaming_protocol="RTMP", + ip_access_control_allows=[azure.media.LiveEventInputIpAccessControlAllowArgs( + name="AllowAll", + address="0.0.0.0", + subnet_prefix_length=0, + )], + ), + encoding=azure.media.LiveEventEncodingArgs( + type="Standard", + preset_name="Default720p", + stretch_mode="AutoFit", + key_frame_interval="PT2S", + ), + preview=azure.media.LiveEventPreviewArgs( + ip_access_control_allows=[azure.media.LiveEventPreviewIpAccessControlAllowArgs( + name="AllowAll", + address="0.0.0.0", + subnet_prefix_length=0, + )], + ), + stream_options=["LowLatency"], + use_static_hostname=True, + hostname_prefix="special-event", + transcription_languages=["en-US"]) + ``` + ## Import Live Events can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/live_event_output.py b/sdk/python/pulumi_azure/media/live_event_output.py index 6823e4a4ba..0e8bc5af07 100644 --- a/sdk/python/pulumi_azure/media/live_event_output.py +++ b/sdk/python/pulumi_azure/media/live_event_output.py @@ -410,6 +410,53 @@ def __init__(__self__, """ Manages a Azure Media Live Event Output. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name) + example_live_event = azure.media.LiveEvent("exampleLiveEvent", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + description="My Event Description", + input=azure.media.LiveEventInputArgs( + streaming_protocol="RTMP", + key_frame_interval_duration="PT6S", + ip_access_control_allows=[azure.media.LiveEventInputIpAccessControlAllowArgs( + name="AllowAll", + address="0.0.0.0", + subnet_prefix_length=0, + )], + )) + example_live_event_output = azure.media.LiveEventOutput("exampleLiveEventOutput", + live_event_id=example_live_event.id, + archive_window_duration="PT5M", + asset_name=example_asset.name, + description="Test live output 1", + manifest_name="testmanifest", + output_snap_time_in_seconds=0, + hls_fragments_per_ts_segment=5, + rewind_window_duration="PT5M") + ``` + ## Import Live Outputs can be imported using the `resource id`, e.g. @@ -438,6 +485,53 @@ def __init__(__self__, """ Manages a Azure Media Live Event Output. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name) + example_live_event = azure.media.LiveEvent("exampleLiveEvent", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + description="My Event Description", + input=azure.media.LiveEventInputArgs( + streaming_protocol="RTMP", + key_frame_interval_duration="PT6S", + ip_access_control_allows=[azure.media.LiveEventInputIpAccessControlAllowArgs( + name="AllowAll", + address="0.0.0.0", + subnet_prefix_length=0, + )], + )) + example_live_event_output = azure.media.LiveEventOutput("exampleLiveEventOutput", + live_event_id=example_live_event.id, + archive_window_duration="PT5M", + asset_name=example_asset.name, + description="Test live output 1", + manifest_name="testmanifest", + output_snap_time_in_seconds=0, + hls_fragments_per_ts_segment=5, + rewind_window_duration="PT5M") + ``` + ## Import Live Outputs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/service_account.py b/sdk/python/pulumi_azure/media/service_account.py index 41336c707c..27ec8036b8 100644 --- a/sdk/python/pulumi_azure/media/service_account.py +++ b/sdk/python/pulumi_azure/media/service_account.py @@ -448,6 +448,27 @@ def __init__(__self__, """ Manages a Media Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + ``` + ## Import Media Services Accounts can be imported using the `resource id`, e.g. @@ -478,6 +499,27 @@ def __init__(__self__, """ Manages a Media Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + ``` + ## Import Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/streaming_endpoint.py b/sdk/python/pulumi_azure/media/streaming_endpoint.py index 0ce39e5c16..7f815ced46 100644 --- a/sdk/python/pulumi_azure/media/streaming_endpoint.py +++ b/sdk/python/pulumi_azure/media/streaming_endpoint.py @@ -696,6 +696,81 @@ def __init__(__self__, """ Manages a Streaming Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_streaming_endpoint = azure.media.StreamingEndpoint("exampleStreamingEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + scale_units=2) + ``` + ### With Access Control + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_streaming_endpoint = azure.media.StreamingEndpoint("exampleStreamingEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + scale_units=2, + access_control=azure.media.StreamingEndpointAccessControlArgs( + ip_allows=[ + azure.media.StreamingEndpointAccessControlIpAllowArgs( + name="AllowedIP", + address="192.168.1.1", + ), + azure.media.StreamingEndpointAccessControlIpAllowArgs( + name="AnotherIp", + address="192.168.1.2", + ), + ], + akamai_signature_header_authentication_keys=[ + azure.media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs( + identifier="id1", + expiration="2030-12-31T16:00:00Z", + base64_key="dGVzdGlkMQ==", + ), + azure.media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs( + identifier="id2", + expiration="2032-01-28T16:00:00Z", + base64_key="dGVzdGlkMQ==", + ), + ], + )) + ``` + ## Import Streaming Endpoints can be imported using the `resource id`, e.g. @@ -731,6 +806,81 @@ def __init__(__self__, """ Manages a Streaming Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_streaming_endpoint = azure.media.StreamingEndpoint("exampleStreamingEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + scale_units=2) + ``` + ### With Access Control + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_streaming_endpoint = azure.media.StreamingEndpoint("exampleStreamingEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + media_services_account_name=example_service_account.name, + scale_units=2, + access_control=azure.media.StreamingEndpointAccessControlArgs( + ip_allows=[ + azure.media.StreamingEndpointAccessControlIpAllowArgs( + name="AllowedIP", + address="192.168.1.1", + ), + azure.media.StreamingEndpointAccessControlIpAllowArgs( + name="AnotherIp", + address="192.168.1.2", + ), + ], + akamai_signature_header_authentication_keys=[ + azure.media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs( + identifier="id1", + expiration="2030-12-31T16:00:00Z", + base64_key="dGVzdGlkMQ==", + ), + azure.media.StreamingEndpointAccessControlAkamaiSignatureHeaderAuthenticationKeyArgs( + identifier="id2", + expiration="2032-01-28T16:00:00Z", + base64_key="dGVzdGlkMQ==", + ), + ], + )) + ``` + ## Import Streaming Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/streaming_locator.py b/sdk/python/pulumi_azure/media/streaming_locator.py index ffc9a187da..644566266c 100644 --- a/sdk/python/pulumi_azure/media/streaming_locator.py +++ b/sdk/python/pulumi_azure/media/streaming_locator.py @@ -548,6 +548,40 @@ def __init__(__self__, """ Manages a Media Streaming Locator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_account_filter = azure.media.AccountFilter("exampleAccountFilter", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Asset description") + example_streaming_locator = azure.media.StreamingLocator("exampleStreamingLocator", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + asset_name=example_asset.name, + streaming_policy_name="Predefined_ClearStreamingOnly", + filter_names=[example_account_filter.name]) + ``` + ## Import Streaming Locators can be imported using the `resource id`, e.g. @@ -580,6 +614,40 @@ def __init__(__self__, """ Manages a Media Streaming Locator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_account_filter = azure.media.AccountFilter("exampleAccountFilter", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name) + example_asset = azure.media.Asset("exampleAsset", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="Asset description") + example_streaming_locator = azure.media.StreamingLocator("exampleStreamingLocator", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + asset_name=example_asset.name, + streaming_policy_name="Predefined_ClearStreamingOnly", + filter_names=[example_account_filter.name]) + ``` + ## Import Streaming Locators can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/streaming_policy.py b/sdk/python/pulumi_azure/media/streaming_policy.py index 8b17a91980..0917118b50 100644 --- a/sdk/python/pulumi_azure/media/streaming_policy.py +++ b/sdk/python/pulumi_azure/media/streaming_policy.py @@ -382,6 +382,80 @@ def __init__(__self__, """ Manages a Streaming Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_content_key_policy = azure.media.ContentKeyPolicy("exampleContentKeyPolicy", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + policy_options=[azure.media.ContentKeyPolicyPolicyOptionArgs( + name="fairPlay", + fairplay_configuration=azure.media.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs( + ask="bb566284cc124a21c435a92cd3c108c4", + pfx="MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + pfx_password="password", + rental_duration_seconds=2249, + rental_and_lease_key_type="PersistentUnlimited", + ), + open_restriction_enabled=True, + )]) + example_streaming_policy = azure.media.StreamingPolicy("exampleStreamingPolicy", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + common_encryption_cenc=azure.media.StreamingPolicyCommonEncryptionCencArgs( + clear_tracks=[azure.media.StreamingPolicyCommonEncryptionCencClearTrackArgs( + conditions=[azure.media.StreamingPolicyCommonEncryptionCencClearTrackConditionArgs( + property="FourCC", + operation="Equal", + value="hev2", + )], + )], + enabled_protocols=azure.media.StreamingPolicyCommonEncryptionCencEnabledProtocolsArgs( + download=False, + dash=True, + hls=False, + smooth_streaming=False, + ), + default_content_key=azure.media.StreamingPolicyCommonEncryptionCencDefaultContentKeyArgs( + label="aesDefaultKey", + policy_name=example_content_key_policy.name, + ), + drm_playready=azure.media.StreamingPolicyCommonEncryptionCencDrmPlayreadyArgs( + custom_license_acquisition_url_template="https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}", + custom_attributes="PlayReady CustomAttributes", + ), + drm_widevine_custom_license_acquisition_url_template="https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId}", + ), + common_encryption_cbcs=azure.media.StreamingPolicyCommonEncryptionCbcsArgs( + enabled_protocols=azure.media.StreamingPolicyCommonEncryptionCbcsEnabledProtocolsArgs( + download=False, + dash=True, + hls=False, + smooth_streaming=False, + ), + drm_fairplay=azure.media.StreamingPolicyCommonEncryptionCbcsDrmFairplayArgs( + custom_license_acquisition_url_template="https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}", + allow_persistent_license=True, + ), + )) + ``` + ## Import Streaming Policies can be imported using the `resource id`, e.g. @@ -410,6 +484,80 @@ def __init__(__self__, """ Manages a Streaming Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_content_key_policy = azure.media.ContentKeyPolicy("exampleContentKeyPolicy", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + policy_options=[azure.media.ContentKeyPolicyPolicyOptionArgs( + name="fairPlay", + fairplay_configuration=azure.media.ContentKeyPolicyPolicyOptionFairplayConfigurationArgs( + ask="bb566284cc124a21c435a92cd3c108c4", + pfx="MIIG7gIBAzCCBqoGCSqGSIb3DQEHAaCCBpsEggaXMIIGkzCCA7wGCSqGSIb3DQEHAaCCA60EggOpMIIDpTCCA6EGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAiV65vFfxLDVgICB9AEggKQx2dxWefICYodVhRLSQVMJRYy5QkM1VySPAXGP744JHrb+s0Y8i/6a+a5itZGlXw3kvxyflHtSsuuBCaYJ1WOCp9jspixJEliFHXTcel96AgZlT5tB7vC6pdZnz8rb+lyxFs99x2CW52EsadoDlRsYrmkmKdnB0cx2JHJbLeXuKV/fjuRJSqCFcDa6Nre8AlBX0zKGIYGLJ1Cfpora4kNTXxu0AwEowzGmoCxqrpKbO1QDi1hZ1qHrtZ1ienAKfiTXaGH4AMQzyut0AaymxalrRbXibJYuefLRvXqx0oLZKVLAX8fR1gnac6Mrr7GkdHaKCsk4eOi98acR7bjiyRRVYYS4B6Y0tCeRJNe6zeYVmLdtatuOlOEVDT6AKrJJMFMyITVS+2D771ge6m37FbJ36K3/eT/HRq1YDsxfD/BY+X7eMIwQrVnD5nK7avXfbIni57n5oWLkE9Vco8uBlMdrx4xHt9vpe42Pz2Yh2O4WtvxcgxrAknvPpV1ZsAJCfvm9TTcg8qZpjyePn3B9TvFVSXMJHn/rzu6OJAgFgVFAe1tPGLh1XBxAvwpB8EqcycIIUUFUBy4HgYCicjI2jp6s8Kk293Uc/TA2623LrWgP/Xm5hVB7lP1k6W9LDivOlAA96D0Cbk08Yv6arkCYj7ONFO8VZbO0zKAAOLHMw/ZQRIutGLrDlqgTDeRXRuReX7TNjDBxp2rzJBY0uU5g9BMFxQrbQwEx9HsnO4dVFG4KLbHmYWhlwS2V2uZtY6D6elOXY3SX50RwhC4+0trUMi/ODtOxAc+lMQk2FNDcNeKIX5wHwFRS+sFBu5Um4Jfj6Ua4w1izmu2KiPfDd3vJsm5Dgcci3fPfdSfpIq4uR6d3JQxgdcwEwYJKoZIhvcNAQkVMQYEBAEAAAAwWwYJKoZIhvcNAQkUMU4eTAB7ADcAMQAxADAANABBADgARgAtADQAQgBFADAALQA0AEEAMgA4AC0AOAAyADIANQAtAEYANwBBADcAMwBGAEMAQQAwAEMARABEAH0wYwYJKwYBBAGCNxEBMVYeVABNAGkAYwByAG8AcwBvAGYAdAAgAEIAYQBzAGUAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByACAAdgAxAC4AMDCCAs8GCSqGSIb3DQEHBqCCAsAwggK8AgEAMIICtQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQISS7mG/riQJkCAgfQgIICiPSGg5axP4JM+GmiVEqOHTVAPw2AM8OPnn1q0mIw54oC2WOJw3FFThYHmxTQzQ1feVmnkVCv++eFp+BYTcWTa+ehl/3/Nvr5uLTzDxmCShacKwoWXOKtSLh6mmgydvMqSf6xv1bPsloodtrRxhprI2lBNBW2uw8az9eLdvURYmhjGPf9klEy/6OCA5jDT5XZMunwiQT5mYNMF7wAQ5PCz2dJQqm1n72A6nUHPkHEusN7iH/+mv5d3iaKxn7/ShxLKHfjMd+r/gv27ylshVHiN4mVStAg+MiLrVvr5VH46p6oosImvS3ZO4D5wTmh/6wtus803qN4QB/Y9n4rqEJ4Dn619h+6O7FChzWkx7kvYIzIxvfnj1PCFTEjUwc7jbuF013W/z9zQi2YEq9AzxMcGro0zjdt2sf30zXSfaRNt0UHHRDkLo7yFUJG5Ka1uWU8paLuXUUiiMUf24Bsfdg2A2n+3Qa7g25OvAM1QTpMwmMWL9sY2hxVUGIKVrnj8c4EKuGJjVDXrze5g9O/LfZr5VSjGu5KsN0eYI3mcePF7XM0azMtTNQYVRmeWxYW+XvK5MaoLEkrFG8C5+JccIlN588jowVIPqP321S/EyFiAmrRdAWkqrc9KH+/eINCFqjut2YPkCaTM9mnJAAqWgggUWkrOKT/ByS6IAQwyEBNFbY0TWyxKt6vZL1EW/6HgZCsxeYycNhnPr2qJNZZMNzmdMRp2GRLcfBH8KFw1rAyua0VJoTLHb23ZAsEY74BrEEiK9e/oOjXkHzQjlmrfQ9rSN2eQpRrn0W8I229WmBO2suG+AQ3aY8kDtBMkjmJno7txUh1K5D6tJTO7MQp343A2AhyJkhYA7NPnDA7MB8wBwYFKw4DAhoEFPO82HDlCzlshWlnMoQPStm62TMEBBQsPmvwbZ5OlwC9+NDF1AC+t67WTgICB9A=", + pfx_password="password", + rental_duration_seconds=2249, + rental_and_lease_key_type="PersistentUnlimited", + ), + open_restriction_enabled=True, + )]) + example_streaming_policy = azure.media.StreamingPolicy("exampleStreamingPolicy", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + common_encryption_cenc=azure.media.StreamingPolicyCommonEncryptionCencArgs( + clear_tracks=[azure.media.StreamingPolicyCommonEncryptionCencClearTrackArgs( + conditions=[azure.media.StreamingPolicyCommonEncryptionCencClearTrackConditionArgs( + property="FourCC", + operation="Equal", + value="hev2", + )], + )], + enabled_protocols=azure.media.StreamingPolicyCommonEncryptionCencEnabledProtocolsArgs( + download=False, + dash=True, + hls=False, + smooth_streaming=False, + ), + default_content_key=azure.media.StreamingPolicyCommonEncryptionCencDefaultContentKeyArgs( + label="aesDefaultKey", + policy_name=example_content_key_policy.name, + ), + drm_playready=azure.media.StreamingPolicyCommonEncryptionCencDrmPlayreadyArgs( + custom_license_acquisition_url_template="https://contoso.com/{AssetAlternativeId}/playready/{ContentKeyId}", + custom_attributes="PlayReady CustomAttributes", + ), + drm_widevine_custom_license_acquisition_url_template="https://contoso.com/{AssetAlternativeId}/widevine/{ContentKeyId}", + ), + common_encryption_cbcs=azure.media.StreamingPolicyCommonEncryptionCbcsArgs( + enabled_protocols=azure.media.StreamingPolicyCommonEncryptionCbcsEnabledProtocolsArgs( + download=False, + dash=True, + hls=False, + smooth_streaming=False, + ), + drm_fairplay=azure.media.StreamingPolicyCommonEncryptionCbcsDrmFairplayArgs( + custom_license_acquisition_url_template="https://contoso.com/{AssetAlternativeId}/fairplay/{ContentKeyId}", + allow_persistent_license=True, + ), + )) + ``` + ## Import Streaming Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/media/transform.py b/sdk/python/pulumi_azure/media/transform.py index df25971b50..3bb654be60 100644 --- a/sdk/python/pulumi_azure/media/transform.py +++ b/sdk/python/pulumi_azure/media/transform.py @@ -251,6 +251,329 @@ def __init__(__self__, """ Manages a Transform. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_transform = azure.media.Transform("exampleTransform", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="My transform description", + outputs=[azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="ContinueJob", + builtin_preset=azure.media.TransformOutputBuiltinPresetArgs( + preset_name="AACGoodQualityAudio", + ), + )]) + ``` + ### With Multiple Outputs + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_transform = azure.media.Transform("exampleTransform", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="My transform description", + outputs=[ + azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="ContinueJob", + builtin_preset=azure.media.TransformOutputBuiltinPresetArgs( + preset_name="AACGoodQualityAudio", + preset_configuration=azure.media.TransformOutputBuiltinPresetPresetConfigurationArgs( + complexity="Balanced", + interleave_output="NonInterleavedOutput", + key_frame_interval_in_seconds=123122.5, + max_bitrate_bps=300000, + max_height=480, + max_layers=14, + min_bitrate_bps=200000, + min_height=360, + ), + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Low", + on_error_action="ContinueJob", + audio_analyzer_preset=azure.media.TransformOutputAudioAnalyzerPresetArgs( + audio_language="en-US", + audio_analysis_mode="Basic", + experimental_options={ + "env": "test", + }, + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Low", + on_error_action="StopProcessingJob", + face_detector_preset=azure.media.TransformOutputFaceDetectorPresetArgs( + analysis_resolution="StandardDefinition", + blur_type="Med", + face_redactor_mode="Combined", + experimental_options={ + "env": "test", + }, + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="StopProcessingJob", + video_analyzer_preset=azure.media.TransformOutputVideoAnalyzerPresetArgs( + audio_language="en-US", + audio_analysis_mode="Basic", + insights_type="AllInsights", + experimental_options={ + "env": "test", + }, + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Low", + on_error_action="ContinueJob", + custom_preset=azure.media.TransformOutputCustomPresetArgs( + codecs=[ + azure.media.TransformOutputCustomPresetCodecArgs( + aac_audio=azure.media.TransformOutputCustomPresetCodecAacAudioArgs( + bitrate=128000, + channels=2, + sampling_rate=48000, + profile="AacLc", + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + copy_audio=azure.media.TransformOutputCustomPresetCodecCopyAudioArgs( + label="test", + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + copy_video=azure.media.TransformOutputCustomPresetCodecCopyVideoArgs( + label="test", + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + h264_video=azure.media.TransformOutputCustomPresetCodecH264VideoArgs( + key_frame_interval="PT1S", + stretch_mode="AutoSize", + sync_mode="Auto", + scene_change_detection_enabled=False, + rate_control_mode="ABR", + complexity="Quality", + layers=[ + azure.media.TransformOutputCustomPresetCodecH264VideoLayerArgs( + width="64", + height="64", + bitrate=1045000, + max_bitrate=1045000, + b_frames=3, + slices=0, + adaptive_b_frame_enabled=True, + profile="Auto", + level="auto", + buffer_window="PT5S", + reference_frames=4, + crf=23, + entropy_mode="Cabac", + ), + azure.media.TransformOutputCustomPresetCodecH264VideoLayerArgs( + width="64", + height="64", + bitrate=1000, + max_bitrate=1000, + b_frames=3, + frame_rate="32", + slices=1, + adaptive_b_frame_enabled=True, + profile="High444", + level="auto", + buffer_window="PT5S", + reference_frames=4, + crf=23, + entropy_mode="Cavlc", + ), + ], + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + h265_video=azure.media.TransformOutputCustomPresetCodecH265VideoArgs( + key_frame_interval="PT2S", + stretch_mode="AutoSize", + sync_mode="Auto", + scene_change_detection_enabled=False, + complexity="Speed", + layers=[azure.media.TransformOutputCustomPresetCodecH265VideoLayerArgs( + width="64", + height="64", + bitrate=1045000, + max_bitrate=1045000, + b_frames=3, + slices=5, + adaptive_b_frame_enabled=True, + profile="Auto", + label="test", + level="auto", + buffer_window="PT5S", + frame_rate="32", + reference_frames=4, + crf=23, + )], + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + jpg_image=azure.media.TransformOutputCustomPresetCodecJpgImageArgs( + stretch_mode="AutoSize", + sync_mode="Auto", + start="10", + range="100%%", + sprite_column=1, + step="10", + layers=[azure.media.TransformOutputCustomPresetCodecJpgImageLayerArgs( + quality=70, + height="180", + label="test", + width="120", + )], + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + png_image=azure.media.TransformOutputCustomPresetCodecPngImageArgs( + stretch_mode="AutoSize", + sync_mode="Auto", + start="{Best}", + range="80", + step="10", + layers=[azure.media.TransformOutputCustomPresetCodecPngImageLayerArgs( + height="180", + label="test", + width="120", + )], + ), + ), + ], + formats=[ + azure.media.TransformOutputCustomPresetFormatArgs( + jpg=azure.media.TransformOutputCustomPresetFormatJpgArgs( + filename_pattern="test{Basename}", + ), + ), + azure.media.TransformOutputCustomPresetFormatArgs( + mp4=azure.media.TransformOutputCustomPresetFormatMp4Args( + filename_pattern="test{Bitrate}", + output_files=[azure.media.TransformOutputCustomPresetFormatMp4OutputFileArgs( + labels=[ + "test", + "ppe", + ], + )], + ), + ), + azure.media.TransformOutputCustomPresetFormatArgs( + png=azure.media.TransformOutputCustomPresetFormatPngArgs( + filename_pattern="test{Basename}", + ), + ), + azure.media.TransformOutputCustomPresetFormatArgs( + transport_stream=azure.media.TransformOutputCustomPresetFormatTransportStreamArgs( + filename_pattern="test{Bitrate}", + output_files=[azure.media.TransformOutputCustomPresetFormatTransportStreamOutputFileArgs( + labels=["prod"], + )], + ), + ), + ], + filter=azure.media.TransformOutputCustomPresetFilterArgs( + crop_rectangle=azure.media.TransformOutputCustomPresetFilterCropRectangleArgs( + height="240", + left="30", + top="360", + width="70", + ), + deinterlace=azure.media.TransformOutputCustomPresetFilterDeinterlaceArgs( + parity="TopFieldFirst", + mode="AutoPixelAdaptive", + ), + fade_in=azure.media.TransformOutputCustomPresetFilterFadeInArgs( + duration="PT5S", + fade_color="0xFF0000", + start="10", + ), + fade_out=azure.media.TransformOutputCustomPresetFilterFadeOutArgs( + duration="90%%", + fade_color="#FF0C7B", + start="10%%", + ), + rotation="Auto", + overlays=[ + azure.media.TransformOutputCustomPresetFilterOverlayArgs( + audio=azure.media.TransformOutputCustomPresetFilterOverlayAudioArgs( + input_label="label.jpg", + start="PT5S", + end="PT30S", + fade_in_duration="PT1S", + fade_out_duration="PT2S", + audio_gain_level=1, + ), + ), + azure.media.TransformOutputCustomPresetFilterOverlayArgs( + video=azure.media.TransformOutputCustomPresetFilterOverlayVideoArgs( + input_label="label.jpg", + start="PT5S", + end="PT30S", + fade_in_duration="PT1S", + fade_out_duration="PT2S", + audio_gain_level=1, + opacity=1, + position=azure.media.TransformOutputCustomPresetFilterOverlayVideoPositionArgs( + height="180", + left="20", + top="240", + width="140", + ), + crop_rectangle=azure.media.TransformOutputCustomPresetFilterOverlayVideoCropRectangleArgs( + height="240", + left="30", + top="360", + width="70", + ), + ), + ), + ], + ), + ), + ), + ]) + ``` + ## Import Transforms can be imported using the `resource id`, e.g. @@ -276,6 +599,329 @@ def __init__(__self__, """ Manages a Transform. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_transform = azure.media.Transform("exampleTransform", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="My transform description", + outputs=[azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="ContinueJob", + builtin_preset=azure.media.TransformOutputBuiltinPresetArgs( + preset_name="AACGoodQualityAudio", + ), + )]) + ``` + ### With Multiple Outputs + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + example_transform = azure.media.Transform("exampleTransform", + resource_group_name=example_resource_group.name, + media_services_account_name=example_service_account.name, + description="My transform description", + outputs=[ + azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="ContinueJob", + builtin_preset=azure.media.TransformOutputBuiltinPresetArgs( + preset_name="AACGoodQualityAudio", + preset_configuration=azure.media.TransformOutputBuiltinPresetPresetConfigurationArgs( + complexity="Balanced", + interleave_output="NonInterleavedOutput", + key_frame_interval_in_seconds=123122.5, + max_bitrate_bps=300000, + max_height=480, + max_layers=14, + min_bitrate_bps=200000, + min_height=360, + ), + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Low", + on_error_action="ContinueJob", + audio_analyzer_preset=azure.media.TransformOutputAudioAnalyzerPresetArgs( + audio_language="en-US", + audio_analysis_mode="Basic", + experimental_options={ + "env": "test", + }, + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Low", + on_error_action="StopProcessingJob", + face_detector_preset=azure.media.TransformOutputFaceDetectorPresetArgs( + analysis_resolution="StandardDefinition", + blur_type="Med", + face_redactor_mode="Combined", + experimental_options={ + "env": "test", + }, + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Normal", + on_error_action="StopProcessingJob", + video_analyzer_preset=azure.media.TransformOutputVideoAnalyzerPresetArgs( + audio_language="en-US", + audio_analysis_mode="Basic", + insights_type="AllInsights", + experimental_options={ + "env": "test", + }, + ), + ), + azure.media.TransformOutputArgs( + relative_priority="Low", + on_error_action="ContinueJob", + custom_preset=azure.media.TransformOutputCustomPresetArgs( + codecs=[ + azure.media.TransformOutputCustomPresetCodecArgs( + aac_audio=azure.media.TransformOutputCustomPresetCodecAacAudioArgs( + bitrate=128000, + channels=2, + sampling_rate=48000, + profile="AacLc", + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + copy_audio=azure.media.TransformOutputCustomPresetCodecCopyAudioArgs( + label="test", + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + copy_video=azure.media.TransformOutputCustomPresetCodecCopyVideoArgs( + label="test", + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + h264_video=azure.media.TransformOutputCustomPresetCodecH264VideoArgs( + key_frame_interval="PT1S", + stretch_mode="AutoSize", + sync_mode="Auto", + scene_change_detection_enabled=False, + rate_control_mode="ABR", + complexity="Quality", + layers=[ + azure.media.TransformOutputCustomPresetCodecH264VideoLayerArgs( + width="64", + height="64", + bitrate=1045000, + max_bitrate=1045000, + b_frames=3, + slices=0, + adaptive_b_frame_enabled=True, + profile="Auto", + level="auto", + buffer_window="PT5S", + reference_frames=4, + crf=23, + entropy_mode="Cabac", + ), + azure.media.TransformOutputCustomPresetCodecH264VideoLayerArgs( + width="64", + height="64", + bitrate=1000, + max_bitrate=1000, + b_frames=3, + frame_rate="32", + slices=1, + adaptive_b_frame_enabled=True, + profile="High444", + level="auto", + buffer_window="PT5S", + reference_frames=4, + crf=23, + entropy_mode="Cavlc", + ), + ], + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + h265_video=azure.media.TransformOutputCustomPresetCodecH265VideoArgs( + key_frame_interval="PT2S", + stretch_mode="AutoSize", + sync_mode="Auto", + scene_change_detection_enabled=False, + complexity="Speed", + layers=[azure.media.TransformOutputCustomPresetCodecH265VideoLayerArgs( + width="64", + height="64", + bitrate=1045000, + max_bitrate=1045000, + b_frames=3, + slices=5, + adaptive_b_frame_enabled=True, + profile="Auto", + label="test", + level="auto", + buffer_window="PT5S", + frame_rate="32", + reference_frames=4, + crf=23, + )], + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + jpg_image=azure.media.TransformOutputCustomPresetCodecJpgImageArgs( + stretch_mode="AutoSize", + sync_mode="Auto", + start="10", + range="100%%", + sprite_column=1, + step="10", + layers=[azure.media.TransformOutputCustomPresetCodecJpgImageLayerArgs( + quality=70, + height="180", + label="test", + width="120", + )], + ), + ), + azure.media.TransformOutputCustomPresetCodecArgs( + png_image=azure.media.TransformOutputCustomPresetCodecPngImageArgs( + stretch_mode="AutoSize", + sync_mode="Auto", + start="{Best}", + range="80", + step="10", + layers=[azure.media.TransformOutputCustomPresetCodecPngImageLayerArgs( + height="180", + label="test", + width="120", + )], + ), + ), + ], + formats=[ + azure.media.TransformOutputCustomPresetFormatArgs( + jpg=azure.media.TransformOutputCustomPresetFormatJpgArgs( + filename_pattern="test{Basename}", + ), + ), + azure.media.TransformOutputCustomPresetFormatArgs( + mp4=azure.media.TransformOutputCustomPresetFormatMp4Args( + filename_pattern="test{Bitrate}", + output_files=[azure.media.TransformOutputCustomPresetFormatMp4OutputFileArgs( + labels=[ + "test", + "ppe", + ], + )], + ), + ), + azure.media.TransformOutputCustomPresetFormatArgs( + png=azure.media.TransformOutputCustomPresetFormatPngArgs( + filename_pattern="test{Basename}", + ), + ), + azure.media.TransformOutputCustomPresetFormatArgs( + transport_stream=azure.media.TransformOutputCustomPresetFormatTransportStreamArgs( + filename_pattern="test{Bitrate}", + output_files=[azure.media.TransformOutputCustomPresetFormatTransportStreamOutputFileArgs( + labels=["prod"], + )], + ), + ), + ], + filter=azure.media.TransformOutputCustomPresetFilterArgs( + crop_rectangle=azure.media.TransformOutputCustomPresetFilterCropRectangleArgs( + height="240", + left="30", + top="360", + width="70", + ), + deinterlace=azure.media.TransformOutputCustomPresetFilterDeinterlaceArgs( + parity="TopFieldFirst", + mode="AutoPixelAdaptive", + ), + fade_in=azure.media.TransformOutputCustomPresetFilterFadeInArgs( + duration="PT5S", + fade_color="0xFF0000", + start="10", + ), + fade_out=azure.media.TransformOutputCustomPresetFilterFadeOutArgs( + duration="90%%", + fade_color="#FF0C7B", + start="10%%", + ), + rotation="Auto", + overlays=[ + azure.media.TransformOutputCustomPresetFilterOverlayArgs( + audio=azure.media.TransformOutputCustomPresetFilterOverlayAudioArgs( + input_label="label.jpg", + start="PT5S", + end="PT30S", + fade_in_duration="PT1S", + fade_out_duration="PT2S", + audio_gain_level=1, + ), + ), + azure.media.TransformOutputCustomPresetFilterOverlayArgs( + video=azure.media.TransformOutputCustomPresetFilterOverlayVideoArgs( + input_label="label.jpg", + start="PT5S", + end="PT30S", + fade_in_duration="PT1S", + fade_out_duration="PT2S", + audio_gain_level=1, + opacity=1, + position=azure.media.TransformOutputCustomPresetFilterOverlayVideoPositionArgs( + height="180", + left="20", + top="240", + width="140", + ), + crop_rectangle=azure.media.TransformOutputCustomPresetFilterOverlayVideoCropRectangleArgs( + height="240", + left="30", + top="360", + width="70", + ), + ), + ), + ], + ), + ), + ), + ]) + ``` + ## Import Transforms can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mediaservices/account.py b/sdk/python/pulumi_azure/mediaservices/account.py index 956cd46b72..1c2f85626a 100644 --- a/sdk/python/pulumi_azure/mediaservices/account.py +++ b/sdk/python/pulumi_azure/mediaservices/account.py @@ -453,6 +453,27 @@ def __init__(__self__, """ Manages a Media Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + ``` + ## Import Media Services Accounts can be imported using the `resource id`, e.g. @@ -483,6 +504,27 @@ def __init__(__self__, """ Manages a Media Services Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_service_account = azure.media.ServiceAccount("exampleServiceAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_accounts=[azure.media.ServiceAccountStorageAccountArgs( + id=example_account.id, + is_primary=True, + )]) + ``` + ## Import Media Services Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mixedreality/get_spatial_anchors_account.py b/sdk/python/pulumi_azure/mixedreality/get_spatial_anchors_account.py index 298d414704..5ec5f03073 100644 --- a/sdk/python/pulumi_azure/mixedreality/get_spatial_anchors_account.py +++ b/sdk/python/pulumi_azure/mixedreality/get_spatial_anchors_account.py @@ -113,6 +113,17 @@ def get_spatial_anchors_account(name: Optional[str] = None, """ Get information about an Azure Spatial Anchors Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mixedreality.get_spatial_anchors_account(name="example", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("accountDomain", data["azurerm_spatial_anchors_account"]["account_domain"]) + ``` + :param str name: Specifies the name of the Spatial Anchors Account. Changing this forces a new resource to be created. Must be globally unique. :param str resource_group_name: The name of the resource group in which to create the Spatial Anchors Account. @@ -140,6 +151,17 @@ def get_spatial_anchors_account_output(name: Optional[pulumi.Input[str]] = None, """ Get information about an Azure Spatial Anchors Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mixedreality.get_spatial_anchors_account(name="example", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("accountDomain", data["azurerm_spatial_anchors_account"]["account_domain"]) + ``` + :param str name: Specifies the name of the Spatial Anchors Account. Changing this forces a new resource to be created. Must be globally unique. :param str resource_group_name: The name of the resource group in which to create the Spatial Anchors Account. diff --git a/sdk/python/pulumi_azure/mixedreality/spatial_anchors_account.py b/sdk/python/pulumi_azure/mixedreality/spatial_anchors_account.py index 858b9eb89d..b29cba569e 100644 --- a/sdk/python/pulumi_azure/mixedreality/spatial_anchors_account.py +++ b/sdk/python/pulumi_azure/mixedreality/spatial_anchors_account.py @@ -247,6 +247,18 @@ def __init__(__self__, """ Manages an Azure Spatial Anchors Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spatial_anchors_account = azure.mixedreality.SpatialAnchorsAccount("exampleSpatialAnchorsAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Spatial Anchors Account can be imported using the `resource id`, e.g. @@ -271,6 +283,18 @@ def __init__(__self__, """ Manages an Azure Spatial Anchors Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spatial_anchors_account = azure.mixedreality.SpatialAnchorsAccount("exampleSpatialAnchorsAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Spatial Anchors Account can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/get_network.py b/sdk/python/pulumi_azure/mobile/get_network.py index f976cf34ac..602e8d43f1 100644 --- a/sdk/python/pulumi_azure/mobile/get_network.py +++ b/sdk/python/pulumi_azure/mobile/get_network.py @@ -128,6 +128,16 @@ def get_network(name: Optional[str] = None, """ Get information about an Azure Mobile Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mobile.get_network(name="example-mn", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: Specifies the name which should be used for this Mobile Network. :param str resource_group_name: Specifies the name of the Resource Group where the Mobile Network should exist. @@ -156,6 +166,16 @@ def get_network_output(name: Optional[pulumi.Input[str]] = None, """ Get information about an Azure Mobile Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mobile.get_network(name="example-mn", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: Specifies the name which should be used for this Mobile Network. :param str resource_group_name: Specifies the name of the Resource Group where the Mobile Network should exist. diff --git a/sdk/python/pulumi_azure/mobile/get_network_attached_data_network.py b/sdk/python/pulumi_azure/mobile/get_network_attached_data_network.py index d515aa3d13..ebf5902d5c 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_attached_data_network.py +++ b/sdk/python/pulumi_azure/mobile/get_network_attached_data_network.py @@ -183,6 +183,18 @@ def get_network_attached_data_network(mobile_network_data_network_name: Optional """ Use this data source to access information about an existing Mobile Network Attached Data Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network_packet_core_control_plane = azure.mobile.get_network_packet_core_control_plane(name="example-mnpccp", + resource_group_name="example-rg") + example_network_attached_data_network = azure.mobile.get_network_attached_data_network(mobile_network_data_network_name=example_network_packet_core_control_plane.name, + mobile_network_packet_core_data_plane_id=example_network_packet_core_control_plane.id) + ``` + :param str mobile_network_data_network_name: The Name of the `mobile.NetworkDataNetwork` this resource belongs to. :param str mobile_network_packet_core_data_plane_id: The ID of the `mobile.NetworkPacketCoreDataPlane` which the Mobile Network Attached Data Network belongs to. @@ -216,6 +228,18 @@ def get_network_attached_data_network_output(mobile_network_data_network_name: O """ Use this data source to access information about an existing Mobile Network Attached Data Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network_packet_core_control_plane = azure.mobile.get_network_packet_core_control_plane(name="example-mnpccp", + resource_group_name="example-rg") + example_network_attached_data_network = azure.mobile.get_network_attached_data_network(mobile_network_data_network_name=example_network_packet_core_control_plane.name, + mobile_network_packet_core_data_plane_id=example_network_packet_core_control_plane.id) + ``` + :param str mobile_network_data_network_name: The Name of the `mobile.NetworkDataNetwork` this resource belongs to. :param str mobile_network_packet_core_data_plane_id: The ID of the `mobile.NetworkPacketCoreDataPlane` which the Mobile Network Attached Data Network belongs to. diff --git a/sdk/python/pulumi_azure/mobile/get_network_data_network.py b/sdk/python/pulumi_azure/mobile/get_network_data_network.py index fabb26dc11..fb7b900244 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_data_network.py +++ b/sdk/python/pulumi_azure/mobile/get_network_data_network.py @@ -104,6 +104,18 @@ def get_network_data_network(mobile_network_id: Optional[str] = None, """ Get information about a Mobile Network Data Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_data_network = azure.mobile.get_network_data_network(name="example-mndn", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: Specifies the ID of the Mobile Network. :param str name: Specifies the name which should be used for this Mobile Network Data Network. @@ -130,6 +142,18 @@ def get_network_data_network_output(mobile_network_id: Optional[pulumi.Input[str """ Get information about a Mobile Network Data Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_data_network = azure.mobile.get_network_data_network(name="example-mndn", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: Specifies the ID of the Mobile Network. :param str name: Specifies the name which should be used for this Mobile Network Data Network. diff --git a/sdk/python/pulumi_azure/mobile/get_network_packet_core_control_plane.py b/sdk/python/pulumi_azure/mobile/get_network_packet_core_control_plane.py index ae12f3ef96..e59ffc9253 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_packet_core_control_plane.py +++ b/sdk/python/pulumi_azure/mobile/get_network_packet_core_control_plane.py @@ -240,6 +240,16 @@ def get_network_packet_core_control_plane(name: Optional[str] = None, """ Get information about a Mobile Network Packet Core Control Plane. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mobile.get_network_packet_core_control_plane(name="example-mnpccp", + resource_group_name="example-rg") + ``` + :param str name: The name of the Mobile Network Packet Core Control Plane. :param str resource_group_name: The name of the Resource Group where the Mobile Network Packet Core Control Plane exists. @@ -278,6 +288,16 @@ def get_network_packet_core_control_plane_output(name: Optional[pulumi.Input[str """ Get information about a Mobile Network Packet Core Control Plane. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mobile.get_network_packet_core_control_plane(name="example-mnpccp", + resource_group_name="example-rg") + ``` + :param str name: The name of the Mobile Network Packet Core Control Plane. :param str resource_group_name: The name of the Resource Group where the Mobile Network Packet Core Control Plane exists. diff --git a/sdk/python/pulumi_azure/mobile/get_network_packet_core_data_plane.py b/sdk/python/pulumi_azure/mobile/get_network_packet_core_data_plane.py index ca0f4ab047..d06c73cbac 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_packet_core_data_plane.py +++ b/sdk/python/pulumi_azure/mobile/get_network_packet_core_data_plane.py @@ -140,6 +140,18 @@ def get_network_packet_core_data_plane(mobile_network_packet_core_control_plane_ """ Get information a Mobile Network Packet Core Data Plane. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network_packet_core_control_plane = azure.mobile.get_network_packet_core_control_plane(name="example-mnpccp", + resource_group_name="example-rg") + example_network_packet_core_data_plane = azure.mobile.get_network_packet_core_data_plane(name="example-mnpcdp", + mobile_network_packet_core_control_plane_id=example_network_packet_core_control_plane.id) + ``` + :param str mobile_network_packet_core_control_plane_id: The ID of the Mobile Network Packet Core Data Plane. :param str name: The name of the Mobile Network Packet Core Data Plane. @@ -169,6 +181,18 @@ def get_network_packet_core_data_plane_output(mobile_network_packet_core_control """ Get information a Mobile Network Packet Core Data Plane. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network_packet_core_control_plane = azure.mobile.get_network_packet_core_control_plane(name="example-mnpccp", + resource_group_name="example-rg") + example_network_packet_core_data_plane = azure.mobile.get_network_packet_core_data_plane(name="example-mnpcdp", + mobile_network_packet_core_control_plane_id=example_network_packet_core_control_plane.id) + ``` + :param str mobile_network_packet_core_control_plane_id: The ID of the Mobile Network Packet Core Data Plane. :param str name: The name of the Mobile Network Packet Core Data Plane. diff --git a/sdk/python/pulumi_azure/mobile/get_network_service.py b/sdk/python/pulumi_azure/mobile/get_network_service.py index 2eff5c064e..60da9238f1 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_service.py +++ b/sdk/python/pulumi_azure/mobile/get_network_service.py @@ -132,6 +132,17 @@ def get_network_service(mobile_network_id: Optional[str] = None, """ Get information about a Mobile Network Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_service = azure.mobile.NetworkService("exampleNetworkService", mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: Specifies the ID of the Mobile Network Service. :param str name: Specifies the name which should be used for this Mobile Network Service. @@ -160,6 +171,17 @@ def get_network_service_output(mobile_network_id: Optional[pulumi.Input[str]] = """ Get information about a Mobile Network Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_service = azure.mobile.NetworkService("exampleNetworkService", mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: Specifies the ID of the Mobile Network Service. :param str name: Specifies the name which should be used for this Mobile Network Service. diff --git a/sdk/python/pulumi_azure/mobile/get_network_sim_group.py b/sdk/python/pulumi_azure/mobile/get_network_sim_group.py index 8249dafdc2..09d99f1f62 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_sim_group.py +++ b/sdk/python/pulumi_azure/mobile/get_network_sim_group.py @@ -117,6 +117,18 @@ def get_network_sim_group(mobile_network_id: Optional[str] = None, """ Get information about a Mobile Network Sim Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name=azurerm_resource_group["example"]["name"]) + example_network_sim_group = azure.mobile.get_network_sim_group(name="example-mnsg", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: The ID of Mobile Network which the Mobile Network Sim Group belongs to. :param str name: Specifies the name which should be used for this Mobile Network Sim Groups. @@ -144,6 +156,18 @@ def get_network_sim_group_output(mobile_network_id: Optional[pulumi.Input[str]] """ Get information about a Mobile Network Sim Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name=azurerm_resource_group["example"]["name"]) + example_network_sim_group = azure.mobile.get_network_sim_group(name="example-mnsg", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: The ID of Mobile Network which the Mobile Network Sim Group belongs to. :param str name: Specifies the name which should be used for this Mobile Network Sim Groups. diff --git a/sdk/python/pulumi_azure/mobile/get_network_sim_policy.py b/sdk/python/pulumi_azure/mobile/get_network_sim_policy.py index 6212db558a..ee73b97fb2 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_sim_policy.py +++ b/sdk/python/pulumi_azure/mobile/get_network_sim_policy.py @@ -153,6 +153,18 @@ def get_network_sim_policy(mobile_network_id: Optional[str] = None, """ Get information about a Mobile Network Sim Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_sim_policy = azure.mobile.get_network_sim_policy(name="example-mnsp", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: The ID of the Mobile Network which the Sim Policy belongs to. :param str name: The name which should be used for this Mobile Network Sim Policies. @@ -183,6 +195,18 @@ def get_network_sim_policy_output(mobile_network_id: Optional[pulumi.Input[str]] """ Get information about a Mobile Network Sim Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_sim_policy = azure.mobile.get_network_sim_policy(name="example-mnsp", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: The ID of the Mobile Network which the Sim Policy belongs to. :param str name: The name which should be used for this Mobile Network Sim Policies. diff --git a/sdk/python/pulumi_azure/mobile/get_network_site.py b/sdk/python/pulumi_azure/mobile/get_network_site.py index d35f4eda7d..3bde88e49f 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_site.py +++ b/sdk/python/pulumi_azure/mobile/get_network_site.py @@ -104,6 +104,18 @@ def get_network_site(mobile_network_id: Optional[str] = None, """ Get information about a Mobile Network Site. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_site = azure.mobile.get_network_site(name="example-mns", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: the ID of the Mobile Network which the Mobile Network Site belongs to. :param str name: The name which should be used for this Mobile Network Site. @@ -130,6 +142,18 @@ def get_network_site_output(mobile_network_id: Optional[pulumi.Input[str]] = Non """ Get information about a Mobile Network Site. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_site = azure.mobile.get_network_site(name="example-mns", + mobile_network_id=example_network.id) + ``` + :param str mobile_network_id: the ID of the Mobile Network which the Mobile Network Site belongs to. :param str name: The name which should be used for this Mobile Network Site. diff --git a/sdk/python/pulumi_azure/mobile/get_network_slice.py b/sdk/python/pulumi_azure/mobile/get_network_slice.py index 742997e97b..a5e6005f40 100644 --- a/sdk/python/pulumi_azure/mobile/get_network_slice.py +++ b/sdk/python/pulumi_azure/mobile/get_network_slice.py @@ -117,6 +117,18 @@ def get_network_slice(mobile_network_id: Optional[str] = None, """ Get information about a Mobile Network Slice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_slice = azure.mobile.get_network_slice(name="example-mns", + mobile_network_id=data["azurerm_mobile_network"]["test"]["id"]) + ``` + :param str mobile_network_id: The ID of Mobile Network which the Mobile Network Slice belongs to. :param str name: Specifies the name which should be used for this Mobile Network Slice. @@ -144,6 +156,18 @@ def get_network_slice_output(mobile_network_id: Optional[pulumi.Input[str]] = No """ Get information about a Mobile Network Slice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_network = azure.mobile.get_network(name="example-mn", + resource_group_name="example-rg") + example_network_slice = azure.mobile.get_network_slice(name="example-mns", + mobile_network_id=data["azurerm_mobile_network"]["test"]["id"]) + ``` + :param str mobile_network_id: The ID of Mobile Network which the Mobile Network Slice belongs to. :param str name: Specifies the name which should be used for this Mobile Network Slice. diff --git a/sdk/python/pulumi_azure/mobile/network.py b/sdk/python/pulumi_azure/mobile/network.py index 5234afe4cb..ac2a7664e0 100644 --- a/sdk/python/pulumi_azure/mobile/network.py +++ b/sdk/python/pulumi_azure/mobile/network.py @@ -311,6 +311,23 @@ def __init__(__self__, """ Manages a Mobile Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_network = azure.mobile.Network("exampleNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + mobile_country_code="001", + mobile_network_code="01", + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network can be imported using the `resource id`, e.g. @@ -337,6 +354,23 @@ def __init__(__self__, """ Manages a Mobile Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_network = azure.mobile.Network("exampleNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + mobile_country_code="001", + mobile_network_code="01", + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_data_network.py b/sdk/python/pulumi_azure/mobile/network_data_network.py index 308ce78b31..357ecade8a 100644 --- a/sdk/python/pulumi_azure/mobile/network_data_network.py +++ b/sdk/python/pulumi_azure/mobile/network_data_network.py @@ -244,6 +244,27 @@ def __init__(__self__, """ Manages a Mobile Network Data Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East Us") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_data_network = azure.mobile.NetworkDataNetwork("exampleNetworkDataNetwork", + mobile_network_id=example_network.id, + location=example_resource_group.location, + description="example description", + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Data Network can be imported using the `resource id`, e.g. @@ -269,6 +290,27 @@ def __init__(__self__, """ Manages a Mobile Network Data Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East Us") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_data_network = azure.mobile.NetworkDataNetwork("exampleNetworkDataNetwork", + mobile_network_id=example_network.id, + location=example_resource_group.location, + description="example description", + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Data Network can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_packet_core_control_plane.py b/sdk/python/pulumi_azure/mobile/network_packet_core_control_plane.py index 56578ce4e0..c02762e7e1 100644 --- a/sdk/python/pulumi_azure/mobile/network_packet_core_control_plane.py +++ b/sdk/python/pulumi_azure/mobile/network_packet_core_control_plane.py @@ -733,6 +733,50 @@ def __init__(__self__, """ Manages a Mobile Network Packet Core Control Plane. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + mobile_country_code="001", + mobile_network_code="01") + example_network_site = azure.mobile.NetworkSite("exampleNetworkSite", + mobile_network_id=azurerm_mobile_network["test"]["id"], + location=example_resource_group.location) + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + example_network_packet_core_control_plane = azure.mobile.NetworkPacketCoreControlPlane("exampleNetworkPacketCoreControlPlane", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="G0", + control_plane_access_name="default-interface", + control_plane_access_ipv4_address="192.168.1.199", + control_plane_access_ipv4_gateway="192.168.1.1", + control_plane_access_ipv4_subnet="192.168.1.0/25", + site_ids=[example_network_site.id], + local_diagnostics_access=azure.mobile.NetworkPacketCoreControlPlaneLocalDiagnosticsAccessArgs( + authentication_type="AAD", + ), + platform=azure.mobile.NetworkPacketCoreControlPlanePlatformArgs( + type="AKS-HCI", + edge_device_id=example_device.id, + ), + interoperability_settings_json=json.dumps({ + "key": "value", + }), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Packet Core Control Plane can be imported using the `resource id`, e.g. @@ -770,6 +814,50 @@ def __init__(__self__, """ Manages a Mobile Network Packet Core Control Plane. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + mobile_country_code="001", + mobile_network_code="01") + example_network_site = azure.mobile.NetworkSite("exampleNetworkSite", + mobile_network_id=azurerm_mobile_network["test"]["id"], + location=example_resource_group.location) + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + example_network_packet_core_control_plane = azure.mobile.NetworkPacketCoreControlPlane("exampleNetworkPacketCoreControlPlane", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="G0", + control_plane_access_name="default-interface", + control_plane_access_ipv4_address="192.168.1.199", + control_plane_access_ipv4_gateway="192.168.1.1", + control_plane_access_ipv4_subnet="192.168.1.0/25", + site_ids=[example_network_site.id], + local_diagnostics_access=azure.mobile.NetworkPacketCoreControlPlaneLocalDiagnosticsAccessArgs( + authentication_type="AAD", + ), + platform=azure.mobile.NetworkPacketCoreControlPlanePlatformArgs( + type="AKS-HCI", + edge_device_id=example_device.id, + ), + interoperability_settings_json=json.dumps({ + "key": "value", + }), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Packet Core Control Plane can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_service.py b/sdk/python/pulumi_azure/mobile/network_service.py index cccf7a4e54..bc65faf8c7 100644 --- a/sdk/python/pulumi_azure/mobile/network_service.py +++ b/sdk/python/pulumi_azure/mobile/network_service.py @@ -334,6 +334,63 @@ def __init__(__self__, """ Manages a Mobile Network Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_service = azure.mobile.NetworkService("exampleNetworkService", + mobile_network_id=example_network.id, + location=example_resource_group.location, + service_precedence=0, + pcc_rules=[azure.mobile.NetworkServicePccRuleArgs( + name="default-rule", + precedence=1, + traffic_control_enabled=True, + qos_policy=azure.mobile.NetworkServicePccRuleQosPolicyArgs( + allocation_and_retention_priority_level=9, + qos_indicator=9, + preemption_capability="NotPreempt", + preemption_vulnerability="Preemptable", + guaranteed_bit_rate=azure.mobile.NetworkServicePccRuleQosPolicyGuaranteedBitRateArgs( + downlink="100 Mbps", + uplink="10 Mbps", + ), + maximum_bit_rate=azure.mobile.NetworkServicePccRuleQosPolicyMaximumBitRateArgs( + downlink="1 Gbps", + uplink="100 Mbps", + ), + ), + service_data_flow_templates=[azure.mobile.NetworkServicePccRuleServiceDataFlowTemplateArgs( + direction="Uplink", + name="IP-to-server", + ports=[], + protocols=["ip"], + remote_ip_lists=["10.3.4.0/24"], + )], + )], + service_qos_policy=azure.mobile.NetworkServiceServiceQosPolicyArgs( + allocation_and_retention_priority_level=9, + qos_indicator=9, + preemption_capability="NotPreempt", + preemption_vulnerability="Preemptable", + maximum_bit_rate=azure.mobile.NetworkServiceServiceQosPolicyMaximumBitRateArgs( + downlink="1 Gbps", + uplink="100 Mbps", + ), + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Service can be imported using the `resource id`, e.g. @@ -361,6 +418,63 @@ def __init__(__self__, """ Manages a Mobile Network Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_service = azure.mobile.NetworkService("exampleNetworkService", + mobile_network_id=example_network.id, + location=example_resource_group.location, + service_precedence=0, + pcc_rules=[azure.mobile.NetworkServicePccRuleArgs( + name="default-rule", + precedence=1, + traffic_control_enabled=True, + qos_policy=azure.mobile.NetworkServicePccRuleQosPolicyArgs( + allocation_and_retention_priority_level=9, + qos_indicator=9, + preemption_capability="NotPreempt", + preemption_vulnerability="Preemptable", + guaranteed_bit_rate=azure.mobile.NetworkServicePccRuleQosPolicyGuaranteedBitRateArgs( + downlink="100 Mbps", + uplink="10 Mbps", + ), + maximum_bit_rate=azure.mobile.NetworkServicePccRuleQosPolicyMaximumBitRateArgs( + downlink="1 Gbps", + uplink="100 Mbps", + ), + ), + service_data_flow_templates=[azure.mobile.NetworkServicePccRuleServiceDataFlowTemplateArgs( + direction="Uplink", + name="IP-to-server", + ports=[], + protocols=["ip"], + remote_ip_lists=["10.3.4.0/24"], + )], + )], + service_qos_policy=azure.mobile.NetworkServiceServiceQosPolicyArgs( + allocation_and_retention_priority_level=9, + qos_indicator=9, + preemption_capability="NotPreempt", + preemption_vulnerability="Preemptable", + maximum_bit_rate=azure.mobile.NetworkServiceServiceQosPolicyMaximumBitRateArgs( + downlink="1 Gbps", + uplink="100 Mbps", + ), + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_sim.py b/sdk/python/pulumi_azure/mobile/network_sim.py index 753d6a5474..2a187d9d89 100644 --- a/sdk/python/pulumi_azure/mobile/network_sim.py +++ b/sdk/python/pulumi_azure/mobile/network_sim.py @@ -486,6 +486,51 @@ def __init__(__self__, """ Manages a Mobile Network Sim. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_sim_group = azure.mobile.NetworkSimGroup("exampleNetworkSimGroup", + location=example_resource_group.location, + mobile_network_id=example_network.id) + example_network_slice = azure.mobile.NetworkSlice("exampleNetworkSlice", + mobile_network_id=example_network.id, + location=example_resource_group.location, + single_network_slice_selection_assistance_information=azure.mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs( + slice_service_type=1, + )) + example_network_attached_data_network = azure.mobile.NetworkAttachedDataNetwork("exampleNetworkAttachedDataNetwork", + mobile_network_data_network_name=azurerm_mobile_network_data_network["example"]["name"], + mobile_network_packet_core_data_plane_id=azurerm_mobile_network_packet_core_data_plane["example"]["id"], + location=example_resource_group.location, + dns_addresses=["1.1.1.1"], + user_equipment_address_pool_prefixes=["2.4.0.0/24"], + user_equipment_static_address_pool_prefixes=["2.4.1.0/24"], + user_plane_access_name="test", + user_plane_access_ipv4_address="10.204.141.4", + user_plane_access_ipv4_gateway="10.204.141.1", + user_plane_access_ipv4_subnet="10.204.141.0/24") + example_network_sim = azure.mobile.NetworkSim("exampleNetworkSim", + mobile_network_sim_group_id=example_network_sim_group.id, + authentication_key="00000000000000000000000000000000", + integrated_circuit_card_identifier="8900000000000000000", + international_mobile_subscriber_identity="000000000000000", + operator_key_code="00000000000000000000000000000000", + static_ip_configurations=[azure.mobile.NetworkSimStaticIpConfigurationArgs( + attached_data_network_id=data["azurerm_mobile_network_attached_data_network"]["test"]["id"], + slice_id=azurerm_mobile_network_slice["test"]["id"], + static_ipv4_address="2.4.0.1", + )]) + ``` + ## Import Mobile Network Sim can be imported using the `resource id`, e.g. @@ -515,6 +560,51 @@ def __init__(__self__, """ Manages a Mobile Network Sim. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_sim_group = azure.mobile.NetworkSimGroup("exampleNetworkSimGroup", + location=example_resource_group.location, + mobile_network_id=example_network.id) + example_network_slice = azure.mobile.NetworkSlice("exampleNetworkSlice", + mobile_network_id=example_network.id, + location=example_resource_group.location, + single_network_slice_selection_assistance_information=azure.mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs( + slice_service_type=1, + )) + example_network_attached_data_network = azure.mobile.NetworkAttachedDataNetwork("exampleNetworkAttachedDataNetwork", + mobile_network_data_network_name=azurerm_mobile_network_data_network["example"]["name"], + mobile_network_packet_core_data_plane_id=azurerm_mobile_network_packet_core_data_plane["example"]["id"], + location=example_resource_group.location, + dns_addresses=["1.1.1.1"], + user_equipment_address_pool_prefixes=["2.4.0.0/24"], + user_equipment_static_address_pool_prefixes=["2.4.1.0/24"], + user_plane_access_name="test", + user_plane_access_ipv4_address="10.204.141.4", + user_plane_access_ipv4_gateway="10.204.141.1", + user_plane_access_ipv4_subnet="10.204.141.0/24") + example_network_sim = azure.mobile.NetworkSim("exampleNetworkSim", + mobile_network_sim_group_id=example_network_sim_group.id, + authentication_key="00000000000000000000000000000000", + integrated_circuit_card_identifier="8900000000000000000", + international_mobile_subscriber_identity="000000000000000", + operator_key_code="00000000000000000000000000000000", + static_ip_configurations=[azure.mobile.NetworkSimStaticIpConfigurationArgs( + attached_data_network_id=data["azurerm_mobile_network_attached_data_network"]["test"]["id"], + slice_id=azurerm_mobile_network_slice["test"]["id"], + static_ipv4_address="2.4.0.1", + )]) + ``` + ## Import Mobile Network Sim can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_sim_group.py b/sdk/python/pulumi_azure/mobile/network_sim_group.py index 5010a4b97a..da888f7612 100644 --- a/sdk/python/pulumi_azure/mobile/network_sim_group.py +++ b/sdk/python/pulumi_azure/mobile/network_sim_group.py @@ -295,6 +295,37 @@ def __init__(__self__, """ Manages a Mobile Network Sim Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_user_assigned_identity = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity", + resource_group_name="name_of_resource_group") + example_key_vault = azure.keyvault.get_key_vault(name="example-kv", + resource_group_name="some-resource-group") + example_key = azure.keyvault.get_key(name="example-key", + key_vault_id=example_key_vault.id) + example_network_sim_group = azure.mobile.NetworkSimGroup("exampleNetworkSimGroup", + location=example_resource_group.location, + mobile_network_id=example_network.id, + encryption_key_url=example_key.id, + identity=azure.mobile.NetworkSimGroupIdentityArgs( + type="SystemAssigned, UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Sim Groups can be imported using the `resource id`, e.g. @@ -323,6 +354,37 @@ def __init__(__self__, """ Manages a Mobile Network Sim Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_user_assigned_identity = azure.authorization.get_user_assigned_identity(name="name_of_user_assigned_identity", + resource_group_name="name_of_resource_group") + example_key_vault = azure.keyvault.get_key_vault(name="example-kv", + resource_group_name="some-resource-group") + example_key = azure.keyvault.get_key(name="example-key", + key_vault_id=example_key_vault.id) + example_network_sim_group = azure.mobile.NetworkSimGroup("exampleNetworkSimGroup", + location=example_resource_group.location, + mobile_network_id=example_network.id, + encryption_key_url=example_key.id, + identity=azure.mobile.NetworkSimGroupIdentityArgs( + type="SystemAssigned, UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Sim Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_sim_policy.py b/sdk/python/pulumi_azure/mobile/network_sim_policy.py index ea3f531bde..6100da3cf9 100644 --- a/sdk/python/pulumi_azure/mobile/network_sim_policy.py +++ b/sdk/python/pulumi_azure/mobile/network_sim_policy.py @@ -413,6 +413,74 @@ def __init__(__self__, """ Manages a Mobile Network Sim Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_data_network = azure.mobile.NetworkDataNetwork("exampleNetworkDataNetwork", + mobile_network_id=example_network.id, + location=example_resource_group.location) + example_network_service = azure.mobile.NetworkService("exampleNetworkService", + mobile_network_id=example_network.id, + location=example_resource_group.location, + service_precedence=0, + pcc_rules=[azure.mobile.NetworkServicePccRuleArgs( + name="default-rule", + precedence=1, + traffic_control_enabled=True, + service_data_flow_templates=[azure.mobile.NetworkServicePccRuleServiceDataFlowTemplateArgs( + direction="Uplink", + name="IP-to-server", + ports=[], + protocols=["ip"], + remote_ip_lists=["10.3.4.0/24"], + )], + )]) + example_network_slice = azure.mobile.NetworkSlice("exampleNetworkSlice", + mobile_network_id=example_network.id, + location=example_resource_group.location, + single_network_slice_selection_assistance_information=azure.mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs( + slice_service_type=1, + )) + example_network_sim_policy = azure.mobile.NetworkSimPolicy("exampleNetworkSimPolicy", + mobile_network_id=example_network.id, + location=example_resource_group.location, + registration_timer_in_seconds=3240, + default_slice_id=example_network_slice.id, + slices=[azure.mobile.NetworkSimPolicySliceArgs( + default_data_network_id=example_network_data_network.id, + slice_id=example_network_slice.id, + data_networks=[azure.mobile.NetworkSimPolicySliceDataNetworkArgs( + data_network_id=example_network_data_network.id, + allocation_and_retention_priority_level=9, + default_session_type="IPv4", + qos_indicator=9, + preemption_capability="NotPreempt", + preemption_vulnerability="Preemptable", + allowed_services_ids=[example_network_service.id], + session_aggregate_maximum_bit_rate=azure.mobile.NetworkSimPolicySliceDataNetworkSessionAggregateMaximumBitRateArgs( + downlink="1 Gbps", + uplink="500 Mbps", + ), + )], + )], + user_equipment_aggregate_maximum_bit_rate=azure.mobile.NetworkSimPolicyUserEquipmentAggregateMaximumBitRateArgs( + downlink="1 Gbps", + uplink="500 Mbps", + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Sim Policies can be imported using the `resource id`, e.g. @@ -442,6 +510,74 @@ def __init__(__self__, """ Manages a Mobile Network Sim Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_data_network = azure.mobile.NetworkDataNetwork("exampleNetworkDataNetwork", + mobile_network_id=example_network.id, + location=example_resource_group.location) + example_network_service = azure.mobile.NetworkService("exampleNetworkService", + mobile_network_id=example_network.id, + location=example_resource_group.location, + service_precedence=0, + pcc_rules=[azure.mobile.NetworkServicePccRuleArgs( + name="default-rule", + precedence=1, + traffic_control_enabled=True, + service_data_flow_templates=[azure.mobile.NetworkServicePccRuleServiceDataFlowTemplateArgs( + direction="Uplink", + name="IP-to-server", + ports=[], + protocols=["ip"], + remote_ip_lists=["10.3.4.0/24"], + )], + )]) + example_network_slice = azure.mobile.NetworkSlice("exampleNetworkSlice", + mobile_network_id=example_network.id, + location=example_resource_group.location, + single_network_slice_selection_assistance_information=azure.mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs( + slice_service_type=1, + )) + example_network_sim_policy = azure.mobile.NetworkSimPolicy("exampleNetworkSimPolicy", + mobile_network_id=example_network.id, + location=example_resource_group.location, + registration_timer_in_seconds=3240, + default_slice_id=example_network_slice.id, + slices=[azure.mobile.NetworkSimPolicySliceArgs( + default_data_network_id=example_network_data_network.id, + slice_id=example_network_slice.id, + data_networks=[azure.mobile.NetworkSimPolicySliceDataNetworkArgs( + data_network_id=example_network_data_network.id, + allocation_and_retention_priority_level=9, + default_session_type="IPv4", + qos_indicator=9, + preemption_capability="NotPreempt", + preemption_vulnerability="Preemptable", + allowed_services_ids=[example_network_service.id], + session_aggregate_maximum_bit_rate=azure.mobile.NetworkSimPolicySliceDataNetworkSessionAggregateMaximumBitRateArgs( + downlink="1 Gbps", + uplink="500 Mbps", + ), + )], + )], + user_equipment_aggregate_maximum_bit_rate=azure.mobile.NetworkSimPolicyUserEquipmentAggregateMaximumBitRateArgs( + downlink="1 Gbps", + uplink="500 Mbps", + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Sim Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_site.py b/sdk/python/pulumi_azure/mobile/network_site.py index 8c1c1c7f5a..0adcf1737d 100644 --- a/sdk/python/pulumi_azure/mobile/network_site.py +++ b/sdk/python/pulumi_azure/mobile/network_site.py @@ -227,6 +227,30 @@ def __init__(__self__, """ Manages a Mobile Network Site. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_site = azure.mobile.NetworkSite("exampleNetworkSite", + mobile_network_id=example_network.id, + location=example_resource_group.location, + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Site can be imported using the `resource id`, e.g. @@ -251,6 +275,30 @@ def __init__(__self__, """ Manages a Mobile Network Site. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_device = azure.databoxedge.Device("exampleDevice", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EdgeP_Base-Standard") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_site = azure.mobile.NetworkSite("exampleNetworkSite", + mobile_network_id=example_network.id, + location=example_resource_group.location, + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Site can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mobile/network_slice.py b/sdk/python/pulumi_azure/mobile/network_slice.py index 8c54884272..5d54054d57 100644 --- a/sdk/python/pulumi_azure/mobile/network_slice.py +++ b/sdk/python/pulumi_azure/mobile/network_slice.py @@ -288,6 +288,30 @@ def __init__(__self__, """ Manages a Mobile Network Slice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_slice = azure.mobile.NetworkSlice("exampleNetworkSlice", + mobile_network_id=example_network.id, + location=example_resource_group.location, + description="an example slice", + single_network_slice_selection_assistance_information=azure.mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs( + slice_service_type=1, + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Slice can be imported using the `resource id`, e.g. @@ -314,6 +338,30 @@ def __init__(__self__, """ Manages a Mobile Network Slice. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network = azure.mobile.Network("exampleNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + mobile_country_code="001", + mobile_network_code="01") + example_network_slice = azure.mobile.NetworkSlice("exampleNetworkSlice", + mobile_network_id=example_network.id, + location=example_resource_group.location, + description="an example slice", + single_network_slice_selection_assistance_information=azure.mobile.NetworkSliceSingleNetworkSliceSelectionAssistanceInformationArgs( + slice_service_type=1, + ), + tags={ + "key": "value", + }) + ``` + ## Import Mobile Network Slice can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/aad_diagnostic_setting.py b/sdk/python/pulumi_azure/monitoring/aad_diagnostic_setting.py index 826d7cebd4..4e7b0a9dd5 100644 --- a/sdk/python/pulumi_azure/monitoring/aad_diagnostic_setting.py +++ b/sdk/python/pulumi_azure/monitoring/aad_diagnostic_setting.py @@ -381,6 +381,53 @@ def __init__(__self__, !> **Authentication** The API for this resource does not support service principal authentication. This resource can only be used with Azure CLI authentication. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_kind="StorageV2", + account_replication_type="LRS") + example_aad_diagnostic_setting = azure.monitoring.AadDiagnosticSetting("exampleAadDiagnosticSetting", + storage_account_id=example_account.id, + enabled_logs=[ + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="SignInLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="AuditLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="NonInteractiveUserSignInLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="ServicePrincipalSignInLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + ]) + ``` + ## Import Monitor Azure Active Directory Diagnostic Settings can be imported using the `resource id`, e.g. @@ -418,6 +465,53 @@ def __init__(__self__, !> **Authentication** The API for this resource does not support service principal authentication. This resource can only be used with Azure CLI authentication. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_kind="StorageV2", + account_replication_type="LRS") + example_aad_diagnostic_setting = azure.monitoring.AadDiagnosticSetting("exampleAadDiagnosticSetting", + storage_account_id=example_account.id, + enabled_logs=[ + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="SignInLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="AuditLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="NonInteractiveUserSignInLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + azure.monitoring.AadDiagnosticSettingEnabledLogArgs( + category="ServicePrincipalSignInLogs", + retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=True, + days=1, + ), + ), + ]) + ``` + ## Import Monitor Azure Active Directory Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/action_group.py b/sdk/python/pulumi_azure/monitoring/action_group.py index ccbebe5e64..a5be556465 100644 --- a/sdk/python/pulumi_azure/monitoring/action_group.py +++ b/sdk/python/pulumi_azure/monitoring/action_group.py @@ -739,6 +739,93 @@ def __init__(__self__, """ Manages an Action Group within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="p0action", + arm_role_receivers=[azure.monitoring.ActionGroupArmRoleReceiverArgs( + name="armroleaction", + role_id="de139f84-1756-47ae-9be6-808fbbe84772", + use_common_alert_schema=True, + )], + automation_runbook_receivers=[azure.monitoring.ActionGroupAutomationRunbookReceiverArgs( + name="action_name_1", + automation_account_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001", + runbook_name="my runbook", + webhook_resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001/webHooks/webhook_alert", + is_global_runbook=True, + service_uri="https://s13events.azure-automation.net/webhooks?token=randomtoken", + use_common_alert_schema=True, + )], + azure_app_push_receivers=[azure.monitoring.ActionGroupAzureAppPushReceiverArgs( + name="pushtoadmin", + email_address="admin@contoso.com", + )], + azure_function_receivers=[azure.monitoring.ActionGroupAzureFunctionReceiverArgs( + name="funcaction", + function_app_resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-funcapp/providers/Microsoft.Web/sites/funcapp", + function_name="myfunc", + http_trigger_url="https://example.com/trigger", + use_common_alert_schema=True, + )], + email_receivers=[ + azure.monitoring.ActionGroupEmailReceiverArgs( + name="sendtoadmin", + email_address="admin@contoso.com", + ), + azure.monitoring.ActionGroupEmailReceiverArgs( + name="sendtodevops", + email_address="devops@contoso.com", + use_common_alert_schema=True, + ), + ], + event_hub_receivers=[azure.monitoring.ActionGroupEventHubReceiverArgs( + name="sendtoeventhub", + event_hub_namespace="eventhubnamespace", + event_hub_name="eventhub1", + subscription_id="00000000-0000-0000-0000-000000000000", + use_common_alert_schema=False, + )], + itsm_receivers=[azure.monitoring.ActionGroupItsmReceiverArgs( + name="createorupdateticket", + workspace_id=example_analytics_workspace.workspace_id.apply(lambda workspace_id: f"{current.subscription_id}|{workspace_id}"), + connection_id="53de6956-42b4-41ba-be3c-b154cdf17b13", + ticket_configuration="{\\"PayloadRevision\\":0,\\"WorkItemType\\":\\"Incident\\",\\"UseTemplate\\":false,\\"WorkItemData\\":\\"{}\\",\\"CreateOneWIPerCI\\":false}", + region="southcentralus", + )], + logic_app_receivers=[azure.monitoring.ActionGroupLogicAppReceiverArgs( + name="logicappaction", + resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-logicapp/providers/Microsoft.Logic/workflows/logicapp", + callback_url="https://logicapptriggerurl/...", + use_common_alert_schema=True, + )], + sms_receivers=[azure.monitoring.ActionGroupSmsReceiverArgs( + name="oncallmsg", + country_code="1", + phone_number="1231231234", + )], + voice_receivers=[azure.monitoring.ActionGroupVoiceReceiverArgs( + name="remotesupport", + country_code="86", + phone_number="13888888888", + )], + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapiaswell", + service_uri="http://example.com/alert", + use_common_alert_schema=True, + )]) + ``` + ## Import Action Groups can be imported using the `resource id`, e.g. @@ -776,6 +863,93 @@ def __init__(__self__, """ Manages an Action Group within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="p0action", + arm_role_receivers=[azure.monitoring.ActionGroupArmRoleReceiverArgs( + name="armroleaction", + role_id="de139f84-1756-47ae-9be6-808fbbe84772", + use_common_alert_schema=True, + )], + automation_runbook_receivers=[azure.monitoring.ActionGroupAutomationRunbookReceiverArgs( + name="action_name_1", + automation_account_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001", + runbook_name="my runbook", + webhook_resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001/webHooks/webhook_alert", + is_global_runbook=True, + service_uri="https://s13events.azure-automation.net/webhooks?token=randomtoken", + use_common_alert_schema=True, + )], + azure_app_push_receivers=[azure.monitoring.ActionGroupAzureAppPushReceiverArgs( + name="pushtoadmin", + email_address="admin@contoso.com", + )], + azure_function_receivers=[azure.monitoring.ActionGroupAzureFunctionReceiverArgs( + name="funcaction", + function_app_resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-funcapp/providers/Microsoft.Web/sites/funcapp", + function_name="myfunc", + http_trigger_url="https://example.com/trigger", + use_common_alert_schema=True, + )], + email_receivers=[ + azure.monitoring.ActionGroupEmailReceiverArgs( + name="sendtoadmin", + email_address="admin@contoso.com", + ), + azure.monitoring.ActionGroupEmailReceiverArgs( + name="sendtodevops", + email_address="devops@contoso.com", + use_common_alert_schema=True, + ), + ], + event_hub_receivers=[azure.monitoring.ActionGroupEventHubReceiverArgs( + name="sendtoeventhub", + event_hub_namespace="eventhubnamespace", + event_hub_name="eventhub1", + subscription_id="00000000-0000-0000-0000-000000000000", + use_common_alert_schema=False, + )], + itsm_receivers=[azure.monitoring.ActionGroupItsmReceiverArgs( + name="createorupdateticket", + workspace_id=example_analytics_workspace.workspace_id.apply(lambda workspace_id: f"{current.subscription_id}|{workspace_id}"), + connection_id="53de6956-42b4-41ba-be3c-b154cdf17b13", + ticket_configuration="{\\"PayloadRevision\\":0,\\"WorkItemType\\":\\"Incident\\",\\"UseTemplate\\":false,\\"WorkItemData\\":\\"{}\\",\\"CreateOneWIPerCI\\":false}", + region="southcentralus", + )], + logic_app_receivers=[azure.monitoring.ActionGroupLogicAppReceiverArgs( + name="logicappaction", + resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-logicapp/providers/Microsoft.Logic/workflows/logicapp", + callback_url="https://logicapptriggerurl/...", + use_common_alert_schema=True, + )], + sms_receivers=[azure.monitoring.ActionGroupSmsReceiverArgs( + name="oncallmsg", + country_code="1", + phone_number="1231231234", + )], + voice_receivers=[azure.monitoring.ActionGroupVoiceReceiverArgs( + name="remotesupport", + country_code="86", + phone_number="13888888888", + )], + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapiaswell", + service_uri="http://example.com/alert", + use_common_alert_schema=True, + )]) + ``` + ## Import Action Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/action_rule_action_group.py b/sdk/python/pulumi_azure/monitoring/action_rule_action_group.py index 45c74892c5..7b0984dc04 100644 --- a/sdk/python/pulumi_azure/monitoring/action_rule_action_group.py +++ b/sdk/python/pulumi_azure/monitoring/action_rule_action_group.py @@ -364,6 +364,28 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `monitoring.AlertProcessingRuleActionGroup` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_action_rule_action_group = azure.monitoring.ActionRuleActionGroup("exampleActionRuleActionGroup", + resource_group_name=example_resource_group.name, + action_group_id=example_action_group.id, + scope=azure.monitoring.ActionRuleActionGroupScopeArgs( + type="ResourceGroup", + resource_ids=[example_resource_group.id], + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Monitor Action Rule can be imported using the `resource id`, e.g. @@ -394,6 +416,28 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `monitoring.AlertProcessingRuleActionGroup` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_action_rule_action_group = azure.monitoring.ActionRuleActionGroup("exampleActionRuleActionGroup", + resource_group_name=example_resource_group.name, + action_group_id=example_action_group.id, + scope=azure.monitoring.ActionRuleActionGroupScopeArgs( + type="ResourceGroup", + resource_ids=[example_resource_group.id], + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/action_rule_suppression.py b/sdk/python/pulumi_azure/monitoring/action_rule_suppression.py index 40630d3e9f..ab2a711110 100644 --- a/sdk/python/pulumi_azure/monitoring/action_rule_suppression.py +++ b/sdk/python/pulumi_azure/monitoring/action_rule_suppression.py @@ -360,6 +360,37 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `monitoring.AlertProcessingRuleSuppression` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_action_rule_suppression = azure.monitoring.ActionRuleSuppression("exampleActionRuleSuppression", + resource_group_name=example_resource_group.name, + scope=azure.monitoring.ActionRuleSuppressionScopeArgs( + type="ResourceGroup", + resource_ids=[example_resource_group.id], + ), + suppression=azure.monitoring.ActionRuleSuppressionSuppressionArgs( + recurrence_type="Weekly", + schedule=azure.monitoring.ActionRuleSuppressionSuppressionScheduleArgs( + start_date_utc="2019-01-01T01:02:03Z", + end_date_utc="2019-01-03T15:02:07Z", + recurrence_weeklies=[ + "Sunday", + "Monday", + "Friday", + "Saturday", + ], + ), + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Monitor Action Rule can be imported using the `resource id`, e.g. @@ -390,6 +421,37 @@ def __init__(__self__, !> **NOTE:** This resource has been deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use `monitoring.AlertProcessingRuleSuppression` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_action_rule_suppression = azure.monitoring.ActionRuleSuppression("exampleActionRuleSuppression", + resource_group_name=example_resource_group.name, + scope=azure.monitoring.ActionRuleSuppressionScopeArgs( + type="ResourceGroup", + resource_ids=[example_resource_group.id], + ), + suppression=azure.monitoring.ActionRuleSuppressionSuppressionArgs( + recurrence_type="Weekly", + schedule=azure.monitoring.ActionRuleSuppressionSuppressionScheduleArgs( + start_date_utc="2019-01-01T01:02:03Z", + end_date_utc="2019-01-03T15:02:07Z", + recurrence_weeklies=[ + "Sunday", + "Monday", + "Friday", + "Saturday", + ], + ), + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Monitor Action Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/activity_log_alert.py b/sdk/python/pulumi_azure/monitoring/activity_log_alert.py index c865b9a4e5..2b7b364151 100644 --- a/sdk/python/pulumi_azure/monitoring/activity_log_alert.py +++ b/sdk/python/pulumi_azure/monitoring/activity_log_alert.py @@ -359,6 +359,42 @@ def __init__(__self__, """ Manages an Activity Log Alert within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + main_action_group = azure.monitoring.ActionGroup("mainActionGroup", + resource_group_name=example.name, + short_name="p0action", + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapi", + service_uri="http://example.com/alert", + )]) + to_monitor = azure.storage.Account("toMonitor", + resource_group_name=example.name, + location=example.location, + account_tier="Standard", + account_replication_type="GRS") + main_activity_log_alert = azure.monitoring.ActivityLogAlert("mainActivityLogAlert", + resource_group_name=example.name, + scopes=[example.id], + description="This alert will monitor a specific storage account updates.", + criteria=azure.monitoring.ActivityLogAlertCriteriaArgs( + resource_id=to_monitor.id, + operation_name="Microsoft.Storage/storageAccounts/write", + category="Recommendation", + ), + actions=[azure.monitoring.ActivityLogAlertActionArgs( + action_group_id=main_action_group.id, + webhook_properties={ + "from": "source", + }, + )]) + ``` + ## Import Activity log alerts can be imported using the `resource id`, e.g. @@ -387,6 +423,42 @@ def __init__(__self__, """ Manages an Activity Log Alert within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + main_action_group = azure.monitoring.ActionGroup("mainActionGroup", + resource_group_name=example.name, + short_name="p0action", + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapi", + service_uri="http://example.com/alert", + )]) + to_monitor = azure.storage.Account("toMonitor", + resource_group_name=example.name, + location=example.location, + account_tier="Standard", + account_replication_type="GRS") + main_activity_log_alert = azure.monitoring.ActivityLogAlert("mainActivityLogAlert", + resource_group_name=example.name, + scopes=[example.id], + description="This alert will monitor a specific storage account updates.", + criteria=azure.monitoring.ActivityLogAlertCriteriaArgs( + resource_id=to_monitor.id, + operation_name="Microsoft.Storage/storageAccounts/write", + category="Recommendation", + ), + actions=[azure.monitoring.ActivityLogAlertActionArgs( + action_group_id=main_action_group.id, + webhook_properties={ + "from": "source", + }, + )]) + ``` + ## Import Activity log alerts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/alert_processing_rule_action_group.py b/sdk/python/pulumi_azure/monitoring/alert_processing_rule_action_group.py index 1dd36536da..c857c256a8 100644 --- a/sdk/python/pulumi_azure/monitoring/alert_processing_rule_action_group.py +++ b/sdk/python/pulumi_azure/monitoring/alert_processing_rule_action_group.py @@ -400,6 +400,56 @@ def __init__(__self__, """ Manages an Alert Processing Rule which apply action group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="action") + example_alert_processing_rule_action_group = azure.monitoring.AlertProcessingRuleActionGroup("exampleAlertProcessingRuleActionGroup", + resource_group_name="example", + scopes=[example_resource_group.id], + add_action_group_ids=[example_action_group.id], + condition=azure.monitoring.AlertProcessingRuleActionGroupConditionArgs( + target_resource_type=azure.monitoring.AlertProcessingRuleActionGroupConditionTargetResourceTypeArgs( + operator="Equals", + values=["Microsoft.Compute/VirtualMachines"], + ), + severity=azure.monitoring.AlertProcessingRuleActionGroupConditionSeverityArgs( + operator="Equals", + values=[ + "Sev0", + "Sev1", + "Sev2", + ], + ), + ), + schedule=azure.monitoring.AlertProcessingRuleActionGroupScheduleArgs( + effective_from="2022-01-01T01:02:03", + effective_until="2022-02-02T01:02:03", + time_zone="Pacific Standard Time", + recurrence=azure.monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceArgs( + dailies=[azure.monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceDailyArgs( + start_time="17:00:00", + end_time="09:00:00", + )], + weeklies=[azure.monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceWeeklyArgs( + days_of_weeks=[ + "Saturday", + "Sunday", + ], + )], + ), + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Alert Processing Rules can be imported using the `resource id`, e.g. @@ -429,6 +479,56 @@ def __init__(__self__, """ Manages an Alert Processing Rule which apply action group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="action") + example_alert_processing_rule_action_group = azure.monitoring.AlertProcessingRuleActionGroup("exampleAlertProcessingRuleActionGroup", + resource_group_name="example", + scopes=[example_resource_group.id], + add_action_group_ids=[example_action_group.id], + condition=azure.monitoring.AlertProcessingRuleActionGroupConditionArgs( + target_resource_type=azure.monitoring.AlertProcessingRuleActionGroupConditionTargetResourceTypeArgs( + operator="Equals", + values=["Microsoft.Compute/VirtualMachines"], + ), + severity=azure.monitoring.AlertProcessingRuleActionGroupConditionSeverityArgs( + operator="Equals", + values=[ + "Sev0", + "Sev1", + "Sev2", + ], + ), + ), + schedule=azure.monitoring.AlertProcessingRuleActionGroupScheduleArgs( + effective_from="2022-01-01T01:02:03", + effective_until="2022-02-02T01:02:03", + time_zone="Pacific Standard Time", + recurrence=azure.monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceArgs( + dailies=[azure.monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceDailyArgs( + start_time="17:00:00", + end_time="09:00:00", + )], + weeklies=[azure.monitoring.AlertProcessingRuleActionGroupScheduleRecurrenceWeeklyArgs( + days_of_weeks=[ + "Saturday", + "Sunday", + ], + )], + ), + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/alert_processing_rule_suppression.py b/sdk/python/pulumi_azure/monitoring/alert_processing_rule_suppression.py index e31741979e..2a2ab67411 100644 --- a/sdk/python/pulumi_azure/monitoring/alert_processing_rule_suppression.py +++ b/sdk/python/pulumi_azure/monitoring/alert_processing_rule_suppression.py @@ -358,6 +358,52 @@ def __init__(__self__, """ Manages an Alert Processing Rule which suppress notifications. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_alert_processing_rule_suppression = azure.monitoring.AlertProcessingRuleSuppression("exampleAlertProcessingRuleSuppression", + resource_group_name="example", + scopes=[example_resource_group.id], + condition=azure.monitoring.AlertProcessingRuleSuppressionConditionArgs( + target_resource_type=azure.monitoring.AlertProcessingRuleSuppressionConditionTargetResourceTypeArgs( + operator="Equals", + values=["Microsoft.Compute/VirtualMachines"], + ), + severity=azure.monitoring.AlertProcessingRuleSuppressionConditionSeverityArgs( + operator="Equals", + values=[ + "Sev0", + "Sev1", + "Sev2", + ], + ), + ), + schedule=azure.monitoring.AlertProcessingRuleSuppressionScheduleArgs( + effective_from="2022-01-01T01:02:03", + effective_until="2022-02-02T01:02:03", + time_zone="Pacific Standard Time", + recurrence=azure.monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceArgs( + dailies=[azure.monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceDailyArgs( + start_time="17:00:00", + end_time="09:00:00", + )], + weeklies=[azure.monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceWeeklyArgs( + days_of_weeks=[ + "Saturday", + "Sunday", + ], + )], + ), + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Alert Processing Rules can be imported using the `resource id`, e.g. @@ -386,6 +432,52 @@ def __init__(__self__, """ Manages an Alert Processing Rule which suppress notifications. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_alert_processing_rule_suppression = azure.monitoring.AlertProcessingRuleSuppression("exampleAlertProcessingRuleSuppression", + resource_group_name="example", + scopes=[example_resource_group.id], + condition=azure.monitoring.AlertProcessingRuleSuppressionConditionArgs( + target_resource_type=azure.monitoring.AlertProcessingRuleSuppressionConditionTargetResourceTypeArgs( + operator="Equals", + values=["Microsoft.Compute/VirtualMachines"], + ), + severity=azure.monitoring.AlertProcessingRuleSuppressionConditionSeverityArgs( + operator="Equals", + values=[ + "Sev0", + "Sev1", + "Sev2", + ], + ), + ), + schedule=azure.monitoring.AlertProcessingRuleSuppressionScheduleArgs( + effective_from="2022-01-01T01:02:03", + effective_until="2022-02-02T01:02:03", + time_zone="Pacific Standard Time", + recurrence=azure.monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceArgs( + dailies=[azure.monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceDailyArgs( + start_time="17:00:00", + end_time="09:00:00", + )], + weeklies=[azure.monitoring.AlertProcessingRuleSuppressionScheduleRecurrenceWeeklyArgs( + days_of_weeks=[ + "Saturday", + "Sunday", + ], + )], + ), + ), + tags={ + "foo": "bar", + }) + ``` + ## Import Alert Processing Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/autoscale_setting.py b/sdk/python/pulumi_azure/monitoring/autoscale_setting.py index 279ac9a7ef..65ded24247 100644 --- a/sdk/python/pulumi_azure/monitoring/autoscale_setting.py +++ b/sdk/python/pulumi_azure/monitoring/autoscale_setting.py @@ -400,6 +400,229 @@ def __init__(__self__, """ Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + upgrade_mode="Manual", + sku="Standard_F2", + instances=2, + admin_username="myadmin", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="myadmin", + public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + )], + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="TestNetworkProfile", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + )], + )], + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + caching="ReadWrite", + storage_account_type="StandardSSD_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_autoscale_setting = azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + target_resource_id=example_linux_virtual_machine_scale_set.id, + profiles=[azure.monitoring.AutoscaleSettingProfileArgs( + name="defaultProfile", + capacity=azure.monitoring.AutoscaleSettingProfileCapacityArgs( + default=1, + minimum=1, + maximum=10, + ), + rules=[ + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="GreaterThan", + threshold=75, + metric_namespace="microsoft.compute/virtualmachinescalesets", + dimensions=[azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerDimensionArgs( + name="AppName", + operator="Equals", + values=["App1"], + )], + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Increase", + type="ChangeCount", + value=1, + cooldown="PT1M", + ), + ), + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="LessThan", + threshold=25, + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Decrease", + type="ChangeCount", + value=1, + cooldown="PT1M", + ), + ), + ], + )], + predictive=azure.monitoring.AutoscaleSettingPredictiveArgs( + scale_mode="Enabled", + look_ahead_time="PT5M", + ), + notification=azure.monitoring.AutoscaleSettingNotificationArgs( + email=azure.monitoring.AutoscaleSettingNotificationEmailArgs( + send_to_subscription_administrator=True, + send_to_subscription_co_administrator=True, + custom_emails=["admin@contoso.com"], + ), + )) + ``` + ### For Fixed Dates) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + upgrade_mode="Manual", + sku="Standard_F2", + instances=2, + admin_username="myadmin", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="myadmin", + public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + )], + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="TestNetworkProfile", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + )], + )], + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + caching="ReadWrite", + storage_account_type="StandardSSD_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_autoscale_setting = azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", + enabled=True, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + target_resource_id=example_linux_virtual_machine_scale_set.id, + profiles=[azure.monitoring.AutoscaleSettingProfileArgs( + name="forJuly", + capacity=azure.monitoring.AutoscaleSettingProfileCapacityArgs( + default=1, + minimum=1, + maximum=10, + ), + rules=[ + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="GreaterThan", + threshold=90, + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Increase", + type="ChangeCount", + value=2, + cooldown="PT1M", + ), + ), + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="LessThan", + threshold=10, + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Decrease", + type="ChangeCount", + value=2, + cooldown="PT1M", + ), + ), + ], + fixed_date=azure.monitoring.AutoscaleSettingProfileFixedDateArgs( + timezone="Pacific Standard Time", + start="2020-07-01T00:00:00Z", + end="2020-07-31T23:59:59Z", + ), + )], + notification=azure.monitoring.AutoscaleSettingNotificationArgs( + email=azure.monitoring.AutoscaleSettingNotificationEmailArgs( + send_to_subscription_administrator=True, + send_to_subscription_co_administrator=True, + custom_emails=["admin@contoso.com"], + ), + )) + ``` + ## Import AutoScale Setting can be imported using the `resource id`, e.g. @@ -429,6 +652,229 @@ def __init__(__self__, """ Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + upgrade_mode="Manual", + sku="Standard_F2", + instances=2, + admin_username="myadmin", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="myadmin", + public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + )], + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="TestNetworkProfile", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + )], + )], + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + caching="ReadWrite", + storage_account_type="StandardSSD_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_autoscale_setting = azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + target_resource_id=example_linux_virtual_machine_scale_set.id, + profiles=[azure.monitoring.AutoscaleSettingProfileArgs( + name="defaultProfile", + capacity=azure.monitoring.AutoscaleSettingProfileCapacityArgs( + default=1, + minimum=1, + maximum=10, + ), + rules=[ + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="GreaterThan", + threshold=75, + metric_namespace="microsoft.compute/virtualmachinescalesets", + dimensions=[azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerDimensionArgs( + name="AppName", + operator="Equals", + values=["App1"], + )], + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Increase", + type="ChangeCount", + value=1, + cooldown="PT1M", + ), + ), + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="LessThan", + threshold=25, + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Decrease", + type="ChangeCount", + value=1, + cooldown="PT1M", + ), + ), + ], + )], + predictive=azure.monitoring.AutoscaleSettingPredictiveArgs( + scale_mode="Enabled", + look_ahead_time="PT5M", + ), + notification=azure.monitoring.AutoscaleSettingNotificationArgs( + email=azure.monitoring.AutoscaleSettingNotificationEmailArgs( + send_to_subscription_administrator=True, + send_to_subscription_co_administrator=True, + custom_emails=["admin@contoso.com"], + ), + )) + ``` + ### For Fixed Dates) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + upgrade_mode="Manual", + sku="Standard_F2", + instances=2, + admin_username="myadmin", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="myadmin", + public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o29rh4vi5MmHkVgVQHKiKybWlHq+b71gIAUQk9wrJxD+dqt4igrmDSpIjfjwnd+l5UIn5fJSO5DYV4YT/4hwK7OKmuo7OFHD0WyY5YnkYEMtFgzemnRBdE8ulcT60DQpVgRMXFWHvhyCWy0L6sgj1QWDZlLpvsIvNfHsyhKFMG1frLnMt/nP0+YCcfg+v1JYeCKjeoJxB8DWcRBsjzItY0CGmzP8UYZiYKl/2u+2TgFS5r7NWH11bxoUzjKdaa1NLw+ieA8GlBFfCbfWe6YVB9ggUte4VtYFMZGxOjS2bAiYtfgTKFJv+XqORAwExG6+G2eDxIDyo80/OA9IG7Xv/jwQr7D6KDjDuULFcN/iTxuttoKrHeYz1hf5ZQlBdllwJHYx6fK2g8kha6r2JIQKocvsAXiiONqSfw== hello@world.com", + )], + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="TestNetworkProfile", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="TestIPConfiguration", + primary=True, + subnet_id=example_subnet.id, + )], + )], + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + caching="ReadWrite", + storage_account_type="StandardSSD_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_autoscale_setting = azure.monitoring.AutoscaleSetting("exampleAutoscaleSetting", + enabled=True, + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + target_resource_id=example_linux_virtual_machine_scale_set.id, + profiles=[azure.monitoring.AutoscaleSettingProfileArgs( + name="forJuly", + capacity=azure.monitoring.AutoscaleSettingProfileCapacityArgs( + default=1, + minimum=1, + maximum=10, + ), + rules=[ + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="GreaterThan", + threshold=90, + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Increase", + type="ChangeCount", + value=2, + cooldown="PT1M", + ), + ), + azure.monitoring.AutoscaleSettingProfileRuleArgs( + metric_trigger=azure.monitoring.AutoscaleSettingProfileRuleMetricTriggerArgs( + metric_name="Percentage CPU", + metric_resource_id=example_linux_virtual_machine_scale_set.id, + time_grain="PT1M", + statistic="Average", + time_window="PT5M", + time_aggregation="Average", + operator="LessThan", + threshold=10, + ), + scale_action=azure.monitoring.AutoscaleSettingProfileRuleScaleActionArgs( + direction="Decrease", + type="ChangeCount", + value=2, + cooldown="PT1M", + ), + ), + ], + fixed_date=azure.monitoring.AutoscaleSettingProfileFixedDateArgs( + timezone="Pacific Standard Time", + start="2020-07-01T00:00:00Z", + end="2020-07-31T23:59:59Z", + ), + )], + notification=azure.monitoring.AutoscaleSettingNotificationArgs( + email=azure.monitoring.AutoscaleSettingNotificationEmailArgs( + send_to_subscription_administrator=True, + send_to_subscription_co_administrator=True, + custom_emails=["admin@contoso.com"], + ), + )) + ``` + ## Import AutoScale Setting can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/data_collection_endpoint.py b/sdk/python/pulumi_azure/monitoring/data_collection_endpoint.py index 359830ead4..0e217d3a93 100644 --- a/sdk/python/pulumi_azure/monitoring/data_collection_endpoint.py +++ b/sdk/python/pulumi_azure/monitoring/data_collection_endpoint.py @@ -362,6 +362,24 @@ def __init__(__self__, """ Manages a Data Collection Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_data_collection_endpoint = azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + kind="Windows", + public_network_access_enabled=True, + description="monitor_data_collection_endpoint example", + tags={ + "foo": "bar", + }) + ``` + ## Import Data Collection Endpoints can be imported using the `resource id`, e.g. @@ -389,6 +407,24 @@ def __init__(__self__, """ Manages a Data Collection Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_data_collection_endpoint = azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + kind="Windows", + public_network_access_enabled=True, + description="monitor_data_collection_endpoint example", + tags={ + "foo": "bar", + }) + ``` + ## Import Data Collection Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/data_collection_rule.py b/sdk/python/pulumi_azure/monitoring/data_collection_rule.py index ce27dcb951..5831011b46 100644 --- a/sdk/python/pulumi_azure/monitoring/data_collection_rule.py +++ b/sdk/python/pulumi_azure/monitoring/data_collection_rule.py @@ -551,6 +551,169 @@ def __init__(__self__, """ Manages a Data Collection Rule. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="WindowsEventForwarding", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/WindowsEventForwarding", + )) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_data_collection_endpoint = azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_data_collection_rule = azure.monitoring.DataCollectionRule("exampleDataCollectionRule", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + data_collection_endpoint_id=example_data_collection_endpoint.id, + destinations=azure.monitoring.DataCollectionRuleDestinationsArgs( + log_analytics=[azure.monitoring.DataCollectionRuleDestinationsLogAnalyticArgs( + workspace_resource_id=example_analytics_workspace.id, + name="example-destination-log", + )], + event_hub=azure.monitoring.DataCollectionRuleDestinationsEventHubArgs( + event_hub_id=example_event_hub.id, + name="example-destination-eventhub", + ), + storage_blobs=[azure.monitoring.DataCollectionRuleDestinationsStorageBlobArgs( + storage_account_id=example_account.id, + container_name=example_container.name, + name="example-destination-storage", + )], + azure_monitor_metrics=azure.monitoring.DataCollectionRuleDestinationsAzureMonitorMetricsArgs( + name="example-destination-metrics", + ), + ), + data_flows=[ + azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=["Microsoft-InsightsMetrics"], + destinations=["example-destination-metrics"], + ), + azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=[ + "Microsoft-InsightsMetrics", + "Microsoft-Syslog", + "Microsoft-Perf", + ], + destinations=["example-destination-log"], + ), + azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=["Custom-MyTableRawData"], + destinations=["example-destination-log"], + output_stream="Microsoft-Syslog", + transform_kql="source | project TimeGenerated = Time, Computer, Message = AdditionalContext", + ), + ], + data_sources=azure.monitoring.DataCollectionRuleDataSourcesArgs( + syslogs=[azure.monitoring.DataCollectionRuleDataSourcesSyslogArgs( + facility_names=["*"], + log_levels=["*"], + name="example-datasource-syslog", + streams=["Microsoft-Syslog"], + )], + iis_logs=[azure.monitoring.DataCollectionRuleDataSourcesIisLogArgs( + streams=["Microsoft-W3CIISLog"], + name="example-datasource-iis", + log_directories=["C:\\\\Logs\\\\W3SVC1"], + )], + log_files=[azure.monitoring.DataCollectionRuleDataSourcesLogFileArgs( + name="example-datasource-logfile", + format="text", + streams=["Custom-MyTableRawData"], + file_patterns=["C:\\\\JavaLogs\\\\*.log"], + settings=azure.monitoring.DataCollectionRuleDataSourcesLogFileSettingsArgs( + text=azure.monitoring.DataCollectionRuleDataSourcesLogFileSettingsTextArgs( + record_start_timestamp_format="ISO 8601", + ), + ), + )], + performance_counters=[azure.monitoring.DataCollectionRuleDataSourcesPerformanceCounterArgs( + streams=[ + "Microsoft-Perf", + "Microsoft-InsightsMetrics", + ], + sampling_frequency_in_seconds=60, + counter_specifiers=["Processor(*)\\\\% Processor Time"], + name="example-datasource-perfcounter", + )], + windows_event_logs=[azure.monitoring.DataCollectionRuleDataSourcesWindowsEventLogArgs( + streams=["Microsoft-WindowsEvent"], + x_path_queries=["*![System/Level=1]"], + name="example-datasource-wineventlog", + )], + extensions=[azure.monitoring.DataCollectionRuleDataSourcesExtensionArgs( + streams=["Microsoft-WindowsEvent"], + input_data_sources=["example-datasource-wineventlog"], + extension_name="example-extension-name", + extension_json=json.dumps({ + "a": 1, + "b": "hello", + }), + name="example-datasource-extension", + )], + ), + stream_declarations=[azure.monitoring.DataCollectionRuleStreamDeclarationArgs( + stream_name="Custom-MyTableRawData", + columns=[ + azure.monitoring.DataCollectionRuleStreamDeclarationColumnArgs( + name="Time", + type="datetime", + ), + azure.monitoring.DataCollectionRuleStreamDeclarationColumnArgs( + name="Computer", + type="string", + ), + azure.monitoring.DataCollectionRuleStreamDeclarationColumnArgs( + name="AdditionalContext", + type="string", + ), + ], + )], + identity=azure.monitoring.DataCollectionRuleIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + description="data collection rule example", + tags={ + "foo": "bar", + }, + opts=pulumi.ResourceOptions(depends_on=[example_analytics_solution])) + ``` + ## Import Data Collection Rules can be imported using the `resource id`, e.g. @@ -585,6 +748,169 @@ def __init__(__self__, """ Manages a Data Collection Rule. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="WindowsEventForwarding", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/WindowsEventForwarding", + )) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_data_collection_endpoint = azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_data_collection_rule = azure.monitoring.DataCollectionRule("exampleDataCollectionRule", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + data_collection_endpoint_id=example_data_collection_endpoint.id, + destinations=azure.monitoring.DataCollectionRuleDestinationsArgs( + log_analytics=[azure.monitoring.DataCollectionRuleDestinationsLogAnalyticArgs( + workspace_resource_id=example_analytics_workspace.id, + name="example-destination-log", + )], + event_hub=azure.monitoring.DataCollectionRuleDestinationsEventHubArgs( + event_hub_id=example_event_hub.id, + name="example-destination-eventhub", + ), + storage_blobs=[azure.monitoring.DataCollectionRuleDestinationsStorageBlobArgs( + storage_account_id=example_account.id, + container_name=example_container.name, + name="example-destination-storage", + )], + azure_monitor_metrics=azure.monitoring.DataCollectionRuleDestinationsAzureMonitorMetricsArgs( + name="example-destination-metrics", + ), + ), + data_flows=[ + azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=["Microsoft-InsightsMetrics"], + destinations=["example-destination-metrics"], + ), + azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=[ + "Microsoft-InsightsMetrics", + "Microsoft-Syslog", + "Microsoft-Perf", + ], + destinations=["example-destination-log"], + ), + azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=["Custom-MyTableRawData"], + destinations=["example-destination-log"], + output_stream="Microsoft-Syslog", + transform_kql="source | project TimeGenerated = Time, Computer, Message = AdditionalContext", + ), + ], + data_sources=azure.monitoring.DataCollectionRuleDataSourcesArgs( + syslogs=[azure.monitoring.DataCollectionRuleDataSourcesSyslogArgs( + facility_names=["*"], + log_levels=["*"], + name="example-datasource-syslog", + streams=["Microsoft-Syslog"], + )], + iis_logs=[azure.monitoring.DataCollectionRuleDataSourcesIisLogArgs( + streams=["Microsoft-W3CIISLog"], + name="example-datasource-iis", + log_directories=["C:\\\\Logs\\\\W3SVC1"], + )], + log_files=[azure.monitoring.DataCollectionRuleDataSourcesLogFileArgs( + name="example-datasource-logfile", + format="text", + streams=["Custom-MyTableRawData"], + file_patterns=["C:\\\\JavaLogs\\\\*.log"], + settings=azure.monitoring.DataCollectionRuleDataSourcesLogFileSettingsArgs( + text=azure.monitoring.DataCollectionRuleDataSourcesLogFileSettingsTextArgs( + record_start_timestamp_format="ISO 8601", + ), + ), + )], + performance_counters=[azure.monitoring.DataCollectionRuleDataSourcesPerformanceCounterArgs( + streams=[ + "Microsoft-Perf", + "Microsoft-InsightsMetrics", + ], + sampling_frequency_in_seconds=60, + counter_specifiers=["Processor(*)\\\\% Processor Time"], + name="example-datasource-perfcounter", + )], + windows_event_logs=[azure.monitoring.DataCollectionRuleDataSourcesWindowsEventLogArgs( + streams=["Microsoft-WindowsEvent"], + x_path_queries=["*![System/Level=1]"], + name="example-datasource-wineventlog", + )], + extensions=[azure.monitoring.DataCollectionRuleDataSourcesExtensionArgs( + streams=["Microsoft-WindowsEvent"], + input_data_sources=["example-datasource-wineventlog"], + extension_name="example-extension-name", + extension_json=json.dumps({ + "a": 1, + "b": "hello", + }), + name="example-datasource-extension", + )], + ), + stream_declarations=[azure.monitoring.DataCollectionRuleStreamDeclarationArgs( + stream_name="Custom-MyTableRawData", + columns=[ + azure.monitoring.DataCollectionRuleStreamDeclarationColumnArgs( + name="Time", + type="datetime", + ), + azure.monitoring.DataCollectionRuleStreamDeclarationColumnArgs( + name="Computer", + type="string", + ), + azure.monitoring.DataCollectionRuleStreamDeclarationColumnArgs( + name="AdditionalContext", + type="string", + ), + ], + )], + identity=azure.monitoring.DataCollectionRuleIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + description="data collection rule example", + tags={ + "foo": "bar", + }, + opts=pulumi.ResourceOptions(depends_on=[example_analytics_solution])) + ``` + ## Import Data Collection Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/data_collection_rule_association.py b/sdk/python/pulumi_azure/monitoring/data_collection_rule_association.py index a78774636a..2ac54ce1a3 100644 --- a/sdk/python/pulumi_azure/monitoring/data_collection_rule_association.py +++ b/sdk/python/pulumi_azure/monitoring/data_collection_rule_association.py @@ -268,6 +268,74 @@ def __init__(__self__, """ Manages a Data Collection Rule Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_B1ls", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_password="example-Password@7890", + disable_password_authentication=False, + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_data_collection_rule = azure.monitoring.DataCollectionRule("exampleDataCollectionRule", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + destinations=azure.monitoring.DataCollectionRuleDestinationsArgs( + azure_monitor_metrics=azure.monitoring.DataCollectionRuleDestinationsAzureMonitorMetricsArgs( + name="example-destination-metrics", + ), + ), + data_flows=[azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=["Microsoft-InsightsMetrics"], + destinations=["example-destination-metrics"], + )]) + example_data_collection_endpoint = azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + # associate to a Data Collection Rule + example1 = azure.monitoring.DataCollectionRuleAssociation("example1", + target_resource_id=example_linux_virtual_machine.id, + data_collection_rule_id=example_data_collection_rule.id, + description="example") + # associate to a Data Collection Endpoint + example2 = azure.monitoring.DataCollectionRuleAssociation("example2", + target_resource_id=example_linux_virtual_machine.id, + data_collection_endpoint_id=example_data_collection_endpoint.id, + description="example") + ``` + ## Import Data Collection Rules Association can be imported using the `resource id`, e.g. @@ -297,6 +365,74 @@ def __init__(__self__, """ Manages a Data Collection Rule Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_B1ls", + admin_username="adminuser", + network_interface_ids=[example_network_interface.id], + admin_password="example-Password@7890", + disable_password_authentication=False, + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + )) + example_data_collection_rule = azure.monitoring.DataCollectionRule("exampleDataCollectionRule", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + destinations=azure.monitoring.DataCollectionRuleDestinationsArgs( + azure_monitor_metrics=azure.monitoring.DataCollectionRuleDestinationsAzureMonitorMetricsArgs( + name="example-destination-metrics", + ), + ), + data_flows=[azure.monitoring.DataCollectionRuleDataFlowArgs( + streams=["Microsoft-InsightsMetrics"], + destinations=["example-destination-metrics"], + )]) + example_data_collection_endpoint = azure.monitoring.DataCollectionEndpoint("exampleDataCollectionEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + # associate to a Data Collection Rule + example1 = azure.monitoring.DataCollectionRuleAssociation("example1", + target_resource_id=example_linux_virtual_machine.id, + data_collection_rule_id=example_data_collection_rule.id, + description="example") + # associate to a Data Collection Endpoint + example2 = azure.monitoring.DataCollectionRuleAssociation("example2", + target_resource_id=example_linux_virtual_machine.id, + data_collection_endpoint_id=example_data_collection_endpoint.id, + description="example") + ``` + ## Import Data Collection Rules Association can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/diagnostic_setting.py b/sdk/python/pulumi_azure/monitoring/diagnostic_setting.py index 28e870d086..1b4bca6d6d 100644 --- a/sdk/python/pulumi_azure/monitoring/diagnostic_setting.py +++ b/sdk/python/pulumi_azure/monitoring/diagnostic_setting.py @@ -596,6 +596,43 @@ def __init__(__self__, """ Manages a Diagnostic Setting for an existing Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard") + example_diagnostic_setting = azure.monitoring.DiagnosticSetting("exampleDiagnosticSetting", + target_resource_id=example_key_vault.id, + storage_account_id=example_account.id, + enabled_logs=[azure.monitoring.DiagnosticSettingEnabledLogArgs( + category="AuditEvent", + retention_policy=azure.monitoring.DiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=False, + ), + )], + metrics=[azure.monitoring.DiagnosticSettingMetricArgs( + category="AllMetrics", + retention_policy=azure.monitoring.DiagnosticSettingMetricRetentionPolicyArgs( + enabled=False, + ), + )]) + ``` + ## Import Diagnostic Settings can be imported using the `resource id`, e.g. @@ -649,6 +686,43 @@ def __init__(__self__, """ Manages a Diagnostic Setting for an existing Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard") + example_diagnostic_setting = azure.monitoring.DiagnosticSetting("exampleDiagnosticSetting", + target_resource_id=example_key_vault.id, + storage_account_id=example_account.id, + enabled_logs=[azure.monitoring.DiagnosticSettingEnabledLogArgs( + category="AuditEvent", + retention_policy=azure.monitoring.DiagnosticSettingEnabledLogRetentionPolicyArgs( + enabled=False, + ), + )], + metrics=[azure.monitoring.DiagnosticSettingMetricArgs( + category="AllMetrics", + retention_policy=azure.monitoring.DiagnosticSettingMetricRetentionPolicyArgs( + enabled=False, + ), + )]) + ``` + ## Import Diagnostic Settings can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/get_action_group.py b/sdk/python/pulumi_azure/monitoring/get_action_group.py index 8514c8e0ab..18fe7dd35b 100644 --- a/sdk/python/pulumi_azure/monitoring/get_action_group.py +++ b/sdk/python/pulumi_azure/monitoring/get_action_group.py @@ -228,6 +228,17 @@ def get_action_group(name: Optional[str] = None, """ Use this data source to access the properties of an Action Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_action_group(resource_group_name="example-rg", + name="tfex-actiongroup") + pulumi.export("actionGroupId", example.id) + ``` + :param str name: Specifies the name of the Action Group. :param str resource_group_name: Specifies the name of the resource group the Action Group is located in. @@ -264,6 +275,17 @@ def get_action_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access the properties of an Action Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_action_group(resource_group_name="example-rg", + name="tfex-actiongroup") + pulumi.export("actionGroupId", example.id) + ``` + :param str name: Specifies the name of the Action Group. :param str resource_group_name: Specifies the name of the resource group the Action Group is located in. diff --git a/sdk/python/pulumi_azure/monitoring/get_data_collection_endpoint.py b/sdk/python/pulumi_azure/monitoring/get_data_collection_endpoint.py index e446464043..e4ea5b8afb 100644 --- a/sdk/python/pulumi_azure/monitoring/get_data_collection_endpoint.py +++ b/sdk/python/pulumi_azure/monitoring/get_data_collection_endpoint.py @@ -152,6 +152,17 @@ def get_data_collection_endpoint(name: Optional[str] = None, """ Use this data source to access information about an existing Data Collection Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_data_collection_endpoint(name="example-mdce", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("endpointId", example.id) + ``` + :param str name: Specifies the name of the Data Collection Endpoint. :param str resource_group_name: Specifies the name of the resource group the Data Collection Endpoint is located in. @@ -182,6 +193,17 @@ def get_data_collection_endpoint_output(name: Optional[pulumi.Input[str]] = None """ Use this data source to access information about an existing Data Collection Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_data_collection_endpoint(name="example-mdce", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("endpointId", example.id) + ``` + :param str name: Specifies the name of the Data Collection Endpoint. :param str resource_group_name: Specifies the name of the resource group the Data Collection Endpoint is located in. diff --git a/sdk/python/pulumi_azure/monitoring/get_data_collection_rule.py b/sdk/python/pulumi_azure/monitoring/get_data_collection_rule.py index 0c8d363c4e..2f3f0cfa69 100644 --- a/sdk/python/pulumi_azure/monitoring/get_data_collection_rule.py +++ b/sdk/python/pulumi_azure/monitoring/get_data_collection_rule.py @@ -201,6 +201,17 @@ def get_data_collection_rule(name: Optional[str] = None, """ Use this data source to access information about an existing Data Collection Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_data_collection_rule(name="example-rule", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("ruleId", example.id) + ``` + :param str name: Specifies the name of the Data Collection Rule. :param str resource_group_name: Specifies the name of the resource group the Data Collection Rule is located in. @@ -235,6 +246,17 @@ def get_data_collection_rule_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Data Collection Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_data_collection_rule(name="example-rule", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("ruleId", example.id) + ``` + :param str name: Specifies the name of the Data Collection Rule. :param str resource_group_name: Specifies the name of the resource group the Data Collection Rule is located in. diff --git a/sdk/python/pulumi_azure/monitoring/get_diagnostic_categories.py b/sdk/python/pulumi_azure/monitoring/get_diagnostic_categories.py index 1fe4350146..c1ae942de8 100644 --- a/sdk/python/pulumi_azure/monitoring/get_diagnostic_categories.py +++ b/sdk/python/pulumi_azure/monitoring/get_diagnostic_categories.py @@ -109,6 +109,17 @@ def get_diagnostic_categories(resource_id: Optional[str] = None, """ Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name=azurerm_key_vault["example"]["name"], + resource_group_name=azurerm_key_vault["example"]["resource_group_name"]) + example_diagnostic_categories = azure.monitoring.get_diagnostic_categories(resource_id=example_key_vault.id) + ``` + :param str resource_id: The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for. """ @@ -132,6 +143,17 @@ def get_diagnostic_categories_output(resource_id: Optional[pulumi.Input[str]] = """ Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_key_vault = azure.keyvault.get_key_vault(name=azurerm_key_vault["example"]["name"], + resource_group_name=azurerm_key_vault["example"]["resource_group_name"]) + example_diagnostic_categories = azure.monitoring.get_diagnostic_categories(resource_id=example_key_vault.id) + ``` + :param str resource_id: The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for. """ diff --git a/sdk/python/pulumi_azure/monitoring/get_log_profile.py b/sdk/python/pulumi_azure/monitoring/get_log_profile.py index 224d78fed3..4b321775dd 100644 --- a/sdk/python/pulumi_azure/monitoring/get_log_profile.py +++ b/sdk/python/pulumi_azure/monitoring/get_log_profile.py @@ -121,6 +121,16 @@ def get_log_profile(name: Optional[str] = None, !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_log_profile(name="test-logprofile") + pulumi.export("logProfileStorageAccountId", example.storage_account_id) + ``` + :param str name: Specifies the Name of the Log Profile. """ @@ -147,6 +157,16 @@ def get_log_profile_output(name: Optional[pulumi.Input[str]] = None, !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_log_profile(name="test-logprofile") + pulumi.export("logProfileStorageAccountId", example.storage_account_id) + ``` + :param str name: Specifies the Name of the Log Profile. """ diff --git a/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_alert.py b/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_alert.py index e15d56c6f6..7aac4b433c 100644 --- a/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_alert.py +++ b/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_alert.py @@ -234,6 +234,17 @@ def get_scheduled_query_rules_alert(name: Optional[str] = None, """ Use this data source to access the properties of an AlertingAction scheduled query rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_scheduled_query_rules_alert(resource_group_name="example-rg", + name="tfex-queryrule") + pulumi.export("queryRuleId", example.id) + ``` + :param str name: Specifies the name of the scheduled query rule. :param str resource_group_name: Specifies the name of the resource group where the scheduled query rule is located. @@ -271,6 +282,17 @@ def get_scheduled_query_rules_alert_output(name: Optional[pulumi.Input[str]] = N """ Use this data source to access the properties of an AlertingAction scheduled query rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_scheduled_query_rules_alert(resource_group_name="example-rg", + name="tfex-queryrule") + pulumi.export("queryRuleId", example.id) + ``` + :param str name: Specifies the name of the scheduled query rule. :param str resource_group_name: Specifies the name of the resource group where the scheduled query rule is located. diff --git a/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_log.py b/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_log.py index a8ef356c40..96e29ce897 100644 --- a/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_log.py +++ b/sdk/python/pulumi_azure/monitoring/get_scheduled_query_rules_log.py @@ -153,6 +153,17 @@ def get_scheduled_query_rules_log(name: Optional[str] = None, """ Use this data source to access the properties of a LogToMetricAction scheduled query rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_scheduled_query_rules_log(resource_group_name="example-rg", + name="tfex-queryrule") + pulumi.export("queryRuleId", example.id) + ``` + :param str name: Specifies the name of the scheduled query rule. :param str resource_group_name: Specifies the name of the resource group where the scheduled query rule is located. @@ -183,6 +194,17 @@ def get_scheduled_query_rules_log_output(name: Optional[pulumi.Input[str]] = Non """ Use this data source to access the properties of a LogToMetricAction scheduled query rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.monitoring.get_scheduled_query_rules_log(resource_group_name="example-rg", + name="tfex-queryrule") + pulumi.export("queryRuleId", example.id) + ``` + :param str name: Specifies the name of the scheduled query rule. :param str resource_group_name: Specifies the name of the resource group where the scheduled query rule is located. diff --git a/sdk/python/pulumi_azure/monitoring/log_profile.py b/sdk/python/pulumi_azure/monitoring/log_profile.py index 394cc797c4..a2d2428bb4 100644 --- a/sdk/python/pulumi_azure/monitoring/log_profile.py +++ b/sdk/python/pulumi_azure/monitoring/log_profile.py @@ -297,6 +297,41 @@ def __init__(__self__, !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=2) + example_log_profile = azure.monitoring.LogProfile("exampleLogProfile", + categories=[ + "Action", + "Delete", + "Write", + ], + locations=[ + "westus", + "global", + ], + servicebus_rule_id=example_event_hub_namespace.id.apply(lambda id: f"{id}/authorizationrules/RootManageSharedAccessKey"), + storage_account_id=example_account.id, + retention_policy=azure.monitoring.LogProfileRetentionPolicyArgs( + enabled=True, + days=7, + )) + ``` + ## Import A Log Profile can be imported using the `resource id`, e.g. @@ -327,6 +362,41 @@ def __init__(__self__, !> **NOTE:** Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found [in the Azure documentation](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log?tabs=powershell#legacy-collection-methods). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=2) + example_log_profile = azure.monitoring.LogProfile("exampleLogProfile", + categories=[ + "Action", + "Delete", + "Write", + ], + locations=[ + "westus", + "global", + ], + servicebus_rule_id=example_event_hub_namespace.id.apply(lambda id: f"{id}/authorizationrules/RootManageSharedAccessKey"), + storage_account_id=example_account.id, + retention_policy=azure.monitoring.LogProfileRetentionPolicyArgs( + enabled=True, + days=7, + )) + ``` + ## Import A Log Profile can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/logz_monitor.py b/sdk/python/pulumi_azure/monitoring/logz_monitor.py index 40f0d96715..e5fb7e336f 100644 --- a/sdk/python/pulumi_azure/monitoring/logz_monitor.py +++ b/sdk/python/pulumi_azure/monitoring/logz_monitor.py @@ -452,6 +452,29 @@ def __init__(__self__, """ Manages a logz Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + ``` + ## Import logz Monitors can be imported using the `resource id`, e.g. @@ -483,6 +506,29 @@ def __init__(__self__, """ Manages a logz Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + ``` + ## Import logz Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/logz_sub_account.py b/sdk/python/pulumi_azure/monitoring/logz_sub_account.py index 7adee06e14..6726ef075b 100644 --- a/sdk/python/pulumi_azure/monitoring/logz_sub_account.py +++ b/sdk/python/pulumi_azure/monitoring/logz_sub_account.py @@ -247,6 +247,37 @@ def __init__(__self__, """ Manages a logz Sub Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_logz_sub_account = azure.monitoring.LogzSubAccount("exampleLogzSubAccount", + logz_monitor_id=example_logz_monitor.id, + user=azure.monitoring.LogzSubAccountUserArgs( + email=example_logz_monitor.user.email, + first_name=example_logz_monitor.user.first_name, + last_name=example_logz_monitor.user.last_name, + phone_number=example_logz_monitor.user.phone_number, + )) + ``` + ## Import logz SubAccounts can be imported using the `resource id`, e.g. @@ -272,6 +303,37 @@ def __init__(__self__, """ Manages a logz Sub Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_logz_sub_account = azure.monitoring.LogzSubAccount("exampleLogzSubAccount", + logz_monitor_id=example_logz_monitor.id, + user=azure.monitoring.LogzSubAccountUserArgs( + email=example_logz_monitor.user.email, + first_name=example_logz_monitor.user.first_name, + last_name=example_logz_monitor.user.last_name, + phone_number=example_logz_monitor.user.phone_number, + )) + ``` + ## Import logz SubAccounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/logz_sub_account_tag_rule.py b/sdk/python/pulumi_azure/monitoring/logz_sub_account_tag_rule.py index 8171179b89..8bdea47f04 100644 --- a/sdk/python/pulumi_azure/monitoring/logz_sub_account_tag_rule.py +++ b/sdk/python/pulumi_azure/monitoring/logz_sub_account_tag_rule.py @@ -262,6 +262,54 @@ def __init__(__self__, """ Manages a Logz Sub Account Tag Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_logz_sub_account = azure.monitoring.LogzSubAccount("exampleLogzSubAccount", + logz_monitor_id=example_logz_monitor.id, + user=azure.monitoring.LogzSubAccountUserArgs( + email=example_logz_monitor.user.email, + first_name=example_logz_monitor.user.first_name, + last_name=example_logz_monitor.user.last_name, + phone_number=example_logz_monitor.user.phone_number, + )) + example_logz_sub_account_tag_rule = azure.monitoring.LogzSubAccountTagRule("exampleLogzSubAccountTagRule", + logz_sub_account_id=example_logz_sub_account.id, + send_aad_logs=True, + send_activity_logs=True, + send_subscription_logs=True, + tag_filters=[ + azure.monitoring.LogzSubAccountTagRuleTagFilterArgs( + name="name1", + action="Include", + value="value1", + ), + azure.monitoring.LogzSubAccountTagRuleTagFilterArgs( + name="name2", + action="Exclude", + value="value2", + ), + ]) + ``` + ## Import Logz Sub Account Tag Rules can be imported using the `resource id`, e.g. @@ -287,6 +335,54 @@ def __init__(__self__, """ Manages a Logz Sub Account Tag Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_logz_sub_account = azure.monitoring.LogzSubAccount("exampleLogzSubAccount", + logz_monitor_id=example_logz_monitor.id, + user=azure.monitoring.LogzSubAccountUserArgs( + email=example_logz_monitor.user.email, + first_name=example_logz_monitor.user.first_name, + last_name=example_logz_monitor.user.last_name, + phone_number=example_logz_monitor.user.phone_number, + )) + example_logz_sub_account_tag_rule = azure.monitoring.LogzSubAccountTagRule("exampleLogzSubAccountTagRule", + logz_sub_account_id=example_logz_sub_account.id, + send_aad_logs=True, + send_activity_logs=True, + send_subscription_logs=True, + tag_filters=[ + azure.monitoring.LogzSubAccountTagRuleTagFilterArgs( + name="name1", + action="Include", + value="value1", + ), + azure.monitoring.LogzSubAccountTagRuleTagFilterArgs( + name="name2", + action="Exclude", + value="value2", + ), + ]) + ``` + ## Import Logz Sub Account Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/logz_tag_rule.py b/sdk/python/pulumi_azure/monitoring/logz_tag_rule.py index 06c61dbc34..c8de455946 100644 --- a/sdk/python/pulumi_azure/monitoring/logz_tag_rule.py +++ b/sdk/python/pulumi_azure/monitoring/logz_tag_rule.py @@ -262,6 +262,46 @@ def __init__(__self__, """ Manages a logz Tag Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_logz_tag_rule = azure.monitoring.LogzTagRule("exampleLogzTagRule", + logz_monitor_id=example_logz_monitor.id, + tag_filters=[ + azure.monitoring.LogzTagRuleTagFilterArgs( + name="name1", + action="Include", + value="value1", + ), + azure.monitoring.LogzTagRuleTagFilterArgs( + name="name2", + action="Exclude", + value="value2", + ), + ], + send_aad_logs=True, + send_activity_logs=True, + send_subscription_logs=True) + ``` + ## Import logz Tag Rules can be imported using the `resource id`, e.g. @@ -287,6 +327,46 @@ def __init__(__self__, """ Manages a logz Tag Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.monitoring.LogzMonitorPlanArgs( + billing_cycle="MONTHLY", + effective_date="2022-06-06T00:00:00Z", + usage_type="COMMITTED", + ), + user=azure.monitoring.LogzMonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_logz_tag_rule = azure.monitoring.LogzTagRule("exampleLogzTagRule", + logz_monitor_id=example_logz_monitor.id, + tag_filters=[ + azure.monitoring.LogzTagRuleTagFilterArgs( + name="name1", + action="Include", + value="value1", + ), + azure.monitoring.LogzTagRuleTagFilterArgs( + name="name2", + action="Exclude", + value="value2", + ), + ], + send_aad_logs=True, + send_activity_logs=True, + send_subscription_logs=True) + ``` + ## Import logz Tag Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/metric_alert.py b/sdk/python/pulumi_azure/monitoring/metric_alert.py index df41533a92..4460954a33 100644 --- a/sdk/python/pulumi_azure/monitoring/metric_alert.py +++ b/sdk/python/pulumi_azure/monitoring/metric_alert.py @@ -718,6 +718,46 @@ def __init__(__self__, """ Manages a Metric Alert within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + to_monitor = azure.storage.Account("toMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + main = azure.monitoring.ActionGroup("main", + resource_group_name=example_resource_group.name, + short_name="exampleact", + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapi", + service_uri="http://example.com/alert", + )]) + example_metric_alert = azure.monitoring.MetricAlert("exampleMetricAlert", + resource_group_name=example_resource_group.name, + scopes=[to_monitor.id], + description="Action will be triggered when Transactions count is greater than 50.", + criterias=[azure.monitoring.MetricAlertCriteriaArgs( + metric_namespace="Microsoft.Storage/storageAccounts", + metric_name="Transactions", + aggregation="Total", + operator="GreaterThan", + threshold=50, + dimensions=[azure.monitoring.MetricAlertCriteriaDimensionArgs( + name="ApiName", + operator="Include", + values=["*"], + )], + )], + actions=[azure.monitoring.MetricAlertActionArgs( + action_group_id=main.id, + )]) + ``` + ## Import Metric Alerts can be imported using the `resource id`, e.g. @@ -764,6 +804,46 @@ def __init__(__self__, """ Manages a Metric Alert within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + to_monitor = azure.storage.Account("toMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + main = azure.monitoring.ActionGroup("main", + resource_group_name=example_resource_group.name, + short_name="exampleact", + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapi", + service_uri="http://example.com/alert", + )]) + example_metric_alert = azure.monitoring.MetricAlert("exampleMetricAlert", + resource_group_name=example_resource_group.name, + scopes=[to_monitor.id], + description="Action will be triggered when Transactions count is greater than 50.", + criterias=[azure.monitoring.MetricAlertCriteriaArgs( + metric_namespace="Microsoft.Storage/storageAccounts", + metric_name="Transactions", + aggregation="Total", + operator="GreaterThan", + threshold=50, + dimensions=[azure.monitoring.MetricAlertCriteriaDimensionArgs( + name="ApiName", + operator="Include", + values=["*"], + )], + )], + actions=[azure.monitoring.MetricAlertActionArgs( + action_group_id=main.id, + )]) + ``` + ## Import Metric Alerts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/private_link_scope.py b/sdk/python/pulumi_azure/monitoring/private_link_scope.py index 57e38b71f2..ee0b705580 100644 --- a/sdk/python/pulumi_azure/monitoring/private_link_scope.py +++ b/sdk/python/pulumi_azure/monitoring/private_link_scope.py @@ -170,6 +170,16 @@ def __init__(__self__, """ Manages an Azure Monitor Private Link Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_link_scope = azure.monitoring.PrivateLinkScope("examplePrivateLinkScope", resource_group_name=example_resource_group.name) + ``` + ## Import Azure Monitor Private Link Scopes can be imported using the `resource id`, e.g. @@ -193,6 +203,16 @@ def __init__(__self__, """ Manages an Azure Monitor Private Link Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_private_link_scope = azure.monitoring.PrivateLinkScope("examplePrivateLinkScope", resource_group_name=example_resource_group.name) + ``` + ## Import Azure Monitor Private Link Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/private_link_scoped_service.py b/sdk/python/pulumi_azure/monitoring/private_link_scoped_service.py index ac622d1379..197f93b5d1 100644 --- a/sdk/python/pulumi_azure/monitoring/private_link_scoped_service.py +++ b/sdk/python/pulumi_azure/monitoring/private_link_scoped_service.py @@ -217,6 +217,24 @@ def __init__(__self__, """ Manages an Azure Monitor Private Link Scoped Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_private_link_scope = azure.monitoring.PrivateLinkScope("examplePrivateLinkScope", resource_group_name=example_resource_group.name) + example_private_link_scoped_service = azure.monitoring.PrivateLinkScopedService("examplePrivateLinkScopedService", + resource_group_name=example_resource_group.name, + scope_name=example_private_link_scope.name, + linked_resource_id=example_insights.id) + ``` + ## Import Azure Monitor Private Link Scoped Services can be imported using the `resource id`, e.g. @@ -241,6 +259,24 @@ def __init__(__self__, """ Manages an Azure Monitor Private Link Scoped Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_private_link_scope = azure.monitoring.PrivateLinkScope("examplePrivateLinkScope", resource_group_name=example_resource_group.name) + example_private_link_scoped_service = azure.monitoring.PrivateLinkScopedService("examplePrivateLinkScopedService", + resource_group_name=example_resource_group.name, + scope_name=example_private_link_scope.name, + linked_resource_id=example_insights.id) + ``` + ## Import Azure Monitor Private Link Scoped Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/scheduled_query_rules_log.py b/sdk/python/pulumi_azure/monitoring/scheduled_query_rules_log.py index 64cac2b6bf..4f662d94d0 100644 --- a/sdk/python/pulumi_azure/monitoring/scheduled_query_rules_log.py +++ b/sdk/python/pulumi_azure/monitoring/scheduled_query_rules_log.py @@ -404,6 +404,62 @@ def __init__(__self__, """ Manages a LogToMetricAction Scheduled Query Rules resource within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="exampleact", + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapi", + service_uri="http://example.com/alert", + )]) + # Example: Creates alert using the new Scheduled Query Rules metric + example_metric_alert = azure.monitoring.MetricAlert("exampleMetricAlert", + resource_group_name=example_resource_group.name, + scopes=[example_analytics_workspace.id], + description="Action will be triggered when Average_% Idle Time metric is less than 10.", + frequency="PT1M", + window_size="PT5M", + criterias=[azure.monitoring.MetricAlertCriteriaArgs( + metric_namespace="Microsoft.OperationalInsights/workspaces", + metric_name="UsedCapacity", + aggregation="Average", + operator="LessThan", + threshold=10, + )], + actions=[azure.monitoring.MetricAlertActionArgs( + action_group_id=example_action_group.id, + )]) + # Example: LogToMetric Action for the named Computer + example_scheduled_query_rules_log = azure.monitoring.ScheduledQueryRulesLog("exampleScheduledQueryRulesLog", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + criteria=azure.monitoring.ScheduledQueryRulesLogCriteriaArgs( + metric_name="Average_% Idle Time", + dimensions=[azure.monitoring.ScheduledQueryRulesLogCriteriaDimensionArgs( + name="Computer", + operator="Include", + values=["targetVM"], + )], + ), + data_source_id=example_analytics_workspace.id, + description="Scheduled query rule LogToMetric example", + enabled=True, + tags={ + "foo": "bar", + }) + ``` + ## Import Scheduled Query Rule Log can be imported using the `resource id`, e.g. @@ -433,6 +489,62 @@ def __init__(__self__, """ Manages a LogToMetricAction Scheduled Query Rules resource within Azure Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="exampleact", + webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs( + name="callmyapi", + service_uri="http://example.com/alert", + )]) + # Example: Creates alert using the new Scheduled Query Rules metric + example_metric_alert = azure.monitoring.MetricAlert("exampleMetricAlert", + resource_group_name=example_resource_group.name, + scopes=[example_analytics_workspace.id], + description="Action will be triggered when Average_% Idle Time metric is less than 10.", + frequency="PT1M", + window_size="PT5M", + criterias=[azure.monitoring.MetricAlertCriteriaArgs( + metric_namespace="Microsoft.OperationalInsights/workspaces", + metric_name="UsedCapacity", + aggregation="Average", + operator="LessThan", + threshold=10, + )], + actions=[azure.monitoring.MetricAlertActionArgs( + action_group_id=example_action_group.id, + )]) + # Example: LogToMetric Action for the named Computer + example_scheduled_query_rules_log = azure.monitoring.ScheduledQueryRulesLog("exampleScheduledQueryRulesLog", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + criteria=azure.monitoring.ScheduledQueryRulesLogCriteriaArgs( + metric_name="Average_% Idle Time", + dimensions=[azure.monitoring.ScheduledQueryRulesLogCriteriaDimensionArgs( + name="Computer", + operator="Include", + values=["targetVM"], + )], + ), + data_source_id=example_analytics_workspace.id, + description="Scheduled query rule LogToMetric example", + enabled=True, + tags={ + "foo": "bar", + }) + ``` + ## Import Scheduled Query Rule Log can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/smart_detector_alert_rule.py b/sdk/python/pulumi_azure/monitoring/smart_detector_alert_rule.py index b88f239153..b50a929899 100644 --- a/sdk/python/pulumi_azure/monitoring/smart_detector_alert_rule.py +++ b/sdk/python/pulumi_azure/monitoring/smart_detector_alert_rule.py @@ -489,6 +489,31 @@ def __init__(__self__, """ Manages an Monitor Smart Detector Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_smart_detector_alert_rule = azure.monitoring.SmartDetectorAlertRule("exampleSmartDetectorAlertRule", + resource_group_name=example_resource_group.name, + severity="Sev0", + scope_resource_ids=[example_insights.id], + frequency="PT1M", + detector_type="FailureAnomaliesDetector", + action_group=azure.monitoring.SmartDetectorAlertRuleActionGroupArgs( + ids=[example_action_group.id], + )) + ``` + ## Import Monitor Smart Detector Alert Rule can be imported using the `resource id`, e.g. @@ -520,6 +545,31 @@ def __init__(__self__, """ Manages an Monitor Smart Detector Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_insights = azure.appinsights.Insights("exampleInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + application_type="web") + example_action_group = azure.monitoring.ActionGroup("exampleActionGroup", + resource_group_name=example_resource_group.name, + short_name="example") + example_smart_detector_alert_rule = azure.monitoring.SmartDetectorAlertRule("exampleSmartDetectorAlertRule", + resource_group_name=example_resource_group.name, + severity="Sev0", + scope_resource_ids=[example_insights.id], + frequency="PT1M", + detector_type="FailureAnomaliesDetector", + action_group=azure.monitoring.SmartDetectorAlertRuleActionGroupArgs( + ids=[example_action_group.id], + )) + ``` + ## Import Monitor Smart Detector Alert Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/monitoring/workspace.py b/sdk/python/pulumi_azure/monitoring/workspace.py index 5fd7f0b0d5..5ccde5cc24 100644 --- a/sdk/python/pulumi_azure/monitoring/workspace.py +++ b/sdk/python/pulumi_azure/monitoring/workspace.py @@ -248,6 +248,21 @@ def __init__(__self__, """ Manages an Azure Monitor Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workspace = azure.monitoring.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location="West Europe", + tags={ + "key": "value", + }) + ``` + ## Import Azure Monitor Workspace can be imported using the `resource id`, e.g. @@ -273,6 +288,21 @@ def __init__(__self__, """ Manages an Azure Monitor Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_workspace = azure.monitoring.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location="West Europe", + tags={ + "key": "value", + }) + ``` + ## Import Azure Monitor Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/msi/user_assigned_identity.py b/sdk/python/pulumi_azure/msi/user_assigned_identity.py index a363f466b9..3cdf322d11 100644 --- a/sdk/python/pulumi_azure/msi/user_assigned_identity.py +++ b/sdk/python/pulumi_azure/msi/user_assigned_identity.py @@ -274,6 +274,18 @@ def __init__(__self__, Manages a User Assigned Identity. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. @@ -302,6 +314,18 @@ def __init__(__self__, Manages a User Assigned Identity. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import An existing User Assigned Identity can be imported into Terraform using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/database.py b/sdk/python/pulumi_azure/mssql/database.py index fad1d2fd13..770ee4e724 100644 --- a/sdk/python/pulumi_azure/mssql/database.py +++ b/sdk/python/pulumi_azure/mssql/database.py @@ -1249,6 +1249,37 @@ def __init__(__self__, """ Manages a MS SQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + test = azure.mssql.Database("test", + server_id=example_server.id, + collation="SQL_Latin1_General_CP1_CI_AS", + license_type="LicenseIncluded", + max_size_gb=4, + read_scale=True, + sku_name="S0", + zone_redundant=True, + tags={ + "foo": "bar", + }) + ``` + ## Import SQL Database can be imported using the `resource id`, e.g. @@ -1311,6 +1342,37 @@ def __init__(__self__, """ Manages a MS SQL Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + test = azure.mssql.Database("test", + server_id=example_server.id, + collation="SQL_Latin1_General_CP1_CI_AS", + license_type="LicenseIncluded", + max_size_gb=4, + read_scale=True, + sku_name="S0", + zone_redundant=True, + tags={ + "foo": "bar", + }) + ``` + ## Import SQL Database can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/database_extended_auditing_policy.py b/sdk/python/pulumi_azure/mssql/database_extended_auditing_policy.py index 0debb1ccdf..97b60dfd2e 100644 --- a/sdk/python/pulumi_azure/mssql/database_extended_auditing_policy.py +++ b/sdk/python/pulumi_azure/mssql/database_extended_auditing_policy.py @@ -338,6 +338,33 @@ def __init__(__self__, """ Manages a MS SQL Database Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_database = azure.mssql.Database("exampleDatabase", server_id=example_server.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_database_extended_auditing_policy = azure.mssql.DatabaseExtendedAuditingPolicy("exampleDatabaseExtendedAuditingPolicy", + database_id=example_database.id, + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ## Import MS SQL Database Extended Auditing Policies can be imported using the `resource id`, e.g. @@ -366,6 +393,33 @@ def __init__(__self__, """ Manages a MS SQL Database Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_database = azure.mssql.Database("exampleDatabase", server_id=example_server.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_database_extended_auditing_policy = azure.mssql.DatabaseExtendedAuditingPolicy("exampleDatabaseExtendedAuditingPolicy", + database_id=example_database.id, + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ## Import MS SQL Database Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/database_vulnerability_assessment_rule_baseline.py b/sdk/python/pulumi_azure/mssql/database_vulnerability_assessment_rule_baseline.py index 31cd98dca2..8fc2c60b7f 100644 --- a/sdk/python/pulumi_azure/mssql/database_vulnerability_assessment_rule_baseline.py +++ b/sdk/python/pulumi_azure/mssql/database_vulnerability_assessment_rule_baseline.py @@ -267,6 +267,63 @@ def __init__(__self__, > **NOTE** Database Vulnerability Assessment is currently only available for MS SQL databases. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_server_security_alert_policy = azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + state="Enabled") + example_database = azure.sql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + location=example_resource_group.location, + edition="Standard") + example_server_vulnerability_assessment = azure.mssql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", + server_security_alert_policy_id=example_server_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key) + example_database_vulnerability_assessment_rule_baseline = azure.mssql.DatabaseVulnerabilityAssessmentRuleBaseline("exampleDatabaseVulnerabilityAssessmentRuleBaseline", + server_vulnerability_assessment_id=example_server_vulnerability_assessment.id, + database_name=example_database.name, + rule_id="VA2065", + baseline_name="master", + baseline_results=[ + azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs( + results=[ + "allowedip1", + "123.123.123.123", + "123.123.123.123", + ], + ), + azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs( + results=[ + "allowedip2", + "255.255.255.255", + "255.255.255.255", + ], + ), + ]) + ``` + ## Import Database Vulnerability Assessment Rule Baseline can be imported using the `resource id`, e.g. @@ -294,6 +351,63 @@ def __init__(__self__, > **NOTE** Database Vulnerability Assessment is currently only available for MS SQL databases. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_server_security_alert_policy = azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + state="Enabled") + example_database = azure.sql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + location=example_resource_group.location, + edition="Standard") + example_server_vulnerability_assessment = azure.mssql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", + server_security_alert_policy_id=example_server_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key) + example_database_vulnerability_assessment_rule_baseline = azure.mssql.DatabaseVulnerabilityAssessmentRuleBaseline("exampleDatabaseVulnerabilityAssessmentRuleBaseline", + server_vulnerability_assessment_id=example_server_vulnerability_assessment.id, + database_name=example_database.name, + rule_id="VA2065", + baseline_name="master", + baseline_results=[ + azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs( + results=[ + "allowedip1", + "123.123.123.123", + "123.123.123.123", + ], + ), + azure.mssql.DatabaseVulnerabilityAssessmentRuleBaselineBaselineResultArgs( + results=[ + "allowedip2", + "255.255.255.255", + "255.255.255.255", + ], + ), + ]) + ``` + ## Import Database Vulnerability Assessment Rule Baseline can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/elastic_pool.py b/sdk/python/pulumi_azure/mssql/elastic_pool.py index 5f2051d23d..48387f9828 100644 --- a/sdk/python/pulumi_azure/mssql/elastic_pool.py +++ b/sdk/python/pulumi_azure/mssql/elastic_pool.py @@ -544,6 +544,37 @@ def __init__(__self__, """ Allows you to manage an Azure SQL Elastic Pool via the `v3.0` API which allows for `vCore` and `DTU` based configurations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_elastic_pool = azure.mssql.ElasticPool("exampleElasticPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_server.name, + license_type="LicenseIncluded", + max_size_gb=756, + sku=azure.mssql.ElasticPoolSkuArgs( + name="BasicPool", + tier="Basic", + family="Gen4", + capacity=4, + ), + per_database_settings=azure.mssql.ElasticPoolPerDatabaseSettingsArgs( + min_capacity=0.25, + max_capacity=4, + )) + ``` + ## Import SQL Elastic Pool can be imported using the `resource id`, e.g. @@ -578,6 +609,37 @@ def __init__(__self__, """ Allows you to manage an Azure SQL Elastic Pool via the `v3.0` API which allows for `vCore` and `DTU` based configurations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_elastic_pool = azure.mssql.ElasticPool("exampleElasticPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_server.name, + license_type="LicenseIncluded", + max_size_gb=756, + sku=azure.mssql.ElasticPoolSkuArgs( + name="BasicPool", + tier="Basic", + family="Gen4", + capacity=4, + ), + per_database_settings=azure.mssql.ElasticPoolPerDatabaseSettingsArgs( + min_capacity=0.25, + max_capacity=4, + )) + ``` + ## Import SQL Elastic Pool can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/failover_group.py b/sdk/python/pulumi_azure/mssql/failover_group.py index a26d715af5..bceeade088 100644 --- a/sdk/python/pulumi_azure/mssql/failover_group.py +++ b/sdk/python/pulumi_azure/mssql/failover_group.py @@ -334,6 +334,46 @@ def __init__(__self__, """ Manages a Microsoft Azure SQL Failover Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.mssql.Server("primary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11") + secondary = azure.mssql.Server("secondary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat12") + example_database = azure.mssql.Database("exampleDatabase", + server_id=primary.id, + sku_name="S1", + collation="SQL_Latin1_General_CP1_CI_AS", + max_size_gb=200) + example_failover_group = azure.mssql.FailoverGroup("exampleFailoverGroup", + server_id=primary.id, + databases=[example_database.id], + partner_servers=[azure.mssql.FailoverGroupPartnerServerArgs( + id=secondary.id, + )], + read_write_endpoint_failover_policy=azure.mssql.FailoverGroupReadWriteEndpointFailoverPolicyArgs( + mode="Automatic", + grace_minutes=80, + ), + tags={ + "environment": "prod", + "database": "example", + }) + ``` + ## Import Failover Groups can be imported using the `resource id`, e.g. @@ -361,6 +401,46 @@ def __init__(__self__, """ Manages a Microsoft Azure SQL Failover Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.mssql.Server("primary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11") + secondary = azure.mssql.Server("secondary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat12") + example_database = azure.mssql.Database("exampleDatabase", + server_id=primary.id, + sku_name="S1", + collation="SQL_Latin1_General_CP1_CI_AS", + max_size_gb=200) + example_failover_group = azure.mssql.FailoverGroup("exampleFailoverGroup", + server_id=primary.id, + databases=[example_database.id], + partner_servers=[azure.mssql.FailoverGroupPartnerServerArgs( + id=secondary.id, + )], + read_write_endpoint_failover_policy=azure.mssql.FailoverGroupReadWriteEndpointFailoverPolicyArgs( + mode="Automatic", + grace_minutes=80, + ), + tags={ + "environment": "prod", + "database": "example", + }) + ``` + ## Import Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/firewall_rule.py b/sdk/python/pulumi_azure/mssql/firewall_rule.py index f9ec08e0ff..c63f23035e 100644 --- a/sdk/python/pulumi_azure/mssql/firewall_rule.py +++ b/sdk/python/pulumi_azure/mssql/firewall_rule.py @@ -225,6 +225,25 @@ def __init__(__self__, """ Allows you to manage an Azure SQL Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_firewall_rule = azure.mssql.FirewallRule("exampleFirewallRule", + server_id=example_server.id, + start_ip_address="10.0.17.62", + end_ip_address="10.0.17.62") + ``` + ## Import SQL Firewall Rules can be imported using the `resource id`, e.g. @@ -251,6 +270,25 @@ def __init__(__self__, """ Allows you to manage an Azure SQL Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_firewall_rule = azure.mssql.FirewallRule("exampleFirewallRule", + server_id=example_server.id, + start_ip_address="10.0.17.62", + end_ip_address="10.0.17.62") + ``` + ## Import SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/get_database.py b/sdk/python/pulumi_azure/mssql/get_database.py index 5c0aa11703..3346d7daec 100644 --- a/sdk/python/pulumi_azure/mssql/get_database.py +++ b/sdk/python/pulumi_azure/mssql/get_database.py @@ -188,6 +188,24 @@ def get_database(name: Optional[str] = None, """ Use this data source to access information about an existing SQL database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_database = azure.mssql.get_database_output(name="example-mssql-db", + server_id=example_server.id) + pulumi.export("databaseId", example_database.id) + ``` + :param str name: The name of the MS SQL Database. :param str server_id: The id of the MS SQL Server on which to read the database. @@ -221,6 +239,24 @@ def get_database_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing SQL database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_database = azure.mssql.get_database_output(name="example-mssql-db", + server_id=example_server.id) + pulumi.export("databaseId", example_database.id) + ``` + :param str name: The name of the MS SQL Database. :param str server_id: The id of the MS SQL Server on which to read the database. diff --git a/sdk/python/pulumi_azure/mssql/get_elastic_pool.py b/sdk/python/pulumi_azure/mssql/get_elastic_pool.py index f37be79068..92ce645a89 100644 --- a/sdk/python/pulumi_azure/mssql/get_elastic_pool.py +++ b/sdk/python/pulumi_azure/mssql/get_elastic_pool.py @@ -190,6 +190,18 @@ def get_elastic_pool(name: Optional[str] = None, """ Use this data source to access information about an existing SQL elastic pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mssql.get_elastic_pool(name="mssqlelasticpoolname", + resource_group_name="example-resources", + server_name="example-sql-server") + pulumi.export("elasticpoolId", example.id) + ``` + :param str name: The name of the elastic pool. :param str resource_group_name: The name of the resource group which contains the elastic pool. @@ -226,6 +238,18 @@ def get_elastic_pool_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing SQL elastic pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mssql.get_elastic_pool(name="mssqlelasticpoolname", + resource_group_name="example-resources", + server_name="example-sql-server") + pulumi.export("elasticpoolId", example.id) + ``` + :param str name: The name of the elastic pool. :param str resource_group_name: The name of the resource group which contains the elastic pool. diff --git a/sdk/python/pulumi_azure/mssql/get_managed_instance.py b/sdk/python/pulumi_azure/mssql/get_managed_instance.py index 1b4ce68111..9ed6269d8b 100644 --- a/sdk/python/pulumi_azure/mssql/get_managed_instance.py +++ b/sdk/python/pulumi_azure/mssql/get_managed_instance.py @@ -282,6 +282,16 @@ def get_managed_instance(name: Optional[str] = None, """ Use this data source to access information about an existing Microsoft SQL Azure Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mssql.get_managed_instance(name="managedsqlinstance", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the SQL Managed Instance. :param str resource_group_name: The name of the resource group where the SQL Managed Instance exists. @@ -323,6 +333,16 @@ def get_managed_instance_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Microsoft SQL Azure Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mssql.get_managed_instance(name="managedsqlinstance", + resource_group_name=azurerm_resource_group["example"]["name"]) + ``` + :param str name: The name of the SQL Managed Instance. :param str resource_group_name: The name of the resource group where the SQL Managed Instance exists. diff --git a/sdk/python/pulumi_azure/mssql/get_server.py b/sdk/python/pulumi_azure/mssql/get_server.py index 6b84bcceba..6c1a3e875b 100644 --- a/sdk/python/pulumi_azure/mssql/get_server.py +++ b/sdk/python/pulumi_azure/mssql/get_server.py @@ -153,6 +153,17 @@ def get_server(name: Optional[str] = None, """ Use this data source to access information about an existing Microsoft SQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mssql.get_server(name="existingMsSqlServer", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Microsoft SQL Server. :param str resource_group_name: The name of the Resource Group where the Microsoft SQL Server exists. @@ -183,6 +194,17 @@ def get_server_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Microsoft SQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mssql.get_server(name="existingMsSqlServer", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Microsoft SQL Server. :param str resource_group_name: The name of the Resource Group where the Microsoft SQL Server exists. diff --git a/sdk/python/pulumi_azure/mssql/job_agent.py b/sdk/python/pulumi_azure/mssql/job_agent.py index c1565357d7..f9766fc54e 100644 --- a/sdk/python/pulumi_azure/mssql/job_agent.py +++ b/sdk/python/pulumi_azure/mssql/job_agent.py @@ -207,6 +207,28 @@ def __init__(__self__, """ Manages an Elastic Job Agent. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="northeurope") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_database = azure.mssql.Database("exampleDatabase", + server_id=example_server.id, + collation="SQL_Latin1_General_CP1_CI_AS", + sku_name="S1") + example_job_agent = azure.mssql.JobAgent("exampleJobAgent", + location=example_resource_group.location, + database_id=example_database.id) + ``` + ## Import Elastic Job Agents can be imported using the `id`, e.g. @@ -231,6 +253,28 @@ def __init__(__self__, """ Manages an Elastic Job Agent. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="northeurope") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_database = azure.mssql.Database("exampleDatabase", + server_id=example_server.id, + collation="SQL_Latin1_General_CP1_CI_AS", + sku_name="S1") + example_job_agent = azure.mssql.JobAgent("exampleJobAgent", + location=example_resource_group.location, + database_id=example_database.id) + ``` + ## Import Elastic Job Agents can be imported using the `id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/job_credential.py b/sdk/python/pulumi_azure/mssql/job_credential.py index e486e3c15c..e00373a963 100644 --- a/sdk/python/pulumi_azure/mssql/job_credential.py +++ b/sdk/python/pulumi_azure/mssql/job_credential.py @@ -209,6 +209,32 @@ def __init__(__self__, """ Manages an Elastic Job Credential. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="northeurope") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_database = azure.mssql.Database("exampleDatabase", + server_id=example_server.id, + collation="SQL_Latin1_General_CP1_CI_AS", + sku_name="S1") + example_job_agent = azure.mssql.JobAgent("exampleJobAgent", + location=example_resource_group.location, + database_id=example_database.id) + example_job_credential = azure.mssql.JobCredential("exampleJobCredential", + job_agent_id=example_job_agent.id, + username="my-username", + password="MyP4ssw0rd!!!") + ``` + ## Import Elastic Job Credentials can be imported using the `resource id`, e.g. @@ -233,6 +259,32 @@ def __init__(__self__, """ Manages an Elastic Job Credential. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="northeurope") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_database = azure.mssql.Database("exampleDatabase", + server_id=example_server.id, + collation="SQL_Latin1_General_CP1_CI_AS", + sku_name="S1") + example_job_agent = azure.mssql.JobAgent("exampleJobAgent", + location=example_resource_group.location, + database_id=example_database.id) + example_job_credential = azure.mssql.JobCredential("exampleJobCredential", + job_agent_id=example_job_agent.id, + username="my-username", + password="MyP4ssw0rd!!!") + ``` + ## Import Elastic Job Credentials can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/managed_database.py b/sdk/python/pulumi_azure/mssql/managed_database.py index 4afd56efde..a4e56aacdf 100644 --- a/sdk/python/pulumi_azure/mssql/managed_database.py +++ b/sdk/python/pulumi_azure/mssql/managed_database.py @@ -217,6 +217,34 @@ def __init__(__self__, """ Manages an Azure SQL Azure Managed Database for a SQL Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="msadministrator", + administrator_login_password="thisIsDog11") + example_managed_database = azure.mssql.ManagedDatabase("exampleManagedDatabase", managed_instance_id=example_managed_instance.id) + ``` + ## Import SQL Managed Databases can be imported using the `resource id`, e.g. @@ -241,6 +269,34 @@ def __init__(__self__, """ Manages an Azure SQL Azure Managed Database for a SQL Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="msadministrator", + administrator_login_password="thisIsDog11") + example_managed_database = azure.mssql.ManagedDatabase("exampleManagedDatabase", managed_instance_id=example_managed_instance.id) + ``` + ## Import SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/managed_instance.py b/sdk/python/pulumi_azure/mssql/managed_instance.py index 84191822b6..84504e05f6 100644 --- a/sdk/python/pulumi_azure/mssql/managed_instance.py +++ b/sdk/python/pulumi_azure/mssql/managed_instance.py @@ -880,6 +880,160 @@ def __init__(__self__, > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + allow_management_inbound = azure.network.NetworkSecurityRule("allowManagementInbound", + priority=106, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "9000", + "9003", + "1438", + "1440", + "1452", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_inbound = azure.network.NetworkSecurityRule("allowMisubnetInbound", + priority=200, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_health_probe_inbound = azure.network.NetworkSecurityRule("allowHealthProbeInbound", + priority=300, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="AzureLoadBalancer", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_tds_inbound = azure.network.NetworkSecurityRule("allowTdsInbound", + priority=1000, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="1433", + source_address_prefix="VirtualNetwork", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_inbound = azure.network.NetworkSecurityRule("denyAllInbound", + priority=4096, + direction="Inbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_management_outbound = azure.network.NetworkSecurityRule("allowManagementOutbound", + priority=102, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "80", + "443", + "12000", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_outbound = azure.network.NetworkSecurityRule("allowMisubnetOutbound", + priority=200, + direction="Outbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_outbound = azure.network.NetworkSecurityRule("denyAllOutbound", + priority=4096, + direction="Outbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + opts=pulumi.ResourceOptions(depends_on=[example_subnet])) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + opts=pulumi.ResourceOptions(depends_on=[ + example_subnet_network_security_group_association, + example_subnet_route_table_association, + ])) + ``` + ## Import Microsoft SQL Managed Instances can be imported using the `resource id`, e.g. @@ -922,6 +1076,160 @@ def __init__(__self__, > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + allow_management_inbound = azure.network.NetworkSecurityRule("allowManagementInbound", + priority=106, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "9000", + "9003", + "1438", + "1440", + "1452", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_inbound = azure.network.NetworkSecurityRule("allowMisubnetInbound", + priority=200, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_health_probe_inbound = azure.network.NetworkSecurityRule("allowHealthProbeInbound", + priority=300, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="AzureLoadBalancer", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_tds_inbound = azure.network.NetworkSecurityRule("allowTdsInbound", + priority=1000, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="1433", + source_address_prefix="VirtualNetwork", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_inbound = azure.network.NetworkSecurityRule("denyAllInbound", + priority=4096, + direction="Inbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_management_outbound = azure.network.NetworkSecurityRule("allowManagementOutbound", + priority=102, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "80", + "443", + "12000", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_outbound = azure.network.NetworkSecurityRule("allowMisubnetOutbound", + priority=200, + direction="Outbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_outbound = azure.network.NetworkSecurityRule("denyAllOutbound", + priority=4096, + direction="Outbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + opts=pulumi.ResourceOptions(depends_on=[example_subnet])) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + opts=pulumi.ResourceOptions(depends_on=[ + example_subnet_network_security_group_association, + example_subnet_route_table_association, + ])) + ``` + ## Import Microsoft SQL Managed Instances can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/managed_instance_active_directory_administrator.py b/sdk/python/pulumi_azure/mssql/managed_instance_active_directory_administrator.py index 943ff2a2f9..d39794bc38 100644 --- a/sdk/python/pulumi_azure/mssql/managed_instance_active_directory_administrator.py +++ b/sdk/python/pulumi_azure/mssql/managed_instance_active_directory_administrator.py @@ -263,6 +263,52 @@ def __init__(__self__, """ Allows you to set a user, group or service principal as the AAD Administrator for an Azure SQL Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="msadministrator", + administrator_login_password="thisIsDog11", + identity=azure.mssql.ManagedInstanceIdentityArgs( + type="SystemAssigned", + )) + reader = azuread.DirectoryRole("reader", display_name="Directory Readers") + example_directory_role_member = azuread.DirectoryRoleMember("exampleDirectoryRoleMember", + role_object_id=reader.object_id, + member_object_id=example_managed_instance.identity.principal_id) + admin = azuread.User("admin", + user_principal_name="ms.admin@hashicorp.com", + display_name="Ms Admin", + mail_nickname="ms.admin", + password="SecretP@sswd99!") + example_managed_instance_active_directory_administrator = azure.mssql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", + managed_instance_id=example_managed_instance.id, + login_username="msadmin", + object_id=admin.object_id, + tenant_id=current.tenant_id) + ``` + ## Import An Azure SQL Active Directory Administrator can be imported using the `resource id`, e.g. @@ -288,6 +334,52 @@ def __init__(__self__, """ Allows you to set a user, group or service principal as the AAD Administrator for an Azure SQL Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_client_config() + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="msadministrator", + administrator_login_password="thisIsDog11", + identity=azure.mssql.ManagedInstanceIdentityArgs( + type="SystemAssigned", + )) + reader = azuread.DirectoryRole("reader", display_name="Directory Readers") + example_directory_role_member = azuread.DirectoryRoleMember("exampleDirectoryRoleMember", + role_object_id=reader.object_id, + member_object_id=example_managed_instance.identity.principal_id) + admin = azuread.User("admin", + user_principal_name="ms.admin@hashicorp.com", + display_name="Ms Admin", + mail_nickname="ms.admin", + password="SecretP@sswd99!") + example_managed_instance_active_directory_administrator = azure.mssql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", + managed_instance_id=example_managed_instance.id, + login_username="msadmin", + object_id=admin.object_id, + tenant_id=current.tenant_id) + ``` + ## Import An Azure SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/managed_instance_security_alert_policy.py b/sdk/python/pulumi_azure/mssql/managed_instance_security_alert_policy.py index ee2828088c..d41aa2f733 100644 --- a/sdk/python/pulumi_azure/mssql/managed_instance_security_alert_policy.py +++ b/sdk/python/pulumi_azure/mssql/managed_instance_security_alert_policy.py @@ -429,6 +429,171 @@ def __init__(__self__, """ Manages a Security Alert Policy for an MS SQL Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + allow_management_inbound = azure.network.NetworkSecurityRule("allowManagementInbound", + priority=106, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "9000", + "9003", + "1438", + "1440", + "1452", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_inbound = azure.network.NetworkSecurityRule("allowMisubnetInbound", + priority=200, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_health_probe_inbound = azure.network.NetworkSecurityRule("allowHealthProbeInbound", + priority=300, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="AzureLoadBalancer", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_tds_inbound = azure.network.NetworkSecurityRule("allowTdsInbound", + priority=1000, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="1433", + source_address_prefix="VirtualNetwork", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_inbound = azure.network.NetworkSecurityRule("denyAllInbound", + priority=4096, + direction="Inbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_management_outbound = azure.network.NetworkSecurityRule("allowManagementOutbound", + priority=102, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "80", + "443", + "12000", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_outbound = azure.network.NetworkSecurityRule("allowMisubnetOutbound", + priority=200, + direction="Outbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_outbound = azure.network.NetworkSecurityRule("denyAllOutbound", + priority=4096, + direction="Outbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + opts=pulumi.ResourceOptions(depends_on=[example_subnet])) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + opts=pulumi.ResourceOptions(depends_on=[ + example_subnet_network_security_group_association, + example_subnet_route_table_association, + ])) + example_managed_instance_security_alert_policy = azure.mssql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + managed_instance_name=example_managed_instance.name, + enabled=True, + storage_endpoint=azurerm_storage_account["example"]["primary_blob_endpoint"], + storage_account_access_key=azurerm_storage_account["example"]["primary_access_key"], + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import MS SQL Managed Instance Security Alert Policy can be imported using the `resource id`, e.g. @@ -460,6 +625,171 @@ def __init__(__self__, """ Manages a Security Alert Policy for an MS SQL Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + allow_management_inbound = azure.network.NetworkSecurityRule("allowManagementInbound", + priority=106, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "9000", + "9003", + "1438", + "1440", + "1452", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_inbound = azure.network.NetworkSecurityRule("allowMisubnetInbound", + priority=200, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_health_probe_inbound = azure.network.NetworkSecurityRule("allowHealthProbeInbound", + priority=300, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="AzureLoadBalancer", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_tds_inbound = azure.network.NetworkSecurityRule("allowTdsInbound", + priority=1000, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="1433", + source_address_prefix="VirtualNetwork", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_inbound = azure.network.NetworkSecurityRule("denyAllInbound", + priority=4096, + direction="Inbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_management_outbound = azure.network.NetworkSecurityRule("allowManagementOutbound", + priority=102, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "80", + "443", + "12000", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_outbound = azure.network.NetworkSecurityRule("allowMisubnetOutbound", + priority=200, + direction="Outbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_outbound = azure.network.NetworkSecurityRule("denyAllOutbound", + priority=4096, + direction="Outbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + opts=pulumi.ResourceOptions(depends_on=[example_subnet])) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + opts=pulumi.ResourceOptions(depends_on=[ + example_subnet_network_security_group_association, + example_subnet_route_table_association, + ])) + example_managed_instance_security_alert_policy = azure.mssql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + managed_instance_name=example_managed_instance.name, + enabled=True, + storage_endpoint=azurerm_storage_account["example"]["primary_blob_endpoint"], + storage_account_access_key=azurerm_storage_account["example"]["primary_access_key"], + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import MS SQL Managed Instance Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/managed_instance_transparent_data_encryption.py b/sdk/python/pulumi_azure/mssql/managed_instance_transparent_data_encryption.py index c657b6cf66..83409bdf50 100644 --- a/sdk/python/pulumi_azure/mssql/managed_instance_transparent_data_encryption.py +++ b/sdk/python/pulumi_azure/mssql/managed_instance_transparent_data_encryption.py @@ -199,6 +199,134 @@ def __init__(__self__, > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. ## Example Usage + ### With Service Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=azurerm_resource_group["test"]["location"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="missadministrator", + administrator_login_password="NCC-1701-D", + identity=azure.mssql.ManagedInstanceIdentityArgs( + type="SystemAssigned", + )) + example_managed_instance_transparent_data_encryption = azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", managed_instance_id=example_managed_instance.id) + ``` + ### With Customer Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=azurerm_resource_group["test"]["location"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="missadministrator", + administrator_login_password="NCC-1701-D", + identity=azure.mssql.ManagedInstanceIdentityArgs( + type="SystemAssigned", + )) + # Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Update", + "Recover", + "Purge", + "GetRotationPolicy", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_managed_instance.identity.tenant_id, + object_id=example_managed_instance.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_key_vault])) + example_managed_instance_transparent_data_encryption = azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", + managed_instance_id=example_managed_instance.id, + key_vault_key_id=example_key.id) + ``` ## Import @@ -232,6 +360,134 @@ def __init__(__self__, > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. ## Example Usage + ### With Service Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=azurerm_resource_group["test"]["location"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="missadministrator", + administrator_login_password="NCC-1701-D", + identity=azure.mssql.ManagedInstanceIdentityArgs( + type="SystemAssigned", + )) + example_managed_instance_transparent_data_encryption = azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", managed_instance_id=example_managed_instance.id) + ``` + ### With Customer Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=azurerm_resource_group["test"]["location"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="missadministrator", + administrator_login_password="NCC-1701-D", + identity=azure.mssql.ManagedInstanceIdentityArgs( + type="SystemAssigned", + )) + # Create a key vault with policies for the deployer to create a key & SQL Managed Instance to wrap/unwrap/get key + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Update", + "Recover", + "Purge", + "GetRotationPolicy", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_managed_instance.identity.tenant_id, + object_id=example_managed_instance.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_key_vault])) + example_managed_instance_transparent_data_encryption = azure.mssql.ManagedInstanceTransparentDataEncryption("exampleManagedInstanceTransparentDataEncryption", + managed_instance_id=example_managed_instance.id, + key_vault_key_id=example_key.id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/mssql/managed_instance_vulnerability_assessment.py b/sdk/python/pulumi_azure/mssql/managed_instance_vulnerability_assessment.py index 72695e4d72..6cba10dd82 100644 --- a/sdk/python/pulumi_azure/mssql/managed_instance_vulnerability_assessment.py +++ b/sdk/python/pulumi_azure/mssql/managed_instance_vulnerability_assessment.py @@ -279,6 +279,61 @@ def __init__(__self__, """ Manages the Vulnerability Assessment for an MS Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="missadministrator", + administrator_login_password="NCC-1701-D") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_managed_instance_security_alert_policy = azure.mssql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", + resource_group_name=azurerm_resource_group["test"]["name"], + managed_instance_name=azurerm_mssql_managed_instance["test"]["name"], + enabled=True, + storage_endpoint=azurerm_storage_account["test"]["primary_blob_endpoint"], + storage_account_access_key=azurerm_storage_account["test"]["primary_access_key"], + retention_days=30) + example_managed_instance_vulnerability_assessment = azure.mssql.ManagedInstanceVulnerabilityAssessment("exampleManagedInstanceVulnerabilityAssessment", + managed_instance_id=example_managed_instance.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.mssql.ManagedInstanceVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + ), + opts=pulumi.ResourceOptions(depends_on=[example_managed_instance_security_alert_policy])) + ``` + ## Import The Vulnerability Assessment can be imported using the `resource id`, e.g. @@ -308,6 +363,61 @@ def __init__(__self__, """ Manages the Vulnerability Assessment for an MS Managed Instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.mssql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + license_type="BasePrice", + sku_name="GP_Gen5", + storage_size_in_gb=32, + subnet_id=example_subnet.id, + vcores=4, + administrator_login="missadministrator", + administrator_login_password="NCC-1701-D") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_managed_instance_security_alert_policy = azure.mssql.ManagedInstanceSecurityAlertPolicy("exampleManagedInstanceSecurityAlertPolicy", + resource_group_name=azurerm_resource_group["test"]["name"], + managed_instance_name=azurerm_mssql_managed_instance["test"]["name"], + enabled=True, + storage_endpoint=azurerm_storage_account["test"]["primary_blob_endpoint"], + storage_account_access_key=azurerm_storage_account["test"]["primary_access_key"], + retention_days=30) + example_managed_instance_vulnerability_assessment = azure.mssql.ManagedInstanceVulnerabilityAssessment("exampleManagedInstanceVulnerabilityAssessment", + managed_instance_id=example_managed_instance.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.mssql.ManagedInstanceVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + ), + opts=pulumi.ResourceOptions(depends_on=[example_managed_instance_security_alert_policy])) + ``` + ## Import The Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/outbound_firewall_rule.py b/sdk/python/pulumi_azure/mssql/outbound_firewall_rule.py index aefb17c2e8..eac16bdbee 100644 --- a/sdk/python/pulumi_azure/mssql/outbound_firewall_rule.py +++ b/sdk/python/pulumi_azure/mssql/outbound_firewall_rule.py @@ -133,6 +133,23 @@ def __init__(__self__, """ Allows you to manage an Azure SQL Outbound Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd", + outbound_network_restriction_enabled=True) + example_outbound_firewall_rule = azure.mssql.OutboundFirewallRule("exampleOutboundFirewallRule", server_id=example_server.id) + ``` + ## Import SQL Outbound Firewall Rules can be imported using the `resource id`, e.g. @@ -155,6 +172,23 @@ def __init__(__self__, """ Allows you to manage an Azure SQL Outbound Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd", + outbound_network_restriction_enabled=True) + example_outbound_firewall_rule = azure.mssql.OutboundFirewallRule("exampleOutboundFirewallRule", server_id=example_server.id) + ``` + ## Import SQL Outbound Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/server.py b/sdk/python/pulumi_azure/mssql/server.py index a98388762c..6eeedd86ef 100644 --- a/sdk/python/pulumi_azure/mssql/server.py +++ b/sdk/python/pulumi_azure/mssql/server.py @@ -733,6 +733,101 @@ def __init__(__self__, """ Manages a Microsoft SQL Azure Database Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + ), + tags={ + "environment": "production", + }) + ``` + ### Transparent Data Encryption(TDE) With A Customer Managed Key(CMK) During Create + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + # Create a key vault with access policies which allow for the current user to get, list, create, delete, update, recover, purge and getRotationPolicy for the key vault key and also add a key vault access policy for the Microsoft Sql Server instance User Managed Identity to get, wrap, and unwrap key(s) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=example_user_assigned_identity.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=True, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Update", + "Recover", + "Purge", + "GetRotationPolicy", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_user_assigned_identity.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_key_vault])) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="Example-Administrator", + administrator_login_password="Example_Password!", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username=example_user_assigned_identity.name, + object_id=example_user_assigned_identity.principal_id, + ), + identity=azure.mssql.ServerIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + primary_user_assigned_identity_id=example_user_assigned_identity.id, + transparent_data_encryption_key_vault_key_id=example_key.id) + ``` + ## Import SQL Servers can be imported using the `resource id`, e.g. @@ -778,6 +873,101 @@ def __init__(__self__, """ Manages a Microsoft SQL Azure Database Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + ), + tags={ + "environment": "production", + }) + ``` + ### Transparent Data Encryption(TDE) With A Customer Managed Key(CMK) During Create + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + # Create a key vault with access policies which allow for the current user to get, list, create, delete, update, recover, purge and getRotationPolicy for the key vault key and also add a key vault access policy for the Microsoft Sql Server instance User Managed Identity to get, wrap, and unwrap key(s) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=example_user_assigned_identity.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=True, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Update", + "Recover", + "Purge", + "GetRotationPolicy", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_user_assigned_identity.tenant_id, + object_id=example_user_assigned_identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_key_vault])) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="Example-Administrator", + administrator_login_password="Example_Password!", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username=example_user_assigned_identity.name, + object_id=example_user_assigned_identity.principal_id, + ), + identity=azure.mssql.ServerIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + primary_user_assigned_identity_id=example_user_assigned_identity.id, + transparent_data_encryption_key_vault_key_id=example_key.id) + ``` + ## Import SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/server_dns_alias.py b/sdk/python/pulumi_azure/mssql/server_dns_alias.py index ff6f6b6106..44538d3b41 100644 --- a/sdk/python/pulumi_azure/mssql/server_dns_alias.py +++ b/sdk/python/pulumi_azure/mssql/server_dns_alias.py @@ -153,6 +153,22 @@ def __init__(__self__, """ Manages a MS SQL Server DNS Alias. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_server_dns_alias = azure.mssql.ServerDnsAlias("exampleServerDnsAlias", mssql_server_id=example_server.id) + ``` + ## Import MSSQL Server DNS Aliass can be imported using the `resource id`, e.g. @@ -175,6 +191,22 @@ def __init__(__self__, """ Manages a MS SQL Server DNS Alias. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_server_dns_alias = azure.mssql.ServerDnsAlias("exampleServerDnsAlias", mssql_server_id=example_server.id) + ``` + ## Import MSSQL Server DNS Aliass can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/server_extended_auditing_policy.py b/sdk/python/pulumi_azure/mssql/server_extended_auditing_policy.py index 72b2945b32..03b5d24fb0 100644 --- a/sdk/python/pulumi_azure/mssql/server_extended_auditing_policy.py +++ b/sdk/python/pulumi_azure/mssql/server_extended_auditing_policy.py @@ -387,6 +387,104 @@ def __init__(__self__, """ Manages a MS SQL Server Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_server_extended_auditing_policy = azure.mssql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", + server_id=example_server.id, + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ### With Storage Account Behind VNet And Firewall + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=[ + "Microsoft.Sql", + "Microsoft.Storage", + ], + enforce_private_link_endpoint_network_policies=True) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!", + minimum_tls_version="1.2", + identity=azure.mssql.ServerIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_server.identity.principal_id) + sqlvnetrule = azure.sql.VirtualNetworkRule("sqlvnetrule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=example_subnet.id) + example_firewall_rule = azure.sql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + allow_nested_items_to_be_public=False, + network_rules=azure.storage.AccountNetworkRulesArgs( + default_action="Deny", + ip_rules=["127.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + bypasses=["AzureServices"], + ), + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + example_server_extended_auditing_policy = azure.mssql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", + storage_endpoint=example_account.primary_blob_endpoint, + server_id=example_server.id, + retention_in_days=6, + log_monitoring_enabled=False, + storage_account_subscription_id=azurerm_subscription["primary"]["subscription_id"], + opts=pulumi.ResourceOptions(depends_on=[ + example_assignment, + example_account, + ])) + ``` + ## Import MS SQL Server Extended Auditing Policies can be imported using the `resource id`, e.g. @@ -417,6 +515,104 @@ def __init__(__self__, """ Manages a MS SQL Server Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_server_extended_auditing_policy = azure.mssql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", + server_id=example_server.id, + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ### With Storage Account Behind VNet And Firewall + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=[ + "Microsoft.Sql", + "Microsoft.Storage", + ], + enforce_private_link_endpoint_network_policies=True) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!", + minimum_tls_version="1.2", + identity=azure.mssql.ServerIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_server.identity.principal_id) + sqlvnetrule = azure.sql.VirtualNetworkRule("sqlvnetrule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=example_subnet.id) + example_firewall_rule = azure.sql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + allow_nested_items_to_be_public=False, + network_rules=azure.storage.AccountNetworkRulesArgs( + default_action="Deny", + ip_rules=["127.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + bypasses=["AzureServices"], + ), + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + example_server_extended_auditing_policy = azure.mssql.ServerExtendedAuditingPolicy("exampleServerExtendedAuditingPolicy", + storage_endpoint=example_account.primary_blob_endpoint, + server_id=example_server.id, + retention_in_days=6, + log_monitoring_enabled=False, + storage_account_subscription_id=azurerm_subscription["primary"]["subscription_id"], + opts=pulumi.ResourceOptions(depends_on=[ + example_assignment, + example_account, + ])) + ``` + ## Import MS SQL Server Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/server_microsoft_support_auditing_policy.py b/sdk/python/pulumi_azure/mssql/server_microsoft_support_auditing_policy.py index 7a20d2044e..689e7b51cf 100644 --- a/sdk/python/pulumi_azure/mssql/server_microsoft_support_auditing_policy.py +++ b/sdk/python/pulumi_azure/mssql/server_microsoft_support_auditing_policy.py @@ -305,6 +305,100 @@ def __init__(__self__, """ Manages a MS SQL Server Microsoft Support Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_server_microsoft_support_auditing_policy = azure.mssql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", + server_id=example_server.id, + blob_storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key) + ``` + ### With Storage Account Behind VNet And Firewall + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=[ + "Microsoft.Sql", + "Microsoft.Storage", + ], + enforce_private_link_endpoint_network_policies=True) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!", + minimum_tls_version="1.2", + identity=azure.mssql.ServerIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_server.identity.principal_id) + sqlvnetrule = azure.sql.VirtualNetworkRule("sqlvnetrule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=example_subnet.id) + example_firewall_rule = azure.sql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + allow_nested_items_to_be_public=False, + network_rules=azure.storage.AccountNetworkRulesArgs( + default_action="Deny", + ip_rules=["127.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + bypasses=["AzureServices"], + ), + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + example_server_microsoft_support_auditing_policy = azure.mssql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", + blob_storage_endpoint=example_account.primary_blob_endpoint, + server_id=example_server.id, + log_monitoring_enabled=False, + storage_account_subscription_id=azurerm_subscription["primary"]["subscription_id"], + opts=pulumi.ResourceOptions(depends_on=[ + example_assignment, + example_account, + ])) + ``` + ## Import MS SQL Server Microsoft Support Auditing Policies can be imported using the `resource id`, e.g. @@ -333,6 +427,100 @@ def __init__(__self__, """ Manages a MS SQL Server Microsoft Support Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_server_microsoft_support_auditing_policy = azure.mssql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", + server_id=example_server.id, + blob_storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key) + ``` + ### With Storage Account Behind VNet And Firewall + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=[ + "Microsoft.Sql", + "Microsoft.Storage", + ], + enforce_private_link_endpoint_network_policies=True) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="AdminPassword123!", + minimum_tls_version="1.2", + identity=azure.mssql.ServerIdentityArgs( + type="SystemAssigned", + )) + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_server.identity.principal_id) + sqlvnetrule = azure.sql.VirtualNetworkRule("sqlvnetrule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=example_subnet.id) + example_firewall_rule = azure.sql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + allow_nested_items_to_be_public=False, + network_rules=azure.storage.AccountNetworkRulesArgs( + default_action="Deny", + ip_rules=["127.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + bypasses=["AzureServices"], + ), + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + example_server_microsoft_support_auditing_policy = azure.mssql.ServerMicrosoftSupportAuditingPolicy("exampleServerMicrosoftSupportAuditingPolicy", + blob_storage_endpoint=example_account.primary_blob_endpoint, + server_id=example_server.id, + log_monitoring_enabled=False, + storage_account_subscription_id=azurerm_subscription["primary"]["subscription_id"], + opts=pulumi.ResourceOptions(depends_on=[ + example_assignment, + example_account, + ])) + ``` + ## Import MS SQL Server Microsoft Support Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/server_security_alert_policy.py b/sdk/python/pulumi_azure/mssql/server_security_alert_policy.py index c667351660..25e94df992 100644 --- a/sdk/python/pulumi_azure/mssql/server_security_alert_policy.py +++ b/sdk/python/pulumi_azure/mssql/server_security_alert_policy.py @@ -432,6 +432,37 @@ def __init__(__self__, > **NOTE** Security Alert Policy is currently only available for MS SQL databases. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_server_security_alert_policy = azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + state="Enabled", + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import MS SQL Server Security Alert Policy can be imported using the `resource id`, e.g. @@ -465,6 +496,37 @@ def __init__(__self__, > **NOTE** Security Alert Policy is currently only available for MS SQL databases. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_server_security_alert_policy = azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + state="Enabled", + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import MS SQL Server Security Alert Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/server_transparent_data_encryption.py b/sdk/python/pulumi_azure/mssql/server_transparent_data_encryption.py index 106d63f6d4..22d5d33bfb 100644 --- a/sdk/python/pulumi_azure/mssql/server_transparent_data_encryption.py +++ b/sdk/python/pulumi_azure/mssql/server_transparent_data_encryption.py @@ -201,6 +201,101 @@ def __init__(__self__, > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. ## Example Usage + ### With Service Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + ), + tags={ + "environment": "production", + }) + example_server_transparent_data_encryption = azure.mssql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", server_id=example_server.id) + ``` + ### With Customer Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + ), + tags={ + "environment": "production", + }, + identity=azure.mssql.ServerIdentityArgs( + type="SystemAssigned", + )) + # Create a key vault with policies for the deployer to create a key & SQL Server to wrap/unwrap/get key + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Update", + "Recover", + "Purge", + "GetRotationPolicy", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_server.identity.tenant_id, + object_id=example_server.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_key_vault])) + example_server_transparent_data_encryption = azure.mssql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", + server_id=example_server.id, + key_vault_key_id=example_key.id) + ``` ## Import @@ -236,6 +331,101 @@ def __init__(__self__, > **Note:** See [documentation](https://docs.microsoft.com/azure/azure-sql/database/transparent-data-encryption-byok-overview) for important information on how handle lifecycle management of the keys to prevent data lockout. ## Example Usage + ### With Service Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + ), + tags={ + "environment": "production", + }) + example_server_transparent_data_encryption = azure.mssql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", server_id=example_server.id) + ``` + ### With Customer Managed Key + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUs") + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="missadministrator", + administrator_login_password="thisIsKat11", + minimum_tls_version="1.2", + azuread_administrator=azure.mssql.ServerAzureadAdministratorArgs( + login_username="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + ), + tags={ + "environment": "production", + }, + identity=azure.mssql.ServerIdentityArgs( + type="SystemAssigned", + )) + # Create a key vault with policies for the deployer to create a key & SQL Server to wrap/unwrap/get key + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + enabled_for_disk_encryption=True, + tenant_id=current.tenant_id, + soft_delete_retention_days=7, + purge_protection_enabled=False, + sku_name="standard", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "List", + "Create", + "Delete", + "Update", + "Recover", + "Purge", + "GetRotationPolicy", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=example_server.identity.tenant_id, + object_id=example_server.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ], + ), + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[example_key_vault])) + example_server_transparent_data_encryption = azure.mssql.ServerTransparentDataEncryption("exampleServerTransparentDataEncryption", + server_id=example_server.id, + key_vault_key_id=example_key.id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/mssql/server_vulnerability_assessment.py b/sdk/python/pulumi_azure/mssql/server_vulnerability_assessment.py index c5556201a5..c85da3fc4d 100644 --- a/sdk/python/pulumi_azure/mssql/server_vulnerability_assessment.py +++ b/sdk/python/pulumi_azure/mssql/server_vulnerability_assessment.py @@ -281,6 +281,45 @@ def __init__(__self__, > **NOTE** Vulnerability Assessment is currently only available for MS SQL databases. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_server_security_alert_policy = azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + state="Enabled") + example_server_vulnerability_assessment = azure.mssql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", + server_security_alert_policy_id=example_server_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.mssql.ServerVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + )) + ``` + ## Import MS SQL Server Vulnerability Assessment can be imported using the `resource id`, e.g. @@ -312,6 +351,45 @@ def __init__(__self__, > **NOTE** Vulnerability Assessment is currently only available for MS SQL databases. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_server_security_alert_policy = azure.mssql.ServerSecurityAlertPolicy("exampleServerSecurityAlertPolicy", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + state="Enabled") + example_server_vulnerability_assessment = azure.mssql.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", + server_security_alert_policy_id=example_server_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.mssql.ServerVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + )) + ``` + ## Import MS SQL Server Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/virtual_machine.py b/sdk/python/pulumi_azure/mssql/virtual_machine.py index 63a4f5ab76..e9da2922d8 100644 --- a/sdk/python/pulumi_azure/mssql/virtual_machine.py +++ b/sdk/python/pulumi_azure/mssql/virtual_machine.py @@ -705,6 +705,31 @@ def __init__(__self__, """ Manages a Microsoft SQL Virtual Machine + ## Example Usage + + This example provisions a brief Managed Microsoft SQL Virtual Machine. + + ```python + import pulumi + import pulumi_azure as azure + + example_virtual_machine = azure.compute.get_virtual_machine(name="example-vm", + resource_group_name="example-resources") + example_mssql_virtual_machine_virtual_machine = azure.mssql.VirtualMachine("exampleMssql/virtualMachineVirtualMachine", + virtual_machine_id=example_virtual_machine.id, + sql_license_type="PAYG", + r_services_enabled=True, + sql_connectivity_port=1433, + sql_connectivity_type="PRIVATE", + sql_connectivity_update_password="Password1234!", + sql_connectivity_update_username="sqllogin", + auto_patching=azure.mssql.VirtualMachineAutoPatchingArgs( + day_of_week="Sunday", + maintenance_window_duration_in_minutes=60, + maintenance_window_starting_hour=2, + )) + ``` + ## Import Microsoft SQL Virtual Machines can be imported using the `resource id`, e.g. @@ -741,6 +766,31 @@ def __init__(__self__, """ Manages a Microsoft SQL Virtual Machine + ## Example Usage + + This example provisions a brief Managed Microsoft SQL Virtual Machine. + + ```python + import pulumi + import pulumi_azure as azure + + example_virtual_machine = azure.compute.get_virtual_machine(name="example-vm", + resource_group_name="example-resources") + example_mssql_virtual_machine_virtual_machine = azure.mssql.VirtualMachine("exampleMssql/virtualMachineVirtualMachine", + virtual_machine_id=example_virtual_machine.id, + sql_license_type="PAYG", + r_services_enabled=True, + sql_connectivity_port=1433, + sql_connectivity_type="PRIVATE", + sql_connectivity_update_password="Password1234!", + sql_connectivity_update_username="sqllogin", + auto_patching=azure.mssql.VirtualMachineAutoPatchingArgs( + day_of_week="Sunday", + maintenance_window_duration_in_minutes=60, + maintenance_window_starting_hour=2, + )) + ``` + ## Import Microsoft SQL Virtual Machines can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/virtual_machine_group.py b/sdk/python/pulumi_azure/mssql/virtual_machine_group.py index 87191fab58..73c3b8e9d4 100644 --- a/sdk/python/pulumi_azure/mssql/virtual_machine_group.py +++ b/sdk/python/pulumi_azure/mssql/virtual_machine_group.py @@ -335,6 +335,24 @@ def __init__(__self__, """ Manages a Microsoft SQL Virtual Machine Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_machine_group = azure.mssql.VirtualMachineGroup("exampleVirtualMachineGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sql_image_offer="SQL2017-WS2016", + sql_image_sku="Developer", + wsfc_domain_profile=azure.mssql.VirtualMachineGroupWsfcDomainProfileArgs( + fqdn="testdomain.com", + cluster_subnet_type="SingleSubnet", + )) + ``` + ## Import Microsoft SQL Virtual Machine Groups can be imported using the `resource id`, e.g. @@ -362,6 +380,24 @@ def __init__(__self__, """ Manages a Microsoft SQL Virtual Machine Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_machine_group = azure.mssql.VirtualMachineGroup("exampleVirtualMachineGroup", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sql_image_offer="SQL2017-WS2016", + sql_image_sku="Developer", + wsfc_domain_profile=azure.mssql.VirtualMachineGroupWsfcDomainProfileArgs( + fqdn="testdomain.com", + cluster_subnet_type="SingleSubnet", + )) + ``` + ## Import Microsoft SQL Virtual Machine Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mssql/virtual_network_rule.py b/sdk/python/pulumi_azure/mssql/virtual_network_rule.py index eba1b321c5..371a934f11 100644 --- a/sdk/python/pulumi_azure/mssql/virtual_network_rule.py +++ b/sdk/python/pulumi_azure/mssql/virtual_network_rule.py @@ -224,6 +224,33 @@ def __init__(__self__, """ Allows you to manage rules for allowing traffic between an Azure SQL server and a subnet of a virtual network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_virtual_network_rule = azure.mssql.VirtualNetworkRule("exampleVirtualNetworkRule", + server_id=example_server.id, + subnet_id=example_subnet.id) + ``` + ## Import SQL Virtual Network Rules can be imported using the `resource id`, e.g. @@ -250,6 +277,33 @@ def __init__(__self__, """ Allows you to manage rules for allowing traffic between an Azure SQL server and a subnet of a virtual network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_virtual_network_rule = azure.mssql.VirtualNetworkRule("exampleVirtualNetworkRule", + server_id=example_server.id, + subnet_id=example_subnet.id) + ``` + ## Import SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/active_directory_administrator.py b/sdk/python/pulumi_azure/mysql/active_directory_administrator.py index 02a36f0d1b..a8bbde0cc0 100644 --- a/sdk/python/pulumi_azure/mysql/active_directory_administrator.py +++ b/sdk/python/pulumi_azure/mysql/active_directory_administrator.py @@ -260,6 +260,31 @@ def __init__(__self__, """ Allows you to set a user or group as the AD administrator for an MySQL server in Azure + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + ssl_enforcement_enabled=True, + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7") + example_active_directory_administrator = azure.mysql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", + server_name=example_server.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A MySQL Active Directory Administrator can be imported using the `resource id`, e.g. @@ -285,6 +310,31 @@ def __init__(__self__, """ Allows you to set a user or group as the AD administrator for an MySQL server in Azure + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + ssl_enforcement_enabled=True, + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7") + example_active_directory_administrator = azure.mysql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", + server_name=example_server.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A MySQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/configuration.py b/sdk/python/pulumi_azure/mysql/configuration.py index a4160b973c..5d5f629780 100644 --- a/sdk/python/pulumi_azure/mysql/configuration.py +++ b/sdk/python/pulumi_azure/mysql/configuration.py @@ -218,6 +218,35 @@ def __init__(__self__, > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=True, + infrastructure_encryption_enabled=True, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + example_configuration = azure.mysql.Configuration("exampleConfiguration", + name="interactive_timeout", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + value="600") + ``` + ## Import MySQL Configurations can be imported using the `resource id`, e.g. @@ -246,6 +275,35 @@ def __init__(__self__, > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=True, + infrastructure_encryption_enabled=True, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + example_configuration = azure.mysql.Configuration("exampleConfiguration", + name="interactive_timeout", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + value="600") + ``` + ## Import MySQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/database.py b/sdk/python/pulumi_azure/mysql/database.py index 5abf42ae3d..d44a980d3f 100644 --- a/sdk/python/pulumi_azure/mysql/database.py +++ b/sdk/python/pulumi_azure/mysql/database.py @@ -251,6 +251,35 @@ def __init__(__self__, """ Manages a MySQL Database within a MySQL Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_2", + storage_mb=5120, + version="5.7", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=True, + infrastructure_encryption_enabled=True, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + example_database = azure.mysql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="utf8", + collation="utf8_unicode_ci") + ``` + ## Import MySQL Database's can be imported using the `resource id`, e.g. @@ -276,6 +305,35 @@ def __init__(__self__, """ Manages a MySQL Database within a MySQL Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_2", + storage_mb=5120, + version="5.7", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=True, + infrastructure_encryption_enabled=True, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + example_database = azure.mysql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="utf8", + collation="utf8_unicode_ci") + ``` + ## Import MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/firewall_rule.py b/sdk/python/pulumi_azure/mysql/firewall_rule.py index 08122e3598..30f79b6f09 100644 --- a/sdk/python/pulumi_azure/mysql/firewall_rule.py +++ b/sdk/python/pulumi_azure/mysql/firewall_rule.py @@ -268,6 +268,55 @@ def __init__(__self__, Manages a Firewall Rule for a MySQL Server. ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + version="5.7", + sku_name="GP_Gen5_2", + ssl_enforcement_enabled=True) + example_firewall_rule = azure.mysql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.8.12", + end_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer") + # ... + example_firewall_rule = azure.mysql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.0.0", + end_ip_address="40.112.255.255") + ``` + ### Allow Access To Azure Services) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer") + # ... + example_firewall_rule = azure.mysql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + ``` ## Import @@ -297,6 +346,55 @@ def __init__(__self__, Manages a Firewall Rule for a MySQL Server. ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + version="5.7", + sku_name="GP_Gen5_2", + ssl_enforcement_enabled=True) + example_firewall_rule = azure.mysql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.8.12", + end_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer") + # ... + example_firewall_rule = azure.mysql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.0.0", + end_ip_address="40.112.255.255") + ``` + ### Allow Access To Azure Services) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer") + # ... + example_firewall_rule = azure.mysql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + ``` ## Import diff --git a/sdk/python/pulumi_azure/mysql/flexible_database.py b/sdk/python/pulumi_azure/mysql/flexible_database.py index 81a81074aa..137772ab8e 100644 --- a/sdk/python/pulumi_azure/mysql/flexible_database.py +++ b/sdk/python/pulumi_azure/mysql/flexible_database.py @@ -251,6 +251,26 @@ def __init__(__self__, """ Manages a MySQL Database within a MySQL Flexible Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mysqladminun", + administrator_password="H@Sh1CoR3!", + sku_name="B_Standard_B1s") + example_flexible_database = azure.mysql.FlexibleDatabase("exampleFlexibleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + charset="utf8", + collation="utf8_unicode_ci") + ``` + ## Import MySQL Database's can be imported using the `resource id`, e.g. @@ -276,6 +296,26 @@ def __init__(__self__, """ Manages a MySQL Database within a MySQL Flexible Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mysqladminun", + administrator_password="H@Sh1CoR3!", + sku_name="B_Standard_B1s") + example_flexible_database = azure.mysql.FlexibleDatabase("exampleFlexibleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + charset="utf8", + collation="utf8_unicode_ci") + ``` + ## Import MySQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/flexible_server.py b/sdk/python/pulumi_azure/mysql/flexible_server.py index ab236196a6..9f24664cd5 100644 --- a/sdk/python/pulumi_azure/mysql/flexible_server.py +++ b/sdk/python/pulumi_azure/mysql/flexible_server.py @@ -1029,6 +1029,46 @@ def __init__(__self__, """ Manages a MySQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=["Microsoft.Storage"], + delegations=[azure.network.SubnetDelegationArgs( + name="fs", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.DBforMySQL/flexibleServers", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_zone_virtual_network_link = azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", + private_dns_zone_name=example_zone.name, + virtual_network_id=example_virtual_network.id, + resource_group_name=example_resource_group.name) + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + backup_retention_days=7, + delegated_subnet_id=example_subnet.id, + private_dns_zone_id=example_zone.id, + sku_name="GP_Standard_D2ds_v4", + opts=pulumi.ResourceOptions(depends_on=[example_zone_virtual_network_link])) + ``` + ## Import MySQL Flexible Servers can be imported using the `resource id`, e.g. @@ -1082,6 +1122,46 @@ def __init__(__self__, """ Manages a MySQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=["Microsoft.Storage"], + delegations=[azure.network.SubnetDelegationArgs( + name="fs", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.DBforMySQL/flexibleServers", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_zone_virtual_network_link = azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", + private_dns_zone_name=example_zone.name, + virtual_network_id=example_virtual_network.id, + resource_group_name=example_resource_group.name) + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + backup_retention_days=7, + delegated_subnet_id=example_subnet.id, + private_dns_zone_id=example_zone.id, + sku_name="GP_Standard_D2ds_v4", + opts=pulumi.ResourceOptions(depends_on=[example_zone_virtual_network_link])) + ``` + ## Import MySQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/flexible_server_configuration.py b/sdk/python/pulumi_azure/mysql/flexible_server_configuration.py index 3b056d32f8..88fdacb203 100644 --- a/sdk/python/pulumi_azure/mysql/flexible_server_configuration.py +++ b/sdk/python/pulumi_azure/mysql/flexible_server_configuration.py @@ -217,6 +217,25 @@ def __init__(__self__, > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="adminTerraform", + administrator_password="H@Sh1CoR3!", + sku_name="GP_Standard_D2ds_v4") + example_flexible_server_configuration = azure.mysql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + value="600") + ``` + ## Import MySQL Flexible Server Configurations can be imported using the `resource id`, e.g. @@ -245,6 +264,25 @@ def __init__(__self__, > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="adminTerraform", + administrator_password="H@Sh1CoR3!", + sku_name="GP_Standard_D2ds_v4") + example_flexible_server_configuration = azure.mysql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + value="600") + ``` + ## Import MySQL Flexible Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/flexible_server_firewall_rule.py b/sdk/python/pulumi_azure/mysql/flexible_server_firewall_rule.py index d6079a5875..0d3f912299 100644 --- a/sdk/python/pulumi_azure/mysql/flexible_server_firewall_rule.py +++ b/sdk/python/pulumi_azure/mysql/flexible_server_firewall_rule.py @@ -268,6 +268,54 @@ def __init__(__self__, Manages a Firewall Rule for a MySQL Flexible Server. ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_flexible_server_firewall_rule = azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + start_ip_address="40.112.8.12", + end_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_flexible_server_firewall_rule = azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + start_ip_address="40.112.0.0", + end_ip_address="40.112.255.255") + ``` + ### Allow Access To Azure Services) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_flexible_server_firewall_rule = azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + ``` ## Import @@ -297,6 +345,54 @@ def __init__(__self__, Manages a Firewall Rule for a MySQL Flexible Server. ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_flexible_server_firewall_rule = azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + start_ip_address="40.112.8.12", + end_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_flexible_server_firewall_rule = azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + start_ip_address="40.112.0.0", + end_ip_address="40.112.255.255") + ``` + ### Allow Access To Azure Services) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.mysql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_flexible_server_firewall_rule = azure.mysql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_flexible_server.name, + start_ip_address="0.0.0.0", + end_ip_address="0.0.0.0") + ``` ## Import diff --git a/sdk/python/pulumi_azure/mysql/get_flexible_server.py b/sdk/python/pulumi_azure/mysql/get_flexible_server.py index 57e9f37f72..c0294fc768 100644 --- a/sdk/python/pulumi_azure/mysql/get_flexible_server.py +++ b/sdk/python/pulumi_azure/mysql/get_flexible_server.py @@ -282,6 +282,17 @@ def get_flexible_server(name: Optional[str] = None, """ Use this data source to access information about an existing MySQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mysql.get_flexible_server(name="existingMySqlFlexibleServer", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the MySQL Flexible Server. :param str resource_group_name: The name of the resource group for the MySQL Flexible Server. @@ -323,6 +334,17 @@ def get_flexible_server_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing MySQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mysql.get_flexible_server(name="existingMySqlFlexibleServer", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the MySQL Flexible Server. :param str resource_group_name: The name of the resource group for the MySQL Flexible Server. diff --git a/sdk/python/pulumi_azure/mysql/get_server.py b/sdk/python/pulumi_azure/mysql/get_server.py index 6b86d53e03..6ef7ac10e4 100644 --- a/sdk/python/pulumi_azure/mysql/get_server.py +++ b/sdk/python/pulumi_azure/mysql/get_server.py @@ -270,6 +270,17 @@ def get_server(name: Optional[str] = None, """ Use this data source to access information about an existing MySQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mysql.get_server(name="existingMySqlServer", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the MySQL Server. :param str resource_group_name: The name of the resource group for the MySQL Server. @@ -310,6 +321,17 @@ def get_server_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing MySQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.mysql.get_server(name="existingMySqlServer", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the name of the MySQL Server. :param str resource_group_name: The name of the resource group for the MySQL Server. diff --git a/sdk/python/pulumi_azure/mysql/server.py b/sdk/python/pulumi_azure/mysql/server.py index 89dea348d1..3280dd1b97 100644 --- a/sdk/python/pulumi_azure/mysql/server.py +++ b/sdk/python/pulumi_azure/mysql/server.py @@ -919,6 +919,30 @@ def __init__(__self__, """ Manages a MySQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + infrastructure_encryption_enabled=False, + public_network_access_enabled=True, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + ``` + ## Import MySQL Server's can be imported using the `resource id`, e.g. @@ -960,6 +984,30 @@ def __init__(__self__, """ Manages a MySQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="B_Gen5_2", + storage_mb=5120, + version="5.7", + auto_grow_enabled=True, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + infrastructure_encryption_enabled=False, + public_network_access_enabled=True, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + ``` + ## Import MySQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/mysql/server_key.py b/sdk/python/pulumi_azure/mysql/server_key.py index 9809536ef3..85430d17e1 100644 --- a/sdk/python/pulumi_azure/mysql/server_key.py +++ b/sdk/python/pulumi_azure/mysql/server_key.py @@ -138,6 +138,85 @@ def __init__(__self__, """ Manages a Customer Managed Key for a MySQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="GP_Gen5_2", + administrator_login="acctestun", + administrator_login_password="H@Sh1CoR3!", + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_1", + storage_mb=51200, + version="5.7", + identity=azure.mysql.ServerIdentityArgs( + type="SystemAssigned", + )) + server = azure.keyvault.AccessPolicy("server", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_server.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ], + secret_permissions=["Get"]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + example_server_key = azure.mysql.ServerKey("exampleServerKey", + server_id=example_server.id, + key_vault_key_id=example_key.id) + ``` + ## Import A MySQL Server Key can be imported using the `resource id` of the MySQL Server Key, e.g. @@ -160,6 +239,85 @@ def __init__(__self__, """ Manages a Customer Managed Key for a MySQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="GP_Gen5_2", + administrator_login="acctestun", + administrator_login_password="H@Sh1CoR3!", + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_1", + storage_mb=51200, + version="5.7", + identity=azure.mysql.ServerIdentityArgs( + type="SystemAssigned", + )) + server = azure.keyvault.AccessPolicy("server", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_server.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ], + secret_permissions=["Get"]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + example_server_key = azure.mysql.ServerKey("exampleServerKey", + server_id=example_server.id, + key_vault_key_id=example_key.id) + ``` + ## Import A MySQL Server Key can be imported using the `resource id` of the MySQL Server Key, e.g. diff --git a/sdk/python/pulumi_azure/mysql/virtual_network_rule.py b/sdk/python/pulumi_azure/mysql/virtual_network_rule.py index e33cc7db1a..165f585894 100644 --- a/sdk/python/pulumi_azure/mysql/virtual_network_rule.py +++ b/sdk/python/pulumi_azure/mysql/virtual_network_rule.py @@ -251,6 +251,39 @@ def __init__(__self__, > **NOTE:** MySQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mysql/concepts-data-access-and-security-vnet) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_2", + storage_mb=5120, + version="5.7", + backup_retention_days=7, + geo_redundant_backup_enabled=False, + ssl_enforcement_enabled=True) + example_virtual_network_rule = azure.mysql.VirtualNetworkRule("exampleVirtualNetworkRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=internal.id) + ``` + ## Import MySQL Virtual Network Rules can be imported using the `resource id`, e.g. @@ -285,6 +318,39 @@ def __init__(__self__, > **NOTE:** MySQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/mysql/concepts-data-access-and-security-vnet) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.mysql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="mysqladminun", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_2", + storage_mb=5120, + version="5.7", + backup_retention_days=7, + geo_redundant_backup_enabled=False, + ssl_enforcement_enabled=True) + example_virtual_network_rule = azure.mysql.VirtualNetworkRule("exampleVirtualNetworkRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=internal.id) + ``` + ## Import MySQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/netapp/account.py b/sdk/python/pulumi_azure/netapp/account.py index 2c0c36ef36..f067d095bd 100644 --- a/sdk/python/pulumi_azure/netapp/account.py +++ b/sdk/python/pulumi_azure/netapp/account.py @@ -252,6 +252,26 @@ def __init__(__self__, > **NOTE:** Azure allows only one active directory can be joined to a single subscription at a time for NetApp Account. + ## NetApp Account Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.netapp.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + active_directory=azure.netapp.AccountActiveDirectoryArgs( + username="aduser", + password="aduserpwd", + smb_server_name="SMBSERVER", + dns_servers=["1.2.3.4"], + domain="westcentralus.com", + organizational_unit="OU=FirstLevel", + )) + ``` + ## Import NetApp Accounts can be imported using the `resource id`, e.g. @@ -279,6 +299,26 @@ def __init__(__self__, > **NOTE:** Azure allows only one active directory can be joined to a single subscription at a time for NetApp Account. + ## NetApp Account Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.netapp.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + active_directory=azure.netapp.AccountActiveDirectoryArgs( + username="aduser", + password="aduserpwd", + smb_server_name="SMBSERVER", + dns_servers=["1.2.3.4"], + domain="westcentralus.com", + organizational_unit="OU=FirstLevel", + )) + ``` + ## Import NetApp Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/netapp/get_account.py b/sdk/python/pulumi_azure/netapp/get_account.py index 4251ff3bb2..754017e987 100644 --- a/sdk/python/pulumi_azure/netapp/get_account.py +++ b/sdk/python/pulumi_azure/netapp/get_account.py @@ -80,6 +80,17 @@ def get_account(name: Optional[str] = None, """ Uses this data source to access information about an existing NetApp Account. + ## NetApp Account Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_account(resource_group_name="acctestRG", + name="acctestnetappaccount") + pulumi.export("netappAccountId", example.id) + ``` + :param str name: The name of the NetApp Account. :param str resource_group_name: The Name of the Resource Group where the NetApp Account exists. @@ -104,6 +115,17 @@ def get_account_output(name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing NetApp Account. + ## NetApp Account Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_account(resource_group_name="acctestRG", + name="acctestnetappaccount") + pulumi.export("netappAccountId", example.id) + ``` + :param str name: The name of the NetApp Account. :param str resource_group_name: The Name of the Resource Group where the NetApp Account exists. diff --git a/sdk/python/pulumi_azure/netapp/get_pool.py b/sdk/python/pulumi_azure/netapp/get_pool.py index 0d0cb845f5..c591c885ac 100644 --- a/sdk/python/pulumi_azure/netapp/get_pool.py +++ b/sdk/python/pulumi_azure/netapp/get_pool.py @@ -114,6 +114,18 @@ def get_pool(account_name: Optional[str] = None, """ Uses this data source to access information about an existing NetApp Pool. + ## NetApp Pool Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_pool(resource_group_name="acctestRG", + account_name="acctestnetappaccount", + name="acctestnetapppool") + pulumi.export("netappPoolId", example.id) + ``` + :param str account_name: The name of the NetApp account where the NetApp pool exists. :param str name: The name of the NetApp Pool. @@ -144,6 +156,18 @@ def get_pool_output(account_name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing NetApp Pool. + ## NetApp Pool Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_pool(resource_group_name="acctestRG", + account_name="acctestnetappaccount", + name="acctestnetapppool") + pulumi.export("netappPoolId", example.id) + ``` + :param str account_name: The name of the NetApp account where the NetApp pool exists. :param str name: The name of the NetApp Pool. diff --git a/sdk/python/pulumi_azure/netapp/get_snapshot.py b/sdk/python/pulumi_azure/netapp/get_snapshot.py index cc390c6469..6334f90ccd 100644 --- a/sdk/python/pulumi_azure/netapp/get_snapshot.py +++ b/sdk/python/pulumi_azure/netapp/get_snapshot.py @@ -110,6 +110,20 @@ def get_snapshot(account_name: Optional[str] = None, """ Uses this data source to access information about an existing NetApp Snapshot. + ## NetApp Snapshot Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.netapp.get_snapshot(resource_group_name="acctestRG", + name="acctestnetappsnapshot", + account_name="acctestnetappaccount", + pool_name="acctestnetapppool", + volume_name="acctestnetappvolume") + pulumi.export("netappSnapshotId", data["azurerm_netapp_snapshot"]["example"]["id"]) + ``` + :param str account_name: The name of the NetApp Account where the NetApp Pool exists. :param str name: The name of the NetApp Snapshot. @@ -146,6 +160,20 @@ def get_snapshot_output(account_name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing NetApp Snapshot. + ## NetApp Snapshot Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.netapp.get_snapshot(resource_group_name="acctestRG", + name="acctestnetappsnapshot", + account_name="acctestnetappaccount", + pool_name="acctestnetapppool", + volume_name="acctestnetappvolume") + pulumi.export("netappSnapshotId", data["azurerm_netapp_snapshot"]["example"]["id"]) + ``` + :param str account_name: The name of the NetApp Account where the NetApp Pool exists. :param str name: The name of the NetApp Snapshot. diff --git a/sdk/python/pulumi_azure/netapp/get_snapshot_policy.py b/sdk/python/pulumi_azure/netapp/get_snapshot_policy.py index d835bb6983..15c336ddd3 100644 --- a/sdk/python/pulumi_azure/netapp/get_snapshot_policy.py +++ b/sdk/python/pulumi_azure/netapp/get_snapshot_policy.py @@ -169,6 +169,24 @@ def get_snapshot_policy(account_name: Optional[str] = None, """ Uses this data source to access information about an existing NetApp Snapshot Policy. + ## NetApp Snapshot Policy Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_snapshot_policy(resource_group_name="acctestRG", + account_name="acctestnetappaccount", + name="example-snapshot-policy") + pulumi.export("id", example.id) + pulumi.export("name", example.name) + pulumi.export("enabled", example.enabled) + pulumi.export("hourlySchedule", example.hourly_schedules) + pulumi.export("dailySchedule", example.daily_schedules) + pulumi.export("weeklySchedule", example.weekly_schedules) + pulumi.export("monthlySchedule", example.monthly_schedules) + ``` + :param str account_name: The name of the NetApp account where the NetApp Snapshot Policy exists. :param str name: The name of the NetApp Snapshot Policy. @@ -203,6 +221,24 @@ def get_snapshot_policy_output(account_name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing NetApp Snapshot Policy. + ## NetApp Snapshot Policy Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_snapshot_policy(resource_group_name="acctestRG", + account_name="acctestnetappaccount", + name="example-snapshot-policy") + pulumi.export("id", example.id) + pulumi.export("name", example.name) + pulumi.export("enabled", example.enabled) + pulumi.export("hourlySchedule", example.hourly_schedules) + pulumi.export("dailySchedule", example.daily_schedules) + pulumi.export("weeklySchedule", example.weekly_schedules) + pulumi.export("monthlySchedule", example.monthly_schedules) + ``` + :param str account_name: The name of the NetApp account where the NetApp Snapshot Policy exists. :param str name: The name of the NetApp Snapshot Policy. diff --git a/sdk/python/pulumi_azure/netapp/get_volume.py b/sdk/python/pulumi_azure/netapp/get_volume.py index 47bcf16c73..556bf854a4 100644 --- a/sdk/python/pulumi_azure/netapp/get_volume.py +++ b/sdk/python/pulumi_azure/netapp/get_volume.py @@ -222,6 +222,19 @@ def get_volume(account_name: Optional[str] = None, """ Uses this data source to access information about an existing NetApp Volume. + ## NetApp Volume Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_volume(resource_group_name="acctestRG", + account_name="acctestnetappaccount", + pool_name="acctestnetapppool", + name="example-volume") + pulumi.export("netappVolumeId", example.id) + ``` + :param str account_name: The name of the NetApp account where the NetApp pool exists. :param str name: The name of the NetApp Volume. @@ -267,6 +280,19 @@ def get_volume_output(account_name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing NetApp Volume. + ## NetApp Volume Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_volume(resource_group_name="acctestRG", + account_name="acctestnetappaccount", + pool_name="acctestnetapppool", + name="example-volume") + pulumi.export("netappVolumeId", example.id) + ``` + :param str account_name: The name of the NetApp account where the NetApp pool exists. :param str name: The name of the NetApp Volume. diff --git a/sdk/python/pulumi_azure/netapp/get_volume_group_sap_hana.py b/sdk/python/pulumi_azure/netapp/get_volume_group_sap_hana.py index 14d797a8e9..f9fb3adbdb 100644 --- a/sdk/python/pulumi_azure/netapp/get_volume_group_sap_hana.py +++ b/sdk/python/pulumi_azure/netapp/get_volume_group_sap_hana.py @@ -130,6 +130,18 @@ def get_volume_group_sap_hana(account_name: Optional[str] = None, """ Use this data source to access information about an existing Application Volume Group for SAP HANA application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_volume_group_sap_hana(name="existing application volume group name", + resource_group_name="resource group name where the account and volume group belong to", + account_name="existing account where the application volume group belong to") + pulumi.export("id", example.id) + ``` + :param str account_name: Name of the account where the application volume group belong to. :param str name: The name of this Application Volume Group for SAP HANA application. @@ -161,6 +173,18 @@ def get_volume_group_sap_hana_output(account_name: Optional[pulumi.Input[str]] = """ Use this data source to access information about an existing Application Volume Group for SAP HANA application. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_volume_group_sap_hana(name="existing application volume group name", + resource_group_name="resource group name where the account and volume group belong to", + account_name="existing account where the application volume group belong to") + pulumi.export("id", example.id) + ``` + :param str account_name: Name of the account where the application volume group belong to. :param str name: The name of this Application Volume Group for SAP HANA application. diff --git a/sdk/python/pulumi_azure/netapp/get_volume_quota_rule.py b/sdk/python/pulumi_azure/netapp/get_volume_quota_rule.py index c4199e546f..70ad7a3396 100644 --- a/sdk/python/pulumi_azure/netapp/get_volume_quota_rule.py +++ b/sdk/python/pulumi_azure/netapp/get_volume_quota_rule.py @@ -116,6 +116,17 @@ def get_volume_quota_rule(name: Optional[str] = None, """ Use this data source to access information about an existing Volume Quota Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_volume_quota_rule(name="exampleQuotaRule", + volume_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Volume Quota Rule. :param str volume_id: The NetApp volume ID where the Volume Quota Rule is assigned to. @@ -143,6 +154,17 @@ def get_volume_quota_rule_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Volume Quota Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.netapp.get_volume_quota_rule(name="exampleQuotaRule", + volume_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Volume Quota Rule. :param str volume_id: The NetApp volume ID where the Volume Quota Rule is assigned to. diff --git a/sdk/python/pulumi_azure/netapp/pool.py b/sdk/python/pulumi_azure/netapp/pool.py index 2d9c740129..7db520ffa4 100644 --- a/sdk/python/pulumi_azure/netapp/pool.py +++ b/sdk/python/pulumi_azure/netapp/pool.py @@ -382,6 +382,24 @@ def __init__(__self__, """ Manages a Pool within a NetApp Account. + ## NetApp Pool Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pool = azure.netapp.Pool("examplePool", + account_name=example_account.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_level="Premium", + size_in_tb=4) + ``` + ## Import NetApp Pool can be imported using the `resource id`, e.g. @@ -412,6 +430,24 @@ def __init__(__self__, """ Manages a Pool within a NetApp Account. + ## NetApp Pool Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pool = azure.netapp.Pool("examplePool", + account_name=example_account.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_level="Premium", + size_in_tb=4) + ``` + ## Import NetApp Pool can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/netapp/snapshot.py b/sdk/python/pulumi_azure/netapp/snapshot.py index 0ed3bcf0f4..76908dc82a 100644 --- a/sdk/python/pulumi_azure/netapp/snapshot.py +++ b/sdk/python/pulumi_azure/netapp/snapshot.py @@ -296,6 +296,57 @@ def __init__(__self__, """ Manages a NetApp Snapshot. + ## NetApp Snapshot Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="netapp", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Netapp/volumes", + actions=[ + "Microsoft.Network/networkinterfaces/*", + "Microsoft.Network/virtualNetworks/subnets/join/action", + ], + ), + )]) + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pool = azure.netapp.Pool("examplePool", + account_name=example_account.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_level="Premium", + size_in_tb=4) + example_volume = azure.netapp.Volume("exampleVolume", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_name=example_account.name, + pool_name=example_pool.name, + volume_path="my-unique-file-path", + service_level="Premium", + subnet_id=example_subnet.id, + storage_quota_in_gb=100) + example_snapshot = azure.netapp.Snapshot("exampleSnapshot", + account_name=example_account.name, + pool_name=example_pool.name, + volume_name=example_volume.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import NetApp Snapshot can be imported using the `resource id`, e.g. @@ -322,6 +373,57 @@ def __init__(__self__, """ Manages a NetApp Snapshot. + ## NetApp Snapshot Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="netapp", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Netapp/volumes", + actions=[ + "Microsoft.Network/networkinterfaces/*", + "Microsoft.Network/virtualNetworks/subnets/join/action", + ], + ), + )]) + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pool = azure.netapp.Pool("examplePool", + account_name=example_account.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + service_level="Premium", + size_in_tb=4) + example_volume = azure.netapp.Volume("exampleVolume", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_name=example_account.name, + pool_name=example_pool.name, + volume_path="my-unique-file-path", + service_level="Premium", + subnet_id=example_subnet.id, + storage_quota_in_gb=100) + example_snapshot = azure.netapp.Snapshot("exampleSnapshot", + account_name=example_account.name, + pool_name=example_pool.name, + volume_name=example_volume.name, + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import NetApp Snapshot can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/netapp/snapshot_policy.py b/sdk/python/pulumi_azure/netapp/snapshot_policy.py index 7294d84ce0..f837723767 100644 --- a/sdk/python/pulumi_azure/netapp/snapshot_policy.py +++ b/sdk/python/pulumi_azure/netapp/snapshot_policy.py @@ -453,6 +453,52 @@ def __init__(__self__, """ Manages a NetApp Snapshot Policy. + ## NetApp Snapshot Policy Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_snapshot_policy = azure.netapp.SnapshotPolicy("exampleSnapshotPolicy", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_name=example_account.name, + enabled=True, + hourly_schedule=azure.netapp.SnapshotPolicyHourlyScheduleArgs( + snapshots_to_keep=4, + minute=15, + ), + daily_schedule=azure.netapp.SnapshotPolicyDailyScheduleArgs( + snapshots_to_keep=2, + hour=20, + minute=15, + ), + weekly_schedule=azure.netapp.SnapshotPolicyWeeklyScheduleArgs( + snapshots_to_keep=1, + days_of_weeks=[ + "Monday", + "Friday", + ], + hour=23, + minute=0, + ), + monthly_schedule=azure.netapp.SnapshotPolicyMonthlyScheduleArgs( + snapshots_to_keep=1, + days_of_months=[ + 1, + 15, + 20, + 30, + ], + hour=5, + minute=45, + )) + ``` + ## Import NetApp Snapshot Policy can be imported using the `resource id`, e.g. @@ -483,6 +529,52 @@ def __init__(__self__, """ Manages a NetApp Snapshot Policy. + ## NetApp Snapshot Policy Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_snapshot_policy = azure.netapp.SnapshotPolicy("exampleSnapshotPolicy", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_name=example_account.name, + enabled=True, + hourly_schedule=azure.netapp.SnapshotPolicyHourlyScheduleArgs( + snapshots_to_keep=4, + minute=15, + ), + daily_schedule=azure.netapp.SnapshotPolicyDailyScheduleArgs( + snapshots_to_keep=2, + hour=20, + minute=15, + ), + weekly_schedule=azure.netapp.SnapshotPolicyWeeklyScheduleArgs( + snapshots_to_keep=1, + days_of_weeks=[ + "Monday", + "Friday", + ], + hour=23, + minute=0, + ), + monthly_schedule=azure.netapp.SnapshotPolicyMonthlyScheduleArgs( + snapshots_to_keep=1, + days_of_months=[ + 1, + 15, + 20, + 30, + ], + hour=5, + minute=45, + )) + ``` + ## Import NetApp Snapshot Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/netapp/volume_quota_rule.py b/sdk/python/pulumi_azure/netapp/volume_quota_rule.py index 7a851d76cb..2e802d7bc6 100644 --- a/sdk/python/pulumi_azure/netapp/volume_quota_rule.py +++ b/sdk/python/pulumi_azure/netapp/volume_quota_rule.py @@ -311,6 +311,78 @@ def __init__(__self__, """ Manages a Volume Quota Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="netapp", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Netapp/volumes", + actions=[ + "Microsoft.Network/networkinterfaces/*", + "Microsoft.Network/virtualNetworks/subnets/join/action", + ], + ), + )]) + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pool = azure.netapp.Pool("examplePool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_name=example_account.name, + service_level="Premium", + size_in_tb=4) + example_volume = azure.netapp.Volume("exampleVolume", + location=example_resource_group.location, + zone="1", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + pool_name=example_pool.name, + volume_path="my-unique-file-path", + service_level="Premium", + subnet_id=example_subnet.id, + network_features="Basic", + protocols=["NFSv4.1"], + security_style="unix", + storage_quota_in_gb=100, + snapshot_directory_visible=False) + quota1 = azure.netapp.VolumeQuotaRule("quota1", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_target="3001", + quota_size_in_kib=1024, + quota_type="IndividualGroupQuota") + quota2 = azure.netapp.VolumeQuotaRule("quota2", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_target="2001", + quota_size_in_kib=1024, + quota_type="IndividualUserQuota") + quota3 = azure.netapp.VolumeQuotaRule("quota3", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_size_in_kib=1024, + quota_type="DefaultUserQuota") + quota4 = azure.netapp.VolumeQuotaRule("quota4", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_size_in_kib=1024, + quota_type="DefaultGroupQuota") + ``` + ## Import Volume Quota Rules can be imported using the `resource id`, e.g. @@ -341,6 +413,78 @@ def __init__(__self__, """ Manages a Volume Quota Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="netapp", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Netapp/volumes", + actions=[ + "Microsoft.Network/networkinterfaces/*", + "Microsoft.Network/virtualNetworks/subnets/join/action", + ], + ), + )]) + example_account = azure.netapp.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_pool = azure.netapp.Pool("examplePool", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_name=example_account.name, + service_level="Premium", + size_in_tb=4) + example_volume = azure.netapp.Volume("exampleVolume", + location=example_resource_group.location, + zone="1", + resource_group_name=example_resource_group.name, + account_name=example_account.name, + pool_name=example_pool.name, + volume_path="my-unique-file-path", + service_level="Premium", + subnet_id=example_subnet.id, + network_features="Basic", + protocols=["NFSv4.1"], + security_style="unix", + storage_quota_in_gb=100, + snapshot_directory_visible=False) + quota1 = azure.netapp.VolumeQuotaRule("quota1", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_target="3001", + quota_size_in_kib=1024, + quota_type="IndividualGroupQuota") + quota2 = azure.netapp.VolumeQuotaRule("quota2", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_target="2001", + quota_size_in_kib=1024, + quota_type="IndividualUserQuota") + quota3 = azure.netapp.VolumeQuotaRule("quota3", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_size_in_kib=1024, + quota_type="DefaultUserQuota") + quota4 = azure.netapp.VolumeQuotaRule("quota4", + location=example_resource_group.location, + volume_id=example_volume.id, + quota_size_in_kib=1024, + quota_type="DefaultGroupQuota") + ``` + ## Import Volume Quota Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/_inputs.py b/sdk/python/pulumi_azure/network/_inputs.py index 0d36c39636..062ce3a813 100644 --- a/sdk/python/pulumi_azure/network/_inputs.py +++ b/sdk/python/pulumi_azure/network/_inputs.py @@ -1800,6 +1800,10 @@ def __init__(__self__, *, :param pulumi.Input[Sequence[pulumi.Input['ApplicationGatewayPrivateLinkConfigurationIpConfigurationArgs']]] ip_configurations: One or more `ip_configuration` blocks as defined below. > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + + ```python + import pulumi + ``` :param pulumi.Input[str] name: The name of the private link configuration. :param pulumi.Input[str] id: The ID of the Rewrite Rule Set """ @@ -1836,6 +1840,10 @@ def ip_configurations(self) -> pulumi.Input[Sequence[pulumi.Input['ApplicationGa One or more `ip_configuration` blocks as defined below. > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + + ```python + import pulumi + ``` """ return pulumi.get(self, "ip_configurations") diff --git a/sdk/python/pulumi_azure/network/application_gateway.py b/sdk/python/pulumi_azure/network/application_gateway.py index 035e4d5a09..31ec3528e9 100644 --- a/sdk/python/pulumi_azure/network/application_gateway.py +++ b/sdk/python/pulumi_azure/network/application_gateway.py @@ -1418,6 +1418,83 @@ def __init__(__self__, """ Manages an Application Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.254.0.0/16"]) + frontend = azure.network.Subnet("frontend", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.254.0.0/24"]) + backend = azure.network.Subnet("backend", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.254.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Dynamic") + backend_address_pool_name = example_virtual_network.name.apply(lambda name: f"{name}-beap") + frontend_port_name = example_virtual_network.name.apply(lambda name: f"{name}-feport") + frontend_ip_configuration_name = example_virtual_network.name.apply(lambda name: f"{name}-feip") + http_setting_name = example_virtual_network.name.apply(lambda name: f"{name}-be-htst") + listener_name = example_virtual_network.name.apply(lambda name: f"{name}-httplstn") + request_routing_rule_name = example_virtual_network.name.apply(lambda name: f"{name}-rqrt") + redirect_configuration_name = example_virtual_network.name.apply(lambda name: f"{name}-rdrcfg") + network = azure.network.ApplicationGateway("network", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.network.ApplicationGatewaySkuArgs( + name="Standard_v2", + tier="Standard_v2", + capacity=2, + ), + gateway_ip_configurations=[azure.network.ApplicationGatewayGatewayIpConfigurationArgs( + name="my-gateway-ip-configuration", + subnet_id=frontend.id, + )], + frontend_ports=[azure.network.ApplicationGatewayFrontendPortArgs( + name=frontend_port_name, + port=80, + )], + frontend_ip_configurations=[azure.network.ApplicationGatewayFrontendIpConfigurationArgs( + name=frontend_ip_configuration_name, + public_ip_address_id=example_public_ip.id, + )], + backend_address_pools=[azure.network.ApplicationGatewayBackendAddressPoolArgs( + name=backend_address_pool_name, + )], + backend_http_settings=[azure.network.ApplicationGatewayBackendHttpSettingArgs( + name=http_setting_name, + cookie_based_affinity="Disabled", + path="/path1/", + port=80, + protocol="Http", + request_timeout=60, + )], + http_listeners=[azure.network.ApplicationGatewayHttpListenerArgs( + name=listener_name, + frontend_ip_configuration_name=frontend_ip_configuration_name, + frontend_port_name=frontend_port_name, + protocol="Http", + )], + request_routing_rules=[azure.network.ApplicationGatewayRequestRoutingRuleArgs( + name=request_routing_rule_name, + priority=9, + rule_type="Basic", + http_listener_name=listener_name, + backend_address_pool_name=backend_address_pool_name, + backend_http_settings_name=http_setting_name, + )]) + ``` + ## Import Application Gateway's can be imported using the `resource id`, e.g. @@ -1473,6 +1550,83 @@ def __init__(__self__, """ Manages an Application Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.254.0.0/16"]) + frontend = azure.network.Subnet("frontend", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.254.0.0/24"]) + backend = azure.network.Subnet("backend", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.254.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Dynamic") + backend_address_pool_name = example_virtual_network.name.apply(lambda name: f"{name}-beap") + frontend_port_name = example_virtual_network.name.apply(lambda name: f"{name}-feport") + frontend_ip_configuration_name = example_virtual_network.name.apply(lambda name: f"{name}-feip") + http_setting_name = example_virtual_network.name.apply(lambda name: f"{name}-be-htst") + listener_name = example_virtual_network.name.apply(lambda name: f"{name}-httplstn") + request_routing_rule_name = example_virtual_network.name.apply(lambda name: f"{name}-rqrt") + redirect_configuration_name = example_virtual_network.name.apply(lambda name: f"{name}-rdrcfg") + network = azure.network.ApplicationGateway("network", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.network.ApplicationGatewaySkuArgs( + name="Standard_v2", + tier="Standard_v2", + capacity=2, + ), + gateway_ip_configurations=[azure.network.ApplicationGatewayGatewayIpConfigurationArgs( + name="my-gateway-ip-configuration", + subnet_id=frontend.id, + )], + frontend_ports=[azure.network.ApplicationGatewayFrontendPortArgs( + name=frontend_port_name, + port=80, + )], + frontend_ip_configurations=[azure.network.ApplicationGatewayFrontendIpConfigurationArgs( + name=frontend_ip_configuration_name, + public_ip_address_id=example_public_ip.id, + )], + backend_address_pools=[azure.network.ApplicationGatewayBackendAddressPoolArgs( + name=backend_address_pool_name, + )], + backend_http_settings=[azure.network.ApplicationGatewayBackendHttpSettingArgs( + name=http_setting_name, + cookie_based_affinity="Disabled", + path="/path1/", + port=80, + protocol="Http", + request_timeout=60, + )], + http_listeners=[azure.network.ApplicationGatewayHttpListenerArgs( + name=listener_name, + frontend_ip_configuration_name=frontend_ip_configuration_name, + frontend_port_name=frontend_port_name, + protocol="Http", + )], + request_routing_rules=[azure.network.ApplicationGatewayRequestRoutingRuleArgs( + name=request_routing_rule_name, + priority=9, + rule_type="Basic", + http_listener_name=listener_name, + backend_address_pool_name=backend_address_pool_name, + backend_http_settings_name=http_setting_name, + )]) + ``` + ## Import Application Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/application_security_group.py b/sdk/python/pulumi_azure/network/application_security_group.py index b983f1e9f4..5742251fd2 100644 --- a/sdk/python/pulumi_azure/network/application_security_group.py +++ b/sdk/python/pulumi_azure/network/application_security_group.py @@ -207,6 +207,21 @@ def __init__(__self__, """ Manages an Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_application_security_group = azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Hello": "World", + }) + ``` + ## Import Application Security Groups can be imported using the `resource id`, e.g. @@ -231,6 +246,21 @@ def __init__(__self__, """ Manages an Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_application_security_group = azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "Hello": "World", + }) + ``` + ## Import Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/bgp_connection.py b/sdk/python/pulumi_azure/network/bgp_connection.py index b50f734087..dbc9edb0c9 100644 --- a/sdk/python/pulumi_azure/network/bgp_connection.py +++ b/sdk/python/pulumi_azure/network/bgp_connection.py @@ -258,6 +258,43 @@ def __init__(__self__, """ Manages a Bgp Connection for a Virtual Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_virtual_hub_ip = azure.network.VirtualHubIp("exampleVirtualHubIp", + virtual_hub_id=example_virtual_hub.id, + private_ip_address="10.5.1.18", + private_ip_allocation_method="Static", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id) + example_bgp_connection = azure.network.BgpConnection("exampleBgpConnection", + virtual_hub_id=example_virtual_hub.id, + peer_asn=65514, + peer_ip="169.254.21.5", + opts=pulumi.ResourceOptions(depends_on=[example_virtual_hub_ip])) + ``` + ## Import Virtual Hub Bgp Connections can be imported using the `resource id`, e.g. @@ -283,6 +320,43 @@ def __init__(__self__, """ Manages a Bgp Connection for a Virtual Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_virtual_hub_ip = azure.network.VirtualHubIp("exampleVirtualHubIp", + virtual_hub_id=example_virtual_hub.id, + private_ip_address="10.5.1.18", + private_ip_allocation_method="Static", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id) + example_bgp_connection = azure.network.BgpConnection("exampleBgpConnection", + virtual_hub_id=example_virtual_hub.id, + peer_asn=65514, + peer_ip="169.254.21.5", + opts=pulumi.ResourceOptions(depends_on=[example_virtual_hub_ip])) + ``` + ## Import Virtual Hub Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/ddos_protection_plan.py b/sdk/python/pulumi_azure/network/ddos_protection_plan.py index e32f8c25b2..21de0fbda3 100644 --- a/sdk/python/pulumi_azure/network/ddos_protection_plan.py +++ b/sdk/python/pulumi_azure/network/ddos_protection_plan.py @@ -231,6 +231,18 @@ def __init__(__self__, > **NOTE** The DDoS Protection Plan is a [high-cost service](https://azure.microsoft.com/en-us/pricing/details/ddos-protection/#pricing). Please keep this in mind while testing and learning. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_ddos_protection_plan = azure.network.DdosProtectionPlan("exampleDdosProtectionPlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Azure DDoS Protection Plan can be imported using the `resource id`, e.g. @@ -259,6 +271,18 @@ def __init__(__self__, > **NOTE** The DDoS Protection Plan is a [high-cost service](https://azure.microsoft.com/en-us/pricing/details/ddos-protection/#pricing). Please keep this in mind while testing and learning. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_ddos_protection_plan = azure.network.DdosProtectionPlan("exampleDdosProtectionPlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Azure DDoS Protection Plan can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/express_route_circuit.py b/sdk/python/pulumi_azure/network/express_route_circuit.py index cc8a9b1963..b3ba4b5d06 100644 --- a/sdk/python/pulumi_azure/network/express_route_circuit.py +++ b/sdk/python/pulumi_azure/network/express_route_circuit.py @@ -598,6 +598,28 @@ def __init__(__self__, """ Manages an ExpressRoute circuit. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + tags={ + "environment": "Production", + }) + ``` + ## Import ExpressRoute circuits can be imported using the `resource id`, e.g. @@ -636,6 +658,28 @@ def __init__(__self__, """ Manages an ExpressRoute circuit. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + tags={ + "environment": "Production", + }) + ``` + ## Import ExpressRoute circuits can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/express_route_circuit_authorization.py b/sdk/python/pulumi_azure/network/express_route_circuit_authorization.py index 8e0cf25135..fed7b66036 100644 --- a/sdk/python/pulumi_azure/network/express_route_circuit_authorization.py +++ b/sdk/python/pulumi_azure/network/express_route_circuit_authorization.py @@ -215,6 +215,32 @@ def __init__(__self__, """ Manages an ExpressRoute Circuit Authorization. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + allow_classic_operations=False, + tags={ + "environment": "Production", + }) + example_express_route_circuit_authorization = azure.network.ExpressRouteCircuitAuthorization("exampleExpressRouteCircuitAuthorization", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name) + ``` + ## Import ExpressRoute Circuit Authorizations can be imported using the `resource id`, e.g. @@ -238,6 +264,32 @@ def __init__(__self__, """ Manages an ExpressRoute Circuit Authorization. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + allow_classic_operations=False, + tags={ + "environment": "Production", + }) + example_express_route_circuit_authorization = azure.network.ExpressRouteCircuitAuthorization("exampleExpressRouteCircuitAuthorization", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name) + ``` + ## Import ExpressRoute Circuit Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/express_route_circuit_connection.py b/sdk/python/pulumi_azure/network/express_route_circuit_connection.py index 3976cee11b..a15b6845a4 100644 --- a/sdk/python/pulumi_azure/network/express_route_circuit_connection.py +++ b/sdk/python/pulumi_azure/network/express_route_circuit_connection.py @@ -307,6 +307,68 @@ def __init__(__self__, """ Manages an Express Route Circuit Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Equinix-Seattle-SE2", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + express_route_port_id=example_express_route_port.id, + bandwidth_in_gbps=5, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + )) + example2_express_route_port = azure.network.ExpressRoutePort("example2ExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Allied-Toronto-King-West", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example2_express_route_circuit = azure.network.ExpressRouteCircuit("example2ExpressRouteCircuit", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + express_route_port_id=example2_express_route_port.id, + bandwidth_in_gbps=5, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + )) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + shared_key="ItsASecret", + peer_asn=100, + primary_peer_address_prefix="192.168.1.0/30", + secondary_peer_address_prefix="192.168.1.0/30", + vlan_id=100) + example2_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("example2ExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example2_express_route_circuit.name, + resource_group_name=example_resource_group.name, + shared_key="ItsASecret", + peer_asn=100, + primary_peer_address_prefix="192.168.1.0/30", + secondary_peer_address_prefix="192.168.1.0/30", + vlan_id=100) + example_express_route_circuit_connection = azure.network.ExpressRouteCircuitConnection("exampleExpressRouteCircuitConnection", + peering_id=example_express_route_circuit_peering.id, + peer_peering_id=example2_express_route_circuit_peering.id, + address_prefix_ipv4="192.169.9.0/29", + authorization_key="846a1918-b7a2-4917-b43c-8c4cdaee006a") + ``` + ## Import Express Route Circuit Connections can be imported using the `resource id`, e.g. @@ -335,6 +397,68 @@ def __init__(__self__, """ Manages an Express Route Circuit Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Equinix-Seattle-SE2", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + express_route_port_id=example_express_route_port.id, + bandwidth_in_gbps=5, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + )) + example2_express_route_port = azure.network.ExpressRoutePort("example2ExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Allied-Toronto-King-West", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example2_express_route_circuit = azure.network.ExpressRouteCircuit("example2ExpressRouteCircuit", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + express_route_port_id=example2_express_route_port.id, + bandwidth_in_gbps=5, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + )) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + shared_key="ItsASecret", + peer_asn=100, + primary_peer_address_prefix="192.168.1.0/30", + secondary_peer_address_prefix="192.168.1.0/30", + vlan_id=100) + example2_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("example2ExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example2_express_route_circuit.name, + resource_group_name=example_resource_group.name, + shared_key="ItsASecret", + peer_asn=100, + primary_peer_address_prefix="192.168.1.0/30", + secondary_peer_address_prefix="192.168.1.0/30", + vlan_id=100) + example_express_route_circuit_connection = azure.network.ExpressRouteCircuitConnection("exampleExpressRouteCircuitConnection", + peering_id=example_express_route_circuit_peering.id, + peer_peering_id=example2_express_route_circuit_peering.id, + address_prefix_ipv4="192.169.9.0/29", + authorization_key="846a1918-b7a2-4917-b43c-8c4cdaee006a") + ``` + ## Import Express Route Circuit Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/express_route_circuit_peering.py b/sdk/python/pulumi_azure/network/express_route_circuit_peering.py index acc69b276c..f4a6fb89a6 100644 --- a/sdk/python/pulumi_azure/network/express_route_circuit_peering.py +++ b/sdk/python/pulumi_azure/network/express_route_circuit_peering.py @@ -641,6 +641,84 @@ def __init__(__self__, Manages an ExpressRoute Circuit Peering. ## Example Usage + ### Creating A Microsoft Peering) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + allow_classic_operations=False, + tags={ + "environment": "Production", + }) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="MicrosoftPeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + peer_asn=100, + primary_peer_address_prefix="123.0.0.0/30", + secondary_peer_address_prefix="123.0.0.4/30", + ipv4_enabled=True, + vlan_id=300, + microsoft_peering_config=azure.network.ExpressRouteCircuitPeeringMicrosoftPeeringConfigArgs( + advertised_public_prefixes=["123.1.0.0/24"], + ), + ipv6=azure.network.ExpressRouteCircuitPeeringIpv6Args( + primary_peer_address_prefix="2002:db01::/126", + secondary_peer_address_prefix="2003:db01::/126", + enabled=True, + microsoft_peering=azure.network.ExpressRouteCircuitPeeringIpv6MicrosoftPeeringArgs( + advertised_public_prefixes=["2002:db01::/126"], + ), + )) + ``` + ### Creating Azure Private Peering) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + allow_classic_operations=False, + tags={ + "environment": "Production", + }) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + peer_asn=100, + primary_peer_address_prefix="123.0.0.0/30", + secondary_peer_address_prefix="123.0.0.4/30", + ipv4_enabled=True, + vlan_id=300, + ipv6=azure.network.ExpressRouteCircuitPeeringIpv6Args( + primary_peer_address_prefix="2002:db01::/126", + secondary_peer_address_prefix="2003:db01::/126", + enabled=True, + )) + ``` ## Import @@ -679,6 +757,84 @@ def __init__(__self__, Manages an ExpressRoute Circuit Peering. ## Example Usage + ### Creating A Microsoft Peering) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + allow_classic_operations=False, + tags={ + "environment": "Production", + }) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="MicrosoftPeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + peer_asn=100, + primary_peer_address_prefix="123.0.0.0/30", + secondary_peer_address_prefix="123.0.0.4/30", + ipv4_enabled=True, + vlan_id=300, + microsoft_peering_config=azure.network.ExpressRouteCircuitPeeringMicrosoftPeeringConfigArgs( + advertised_public_prefixes=["123.1.0.0/24"], + ), + ipv6=azure.network.ExpressRouteCircuitPeeringIpv6Args( + primary_peer_address_prefix="2002:db01::/126", + secondary_peer_address_prefix="2003:db01::/126", + enabled=True, + microsoft_peering=azure.network.ExpressRouteCircuitPeeringIpv6MicrosoftPeeringArgs( + advertised_public_prefixes=["2002:db01::/126"], + ), + )) + ``` + ### Creating Azure Private Peering) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + service_provider_name="Equinix", + peering_location="Silicon Valley", + bandwidth_in_mbps=50, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + ), + allow_classic_operations=False, + tags={ + "environment": "Production", + }) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + peer_asn=100, + primary_peer_address_prefix="123.0.0.0/30", + secondary_peer_address_prefix="123.0.0.4/30", + ipv4_enabled=True, + vlan_id=300, + ipv6=azure.network.ExpressRouteCircuitPeeringIpv6Args( + primary_peer_address_prefix="2002:db01::/126", + secondary_peer_address_prefix="2003:db01::/126", + enabled=True, + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/network/express_route_connection.py b/sdk/python/pulumi_azure/network/express_route_connection.py index d3736f457f..7740bce94c 100644 --- a/sdk/python/pulumi_azure/network/express_route_connection.py +++ b/sdk/python/pulumi_azure/network/express_route_connection.py @@ -380,6 +380,55 @@ def __init__(__self__, > **NOTE:** The provider status of the Express Route Circuit must be set as provisioned while creating the Express Route Connection. See more details [here](https://docs.microsoft.com/azure/expressroute/expressroute-howto-circuit-portal-resource-manager#send-the-service-key-to-your-connectivity-provider-for-provisioning). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_express_route_gateway = azure.network.ExpressRouteGateway("exampleExpressRouteGateway", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_hub_id=example_virtual_hub.id, + scale_units=1) + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Equinix-Seattle-SE2", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + express_route_port_id=example_express_route_port.id, + bandwidth_in_gbps=5, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + )) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + shared_key="ItsASecret", + peer_asn=100, + primary_peer_address_prefix="192.168.1.0/30", + secondary_peer_address_prefix="192.168.2.0/30", + vlan_id=100) + example_express_route_connection = azure.network.ExpressRouteConnection("exampleExpressRouteConnection", + express_route_gateway_id=example_express_route_gateway.id, + express_route_circuit_peering_id=example_express_route_circuit_peering.id) + ``` + ## Import Express Route Connections can be imported using the `resource id`, e.g. @@ -410,6 +459,55 @@ def __init__(__self__, > **NOTE:** The provider status of the Express Route Circuit must be set as provisioned while creating the Express Route Connection. See more details [here](https://docs.microsoft.com/azure/expressroute/expressroute-howto-circuit-portal-resource-manager#send-the-service-key-to-your-connectivity-provider-for-provisioning). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_express_route_gateway = azure.network.ExpressRouteGateway("exampleExpressRouteGateway", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_hub_id=example_virtual_hub.id, + scale_units=1) + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Equinix-Seattle-SE2", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example_express_route_circuit = azure.network.ExpressRouteCircuit("exampleExpressRouteCircuit", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + express_route_port_id=example_express_route_port.id, + bandwidth_in_gbps=5, + sku=azure.network.ExpressRouteCircuitSkuArgs( + tier="Standard", + family="MeteredData", + )) + example_express_route_circuit_peering = azure.network.ExpressRouteCircuitPeering("exampleExpressRouteCircuitPeering", + peering_type="AzurePrivatePeering", + express_route_circuit_name=example_express_route_circuit.name, + resource_group_name=example_resource_group.name, + shared_key="ItsASecret", + peer_asn=100, + primary_peer_address_prefix="192.168.1.0/30", + secondary_peer_address_prefix="192.168.2.0/30", + vlan_id=100) + example_express_route_connection = azure.network.ExpressRouteConnection("exampleExpressRouteConnection", + express_route_gateway_id=example_express_route_gateway.id, + express_route_circuit_peering_id=example_express_route_circuit_peering.id) + ``` + ## Import Express Route Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/express_route_gateway.py b/sdk/python/pulumi_azure/network/express_route_gateway.py index feee4e895c..77520a0258 100644 --- a/sdk/python/pulumi_azure/network/express_route_gateway.py +++ b/sdk/python/pulumi_azure/network/express_route_gateway.py @@ -332,6 +332,31 @@ def __init__(__self__, """ Manages an ExpressRoute gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_express_route_gateway = azure.network.ExpressRouteGateway("exampleExpressRouteGateway", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_hub_id=example_virtual_hub.id, + scale_units=1, + tags={ + "environment": "Production", + }) + ``` + ## Import ExpressRoute Gateways can be imported using the `resource id`, e.g. @@ -359,6 +384,31 @@ def __init__(__self__, """ Manages an ExpressRoute gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_express_route_gateway = azure.network.ExpressRouteGateway("exampleExpressRouteGateway", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_hub_id=example_virtual_hub.id, + scale_units=1, + tags={ + "environment": "Production", + }) + ``` + ## Import ExpressRoute Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/express_route_port.py b/sdk/python/pulumi_azure/network/express_route_port.py index f7071d7ed5..f010c907eb 100644 --- a/sdk/python/pulumi_azure/network/express_route_port.py +++ b/sdk/python/pulumi_azure/network/express_route_port.py @@ -537,6 +537,21 @@ def __init__(__self__, """ Manages a Express Route Port. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Airtel-Chennai-CLS", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + ``` + ## Import Express Route Ports can be imported using the `resource id`, e.g. @@ -568,6 +583,21 @@ def __init__(__self__, """ Manages a Express Route Port. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Airtel-Chennai-CLS", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + ``` + ## Import Express Route Ports can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/express_route_port_authorization.py b/sdk/python/pulumi_azure/network/express_route_port_authorization.py index c9e2fe398d..81a00447a1 100644 --- a/sdk/python/pulumi_azure/network/express_route_port_authorization.py +++ b/sdk/python/pulumi_azure/network/express_route_port_authorization.py @@ -215,6 +215,24 @@ def __init__(__self__, """ Manages an ExpressRoute Port Authorization. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Airtel-Chennai-CLS", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example_express_route_port_authorization = azure.network.ExpressRoutePortAuthorization("exampleExpressRoutePortAuthorization", + express_route_port_name=example_express_route_port.name, + resource_group_name=example_resource_group.name) + ``` + ## Import ExpressRoute Port Authorizations can be imported using the `resource id`, e.g. @@ -238,6 +256,24 @@ def __init__(__self__, """ Manages an ExpressRoute Port Authorization. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_express_route_port = azure.network.ExpressRoutePort("exampleExpressRoutePort", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + peering_location="Airtel-Chennai-CLS", + bandwidth_in_gbps=10, + encapsulation="Dot1Q") + example_express_route_port_authorization = azure.network.ExpressRoutePortAuthorization("exampleExpressRoutePortAuthorization", + express_route_port_name=example_express_route_port.name, + resource_group_name=example_resource_group.name) + ``` + ## Import ExpressRoute Port Authorizations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/firewall.py b/sdk/python/pulumi_azure/network/firewall.py index 977eb1ebad..103c1ed682 100644 --- a/sdk/python/pulumi_azure/network/firewall.py +++ b/sdk/python/pulumi_azure/network/firewall.py @@ -625,6 +625,38 @@ def __init__(__self__, """ Manages an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + ``` + ## Import Azure Firewalls can be imported using the `resource id`, e.g. @@ -661,6 +693,38 @@ def __init__(__self__, """ Manages an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + ``` + ## Import Azure Firewalls can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/firewall_application_rule_collection.py b/sdk/python/pulumi_azure/network/firewall_application_rule_collection.py index 2c5bcaa152..29c44b759b 100644 --- a/sdk/python/pulumi_azure/network/firewall_application_rule_collection.py +++ b/sdk/python/pulumi_azure/network/firewall_application_rule_collection.py @@ -291,6 +291,52 @@ def __init__(__self__, """ Manages an Application Rule Collection within an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + example_firewall_application_rule_collection = azure.network.FirewallApplicationRuleCollection("exampleFirewallApplicationRuleCollection", + azure_firewall_name=example_firewall.name, + resource_group_name=example_resource_group.name, + priority=100, + action="Allow", + rules=[azure.network.FirewallApplicationRuleCollectionRuleArgs( + name="testrule", + source_addresses=["10.0.0.0/16"], + target_fqdns=["*.google.com"], + protocols=[azure.network.FirewallApplicationRuleCollectionRuleProtocolArgs( + port=443, + type="Https", + )], + )]) + ``` + ## Import Firewall Application Rule Collections can be imported using the `resource id`, e.g. @@ -317,6 +363,52 @@ def __init__(__self__, """ Manages an Application Rule Collection within an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + example_firewall_application_rule_collection = azure.network.FirewallApplicationRuleCollection("exampleFirewallApplicationRuleCollection", + azure_firewall_name=example_firewall.name, + resource_group_name=example_resource_group.name, + priority=100, + action="Allow", + rules=[azure.network.FirewallApplicationRuleCollectionRuleArgs( + name="testrule", + source_addresses=["10.0.0.0/16"], + target_fqdns=["*.google.com"], + protocols=[azure.network.FirewallApplicationRuleCollectionRuleProtocolArgs( + port=443, + type="Https", + )], + )]) + ``` + ## Import Firewall Application Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/firewall_nat_rule_collection.py b/sdk/python/pulumi_azure/network/firewall_nat_rule_collection.py index e5c5c1110d..f9e3d11081 100644 --- a/sdk/python/pulumi_azure/network/firewall_nat_rule_collection.py +++ b/sdk/python/pulumi_azure/network/firewall_nat_rule_collection.py @@ -291,6 +291,55 @@ def __init__(__self__, """ Manages a NAT Rule Collection within an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + example_firewall_nat_rule_collection = azure.network.FirewallNatRuleCollection("exampleFirewallNatRuleCollection", + azure_firewall_name=example_firewall.name, + resource_group_name=example_resource_group.name, + priority=100, + action="Dnat", + rules=[azure.network.FirewallNatRuleCollectionRuleArgs( + name="testrule", + source_addresses=["10.0.0.0/16"], + destination_ports=["53"], + destination_addresses=[example_public_ip.ip_address], + translated_port="53", + translated_address="8.8.8.8", + protocols=[ + "TCP", + "UDP", + ], + )]) + ``` + ## Import Azure Firewall NAT Rule Collections can be imported using the `resource id`, e.g. @@ -317,6 +366,55 @@ def __init__(__self__, """ Manages a NAT Rule Collection within an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + example_firewall_nat_rule_collection = azure.network.FirewallNatRuleCollection("exampleFirewallNatRuleCollection", + azure_firewall_name=example_firewall.name, + resource_group_name=example_resource_group.name, + priority=100, + action="Dnat", + rules=[azure.network.FirewallNatRuleCollectionRuleArgs( + name="testrule", + source_addresses=["10.0.0.0/16"], + destination_ports=["53"], + destination_addresses=[example_public_ip.ip_address], + translated_port="53", + translated_address="8.8.8.8", + protocols=[ + "TCP", + "UDP", + ], + )]) + ``` + ## Import Azure Firewall NAT Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/firewall_network_rule_collection.py b/sdk/python/pulumi_azure/network/firewall_network_rule_collection.py index 1783222750..90512dff21 100644 --- a/sdk/python/pulumi_azure/network/firewall_network_rule_collection.py +++ b/sdk/python/pulumi_azure/network/firewall_network_rule_collection.py @@ -291,6 +291,56 @@ def __init__(__self__, """ Manages a Network Rule Collection within an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + example_firewall_network_rule_collection = azure.network.FirewallNetworkRuleCollection("exampleFirewallNetworkRuleCollection", + azure_firewall_name=example_firewall.name, + resource_group_name=example_resource_group.name, + priority=100, + action="Allow", + rules=[azure.network.FirewallNetworkRuleCollectionRuleArgs( + name="testrule", + source_addresses=["10.0.0.0/16"], + destination_ports=["53"], + destination_addresses=[ + "8.8.8.8", + "8.8.4.4", + ], + protocols=[ + "TCP", + "UDP", + ], + )]) + ``` + ## Import Azure Firewall Network Rule Collections can be imported using the `resource id`, e.g. @@ -317,6 +367,56 @@ def __init__(__self__, """ Manages a Network Rule Collection within an Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_VNet", + sku_tier="Standard", + ip_configurations=[azure.network.FirewallIpConfigurationArgs( + name="configuration", + subnet_id=example_subnet.id, + public_ip_address_id=example_public_ip.id, + )]) + example_firewall_network_rule_collection = azure.network.FirewallNetworkRuleCollection("exampleFirewallNetworkRuleCollection", + azure_firewall_name=example_firewall.name, + resource_group_name=example_resource_group.name, + priority=100, + action="Allow", + rules=[azure.network.FirewallNetworkRuleCollectionRuleArgs( + name="testrule", + source_addresses=["10.0.0.0/16"], + destination_ports=["53"], + destination_addresses=[ + "8.8.8.8", + "8.8.4.4", + ], + protocols=[ + "TCP", + "UDP", + ], + )]) + ``` + ## Import Azure Firewall Network Rule Collections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/firewall_policy.py b/sdk/python/pulumi_azure/network/firewall_policy.py index 6c4bc3bc6b..d6a87c8db6 100644 --- a/sdk/python/pulumi_azure/network/firewall_policy.py +++ b/sdk/python/pulumi_azure/network/firewall_policy.py @@ -784,6 +784,18 @@ def __init__(__self__, """ Manages a Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_firewall_policy = azure.network.FirewallPolicy("exampleFirewallPolicy", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Firewall Policies can be imported using the `resource id`, e.g. @@ -821,6 +833,18 @@ def __init__(__self__, """ Manages a Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_firewall_policy = azure.network.FirewallPolicy("exampleFirewallPolicy", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Firewall Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/get_application_gateway.py b/sdk/python/pulumi_azure/network/get_application_gateway.py index 26349b6241..b5ecf7b6d2 100644 --- a/sdk/python/pulumi_azure/network/get_application_gateway.py +++ b/sdk/python/pulumi_azure/network/get_application_gateway.py @@ -453,6 +453,17 @@ def get_application_gateway(name: Optional[str] = None, """ Use this data source to access information about an existing Application Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_application_gateway(name="existing-app-gateway", + resource_group_name="existing-resources") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Application Gateway. :param str resource_group_name: The name of the Resource Group where the Application Gateway exists. @@ -508,6 +519,17 @@ def get_application_gateway_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Application Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_application_gateway(name="existing-app-gateway", + resource_group_name="existing-resources") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Application Gateway. :param str resource_group_name: The name of the Resource Group where the Application Gateway exists. diff --git a/sdk/python/pulumi_azure/network/get_application_security_group.py b/sdk/python/pulumi_azure/network/get_application_security_group.py index 69e4e49990..683bb06eeb 100644 --- a/sdk/python/pulumi_azure/network/get_application_security_group.py +++ b/sdk/python/pulumi_azure/network/get_application_security_group.py @@ -92,6 +92,17 @@ def get_application_security_group(name: Optional[str] = None, """ Use this data source to access information about an existing Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_application_security_group(name="tf-appsecuritygroup", + resource_group_name="my-resource-group") + pulumi.export("applicationSecurityGroupId", example.id) + ``` + :param str name: The name of the Application Security Group. :param str resource_group_name: The name of the resource group in which the Application Security Group exists. @@ -117,6 +128,17 @@ def get_application_security_group_output(name: Optional[pulumi.Input[str]] = No """ Use this data source to access information about an existing Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_application_security_group(name="tf-appsecuritygroup", + resource_group_name="my-resource-group") + pulumi.export("applicationSecurityGroupId", example.id) + ``` + :param str name: The name of the Application Security Group. :param str resource_group_name: The name of the resource group in which the Application Security Group exists. diff --git a/sdk/python/pulumi_azure/network/get_express_route_circuit.py b/sdk/python/pulumi_azure/network/get_express_route_circuit.py index 80b287d132..94be70219d 100644 --- a/sdk/python/pulumi_azure/network/get_express_route_circuit.py +++ b/sdk/python/pulumi_azure/network/get_express_route_circuit.py @@ -141,6 +141,18 @@ def get_express_route_circuit(name: Optional[str] = None, """ Use this data source to access information about an existing ExpressRoute circuit. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_express_route_circuit(resource_group_name=azurerm_resource_group["example"]["name"], + name=azurerm_express_route_circuit["example"]["name"]) + pulumi.export("expressRouteCircuitId", example.id) + pulumi.export("serviceKey", example.service_key) + ``` + :param str name: The name of the ExpressRoute circuit. :param str resource_group_name: The Name of the Resource Group where the ExpressRoute circuit exists. @@ -170,6 +182,18 @@ def get_express_route_circuit_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing ExpressRoute circuit. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_express_route_circuit(resource_group_name=azurerm_resource_group["example"]["name"], + name=azurerm_express_route_circuit["example"]["name"]) + pulumi.export("expressRouteCircuitId", example.id) + pulumi.export("serviceKey", example.service_key) + ``` + :param str name: The name of the ExpressRoute circuit. :param str resource_group_name: The Name of the Resource Group where the ExpressRoute circuit exists. diff --git a/sdk/python/pulumi_azure/network/get_firewall.py b/sdk/python/pulumi_azure/network/get_firewall.py index da5932e917..45ba1e6a36 100644 --- a/sdk/python/pulumi_azure/network/get_firewall.py +++ b/sdk/python/pulumi_azure/network/get_firewall.py @@ -201,6 +201,17 @@ def get_firewall(name: Optional[str] = None, """ Use this data source to access information about an existing Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_firewall(name="firewall1", + resource_group_name="firewall-RG") + pulumi.export("firewallPrivateIp", example.ip_configurations[0].private_ip_address) + ``` + :param str name: The name of the Azure Firewall. :param str resource_group_name: The name of the Resource Group in which the Azure Firewall exists. @@ -235,6 +246,17 @@ def get_firewall_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Azure Firewall. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_firewall(name="firewall1", + resource_group_name="firewall-RG") + pulumi.export("firewallPrivateIp", example.ip_configurations[0].private_ip_address) + ``` + :param str name: The name of the Azure Firewall. :param str resource_group_name: The name of the Resource Group in which the Azure Firewall exists. diff --git a/sdk/python/pulumi_azure/network/get_firewall_policy.py b/sdk/python/pulumi_azure/network/get_firewall_policy.py index 2c33071924..25f1fcbeb7 100644 --- a/sdk/python/pulumi_azure/network/get_firewall_policy.py +++ b/sdk/python/pulumi_azure/network/get_firewall_policy.py @@ -153,6 +153,17 @@ def get_firewall_policy(name: Optional[str] = None, """ Use this data source to access information about an existing Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_firewall_policy(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Firewall Policy. :param str resource_group_name: The name of the Resource Group where the Firewall Policy exists. @@ -185,6 +196,17 @@ def get_firewall_policy_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_firewall_policy(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Firewall Policy. :param str resource_group_name: The name of the Resource Group where the Firewall Policy exists. diff --git a/sdk/python/pulumi_azure/network/get_gateway_connection.py b/sdk/python/pulumi_azure/network/get_gateway_connection.py index d2c3204b45..bfc81a5562 100644 --- a/sdk/python/pulumi_azure/network/get_gateway_connection.py +++ b/sdk/python/pulumi_azure/network/get_gateway_connection.py @@ -325,6 +325,17 @@ def get_gateway_connection(name: Optional[str] = None, """ Use this data source to access information about an existing Virtual Network Gateway Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_gateway_connection(name="production", + resource_group_name="networking") + pulumi.export("virtualNetworkGatewayConnectionId", example.id) + ``` + :param str name: Specifies the name of the Virtual Network Gateway Connection. :param str resource_group_name: Specifies the name of the resource group the Virtual Network Gateway Connection is located in. @@ -369,6 +380,17 @@ def get_gateway_connection_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Virtual Network Gateway Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_gateway_connection(name="production", + resource_group_name="networking") + pulumi.export("virtualNetworkGatewayConnectionId", example.id) + ``` + :param str name: Specifies the name of the Virtual Network Gateway Connection. :param str resource_group_name: Specifies the name of the resource group the Virtual Network Gateway Connection is located in. diff --git a/sdk/python/pulumi_azure/network/get_ip_group.py b/sdk/python/pulumi_azure/network/get_ip_group.py index 6d7eb28907..19b2c421f2 100644 --- a/sdk/python/pulumi_azure/network/get_ip_group.py +++ b/sdk/python/pulumi_azure/network/get_ip_group.py @@ -104,6 +104,17 @@ def get_ip_group(name: Optional[str] = None, """ Use this data source to access information about an existing IP Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_ip_group(name="example1-ipgroup", + resource_group_name="example-rg") + pulumi.export("cidrs", example.cidrs) + ``` + :param str name: Specifies the Name of the IP Group. :param str resource_group_name: Specifies the Name of the Resource Group within which the IP Group exists @@ -130,6 +141,17 @@ def get_ip_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing IP Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_ip_group(name="example1-ipgroup", + resource_group_name="example-rg") + pulumi.export("cidrs", example.cidrs) + ``` + :param str name: Specifies the Name of the IP Group. :param str resource_group_name: Specifies the Name of the Resource Group within which the IP Group exists diff --git a/sdk/python/pulumi_azure/network/get_local_network_gateway.py b/sdk/python/pulumi_azure/network/get_local_network_gateway.py index 7d0d864279..8ac96ff4f8 100644 --- a/sdk/python/pulumi_azure/network/get_local_network_gateway.py +++ b/sdk/python/pulumi_azure/network/get_local_network_gateway.py @@ -141,6 +141,17 @@ def get_local_network_gateway(name: Optional[str] = None, """ Use this data source to access information about an existing Local Network Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_local_network_gateway(name="existing-local-network-gateway", + resource_group_name="existing-resources") + pulumi.export("id", example.id) + ``` + :param str name: The name of the Local Network Gateway. :param str resource_group_name: The name of the Resource Group where the Local Network Gateway exists. @@ -170,6 +181,17 @@ def get_local_network_gateway_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Local Network Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_local_network_gateway(name="existing-local-network-gateway", + resource_group_name="existing-resources") + pulumi.export("id", example.id) + ``` + :param str name: The name of the Local Network Gateway. :param str resource_group_name: The name of the Resource Group where the Local Network Gateway exists. diff --git a/sdk/python/pulumi_azure/network/get_network_ddos_protection_plan.py b/sdk/python/pulumi_azure/network/get_network_ddos_protection_plan.py index f842a1b02c..9e2e7347d8 100644 --- a/sdk/python/pulumi_azure/network/get_network_ddos_protection_plan.py +++ b/sdk/python/pulumi_azure/network/get_network_ddos_protection_plan.py @@ -105,6 +105,17 @@ def get_network_ddos_protection_plan(name: Optional[str] = None, """ Use this data source to access information about an existing Azure Network DDoS Protection Plan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_ddos_protection_plan(name=azurerm_network_ddos_protection_plan["example"]["name"], + resource_group_name=azurerm_network_ddos_protection_plan["example"]["resource_group_name"]) + pulumi.export("ddosProtectionPlanId", example.id) + ``` + :param str name: The name of the Network DDoS Protection Plan. :param str resource_group_name: The name of the resource group where the Network DDoS Protection Plan exists. @@ -134,6 +145,17 @@ def get_network_ddos_protection_plan_output(name: Optional[pulumi.Input[str]] = """ Use this data source to access information about an existing Azure Network DDoS Protection Plan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_ddos_protection_plan(name=azurerm_network_ddos_protection_plan["example"]["name"], + resource_group_name=azurerm_network_ddos_protection_plan["example"]["resource_group_name"]) + pulumi.export("ddosProtectionPlanId", example.id) + ``` + :param str name: The name of the Network DDoS Protection Plan. :param str resource_group_name: The name of the resource group where the Network DDoS Protection Plan exists. diff --git a/sdk/python/pulumi_azure/network/get_network_interface.py b/sdk/python/pulumi_azure/network/get_network_interface.py index edffa14e21..c4d62e637f 100644 --- a/sdk/python/pulumi_azure/network/get_network_interface.py +++ b/sdk/python/pulumi_azure/network/get_network_interface.py @@ -228,6 +228,17 @@ def get_network_interface(name: Optional[str] = None, """ Use this data source to access information about an existing Network Interface. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_interface(name="acctest-nic", + resource_group_name="networking") + pulumi.export("networkInterfaceId", example.id) + ``` + :param str name: Specifies the name of the Network Interface. :param str resource_group_name: Specifies the name of the resource group the Network Interface is located in. @@ -264,6 +275,17 @@ def get_network_interface_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Network Interface. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_interface(name="acctest-nic", + resource_group_name="networking") + pulumi.export("networkInterfaceId", example.id) + ``` + :param str name: Specifies the name of the Network Interface. :param str resource_group_name: Specifies the name of the resource group the Network Interface is located in. diff --git a/sdk/python/pulumi_azure/network/get_network_security_group.py b/sdk/python/pulumi_azure/network/get_network_security_group.py index 00cc881616..29b76f415b 100644 --- a/sdk/python/pulumi_azure/network/get_network_security_group.py +++ b/sdk/python/pulumi_azure/network/get_network_security_group.py @@ -108,6 +108,17 @@ def get_network_security_group(name: Optional[str] = None, """ Use this data source to access information about an existing Network Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_security_group(name="example", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("location", example.location) + ``` + :param str name: Specifies the Name of the Network Security Group. :param str resource_group_name: Specifies the Name of the Resource Group within which the Network Security Group exists @@ -134,6 +145,17 @@ def get_network_security_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Network Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_security_group(name="example", + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("location", example.location) + ``` + :param str name: Specifies the Name of the Network Security Group. :param str resource_group_name: Specifies the Name of the Resource Group within which the Network Security Group exists diff --git a/sdk/python/pulumi_azure/network/get_network_watcher.py b/sdk/python/pulumi_azure/network/get_network_watcher.py index 87a0baa703..4d1ad046a5 100644 --- a/sdk/python/pulumi_azure/network/get_network_watcher.py +++ b/sdk/python/pulumi_azure/network/get_network_watcher.py @@ -92,6 +92,17 @@ def get_network_watcher(name: Optional[str] = None, """ Use this data source to access information about an existing Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_watcher(name=azurerm_network_watcher["example"]["name"], + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("networkWatcherId", example.id) + ``` + :param str name: Specifies the Name of the Network Watcher. :param str resource_group_name: Specifies the Name of the Resource Group within which the Network Watcher exists. @@ -117,6 +128,17 @@ def get_network_watcher_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_network_watcher(name=azurerm_network_watcher["example"]["name"], + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("networkWatcherId", example.id) + ``` + :param str name: Specifies the Name of the Network Watcher. :param str resource_group_name: Specifies the Name of the Resource Group within which the Network Watcher exists. diff --git a/sdk/python/pulumi_azure/network/get_public_i_ps.py b/sdk/python/pulumi_azure/network/get_public_i_ps.py index 0f9922120a..8250cae6e9 100644 --- a/sdk/python/pulumi_azure/network/get_public_i_ps.py +++ b/sdk/python/pulumi_azure/network/get_public_i_ps.py @@ -101,6 +101,16 @@ def get_public_i_ps(allocation_type: Optional[str] = None, """ Use this data source to access information about a set of existing Public IP Addresses. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_public_i_ps(attachment_status="Attached", + resource_group_name="pip-test") + ``` + :param str allocation_type: The Allocation Type for the Public IP Address. Possible values include `Static` or `Dynamic`. :param str attachment_status: Filter to include IP Addresses which are attached to a device, such as a VM/LB (`Attached`) or unattached (`Unattached`). @@ -133,6 +143,16 @@ def get_public_i_ps_output(allocation_type: Optional[pulumi.Input[Optional[str]] """ Use this data source to access information about a set of existing Public IP Addresses. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_public_i_ps(attachment_status="Attached", + resource_group_name="pip-test") + ``` + :param str allocation_type: The Allocation Type for the Public IP Address. Possible values include `Static` or `Dynamic`. :param str attachment_status: Filter to include IP Addresses which are attached to a device, such as a VM/LB (`Attached`) or unattached (`Unattached`). diff --git a/sdk/python/pulumi_azure/network/get_public_ip.py b/sdk/python/pulumi_azure/network/get_public_ip.py index e98280c118..3031ec637c 100644 --- a/sdk/python/pulumi_azure/network/get_public_ip.py +++ b/sdk/python/pulumi_azure/network/get_public_ip.py @@ -237,6 +237,59 @@ def get_public_ip(name: Optional[str] = None, Use this data source to access information about an existing Public IP Address. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_public_ip(name="name_of_public_ip", + resource_group_name="name_of_resource_group") + pulumi.export("domainNameLabel", example.domain_name_label) + pulumi.export("publicIpAddress", example.ip_address) + ``` + ### Retrieve The Dynamic Public IP Of A New VM) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic", + idle_timeout_in_minutes=30, + tags={ + "environment": "test", + }) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Static", + private_ip_address="10.0.2.5", + public_ip_address_id=example_public_ip.id, + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id]) + # ... + example_public_ip = azure.network.get_public_ip_output(name=example_public_ip.name, + resource_group_name=example_virtual_machine.resource_group_name) + pulumi.export("publicIpAddress", example_public_ip.ip_address) + ``` :param str name: Specifies the name of the public IP address. @@ -276,6 +329,59 @@ def get_public_ip_output(name: Optional[pulumi.Input[str]] = None, Use this data source to access information about an existing Public IP Address. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_public_ip(name="name_of_public_ip", + resource_group_name="name_of_resource_group") + pulumi.export("domainNameLabel", example.domain_name_label) + pulumi.export("publicIpAddress", example.ip_address) + ``` + ### Retrieve The Dynamic Public IP Of A New VM) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic", + idle_timeout_in_minutes=30, + tags={ + "environment": "test", + }) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Static", + private_ip_address="10.0.2.5", + public_ip_address_id=example_public_ip.id, + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id]) + # ... + example_public_ip = azure.network.get_public_ip_output(name=example_public_ip.name, + resource_group_name=example_virtual_machine.resource_group_name) + pulumi.export("publicIpAddress", example_public_ip.ip_address) + ``` :param str name: Specifies the name of the public IP address. diff --git a/sdk/python/pulumi_azure/network/get_public_ip_prefix.py b/sdk/python/pulumi_azure/network/get_public_ip_prefix.py index db0da3eed2..1b1fcfad1a 100644 --- a/sdk/python/pulumi_azure/network/get_public_ip_prefix.py +++ b/sdk/python/pulumi_azure/network/get_public_ip_prefix.py @@ -144,6 +144,16 @@ def get_public_ip_prefix(name: Optional[str] = None, Use this data source to access information about an existing Public IP Prefix. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_public_ip_prefix(name="name_of_public_ip", + resource_group_name="name_of_resource_group") + pulumi.export("publicIpPrefix", example.ip_prefix) + ``` :param str name: Specifies the name of the public IP prefix. @@ -175,6 +185,16 @@ def get_public_ip_prefix_output(name: Optional[pulumi.Input[str]] = None, Use this data source to access information about an existing Public IP Prefix. ## Example Usage + ### Reference An Existing) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_public_ip_prefix(name="name_of_public_ip", + resource_group_name="name_of_resource_group") + pulumi.export("publicIpPrefix", example.ip_prefix) + ``` :param str name: Specifies the name of the public IP prefix. diff --git a/sdk/python/pulumi_azure/network/get_route_filter.py b/sdk/python/pulumi_azure/network/get_route_filter.py index 0af78c2c9c..40c82cb23c 100644 --- a/sdk/python/pulumi_azure/network/get_route_filter.py +++ b/sdk/python/pulumi_azure/network/get_route_filter.py @@ -108,6 +108,17 @@ def get_route_filter(name: Optional[str] = None, """ Use this data source to access information about an existing Route Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_route_filter(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The Name of this Route Filter. :param str resource_group_name: The name of the Resource Group where the Route Filter exists. @@ -134,6 +145,17 @@ def get_route_filter_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Route Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_route_filter(name="existing", + resource_group_name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The Name of this Route Filter. :param str resource_group_name: The name of the Resource Group where the Route Filter exists. diff --git a/sdk/python/pulumi_azure/network/get_route_table.py b/sdk/python/pulumi_azure/network/get_route_table.py index 2cf1adea4e..43971ac9d0 100644 --- a/sdk/python/pulumi_azure/network/get_route_table.py +++ b/sdk/python/pulumi_azure/network/get_route_table.py @@ -132,6 +132,16 @@ def get_route_table(name: Optional[str] = None, """ Use this data source to access information about an existing Route Table. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_route_table(name="myroutetable", + resource_group_name="some-resource-group") + ``` + :param str name: The name of the Route Table. :param str resource_group_name: The name of the Resource Group in which the Route Table exists. @@ -160,6 +170,16 @@ def get_route_table_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Route Table. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_route_table(name="myroutetable", + resource_group_name="some-resource-group") + ``` + :param str name: The name of the Route Table. :param str resource_group_name: The name of the Resource Group in which the Route Table exists. diff --git a/sdk/python/pulumi_azure/network/get_service_tags.py b/sdk/python/pulumi_azure/network/get_service_tags.py index 65a1839db5..6affce9ebb 100644 --- a/sdk/python/pulumi_azure/network/get_service_tags.py +++ b/sdk/python/pulumi_azure/network/get_service_tags.py @@ -126,6 +126,19 @@ def get_service_tags(location: Optional[str] = None, """ Use this data source to access information about Service Tags. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_service_tags(location="westcentralus", + service="AzureKeyVault", + location_filter="northeurope") + pulumi.export("addressPrefixes", example.address_prefixes) + pulumi.export("ipv4Cidrs", example.ipv4_cidrs) + ``` + :param str location: The Azure Region where the Service Tags exists. This value is not used to filter the results but for specifying the region to request. For filtering by region use `location_filter` instead. More information can be found here: [Service Tags URL parameters](https://docs.microsoft.com/rest/api/virtualnetwork/servicetags/list#uri-parameters). :param str location_filter: Changes the scope of the service tags. Can be any value that is also valid for `location`. If this field is empty then all address prefixes are considered instead of only location specific ones. @@ -157,6 +170,19 @@ def get_service_tags_output(location: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about Service Tags. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_service_tags(location="westcentralus", + service="AzureKeyVault", + location_filter="northeurope") + pulumi.export("addressPrefixes", example.address_prefixes) + pulumi.export("ipv4Cidrs", example.ipv4_cidrs) + ``` + :param str location: The Azure Region where the Service Tags exists. This value is not used to filter the results but for specifying the region to request. For filtering by region use `location_filter` instead. More information can be found here: [Service Tags URL parameters](https://docs.microsoft.com/rest/api/virtualnetwork/servicetags/list#uri-parameters). :param str location_filter: Changes the scope of the service tags. Can be any value that is also valid for `location`. If this field is empty then all address prefixes are considered instead of only location specific ones. diff --git a/sdk/python/pulumi_azure/network/get_subnet.py b/sdk/python/pulumi_azure/network/get_subnet.py index 92268685b5..6e46be6c67 100644 --- a/sdk/python/pulumi_azure/network/get_subnet.py +++ b/sdk/python/pulumi_azure/network/get_subnet.py @@ -177,6 +177,18 @@ def get_subnet(name: Optional[str] = None, """ Use this data source to access information about an existing Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_subnet(name="backend", + virtual_network_name="production", + resource_group_name="networking") + pulumi.export("subnetId", example.id) + ``` + :param str name: Specifies the name of the Subnet. :param str resource_group_name: Specifies the name of the resource group the Virtual Network is located in. @@ -213,6 +225,18 @@ def get_subnet_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_subnet(name="backend", + virtual_network_name="production", + resource_group_name="networking") + pulumi.export("subnetId", example.id) + ``` + :param str name: Specifies the name of the Subnet. :param str resource_group_name: Specifies the name of the resource group the Virtual Network is located in. diff --git a/sdk/python/pulumi_azure/network/get_traffic_manager.py b/sdk/python/pulumi_azure/network/get_traffic_manager.py index 02ddfea6d7..456ef72397 100644 --- a/sdk/python/pulumi_azure/network/get_traffic_manager.py +++ b/sdk/python/pulumi_azure/network/get_traffic_manager.py @@ -59,6 +59,15 @@ def get_traffic_manager(name: Optional[str] = None, Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. ## Example Usage + ### World) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_traffic_manager(name="World") + pulumi.export("locationCode", example.id) + ``` :param str name: Specifies the name of the Location, for example `World`, `Europe` or `Germany`. @@ -80,6 +89,15 @@ def get_traffic_manager_output(name: Optional[pulumi.Input[str]] = None, Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. ## Example Usage + ### World) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_traffic_manager(name="World") + pulumi.export("locationCode", example.id) + ``` :param str name: Specifies the name of the Location, for example `World`, `Europe` or `Germany`. diff --git a/sdk/python/pulumi_azure/network/get_traffic_manager_profile.py b/sdk/python/pulumi_azure/network/get_traffic_manager_profile.py index f03acc3aad..4f8c59c808 100644 --- a/sdk/python/pulumi_azure/network/get_traffic_manager_profile.py +++ b/sdk/python/pulumi_azure/network/get_traffic_manager_profile.py @@ -158,6 +158,17 @@ def get_traffic_manager_profile(name: Optional[str] = None, """ Use this data source to access information about an existing Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_traffic_manager_profile(name="test", + resource_group_name="test") + pulumi.export("trafficRoutingMethod", example.traffic_routing_method) + ``` + :param str name: Specifies the name of the Traffic Manager Profile. :param str resource_group_name: Specifies the name of the resource group the Traffic Manager Profile is located in. @@ -194,6 +205,17 @@ def get_traffic_manager_profile_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_traffic_manager_profile(name="test", + resource_group_name="test") + pulumi.export("trafficRoutingMethod", example.traffic_routing_method) + ``` + :param str name: Specifies the name of the Traffic Manager Profile. :param str resource_group_name: Specifies the name of the resource group the Traffic Manager Profile is located in. diff --git a/sdk/python/pulumi_azure/network/get_virtual_hub.py b/sdk/python/pulumi_azure/network/get_virtual_hub.py index ec33e1d21a..b117d9a3c6 100644 --- a/sdk/python/pulumi_azure/network/get_virtual_hub.py +++ b/sdk/python/pulumi_azure/network/get_virtual_hub.py @@ -152,6 +152,17 @@ def get_virtual_hub(name: Optional[str] = None, """ Uses this data source to access information about an existing Virtual Hub. + ## Virtual Hub Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_hub(name="example-hub", + resource_group_name="example-resources") + pulumi.export("virtualHubId", example.id) + ``` + :param str name: The name of the Virtual Hub. :param str resource_group_name: The Name of the Resource Group where the Virtual Hub exists. @@ -182,6 +193,17 @@ def get_virtual_hub_output(name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing Virtual Hub. + ## Virtual Hub Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_hub(name="example-hub", + resource_group_name="example-resources") + pulumi.export("virtualHubId", example.id) + ``` + :param str name: The name of the Virtual Hub. :param str resource_group_name: The Name of the Resource Group where the Virtual Hub exists. diff --git a/sdk/python/pulumi_azure/network/get_virtual_hub_connection.py b/sdk/python/pulumi_azure/network/get_virtual_hub_connection.py index 6c29ec6a09..b1137a1582 100644 --- a/sdk/python/pulumi_azure/network/get_virtual_hub_connection.py +++ b/sdk/python/pulumi_azure/network/get_virtual_hub_connection.py @@ -130,6 +130,18 @@ def get_virtual_hub_connection(name: Optional[str] = None, """ Uses this data source to access information about an existing Virtual Hub Connection. + ## Virtual Hub Connection Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_hub_connection(name="example-connection", + resource_group_name="example-resources", + virtual_hub_name="example-hub-name") + pulumi.export("virtualHubConnectionId", example.id) + ``` + :param str name: The name of the Connection which should be retrieved. :param str resource_group_name: The Name of the Resource Group where the Virtual Hub Connection exists. @@ -161,6 +173,18 @@ def get_virtual_hub_connection_output(name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing Virtual Hub Connection. + ## Virtual Hub Connection Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_hub_connection(name="example-connection", + resource_group_name="example-resources", + virtual_hub_name="example-hub-name") + pulumi.export("virtualHubConnectionId", example.id) + ``` + :param str name: The name of the Connection which should be retrieved. :param str resource_group_name: The Name of the Resource Group where the Virtual Hub Connection exists. diff --git a/sdk/python/pulumi_azure/network/get_virtual_hub_route_table.py b/sdk/python/pulumi_azure/network/get_virtual_hub_route_table.py index 14bc07d080..931e445629 100644 --- a/sdk/python/pulumi_azure/network/get_virtual_hub_route_table.py +++ b/sdk/python/pulumi_azure/network/get_virtual_hub_route_table.py @@ -118,6 +118,18 @@ def get_virtual_hub_route_table(name: Optional[str] = None, """ Uses this data source to access information about an existing Virtual Hub Route Table. + ## Virtual Hub Route Table Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_hub_route_table(name="example-hub-route-table", + resource_group_name="example-resources", + virtual_hub_name="example-hub-name") + pulumi.export("virtualHubRouteTableId", example.id) + ``` + :param str name: The name of the Virtual Hub Route Table. :param str resource_group_name: The Name of the Resource Group where the Virtual Hub Route Table exists. @@ -148,6 +160,18 @@ def get_virtual_hub_route_table_output(name: Optional[pulumi.Input[str]] = None, """ Uses this data source to access information about an existing Virtual Hub Route Table. + ## Virtual Hub Route Table Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_hub_route_table(name="example-hub-route-table", + resource_group_name="example-resources", + virtual_hub_name="example-hub-name") + pulumi.export("virtualHubRouteTableId", example.id) + ``` + :param str name: The name of the Virtual Hub Route Table. :param str resource_group_name: The Name of the Resource Group where the Virtual Hub Route Table exists. diff --git a/sdk/python/pulumi_azure/network/get_virtual_network.py b/sdk/python/pulumi_azure/network/get_virtual_network.py index 4aefc759c1..bf9ca429f0 100644 --- a/sdk/python/pulumi_azure/network/get_virtual_network.py +++ b/sdk/python/pulumi_azure/network/get_virtual_network.py @@ -164,6 +164,17 @@ def get_virtual_network(name: Optional[str] = None, """ Use this data source to access information about an existing Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_network(name="production", + resource_group_name="networking") + pulumi.export("virtualNetworkId", example.id) + ``` + :param str name: Specifies the name of the Virtual Network. :param str resource_group_name: Specifies the name of the resource group the Virtual Network is located in. @@ -195,6 +206,17 @@ def get_virtual_network_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_network(name="production", + resource_group_name="networking") + pulumi.export("virtualNetworkId", example.id) + ``` + :param str name: Specifies the name of the Virtual Network. :param str resource_group_name: Specifies the name of the resource group the Virtual Network is located in. diff --git a/sdk/python/pulumi_azure/network/get_virtual_network_gateway.py b/sdk/python/pulumi_azure/network/get_virtual_network_gateway.py index a9c258016d..eae1240670 100644 --- a/sdk/python/pulumi_azure/network/get_virtual_network_gateway.py +++ b/sdk/python/pulumi_azure/network/get_virtual_network_gateway.py @@ -238,6 +238,17 @@ def get_virtual_network_gateway(name: Optional[str] = None, """ Use this data source to access information about an existing Virtual Network Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_network_gateway(name="production", + resource_group_name="networking") + pulumi.export("virtualNetworkGatewayId", example.id) + ``` + :param str name: Specifies the name of the Virtual Network Gateway. :param str resource_group_name: Specifies the name of the resource group the Virtual Network Gateway is located in. @@ -275,6 +286,17 @@ def get_virtual_network_gateway_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Virtual Network Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_virtual_network_gateway(name="production", + resource_group_name="networking") + pulumi.export("virtualNetworkGatewayId", example.id) + ``` + :param str name: Specifies the name of the Virtual Network Gateway. :param str resource_group_name: Specifies the name of the resource group the Virtual Network Gateway is located in. diff --git a/sdk/python/pulumi_azure/network/get_vpn_gateway.py b/sdk/python/pulumi_azure/network/get_vpn_gateway.py index c6cca04748..ae7c8043b9 100644 --- a/sdk/python/pulumi_azure/network/get_vpn_gateway.py +++ b/sdk/python/pulumi_azure/network/get_vpn_gateway.py @@ -129,6 +129,17 @@ def get_vpn_gateway(name: Optional[str] = None, """ Use this data source to access information about an existing VPN Gateway within a Virtual Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_vpn_gateway(name="existing-local-vpn_gateway", + resource_group_name="existing-vpn_gateway") + pulumi.export("azurermVpnGatewayId", example.id) + ``` + :param str name: The Name of the VPN Gateway. :param str resource_group_name: The name of the Resource Group where the VPN Gateway exists. @@ -157,6 +168,17 @@ def get_vpn_gateway_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing VPN Gateway within a Virtual Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_vpn_gateway(name="existing-local-vpn_gateway", + resource_group_name="existing-vpn_gateway") + pulumi.export("azurermVpnGatewayId", example.id) + ``` + :param str name: The Name of the VPN Gateway. :param str resource_group_name: The name of the Resource Group where the VPN Gateway exists. diff --git a/sdk/python/pulumi_azure/network/ip_group.py b/sdk/python/pulumi_azure/network/ip_group.py index da8f9871cc..7124740d63 100644 --- a/sdk/python/pulumi_azure/network/ip_group.py +++ b/sdk/python/pulumi_azure/network/ip_group.py @@ -276,6 +276,26 @@ def __init__(__self__, """ Manages an IP group that contains a list of CIDRs and/or IP addresses. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_ip_group = azure.network.IPGroup("exampleIPGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + cidrs=[ + "192.168.0.1", + "172.16.240.0/20", + "10.48.0.0/12", + ], + tags={ + "environment": "Production", + }) + ``` + ## Import IP Groups can be imported using the `resource id`, e.g. @@ -300,6 +320,26 @@ def __init__(__self__, """ Manages an IP group that contains a list of CIDRs and/or IP addresses. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_ip_group = azure.network.IPGroup("exampleIPGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + cidrs=[ + "192.168.0.1", + "172.16.240.0/20", + "10.48.0.0/12", + ], + tags={ + "environment": "Production", + }) + ``` + ## Import IP Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/ip_group_cidr.py b/sdk/python/pulumi_azure/network/ip_group_cidr.py index 56942d4654..e43fa4413c 100644 --- a/sdk/python/pulumi_azure/network/ip_group_cidr.py +++ b/sdk/python/pulumi_azure/network/ip_group_cidr.py @@ -134,6 +134,21 @@ def __init__(__self__, `network.IPGroup` resource for the same IP Group. Doing so will cause a conflict and CIDRS will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_ip_group = azure.network.IPGroup("exampleIPGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_ip_group_cidr = azure.network.IPGroupCIDR("exampleIPGroupCIDR", + ip_group_id=example_ip_group.id, + cidr="10.10.10.0/24") + ``` + ## Import IP Group CIDRs can be imported using the `resource id` of the IP Group and the CIDR value (`/` characters have to be replaced by `_`), e.g. @@ -160,6 +175,21 @@ def __init__(__self__, `network.IPGroup` resource for the same IP Group. Doing so will cause a conflict and CIDRS will be removed. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_ip_group = azure.network.IPGroup("exampleIPGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_ip_group_cidr = azure.network.IPGroupCIDR("exampleIPGroupCIDR", + ip_group_id=example_ip_group.id, + cidr="10.10.10.0/24") + ``` + ## Import IP Group CIDRs can be imported using the `resource id` of the IP Group and the CIDR value (`/` characters have to be replaced by `_`), e.g. diff --git a/sdk/python/pulumi_azure/network/local_network_gateway.py b/sdk/python/pulumi_azure/network/local_network_gateway.py index ac7a35d7a4..b28466cf8e 100644 --- a/sdk/python/pulumi_azure/network/local_network_gateway.py +++ b/sdk/python/pulumi_azure/network/local_network_gateway.py @@ -381,6 +381,20 @@ def __init__(__self__, """ Manages a local network gateway connection over which specific connections can be configured. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + home = azure.network.LocalNetworkGateway("home", + resource_group_name=example.name, + location=example.location, + gateway_address="12.13.14.15", + address_spaces=["10.0.0.0/16"]) + ``` + ## Import Local Network Gateways can be imported using the `resource id`, e.g. @@ -411,6 +425,20 @@ def __init__(__self__, """ Manages a local network gateway connection over which specific connections can be configured. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + home = azure.network.LocalNetworkGateway("home", + resource_group_name=example.name, + location=example.location, + gateway_address="12.13.14.15", + address_spaces=["10.0.0.0/16"]) + ``` + ## Import Local Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/nat_gateway.py b/sdk/python/pulumi_azure/network/nat_gateway.py index fecd927a64..b2c3293269 100644 --- a/sdk/python/pulumi_azure/network/nat_gateway.py +++ b/sdk/python/pulumi_azure/network/nat_gateway.py @@ -354,6 +354,23 @@ def __init__(__self__, """ Manages an Azure NAT Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + idle_timeout_in_minutes=10, + zones=["1"]) + ``` + + For more complete examples, please see the network.NatGatewayPublicIpAssociation and network.NatGatewayPublicIpPrefixAssociation resources. + ## Import NAT Gateway can be imported using the `resource id`, e.g. @@ -383,6 +400,23 @@ def __init__(__self__, """ Manages an Azure NAT Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + idle_timeout_in_minutes=10, + zones=["1"]) + ``` + + For more complete examples, please see the network.NatGatewayPublicIpAssociation and network.NatGatewayPublicIpPrefixAssociation resources. + ## Import NAT Gateway can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/nat_gateway_public_ip_association.py b/sdk/python/pulumi_azure/network/nat_gateway_public_ip_association.py index fda1cd05b8..479b5f8126 100644 --- a/sdk/python/pulumi_azure/network/nat_gateway_public_ip_association.py +++ b/sdk/python/pulumi_azure/network/nat_gateway_public_ip_association.py @@ -138,6 +138,27 @@ def __init__(__self__, """ Manages the association between a NAT Gateway and a Public IP. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_nat_gateway_public_ip_association = azure.network.NatGatewayPublicIpAssociation("exampleNatGatewayPublicIpAssociation", + nat_gateway_id=example_nat_gateway.id, + public_ip_address_id=example_public_ip.id) + ``` + ## Import Associations between NAT Gateway and Public IP Addresses can be imported using the `resource id`, e.g. @@ -160,6 +181,27 @@ def __init__(__self__, """ Manages the association between a NAT Gateway and a Public IP. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_nat_gateway_public_ip_association = azure.network.NatGatewayPublicIpAssociation("exampleNatGatewayPublicIpAssociation", + nat_gateway_id=example_nat_gateway.id, + public_ip_address_id=example_public_ip.id) + ``` + ## Import Associations between NAT Gateway and Public IP Addresses can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/nat_gateway_public_ip_prefix_association.py b/sdk/python/pulumi_azure/network/nat_gateway_public_ip_prefix_association.py index 02d5c01e0d..4dce30d2d9 100644 --- a/sdk/python/pulumi_azure/network/nat_gateway_public_ip_prefix_association.py +++ b/sdk/python/pulumi_azure/network/nat_gateway_public_ip_prefix_association.py @@ -138,6 +138,27 @@ def __init__(__self__, """ Manages the association between a NAT Gateway and a Public IP Prefix. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip_prefix = azure.network.PublicIpPrefix("examplePublicIpPrefix", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + prefix_length=30, + zones=["1"]) + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_nat_gateway_public_ip_prefix_association = azure.network.NatGatewayPublicIpPrefixAssociation("exampleNatGatewayPublicIpPrefixAssociation", + nat_gateway_id=example_nat_gateway.id, + public_ip_prefix_id=example_public_ip_prefix.id) + ``` + ## Import Associations between NAT Gateway and Public IP Prefixes can be imported using the `resource id`, e.g. @@ -160,6 +181,27 @@ def __init__(__self__, """ Manages the association between a NAT Gateway and a Public IP Prefix. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip_prefix = azure.network.PublicIpPrefix("examplePublicIpPrefix", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + prefix_length=30, + zones=["1"]) + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard") + example_nat_gateway_public_ip_prefix_association = azure.network.NatGatewayPublicIpPrefixAssociation("exampleNatGatewayPublicIpPrefixAssociation", + nat_gateway_id=example_nat_gateway.id, + public_ip_prefix_id=example_public_ip_prefix.id) + ``` + ## Import Associations between NAT Gateway and Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_connection_monitor.py b/sdk/python/pulumi_azure/network/network_connection_monitor.py index 9bc3631618..e726aef3e8 100644 --- a/sdk/python/pulumi_azure/network/network_connection_monitor.py +++ b/sdk/python/pulumi_azure/network/network_connection_monitor.py @@ -411,6 +411,106 @@ def __init__(__self__, > **NOTE:** Any Network Connection Monitor resource created with API versions 2019-06-01 or earlier (v1) are now incompatible with this provider, which now only supports v2. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + vm_size="Standard_D2s_v3", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="osdisk-example01", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="hostnametest01", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_virtual_machine.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_network_connection_monitor = azure.network.NetworkConnectionMonitor("exampleNetworkConnectionMonitor", + network_watcher_id=example_network_watcher.id, + location=example_network_watcher.location, + endpoints=[ + azure.network.NetworkConnectionMonitorEndpointArgs( + name="source", + target_resource_id=example_virtual_machine.id, + filter=azure.network.NetworkConnectionMonitorEndpointFilterArgs( + items=[azure.network.NetworkConnectionMonitorEndpointFilterItemArgs( + address=example_virtual_machine.id, + type="AgentAddress", + )], + type="Include", + ), + ), + azure.network.NetworkConnectionMonitorEndpointArgs( + name="destination", + address="mycompany.io", + ), + ], + test_configurations=[azure.network.NetworkConnectionMonitorTestConfigurationArgs( + name="tcpName", + protocol="Tcp", + test_frequency_in_seconds=60, + tcp_configuration=azure.network.NetworkConnectionMonitorTestConfigurationTcpConfigurationArgs( + port=80, + ), + )], + test_groups=[azure.network.NetworkConnectionMonitorTestGroupArgs( + name="exampletg", + destination_endpoints=["destination"], + source_endpoints=["source"], + test_configuration_names=["tcpName"], + )], + notes="examplenote", + output_workspace_resource_ids=[example_analytics_workspace.id], + opts=pulumi.ResourceOptions(depends_on=[example_extension])) + ``` + ## Import Network Connection Monitors can be imported using the `resource id`, e.g. @@ -442,6 +542,106 @@ def __init__(__self__, > **NOTE:** Any Network Connection Monitor resource created with API versions 2019-06-01 or earlier (v1) are now incompatible with this provider, which now only supports v2. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + vm_size="Standard_D2s_v3", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="osdisk-example01", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="hostnametest01", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_virtual_machine.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_network_connection_monitor = azure.network.NetworkConnectionMonitor("exampleNetworkConnectionMonitor", + network_watcher_id=example_network_watcher.id, + location=example_network_watcher.location, + endpoints=[ + azure.network.NetworkConnectionMonitorEndpointArgs( + name="source", + target_resource_id=example_virtual_machine.id, + filter=azure.network.NetworkConnectionMonitorEndpointFilterArgs( + items=[azure.network.NetworkConnectionMonitorEndpointFilterItemArgs( + address=example_virtual_machine.id, + type="AgentAddress", + )], + type="Include", + ), + ), + azure.network.NetworkConnectionMonitorEndpointArgs( + name="destination", + address="mycompany.io", + ), + ], + test_configurations=[azure.network.NetworkConnectionMonitorTestConfigurationArgs( + name="tcpName", + protocol="Tcp", + test_frequency_in_seconds=60, + tcp_configuration=azure.network.NetworkConnectionMonitorTestConfigurationTcpConfigurationArgs( + port=80, + ), + )], + test_groups=[azure.network.NetworkConnectionMonitorTestGroupArgs( + name="exampletg", + destination_endpoints=["destination"], + source_endpoints=["source"], + test_configuration_names=["tcpName"], + )], + notes="examplenote", + output_workspace_resource_ids=[example_analytics_workspace.id], + opts=pulumi.ResourceOptions(depends_on=[example_extension])) + ``` + ## Import Network Connection Monitors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_interface.py b/sdk/python/pulumi_azure/network/network_interface.py index 1e4d4cc541..d2d91c7e9e 100644 --- a/sdk/python/pulumi_azure/network/network_interface.py +++ b/sdk/python/pulumi_azure/network/network_interface.py @@ -698,6 +698,31 @@ def __init__(__self__, """ Manages a Network Interface. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + ``` + ## Import Network Interfaces can be imported using the `resource id`, e.g. @@ -740,6 +765,31 @@ def __init__(__self__, """ Manages a Network Interface. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + ``` + ## Import Network Interfaces can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_interface_application_security_group_association.py b/sdk/python/pulumi_azure/network/network_interface_application_security_group_association.py index 150a628f45..00386f06e1 100644 --- a/sdk/python/pulumi_azure/network/network_interface_application_security_group_association.py +++ b/sdk/python/pulumi_azure/network/network_interface_application_security_group_association.py @@ -138,6 +138,37 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_application_security_group = azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_application_security_group_association = azure.network.NetworkInterfaceApplicationSecurityGroupAssociation("exampleNetworkInterfaceApplicationSecurityGroupAssociation", + network_interface_id=example_network_interface.id, + application_security_group_id=example_application_security_group.id) + ``` + ## Import Associations between Network Interfaces and Application Security Groups can be imported using the `resource id`, e.g. @@ -160,6 +191,37 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_application_security_group = azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_application_security_group_association = azure.network.NetworkInterfaceApplicationSecurityGroupAssociation("exampleNetworkInterfaceApplicationSecurityGroupAssociation", + network_interface_id=example_network_interface.id, + application_security_group_id=example_application_security_group.id) + ``` + ## Import Associations between Network Interfaces and Application Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_interface_backend_address_pool_association.py b/sdk/python/pulumi_azure/network/network_interface_backend_address_pool_association.py index f0dd1ea8f8..62e28f7290 100644 --- a/sdk/python/pulumi_azure/network/network_interface_backend_address_pool_association.py +++ b/sdk/python/pulumi_azure/network/network_interface_backend_address_pool_association.py @@ -180,6 +180,47 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Load Balancer's Backend Address Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="primary", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_backend_address_pool_association = azure.network.NetworkInterfaceBackendAddressPoolAssociation("exampleNetworkInterfaceBackendAddressPoolAssociation", + network_interface_id=example_network_interface.id, + ip_configuration_name="testconfiguration1", + backend_address_pool_id=example_backend_address_pool.id) + ``` + ## Import Associations between Network Interfaces and Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. @@ -203,6 +244,47 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Load Balancer's Backend Address Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="primary", + public_ip_address_id=example_public_ip.id, + )]) + example_backend_address_pool = azure.lb.BackendAddressPool("exampleBackendAddressPool", loadbalancer_id=example_load_balancer.id) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_backend_address_pool_association = azure.network.NetworkInterfaceBackendAddressPoolAssociation("exampleNetworkInterfaceBackendAddressPoolAssociation", + network_interface_id=example_network_interface.id, + ip_configuration_name="testconfiguration1", + backend_address_pool_id=example_backend_address_pool.id) + ``` + ## Import Associations between Network Interfaces and Load Balancer Backend Address Pools can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_interface_nat_rule_association.py b/sdk/python/pulumi_azure/network/network_interface_nat_rule_association.py index f334346b92..15336fb0b8 100644 --- a/sdk/python/pulumi_azure/network/network_interface_nat_rule_association.py +++ b/sdk/python/pulumi_azure/network/network_interface_nat_rule_association.py @@ -180,6 +180,53 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Load Balancer's NAT Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="primary", + public_ip_address_id=example_public_ip.id, + )]) + example_nat_rule = azure.lb.NatRule("exampleNatRule", + resource_group_name=example_resource_group.name, + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port=3389, + backend_port=3389, + frontend_ip_configuration_name="primary") + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_nat_rule_association = azure.network.NetworkInterfaceNatRuleAssociation("exampleNetworkInterfaceNatRuleAssociation", + network_interface_id=example_network_interface.id, + ip_configuration_name="testconfiguration1", + nat_rule_id=example_nat_rule.id) + ``` + ## Import Associations between Network Interfaces and Load Balancer NAT Rule can be imported using the `resource id`, e.g. @@ -203,6 +250,53 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Load Balancer's NAT Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name="primary", + public_ip_address_id=example_public_ip.id, + )]) + example_nat_rule = azure.lb.NatRule("exampleNatRule", + resource_group_name=example_resource_group.name, + loadbalancer_id=example_load_balancer.id, + protocol="Tcp", + frontend_port=3389, + backend_port=3389, + frontend_ip_configuration_name="primary") + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_nat_rule_association = azure.network.NetworkInterfaceNatRuleAssociation("exampleNetworkInterfaceNatRuleAssociation", + network_interface_id=example_network_interface.id, + ip_configuration_name="testconfiguration1", + nat_rule_id=example_nat_rule.id) + ``` + ## Import Associations between Network Interfaces and Load Balancer NAT Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_interface_security_group_association.py b/sdk/python/pulumi_azure/network/network_interface_security_group_association.py index f2dede7999..c8d0993ef2 100644 --- a/sdk/python/pulumi_azure/network/network_interface_security_group_association.py +++ b/sdk/python/pulumi_azure/network/network_interface_security_group_association.py @@ -138,6 +138,37 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Network Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_security_group_association = azure.network.NetworkInterfaceSecurityGroupAssociation("exampleNetworkInterfaceSecurityGroupAssociation", + network_interface_id=example_network_interface.id, + network_security_group_id=example_network_security_group.id) + ``` + ## Import Associations between Network Interfaces and Network Security Group can be imported using the `resource id`, e.g. @@ -160,6 +191,37 @@ def __init__(__self__, """ Manages the association between a Network Interface and a Network Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_network_interface_security_group_association = azure.network.NetworkInterfaceSecurityGroupAssociation("exampleNetworkInterfaceSecurityGroupAssociation", + network_interface_id=example_network_interface.id, + network_security_group_id=example_network_security_group.id) + ``` + ## Import Associations between Network Interfaces and Network Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager.py b/sdk/python/pulumi_azure/network/network_manager.py index beb421044a..db2b4d9edf 100644 --- a/sdk/python/pulumi_azure/network/network_manager.py +++ b/sdk/python/pulumi_azure/network/network_manager.py @@ -346,6 +346,30 @@ def __init__(__self__, """ Manages a Network Managers. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager", + tags={ + "foo": "bar", + }) + ``` + ## Import Network Managers can be imported using the `resource id`, e.g. @@ -373,6 +397,30 @@ def __init__(__self__, """ Manages a Network Managers. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager", + tags={ + "foo": "bar", + }) + ``` + ## Import Network Managers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_admin_rule.py b/sdk/python/pulumi_azure/network/network_manager_admin_rule.py index e3ec9df3d9..b9edee00e0 100644 --- a/sdk/python/pulumi_azure/network/network_manager_admin_rule.py +++ b/sdk/python/pulumi_azure/network/network_manager_admin_rule.py @@ -480,6 +480,58 @@ def __init__(__self__, """ Manages a Network Manager Admin Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_network_manager_security_admin_configuration = azure.network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", network_manager_id=example_network_manager.id) + example_network_manager_admin_rule_collection = azure.network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", + security_admin_configuration_id=example_network_manager_security_admin_configuration.id, + network_group_ids=[example_network_manager_network_group.id]) + example_network_manager_admin_rule = azure.network.NetworkManagerAdminRule("exampleNetworkManagerAdminRule", + admin_rule_collection_id=example_network_manager_admin_rule_collection.id, + action="Deny", + direction="Outbound", + priority=1, + protocol="Tcp", + source_port_ranges=[ + "80", + "1024-65535", + ], + destination_port_ranges=["80"], + sources=[azure.network.NetworkManagerAdminRuleSourceArgs( + address_prefix_type="ServiceTag", + address_prefix="Internet", + )], + destinations=[ + azure.network.NetworkManagerAdminRuleDestinationArgs( + address_prefix_type="IPPrefix", + address_prefix="10.1.0.1", + ), + azure.network.NetworkManagerAdminRuleDestinationArgs( + address_prefix_type="IPPrefix", + address_prefix="10.0.0.0/24", + ), + ], + description="example admin rule") + ``` + ## Import Network Manager Admin Rule can be imported using the `resource id`, e.g. @@ -511,6 +563,58 @@ def __init__(__self__, """ Manages a Network Manager Admin Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_network_manager_security_admin_configuration = azure.network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", network_manager_id=example_network_manager.id) + example_network_manager_admin_rule_collection = azure.network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", + security_admin_configuration_id=example_network_manager_security_admin_configuration.id, + network_group_ids=[example_network_manager_network_group.id]) + example_network_manager_admin_rule = azure.network.NetworkManagerAdminRule("exampleNetworkManagerAdminRule", + admin_rule_collection_id=example_network_manager_admin_rule_collection.id, + action="Deny", + direction="Outbound", + priority=1, + protocol="Tcp", + source_port_ranges=[ + "80", + "1024-65535", + ], + destination_port_ranges=["80"], + sources=[azure.network.NetworkManagerAdminRuleSourceArgs( + address_prefix_type="ServiceTag", + address_prefix="Internet", + )], + destinations=[ + azure.network.NetworkManagerAdminRuleDestinationArgs( + address_prefix_type="IPPrefix", + address_prefix="10.1.0.1", + ), + azure.network.NetworkManagerAdminRuleDestinationArgs( + address_prefix_type="IPPrefix", + address_prefix="10.0.0.0/24", + ), + ], + description="example admin rule") + ``` + ## Import Network Manager Admin Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_admin_rule_collection.py b/sdk/python/pulumi_azure/network/network_manager_admin_rule_collection.py index 0773b56c17..ef31b731dc 100644 --- a/sdk/python/pulumi_azure/network/network_manager_admin_rule_collection.py +++ b/sdk/python/pulumi_azure/network/network_manager_admin_rule_collection.py @@ -212,6 +212,32 @@ def __init__(__self__, """ Manages a Network Manager Admin Rule Collection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_network_manager_security_admin_configuration = azure.network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", network_manager_id=example_network_manager.id) + example_network_manager_admin_rule_collection = azure.network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", + security_admin_configuration_id=example_network_manager_security_admin_configuration.id, + network_group_ids=[example_network_manager_network_group.id]) + ``` + ## Import Network Manager Admin Rule Collection can be imported using the `resource id`, e.g. @@ -236,6 +262,32 @@ def __init__(__self__, """ Manages a Network Manager Admin Rule Collection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_network_manager_security_admin_configuration = azure.network.NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", network_manager_id=example_network_manager.id) + example_network_manager_admin_rule_collection = azure.network.NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", + security_admin_configuration_id=example_network_manager_security_admin_configuration.id, + network_group_ids=[example_network_manager_network_group.id]) + ``` + ## Import Network Manager Admin Rule Collection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_connectivity_configuration.py b/sdk/python/pulumi_azure/network/network_manager_connectivity_configuration.py index 0ed5903c90..2e3da47d1f 100644 --- a/sdk/python/pulumi_azure/network/network_manager_connectivity_configuration.py +++ b/sdk/python/pulumi_azure/network/network_manager_connectivity_configuration.py @@ -377,6 +377,44 @@ def __init__(__self__, > **Note:** The `network.NetworkManagerConnectivityConfiguration` deployment may modify or delete existing Network Peering resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + flow_timeout_in_minutes=10) + example_network_manager_connectivity_configuration = azure.network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", + network_manager_id=example_network_manager.id, + connectivity_topology="HubAndSpoke", + applies_to_groups=[azure.network.NetworkManagerConnectivityConfigurationAppliesToGroupArgs( + group_connectivity="DirectlyConnected", + network_group_id=example_network_manager_network_group.id, + )], + hub=azure.network.NetworkManagerConnectivityConfigurationHubArgs( + resource_id=example_virtual_network.id, + resource_type="Microsoft.Network/virtualNetworks", + )) + ``` + ## Import Network Manager Connectivity Configuration can be imported using the `resource id`, e.g. @@ -407,6 +445,44 @@ def __init__(__self__, > **Note:** The `network.NetworkManagerConnectivityConfiguration` deployment may modify or delete existing Network Peering resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + flow_timeout_in_minutes=10) + example_network_manager_connectivity_configuration = azure.network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", + network_manager_id=example_network_manager.id, + connectivity_topology="HubAndSpoke", + applies_to_groups=[azure.network.NetworkManagerConnectivityConfigurationAppliesToGroupArgs( + group_connectivity="DirectlyConnected", + network_group_id=example_network_manager_network_group.id, + )], + hub=azure.network.NetworkManagerConnectivityConfigurationHubArgs( + resource_id=example_virtual_network.id, + resource_type="Microsoft.Network/virtualNetworks", + )) + ``` + ## Import Network Manager Connectivity Configuration can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_deployment.py b/sdk/python/pulumi_azure/network/network_manager_deployment.py index 4faf0cfff7..d7fd456296 100644 --- a/sdk/python/pulumi_azure/network/network_manager_deployment.py +++ b/sdk/python/pulumi_azure/network/network_manager_deployment.py @@ -256,6 +256,49 @@ def __init__(__self__, > **NOTE on Virtual Network Peering:** Using Network Manager Deployment to deploy Connectivity Configuration may modify or delete existing Virtual Network Peering. At this time you should not use Network Peering resource in conjunction with Network Manager Deployment. Doing so may cause a conflict of Peering configurations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + flow_timeout_in_minutes=10) + example_network_manager_connectivity_configuration = azure.network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", + network_manager_id=example_network_manager.id, + connectivity_topology="HubAndSpoke", + applies_to_groups=[azure.network.NetworkManagerConnectivityConfigurationAppliesToGroupArgs( + group_connectivity="None", + network_group_id=example_network_manager_network_group.id, + )], + hub=azure.network.NetworkManagerConnectivityConfigurationHubArgs( + resource_id=example_virtual_network.id, + resource_type="Microsoft.Network/virtualNetworks", + )) + example_network_manager_deployment = azure.network.NetworkManagerDeployment("exampleNetworkManagerDeployment", + network_manager_id=example_network_manager.id, + location="eastus", + scope_access="Connectivity", + configuration_ids=[example_network_manager_connectivity_configuration.id]) + ``` + ## Import Network Manager Deployment can be imported using the `resource id`, e.g. @@ -283,6 +326,49 @@ def __init__(__self__, > **NOTE on Virtual Network Peering:** Using Network Manager Deployment to deploy Connectivity Configuration may modify or delete existing Virtual Network Peering. At this time you should not use Network Peering resource in conjunction with Network Manager Deployment. Doing so may cause a conflict of Peering configurations. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + flow_timeout_in_minutes=10) + example_network_manager_connectivity_configuration = azure.network.NetworkManagerConnectivityConfiguration("exampleNetworkManagerConnectivityConfiguration", + network_manager_id=example_network_manager.id, + connectivity_topology="HubAndSpoke", + applies_to_groups=[azure.network.NetworkManagerConnectivityConfigurationAppliesToGroupArgs( + group_connectivity="None", + network_group_id=example_network_manager_network_group.id, + )], + hub=azure.network.NetworkManagerConnectivityConfigurationHubArgs( + resource_id=example_virtual_network.id, + resource_type="Microsoft.Network/virtualNetworks", + )) + example_network_manager_deployment = azure.network.NetworkManagerDeployment("exampleNetworkManagerDeployment", + network_manager_id=example_network_manager.id, + location="eastus", + scope_access="Connectivity", + configuration_ids=[example_network_manager_connectivity_configuration.id]) + ``` + ## Import Network Manager Deployment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_management_group_connection.py b/sdk/python/pulumi_azure/network/network_manager_management_group_connection.py index a8848aac82..8f6b8f5151 100644 --- a/sdk/python/pulumi_azure/network/network_manager_management_group_connection.py +++ b/sdk/python/pulumi_azure/network/network_manager_management_group_connection.py @@ -232,6 +232,38 @@ def __init__(__self__, """ Manages a Network Manager Management Group Connection which may cross tenants. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup") + alt = azure.core.get_subscription(subscription_id="00000000-0000-0000-0000-000000000000") + example_group_subscription_association = azure.management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", + management_group_id=example_group.id, + subscription_id=alt.id) + current_subscription = azure.core.get_subscription() + current_client_config = azure.core.get_client_config() + network_contributor = azure.authorization.Assignment("networkContributor", + scope=example_group.id, + role_definition_name="Network Contributor", + principal_id=current_client_config.object_id) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current_subscription.id], + ), + scope_accesses=["SecurityAdmin"]) + example_network_manager_management_group_connection = azure.network.NetworkManagerManagementGroupConnection("exampleNetworkManagerManagementGroupConnection", + management_group_id=example_group.id, + network_manager_id=example_network_manager.id, + description="example", + opts=pulumi.ResourceOptions(depends_on=[network_contributor])) + ``` + ## Import Network Manager Management Group Connection can be imported using the `resource id`, e.g. @@ -256,6 +288,38 @@ def __init__(__self__, """ Manages a Network Manager Management Group Connection which may cross tenants. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_group = azure.management.Group("exampleGroup") + alt = azure.core.get_subscription(subscription_id="00000000-0000-0000-0000-000000000000") + example_group_subscription_association = azure.management.GroupSubscriptionAssociation("exampleGroupSubscriptionAssociation", + management_group_id=example_group.id, + subscription_id=alt.id) + current_subscription = azure.core.get_subscription() + current_client_config = azure.core.get_client_config() + network_contributor = azure.authorization.Assignment("networkContributor", + scope=example_group.id, + role_definition_name="Network Contributor", + principal_id=current_client_config.object_id) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current_subscription.id], + ), + scope_accesses=["SecurityAdmin"]) + example_network_manager_management_group_connection = azure.network.NetworkManagerManagementGroupConnection("exampleNetworkManagerManagementGroupConnection", + management_group_id=example_group.id, + network_manager_id=example_network_manager.id, + description="example", + opts=pulumi.ResourceOptions(depends_on=[network_contributor])) + ``` + ## Import Network Manager Management Group Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_network_group.py b/sdk/python/pulumi_azure/network/network_manager_network_group.py index 87b1be9501..218c931512 100644 --- a/sdk/python/pulumi_azure/network/network_manager_network_group.py +++ b/sdk/python/pulumi_azure/network/network_manager_network_group.py @@ -170,6 +170,28 @@ def __init__(__self__, """ Manages a Network Manager Network Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + ``` + ## Import Network Manager Network Group can be imported using the `resource id`, e.g. @@ -193,6 +215,28 @@ def __init__(__self__, """ Manages a Network Manager Network Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", network_manager_id=example_network_manager.id) + ``` + ## Import Network Manager Network Group can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_scope_connection.py b/sdk/python/pulumi_azure/network/network_manager_scope_connection.py index 9a9f30c34f..f66b531034 100644 --- a/sdk/python/pulumi_azure/network/network_manager_scope_connection.py +++ b/sdk/python/pulumi_azure/network/network_manager_scope_connection.py @@ -274,6 +274,30 @@ def __init__(__self__, """ Manages a Network Manager Scope Connection which may cross tenants. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current_client_config = azure.core.get_client_config() + current_subscription = azure.core.get_subscription() + alt = azure.core.get_subscription(subscription_id="00000000-0000-0000-0000-000000000000") + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current_subscription.id], + ), + scope_accesses=["SecurityAdmin"]) + example_network_manager_scope_connection = azure.network.NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", + network_manager_id=example_network_manager.id, + tenant_id=current_client_config.tenant_id, + target_scope_id=alt.id, + description="example") + ``` + ## Import Network Manager Scope Connection can be imported using the `resource id`, e.g. @@ -299,6 +323,30 @@ def __init__(__self__, """ Manages a Network Manager Scope Connection which may cross tenants. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current_client_config = azure.core.get_client_config() + current_subscription = azure.core.get_subscription() + alt = azure.core.get_subscription(subscription_id="00000000-0000-0000-0000-000000000000") + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current_subscription.id], + ), + scope_accesses=["SecurityAdmin"]) + example_network_manager_scope_connection = azure.network.NetworkManagerScopeConnection("exampleNetworkManagerScopeConnection", + network_manager_id=example_network_manager.id, + tenant_id=current_client_config.tenant_id, + target_scope_id=alt.id, + description="example") + ``` + ## Import Network Manager Scope Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_static_member.py b/sdk/python/pulumi_azure/network/network_manager_static_member.py index 7c0b3655e8..cbbd02eefb 100644 --- a/sdk/python/pulumi_azure/network/network_manager_static_member.py +++ b/sdk/python/pulumi_azure/network/network_manager_static_member.py @@ -193,6 +193,37 @@ def __init__(__self__, """ Manages a Network Manager Static Member. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", + network_manager_id=example_network_manager.id, + description="example network group") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_network_manager_static_member = azure.network.NetworkManagerStaticMember("exampleNetworkManagerStaticMember", + network_group_id=example_network_manager_network_group.id, + target_virtual_network_id=example_virtual_network.id) + ``` + ## Import Network Manager Static Member can be imported using the `resource id`, e.g. @@ -216,6 +247,37 @@ def __init__(__self__, """ Manages a Network Manager Static Member. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=[ + "Connectivity", + "SecurityAdmin", + ], + description="example network manager") + example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", + network_manager_id=example_network_manager.id, + description="example network group") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_network_manager_static_member = azure.network.NetworkManagerStaticMember("exampleNetworkManagerStaticMember", + network_group_id=example_network_manager_network_group.id, + target_virtual_network_id=example_virtual_network.id) + ``` + ## Import Network Manager Static Member can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_manager_subscription_connection.py b/sdk/python/pulumi_azure/network/network_manager_subscription_connection.py index 71216e30fe..cf29a88523 100644 --- a/sdk/python/pulumi_azure/network/network_manager_subscription_connection.py +++ b/sdk/python/pulumi_azure/network/network_manager_subscription_connection.py @@ -232,6 +232,27 @@ def __init__(__self__, """ Manages a Network Manager Subscription Connection which may cross tenants. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=["SecurityAdmin"]) + example_network_manager_subscription_connection = azure.network.NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", + subscription_id=current.id, + network_manager_id=example_network_manager.id, + description="example") + ``` + ## Import Network Subscription Network Manager Connection can be imported using the `resource id`, e.g. @@ -256,6 +277,27 @@ def __init__(__self__, """ Manages a Network Manager Subscription Connection which may cross tenants. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + current = azure.core.get_subscription() + example_network_manager = azure.network.NetworkManager("exampleNetworkManager", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + scope=azure.network.NetworkManagerScopeArgs( + subscription_ids=[current.id], + ), + scope_accesses=["SecurityAdmin"]) + example_network_manager_subscription_connection = azure.network.NetworkManagerSubscriptionConnection("exampleNetworkManagerSubscriptionConnection", + subscription_id=current.id, + network_manager_id=example_network_manager.id, + description="example") + ``` + ## Import Network Subscription Network Manager Connection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_packet_capture.py b/sdk/python/pulumi_azure/network/network_packet_capture.py index 1804aa7c20..dc7c16ddb8 100644 --- a/sdk/python/pulumi_azure/network/network_packet_capture.py +++ b/sdk/python/pulumi_azure/network/network_packet_capture.py @@ -431,6 +431,80 @@ def __init__(__self__, !> **NOTE:** The `network.NetworkPacketCapture` resource is deprecated and will be removed in favour of `compute.PacketCapture` and `compute.ScaleSetPacketCapture` in version 4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + vm_size="Standard_F2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="osdisk", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="pctest-vm", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_virtual_machine.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_network_packet_capture = azure.network.NetworkPacketCapture("exampleNetworkPacketCapture", + network_watcher_name=example_network_watcher.name, + resource_group_name=example_resource_group.name, + target_resource_id=example_virtual_machine.id, + storage_location=azure.network.NetworkPacketCaptureStorageLocationArgs( + storage_account_id=example_account.id, + ), + opts=pulumi.ResourceOptions(depends_on=[example_extension])) + ``` + + > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `compute.Extension` resource. + ## Import Packet Captures can be imported using the `resource id`, e.g. @@ -464,6 +538,80 @@ def __init__(__self__, !> **NOTE:** The `network.NetworkPacketCapture` resource is deprecated and will be removed in favour of `compute.PacketCapture` and `compute.ScaleSetPacketCapture` in version 4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="testconfiguration1", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_virtual_machine = azure.compute.VirtualMachine("exampleVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + network_interface_ids=[example_network_interface.id], + vm_size="Standard_F2", + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="osdisk", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Standard_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + computer_name="pctest-vm", + admin_username="testadmin", + admin_password="Password1234!", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_virtual_machine.id, + publisher="Microsoft.Azure.NetworkWatcher", + type="NetworkWatcherAgentLinux", + type_handler_version="1.4", + auto_upgrade_minor_version=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_network_packet_capture = azure.network.NetworkPacketCapture("exampleNetworkPacketCapture", + network_watcher_name=example_network_watcher.name, + resource_group_name=example_resource_group.name, + target_resource_id=example_virtual_machine.id, + storage_location=azure.network.NetworkPacketCaptureStorageLocationArgs( + storage_account_id=example_account.id, + ), + opts=pulumi.ResourceOptions(depends_on=[example_extension])) + ``` + + > **NOTE:** This Resource requires that [the Network Watcher Virtual Machine Extension](https://docs.microsoft.com/azure/network-watcher/network-watcher-packet-capture-manage-portal#before-you-begin) is installed on the Virtual Machine before capturing can be enabled which can be installed via the `compute.Extension` resource. + ## Import Packet Captures can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_security_group.py b/sdk/python/pulumi_azure/network/network_security_group.py index 21b353ceb1..fb1603b1ff 100644 --- a/sdk/python/pulumi_azure/network/network_security_group.py +++ b/sdk/python/pulumi_azure/network/network_security_group.py @@ -262,6 +262,32 @@ def __init__(__self__, provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + security_rules=[azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="test123", + priority=100, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + )], + tags={ + "environment": "Production", + }) + ``` + ## Import Network Security Groups can be imported using the `resource id`, e.g. @@ -293,6 +319,32 @@ def __init__(__self__, provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + security_rules=[azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="test123", + priority=100, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + )], + tags={ + "environment": "Production", + }) + ``` + ## Import Network Security Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_security_rule.py b/sdk/python/pulumi_azure/network/network_security_rule.py index b137e50a4a..abd36bf4e4 100644 --- a/sdk/python/pulumi_azure/network/network_security_rule.py +++ b/sdk/python/pulumi_azure/network/network_security_rule.py @@ -778,6 +778,29 @@ def __init__(__self__, provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_security_rule = azure.network.NetworkSecurityRule("exampleNetworkSecurityRule", + priority=100, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + ``` + ## Import Network Security Rules can be imported using the `resource id`, e.g. @@ -820,6 +843,29 @@ def __init__(__self__, provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource. At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_security_rule = azure.network.NetworkSecurityRule("exampleNetworkSecurityRule", + priority=100, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + ``` + ## Import Network Security Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_watcher.py b/sdk/python/pulumi_azure/network/network_watcher.py index fb25492fae..1da5ed4029 100644 --- a/sdk/python/pulumi_azure/network/network_watcher.py +++ b/sdk/python/pulumi_azure/network/network_watcher.py @@ -207,6 +207,18 @@ def __init__(__self__, """ Manages a Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Network Watchers can be imported using the `resource id`, e.g. @@ -231,6 +243,18 @@ def __init__(__self__, """ Manages a Network Watcher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_watcher = azure.network.NetworkWatcher("exampleNetworkWatcher", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + ``` + ## Import Network Watchers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/network_watcher_flow_log.py b/sdk/python/pulumi_azure/network/network_watcher_flow_log.py index 707e6e2f93..b6bd780f01 100644 --- a/sdk/python/pulumi_azure/network/network_watcher_flow_log.py +++ b/sdk/python/pulumi_azure/network/network_watcher_flow_log.py @@ -491,6 +491,49 @@ def __init__(__self__, version: Optional[pulumi.Input[int]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test_network_security_group = azure.network.NetworkSecurityGroup("testNetworkSecurityGroup", + location=example.location, + resource_group_name=example.name) + test_network_watcher = azure.network.NetworkWatcher("testNetworkWatcher", + location=example.location, + resource_group_name=example.name) + test_account = azure.storage.Account("testAccount", + resource_group_name=example.name, + location=example.location, + account_tier="Standard", + account_kind="StorageV2", + account_replication_type="LRS", + enable_https_traffic_only=True) + test_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("testAnalyticsWorkspace", + location=example.location, + resource_group_name=example.name, + sku="PerGB2018") + test_network_watcher_flow_log = azure.network.NetworkWatcherFlowLog("testNetworkWatcherFlowLog", + network_watcher_name=test_network_watcher.name, + resource_group_name=example.name, + network_security_group_id=test_network_security_group.id, + storage_account_id=test_account.id, + enabled=True, + retention_policy=azure.network.NetworkWatcherFlowLogRetentionPolicyArgs( + enabled=True, + days=7, + ), + traffic_analytics=azure.network.NetworkWatcherFlowLogTrafficAnalyticsArgs( + enabled=True, + workspace_id=test_analytics_workspace.workspace_id, + workspace_region=test_analytics_workspace.location, + workspace_resource_id=test_analytics_workspace.id, + interval_in_minutes=10, + )) + ``` + ## Import Network Watcher Flow Logs can be imported using the `resource id`, e.g. @@ -520,6 +563,49 @@ def __init__(__self__, args: NetworkWatcherFlowLogArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test_network_security_group = azure.network.NetworkSecurityGroup("testNetworkSecurityGroup", + location=example.location, + resource_group_name=example.name) + test_network_watcher = azure.network.NetworkWatcher("testNetworkWatcher", + location=example.location, + resource_group_name=example.name) + test_account = azure.storage.Account("testAccount", + resource_group_name=example.name, + location=example.location, + account_tier="Standard", + account_kind="StorageV2", + account_replication_type="LRS", + enable_https_traffic_only=True) + test_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("testAnalyticsWorkspace", + location=example.location, + resource_group_name=example.name, + sku="PerGB2018") + test_network_watcher_flow_log = azure.network.NetworkWatcherFlowLog("testNetworkWatcherFlowLog", + network_watcher_name=test_network_watcher.name, + resource_group_name=example.name, + network_security_group_id=test_network_security_group.id, + storage_account_id=test_account.id, + enabled=True, + retention_policy=azure.network.NetworkWatcherFlowLogRetentionPolicyArgs( + enabled=True, + days=7, + ), + traffic_analytics=azure.network.NetworkWatcherFlowLogTrafficAnalyticsArgs( + enabled=True, + workspace_id=test_analytics_workspace.workspace_id, + workspace_region=test_analytics_workspace.location, + workspace_resource_id=test_analytics_workspace.id, + interval_in_minutes=10, + )) + ``` + ## Import Network Watcher Flow Logs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/outputs.py b/sdk/python/pulumi_azure/network/outputs.py index 5b9d40c348..4557e06ec3 100644 --- a/sdk/python/pulumi_azure/network/outputs.py +++ b/sdk/python/pulumi_azure/network/outputs.py @@ -1856,6 +1856,10 @@ def __init__(__self__, *, :param Sequence['ApplicationGatewayPrivateLinkConfigurationIpConfigurationArgs'] ip_configurations: One or more `ip_configuration` blocks as defined below. > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + + ```python + import pulumi + ``` :param str name: The name of the private link configuration. :param str id: The ID of the Rewrite Rule Set """ @@ -1892,6 +1896,10 @@ def ip_configurations(self) -> Sequence['outputs.ApplicationGatewayPrivateLinkCo One or more `ip_configuration` blocks as defined below. > **Please Note**: The `AllowApplicationGatewayPrivateLink` feature must be registered on the subscription before enabling private link + + ```python + import pulumi + ``` """ return pulumi.get(self, "ip_configurations") diff --git a/sdk/python/pulumi_azure/network/point_to_point_vpn_gateway.py b/sdk/python/pulumi_azure/network/point_to_point_vpn_gateway.py index ab899c80ac..71f3dc3406 100644 --- a/sdk/python/pulumi_azure/network/point_to_point_vpn_gateway.py +++ b/sdk/python/pulumi_azure/network/point_to_point_vpn_gateway.py @@ -459,6 +459,63 @@ def __init__(__self__, """ Manages a Point-to-Site VPN Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.0.0/23") + example_vpn_server_configuration = azure.network.VpnServerConfiguration("exampleVpnServerConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + vpn_authentication_types=["Certificate"], + client_root_certificates=[azure.network.VpnServerConfigurationClientRootCertificateArgs( + name="DigiCert-Federated-ID-Root-CA", + public_cert_data=\"\"\"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + \"\"\", + )]) + example_point_to_point_vpn_gateway = azure.network.PointToPointVpnGateway("examplePointToPointVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id, + vpn_server_configuration_id=example_vpn_server_configuration.id, + scale_unit=1, + connection_configuration=azure.network.PointToPointVpnGatewayConnectionConfigurationArgs( + name="example-gateway-config", + vpn_client_address_pool=azure.network.PointToPointVpnGatewayConnectionConfigurationVpnClientAddressPoolArgs( + address_prefixes=["10.0.2.0/24"], + ), + )) + ``` + ## Import Point-to-Site VPN Gateway's can be imported using the `resource id`, e.g. @@ -489,6 +546,63 @@ def __init__(__self__, """ Manages a Point-to-Site VPN Gateway. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.0.0/23") + example_vpn_server_configuration = azure.network.VpnServerConfiguration("exampleVpnServerConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + vpn_authentication_types=["Certificate"], + client_root_certificates=[azure.network.VpnServerConfigurationClientRootCertificateArgs( + name="DigiCert-Federated-ID-Root-CA", + public_cert_data=\"\"\"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + \"\"\", + )]) + example_point_to_point_vpn_gateway = azure.network.PointToPointVpnGateway("examplePointToPointVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id, + vpn_server_configuration_id=example_vpn_server_configuration.id, + scale_unit=1, + connection_configuration=azure.network.PointToPointVpnGatewayConnectionConfigurationArgs( + name="example-gateway-config", + vpn_client_address_pool=azure.network.PointToPointVpnGatewayConnectionConfigurationVpnClientAddressPoolArgs( + address_prefixes=["10.0.2.0/24"], + ), + )) + ``` + ## Import Point-to-Site VPN Gateway's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/profile.py b/sdk/python/pulumi_azure/network/profile.py index 1dc9955486..cb350a7734 100644 --- a/sdk/python/pulumi_azure/network/profile.py +++ b/sdk/python/pulumi_azure/network/profile.py @@ -271,6 +271,40 @@ def __init__(__self__, """ Manages a Network Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.1.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.ContainerInstance/containerGroups", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_profile = azure.network.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + container_network_interface=azure.network.ProfileContainerNetworkInterfaceArgs( + name="examplecnic", + ip_configurations=[azure.network.ProfileContainerNetworkInterfaceIpConfigurationArgs( + name="exampleipconfig", + subnet_id=example_subnet.id, + )], + )) + ``` + ## Import Network Profile can be imported using the `resource id`, e.g. @@ -296,6 +330,40 @@ def __init__(__self__, """ Manages a Network Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.1.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.1.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.ContainerInstance/containerGroups", + actions=["Microsoft.Network/virtualNetworks/subnets/action"], + ), + )]) + example_profile = azure.network.Profile("exampleProfile", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + container_network_interface=azure.network.ProfileContainerNetworkInterfaceArgs( + name="examplecnic", + ip_configurations=[azure.network.ProfileContainerNetworkInterfaceIpConfigurationArgs( + name="exampleipconfig", + subnet_id=example_subnet.id, + )], + )) + ``` + ## Import Network Profile can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/public_ip.py b/sdk/python/pulumi_azure/network/public_ip.py index 27f10deb17..d898458851 100644 --- a/sdk/python/pulumi_azure/network/public_ip.py +++ b/sdk/python/pulumi_azure/network/public_ip.py @@ -829,6 +829,22 @@ def __init__(__self__, > **Note** If this resource is to be associated with a resource that requires disassociation before destruction (such as `network.NetworkInterface`) it is recommended to set the `lifecycle` argument `create_before_destroy = true`. Otherwise, it can fail to disassociate on destruction. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + tags={ + "environment": "Production", + }) + ``` + ## Import Public IPs can be imported using the `resource id`, e.g. @@ -882,6 +898,22 @@ def __init__(__self__, > **Note** If this resource is to be associated with a resource that requires disassociation before destruction (such as `network.NetworkInterface`) it is recommended to set the `lifecycle` argument `create_before_destroy = true`. Otherwise, it can fail to disassociate on destruction. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + tags={ + "environment": "Production", + }) + ``` + ## Import Public IPs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/public_ip_prefix.py b/sdk/python/pulumi_azure/network/public_ip_prefix.py index 4329bf5e1d..e59082fcb3 100644 --- a/sdk/python/pulumi_azure/network/public_ip_prefix.py +++ b/sdk/python/pulumi_azure/network/public_ip_prefix.py @@ -407,6 +407,22 @@ def __init__(__self__, """ Manages a Public IP Prefix. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip_prefix = azure.network.PublicIpPrefix("examplePublicIpPrefix", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + prefix_length=31, + tags={ + "environment": "Production", + }) + ``` + ## Import Public IP Prefixes can be imported using the `resource id`, e.g. @@ -441,6 +457,22 @@ def __init__(__self__, """ Manages a Public IP Prefix. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip_prefix = azure.network.PublicIpPrefix("examplePublicIpPrefix", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + prefix_length=31, + tags={ + "environment": "Production", + }) + ``` + ## Import Public IP Prefixes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/route.py b/sdk/python/pulumi_azure/network/route.py index 3c46c9ef88..99325bd6f0 100644 --- a/sdk/python/pulumi_azure/network/route.py +++ b/sdk/python/pulumi_azure/network/route.py @@ -304,6 +304,23 @@ def __init__(__self__, provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource. At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_route = azure.network.Route("exampleRoute", + resource_group_name=example_resource_group.name, + route_table_name=example_route_table.name, + address_prefix="10.1.0.0/16", + next_hop_type="VnetLocal") + ``` + ## Import Routes can be imported using the `resource id`, e.g. @@ -334,6 +351,23 @@ def __init__(__self__, provides both a standalone Route resource, and allows for Routes to be defined in-line within the Route Table resource. At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_route = azure.network.Route("exampleRoute", + resource_group_name=example_resource_group.name, + route_table_name=example_route_table.name, + address_prefix="10.1.0.0/16", + next_hop_type="VnetLocal") + ``` + ## Import Routes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/route_filter.py b/sdk/python/pulumi_azure/network/route_filter.py index 0c6e84ffec..7e9e42d7d8 100644 --- a/sdk/python/pulumi_azure/network/route_filter.py +++ b/sdk/python/pulumi_azure/network/route_filter.py @@ -246,6 +246,23 @@ def __init__(__self__, """ Manages a Route Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.RouteFilter("example", + location="East US", + resource_group_name="example", + rule=azure.network.RouteFilterRuleArgs( + access="Allow", + communities=["12076:52004"], + name="rule", + rule_type="Community", + )) + ``` + ## Import Route Filters can be imported using the `resource id`, e.g. @@ -271,6 +288,23 @@ def __init__(__self__, """ Manages a Route Filter. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.RouteFilter("example", + location="East US", + resource_group_name="example", + rule=azure.network.RouteFilterRuleArgs( + access="Allow", + communities=["12076:52004"], + name="rule", + rule_type="Community", + )) + ``` + ## Import Route Filters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/route_map.py b/sdk/python/pulumi_azure/network/route_map.py index 6a76e001ec..863aa418dc 100644 --- a/sdk/python/pulumi_azure/network/route_map.py +++ b/sdk/python/pulumi_azure/network/route_map.py @@ -172,6 +172,39 @@ def __init__(__self__, """ Manages a Route Map. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_route_map = azure.network.RouteMap("exampleRouteMap", + virtual_hub_id=example_virtual_hub.id, + rules=[azure.network.RouteMapRuleArgs( + name="rule1", + next_step_if_matched="Continue", + actions=[azure.network.RouteMapRuleActionArgs( + type="Add", + parameters=[azure.network.RouteMapRuleActionParameterArgs( + as_paths=["22334"], + )], + )], + match_criterions=[azure.network.RouteMapRuleMatchCriterionArgs( + match_condition="Contains", + route_prefixes=["10.0.0.0/8"], + )], + )]) + ``` + ## Import Route Maps can be imported using the `resource id`, e.g. @@ -195,6 +228,39 @@ def __init__(__self__, """ Manages a Route Map. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_route_map = azure.network.RouteMap("exampleRouteMap", + virtual_hub_id=example_virtual_hub.id, + rules=[azure.network.RouteMapRuleArgs( + name="rule1", + next_step_if_matched="Continue", + actions=[azure.network.RouteMapRuleActionArgs( + type="Add", + parameters=[azure.network.RouteMapRuleActionParameterArgs( + as_paths=["22334"], + )], + )], + match_criterions=[azure.network.RouteMapRuleMatchCriterionArgs( + match_condition="Contains", + route_prefixes=["10.0.0.0/8"], + )], + )]) + ``` + ## Import Route Maps can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/route_server.py b/sdk/python/pulumi_azure/network/route_server.py index 0954a1e4af..c266377e3c 100644 --- a/sdk/python/pulumi_azure/network/route_server.py +++ b/sdk/python/pulumi_azure/network/route_server.py @@ -426,6 +426,38 @@ def __init__(__self__, """ Manages an Azure Route Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "environment": "Production", + }) + example_subnet = azure.network.Subnet("exampleSubnet", + virtual_network_name=example_virtual_network.name, + resource_group_name=example_resource_group.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard") + example_route_server = azure.network.RouteServer("exampleRouteServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id, + branch_to_branch_traffic_enabled=True) + ``` + ## Import Route Server can be imported using the `resource id`, e.g. @@ -456,6 +488,38 @@ def __init__(__self__, """ Manages an Azure Route Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "environment": "Production", + }) + example_subnet = azure.network.Subnet("exampleSubnet", + virtual_network_name=example_virtual_network.name, + resource_group_name=example_resource_group.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard") + example_route_server = azure.network.RouteServer("exampleRouteServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id, + branch_to_branch_traffic_enabled=True) + ``` + ## Import Route Server can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/route_server_bgp_connection.py b/sdk/python/pulumi_azure/network/route_server_bgp_connection.py index d9e1b9e3dd..8d9098afc7 100644 --- a/sdk/python/pulumi_azure/network/route_server_bgp_connection.py +++ b/sdk/python/pulumi_azure/network/route_server_bgp_connection.py @@ -217,6 +217,42 @@ def __init__(__self__, """ Manages a Bgp Connection for a Route Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "environment": "Production", + }) + example_subnet = azure.network.Subnet("exampleSubnet", + virtual_network_name=example_virtual_network.name, + resource_group_name=example_resource_group.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard") + example_route_server = azure.network.RouteServer("exampleRouteServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id, + branch_to_branch_traffic_enabled=True) + example_route_server_bgp_connection = azure.network.RouteServerBgpConnection("exampleRouteServerBgpConnection", + route_server_id=example_route_server.id, + peer_asn=65501, + peer_ip="169.254.21.5") + ``` + ## Import Route Server Bgp Connections can be imported using the `resource id`, e.g. @@ -241,6 +277,42 @@ def __init__(__self__, """ Manages a Bgp Connection for a Route Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "environment": "Production", + }) + example_subnet = azure.network.Subnet("exampleSubnet", + virtual_network_name=example_virtual_network.name, + resource_group_name=example_resource_group.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard") + example_route_server = azure.network.RouteServer("exampleRouteServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id, + branch_to_branch_traffic_enabled=True) + example_route_server_bgp_connection = azure.network.RouteServerBgpConnection("exampleRouteServerBgpConnection", + route_server_id=example_route_server.id, + peer_asn=65501, + peer_ip="169.254.21.5") + ``` + ## Import Route Server Bgp Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/route_table.py b/sdk/python/pulumi_azure/network/route_table.py index ef30af6893..542cf39b7d 100644 --- a/sdk/python/pulumi_azure/network/route_table.py +++ b/sdk/python/pulumi_azure/network/route_table.py @@ -316,6 +316,27 @@ def __init__(__self__, > **NOTE on Route Tables and Routes:** There is both a standalone `route` resource, and allows for Routes to be defined in-line within the `route_table` resource. At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + routes=[azure.network.RouteTableRouteArgs( + name="route1", + address_prefix="10.1.0.0/16", + next_hop_type="VnetLocal", + )], + tags={ + "environment": "Production", + }) + ``` + ## Import Route Tables can be imported using the `resource id`, e.g. @@ -347,6 +368,27 @@ def __init__(__self__, > **NOTE on Route Tables and Routes:** There is both a standalone `route` resource, and allows for Routes to be defined in-line within the `route_table` resource. At this time you cannot use a Route Table with in-line Routes in conjunction with any Route resources. Doing so will cause a conflict of Route configurations and will overwrite Routes. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + routes=[azure.network.RouteTableRouteArgs( + name="route1", + address_prefix="10.1.0.0/16", + next_hop_type="VnetLocal", + )], + tags={ + "environment": "Production", + }) + ``` + ## Import Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/routing_intent.py b/sdk/python/pulumi_azure/network/routing_intent.py index e998af73eb..f68243cc04 100644 --- a/sdk/python/pulumi_azure/network/routing_intent.py +++ b/sdk/python/pulumi_azure/network/routing_intent.py @@ -177,6 +177,39 @@ def __init__(__self__, """ Manages a Virtual Hub Routing Intent. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_Hub", + sku_tier="Standard", + virtual_hub=azure.network.FirewallVirtualHubArgs( + virtual_hub_id=example_virtual_hub.id, + public_ip_count=1, + )) + example_routing_intent = azure.network.RoutingIntent("exampleRoutingIntent", + virtual_hub_id=example_virtual_hub.id, + routing_policies=[azure.network.RoutingIntentRoutingPolicyArgs( + name="InternetTrafficPolicy", + destinations=["Internet"], + next_hop=example_firewall.id, + )]) + ``` + ## Import Virtual Hub Routing Intents can be imported using the `resource id`, e.g. @@ -200,6 +233,39 @@ def __init__(__self__, """ Manages a Virtual Hub Routing Intent. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_firewall = azure.network.Firewall("exampleFirewall", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="AZFW_Hub", + sku_tier="Standard", + virtual_hub=azure.network.FirewallVirtualHubArgs( + virtual_hub_id=example_virtual_hub.id, + public_ip_count=1, + )) + example_routing_intent = azure.network.RoutingIntent("exampleRoutingIntent", + virtual_hub_id=example_virtual_hub.id, + routing_policies=[azure.network.RoutingIntentRoutingPolicyArgs( + name="InternetTrafficPolicy", + destinations=["Internet"], + next_hop=example_firewall.id, + )]) + ``` + ## Import Virtual Hub Routing Intents can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/security_partner_provider.py b/sdk/python/pulumi_azure/network/security_partner_provider.py index ed0665d1e9..31afe9aa84 100644 --- a/sdk/python/pulumi_azure/network/security_partner_provider.py +++ b/sdk/python/pulumi_azure/network/security_partner_provider.py @@ -290,6 +290,36 @@ def __init__(__self__, """ Manages a Security Partner Provider which could be associated to virtual hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.2.0/24") + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + example_security_partner_provider = azure.network.SecurityPartnerProvider("exampleSecurityPartnerProvider", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_hub_id=example_virtual_hub.id, + security_provider_name="IBoss", + tags={ + "ENV": "Prod", + }, + opts=pulumi.ResourceOptions(depends_on=[example_vpn_gateway])) + ``` + ## Import Security Partner Providers can be imported using the `resource id`, e.g. @@ -316,6 +346,36 @@ def __init__(__self__, """ Manages a Security Partner Provider which could be associated to virtual hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.2.0/24") + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + example_security_partner_provider = azure.network.SecurityPartnerProvider("exampleSecurityPartnerProvider", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_hub_id=example_virtual_hub.id, + security_provider_name="IBoss", + tags={ + "ENV": "Prod", + }, + opts=pulumi.ResourceOptions(depends_on=[example_vpn_gateway])) + ``` + ## Import Security Partner Providers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/subnet.py b/sdk/python/pulumi_azure/network/subnet.py index 64af355ec4..55a93bd428 100644 --- a/sdk/python/pulumi_azure/network/subnet.py +++ b/sdk/python/pulumi_azure/network/subnet.py @@ -546,6 +546,33 @@ def __init__(__self__, provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource. At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnets. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.ContainerInstance/containerGroups", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + ], + ), + )]) + ``` + ## Import Subnets can be imported using the `resource id`, e.g. @@ -587,6 +614,33 @@ def __init__(__self__, provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource. At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnets. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.ContainerInstance/containerGroups", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + ], + ), + )]) + ``` + ## Import Subnets can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/subnet_nat_gateway_association.py b/sdk/python/pulumi_azure/network/subnet_nat_gateway_association.py index f1bfd4dc12..038730c883 100644 --- a/sdk/python/pulumi_azure/network/subnet_nat_gateway_association.py +++ b/sdk/python/pulumi_azure/network/subnet_nat_gateway_association.py @@ -138,6 +138,29 @@ def __init__(__self__, """ Associates a NAT Gateway with a Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet_nat_gateway_association = azure.network.SubnetNatGatewayAssociation("exampleSubnetNatGatewayAssociation", + subnet_id=example_subnet.id, + nat_gateway_id=example_nat_gateway.id) + ``` + ## Import Subnet NAT Gateway Associations can be imported using the `resource id` of the Subnet, e.g. @@ -160,6 +183,29 @@ def __init__(__self__, """ Associates a NAT Gateway with a Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_nat_gateway = azure.network.NatGateway("exampleNatGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet_nat_gateway_association = azure.network.SubnetNatGatewayAssociation("exampleSubnetNatGatewayAssociation", + subnet_id=example_subnet.id, + nat_gateway_id=example_nat_gateway.id) + ``` + ## Import Subnet NAT Gateway Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/python/pulumi_azure/network/subnet_network_security_group_association.py b/sdk/python/pulumi_azure/network/subnet_network_security_group_association.py index 16d06a9d98..9e6f8f185d 100644 --- a/sdk/python/pulumi_azure/network/subnet_network_security_group_association.py +++ b/sdk/python/pulumi_azure/network/subnet_network_security_group_association.py @@ -138,6 +138,40 @@ def __init__(__self__, """ Associates a Network Security Group with a Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + security_rules=[azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="test123", + priority=100, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + ``` + ## Import Subnet `<->` Network Security Group Associations can be imported using the `resource id` of the Subnet, e.g. @@ -160,6 +194,40 @@ def __init__(__self__, """ Associates a Network Security Group with a Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + security_rules=[azure.network.NetworkSecurityGroupSecurityRuleArgs( + name="test123", + priority=100, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + ``` + ## Import Subnet `<->` Network Security Group Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/python/pulumi_azure/network/subnet_route_table_association.py b/sdk/python/pulumi_azure/network/subnet_route_table_association.py index b47934c7cf..55e67bd920 100644 --- a/sdk/python/pulumi_azure/network/subnet_route_table_association.py +++ b/sdk/python/pulumi_azure/network/subnet_route_table_association.py @@ -138,6 +138,35 @@ def __init__(__self__, """ Associates a Route Table with a Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + routes=[azure.network.RouteTableRouteArgs( + name="example", + address_prefix="10.100.0.0/14", + next_hop_type="VirtualAppliance", + next_hop_in_ip_address="10.10.1.1", + )]) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + ``` + ## Import Subnet Route Table Associations can be imported using the `resource id` of the Subnet, e.g. @@ -160,6 +189,35 @@ def __init__(__self__, """ Associates a Route Table with a Subnet within a Virtual Network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + routes=[azure.network.RouteTableRouteArgs( + name="example", + address_prefix="10.100.0.0/14", + next_hop_type="VirtualAppliance", + next_hop_in_ip_address="10.10.1.1", + )]) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + ``` + ## Import Subnet Route Table Associations can be imported using the `resource id` of the Subnet, e.g. diff --git a/sdk/python/pulumi_azure/network/traffic_manager_azure_endpoint.py b/sdk/python/pulumi_azure/network/traffic_manager_azure_endpoint.py index 5e3d80c5bb..fec97066be 100644 --- a/sdk/python/pulumi_azure/network/traffic_manager_azure_endpoint.py +++ b/sdk/python/pulumi_azure/network/traffic_manager_azure_endpoint.py @@ -407,6 +407,42 @@ def __init__(__self__, """ Manages an Azure Endpoint within a Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + domain_name_label="example-public-ip") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="example-profile", + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + example_traffic_manager_azure_endpoint = azure.network.TrafficManagerAzureEndpoint("exampleTrafficManagerAzureEndpoint", + profile_id=example_traffic_manager_profile.id, + weight=100, + target_resource_id=example_public_ip.id) + ``` + ## Import Azure Endpoints can be imported using the `resource id`, e.g. @@ -436,6 +472,42 @@ def __init__(__self__, """ Manages an Azure Endpoint within a Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + domain_name_label="example-public-ip") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="example-profile", + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + example_traffic_manager_azure_endpoint = azure.network.TrafficManagerAzureEndpoint("exampleTrafficManagerAzureEndpoint", + profile_id=example_traffic_manager_profile.id, + weight=100, + target_resource_id=example_public_ip.id) + ``` + ## Import Azure Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/traffic_manager_external_endpoint.py b/sdk/python/pulumi_azure/network/traffic_manager_external_endpoint.py index e02b487b5e..1d171180a8 100644 --- a/sdk/python/pulumi_azure/network/traffic_manager_external_endpoint.py +++ b/sdk/python/pulumi_azure/network/traffic_manager_external_endpoint.py @@ -444,6 +444,37 @@ def __init__(__self__, """ Manages an External Endpoint within a Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="example-profile", + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + example_traffic_manager_external_endpoint = azure.network.TrafficManagerExternalEndpoint("exampleTrafficManagerExternalEndpoint", + profile_id=example_traffic_manager_profile.id, + weight=100, + target="www.example.com") + ``` + ## Import External Endpoints can be imported using the `resource id`, e.g. @@ -474,6 +505,37 @@ def __init__(__self__, """ Manages an External Endpoint within a Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="example-profile", + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + example_traffic_manager_external_endpoint = azure.network.TrafficManagerExternalEndpoint("exampleTrafficManagerExternalEndpoint", + profile_id=example_traffic_manager_profile.id, + weight=100, + target="www.example.com") + ``` + ## Import External Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/traffic_manager_nested_endpoint.py b/sdk/python/pulumi_azure/network/traffic_manager_nested_endpoint.py index c767ac1ca6..c1581b60dc 100644 --- a/sdk/python/pulumi_azure/network/traffic_manager_nested_endpoint.py +++ b/sdk/python/pulumi_azure/network/traffic_manager_nested_endpoint.py @@ -580,6 +580,56 @@ def __init__(__self__, """ Manages a Nested Endpoint within a Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + domain_name_label="example-pip") + parent = azure.network.TrafficManagerProfile("parent", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="parent-profile", + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + nested = azure.network.TrafficManagerProfile("nested", + resource_group_name=example_resource_group.name, + traffic_routing_method="Priority", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="nested-profile", + ttl=30, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=443, + path="/", + )) + example_traffic_manager_nested_endpoint = azure.network.TrafficManagerNestedEndpoint("exampleTrafficManagerNestedEndpoint", + target_resource_id=nested.id, + priority=1, + profile_id=parent.id, + minimum_child_endpoints=9, + weight=5) + ``` + ## Import Nested Endpoints can be imported using the `resource id`, e.g. @@ -615,6 +665,56 @@ def __init__(__self__, """ Manages a Nested Endpoint within a Traffic Manager Profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + domain_name_label="example-pip") + parent = azure.network.TrafficManagerProfile("parent", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="parent-profile", + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + nested = azure.network.TrafficManagerProfile("nested", + resource_group_name=example_resource_group.name, + traffic_routing_method="Priority", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name="nested-profile", + ttl=30, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=443, + path="/", + )) + example_traffic_manager_nested_endpoint = azure.network.TrafficManagerNestedEndpoint("exampleTrafficManagerNestedEndpoint", + target_resource_id=nested.id, + priority=1, + profile_id=parent.id, + minimum_child_endpoints=9, + weight=5) + ``` + ## Import Nested Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/traffic_manager_profile.py b/sdk/python/pulumi_azure/network/traffic_manager_profile.py index c8cfa74054..fd09deb2a7 100644 --- a/sdk/python/pulumi_azure/network/traffic_manager_profile.py +++ b/sdk/python/pulumi_azure/network/traffic_manager_profile.py @@ -447,6 +447,39 @@ def __init__(__self__, """ Manages a Traffic Manager Profile to which multiple endpoints can be attached. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name=server.hex, + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + ``` + ## Import Traffic Manager Profiles can be imported using the `resource id`, e.g. @@ -478,6 +511,39 @@ def __init__(__self__, """ Manages a Traffic Manager Profile to which multiple endpoints can be attached. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name=server.hex, + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + ``` + ## Import Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_hub.py b/sdk/python/pulumi_azure/network/virtual_hub.py index 06e38a586e..72a1bffba7 100644 --- a/sdk/python/pulumi_azure/network/virtual_hub.py +++ b/sdk/python/pulumi_azure/network/virtual_hub.py @@ -507,6 +507,23 @@ def __init__(__self__, """ Manages a Virtual Hub within a Virtual WAN. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.0.0/23") + ``` + ## Import Virtual Hub's can be imported using the `resource id`, e.g. @@ -537,6 +554,23 @@ def __init__(__self__, """ Manages a Virtual Hub within a Virtual WAN. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.0.0/23") + ``` + ## Import Virtual Hub's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_hub_connection.py b/sdk/python/pulumi_azure/network/virtual_hub_connection.py index f88f95d355..7f29b712b8 100644 --- a/sdk/python/pulumi_azure/network/virtual_hub_connection.py +++ b/sdk/python/pulumi_azure/network/virtual_hub_connection.py @@ -255,6 +255,30 @@ def __init__(__self__, """ Manages a Connection for a Virtual Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["172.16.0.0/12"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_virtual_hub_connection = azure.network.VirtualHubConnection("exampleVirtualHubConnection", + virtual_hub_id=example_virtual_hub.id, + remote_virtual_network_id=example_virtual_network.id) + ``` + ## Import Virtual Hub Connection's can be imported using the `resource id`, e.g. @@ -280,6 +304,30 @@ def __init__(__self__, """ Manages a Connection for a Virtual Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["172.16.0.0/12"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_virtual_hub_connection = azure.network.VirtualHubConnection("exampleVirtualHubConnection", + virtual_hub_id=example_virtual_hub.id, + remote_virtual_network_id=example_virtual_network.id) + ``` + ## Import Virtual Hub Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_hub_ip.py b/sdk/python/pulumi_azure/network/virtual_hub_ip.py index 8331d232d4..7a9f571d58 100644 --- a/sdk/python/pulumi_azure/network/virtual_hub_ip.py +++ b/sdk/python/pulumi_azure/network/virtual_hub_ip.py @@ -301,6 +301,38 @@ def __init__(__self__, > **NOTE** Virtual Hub IP only supports Standard Virtual Hub without Virtual Wan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_virtual_hub_ip = azure.network.VirtualHubIp("exampleVirtualHubIp", + virtual_hub_id=example_virtual_hub.id, + private_ip_address="10.5.1.18", + private_ip_allocation_method="Static", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id) + ``` + ## Import Virtual Hub IPs can be imported using the `resource id`, e.g. @@ -329,6 +361,38 @@ def __init__(__self__, > **NOTE** Virtual Hub IP only supports Standard Virtual Hub without Virtual Wan. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_virtual_hub_ip = azure.network.VirtualHubIp("exampleVirtualHubIp", + virtual_hub_id=example_virtual_hub.id, + private_ip_address="10.5.1.18", + private_ip_allocation_method="Static", + public_ip_address_id=example_public_ip.id, + subnet_id=example_subnet.id) + ``` + ## Import Virtual Hub IPs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_hub_route_table.py b/sdk/python/pulumi_azure/network/virtual_hub_route_table.py index f6ad8c7c1d..43d7ad85d9 100644 --- a/sdk/python/pulumi_azure/network/virtual_hub_route_table.py +++ b/sdk/python/pulumi_azure/network/virtual_hub_route_table.py @@ -209,6 +209,50 @@ def __init__(__self__, """ Manages a Virtual Hub Route Table. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.2.0/24") + example_virtual_hub_connection = azure.network.VirtualHubConnection("exampleVirtualHubConnection", + virtual_hub_id=example_virtual_hub.id, + remote_virtual_network_id=example_virtual_network.id) + example_virtual_hub_route_table = azure.network.VirtualHubRouteTable("exampleVirtualHubRouteTable", + virtual_hub_id=example_virtual_hub.id, + labels=["label1"], + routes=[azure.network.VirtualHubRouteTableRouteArgs( + name="example-route", + destinations_type="CIDR", + destinations=["10.0.0.0/16"], + next_hop_type="ResourceId", + next_hop=example_virtual_hub_connection.id, + )]) + ``` + ## Import Virtual Hub Route Tables can be imported using the `resource id`, e.g. @@ -233,6 +277,50 @@ def __init__(__self__, """ Manages a Virtual Hub Route Table. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.2.0/24") + example_virtual_hub_connection = azure.network.VirtualHubConnection("exampleVirtualHubConnection", + virtual_hub_id=example_virtual_hub.id, + remote_virtual_network_id=example_virtual_network.id) + example_virtual_hub_route_table = azure.network.VirtualHubRouteTable("exampleVirtualHubRouteTable", + virtual_hub_id=example_virtual_hub.id, + labels=["label1"], + routes=[azure.network.VirtualHubRouteTableRouteArgs( + name="example-route", + destinations_type="CIDR", + destinations=["10.0.0.0/16"], + next_hop_type="ResourceId", + next_hop=example_virtual_hub_connection.id, + )]) + ``` + ## Import Virtual Hub Route Tables can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_hub_route_table_route.py b/sdk/python/pulumi_azure/network/virtual_hub_route_table_route.py index 663ca8ed93..9387a4eb46 100644 --- a/sdk/python/pulumi_azure/network/virtual_hub_route_table_route.py +++ b/sdk/python/pulumi_azure/network/virtual_hub_route_table_route.py @@ -298,6 +298,52 @@ def __init__(__self__, > **Note:** Route table routes can managed with this resource, or in-line with the virtual_hub_route_table resource. Using both is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.2.0/24") + example_virtual_hub_route_table = azure.network.VirtualHubRouteTable("exampleVirtualHubRouteTable", + virtual_hub_id=example_virtual_hub.id, + labels=["label1"]) + example_virtual_hub_connection = azure.network.VirtualHubConnection("exampleVirtualHubConnection", + virtual_hub_id=example_virtual_hub.id, + remote_virtual_network_id=example_virtual_network.id, + routing=azure.network.VirtualHubConnectionRoutingArgs( + associated_route_table_id=example_virtual_hub_route_table.id, + )) + example_virtual_hub_route_table_route = azure.network.VirtualHubRouteTableRoute("exampleVirtualHubRouteTableRoute", + route_table_id=example_virtual_hub_route_table.id, + destinations_type="CIDR", + destinations=["10.0.0.0/16"], + next_hop_type="ResourceId", + next_hop=example_virtual_hub_connection.id) + ``` + ## Import Virtual Hub Route Table Routes can be imported using `/routes/`, e.g. @@ -326,6 +372,52 @@ def __init__(__self__, > **Note:** Route table routes can managed with this resource, or in-line with the virtual_hub_route_table resource. Using both is not supported. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.5.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.2.0/24") + example_virtual_hub_route_table = azure.network.VirtualHubRouteTable("exampleVirtualHubRouteTable", + virtual_hub_id=example_virtual_hub.id, + labels=["label1"]) + example_virtual_hub_connection = azure.network.VirtualHubConnection("exampleVirtualHubConnection", + virtual_hub_id=example_virtual_hub.id, + remote_virtual_network_id=example_virtual_network.id, + routing=azure.network.VirtualHubConnectionRoutingArgs( + associated_route_table_id=example_virtual_hub_route_table.id, + )) + example_virtual_hub_route_table_route = azure.network.VirtualHubRouteTableRoute("exampleVirtualHubRouteTableRoute", + route_table_id=example_virtual_hub_route_table.id, + destinations_type="CIDR", + destinations=["10.0.0.0/16"], + next_hop_type="ResourceId", + next_hop=example_virtual_hub_connection.id) + ``` + ## Import Virtual Hub Route Table Routes can be imported using `/routes/`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_network.py b/sdk/python/pulumi_azure/network/virtual_network.py index 90d29f3f85..e0e4663fa3 100644 --- a/sdk/python/pulumi_azure/network/virtual_network.py +++ b/sdk/python/pulumi_azure/network/virtual_network.py @@ -579,6 +579,40 @@ def __init__(__self__, **NOTE on Virtual Networks and DNS Servers:** This provider currently provides both a standalone virtual network DNS Servers resource, and allows for DNS servers to be defined in-line within the Virtual Network resource. At this time you cannot use a Virtual Network with in-line DNS servers in conjunction with any Virtual Network DNS Servers resources. Doing so will cause a conflict of Virtual Network DNS Servers configurations and will overwrite virtual networks DNS servers. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + dns_servers=[ + "10.0.0.4", + "10.0.0.5", + ], + subnets=[ + azure.network.VirtualNetworkSubnetArgs( + name="subnet1", + address_prefix="10.0.1.0/24", + ), + azure.network.VirtualNetworkSubnetArgs( + name="subnet2", + address_prefix="10.0.2.0/24", + security_group=example_network_security_group.id, + ), + ], + tags={ + "environment": "Production", + }) + ``` + ## Import Virtual Networks can be imported using the `resource id`, e.g. @@ -624,6 +658,40 @@ def __init__(__self__, **NOTE on Virtual Networks and DNS Servers:** This provider currently provides both a standalone virtual network DNS Servers resource, and allows for DNS servers to be defined in-line within the Virtual Network resource. At this time you cannot use a Virtual Network with in-line DNS servers in conjunction with any Virtual Network DNS Servers resources. Doing so will cause a conflict of Virtual Network DNS Servers configurations and will overwrite virtual networks DNS servers. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + dns_servers=[ + "10.0.0.4", + "10.0.0.5", + ], + subnets=[ + azure.network.VirtualNetworkSubnetArgs( + name="subnet1", + address_prefix="10.0.1.0/24", + ), + azure.network.VirtualNetworkSubnetArgs( + name="subnet2", + address_prefix="10.0.2.0/24", + security_group=example_network_security_group.id, + ), + ], + tags={ + "environment": "Production", + }) + ``` + ## Import Virtual Networks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_network_dns_servers.py b/sdk/python/pulumi_azure/network/virtual_network_dns_servers.py index 9e141ca8d6..bee1e3c502 100644 --- a/sdk/python/pulumi_azure/network/virtual_network_dns_servers.py +++ b/sdk/python/pulumi_azure/network/virtual_network_dns_servers.py @@ -135,6 +135,30 @@ def __init__(__self__, virtual_network_id: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + subnets=[azure.network.VirtualNetworkSubnetArgs( + name="subnet1", + address_prefix="10.0.1.0/24", + )]) + example_virtual_network_dns_servers = azure.network.VirtualNetworkDnsServers("exampleVirtualNetworkDnsServers", + virtual_network_id=example_virtual_network.id, + dns_servers=[ + "10.7.7.2", + "10.7.7.7", + "10.7.7.1", + ]) + ``` + ## Import Virtual Network DNS Servers can be imported using the `resource id`, e.g. @@ -155,6 +179,30 @@ def __init__(__self__, args: VirtualNetworkDnsServersArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + subnets=[azure.network.VirtualNetworkSubnetArgs( + name="subnet1", + address_prefix="10.0.1.0/24", + )]) + example_virtual_network_dns_servers = azure.network.VirtualNetworkDnsServers("exampleVirtualNetworkDnsServers", + virtual_network_id=example_virtual_network.id, + dns_servers=[ + "10.7.7.2", + "10.7.7.7", + "10.7.7.1", + ]) + ``` + ## Import Virtual Network DNS Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_network_gateway.py b/sdk/python/pulumi_azure/network/virtual_network_gateway.py index 968068224f..6a0803d9dc 100644 --- a/sdk/python/pulumi_azure/network/virtual_network_gateway.py +++ b/sdk/python/pulumi_azure/network/virtual_network_gateway.py @@ -771,6 +771,72 @@ def __init__(__self__, > **Note:** Please be aware that provisioning a Virtual Network Gateway takes a long time (between 30 minutes and 1 hour) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic") + example_virtual_network_gateway = azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + active_active=False, + enable_bgp=False, + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + name="vnetGatewayConfig", + public_ip_address_id=example_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=example_subnet.id, + )], + vpn_client_configuration=azure.network.VirtualNetworkGatewayVpnClientConfigurationArgs( + address_spaces=["10.2.0.0/24"], + root_certificates=[azure.network.VirtualNetworkGatewayVpnClientConfigurationRootCertificateArgs( + name="DigiCert-Federated-ID-Root-CA", + public_cert_data=\"\"\"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + \"\"\", + )], + revoked_certificates=[azure.network.VirtualNetworkGatewayVpnClientConfigurationRevokedCertificateArgs( + name="Verizon-Global-Root-CA", + thumbprint="912198EEF23DCAC40939312FEE97DD560BAE49B1", + )], + )) + ``` + ## Import Virtual Network Gateways can be imported using the `resource id`, e.g. @@ -819,6 +885,72 @@ def __init__(__self__, > **Note:** Please be aware that provisioning a Virtual Network Gateway takes a long time (between 30 minutes and 1 hour) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic") + example_virtual_network_gateway = azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + active_active=False, + enable_bgp=False, + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + name="vnetGatewayConfig", + public_ip_address_id=example_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=example_subnet.id, + )], + vpn_client_configuration=azure.network.VirtualNetworkGatewayVpnClientConfigurationArgs( + address_spaces=["10.2.0.0/24"], + root_certificates=[azure.network.VirtualNetworkGatewayVpnClientConfigurationRootCertificateArgs( + name="DigiCert-Federated-ID-Root-CA", + public_cert_data=\"\"\"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + \"\"\", + )], + revoked_certificates=[azure.network.VirtualNetworkGatewayVpnClientConfigurationRevokedCertificateArgs( + name="Verizon-Global-Root-CA", + thumbprint="912198EEF23DCAC40939312FEE97DD560BAE49B1", + )], + )) + ``` + ## Import Virtual Network Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/virtual_network_gateway_connection.py b/sdk/python/pulumi_azure/network/virtual_network_gateway_connection.py index b738a5c908..8e33927a9b 100644 --- a/sdk/python/pulumi_azure/network/virtual_network_gateway_connection.py +++ b/sdk/python/pulumi_azure/network/virtual_network_gateway_connection.py @@ -1056,6 +1056,126 @@ def __init__(__self__, Manages a connection in an existing Virtual Network Gateway. ## Example Usage + ### Site-to-Site connection + + The following example shows a connection between an Azure virtual network + and an on-premises VPN device and network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + onpremise_local_network_gateway = azure.network.LocalNetworkGateway("onpremiseLocalNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + gateway_address="168.62.225.23", + address_spaces=["10.1.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic") + example_virtual_network_gateway = azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + active_active=False, + enable_bgp=False, + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=example_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=example_subnet.id, + )]) + onpremise_virtual_network_gateway_connection = azure.network.VirtualNetworkGatewayConnection("onpremiseVirtualNetworkGatewayConnection", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="IPsec", + virtual_network_gateway_id=example_virtual_network_gateway.id, + local_network_gateway_id=onpremise_local_network_gateway.id, + shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y") + ``` + ### VNet-to-VNet connection + + The following example shows a connection between two Azure virtual network + in different locations/regions. + + ```python + import pulumi + import pulumi_azure as azure + + us_resource_group = azure.core.ResourceGroup("usResourceGroup", location="East US") + us_virtual_network = azure.network.VirtualNetwork("usVirtualNetwork", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + address_spaces=["10.0.0.0/16"]) + us_gateway = azure.network.Subnet("usGateway", + resource_group_name=us_resource_group.name, + virtual_network_name=us_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + us_public_ip = azure.network.PublicIp("usPublicIp", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + allocation_method="Dynamic") + us_virtual_network_gateway = azure.network.VirtualNetworkGateway("usVirtualNetworkGateway", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=us_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=us_gateway.id, + )]) + europe_resource_group = azure.core.ResourceGroup("europeResourceGroup", location="West Europe") + europe_virtual_network = azure.network.VirtualNetwork("europeVirtualNetwork", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + address_spaces=["10.1.0.0/16"]) + europe_gateway = azure.network.Subnet("europeGateway", + resource_group_name=europe_resource_group.name, + virtual_network_name=europe_virtual_network.name, + address_prefixes=["10.1.1.0/24"]) + europe_public_ip = azure.network.PublicIp("europePublicIp", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + allocation_method="Dynamic") + europe_virtual_network_gateway = azure.network.VirtualNetworkGateway("europeVirtualNetworkGateway", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=europe_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=europe_gateway.id, + )]) + us_to_europe = azure.network.VirtualNetworkGatewayConnection("usToEurope", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + type="Vnet2Vnet", + virtual_network_gateway_id=us_virtual_network_gateway.id, + peer_virtual_network_gateway_id=europe_virtual_network_gateway.id, + shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y") + europe_to_us = azure.network.VirtualNetworkGatewayConnection("europeToUs", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + type="Vnet2Vnet", + virtual_network_gateway_id=europe_virtual_network_gateway.id, + peer_virtual_network_gateway_id=us_virtual_network_gateway.id, + shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y") + ``` ## Import @@ -1109,6 +1229,126 @@ def __init__(__self__, Manages a connection in an existing Virtual Network Gateway. ## Example Usage + ### Site-to-Site connection + + The following example shows a connection between an Azure virtual network + and an on-premises VPN device and network. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + onpremise_local_network_gateway = azure.network.LocalNetworkGateway("onpremiseLocalNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + gateway_address="168.62.225.23", + address_spaces=["10.1.1.0/24"]) + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Dynamic") + example_virtual_network_gateway = azure.network.VirtualNetworkGateway("exampleVirtualNetworkGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + active_active=False, + enable_bgp=False, + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=example_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=example_subnet.id, + )]) + onpremise_virtual_network_gateway_connection = azure.network.VirtualNetworkGatewayConnection("onpremiseVirtualNetworkGatewayConnection", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + type="IPsec", + virtual_network_gateway_id=example_virtual_network_gateway.id, + local_network_gateway_id=onpremise_local_network_gateway.id, + shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y") + ``` + ### VNet-to-VNet connection + + The following example shows a connection between two Azure virtual network + in different locations/regions. + + ```python + import pulumi + import pulumi_azure as azure + + us_resource_group = azure.core.ResourceGroup("usResourceGroup", location="East US") + us_virtual_network = azure.network.VirtualNetwork("usVirtualNetwork", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + address_spaces=["10.0.0.0/16"]) + us_gateway = azure.network.Subnet("usGateway", + resource_group_name=us_resource_group.name, + virtual_network_name=us_virtual_network.name, + address_prefixes=["10.0.1.0/24"]) + us_public_ip = azure.network.PublicIp("usPublicIp", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + allocation_method="Dynamic") + us_virtual_network_gateway = azure.network.VirtualNetworkGateway("usVirtualNetworkGateway", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=us_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=us_gateway.id, + )]) + europe_resource_group = azure.core.ResourceGroup("europeResourceGroup", location="West Europe") + europe_virtual_network = azure.network.VirtualNetwork("europeVirtualNetwork", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + address_spaces=["10.1.0.0/16"]) + europe_gateway = azure.network.Subnet("europeGateway", + resource_group_name=europe_resource_group.name, + virtual_network_name=europe_virtual_network.name, + address_prefixes=["10.1.1.0/24"]) + europe_public_ip = azure.network.PublicIp("europePublicIp", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + allocation_method="Dynamic") + europe_virtual_network_gateway = azure.network.VirtualNetworkGateway("europeVirtualNetworkGateway", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + type="Vpn", + vpn_type="RouteBased", + sku="Basic", + ip_configurations=[azure.network.VirtualNetworkGatewayIpConfigurationArgs( + public_ip_address_id=europe_public_ip.id, + private_ip_address_allocation="Dynamic", + subnet_id=europe_gateway.id, + )]) + us_to_europe = azure.network.VirtualNetworkGatewayConnection("usToEurope", + location=us_resource_group.location, + resource_group_name=us_resource_group.name, + type="Vnet2Vnet", + virtual_network_gateway_id=us_virtual_network_gateway.id, + peer_virtual_network_gateway_id=europe_virtual_network_gateway.id, + shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y") + europe_to_us = azure.network.VirtualNetworkGatewayConnection("europeToUs", + location=europe_resource_group.location, + resource_group_name=europe_resource_group.name, + type="Vnet2Vnet", + virtual_network_gateway_id=europe_virtual_network_gateway.id, + peer_virtual_network_gateway_id=us_virtual_network_gateway.id, + shared_key="4-v3ry-53cr37-1p53c-5h4r3d-k3y") + ``` ## Import diff --git a/sdk/python/pulumi_azure/network/virtual_network_peering.py b/sdk/python/pulumi_azure/network/virtual_network_peering.py index e1f57e4872..94ac9ea3e6 100644 --- a/sdk/python/pulumi_azure/network/virtual_network_peering.py +++ b/sdk/python/pulumi_azure/network/virtual_network_peering.py @@ -427,6 +427,30 @@ def __init__(__self__, Manages a virtual network peering which allows resources to access other resources in the linked virtual network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + example_1_virtual_network = azure.network.VirtualNetwork("example-1VirtualNetwork", + resource_group_name=example.name, + address_spaces=["10.0.1.0/24"], + location=example.location) + example_2_virtual_network = azure.network.VirtualNetwork("example-2VirtualNetwork", + resource_group_name=example.name, + address_spaces=["10.0.2.0/24"], + location=example.location) + example_1_virtual_network_peering = azure.network.VirtualNetworkPeering("example-1VirtualNetworkPeering", + resource_group_name=example.name, + virtual_network_name=example_1_virtual_network.name, + remote_virtual_network_id=example_2_virtual_network.id) + example_2_virtual_network_peering = azure.network.VirtualNetworkPeering("example-2VirtualNetworkPeering", + resource_group_name=example.name, + virtual_network_name=example_2_virtual_network.name, + remote_virtual_network_id=example_1_virtual_network.id) + ``` ## Note Virtual Network peerings cannot be created, updated or deleted concurrently. @@ -463,6 +487,30 @@ def __init__(__self__, Manages a virtual network peering which allows resources to access other resources in the linked virtual network. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + example_1_virtual_network = azure.network.VirtualNetwork("example-1VirtualNetwork", + resource_group_name=example.name, + address_spaces=["10.0.1.0/24"], + location=example.location) + example_2_virtual_network = azure.network.VirtualNetwork("example-2VirtualNetwork", + resource_group_name=example.name, + address_spaces=["10.0.2.0/24"], + location=example.location) + example_1_virtual_network_peering = azure.network.VirtualNetworkPeering("example-1VirtualNetworkPeering", + resource_group_name=example.name, + virtual_network_name=example_1_virtual_network.name, + remote_virtual_network_id=example_2_virtual_network.id) + example_2_virtual_network_peering = azure.network.VirtualNetworkPeering("example-2VirtualNetworkPeering", + resource_group_name=example.name, + virtual_network_name=example_2_virtual_network.name, + remote_virtual_network_id=example_1_virtual_network.id) + ``` ## Note Virtual Network peerings cannot be created, updated or deleted concurrently. diff --git a/sdk/python/pulumi_azure/network/virtual_wan.py b/sdk/python/pulumi_azure/network/virtual_wan.py index 3aef72d139..f53fa7ca64 100644 --- a/sdk/python/pulumi_azure/network/virtual_wan.py +++ b/sdk/python/pulumi_azure/network/virtual_wan.py @@ -367,6 +367,18 @@ def __init__(__self__, """ Manages a Virtual WAN. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Virtual WAN can be imported using the `resource id`, e.g. @@ -395,6 +407,18 @@ def __init__(__self__, """ Manages a Virtual WAN. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Virtual WAN can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/vnp_gateway_nat_rule.py b/sdk/python/pulumi_azure/network/vnp_gateway_nat_rule.py index 94a99f56cd..e8176abff3 100644 --- a/sdk/python/pulumi_azure/network/vnp_gateway_nat_rule.py +++ b/sdk/python/pulumi_azure/network/vnp_gateway_nat_rule.py @@ -496,6 +496,36 @@ def __init__(__self__, """ Manages a VPN Gateway NAT Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_prefix="10.0.1.0/24", + virtual_wan_id=example_virtual_wan.id) + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + example_vnp_gateway_nat_rule = azure.network.VnpGatewayNatRule("exampleVnpGatewayNatRule", + resource_group_name=example_resource_group.name, + vpn_gateway_id=example_vpn_gateway.id, + external_mappings=[azure.network.VnpGatewayNatRuleExternalMappingArgs( + address_space="192.168.21.0/26", + )], + internal_mappings=[azure.network.VnpGatewayNatRuleInternalMappingArgs( + address_space="10.4.0.0/26", + )]) + ``` + ## Import VPN Gateway NAT Rules can be imported using the `resource id`, e.g. @@ -530,6 +560,36 @@ def __init__(__self__, """ Manages a VPN Gateway NAT Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_prefix="10.0.1.0/24", + virtual_wan_id=example_virtual_wan.id) + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + example_vnp_gateway_nat_rule = azure.network.VnpGatewayNatRule("exampleVnpGatewayNatRule", + resource_group_name=example_resource_group.name, + vpn_gateway_id=example_vpn_gateway.id, + external_mappings=[azure.network.VnpGatewayNatRuleExternalMappingArgs( + address_space="192.168.21.0/26", + )], + internal_mappings=[azure.network.VnpGatewayNatRuleInternalMappingArgs( + address_space="10.4.0.0/26", + )]) + ``` + ## Import VPN Gateway NAT Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/vpn_gateway.py b/sdk/python/pulumi_azure/network/vpn_gateway.py index 6d0b063580..d22536a417 100644 --- a/sdk/python/pulumi_azure/network/vpn_gateway.py +++ b/sdk/python/pulumi_azure/network/vpn_gateway.py @@ -415,6 +415,31 @@ def __init__(__self__, """ Manages a VPN Gateway within a Virtual Hub, which enables Site-to-Site communication. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + ``` + ## Import VPN Gateways can be imported using the `resource id`, e.g. @@ -444,6 +469,31 @@ def __init__(__self__, """ Manages a VPN Gateway within a Virtual Hub, which enables Site-to-Site communication. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.1.0/24") + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + ``` + ## Import VPN Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/vpn_gateway_connection.py b/sdk/python/pulumi_azure/network/vpn_gateway_connection.py index 97cb505ee1..b1300f1a91 100644 --- a/sdk/python/pulumi_azure/network/vpn_gateway_connection.py +++ b/sdk/python/pulumi_azure/network/vpn_gateway_connection.py @@ -338,6 +338,54 @@ def __init__(__self__, """ Manages a VPN Gateway Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.0.0/24") + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + example_vpn_site = azure.network.VpnSite("exampleVpnSite", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_wan_id=example_virtual_wan.id, + links=[ + azure.network.VpnSiteLinkArgs( + name="link1", + ip_address="10.1.0.0", + ), + azure.network.VpnSiteLinkArgs( + name="link2", + ip_address="10.2.0.0", + ), + ]) + example_vpn_gateway_connection = azure.network.VpnGatewayConnection("exampleVpnGatewayConnection", + vpn_gateway_id=example_vpn_gateway.id, + remote_vpn_site_id=example_vpn_site.id, + vpn_links=[ + azure.network.VpnGatewayConnectionVpnLinkArgs( + name="link1", + vpn_site_link_id=example_vpn_site.links[0].id, + ), + azure.network.VpnGatewayConnectionVpnLinkArgs( + name="link2", + vpn_site_link_id=example_vpn_site.links[1].id, + ), + ]) + ``` + ## Import VPN Gateway Connections can be imported using the `resource id`, e.g. @@ -365,6 +413,54 @@ def __init__(__self__, """ Manages a VPN Gateway Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_virtual_hub = azure.network.VirtualHub("exampleVirtualHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_prefix="10.0.0.0/24") + example_vpn_gateway = azure.network.VpnGateway("exampleVpnGateway", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_hub_id=example_virtual_hub.id) + example_vpn_site = azure.network.VpnSite("exampleVpnSite", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + virtual_wan_id=example_virtual_wan.id, + links=[ + azure.network.VpnSiteLinkArgs( + name="link1", + ip_address="10.1.0.0", + ), + azure.network.VpnSiteLinkArgs( + name="link2", + ip_address="10.2.0.0", + ), + ]) + example_vpn_gateway_connection = azure.network.VpnGatewayConnection("exampleVpnGatewayConnection", + vpn_gateway_id=example_vpn_gateway.id, + remote_vpn_site_id=example_vpn_site.id, + vpn_links=[ + azure.network.VpnGatewayConnectionVpnLinkArgs( + name="link1", + vpn_site_link_id=example_vpn_site.links[0].id, + ), + azure.network.VpnGatewayConnectionVpnLinkArgs( + name="link2", + vpn_site_link_id=example_vpn_site.links[1].id, + ), + ]) + ``` + ## Import VPN Gateway Connections can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/vpn_server_configuration.py b/sdk/python/pulumi_azure/network/vpn_server_configuration.py index 0c21894992..8d6918666f 100644 --- a/sdk/python/pulumi_azure/network/vpn_server_configuration.py +++ b/sdk/python/pulumi_azure/network/vpn_server_configuration.py @@ -493,6 +493,43 @@ def __init__(__self__, """ Manages a VPN Server Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test = azure.network.VpnServerConfiguration("test", + resource_group_name=example.name, + location=example.location, + vpn_authentication_types=["Certificate"], + client_root_certificates=[azure.network.VpnServerConfigurationClientRootCertificateArgs( + name="DigiCert-Federated-ID-Root-CA", + public_cert_data=\"\"\"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + \"\"\", + )]) + ``` + ## Import VPN Server Configurations can be imported using the `resource id`, e.g. @@ -524,6 +561,43 @@ def __init__(__self__, """ Manages a VPN Server Configuration. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test = azure.network.VpnServerConfiguration("test", + resource_group_name=example.name, + location=example.location, + vpn_authentication_types=["Certificate"], + client_root_certificates=[azure.network.VpnServerConfigurationClientRootCertificateArgs( + name="DigiCert-Federated-ID-Root-CA", + public_cert_data=\"\"\"MIIDuzCCAqOgAwIBAgIQCHTZWCM+IlfFIRXIvyKSrjANBgkqhkiG9w0BAQsFADBn + MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 + d3cuZGlnaWNlcnQuY29tMSYwJAYDVQQDEx1EaWdpQ2VydCBGZWRlcmF0ZWQgSUQg + Um9vdCBDQTAeFw0xMzAxMTUxMjAwMDBaFw0zMzAxMTUxMjAwMDBaMGcxCzAJBgNV + BAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdp + Y2VydC5jb20xJjAkBgNVBAMTHURpZ2lDZXJ0IEZlZGVyYXRlZCBJRCBSb290IENB + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvAEB4pcCqnNNOWE6Ur5j + QPUH+1y1F9KdHTRSza6k5iDlXq1kGS1qAkuKtw9JsiNRrjltmFnzMZRBbX8Tlfl8 + zAhBmb6dDduDGED01kBsTkgywYPxXVTKec0WxYEEF0oMn4wSYNl0lt2eJAKHXjNf + GTwiibdP8CUR2ghSM2sUTI8Nt1Omfc4SMHhGhYD64uJMbX98THQ/4LMGuYegou+d + GTiahfHtjn7AboSEknwAMJHCh5RlYZZ6B1O4QbKJ+34Q0eKgnI3X6Vc9u0zf6DH8 + Dk+4zQDYRRTqTnVO3VT8jzqDlCRuNtq6YvryOWN74/dq8LQhUnXHvFyrsdMaE1X2 + DwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV + HQ4EFgQUGRdkFnbGt1EWjKwbUne+5OaZvRYwHwYDVR0jBBgwFoAUGRdkFnbGt1EW + jKwbUne+5OaZvRYwDQYJKoZIhvcNAQELBQADggEBAHcqsHkrjpESqfuVTRiptJfP + 9JbdtWqRTmOf6uJi2c8YVqI6XlKXsD8C1dUUaaHKLUJzvKiazibVuBwMIT84AyqR + QELn3e0BtgEymEygMU569b01ZPxoFSnNXc7qDZBDef8WfqAV/sxkTi8L9BkmFYfL + uGLOhRJOFprPdoDIUBB+tmCl3oDcBy3vnUeOEioz8zAkprcb3GHwHAK+vHmmfgcn + WsfMLH4JCLa/tRYL+Rw/N3ybCkDp00s0WUZ+AoDywSl0Q/ZEnNY0MsFiw6LyIdbq + M/s/1JRtO3bDSzD9TazRVzn2oBqzSa8VgIo5C1nOnoAKJTlsClJKvIhnRlaLQqk= + \"\"\", + )]) + ``` + ## Import VPN Server Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/vpn_server_configuration_policy_group.py b/sdk/python/pulumi_azure/network/vpn_server_configuration_policy_group.py index 077c41fb22..53bda8e368 100644 --- a/sdk/python/pulumi_azure/network/vpn_server_configuration_policy_group.py +++ b/sdk/python/pulumi_azure/network/vpn_server_configuration_policy_group.py @@ -251,6 +251,33 @@ def __init__(__self__, """ Manages a VPN Server Configuration Policy Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vpn_server_configuration = azure.network.VpnServerConfiguration("exampleVpnServerConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + vpn_authentication_types=["Radius"], + radius=azure.network.VpnServerConfigurationRadiusArgs( + servers=[azure.network.VpnServerConfigurationRadiusServerArgs( + address="10.105.1.1", + secret="vindicators-the-return-of-worldender", + score=15, + )], + )) + example_vpn_server_configuration_policy_group = azure.network.VpnServerConfigurationPolicyGroup("exampleVpnServerConfigurationPolicyGroup", + vpn_server_configuration_id=example_vpn_server_configuration.id, + policies=[azure.network.VpnServerConfigurationPolicyGroupPolicyArgs( + name="policy1", + type="RadiusAzureGroupId", + value="6ad1bd08", + )]) + ``` + ## Import VPN Server Configuration Policy Groups can be imported using the `resource id`, e.g. @@ -276,6 +303,33 @@ def __init__(__self__, """ Manages a VPN Server Configuration Policy Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_vpn_server_configuration = azure.network.VpnServerConfiguration("exampleVpnServerConfiguration", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + vpn_authentication_types=["Radius"], + radius=azure.network.VpnServerConfigurationRadiusArgs( + servers=[azure.network.VpnServerConfigurationRadiusServerArgs( + address="10.105.1.1", + secret="vindicators-the-return-of-worldender", + score=15, + )], + )) + example_vpn_server_configuration_policy_group = azure.network.VpnServerConfigurationPolicyGroup("exampleVpnServerConfigurationPolicyGroup", + vpn_server_configuration_id=example_vpn_server_configuration.id, + policies=[azure.network.VpnServerConfigurationPolicyGroupPolicyArgs( + name="policy1", + type="RadiusAzureGroupId", + value="6ad1bd08", + )]) + ``` + ## Import VPN Server Configuration Policy Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/network/vpn_site.py b/sdk/python/pulumi_azure/network/vpn_site.py index 19ba6e65cd..6eb7a42509 100644 --- a/sdk/python/pulumi_azure/network/vpn_site.py +++ b/sdk/python/pulumi_azure/network/vpn_site.py @@ -460,6 +460,27 @@ def __init__(__self__, """ Manages a VPN Site. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_vpn_site = azure.network.VpnSite("exampleVpnSite", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_cidrs=["10.0.0.0/24"], + links=[azure.network.VpnSiteLinkArgs( + name="link1", + ip_address="10.0.0.1", + )]) + ``` + ## Import VPN Sites can be imported using the `resource id`, e.g. @@ -492,6 +513,27 @@ def __init__(__self__, """ Manages a VPN Site. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_wan = azure.network.VirtualWan("exampleVirtualWan", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_vpn_site = azure.network.VpnSite("exampleVpnSite", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_wan_id=example_virtual_wan.id, + address_cidrs=["10.0.0.0/24"], + links=[azure.network.VpnSiteLinkArgs( + name="link1", + ip_address="10.0.0.1", + )]) + ``` + ## Import VPN Sites can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/networkfunction/azure_traffic_collector.py b/sdk/python/pulumi_azure/networkfunction/azure_traffic_collector.py index 4c59d71f68..016f9a846f 100644 --- a/sdk/python/pulumi_azure/networkfunction/azure_traffic_collector.py +++ b/sdk/python/pulumi_azure/networkfunction/azure_traffic_collector.py @@ -247,6 +247,21 @@ def __init__(__self__, """ Manages a Network Function Azure Traffic Collector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_azure_traffic_collector = azure.networkfunction.AzureTrafficCollector("exampleAzureTrafficCollector", + resource_group_name=example_resource_group.name, + location="West US", + tags={ + "key": "value", + }) + ``` + ## Import Network Function Azure Traffic Collector can be imported using the `resource id`, e.g. @@ -271,6 +286,21 @@ def __init__(__self__, """ Manages a Network Function Azure Traffic Collector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_azure_traffic_collector = azure.networkfunction.AzureTrafficCollector("exampleAzureTrafficCollector", + resource_group_name=example_resource_group.name, + location="West US", + tags={ + "key": "value", + }) + ``` + ## Import Network Function Azure Traffic Collector can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/newrelic/monitor.py b/sdk/python/pulumi_azure/newrelic/monitor.py index b91d8bc24c..7a5bb81f8f 100644 --- a/sdk/python/pulumi_azure/newrelic/monitor.py +++ b/sdk/python/pulumi_azure/newrelic/monitor.py @@ -494,6 +494,27 @@ def __init__(__self__, """ Manages an Azure Native New Relic Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_monitor = azure.newrelic.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.newrelic.MonitorPlanArgs( + effective_date="2023-06-06T00:00:00Z", + ), + user=azure.newrelic.MonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + ``` + ## Import Azure Native New Relic Monitor can be imported using the `resource id`, e.g. @@ -525,6 +546,27 @@ def __init__(__self__, """ Manages an Azure Native New Relic Monitor. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_monitor = azure.newrelic.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.newrelic.MonitorPlanArgs( + effective_date="2023-06-06T00:00:00Z", + ), + user=azure.newrelic.MonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + ``` + ## Import Azure Native New Relic Monitor can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/newrelic/tag_rule.py b/sdk/python/pulumi_azure/newrelic/tag_rule.py index 95454325c5..c17f5f9f7e 100644 --- a/sdk/python/pulumi_azure/newrelic/tag_rule.py +++ b/sdk/python/pulumi_azure/newrelic/tag_rule.py @@ -344,6 +344,43 @@ def __init__(__self__, """ Manages an Azure Native New Relic Tag Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_monitor = azure.newrelic.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.newrelic.MonitorPlanArgs( + effective_date="2023-06-06T00:00:00Z", + ), + user=azure.newrelic.MonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_tag_rule = azure.newrelic.TagRule("exampleTagRule", + monitor_id=example_monitor.id, + azure_active_directory_log_enabled=True, + activity_log_enabled=True, + metric_enabled=True, + subscription_log_enabled=True, + log_tag_filters=[azure.newrelic.TagRuleLogTagFilterArgs( + name="key", + action="Include", + value="value", + )], + metric_tag_filters=[azure.newrelic.TagRuleMetricTagFilterArgs( + name="key", + action="Exclude", + value="value", + )]) + ``` + ## Import Azure Native New Relic Tag Rule can be imported using the `resource id`, e.g. @@ -371,6 +408,43 @@ def __init__(__self__, """ Manages an Azure Native New Relic Tag Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_monitor = azure.newrelic.Monitor("exampleMonitor", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + plan=azure.newrelic.MonitorPlanArgs( + effective_date="2023-06-06T00:00:00Z", + ), + user=azure.newrelic.MonitorUserArgs( + email="user@example.com", + first_name="Example", + last_name="User", + phone_number="+12313803556", + )) + example_tag_rule = azure.newrelic.TagRule("exampleTagRule", + monitor_id=example_monitor.id, + azure_active_directory_log_enabled=True, + activity_log_enabled=True, + metric_enabled=True, + subscription_log_enabled=True, + log_tag_filters=[azure.newrelic.TagRuleLogTagFilterArgs( + name="key", + action="Include", + value="value", + )], + metric_tag_filters=[azure.newrelic.TagRuleMetricTagFilterArgs( + name="key", + action="Exclude", + value="value", + )]) + ``` + ## Import Azure Native New Relic Tag Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/nginx/certificate.py b/sdk/python/pulumi_azure/nginx/certificate.py index d1178930f9..6bfc348f95 100644 --- a/sdk/python/pulumi_azure/nginx/certificate.py +++ b/sdk/python/pulumi_azure/nginx/certificate.py @@ -259,6 +259,86 @@ def __init__(__self__, """ Manages a Certificate for an NGinx Deployment. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard", + tags={ + "environment": "Production", + }) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="NGINX.NGINXPLUS/nginxDeployments", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_deployment = azure.nginx.Deployment("exampleDeployment", + resource_group_name=example_resource_group.name, + sku="publicpreview_Monthly_gmz7xq9ge3py", + location=example_resource_group.location, + managed_resource_group="example", + diagnose_support_enabled=True, + frontend_public=azure.nginx.DeploymentFrontendPublicArgs( + ip_addresses=[example_public_ip.id], + ), + network_interfaces=[azure.nginx.DeploymentNetworkInterfaceArgs( + subnet_id=example_subnet.id, + )]) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "SetIssuers", + "Update", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + example_nginx_certificate_certificate = azure.nginx.Certificate("exampleNginx/certificateCertificate", + nginx_deployment_id=example_deployment.id, + key_virtual_path="/src/cert/soservermekey.key", + certificate_virtual_path="/src/cert/server.cert", + key_vault_secret_id=example_certificate.secret_id) + ``` + ## Import An Nginx Certificate can be imported using the `resource id`, e.g. @@ -284,6 +364,86 @@ def __init__(__self__, """ Manages a Certificate for an NGinx Deployment. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard", + tags={ + "environment": "Production", + }) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="NGINX.NGINXPLUS/nginxDeployments", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_deployment = azure.nginx.Deployment("exampleDeployment", + resource_group_name=example_resource_group.name, + sku="publicpreview_Monthly_gmz7xq9ge3py", + location=example_resource_group.location, + managed_resource_group="example", + diagnose_support_enabled=True, + frontend_public=azure.nginx.DeploymentFrontendPublicArgs( + ip_addresses=[example_public_ip.id], + ), + network_interfaces=[azure.nginx.DeploymentNetworkInterfaceArgs( + subnet_id=example_subnet.id, + )]) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Delete", + "DeleteIssuers", + "Get", + "GetIssuers", + "Import", + "List", + "ListIssuers", + "ManageContacts", + "ManageIssuers", + "SetIssuers", + "Update", + ], + )]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + example_nginx_certificate_certificate = azure.nginx.Certificate("exampleNginx/certificateCertificate", + nginx_deployment_id=example_deployment.id, + key_virtual_path="/src/cert/soservermekey.key", + certificate_virtual_path="/src/cert/server.cert", + key_vault_secret_id=example_certificate.secret_id) + ``` + ## Import An Nginx Certificate can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/nginx/deployment.py b/sdk/python/pulumi_azure/nginx/deployment.py index f9a20bf834..c3213e7325 100644 --- a/sdk/python/pulumi_azure/nginx/deployment.py +++ b/sdk/python/pulumi_azure/nginx/deployment.py @@ -652,6 +652,52 @@ def __init__(__self__, """ Manages a Nginx Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard", + tags={ + "environment": "Production", + }) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="NGINX.NGINXPLUS/nginxDeployments", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_deployment = azure.nginx.Deployment("exampleDeployment", + resource_group_name=example_resource_group.name, + sku="publicpreview_Monthly_gmz7xq9ge3py", + location=example_resource_group.location, + managed_resource_group="example", + diagnose_support_enabled=True, + frontend_public=azure.nginx.DeploymentFrontendPublicArgs( + ip_addresses=[example_public_ip.id], + ), + network_interfaces=[azure.nginx.DeploymentNetworkInterfaceArgs( + subnet_id=example_subnet.id, + )], + capacity=20, + email="user@test.com") + ``` + ## Import Nginx Deployments can be imported using the `resource id`, e.g. @@ -688,6 +734,52 @@ def __init__(__self__, """ Manages a Nginx Deployment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_public_ip = azure.network.PublicIp("examplePublicIp", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + allocation_method="Static", + sku="Standard", + tags={ + "environment": "Production", + }) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="delegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="NGINX.NGINXPLUS/nginxDeployments", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_deployment = azure.nginx.Deployment("exampleDeployment", + resource_group_name=example_resource_group.name, + sku="publicpreview_Monthly_gmz7xq9ge3py", + location=example_resource_group.location, + managed_resource_group="example", + diagnose_support_enabled=True, + frontend_public=azure.nginx.DeploymentFrontendPublicArgs( + ip_addresses=[example_public_ip.id], + ), + network_interfaces=[azure.nginx.DeploymentNetworkInterfaceArgs( + subnet_id=example_subnet.id, + )], + capacity=20, + email="user@test.com") + ``` + ## Import Nginx Deployments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/notificationhub/authorization_rule.py b/sdk/python/pulumi_azure/notificationhub/authorization_rule.py index 39141b41fb..51af601a96 100644 --- a/sdk/python/pulumi_azure/notificationhub/authorization_rule.py +++ b/sdk/python/pulumi_azure/notificationhub/authorization_rule.py @@ -376,6 +376,31 @@ def __init__(__self__, """ Manages an Authorization Rule associated with a Notification Hub within a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.notificationhub.Namespace("exampleNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + namespace_type="NotificationHub", + sku_name="Free") + example_hub = azure.notificationhub.Hub("exampleHub", + namespace_name=example_namespace.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_authorization_rule = azure.notificationhub.AuthorizationRule("exampleAuthorizationRule", + notification_hub_name=example_hub.name, + namespace_name=example_namespace.name, + resource_group_name=example_resource_group.name, + manage=True, + send=True, + listen=True) + ``` + ## Import Notification Hub Authorization Rule can be imported using the `resource id`, e.g. @@ -405,6 +430,31 @@ def __init__(__self__, """ Manages an Authorization Rule associated with a Notification Hub within a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.notificationhub.Namespace("exampleNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + namespace_type="NotificationHub", + sku_name="Free") + example_hub = azure.notificationhub.Hub("exampleHub", + namespace_name=example_namespace.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_authorization_rule = azure.notificationhub.AuthorizationRule("exampleAuthorizationRule", + notification_hub_name=example_hub.name, + namespace_name=example_namespace.name, + resource_group_name=example_resource_group.name, + manage=True, + send=True, + listen=True) + ``` + ## Import Notification Hub Authorization Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/notificationhub/get_hub.py b/sdk/python/pulumi_azure/notificationhub/get_hub.py index 8324034094..4c88d1270a 100644 --- a/sdk/python/pulumi_azure/notificationhub/get_hub.py +++ b/sdk/python/pulumi_azure/notificationhub/get_hub.py @@ -127,6 +127,18 @@ def get_hub(name: Optional[str] = None, """ Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.notificationhub.get_hub(name="notification-hub", + namespace_name="namespace-name", + resource_group_name="resource-group-name") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the Name of the Notification Hub. :param str namespace_name: Specifies the Name of the Notification Hub Namespace which contains the Notification Hub. @@ -158,6 +170,18 @@ def get_hub_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.notificationhub.get_hub(name="notification-hub", + namespace_name="namespace-name", + resource_group_name="resource-group-name") + pulumi.export("id", example.id) + ``` + :param str name: Specifies the Name of the Notification Hub. :param str namespace_name: Specifies the Name of the Notification Hub Namespace which contains the Notification Hub. diff --git a/sdk/python/pulumi_azure/notificationhub/get_namespace.py b/sdk/python/pulumi_azure/notificationhub/get_namespace.py index daeea985b6..0cf3a29759 100644 --- a/sdk/python/pulumi_azure/notificationhub/get_namespace.py +++ b/sdk/python/pulumi_azure/notificationhub/get_namespace.py @@ -141,6 +141,17 @@ def get_namespace(name: Optional[str] = None, """ Use this data source to access information about an existing Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.notificationhub.get_namespace(name="my-namespace", + resource_group_name="my-resource-group") + pulumi.export("servicebusEndpoint", example.servicebus_endpoint) + ``` + :param str name: Specifies the Name of the Notification Hub Namespace. :param str resource_group_name: Specifies the Name of the Resource Group within which the Notification Hub exists. @@ -170,6 +181,17 @@ def get_namespace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.notificationhub.get_namespace(name="my-namespace", + resource_group_name="my-resource-group") + pulumi.export("servicebusEndpoint", example.servicebus_endpoint) + ``` + :param str name: Specifies the Name of the Notification Hub Namespace. :param str resource_group_name: Specifies the Name of the Resource Group within which the Notification Hub exists. diff --git a/sdk/python/pulumi_azure/notificationhub/hub.py b/sdk/python/pulumi_azure/notificationhub/hub.py index 76b61221dc..9e45a2219e 100644 --- a/sdk/python/pulumi_azure/notificationhub/hub.py +++ b/sdk/python/pulumi_azure/notificationhub/hub.py @@ -349,6 +349,24 @@ def __init__(__self__, """ Manages a Notification Hub within a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.notificationhub.Namespace("exampleNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + namespace_type="NotificationHub", + sku_name="Free") + example_hub = azure.notificationhub.Hub("exampleHub", + namespace_name=example_namespace.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Notification Hubs can be imported using the `resource id`, e.g. @@ -380,6 +398,24 @@ def __init__(__self__, """ Manages a Notification Hub within a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.notificationhub.Namespace("exampleNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + namespace_type="NotificationHub", + sku_name="Free") + example_hub = azure.notificationhub.Hub("exampleHub", + namespace_name=example_namespace.name, + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Notification Hubs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/notificationhub/namespace.py b/sdk/python/pulumi_azure/notificationhub/namespace.py index 95b062a501..fb7142abc4 100644 --- a/sdk/python/pulumi_azure/notificationhub/namespace.py +++ b/sdk/python/pulumi_azure/notificationhub/namespace.py @@ -348,6 +348,20 @@ def __init__(__self__, """ Manages a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.notificationhub.Namespace("exampleNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + namespace_type="NotificationHub", + sku_name="Free") + ``` + ## Import Notification Hub Namespaces can be imported using the `resource id`, e.g. @@ -375,6 +389,20 @@ def __init__(__self__, """ Manages a Notification Hub Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.notificationhub.Namespace("exampleNamespace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + namespace_type="NotificationHub", + sku_name="Free") + ``` + ## Import Notification Hub Namespaces can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/operationalinsights/analytics_solution.py b/sdk/python/pulumi_azure/operationalinsights/analytics_solution.py index 2036a16a15..c8a6c8fffb 100644 --- a/sdk/python/pulumi_azure/operationalinsights/analytics_solution.py +++ b/sdk/python/pulumi_azure/operationalinsights/analytics_solution.py @@ -336,6 +336,35 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Solution. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + workspace = random.RandomId("workspace", + keepers={ + "group_name": example_resource_group.name, + }, + byte_length=8) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="ContainerInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/ContainerInsights", + )) + ``` + ## Import Log Analytics Solutions can be imported using the `resource id`, e.g. @@ -363,6 +392,35 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Solution. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + workspace = random.RandomId("workspace", + keepers={ + "group_name": example_resource_group.name, + }, + byte_length=8) + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="ContainerInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/ContainerInsights", + )) + ``` + ## Import Log Analytics Solutions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/operationalinsights/analytics_workspace.py b/sdk/python/pulumi_azure/operationalinsights/analytics_workspace.py index 269da6fdf0..81925159cc 100644 --- a/sdk/python/pulumi_azure/operationalinsights/analytics_workspace.py +++ b/sdk/python/pulumi_azure/operationalinsights/analytics_workspace.py @@ -721,6 +721,20 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + ``` + ## Import Log Analytics Workspaces can be imported using the `resource id`, e.g. @@ -767,6 +781,20 @@ def __init__(__self__, """ Manages a Log Analytics (formally Operational Insights) Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + ``` + ## Import Log Analytics Workspaces can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/operationalinsights/get_analytics_workspace.py b/sdk/python/pulumi_azure/operationalinsights/get_analytics_workspace.py index f3d9b866ee..a6a9e30cb6 100644 --- a/sdk/python/pulumi_azure/operationalinsights/get_analytics_workspace.py +++ b/sdk/python/pulumi_azure/operationalinsights/get_analytics_workspace.py @@ -161,6 +161,17 @@ def get_analytics_workspace(name: Optional[str] = None, """ Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.operationalinsights.get_analytics_workspace(name="acctest-01", + resource_group_name="acctest") + pulumi.export("logAnalyticsWorkspaceId", example.workspace_id) + ``` + :param str name: Specifies the name of the Log Analytics Workspace. :param str resource_group_name: The name of the resource group in which the Log Analytics workspace is located in. @@ -192,6 +203,17 @@ def get_analytics_workspace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.operationalinsights.get_analytics_workspace(name="acctest-01", + resource_group_name="acctest") + pulumi.export("logAnalyticsWorkspaceId", example.workspace_id) + ``` + :param str name: Specifies the name of the Log Analytics Workspace. :param str resource_group_name: The name of the resource group in which the Log Analytics workspace is located in. diff --git a/sdk/python/pulumi_azure/operationalinsights/query_pack_query.py b/sdk/python/pulumi_azure/operationalinsights/query_pack_query.py index 61c7da3736..04850a2a22 100644 --- a/sdk/python/pulumi_azure/operationalinsights/query_pack_query.py +++ b/sdk/python/pulumi_azure/operationalinsights/query_pack_query.py @@ -443,6 +443,34 @@ def __init__(__self__, """ Manages a Log Analytics Query Pack Query. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_query_pack = azure.loganalytics.QueryPack("exampleQueryPack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_query_pack_query = azure.operationalinsights.QueryPackQuery("exampleQueryPackQuery", + query_pack_id=example_query_pack.id, + body=\"\"\"let newExceptionsTimeRange = 1d; + let timeRangeToCheckBefore = 7d; + exceptions + | where timestamp < ago(timeRangeToCheckBefore) + | summarize count() by problemId + | join kind= rightanti ( + exceptions + | where timestamp >= ago(newExceptionsTimeRange) + | extend stack = tostring(details[0].rawStack) + | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId + ) on problemId + | order by count_ desc + \"\"\", + display_name="Exceptions - New in the last 24 hours") + ``` + ## Import Log Analytics Query Pack Queries can be imported using the `resource id`, e.g. @@ -473,6 +501,34 @@ def __init__(__self__, """ Manages a Log Analytics Query Pack Query. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_query_pack = azure.loganalytics.QueryPack("exampleQueryPack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_query_pack_query = azure.operationalinsights.QueryPackQuery("exampleQueryPackQuery", + query_pack_id=example_query_pack.id, + body=\"\"\"let newExceptionsTimeRange = 1d; + let timeRangeToCheckBefore = 7d; + exceptions + | where timestamp < ago(timeRangeToCheckBefore) + | summarize count() by problemId + | join kind= rightanti ( + exceptions + | where timestamp >= ago(newExceptionsTimeRange) + | extend stack = tostring(details[0].rawStack) + | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId + ) on problemId + | order by count_ desc + \"\"\", + display_name="Exceptions - New in the last 24 hours") + ``` + ## Import Log Analytics Query Pack Queries can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/orbital/contact.py b/sdk/python/pulumi_azure/orbital/contact.py index b161a6f2fb..0f9b807407 100644 --- a/sdk/python/pulumi_azure/orbital/contact.py +++ b/sdk/python/pulumi_azure/orbital/contact.py @@ -301,6 +301,82 @@ def __init__(__self__, """ Manages an orbital contact. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spacecraft = azure.orbital.Spacecraft("exampleSpacecraft", + resource_group_name=example_resource_group.name, + location="westeurope", + norad_id="12345", + links=[azure.orbital.SpacecraftLinkArgs( + bandwidth_mhz=100, + center_frequency_mhz=101, + direction="Uplink", + polarization="LHCP", + name="examplename", + )], + two_line_elements=[ + "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + ], + title_line="AQUA", + tags={ + "aks-managed-cluster-name": "9a57225d-a405-4d40-aa46-f13d2342abef", + }) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="orbitalgateway", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Orbital/orbitalGateways", + actions=[ + "Microsoft.Network/publicIPAddresses/join/action", + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/read", + "Microsoft.Network/publicIPAddresses/read", + ], + ), + )]) + example_contact_profile = azure.orbital.ContactProfile("exampleContactProfile", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + minimum_variable_contact_duration="PT1M", + auto_tracking="disabled", + links=[azure.orbital.ContactProfileLinkArgs( + channels=[azure.orbital.ContactProfileLinkChannelArgs( + name="channelname", + bandwidth_mhz=100, + center_frequency_mhz=101, + end_points=[azure.orbital.ContactProfileLinkChannelEndPointArgs( + end_point_name="AQUA_command", + ip_address="10.0.1.0", + port="49153", + protocol="TCP", + )], + )], + direction="Uplink", + name="RHCP_UL", + polarization="RHCP", + )], + network_configuration_subnet_id=example_subnet.id) + example_contact = azure.orbital.Contact("exampleContact", + spacecraft_id=example_spacecraft.id, + reservation_start_time="2020-07-16T20:35:00.00Z", + reservation_end_time="2020-07-16T20:55:00.00Z", + ground_station_name="WESTUS2_0", + contact_profile_id=example_contact_profile.id) + ``` + ## Import Spacecraft can be imported using the `resource id`, e.g. @@ -327,6 +403,82 @@ def __init__(__self__, """ Manages an orbital contact. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spacecraft = azure.orbital.Spacecraft("exampleSpacecraft", + resource_group_name=example_resource_group.name, + location="westeurope", + norad_id="12345", + links=[azure.orbital.SpacecraftLinkArgs( + bandwidth_mhz=100, + center_frequency_mhz=101, + direction="Uplink", + polarization="LHCP", + name="examplename", + )], + two_line_elements=[ + "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + ], + title_line="AQUA", + tags={ + "aks-managed-cluster-name": "9a57225d-a405-4d40-aa46-f13d2342abef", + }) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="orbitalgateway", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Orbital/orbitalGateways", + actions=[ + "Microsoft.Network/publicIPAddresses/join/action", + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/read", + "Microsoft.Network/publicIPAddresses/read", + ], + ), + )]) + example_contact_profile = azure.orbital.ContactProfile("exampleContactProfile", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + minimum_variable_contact_duration="PT1M", + auto_tracking="disabled", + links=[azure.orbital.ContactProfileLinkArgs( + channels=[azure.orbital.ContactProfileLinkChannelArgs( + name="channelname", + bandwidth_mhz=100, + center_frequency_mhz=101, + end_points=[azure.orbital.ContactProfileLinkChannelEndPointArgs( + end_point_name="AQUA_command", + ip_address="10.0.1.0", + port="49153", + protocol="TCP", + )], + )], + direction="Uplink", + name="RHCP_UL", + polarization="RHCP", + )], + network_configuration_subnet_id=example_subnet.id) + example_contact = azure.orbital.Contact("exampleContact", + spacecraft_id=example_spacecraft.id, + reservation_start_time="2020-07-16T20:35:00.00Z", + reservation_end_time="2020-07-16T20:55:00.00Z", + ground_station_name="WESTUS2_0", + contact_profile_id=example_contact_profile.id) + ``` + ## Import Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/orbital/contact_profile.py b/sdk/python/pulumi_azure/orbital/contact_profile.py index 436fcebfbf..4c889414cd 100644 --- a/sdk/python/pulumi_azure/orbital/contact_profile.py +++ b/sdk/python/pulumi_azure/orbital/contact_profile.py @@ -455,6 +455,57 @@ def __init__(__self__, """ Manages a Contact profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="orbitalgateway", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Orbital/orbitalGateways", + actions=[ + "Microsoft.Network/publicIPAddresses/join/action", + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/read", + "Microsoft.Network/publicIPAddresses/read", + ], + ), + )]) + example_contact_profile = azure.orbital.ContactProfile("exampleContactProfile", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + minimum_variable_contact_duration="PT1M", + auto_tracking="disabled", + links=[azure.orbital.ContactProfileLinkArgs( + channels=[azure.orbital.ContactProfileLinkChannelArgs( + name="channelname", + bandwidth_mhz=100, + center_frequency_mhz=101, + end_points=[azure.orbital.ContactProfileLinkChannelEndPointArgs( + end_point_name="AQUA_command", + ip_address="10.0.1.0", + port="49513", + protocol="TCP", + )], + )], + direction="Uplink", + name="RHCP_UL", + polarization="RHCP", + )], + network_configuration_subnet_id=example_subnet.id) + ``` + ## Import Contact profile can be imported using the `resource id`, e.g. @@ -485,6 +536,57 @@ def __init__(__self__, """ Manages a Contact profile. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="orbitalgateway", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Orbital/orbitalGateways", + actions=[ + "Microsoft.Network/publicIPAddresses/join/action", + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/read", + "Microsoft.Network/publicIPAddresses/read", + ], + ), + )]) + example_contact_profile = azure.orbital.ContactProfile("exampleContactProfile", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + minimum_variable_contact_duration="PT1M", + auto_tracking="disabled", + links=[azure.orbital.ContactProfileLinkArgs( + channels=[azure.orbital.ContactProfileLinkChannelArgs( + name="channelname", + bandwidth_mhz=100, + center_frequency_mhz=101, + end_points=[azure.orbital.ContactProfileLinkChannelEndPointArgs( + end_point_name="AQUA_command", + ip_address="10.0.1.0", + port="49513", + protocol="TCP", + )], + )], + direction="Uplink", + name="RHCP_UL", + polarization="RHCP", + )], + network_configuration_subnet_id=example_subnet.id) + ``` + ## Import Contact profile can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/orbital/spacecraft.py b/sdk/python/pulumi_azure/orbital/spacecraft.py index 3d93e4a886..a7f86195ed 100644 --- a/sdk/python/pulumi_azure/orbital/spacecraft.py +++ b/sdk/python/pulumi_azure/orbital/spacecraft.py @@ -373,6 +373,34 @@ def __init__(__self__, """ Manages a Spacecraft. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spacecraft = azure.orbital.Spacecraft("exampleSpacecraft", + resource_group_name=example_resource_group.name, + location="westeurope", + norad_id="12345", + links=[azure.orbital.SpacecraftLinkArgs( + bandwidth_mhz=100, + center_frequency_mhz=101, + direction="Uplink", + polarization="LHCP", + name="examplename", + )], + two_line_elements=[ + "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + ], + title_line="AQUA", + tags={ + "aks-managed-cluster-name": "9a57225d-a405-4d40-aa46-f13d2342abef", + }) + ``` + ## Import Spacecraft can be imported using the `resource id`, e.g. @@ -401,6 +429,34 @@ def __init__(__self__, """ Manages a Spacecraft. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_spacecraft = azure.orbital.Spacecraft("exampleSpacecraft", + resource_group_name=example_resource_group.name, + location="westeurope", + norad_id="12345", + links=[azure.orbital.SpacecraftLinkArgs( + bandwidth_mhz=100, + center_frequency_mhz=101, + direction="Uplink", + polarization="LHCP", + name="examplename", + )], + two_line_elements=[ + "1 23455U 94089A 97320.90946019 .00000140 00000-0 10191-3 0 2621", + "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495", + ], + title_line="AQUA", + tags={ + "aks-managed-cluster-name": "9a57225d-a405-4d40-aa46-f13d2342abef", + }) + ``` + ## Import Spacecraft can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/paloalto/local_rulestack.py b/sdk/python/pulumi_azure/paloalto/local_rulestack.py index 7f5f9d919b..1715c0f49d 100644 --- a/sdk/python/pulumi_azure/paloalto/local_rulestack.py +++ b/sdk/python/pulumi_azure/paloalto/local_rulestack.py @@ -453,6 +453,18 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Palo Alto Networks Rulestacks can be imported using the `resource id`, e.g. @@ -483,6 +495,18 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + ``` + ## Import Palo Alto Networks Rulestacks can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/paloalto/local_rulestack_certificate.py b/sdk/python/pulumi_azure/paloalto/local_rulestack_certificate.py index c9390f0527..83ca481c99 100644 --- a/sdk/python/pulumi_azure/paloalto/local_rulestack_certificate.py +++ b/sdk/python/pulumi_azure/paloalto/local_rulestack_certificate.py @@ -301,6 +301,21 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_certificate = azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", + rulestack_id=example_local_rulestack.id, + self_signed=True) + ``` + ## Import Palo Alto Networks Rulestack Certificates can be imported using the `resource id`, e.g. @@ -329,6 +344,21 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack Certificate. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_certificate = azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", + rulestack_id=example_local_rulestack.id, + self_signed=True) + ``` + ## Import Palo Alto Networks Rulestack Certificates can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/paloalto/local_rulestack_fqdn_list.py b/sdk/python/pulumi_azure/paloalto/local_rulestack_fqdn_list.py index 9b5b585758..8d72ed4752 100644 --- a/sdk/python/pulumi_azure/paloalto/local_rulestack_fqdn_list.py +++ b/sdk/python/pulumi_azure/paloalto/local_rulestack_fqdn_list.py @@ -253,6 +253,21 @@ def __init__(__self__, """ Manages a Palo Alto Local Rulestack FQDN List. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=azurerm_resrouce_group["example"]["name"], + location=example_resource_group.location) + example_local_rulestack_fqdn_list = azure.paloalto.LocalRulestackFqdnList("exampleLocalRulestackFqdnList", + rulestack_id=example_local_rulestack.id, + fully_qualified_domain_names=["contoso.com"]) + ``` + ## Import Palo Alto Local Rulestack FQDN Lists can be imported using the `resource id`, e.g. @@ -278,6 +293,21 @@ def __init__(__self__, """ Manages a Palo Alto Local Rulestack FQDN List. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=azurerm_resrouce_group["example"]["name"], + location=example_resource_group.location) + example_local_rulestack_fqdn_list = azure.paloalto.LocalRulestackFqdnList("exampleLocalRulestackFqdnList", + rulestack_id=example_local_rulestack.id, + fully_qualified_domain_names=["contoso.com"]) + ``` + ## Import Palo Alto Local Rulestack FQDN Lists can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_trust_certificate_association.py b/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_trust_certificate_association.py index b67a7dec21..fb6455020d 100644 --- a/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_trust_certificate_association.py +++ b/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_trust_certificate_association.py @@ -96,6 +96,22 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack Outbound Trust Certificate Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_certificate = azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", + rulestack_id=example_local_rulestack.id, + self_signed=True) + example_local_rulestack_outbound_trust_certificate_association = azure.paloalto.LocalRulestackOutboundTrustCertificateAssociation("exampleLocalRulestackOutboundTrustCertificateAssociation", certificate_id=example_local_rulestack_certificate.id) + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] certificate_id: The ID of the Certificate to use as the Outbound Trust Certificate. Changing this forces a new Palo Alto Networks Rulestack Outbound Trust Certificate Association to be created. @@ -109,6 +125,22 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack Outbound Trust Certificate Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_certificate = azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", + rulestack_id=example_local_rulestack.id, + self_signed=True) + example_local_rulestack_outbound_trust_certificate_association = azure.paloalto.LocalRulestackOutboundTrustCertificateAssociation("exampleLocalRulestackOutboundTrustCertificateAssociation", certificate_id=example_local_rulestack_certificate.id) + ``` + :param str resource_name: The name of the resource. :param LocalRulestackOutboundTrustCertificateAssociationArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_untrust_certificate_association.py b/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_untrust_certificate_association.py index d621a20168..eb2e1cc79d 100644 --- a/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_untrust_certificate_association.py +++ b/sdk/python/pulumi_azure/paloalto/local_rulestack_outbound_untrust_certificate_association.py @@ -96,6 +96,22 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack Outbound Untrust Certificate Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_certificate = azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", + rulestack_id=example_local_rulestack.id, + self_signed=True) + example_local_rulestack_outbound_untrust_certificate_association = azure.paloalto.LocalRulestackOutboundUntrustCertificateAssociation("exampleLocalRulestackOutboundUntrustCertificateAssociation", certificate_id=example_local_rulestack_certificate.id) + ``` + :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] certificate_id: The ID of the Certificate to use as the Outbound Untrust Certificate. Changing this forces a new Palo Alto Networks Rulestack Outbound Untrust Certificate Association to be created. @@ -109,6 +125,22 @@ def __init__(__self__, """ Manages a Palo Alto Networks Rulestack Outbound Untrust Certificate Association. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_certificate = azure.paloalto.LocalRulestackCertificate("exampleLocalRulestackCertificate", + rulestack_id=example_local_rulestack.id, + self_signed=True) + example_local_rulestack_outbound_untrust_certificate_association = azure.paloalto.LocalRulestackOutboundUntrustCertificateAssociation("exampleLocalRulestackOutboundUntrustCertificateAssociation", certificate_id=example_local_rulestack_certificate.id) + ``` + :param str resource_name: The name of the resource. :param LocalRulestackOutboundUntrustCertificateAssociationArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. diff --git a/sdk/python/pulumi_azure/paloalto/local_rulestack_prefix_list.py b/sdk/python/pulumi_azure/paloalto/local_rulestack_prefix_list.py index 6e0c22feb3..31699008b7 100644 --- a/sdk/python/pulumi_azure/paloalto/local_rulestack_prefix_list.py +++ b/sdk/python/pulumi_azure/paloalto/local_rulestack_prefix_list.py @@ -253,6 +253,21 @@ def __init__(__self__, """ Manages a Palo Alto Local Rulestack Prefix List. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_prefix_list = azure.paloalto.LocalRulestackPrefixList("exampleLocalRulestackPrefixList", + rulestack_id=example_local_rulestack.id, + prefix_lists=["10.0.1.0/24"]) + ``` + ## Import Palo Alto Local Rulestack Prefix Lists can be imported using the `resource id`, e.g. @@ -278,6 +293,21 @@ def __init__(__self__, """ Manages a Palo Alto Local Rulestack Prefix List. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_prefix_list = azure.paloalto.LocalRulestackPrefixList("exampleLocalRulestackPrefixList", + rulestack_id=example_local_rulestack.id, + prefix_lists=["10.0.1.0/24"]) + ``` + ## Import Palo Alto Local Rulestack Prefix Lists can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/paloalto/local_rulestack_rule.py b/sdk/python/pulumi_azure/paloalto/local_rulestack_rule.py index 90fa1834ba..e59d3cd668 100644 --- a/sdk/python/pulumi_azure/paloalto/local_rulestack_rule.py +++ b/sdk/python/pulumi_azure/paloalto/local_rulestack_rule.py @@ -805,6 +805,29 @@ def __init__(__self__, """ Manages a Palo Alto Local Rulestack Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_rule = azure.paloalto.LocalRulestackRule("exampleLocalRulestackRule", + rulestack_id=example_local_rulestack.id, + priority=1000, + action="Allow", + applications=["any"], + source=azure.paloalto.LocalRulestackRuleSourceArgs( + cidrs=["10.0.0.0/8"], + ), + destination=azure.paloalto.LocalRulestackRuleDestinationArgs( + cidrs=["192.168.16.0/24"], + )) + ``` + ## Import Palo Alto Local Rulestack Rules can be imported using the `resource id`, e.g. @@ -846,6 +869,29 @@ def __init__(__self__, """ Manages a Palo Alto Local Rulestack Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_local_rulestack = azure.paloalto.LocalRulestack("exampleLocalRulestack", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_local_rulestack_rule = azure.paloalto.LocalRulestackRule("exampleLocalRulestackRule", + rulestack_id=example_local_rulestack.id, + priority=1000, + action="Allow", + applications=["any"], + source=azure.paloalto.LocalRulestackRuleSourceArgs( + cidrs=["10.0.0.0/8"], + ), + destination=azure.paloalto.LocalRulestackRuleDestinationArgs( + cidrs=["192.168.16.0/24"], + )) + ``` + ## Import Palo Alto Local Rulestack Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/paloalto/next_generation_firewall_virtual_network_panorama.py b/sdk/python/pulumi_azure/paloalto/next_generation_firewall_virtual_network_panorama.py index d7ca84c38f..5ba3227a7c 100644 --- a/sdk/python/pulumi_azure/paloalto/next_generation_firewall_virtual_network_panorama.py +++ b/sdk/python/pulumi_azure/paloalto/next_generation_firewall_virtual_network_panorama.py @@ -393,6 +393,70 @@ def __init__(__self__, """ Manages a Palo Alto Next Generation Firewall Virtual Network Panorama. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westeurope") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"]) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + trust_subnet = azure.network.Subnet("trustSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="trusted", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="PaloAltoNetworks.Cloudngfw/firewalls", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + trust_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("trustSubnetNetworkSecurityGroupAssociation", + subnet_id=trust_subnet.id, + network_security_group_id=example_network_security_group.id) + untrust_subnet = azure.network.Subnet("untrustSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="untrusted", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="PaloAltoNetworks.Cloudngfw/firewalls", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + untrust_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("untrustSubnetNetworkSecurityGroupAssociation", + subnet_id=untrust_subnet.id, + network_security_group_id=example_network_security_group.id) + example_next_generation_firewall_virtual_network_panorama = azure.paloalto.NextGenerationFirewallVirtualNetworkPanorama("exampleNextGenerationFirewallVirtualNetworkPanorama", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + panorama_base64_config="e2RnbmFtZTogY25nZnctYXotZXhhbXBsZSwgdHBsbmFtZTogY25nZnctZXhhbXBsZS10ZW1wbGF0ZS1zdGFjaywgZXhhbXBsZS1wYW5vcmFtYS1zZXJ2ZXI6IDE5Mi4xNjguMC4xLCB2bS1hdXRoLWtleTogMDAwMDAwMDAwMDAwMDAwLCBleHBpcnk6IDIwMjQvMDcvMzF9Cg==", + network_profile=azure.paloalto.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileArgs( + public_ip_address_ids=[example_public_ip.id], + vnet_configuration=azure.paloalto.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileVnetConfigurationArgs( + virtual_network_id=example_virtual_network.id, + trusted_subnet_id=trust_subnet.id, + untrusted_subnet_id=untrust_subnet.id, + ), + )) + ``` + ## Import Palo Alto Next Generation Firewall Virtual Network Panoramas can be imported using the `resource id`, e.g. @@ -421,6 +485,70 @@ def __init__(__self__, """ Manages a Palo Alto Next Generation Firewall Virtual Network Panorama. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westeurope") + example_public_ip = azure.network.PublicIp("examplePublicIp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static", + sku="Standard") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"]) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + trust_subnet = azure.network.Subnet("trustSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.1.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="trusted", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="PaloAltoNetworks.Cloudngfw/firewalls", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + trust_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("trustSubnetNetworkSecurityGroupAssociation", + subnet_id=trust_subnet.id, + network_security_group_id=example_network_security_group.id) + untrust_subnet = azure.network.Subnet("untrustSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="untrusted", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="PaloAltoNetworks.Cloudngfw/firewalls", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + untrust_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("untrustSubnetNetworkSecurityGroupAssociation", + subnet_id=untrust_subnet.id, + network_security_group_id=example_network_security_group.id) + example_next_generation_firewall_virtual_network_panorama = azure.paloalto.NextGenerationFirewallVirtualNetworkPanorama("exampleNextGenerationFirewallVirtualNetworkPanorama", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + panorama_base64_config="e2RnbmFtZTogY25nZnctYXotZXhhbXBsZSwgdHBsbmFtZTogY25nZnctZXhhbXBsZS10ZW1wbGF0ZS1zdGFjaywgZXhhbXBsZS1wYW5vcmFtYS1zZXJ2ZXI6IDE5Mi4xNjguMC4xLCB2bS1hdXRoLWtleTogMDAwMDAwMDAwMDAwMDAwLCBleHBpcnk6IDIwMjQvMDcvMzF9Cg==", + network_profile=azure.paloalto.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileArgs( + public_ip_address_ids=[example_public_ip.id], + vnet_configuration=azure.paloalto.NextGenerationFirewallVirtualNetworkPanoramaNetworkProfileVnetConfigurationArgs( + virtual_network_id=example_virtual_network.id, + trusted_subnet_id=trust_subnet.id, + untrusted_subnet_id=untrust_subnet.id, + ), + )) + ``` + ## Import Palo Alto Next Generation Firewall Virtual Network Panoramas can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/pim/active_role_assignment.py b/sdk/python/pulumi_azure/pim/active_role_assignment.py index c4108b13c0..9f38db0c21 100644 --- a/sdk/python/pulumi_azure/pim/active_role_assignment.py +++ b/sdk/python/pulumi_azure/pim/active_role_assignment.py @@ -310,6 +310,60 @@ def __init__(__self__, Manages a Pim Active Role Assignment. ## Example Usage + ### Subscription) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_static = time.Static("exampleStatic") + example_active_role_assignment = azure.pim.ActiveRoleAssignment("exampleActiveRoleAssignment", + scope=primary.id, + role_definition_id=f"{primary.id}{example_role_definition.id}", + principal_id=example_client_config.object_id, + schedule=azure.pim.ActiveRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.ActiveRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.ActiveRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` + ### Management Group) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_group = azure.management.Group("exampleGroup") + example_static = time.Static("exampleStatic") + example_active_role_assignment = azure.pim.ActiveRoleAssignment("exampleActiveRoleAssignment", + scope=example_group.id, + role_definition_id=example_role_definition.id, + principal_id=example_client_config.object_id, + schedule=azure.pim.ActiveRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.ActiveRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.ActiveRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` ## Import @@ -338,6 +392,60 @@ def __init__(__self__, Manages a Pim Active Role Assignment. ## Example Usage + ### Subscription) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_static = time.Static("exampleStatic") + example_active_role_assignment = azure.pim.ActiveRoleAssignment("exampleActiveRoleAssignment", + scope=primary.id, + role_definition_id=f"{primary.id}{example_role_definition.id}", + principal_id=example_client_config.object_id, + schedule=azure.pim.ActiveRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.ActiveRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.ActiveRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` + ### Management Group) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_group = azure.management.Group("exampleGroup") + example_static = time.Static("exampleStatic") + example_active_role_assignment = azure.pim.ActiveRoleAssignment("exampleActiveRoleAssignment", + scope=example_group.id, + role_definition_id=example_role_definition.id, + principal_id=example_client_config.object_id, + schedule=azure.pim.ActiveRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.ActiveRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.ActiveRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/pim/eligible_role_assignment.py b/sdk/python/pulumi_azure/pim/eligible_role_assignment.py index 4d00693eb6..1a716069f2 100644 --- a/sdk/python/pulumi_azure/pim/eligible_role_assignment.py +++ b/sdk/python/pulumi_azure/pim/eligible_role_assignment.py @@ -312,6 +312,60 @@ def __init__(__self__, Manages a Pim Eligible Role Assignment. ## Example Usage + ### Subscription) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_static = time.Static("exampleStatic") + example_eligible_role_assignment = azure.pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", + scope=primary.id, + role_definition_id=f"{primary.id}{example_role_definition.id}", + principal_id=example_client_config.object_id, + schedule=azure.pim.EligibleRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.EligibleRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.EligibleRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` + ### Management Group) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_group = azure.management.Group("exampleGroup") + example_static = time.Static("exampleStatic") + example_eligible_role_assignment = azure.pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", + scope=example_group.id, + role_definition_id=example_role_definition.id, + principal_id=example_client_config.object_id, + schedule=azure.pim.EligibleRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.EligibleRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.EligibleRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` ## Import @@ -340,6 +394,60 @@ def __init__(__self__, Manages a Pim Eligible Role Assignment. ## Example Usage + ### Subscription) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_static = time.Static("exampleStatic") + example_eligible_role_assignment = azure.pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", + scope=primary.id, + role_definition_id=f"{primary.id}{example_role_definition.id}", + principal_id=example_client_config.object_id, + schedule=azure.pim.EligibleRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.EligibleRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.EligibleRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` + ### Management Group) + + ```python + import pulumi + import pulumi_azure as azure + import pulumiverse_time as time + + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.get_role_definition(name="Reader") + example_group = azure.management.Group("exampleGroup") + example_static = time.Static("exampleStatic") + example_eligible_role_assignment = azure.pim.EligibleRoleAssignment("exampleEligibleRoleAssignment", + scope=example_group.id, + role_definition_id=example_role_definition.id, + principal_id=example_client_config.object_id, + schedule=azure.pim.EligibleRoleAssignmentScheduleArgs( + start_date_time=example_static.rfc3339, + expiration=azure.pim.EligibleRoleAssignmentScheduleExpirationArgs( + duration_hours=8, + ), + ), + justification="Expiration Duration Set", + ticket=azure.pim.EligibleRoleAssignmentTicketArgs( + number="1", + system="example ticket system", + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/policy/definition.py b/sdk/python/pulumi_azure/policy/definition.py index 5aba64be00..2c4250c39f 100644 --- a/sdk/python/pulumi_azure/policy/definition.py +++ b/sdk/python/pulumi_azure/policy/definition.py @@ -436,6 +436,49 @@ def __init__(__self__, Policy definitions do not take effect until they are assigned to a scope using a Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.policy.Definition("policy", + display_name="acceptance test policy definition", + metadata=\"\"\" { + "category": "General" + } + + + \"\"\", + mode="Indexed", + parameters=\"\"\" { + "allowedLocations": { + "type": "Array", + "metadata": { + "description": "The list of allowed locations for resources.", + "displayName": "Allowed locations", + "strongType": "location" + } + } + } + + \"\"\", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "in": "[parameters('allowedLocations')]" + } + }, + "then": { + "effect": "audit" + } + } + + \"\"\", + policy_type="Custom") + ``` + ## Import Policy Definitions can be imported using the `policy name`, e.g. @@ -475,6 +518,49 @@ def __init__(__self__, Policy definitions do not take effect until they are assigned to a scope using a Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.policy.Definition("policy", + display_name="acceptance test policy definition", + metadata=\"\"\" { + "category": "General" + } + + + \"\"\", + mode="Indexed", + parameters=\"\"\" { + "allowedLocations": { + "type": "Array", + "metadata": { + "description": "The list of allowed locations for resources.", + "displayName": "Allowed locations", + "strongType": "location" + } + } + } + + \"\"\", + policy_rule=\"\"\" { + "if": { + "not": { + "field": "location", + "in": "[parameters('allowedLocations')]" + } + }, + "then": { + "effect": "audit" + } + } + + \"\"\", + policy_type="Custom") + ``` + ## Import Policy Definitions can be imported using the `policy name`, e.g. diff --git a/sdk/python/pulumi_azure/policy/get_policy_assignment.py b/sdk/python/pulumi_azure/policy/get_policy_assignment.py index 78733014c5..731e4e8324 100644 --- a/sdk/python/pulumi_azure/policy/get_policy_assignment.py +++ b/sdk/python/pulumi_azure/policy/get_policy_assignment.py @@ -189,6 +189,17 @@ def get_policy_assignment(name: Optional[str] = None, """ Use this data source to access information about an existing Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_assignment(name="existing", + scope_id=data["azurerm_resource_group"]["example"]["id"]) + pulumi.export("id", example.id) + ``` + :param str name: The name of this Policy Assignment. Changing this forces a new Policy Assignment to be created. :param str scope_id: The ID of the scope this Policy Assignment is assigned to. The `scope_id` can be a subscription id, a resource group id, a management group id, or an ID of any resource that is assigned with a policy. Changing this forces a new Policy Assignment to be created. @@ -222,6 +233,17 @@ def get_policy_assignment_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Policy Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_assignment(name="existing", + scope_id=data["azurerm_resource_group"]["example"]["id"]) + pulumi.export("id", example.id) + ``` + :param str name: The name of this Policy Assignment. Changing this forces a new Policy Assignment to be created. :param str scope_id: The ID of the scope this Policy Assignment is assigned to. The `scope_id` can be a subscription id, a resource group id, a management group id, or an ID of any resource that is assigned with a policy. Changing this forces a new Policy Assignment to be created. diff --git a/sdk/python/pulumi_azure/policy/get_policy_defintion.py b/sdk/python/pulumi_azure/policy/get_policy_defintion.py index 9b45c19123..2d85aa1848 100644 --- a/sdk/python/pulumi_azure/policy/get_policy_defintion.py +++ b/sdk/python/pulumi_azure/policy/get_policy_defintion.py @@ -174,6 +174,16 @@ def get_policy_defintion(display_name: Optional[str] = None, """ Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_defintion(display_name="Allowed resource types") + pulumi.export("id", example.id) + ``` + :param str display_name: Specifies the display name of the Policy Definition. Conflicts with `name`. @@ -211,6 +221,16 @@ def get_policy_defintion_output(display_name: Optional[pulumi.Input[Optional[str """ Use this data source to access information about a Policy Definition, both custom and built in. Retrieves Policy Definitions from your current subscription by default. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_defintion(display_name="Allowed resource types") + pulumi.export("id", example.id) + ``` + :param str display_name: Specifies the display name of the Policy Definition. Conflicts with `name`. diff --git a/sdk/python/pulumi_azure/policy/get_policy_defintion_built_in.py b/sdk/python/pulumi_azure/policy/get_policy_defintion_built_in.py index a1508c1e6d..f75909f605 100644 --- a/sdk/python/pulumi_azure/policy/get_policy_defintion_built_in.py +++ b/sdk/python/pulumi_azure/policy/get_policy_defintion_built_in.py @@ -174,6 +174,16 @@ def get_policy_defintion_built_in(display_name: Optional[str] = None, """ Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_defintion_built_in(display_name="Allowed resource types") + pulumi.export("id", example.id) + ``` + :param str display_name: Specifies the display name of the Policy Definition. Conflicts with `name`. @@ -211,6 +221,16 @@ def get_policy_defintion_built_in_output(display_name: Optional[pulumi.Input[Opt """ Use this data source to access information about a Built-In Policy Definition. Retrieves Policy Definitions from your current subscription by default. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_defintion_built_in(display_name="Allowed resource types") + pulumi.export("id", example.id) + ``` + :param str display_name: Specifies the display name of the Policy Definition. Conflicts with `name`. diff --git a/sdk/python/pulumi_azure/policy/get_policy_set_definition.py b/sdk/python/pulumi_azure/policy/get_policy_set_definition.py index 82787adbff..97a2ee22b8 100644 --- a/sdk/python/pulumi_azure/policy/get_policy_set_definition.py +++ b/sdk/python/pulumi_azure/policy/get_policy_set_definition.py @@ -169,6 +169,16 @@ def get_policy_set_definition(display_name: Optional[str] = None, """ Use this data source to access information about an existing Policy Set Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_set_definition(display_name="Policy Set Definition Example") + pulumi.export("id", example.id) + ``` + :param str display_name: Specifies the display name of the Policy Set Definition. Conflicts with `name`. @@ -205,6 +215,16 @@ def get_policy_set_definition_output(display_name: Optional[pulumi.Input[Optiona """ Use this data source to access information about an existing Policy Set Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_policy_set_definition(display_name="Policy Set Definition Example") + pulumi.export("id", example.id) + ``` + :param str display_name: Specifies the display name of the Policy Set Definition. Conflicts with `name`. diff --git a/sdk/python/pulumi_azure/policy/get_virtual_machine_configuration_assignment.py b/sdk/python/pulumi_azure/policy/get_virtual_machine_configuration_assignment.py index 2780ea5e13..26291947bc 100644 --- a/sdk/python/pulumi_azure/policy/get_virtual_machine_configuration_assignment.py +++ b/sdk/python/pulumi_azure/policy/get_virtual_machine_configuration_assignment.py @@ -150,6 +150,18 @@ def get_virtual_machine_configuration_assignment(name: Optional[str] = None, """ Use this data source to access information about an existing Guest Configuration Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_virtual_machine_configuration_assignment(name="AzureWindowsBaseline", + resource_group_name="example-RG", + virtual_machine_name="example-vm") + pulumi.export("complianceStatus", example.compliance_status) + ``` + :param str name: Specifies the name of the Guest Configuration Assignment. :param str resource_group_name: Specifies the Name of the Resource Group where the Guest Configuration Assignment exists. @@ -183,6 +195,18 @@ def get_virtual_machine_configuration_assignment_output(name: Optional[pulumi.In """ Use this data source to access information about an existing Guest Configuration Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.get_virtual_machine_configuration_assignment(name="AzureWindowsBaseline", + resource_group_name="example-RG", + virtual_machine_name="example-vm") + pulumi.export("complianceStatus", example.compliance_status) + ``` + :param str name: Specifies the name of the Guest Configuration Assignment. :param str resource_group_name: Specifies the Name of the Resource Group where the Guest Configuration Assignment exists. diff --git a/sdk/python/pulumi_azure/policy/policy_set_definition.py b/sdk/python/pulumi_azure/policy/policy_set_definition.py index deca3afd2a..cdcf5e52d8 100644 --- a/sdk/python/pulumi_azure/policy/policy_set_definition.py +++ b/sdk/python/pulumi_azure/policy/policy_set_definition.py @@ -414,6 +414,37 @@ def __init__(__self__, > **NOTE:** Policy set definitions (also known as policy initiatives) do not take effect until they are assigned to a scope using a Policy Set Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.PolicySetDefinition("example", + display_name="Test Policy Set", + parameters=\"\"\" { + "allowedLocations": { + "type": "Array", + "metadata": { + "description": "The list of allowed locations for resources.", + "displayName": "Allowed locations", + "strongType": "location" + } + } + } + + \"\"\", + policy_definition_references=[azure.policy.PolicySetDefinitionPolicyDefinitionReferenceArgs( + parameter_values=\"\"\" { + "listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"} + } + + \"\"\", + policy_definition_id="/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", + )], + policy_type="Custom") + ``` + ## Import Policy Set Definitions can be imported using the `resource id`, e.g. @@ -451,6 +482,37 @@ def __init__(__self__, > **NOTE:** Policy set definitions (also known as policy initiatives) do not take effect until they are assigned to a scope using a Policy Set Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.policy.PolicySetDefinition("example", + display_name="Test Policy Set", + parameters=\"\"\" { + "allowedLocations": { + "type": "Array", + "metadata": { + "description": "The list of allowed locations for resources.", + "displayName": "Allowed locations", + "strongType": "location" + } + } + } + + \"\"\", + policy_definition_references=[azure.policy.PolicySetDefinitionPolicyDefinitionReferenceArgs( + parameter_values=\"\"\" { + "listOfAllowedLocations": {"value": "[parameters('allowedLocations')]"} + } + + \"\"\", + policy_definition_id="/providers/Microsoft.Authorization/policyDefinitions/e765b5de-1225-4ba3-bd56-1ac6695af988", + )], + policy_type="Custom") + ``` + ## Import Policy Set Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/policy/virtual_machine_configuration_assignment.py b/sdk/python/pulumi_azure/policy/virtual_machine_configuration_assignment.py index ec63c7bb03..4c5a7edcd3 100644 --- a/sdk/python/pulumi_azure/policy/virtual_machine_configuration_assignment.py +++ b/sdk/python/pulumi_azure/policy/virtual_machine_configuration_assignment.py @@ -212,6 +212,86 @@ def __init__(__self__, > **NOTE:** You can create Guest Configuration Policies without defining a `compute.Extension` resource, however the policies will not be executed until a `compute.Extension` has been provisioned to the virtual machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_windows_virtual_machine = azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + admin_password="P@$$w0rd1234!", + network_interface_ids=[example_network_interface.id], + identity=azure.compute.WindowsVirtualMachineIdentityArgs( + type="SystemAssigned", + ), + os_disk=azure.compute.WindowsVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.WindowsVirtualMachineSourceImageReferenceArgs( + publisher="MicrosoftWindowsServer", + offer="WindowsServer", + sku="2019-Datacenter", + version="latest", + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_windows_virtual_machine.id, + publisher="Microsoft.GuestConfiguration", + type="ConfigurationforWindows", + type_handler_version="1.29", + auto_upgrade_minor_version=True) + example_virtual_machine_configuration_assignment = azure.policy.VirtualMachineConfigurationAssignment("exampleVirtualMachineConfigurationAssignment", + location=example_windows_virtual_machine.location, + virtual_machine_id=example_windows_virtual_machine.id, + configuration=azure.policy.VirtualMachineConfigurationAssignmentConfigurationArgs( + assignment_type="ApplyAndMonitor", + version="1.*", + parameters=[ + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Minimum Password Length;ExpectedValue", + value="16", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Minimum Password Age;ExpectedValue", + value="0", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Maximum Password Age;ExpectedValue", + value="30,45", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Enforce Password History;ExpectedValue", + value="10", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Password Must Meet Complexity Requirements;ExpectedValue", + value="1", + ), + ], + )) + ``` + ## Import Policy Virtual Machine Configuration Assignments can be imported using the `resource id`, e.g. @@ -238,6 +318,86 @@ def __init__(__self__, > **NOTE:** You can create Guest Configuration Policies without defining a `compute.Extension` resource, however the policies will not be executed until a `compute.Extension` has been provisioned to the virtual machine. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="internal", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_windows_virtual_machine = azure.compute.WindowsVirtualMachine("exampleWindowsVirtualMachine", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + size="Standard_F2", + admin_username="adminuser", + admin_password="P@$$w0rd1234!", + network_interface_ids=[example_network_interface.id], + identity=azure.compute.WindowsVirtualMachineIdentityArgs( + type="SystemAssigned", + ), + os_disk=azure.compute.WindowsVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + source_image_reference=azure.compute.WindowsVirtualMachineSourceImageReferenceArgs( + publisher="MicrosoftWindowsServer", + offer="WindowsServer", + sku="2019-Datacenter", + version="latest", + )) + example_extension = azure.compute.Extension("exampleExtension", + virtual_machine_id=example_windows_virtual_machine.id, + publisher="Microsoft.GuestConfiguration", + type="ConfigurationforWindows", + type_handler_version="1.29", + auto_upgrade_minor_version=True) + example_virtual_machine_configuration_assignment = azure.policy.VirtualMachineConfigurationAssignment("exampleVirtualMachineConfigurationAssignment", + location=example_windows_virtual_machine.location, + virtual_machine_id=example_windows_virtual_machine.id, + configuration=azure.policy.VirtualMachineConfigurationAssignmentConfigurationArgs( + assignment_type="ApplyAndMonitor", + version="1.*", + parameters=[ + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Minimum Password Length;ExpectedValue", + value="16", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Minimum Password Age;ExpectedValue", + value="0", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Maximum Password Age;ExpectedValue", + value="30,45", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Enforce Password History;ExpectedValue", + value="10", + ), + azure.policy.VirtualMachineConfigurationAssignmentConfigurationParameterArgs( + name="Password Must Meet Complexity Requirements;ExpectedValue", + value="1", + ), + ], + )) + ``` + ## Import Policy Virtual Machine Configuration Assignments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/portal/dashboard.py b/sdk/python/pulumi_azure/portal/dashboard.py index d5616d2702..300afcf971 100644 --- a/sdk/python/pulumi_azure/portal/dashboard.py +++ b/sdk/python/pulumi_azure/portal/dashboard.py @@ -258,6 +258,141 @@ def __init__(__self__, !> **Note:** The `portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `portal.PortalDashboard` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + md_content = config.get("mdContent") + if md_content is None: + md_content = "# Hello all :)" + video_link = config.get("videoLink") + if video_link is None: + video_link = "https://www.youtube.com/watch?v=......" + current = azure.core.get_subscription() + example = azure.core.ResourceGroup("example", location="West Europe") + my_board = azure.portal.Dashboard("my-board", + resource_group_name=example.name, + location=example.location, + tags={ + "source": "managed", + }, + dashboard_properties=f\"\"\"{{ + "lenses": {{ + "0": {{ + "order": 0, + "parts": {{ + "0": {{ + "position": {{ + "x": 0, + "y": 0, + "rowSpan": 2, + "colSpan": 3 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": {{ + "content": {{ + "settings": {{ + "content": "{md_content}", + "subtitle": "", + "title": "" + }} + }} + }} + }} + }}, + "1": {{ + "position": {{ + "x": 5, + "y": 0, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/VideoPart", + "settings": {{ + "content": {{ + "settings": {{ + "title": "Important Information", + "subtitle": "", + "src": "{video_link}", + "autoplay": true + }} + }} + }} + }} + }}, + "2": {{ + "position": {{ + "x": 0, + "y": 4, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [ + {{ + "name": "ComponentId", + "value": "/subscriptions/{current.subscription_id}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" + }} + ], + "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", + "settings": {{}}, + "asset": {{ + "idInputName": "ComponentId", + "type": "ApplicationInsights" + }} + }} + }} + }} + }} + }}, + "metadata": {{ + "model": {{ + "timeRange": {{ + "value": {{ + "relative": {{ + "duration": 24, + "timeUnit": 1 + }} + }}, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + }}, + "filterLocale": {{ + "value": "en-us" + }}, + "filters": {{ + "value": {{ + "MsPortalFx_TimeRange": {{ + "model": {{ + "format": "utc", + "granularity": "auto", + "relative": "24h" + }}, + "displayCache": {{ + "name": "UTC Time", + "value": "Past 24 hours" + }}, + "filteredPartIds": [ + "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" + ] + }} + }} + }} + }} + }} + }} + \"\"\") + ``` + + It is recommended to follow the steps outlined + [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + ## Import Dashboards can be imported using the `resource id`, e.g. @@ -289,6 +424,141 @@ def __init__(__self__, !> **Note:** The `portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `portal.PortalDashboard` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + config = pulumi.Config() + md_content = config.get("mdContent") + if md_content is None: + md_content = "# Hello all :)" + video_link = config.get("videoLink") + if video_link is None: + video_link = "https://www.youtube.com/watch?v=......" + current = azure.core.get_subscription() + example = azure.core.ResourceGroup("example", location="West Europe") + my_board = azure.portal.Dashboard("my-board", + resource_group_name=example.name, + location=example.location, + tags={ + "source": "managed", + }, + dashboard_properties=f\"\"\"{{ + "lenses": {{ + "0": {{ + "order": 0, + "parts": {{ + "0": {{ + "position": {{ + "x": 0, + "y": 0, + "rowSpan": 2, + "colSpan": 3 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/MarkdownPart", + "settings": {{ + "content": {{ + "settings": {{ + "content": "{md_content}", + "subtitle": "", + "title": "" + }} + }} + }} + }} + }}, + "1": {{ + "position": {{ + "x": 5, + "y": 0, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [], + "type": "Extension/HubsExtension/PartType/VideoPart", + "settings": {{ + "content": {{ + "settings": {{ + "title": "Important Information", + "subtitle": "", + "src": "{video_link}", + "autoplay": true + }} + }} + }} + }} + }}, + "2": {{ + "position": {{ + "x": 0, + "y": 4, + "rowSpan": 4, + "colSpan": 6 + }}, + "metadata": {{ + "inputs": [ + {{ + "name": "ComponentId", + "value": "/subscriptions/{current.subscription_id}/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp" + }} + ], + "type": "Extension/AppInsightsExtension/PartType/AppMapGalPt", + "settings": {{}}, + "asset": {{ + "idInputName": "ComponentId", + "type": "ApplicationInsights" + }} + }} + }} + }} + }} + }}, + "metadata": {{ + "model": {{ + "timeRange": {{ + "value": {{ + "relative": {{ + "duration": 24, + "timeUnit": 1 + }} + }}, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + }}, + "filterLocale": {{ + "value": "en-us" + }}, + "filters": {{ + "value": {{ + "MsPortalFx_TimeRange": {{ + "model": {{ + "format": "utc", + "granularity": "auto", + "relative": "24h" + }}, + "displayCache": {{ + "name": "UTC Time", + "value": "Past 24 hours" + }}, + "filteredPartIds": [ + "StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7" + ] + }} + }} + }} + }} + }} + }} + \"\"\") + ``` + + It is recommended to follow the steps outlined + [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example. + ## Import Dashboards can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/portal/get_dashboard.py b/sdk/python/pulumi_azure/portal/get_dashboard.py index dfca736871..2dfdc97d37 100644 --- a/sdk/python/pulumi_azure/portal/get_dashboard.py +++ b/sdk/python/pulumi_azure/portal/get_dashboard.py @@ -115,6 +115,17 @@ def get_dashboard(dashboard_properties: Optional[str] = None, """ Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `portal.Dashboard` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.portal.get_dashboard(name="existing-dashboard", + resource_group_name="dashboard-rg") + pulumi.export("id", data["azurerm_dashboard"]["example"]["id"]) + ``` + :param str dashboard_properties: JSON data representing dashboard body. :param str display_name: Specifies the display name of the shared Azure Portal Dashboard. @@ -148,6 +159,17 @@ def get_dashboard_output(dashboard_properties: Optional[pulumi.Input[Optional[st """ Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `portal.Dashboard` resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.portal.get_dashboard(name="existing-dashboard", + resource_group_name="dashboard-rg") + pulumi.export("id", data["azurerm_dashboard"]["example"]["id"]) + ``` + :param str dashboard_properties: JSON data representing dashboard body. :param str display_name: Specifies the display name of the shared Azure Portal Dashboard. diff --git a/sdk/python/pulumi_azure/postgresql/active_directory_administrator.py b/sdk/python/pulumi_azure/postgresql/active_directory_administrator.py index 8973e0ea25..1f9c7b87a8 100644 --- a/sdk/python/pulumi_azure/postgresql/active_directory_administrator.py +++ b/sdk/python/pulumi_azure/postgresql/active_directory_administrator.py @@ -260,6 +260,30 @@ def __init__(__self__, """ Allows you to set a user or group as the AD administrator for an PostgreSQL server in Azure + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="9.6", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd", + sku_name="GP_Gen5_2", + ssl_enforcement_enabled=True) + example_active_directory_administrator = azure.postgresql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", + server_name=example_server.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A PostgreSQL Active Directory Administrator can be imported using the `resource id`, e.g. @@ -285,6 +309,30 @@ def __init__(__self__, """ Allows you to set a user or group as the AD administrator for an PostgreSQL server in Azure + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="9.6", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd", + sku_name="GP_Gen5_2", + ssl_enforcement_enabled=True) + example_active_directory_administrator = azure.postgresql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", + server_name=example_server.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A PostgreSQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/configuration.py b/sdk/python/pulumi_azure/postgresql/configuration.py index a6545e5f3e..1f12d4cc8e 100644 --- a/sdk/python/pulumi_azure/postgresql/configuration.py +++ b/sdk/python/pulumi_azure/postgresql/configuration.py @@ -218,6 +218,32 @@ def __init__(__self__, > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + auto_grow_enabled=True, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_configuration = azure.postgresql.Configuration("exampleConfiguration", + name="backslash_quote", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + value="on") + ``` + ## Import PostgreSQL Configurations can be imported using the `resource id`, e.g. @@ -246,6 +272,32 @@ def __init__(__self__, > **Note:** Since this resource is provisioned by default, the Azure Provider will not check for the presence of an existing resource prior to attempting to create it. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + auto_grow_enabled=True, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_configuration = azure.postgresql.Configuration("exampleConfiguration", + name="backslash_quote", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + value="on") + ``` + ## Import PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/database.py b/sdk/python/pulumi_azure/postgresql/database.py index 4aa21bb336..c7f439b4fe 100644 --- a/sdk/python/pulumi_azure/postgresql/database.py +++ b/sdk/python/pulumi_azure/postgresql/database.py @@ -251,6 +251,32 @@ def __init__(__self__, """ Manages a PostgreSQL Database within a PostgreSQL Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + auto_grow_enabled=True, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_database = azure.postgresql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="UTF8", + collation="English_United States.1252") + ``` + ## Import PostgreSQL Database's can be imported using the `resource id`, e.g. @@ -276,6 +302,32 @@ def __init__(__self__, """ Manages a PostgreSQL Database within a PostgreSQL Server + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="B_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + geo_redundant_backup_enabled=False, + auto_grow_enabled=True, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_database = azure.postgresql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + charset="UTF8", + collation="English_United States.1252") + ``` + ## Import PostgreSQL Database's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/firewall_rule.py b/sdk/python/pulumi_azure/postgresql/firewall_rule.py index d391d25759..3a70054ea2 100644 --- a/sdk/python/pulumi_azure/postgresql/firewall_rule.py +++ b/sdk/python/pulumi_azure/postgresql/firewall_rule.py @@ -268,6 +268,40 @@ def __init__(__self__, Manages a Firewall Rule for a PostgreSQL Server ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="GP_Gen5_2", + version="11", + ssl_enforcement_enabled=True) + example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.8.12", + end_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer") + # ... + example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.0.0", + end_ip_address="40.112.255.255") + ``` ## Import @@ -297,6 +331,40 @@ def __init__(__self__, Manages a Firewall Rule for a PostgreSQL Server ## Example Usage + ### Single IP Address) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="GP_Gen5_2", + version="11", + ssl_enforcement_enabled=True) + example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.8.12", + end_ip_address="40.112.8.12") + ``` + ### IP Range) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer") + # ... + example_firewall_rule = azure.postgresql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + start_ip_address="40.112.0.0", + end_ip_address="40.112.255.255") + ``` ## Import diff --git a/sdk/python/pulumi_azure/postgresql/flexible_server.py b/sdk/python/pulumi_azure/postgresql/flexible_server.py index 92793f76d9..5b1c834349 100644 --- a/sdk/python/pulumi_azure/postgresql/flexible_server.py +++ b/sdk/python/pulumi_azure/postgresql/flexible_server.py @@ -1099,6 +1099,48 @@ def __init__(__self__, """ Manages a PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=["Microsoft.Storage"], + delegations=[azure.network.SubnetDelegationArgs( + name="fs", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.DBforPostgreSQL/flexibleServers", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_zone_virtual_network_link = azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", + private_dns_zone_name=example_zone.name, + virtual_network_id=example_virtual_network.id, + resource_group_name=example_resource_group.name) + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + delegated_subnet_id=example_subnet.id, + private_dns_zone_id=example_zone.id, + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + zone="1", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3", + opts=pulumi.ResourceOptions(depends_on=[example_zone_virtual_network_link])) + ``` + ## Import PostgreSQL Flexible Servers can be imported using the `resource id`, e.g. @@ -1156,6 +1198,48 @@ def __init__(__self__, """ Manages a PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=["Microsoft.Storage"], + delegations=[azure.network.SubnetDelegationArgs( + name="fs", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.DBforPostgreSQL/flexibleServers", + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + ), + )]) + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_zone_virtual_network_link = azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", + private_dns_zone_name=example_zone.name, + virtual_network_id=example_virtual_network.id, + resource_group_name=example_resource_group.name) + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + delegated_subnet_id=example_subnet.id, + private_dns_zone_id=example_zone.id, + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + zone="1", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3", + opts=pulumi.ResourceOptions(depends_on=[example_zone_virtual_network_link])) + ``` + ## Import PostgreSQL Flexible Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/flexible_server_active_directory_administrator.py b/sdk/python/pulumi_azure/postgresql/flexible_server_active_directory_administrator.py index 93834b224c..02c73ebb9a 100644 --- a/sdk/python/pulumi_azure/postgresql/flexible_server_active_directory_administrator.py +++ b/sdk/python/pulumi_azure/postgresql/flexible_server_active_directory_administrator.py @@ -306,6 +306,38 @@ def __init__(__self__, """ Allows you to set a user or group as the AD administrator for a PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + example_service_principal = azuread.get_service_principal(object_id=current.object_id) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="adminTerraform", + administrator_password="QAZwsx123", + storage_mb=32768, + version="12", + sku_name="GP_Standard_D2s_v3", + zone="2", + authentication=azure.postgresql.FlexibleServerAuthenticationArgs( + active_directory_auth_enabled=True, + tenant_id=current.tenant_id, + )) + example_flexible_server_active_directory_administrator = azure.postgresql.FlexibleServerActiveDirectoryAdministrator("exampleFlexibleServerActiveDirectoryAdministrator", + server_name=example_flexible_server.name, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + object_id=example_service_principal.object_id, + principal_name=example_service_principal.display_name, + principal_type="ServicePrincipal") + ``` + ## Import A PostgreSQL Flexible Server Active Directory Administrator can be imported using the `resource id`, e.g. @@ -332,6 +364,38 @@ def __init__(__self__, """ Allows you to set a user or group as the AD administrator for a PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + current = azure.core.get_client_config() + example_service_principal = azuread.get_service_principal(object_id=current.object_id) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="adminTerraform", + administrator_password="QAZwsx123", + storage_mb=32768, + version="12", + sku_name="GP_Standard_D2s_v3", + zone="2", + authentication=azure.postgresql.FlexibleServerAuthenticationArgs( + active_directory_auth_enabled=True, + tenant_id=current.tenant_id, + )) + example_flexible_server_active_directory_administrator = azure.postgresql.FlexibleServerActiveDirectoryAdministrator("exampleFlexibleServerActiveDirectoryAdministrator", + server_name=example_flexible_server.name, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + object_id=example_service_principal.object_id, + principal_name=example_service_principal.display_name, + principal_type="ServicePrincipal") + ``` + ## Import A PostgreSQL Flexible Server Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/flexible_server_configuration.py b/sdk/python/pulumi_azure/postgresql/flexible_server_configuration.py index cbe4fd27e2..4f3abb5ed4 100644 --- a/sdk/python/pulumi_azure/postgresql/flexible_server_configuration.py +++ b/sdk/python/pulumi_azure/postgresql/flexible_server_configuration.py @@ -179,6 +179,45 @@ def __init__(__self__, """ Sets a PostgreSQL Configuration value on a Azure PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_configuration = azure.postgresql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", + server_id=example_flexible_server.id, + value="on") + ``` + ### Azure Extensions + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_configuration = azure.postgresql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", + server_id=example_flexible_server.id, + value="CUBE,CITEXT,BTREE_GIST") + ``` + ## Import PostgreSQL Configurations can be imported using the `resource id`, e.g. @@ -204,6 +243,45 @@ def __init__(__self__, """ Sets a PostgreSQL Configuration value on a Azure PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_configuration = azure.postgresql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", + server_id=example_flexible_server.id, + value="on") + ``` + ### Azure Extensions + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_configuration = azure.postgresql.FlexibleServerConfiguration("exampleFlexibleServerConfiguration", + server_id=example_flexible_server.id, + value="CUBE,CITEXT,BTREE_GIST") + ``` + ## Import PostgreSQL Configurations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/flexible_server_database.py b/sdk/python/pulumi_azure/postgresql/flexible_server_database.py index d69d0da4f3..be8be818cb 100644 --- a/sdk/python/pulumi_azure/postgresql/flexible_server_database.py +++ b/sdk/python/pulumi_azure/postgresql/flexible_server_database.py @@ -207,6 +207,27 @@ def __init__(__self__, """ Manages a PostgreSQL Flexible Server Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_database = azure.postgresql.FlexibleServerDatabase("exampleFlexibleServerDatabase", + server_id=example_flexible_server.id, + collation="en_US.utf8", + charset="utf8") + ``` + ## Import Azure PostgreSQL Flexible Server Database can be imported using the `resource id`, e.g. @@ -231,6 +252,27 @@ def __init__(__self__, """ Manages a PostgreSQL Flexible Server Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_database = azure.postgresql.FlexibleServerDatabase("exampleFlexibleServerDatabase", + server_id=example_flexible_server.id, + collation="en_US.utf8", + charset="utf8") + ``` + ## Import Azure PostgreSQL Flexible Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/flexible_server_firewall_rule.py b/sdk/python/pulumi_azure/postgresql/flexible_server_firewall_rule.py index 5657217461..bbceeaff62 100644 --- a/sdk/python/pulumi_azure/postgresql/flexible_server_firewall_rule.py +++ b/sdk/python/pulumi_azure/postgresql/flexible_server_firewall_rule.py @@ -217,6 +217,27 @@ def __init__(__self__, """ Manages a PostgreSQL Flexible Server Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_firewall_rule = azure.postgresql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + server_id=example_flexible_server.id, + start_ip_address="122.122.0.0", + end_ip_address="122.122.0.0") + ``` + ## Import PostgreSQL Flexible Server Firewall Rules can be imported using the `resource id`, e.g. @@ -241,6 +262,27 @@ def __init__(__self__, """ Manages a PostgreSQL Flexible Server Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_flexible_server = azure.postgresql.FlexibleServer("exampleFlexibleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12", + administrator_login="psqladmin", + administrator_password="H@Sh1CoR3!", + storage_mb=32768, + sku_name="GP_Standard_D4s_v3") + example_flexible_server_firewall_rule = azure.postgresql.FlexibleServerFirewallRule("exampleFlexibleServerFirewallRule", + server_id=example_flexible_server.id, + start_ip_address="122.122.0.0", + end_ip_address="122.122.0.0") + ``` + ## Import PostgreSQL Flexible Server Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/get_flexible_server.py b/sdk/python/pulumi_azure/postgresql/get_flexible_server.py index 78c9ea07c0..cedcb8e4fb 100644 --- a/sdk/python/pulumi_azure/postgresql/get_flexible_server.py +++ b/sdk/python/pulumi_azure/postgresql/get_flexible_server.py @@ -200,6 +200,17 @@ def get_flexible_server(name: Optional[str] = None, """ Use this data source to access information about an existing PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.postgresql.get_flexible_server(name="existing-postgresql-fs", + resource_group_name="existing-postgresql-resgroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this PostgreSQL Flexible Server. :param str resource_group_name: The name of the Resource Group where the PostgreSQL Flexible Server exists. @@ -234,6 +245,17 @@ def get_flexible_server_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing PostgreSQL Flexible Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.postgresql.get_flexible_server(name="existing-postgresql-fs", + resource_group_name="existing-postgresql-resgroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this PostgreSQL Flexible Server. :param str resource_group_name: The name of the Resource Group where the PostgreSQL Flexible Server exists. diff --git a/sdk/python/pulumi_azure/postgresql/get_server.py b/sdk/python/pulumi_azure/postgresql/get_server.py index ae9dd436e7..e6744539d5 100644 --- a/sdk/python/pulumi_azure/postgresql/get_server.py +++ b/sdk/python/pulumi_azure/postgresql/get_server.py @@ -153,6 +153,17 @@ def get_server(name: Optional[str] = None, """ Use this data source to access information about an existing PostgreSQL Azure Database Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.postgresql.get_server(name="postgresql-server-1", + resource_group_name="api-rg-pro") + pulumi.export("postgresqlServerId", example.id) + ``` + :param str name: The name of the PostgreSQL Server. :param str resource_group_name: Specifies the name of the Resource Group where the PostgreSQL Server exists. @@ -183,6 +194,17 @@ def get_server_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing PostgreSQL Azure Database Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.postgresql.get_server(name="postgresql-server-1", + resource_group_name="api-rg-pro") + pulumi.export("postgresqlServerId", example.id) + ``` + :param str name: The name of the PostgreSQL Server. :param str resource_group_name: Specifies the name of the Resource Group where the PostgreSQL Server exists. diff --git a/sdk/python/pulumi_azure/postgresql/server.py b/sdk/python/pulumi_azure/postgresql/server.py index 3c89d2cbd3..aca46e9363 100644 --- a/sdk/python/pulumi_azure/postgresql/server.py +++ b/sdk/python/pulumi_azure/postgresql/server.py @@ -943,6 +943,29 @@ def __init__(__self__, """ Manages a PostgreSQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_4", + version="11", + storage_mb=640000, + backup_retention_days=7, + geo_redundant_backup_enabled=True, + auto_grow_enabled=True, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + ``` + ## Import PostgreSQL Server's can be imported using the `resource id`, e.g. @@ -990,6 +1013,29 @@ def __init__(__self__, """ Manages a PostgreSQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_4", + version="11", + storage_mb=640000, + backup_retention_days=7, + geo_redundant_backup_enabled=True, + auto_grow_enabled=True, + public_network_access_enabled=False, + ssl_enforcement_enabled=True, + ssl_minimal_tls_version_enforced="TLS1_2") + ``` + ## Import PostgreSQL Server's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/server_key.py b/sdk/python/pulumi_azure/postgresql/server_key.py index f2036851ff..9f801a4801 100644 --- a/sdk/python/pulumi_azure/postgresql/server_key.py +++ b/sdk/python/pulumi_azure/postgresql/server_key.py @@ -138,6 +138,84 @@ def __init__(__self__, """ Manages a Customer Managed Key for a PostgreSQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_2", + version="11", + storage_mb=51200, + ssl_enforcement_enabled=True, + identity=azure.postgresql.ServerIdentityArgs( + type="SystemAssigned", + )) + server = azure.keyvault.AccessPolicy("server", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_server.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ], + secret_permissions=["Get"]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + example_server_key = azure.postgresql.ServerKey("exampleServerKey", + server_id=example_server.id, + key_vault_key_id=example_key.id) + ``` + ## Import A PostgreSQL Server Key can be imported using the `resource id` of the PostgreSQL Server Key, e.g. @@ -160,6 +238,84 @@ def __init__(__self__, """ Manages a Customer Managed Key for a PostgreSQL Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + purge_protection_enabled=True) + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + sku_name="GP_Gen5_2", + version="11", + storage_mb=51200, + ssl_enforcement_enabled=True, + identity=azure.postgresql.ServerIdentityArgs( + type="SystemAssigned", + )) + server = azure.keyvault.AccessPolicy("server", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_server.identity.principal_id, + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ], + secret_permissions=["Get"]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + ], + secret_permissions=["Get"]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + server, + ])) + example_server_key = azure.postgresql.ServerKey("exampleServerKey", + server_id=example_server.id, + key_vault_key_id=example_key.id) + ``` + ## Import A PostgreSQL Server Key can be imported using the `resource id` of the PostgreSQL Server Key, e.g. diff --git a/sdk/python/pulumi_azure/postgresql/virtual_network_rule.py b/sdk/python/pulumi_azure/postgresql/virtual_network_rule.py index 86b6032c15..794151cc65 100644 --- a/sdk/python/pulumi_azure/postgresql/virtual_network_rule.py +++ b/sdk/python/pulumi_azure/postgresql/virtual_network_rule.py @@ -284,6 +284,39 @@ def __init__(__self__, > **NOTE:** PostgreSQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/postgresql/concepts-data-access-and-security-vnet) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="GP_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_virtual_network_rule = azure.postgresql.VirtualNetworkRule("exampleVirtualNetworkRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=internal.id, + ignore_missing_vnet_service_endpoint=True) + ``` + ## Import PostgreSQL Virtual Network Rules can be imported using the `resource id`, e.g. @@ -317,6 +350,39 @@ def __init__(__self__, > **NOTE:** PostgreSQL Virtual Network Rules [can only be used with SKU Tiers of `GeneralPurpose` or `MemoryOptimized`](https://docs.microsoft.com/azure/postgresql/concepts-data-access-and-security-vnet) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.7.29.0/29"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + example_server = azure.postgresql.Server("exampleServer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="GP_Gen5_2", + storage_mb=5120, + backup_retention_days=7, + administrator_login="psqladmin", + administrator_login_password="H@Sh1CoR3!", + version="9.5", + ssl_enforcement_enabled=True) + example_virtual_network_rule = azure.postgresql.VirtualNetworkRule("exampleVirtualNetworkRule", + resource_group_name=example_resource_group.name, + server_name=example_server.name, + subnet_id=internal.id, + ignore_missing_vnet_service_endpoint=True) + ``` + ## Import PostgreSQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/powerbi/embedded.py b/sdk/python/pulumi_azure/powerbi/embedded.py index 0d943f70d7..71b432be4e 100644 --- a/sdk/python/pulumi_azure/powerbi/embedded.py +++ b/sdk/python/pulumi_azure/powerbi/embedded.py @@ -324,6 +324,20 @@ def __init__(__self__, """ Manages a PowerBI Embedded. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_embedded = azure.powerbi.Embedded("exampleEmbedded", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="A1", + administrators=["azsdktest@microsoft.com"]) + ``` + ## Import PowerBI Embedded can be imported using the `resource id`, e.g. @@ -351,6 +365,20 @@ def __init__(__self__, """ Manages a PowerBI Embedded. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_embedded = azure.powerbi.Embedded("exampleEmbedded", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="A1", + administrators=["azsdktest@microsoft.com"]) + ``` + ## Import PowerBI Embedded can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/a_record.py b/sdk/python/pulumi_azure/privatedns/a_record.py index 81b4952fa2..f465a9744e 100644 --- a/sdk/python/pulumi_azure/privatedns/a_record.py +++ b/sdk/python/pulumi_azure/privatedns/a_record.py @@ -306,6 +306,21 @@ def __init__(__self__, """ Enables you to manage DNS A Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_a_record = azure.privatedns.ARecord("exampleARecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["10.0.180.17"]) + ``` + ## Import Private DNS A Records can be imported using the `resource id`, e.g. @@ -332,6 +347,21 @@ def __init__(__self__, """ Enables you to manage DNS A Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_a_record = azure.privatedns.ARecord("exampleARecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["10.0.180.17"]) + ``` + ## Import Private DNS A Records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/aaaa_record.py b/sdk/python/pulumi_azure/privatedns/aaaa_record.py index d47e999d7a..adb1071145 100644 --- a/sdk/python/pulumi_azure/privatedns/aaaa_record.py +++ b/sdk/python/pulumi_azure/privatedns/aaaa_record.py @@ -306,6 +306,24 @@ def __init__(__self__, """ Enables you to manage DNS AAAA Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test_zone = azure.privatedns.Zone("testZone", resource_group_name=example.name) + test_aaaa_record = azure.privatedns.AAAARecord("testAAAARecord", + zone_name=test_zone.name, + resource_group_name=example.name, + ttl=300, + records=[ + "fd5d:70bc:930e:d008:0000:0000:0000:7334", + "fd5d:70bc:930e:d008::7335", + ]) + ``` + ## Import Private DNS AAAA Records can be imported using the `resource id`, e.g. @@ -332,6 +350,24 @@ def __init__(__self__, """ Enables you to manage DNS AAAA Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + test_zone = azure.privatedns.Zone("testZone", resource_group_name=example.name) + test_aaaa_record = azure.privatedns.AAAARecord("testAAAARecord", + zone_name=test_zone.name, + resource_group_name=example.name, + ttl=300, + records=[ + "fd5d:70bc:930e:d008:0000:0000:0000:7334", + "fd5d:70bc:930e:d008::7335", + ]) + ``` + ## Import Private DNS AAAA Records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/cname_record.py b/sdk/python/pulumi_azure/privatedns/cname_record.py index 275db20d41..0091a830dc 100644 --- a/sdk/python/pulumi_azure/privatedns/cname_record.py +++ b/sdk/python/pulumi_azure/privatedns/cname_record.py @@ -306,6 +306,21 @@ def __init__(__self__, """ Enables you to manage DNS CNAME Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_cname_record = azure.privatedns.CnameRecord("exampleCnameRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + record="contoso.com") + ``` + ## Import Private DNS CName Records can be imported using the `resource id`, e.g. @@ -332,6 +347,21 @@ def __init__(__self__, """ Enables you to manage DNS CNAME Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_cname_record = azure.privatedns.CnameRecord("exampleCnameRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + record="contoso.com") + ``` + ## Import Private DNS CName Records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/get_a_record.py b/sdk/python/pulumi_azure/privatedns/get_a_record.py index 32404c03b0..dea881cc05 100644 --- a/sdk/python/pulumi_azure/privatedns/get_a_record.py +++ b/sdk/python/pulumi_azure/privatedns/get_a_record.py @@ -124,7 +124,18 @@ def get_a_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetARecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_a_record(name="test", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsARecordId", example.id) + ``` + :param str name: The name of the Private DNS A Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. @@ -154,7 +165,18 @@ def get_a_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetARecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_a_record(name="test", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsARecordId", example.id) + ``` + :param str name: The name of the Private DNS A Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_aaaa_record.py b/sdk/python/pulumi_azure/privatedns/get_aaaa_record.py index 05a2c30cf3..c815adb8d4 100644 --- a/sdk/python/pulumi_azure/privatedns/get_aaaa_record.py +++ b/sdk/python/pulumi_azure/privatedns/get_aaaa_record.py @@ -124,7 +124,18 @@ def get_aaaa_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAAAARecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.AAAARecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsAaaaRecordId", example.id) + ``` + :param str name: The name of the Private DNS AAAA Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. @@ -154,7 +165,18 @@ def get_aaaa_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetAAAARecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.AAAARecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsAaaaRecordId", example.id) + ``` + :param str name: The name of the Private DNS AAAA Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_cname_record.py b/sdk/python/pulumi_azure/privatedns/get_cname_record.py index 9a5d8a6617..a7806ab732 100644 --- a/sdk/python/pulumi_azure/privatedns/get_cname_record.py +++ b/sdk/python/pulumi_azure/privatedns/get_cname_record.py @@ -133,7 +133,18 @@ def get_cname_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCnameRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.CnameRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsCnameRecordId", example.id) + ``` + :param str name: The name of the Private DNS CNAME Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. @@ -164,7 +175,18 @@ def get_cname_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCnameRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.CnameRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsCnameRecordId", example.id) + ``` + :param str name: The name of the Private DNS CNAME Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_dns_zone.py b/sdk/python/pulumi_azure/privatedns/get_dns_zone.py index 501678188f..aca013ee97 100644 --- a/sdk/python/pulumi_azure/privatedns/get_dns_zone.py +++ b/sdk/python/pulumi_azure/privatedns/get_dns_zone.py @@ -129,6 +129,17 @@ def get_dns_zone(name: Optional[str] = None, """ Use this data source to access information about an existing Private DNS Zone. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_dns_zone(name="contoso.internal", + resource_group_name="contoso-dns") + pulumi.export("privateDnsZoneId", example.id) + ``` + :param str name: The name of the Private DNS Zone. :param str resource_group_name: The Name of the Resource Group where the Private DNS Zone exists. @@ -162,6 +173,17 @@ def get_dns_zone_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Private DNS Zone. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_dns_zone(name="contoso.internal", + resource_group_name="contoso-dns") + pulumi.export("privateDnsZoneId", example.id) + ``` + :param str name: The name of the Private DNS Zone. :param str resource_group_name: The Name of the Resource Group where the Private DNS Zone exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_mx_record.py b/sdk/python/pulumi_azure/privatedns/get_mx_record.py index 2f1dabcbe3..9b22ccd190 100644 --- a/sdk/python/pulumi_azure/privatedns/get_mx_record.py +++ b/sdk/python/pulumi_azure/privatedns/get_mx_record.py @@ -125,7 +125,18 @@ def get_mx_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetMxRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.MxRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsMxRecordId", example.id) + ``` + :param str name: The name of the Private DNS MX Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. @@ -155,7 +166,18 @@ def get_mx_record_output(name: Optional[pulumi.Input[Optional[str]]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetMxRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.MxRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsMxRecordId", example.id) + ``` + :param str name: The name of the Private DNS MX Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_ptr_record.py b/sdk/python/pulumi_azure/privatedns/get_ptr_record.py index 5b1057703d..978053883d 100644 --- a/sdk/python/pulumi_azure/privatedns/get_ptr_record.py +++ b/sdk/python/pulumi_azure/privatedns/get_ptr_record.py @@ -124,7 +124,18 @@ def get_ptr_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPtrRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.PTRRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsPtrRecordId", example.id) + ``` + :param str name: The name of the Private DNS PTR Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. @@ -154,7 +165,18 @@ def get_ptr_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetPtrRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.PTRRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsPtrRecordId", example.id) + ``` + :param str name: The name of the Private DNS PTR Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_resolver.py b/sdk/python/pulumi_azure/privatedns/get_resolver.py index 853152c2a8..615e80e98e 100644 --- a/sdk/python/pulumi_azure/privatedns/get_resolver.py +++ b/sdk/python/pulumi_azure/privatedns/get_resolver.py @@ -104,6 +104,16 @@ def get_resolver(name: Optional[str] = None, """ Gets information about an existing Private DNS Resolver. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.privatedns.get_resolver(name="example", + resource_group_name="example-resourcegroup-name") + ``` + :param str name: Name of the Private DNS Resolver. :param str resource_group_name: Name of the Resource Group where the Private DNS Resolver exists. @@ -130,6 +140,16 @@ def get_resolver_output(name: Optional[pulumi.Input[str]] = None, """ Gets information about an existing Private DNS Resolver. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test = azure.privatedns.get_resolver(name="example", + resource_group_name="example-resourcegroup-name") + ``` + :param str name: Name of the Private DNS Resolver. :param str resource_group_name: Name of the Resource Group where the Private DNS Resolver exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_resolver_dns_forwarding_ruleset.py b/sdk/python/pulumi_azure/privatedns/get_resolver_dns_forwarding_ruleset.py index 67218a54b7..43483b94fb 100644 --- a/sdk/python/pulumi_azure/privatedns/get_resolver_dns_forwarding_ruleset.py +++ b/sdk/python/pulumi_azure/privatedns/get_resolver_dns_forwarding_ruleset.py @@ -104,6 +104,16 @@ def get_resolver_dns_forwarding_ruleset(name: Optional[str] = None, """ Gets information about an existing Private DNS Resolver Dns Forwarding Ruleset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_dns_forwarding_ruleset(name="example-ruleset", + resource_group_name="example-ruleset-resourcegroup") + ``` + :param str name: Name of the existing Private DNS Resolver Dns Forwarding Ruleset. :param str resource_group_name: Name of the Resource Group where the Private DNS Resolver Dns Forwarding Ruleset exists. @@ -130,6 +140,16 @@ def get_resolver_dns_forwarding_ruleset_output(name: Optional[pulumi.Input[str]] """ Gets information about an existing Private DNS Resolver Dns Forwarding Ruleset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_dns_forwarding_ruleset(name="example-ruleset", + resource_group_name="example-ruleset-resourcegroup") + ``` + :param str name: Name of the existing Private DNS Resolver Dns Forwarding Ruleset. :param str resource_group_name: Name of the Resource Group where the Private DNS Resolver Dns Forwarding Ruleset exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_resolver_forwarding_rule.py b/sdk/python/pulumi_azure/privatedns/get_resolver_forwarding_rule.py index 9e6d6cfb2f..00b12d8c99 100644 --- a/sdk/python/pulumi_azure/privatedns/get_resolver_forwarding_rule.py +++ b/sdk/python/pulumi_azure/privatedns/get_resolver_forwarding_rule.py @@ -117,6 +117,16 @@ def get_resolver_forwarding_rule(dns_forwarding_ruleset_id: Optional[str] = None """ Gets information about an existing Private DNS Resolver Forwarding Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_forwarding_rule(dns_forwarding_ruleset_id="example-forwarding-rulset-id", + name="example-rule") + ``` + :param str dns_forwarding_ruleset_id: ID of the Private DNS Resolver Forwarding Ruleset. :param str name: Name of the Private DNS Resolver Forwarding Rule. @@ -144,6 +154,16 @@ def get_resolver_forwarding_rule_output(dns_forwarding_ruleset_id: Optional[pulu """ Gets information about an existing Private DNS Resolver Forwarding Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_forwarding_rule(dns_forwarding_ruleset_id="example-forwarding-rulset-id", + name="example-rule") + ``` + :param str dns_forwarding_ruleset_id: ID of the Private DNS Resolver Forwarding Ruleset. :param str name: Name of the Private DNS Resolver Forwarding Rule. diff --git a/sdk/python/pulumi_azure/privatedns/get_resolver_inbound_endpoint.py b/sdk/python/pulumi_azure/privatedns/get_resolver_inbound_endpoint.py index 4d920eca25..e4afdfda09 100644 --- a/sdk/python/pulumi_azure/privatedns/get_resolver_inbound_endpoint.py +++ b/sdk/python/pulumi_azure/privatedns/get_resolver_inbound_endpoint.py @@ -105,6 +105,16 @@ def get_resolver_inbound_endpoint(name: Optional[str] = None, """ Gets information about an existing Private DNS Resolver Inbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_inbound_endpoint(name="example-drie", + private_dns_resolver_id="example-private-dns-resolver-id") + ``` + :param str name: Name of the Private DNS Resolver Inbound Endpoint. :param str private_dns_resolver_id: ID of the Private DNS Resolver. @@ -131,6 +141,16 @@ def get_resolver_inbound_endpoint_output(name: Optional[pulumi.Input[str]] = Non """ Gets information about an existing Private DNS Resolver Inbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_inbound_endpoint(name="example-drie", + private_dns_resolver_id="example-private-dns-resolver-id") + ``` + :param str name: Name of the Private DNS Resolver Inbound Endpoint. :param str private_dns_resolver_id: ID of the Private DNS Resolver. diff --git a/sdk/python/pulumi_azure/privatedns/get_resolver_outbound_endpoint.py b/sdk/python/pulumi_azure/privatedns/get_resolver_outbound_endpoint.py index 13c31fc3f6..bfc53ec838 100644 --- a/sdk/python/pulumi_azure/privatedns/get_resolver_outbound_endpoint.py +++ b/sdk/python/pulumi_azure/privatedns/get_resolver_outbound_endpoint.py @@ -104,6 +104,16 @@ def get_resolver_outbound_endpoint(name: Optional[str] = None, """ Gets information about an existing Private DNS Resolver Outbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_outbound_endpoint(name="example-endpoint", + private_dns_resolver_id="example-private-dns-resolver-id") + ``` + :param str name: Name of the Private DNS Resolver Outbound Endpoint. :param str private_dns_resolver_id: ID of the Private DNS Resolver Outbound Endpoint. @@ -130,6 +140,16 @@ def get_resolver_outbound_endpoint_output(name: Optional[pulumi.Input[str]] = No """ Gets information about an existing Private DNS Resolver Outbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_outbound_endpoint(name="example-endpoint", + private_dns_resolver_id="example-private-dns-resolver-id") + ``` + :param str name: Name of the Private DNS Resolver Outbound Endpoint. :param str private_dns_resolver_id: ID of the Private DNS Resolver Outbound Endpoint. diff --git a/sdk/python/pulumi_azure/privatedns/get_resolver_virtual_network_link.py b/sdk/python/pulumi_azure/privatedns/get_resolver_virtual_network_link.py index e52c38c2fe..e2c64309c9 100644 --- a/sdk/python/pulumi_azure/privatedns/get_resolver_virtual_network_link.py +++ b/sdk/python/pulumi_azure/privatedns/get_resolver_virtual_network_link.py @@ -92,6 +92,16 @@ def get_resolver_virtual_network_link(dns_forwarding_ruleset_id: Optional[str] = """ Gets information about an existing Private DNS Resolver Virtual Network Link. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_virtual_network_link(dns_forwarding_ruleset_id="example-dns-forwarding-ruleset-id", + name="example-link") + ``` + :param str dns_forwarding_ruleset_id: ID of the Private DNS Resolver DNS Forwarding Ruleset. :param str name: Name of the Private DNS Resolver Virtual Network Link. @@ -117,6 +127,16 @@ def get_resolver_virtual_network_link_output(dns_forwarding_ruleset_id: Optional """ Gets information about an existing Private DNS Resolver Virtual Network Link. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_resolver_virtual_network_link(dns_forwarding_ruleset_id="example-dns-forwarding-ruleset-id", + name="example-link") + ``` + :param str dns_forwarding_ruleset_id: ID of the Private DNS Resolver DNS Forwarding Ruleset. :param str name: Name of the Private DNS Resolver Virtual Network Link. diff --git a/sdk/python/pulumi_azure/privatedns/get_srv_record.py b/sdk/python/pulumi_azure/privatedns/get_srv_record.py index 15ee25172e..9e76fe1c91 100644 --- a/sdk/python/pulumi_azure/privatedns/get_srv_record.py +++ b/sdk/python/pulumi_azure/privatedns/get_srv_record.py @@ -125,7 +125,18 @@ def get_srv_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSrvRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.SRVRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsSrvRecordId", example.id) + ``` + :param str name: The name of the Private DNS SRV Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. @@ -155,7 +166,18 @@ def get_srv_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetSrvRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.SRVRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsSrvRecordId", example.id) + ``` + :param str name: The name of the Private DNS SRV Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_txt_record.py b/sdk/python/pulumi_azure/privatedns/get_txt_record.py index da112e5d69..e81dd1a776 100644 --- a/sdk/python/pulumi_azure/privatedns/get_txt_record.py +++ b/sdk/python/pulumi_azure/privatedns/get_txt_record.py @@ -125,7 +125,18 @@ def get_txt_record(name: Optional[str] = None, zone_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTxtRecordResult: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.TxtRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsTxtRecordId", example.id) + ``` + :param str name: The name of the Private DNS TXT Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. @@ -155,7 +166,18 @@ def get_txt_record_output(name: Optional[pulumi.Input[str]] = None, zone_name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetTxtRecordResult]: """ - Use this data source to access information about an existing resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.TxtRecord("example", + zone_name="test-zone", + resource_group_name="test-rg") + pulumi.export("privateDnsTxtRecordId", example.id) + ``` + :param str name: The name of the Private DNS TXT Record. :param str resource_group_name: Specifies the resource group where the Private DNS Zone (parent resource) exists. diff --git a/sdk/python/pulumi_azure/privatedns/get_zone_virtual_network_link.py b/sdk/python/pulumi_azure/privatedns/get_zone_virtual_network_link.py index 9857f9ba36..f9871e143f 100644 --- a/sdk/python/pulumi_azure/privatedns/get_zone_virtual_network_link.py +++ b/sdk/python/pulumi_azure/privatedns/get_zone_virtual_network_link.py @@ -114,6 +114,18 @@ def get_zone_virtual_network_link(name: Optional[str] = None, """ Use this data source to access information about an existing Private DNS zone Virtual Network Link. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_zone_virtual_network_link(name="test", + resource_group_name="test-rg", + private_dns_zone_name="test-zone") + pulumi.export("privateDnsARecordId", example.id) + ``` + :param str name: The name of the Private DNS Zone Virtual Network Link. :param str private_dns_zone_name: The name of the Private DNS zone (without a terminating dot). @@ -144,6 +156,18 @@ def get_zone_virtual_network_link_output(name: Optional[pulumi.Input[str]] = Non """ Use this data source to access information about an existing Private DNS zone Virtual Network Link. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatedns.get_zone_virtual_network_link(name="test", + resource_group_name="test-rg", + private_dns_zone_name="test-zone") + pulumi.export("privateDnsARecordId", example.id) + ``` + :param str name: The name of the Private DNS Zone Virtual Network Link. :param str private_dns_zone_name: The name of the Private DNS zone (without a terminating dot). diff --git a/sdk/python/pulumi_azure/privatedns/link_service.py b/sdk/python/pulumi_azure/privatedns/link_service.py index fd1985ac1e..13bb3e39a7 100644 --- a/sdk/python/pulumi_azure/privatedns/link_service.py +++ b/sdk/python/pulumi_azure/privatedns/link_service.py @@ -481,6 +481,59 @@ def __init__(__self__, > **NOTE** Private Link is now in [GA](https://docs.microsoft.com/en-gb/azure/private-link/). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"], + enforce_private_link_service_network_policies=True) + example_public_ip = azure.network.PublicIp("examplePublicIp", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name=example_public_ip.name, + public_ip_address_id=example_public_ip.id, + )]) + example_link_service = azure.privatedns.LinkService("exampleLinkService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + auto_approval_subscription_ids=["00000000-0000-0000-0000-000000000000"], + visibility_subscription_ids=["00000000-0000-0000-0000-000000000000"], + load_balancer_frontend_ip_configuration_ids=[example_load_balancer.frontend_ip_configurations[0].id], + nat_ip_configurations=[ + azure.privatedns.LinkServiceNatIpConfigurationArgs( + name="primary", + private_ip_address="10.5.1.17", + private_ip_address_version="IPv4", + subnet_id=example_subnet.id, + primary=True, + ), + azure.privatedns.LinkServiceNatIpConfigurationArgs( + name="secondary", + private_ip_address="10.5.1.18", + private_ip_address_version="IPv4", + subnet_id=example_subnet.id, + primary=False, + ), + ]) + ``` + ## Import Private Link Services can be imported using the `resource id`, e.g. @@ -515,6 +568,59 @@ def __init__(__self__, > **NOTE** Private Link is now in [GA](https://docs.microsoft.com/en-gb/azure/private-link/). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"], + enforce_private_link_service_network_policies=True) + example_public_ip = azure.network.PublicIp("examplePublicIp", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name=example_public_ip.name, + public_ip_address_id=example_public_ip.id, + )]) + example_link_service = azure.privatedns.LinkService("exampleLinkService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + auto_approval_subscription_ids=["00000000-0000-0000-0000-000000000000"], + visibility_subscription_ids=["00000000-0000-0000-0000-000000000000"], + load_balancer_frontend_ip_configuration_ids=[example_load_balancer.frontend_ip_configurations[0].id], + nat_ip_configurations=[ + azure.privatedns.LinkServiceNatIpConfigurationArgs( + name="primary", + private_ip_address="10.5.1.17", + private_ip_address_version="IPv4", + subnet_id=example_subnet.id, + primary=True, + ), + azure.privatedns.LinkServiceNatIpConfigurationArgs( + name="secondary", + private_ip_address="10.5.1.18", + private_ip_address_version="IPv4", + subnet_id=example_subnet.id, + primary=False, + ), + ]) + ``` + ## Import Private Link Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/mx_record.py b/sdk/python/pulumi_azure/privatedns/mx_record.py index 1a0535d3db..7520fcc767 100644 --- a/sdk/python/pulumi_azure/privatedns/mx_record.py +++ b/sdk/python/pulumi_azure/privatedns/mx_record.py @@ -308,6 +308,33 @@ def __init__(__self__, """ Enables you to manage DNS MX Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_mx_record = azure.privatedns.MxRecord("exampleMxRecord", + resource_group_name=example_resource_group.name, + zone_name=example_zone.name, + ttl=300, + records=[ + azure.privatedns.MxRecordRecordArgs( + preference=10, + exchange="mx1.contoso.com", + ), + azure.privatedns.MxRecordRecordArgs( + preference=20, + exchange="backupmx.contoso.com", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import Private DNS MX Records can be imported using the `resource id`, e.g. @@ -334,6 +361,33 @@ def __init__(__self__, """ Enables you to manage DNS MX Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_mx_record = azure.privatedns.MxRecord("exampleMxRecord", + resource_group_name=example_resource_group.name, + zone_name=example_zone.name, + ttl=300, + records=[ + azure.privatedns.MxRecordRecordArgs( + preference=10, + exchange="mx1.contoso.com", + ), + azure.privatedns.MxRecordRecordArgs( + preference=20, + exchange="backupmx.contoso.com", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import Private DNS MX Records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/ptr_record.py b/sdk/python/pulumi_azure/privatedns/ptr_record.py index c15dbb7be0..b1c4816458 100644 --- a/sdk/python/pulumi_azure/privatedns/ptr_record.py +++ b/sdk/python/pulumi_azure/privatedns/ptr_record.py @@ -306,6 +306,21 @@ def __init__(__self__, """ Enables you to manage DNS PTR Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_ptr_record = azure.privatedns.PTRRecord("examplePTRRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["test.example.com"]) + ``` + ## Import Private DNS PTR Records can be imported using the `resource id`, e.g. @@ -332,6 +347,21 @@ def __init__(__self__, """ Enables you to manage DNS PTR Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_ptr_record = azure.privatedns.PTRRecord("examplePTRRecord", + zone_name=example_zone.name, + resource_group_name=example_resource_group.name, + ttl=300, + records=["test.example.com"]) + ``` + ## Import Private DNS PTR Records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/resolver.py b/sdk/python/pulumi_azure/privatedns/resolver.py index 0f7e69cb64..78fce193e3 100644 --- a/sdk/python/pulumi_azure/privatedns/resolver.py +++ b/sdk/python/pulumi_azure/privatedns/resolver.py @@ -249,6 +249,23 @@ def __init__(__self__, """ Manages a Private DNS Resolver. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + test = azure.privatedns.Resolver("test", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + ``` + ## Import DNS Resolver can be imported using the `resource id`, e.g. @@ -274,6 +291,23 @@ def __init__(__self__, """ Manages a Private DNS Resolver. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + test = azure.privatedns.Resolver("test", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + ``` + ## Import DNS Resolver can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/resolver_dns_forwarding_ruleset.py b/sdk/python/pulumi_azure/privatedns/resolver_dns_forwarding_ruleset.py index eecd9879a5..9a3e710468 100644 --- a/sdk/python/pulumi_azure/privatedns/resolver_dns_forwarding_ruleset.py +++ b/sdk/python/pulumi_azure/privatedns/resolver_dns_forwarding_ruleset.py @@ -249,6 +249,48 @@ def __init__(__self__, """ Manages a Private DNS Resolver Dns Forwarding Ruleset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + example_resolver_dns_forwarding_ruleset = azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + private_dns_resolver_outbound_endpoint_ids=[example_resolver_outbound_endpoint.id], + tags={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Dns Forwarding Ruleset can be imported using the `resource id`, e.g. @@ -274,6 +316,48 @@ def __init__(__self__, """ Manages a Private DNS Resolver Dns Forwarding Ruleset. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + example_resolver_dns_forwarding_ruleset = azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + private_dns_resolver_outbound_endpoint_ids=[example_resolver_outbound_endpoint.id], + tags={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Dns Forwarding Ruleset can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/resolver_forwarding_rule.py b/sdk/python/pulumi_azure/privatedns/resolver_forwarding_rule.py index 691165d3c0..10c6bb4214 100644 --- a/sdk/python/pulumi_azure/privatedns/resolver_forwarding_rule.py +++ b/sdk/python/pulumi_azure/privatedns/resolver_forwarding_rule.py @@ -293,6 +293,56 @@ def __init__(__self__, """ Manages a Private DNS Resolver Forwarding Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + example_resolver_dns_forwarding_ruleset = azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + private_dns_resolver_outbound_endpoint_ids=[example_resolver_outbound_endpoint.id]) + example_resolver_forwarding_rule = azure.privatedns.ResolverForwardingRule("exampleResolverForwardingRule", + dns_forwarding_ruleset_id=example_resolver_dns_forwarding_ruleset.id, + domain_name="onprem.local.", + enabled=True, + target_dns_servers=[azure.privatedns.ResolverForwardingRuleTargetDnsServerArgs( + ip_address="10.10.0.1", + port=53, + )], + metadata={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Forwarding Rules can be imported using the `resource id`, e.g. @@ -319,6 +369,56 @@ def __init__(__self__, """ Manages a Private DNS Resolver Forwarding Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + example_resolver_dns_forwarding_ruleset = azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + private_dns_resolver_outbound_endpoint_ids=[example_resolver_outbound_endpoint.id]) + example_resolver_forwarding_rule = azure.privatedns.ResolverForwardingRule("exampleResolverForwardingRule", + dns_forwarding_ruleset_id=example_resolver_dns_forwarding_ruleset.id, + domain_name="onprem.local.", + enabled=True, + target_dns_servers=[azure.privatedns.ResolverForwardingRuleTargetDnsServerArgs( + ip_address="10.10.0.1", + port=53, + )], + metadata={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Forwarding Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/resolver_inbound_endpoint.py b/sdk/python/pulumi_azure/privatedns/resolver_inbound_endpoint.py index d2e903d7d3..94bfafacd3 100644 --- a/sdk/python/pulumi_azure/privatedns/resolver_inbound_endpoint.py +++ b/sdk/python/pulumi_azure/privatedns/resolver_inbound_endpoint.py @@ -251,6 +251,44 @@ def __init__(__self__, """ Manages a Private DNS Resolver Inbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver_inbound_endpoint = azure.privatedns.ResolverInboundEndpoint("exampleResolverInboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + ip_configurations=[azure.privatedns.ResolverInboundEndpointIpConfigurationArgs( + private_ip_allocation_method="Dynamic", + subnet_id=example_subnet.id, + )], + tags={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Inbound Endpoint can be imported using the `resource id`, e.g. @@ -276,6 +314,44 @@ def __init__(__self__, """ Manages a Private DNS Resolver Inbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver_inbound_endpoint = azure.privatedns.ResolverInboundEndpoint("exampleResolverInboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + ip_configurations=[azure.privatedns.ResolverInboundEndpointIpConfigurationArgs( + private_ip_allocation_method="Dynamic", + subnet_id=example_subnet.id, + )], + tags={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Inbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/resolver_outbound_endpoint.py b/sdk/python/pulumi_azure/privatedns/resolver_outbound_endpoint.py index edf99cf91a..ae25999205 100644 --- a/sdk/python/pulumi_azure/privatedns/resolver_outbound_endpoint.py +++ b/sdk/python/pulumi_azure/privatedns/resolver_outbound_endpoint.py @@ -249,6 +249,41 @@ def __init__(__self__, """ Manages a Private DNS Resolver Outbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Outbound Endpoint can be imported using the `resource id`, e.g. @@ -274,6 +309,41 @@ def __init__(__self__, """ Manages a Private DNS Resolver Outbound Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Outbound Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/resolver_virtual_network_link.py b/sdk/python/pulumi_azure/privatedns/resolver_virtual_network_link.py index 6ddf388b26..422f0567dd 100644 --- a/sdk/python/pulumi_azure/privatedns/resolver_virtual_network_link.py +++ b/sdk/python/pulumi_azure/privatedns/resolver_virtual_network_link.py @@ -212,6 +212,54 @@ def __init__(__self__, """ Manages a Private DNS Resolver Virtual Network Link. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + example_resolver_dns_forwarding_ruleset = azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + private_dns_resolver_outbound_endpoint_ids=[example_resolver_outbound_endpoint.id], + tags={ + "key": "value", + }) + example_resolver_virtual_network_link = azure.privatedns.ResolverVirtualNetworkLink("exampleResolverVirtualNetworkLink", + dns_forwarding_ruleset_id=example_resolver_dns_forwarding_ruleset.id, + virtual_network_id=example_virtual_network.id, + metadata={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Virtual Network Link can be imported using the `resource id`, e.g. @@ -236,6 +284,54 @@ def __init__(__self__, """ Manages a Private DNS Resolver Virtual Network Link. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.64/28"], + delegations=[azure.network.SubnetDelegationArgs( + name="Microsoft.Network.dnsResolvers", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + actions=["Microsoft.Network/virtualNetworks/subnets/join/action"], + name="Microsoft.Network/dnsResolvers", + ), + )]) + example_resolver = azure.privatedns.Resolver("exampleResolver", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + virtual_network_id=example_virtual_network.id) + example_resolver_outbound_endpoint = azure.privatedns.ResolverOutboundEndpoint("exampleResolverOutboundEndpoint", + private_dns_resolver_id=example_resolver.id, + location=example_resolver.location, + subnet_id=example_subnet.id, + tags={ + "key": "value", + }) + example_resolver_dns_forwarding_ruleset = azure.privatedns.ResolverDnsForwardingRuleset("exampleResolverDnsForwardingRuleset", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + private_dns_resolver_outbound_endpoint_ids=[example_resolver_outbound_endpoint.id], + tags={ + "key": "value", + }) + example_resolver_virtual_network_link = azure.privatedns.ResolverVirtualNetworkLink("exampleResolverVirtualNetworkLink", + dns_forwarding_ruleset_id=example_resolver_dns_forwarding_ruleset.id, + virtual_network_id=example_virtual_network.id, + metadata={ + "key": "value", + }) + ``` + ## Import Private DNS Resolver Virtual Network Link can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/srv_record.py b/sdk/python/pulumi_azure/privatedns/srv_record.py index 2b066a3d28..c8f843758a 100644 --- a/sdk/python/pulumi_azure/privatedns/srv_record.py +++ b/sdk/python/pulumi_azure/privatedns/srv_record.py @@ -308,6 +308,37 @@ def __init__(__self__, """ Enables you to manage DNS SRV Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_srv_record = azure.privatedns.SRVRecord("exampleSRVRecord", + resource_group_name=example_resource_group.name, + zone_name=example_zone.name, + ttl=300, + records=[ + azure.privatedns.SRVRecordRecordArgs( + priority=1, + weight=5, + port=8080, + target="target1.contoso.com", + ), + azure.privatedns.SRVRecordRecordArgs( + priority=10, + weight=10, + port=8080, + target="target2.contoso.com", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import Private DNS SRV Records can be imported using the `resource id`, e.g. @@ -334,6 +365,37 @@ def __init__(__self__, """ Enables you to manage DNS SRV Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_srv_record = azure.privatedns.SRVRecord("exampleSRVRecord", + resource_group_name=example_resource_group.name, + zone_name=example_zone.name, + ttl=300, + records=[ + azure.privatedns.SRVRecordRecordArgs( + priority=1, + weight=5, + port=8080, + target="target1.contoso.com", + ), + azure.privatedns.SRVRecordRecordArgs( + priority=10, + weight=10, + port=8080, + target="target2.contoso.com", + ), + ], + tags={ + "Environment": "Production", + }) + ``` + ## Import Private DNS SRV Records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/txt_record.py b/sdk/python/pulumi_azure/privatedns/txt_record.py index d7e6f7f33c..c7ec288d3f 100644 --- a/sdk/python/pulumi_azure/privatedns/txt_record.py +++ b/sdk/python/pulumi_azure/privatedns/txt_record.py @@ -308,6 +308,23 @@ def __init__(__self__, """ Enables you to manage DNS TXT Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_txt_record = azure.privatedns.TxtRecord("exampleTxtRecord", + resource_group_name=example_resource_group.name, + zone_name=example_zone.name, + ttl=300, + records=[azure.privatedns.TxtRecordRecordArgs( + value="v=spf1 mx ~all", + )]) + ``` + ## Import Private DNS TXT Records can be imported using the `resource id`, e.g. @@ -334,6 +351,23 @@ def __init__(__self__, """ Enables you to manage DNS TXT Records within Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_txt_record = azure.privatedns.TxtRecord("exampleTxtRecord", + resource_group_name=example_resource_group.name, + zone_name=example_zone.name, + ttl=300, + records=[azure.privatedns.TxtRecordRecordArgs( + value="v=spf1 mx ~all", + )]) + ``` + ## Import Private DNS TXT Records can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/zone.py b/sdk/python/pulumi_azure/privatedns/zone.py index c8528b0a5f..ae54c08e7b 100644 --- a/sdk/python/pulumi_azure/privatedns/zone.py +++ b/sdk/python/pulumi_azure/privatedns/zone.py @@ -301,6 +301,16 @@ def __init__(__self__, """ Enables you to manage Private DNS zones within Azure DNS. These zones are hosted on Azure's name servers. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + ``` + ## Import Private DNS Zones can be imported using the `resource id`, e.g. @@ -327,6 +337,16 @@ def __init__(__self__, """ Enables you to manage Private DNS zones within Azure DNS. These zones are hosted on Azure's name servers. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + ``` + ## Import Private DNS Zones can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatedns/zone_virtual_network_link.py b/sdk/python/pulumi_azure/privatedns/zone_virtual_network_link.py index fa509181c3..85ac71e434 100644 --- a/sdk/python/pulumi_azure/privatedns/zone_virtual_network_link.py +++ b/sdk/python/pulumi_azure/privatedns/zone_virtual_network_link.py @@ -295,6 +295,24 @@ def __init__(__self__, """ Enables you to manage Private DNS zone Virtual Network Links. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_zone_virtual_network_link = azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", + resource_group_name=example_resource_group.name, + private_dns_zone_name=example_zone.name, + virtual_network_id=example_virtual_network.id) + ``` + ## Import Private DNS Zone Virtual Network Links can be imported using the `resource id`, e.g. @@ -321,6 +339,24 @@ def __init__(__self__, """ Enables you to manage Private DNS zone Virtual Network Links. These Links enable DNS resolution and registration inside Azure Virtual Networks using Azure Private DNS. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_zone = azure.privatedns.Zone("exampleZone", resource_group_name=example_resource_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_zone_virtual_network_link = azure.privatedns.ZoneVirtualNetworkLink("exampleZoneVirtualNetworkLink", + resource_group_name=example_resource_group.name, + private_dns_zone_name=example_zone.name, + virtual_network_id=example_virtual_network.id) + ``` + ## Import Private DNS Zone Virtual Network Links can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatelink/application_security_group_association.py b/sdk/python/pulumi_azure/privatelink/application_security_group_association.py index 8ba66f6b8a..003ad1e715 100644 --- a/sdk/python/pulumi_azure/privatelink/application_security_group_association.py +++ b/sdk/python/pulumi_azure/privatelink/application_security_group_association.py @@ -138,6 +138,69 @@ def __init__(__self__, """ Manages an association between Private Endpoint and Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + service = azure.network.Subnet("service", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"], + enforce_private_link_service_network_policies=True) + endpoint = azure.network.Subnet("endpoint", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.2.0/24"], + enforce_private_link_endpoint_network_policies=True) + example_public_ip = azure.network.PublicIp("examplePublicIp", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name=example_public_ip.name, + public_ip_address_id=example_public_ip.id, + )]) + example_link_service = azure.privatedns.LinkService("exampleLinkService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + auto_approval_subscription_ids=[current.subscription_id], + visibility_subscription_ids=[current.subscription_id], + nat_ip_configurations=[azure.privatedns.LinkServiceNatIpConfigurationArgs( + name="primaryIpConfiguration", + primary=True, + subnet_id=service.id, + )], + load_balancer_frontend_ip_configuration_ids=[example_load_balancer.frontend_ip_configurations[0].id]) + example_endpoint = azure.privatelink.Endpoint("exampleEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=endpoint.id, + private_service_connection=azure.privatelink.EndpointPrivateServiceConnectionArgs( + name=example_link_service.name, + is_manual_connection=False, + private_connection_resource_id=example_link_service.id, + )) + example_application_security_group = azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_application_security_group_association = azure.privatelink.ApplicationSecurityGroupAssociation("exampleApplicationSecurityGroupAssociation", + private_endpoint_id=example_endpoint.id, + application_security_group_id=example_application_security_group.id) + ``` + ## Import Associations between Private Endpoint and Application Security Group can be imported using the `resource id`, e.g. @@ -160,6 +223,69 @@ def __init__(__self__, """ Manages an association between Private Endpoint and Application Security Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_subscription() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + service = azure.network.Subnet("service", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.1.0/24"], + enforce_private_link_service_network_policies=True) + endpoint = azure.network.Subnet("endpoint", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.2.0/24"], + enforce_private_link_endpoint_network_policies=True) + example_public_ip = azure.network.PublicIp("examplePublicIp", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + allocation_method="Static") + example_load_balancer = azure.lb.LoadBalancer("exampleLoadBalancer", + sku="Standard", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + frontend_ip_configurations=[azure.lb.LoadBalancerFrontendIpConfigurationArgs( + name=example_public_ip.name, + public_ip_address_id=example_public_ip.id, + )]) + example_link_service = azure.privatedns.LinkService("exampleLinkService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + auto_approval_subscription_ids=[current.subscription_id], + visibility_subscription_ids=[current.subscription_id], + nat_ip_configurations=[azure.privatedns.LinkServiceNatIpConfigurationArgs( + name="primaryIpConfiguration", + primary=True, + subnet_id=service.id, + )], + load_balancer_frontend_ip_configuration_ids=[example_load_balancer.frontend_ip_configurations[0].id]) + example_endpoint = azure.privatelink.Endpoint("exampleEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=endpoint.id, + private_service_connection=azure.privatelink.EndpointPrivateServiceConnectionArgs( + name=example_link_service.name, + is_manual_connection=False, + private_connection_resource_id=example_link_service.id, + )) + example_application_security_group = azure.network.ApplicationSecurityGroup("exampleApplicationSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_application_security_group_association = azure.privatelink.ApplicationSecurityGroupAssociation("exampleApplicationSecurityGroupAssociation", + private_endpoint_id=example_endpoint.id, + application_security_group_id=example_application_security_group.id) + ``` + ## Import Associations between Private Endpoint and Application Security Group can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/privatelink/get_endpoint_connection.py b/sdk/python/pulumi_azure/privatelink/get_endpoint_connection.py index 65ef66ea46..12e4cb0140 100644 --- a/sdk/python/pulumi_azure/privatelink/get_endpoint_connection.py +++ b/sdk/python/pulumi_azure/privatelink/get_endpoint_connection.py @@ -102,6 +102,17 @@ def get_endpoint_connection(name: Optional[str] = None, """ Use this data source to access the connection status information about an existing Private Endpoint Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatelink.get_endpoint_connection(name="example-private-endpoint", + resource_group_name="example-rg") + pulumi.export("privateEndpointStatus", example.private_service_connections[0].status) + ``` + :param str name: Specifies the Name of the private endpoint. :param str resource_group_name: Specifies the Name of the Resource Group within which the private endpoint exists. @@ -128,6 +139,17 @@ def get_endpoint_connection_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access the connection status information about an existing Private Endpoint Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatelink.get_endpoint_connection(name="example-private-endpoint", + resource_group_name="example-rg") + pulumi.export("privateEndpointStatus", example.private_service_connections[0].status) + ``` + :param str name: Specifies the Name of the private endpoint. :param str resource_group_name: Specifies the Name of the Resource Group within which the private endpoint exists. diff --git a/sdk/python/pulumi_azure/privatelink/get_service.py b/sdk/python/pulumi_azure/privatelink/get_service.py index 757ec60832..0b11457581 100644 --- a/sdk/python/pulumi_azure/privatelink/get_service.py +++ b/sdk/python/pulumi_azure/privatelink/get_service.py @@ -168,6 +168,17 @@ def get_service(name: Optional[str] = None, """ Use this data source to access information about an existing Private Link Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatelink.get_service(name="myPrivateLinkService", + resource_group_name="PrivateLinkServiceRG") + pulumi.export("privateLinkServiceId", example.id) + ``` + :param str name: The name of the private link service. :param str resource_group_name: The name of the resource group in which the private link service resides. @@ -199,6 +210,17 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Private Link Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatelink.get_service(name="myPrivateLinkService", + resource_group_name="PrivateLinkServiceRG") + pulumi.export("privateLinkServiceId", example.id) + ``` + :param str name: The name of the private link service. :param str resource_group_name: The name of the resource group in which the private link service resides. diff --git a/sdk/python/pulumi_azure/privatelink/get_service_endpoint_connections.py b/sdk/python/pulumi_azure/privatelink/get_service_endpoint_connections.py index a060acab4f..b2e5d0c582 100644 --- a/sdk/python/pulumi_azure/privatelink/get_service_endpoint_connections.py +++ b/sdk/python/pulumi_azure/privatelink/get_service_endpoint_connections.py @@ -99,6 +99,17 @@ def get_service_endpoint_connections(resource_group_name: Optional[str] = None, """ Use this data source to access endpoint connection information about an existing Private Link Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatelink.get_service_endpoint_connections(service_id=azurerm_private_link_service["example"]["id"], + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("privateEndpointStatus", example.private_endpoint_connections[0].status) + ``` + :param str resource_group_name: The name of the resource group in which the private link service resides. :param str service_id: The resource ID of the private link service. @@ -125,6 +136,17 @@ def get_service_endpoint_connections_output(resource_group_name: Optional[pulumi """ Use this data source to access endpoint connection information about an existing Private Link Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.privatelink.get_service_endpoint_connections(service_id=azurerm_private_link_service["example"]["id"], + resource_group_name=azurerm_resource_group["example"]["name"]) + pulumi.export("privateEndpointStatus", example.private_endpoint_connections[0].status) + ``` + :param str resource_group_name: The name of the resource group in which the private link service resides. :param str service_id: The resource ID of the private link service. diff --git a/sdk/python/pulumi_azure/proximity/get_placement_group.py b/sdk/python/pulumi_azure/proximity/get_placement_group.py index 5edde122be..1d232548f4 100644 --- a/sdk/python/pulumi_azure/proximity/get_placement_group.py +++ b/sdk/python/pulumi_azure/proximity/get_placement_group.py @@ -86,6 +86,17 @@ def get_placement_group(name: Optional[str] = None, """ Use this data source to access information about an existing Proximity Placement Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.proximity.get_placement_group(name="tf-appsecuritygroup", + resource_group_name="my-resource-group") + pulumi.export("proximityPlacementGroupId", example.id) + ``` + :param str name: The name of the Proximity Placement Group. :param str resource_group_name: The name of the resource group in which the Proximity Placement Group exists. @@ -111,6 +122,17 @@ def get_placement_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Proximity Placement Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.proximity.get_placement_group(name="tf-appsecuritygroup", + resource_group_name="my-resource-group") + pulumi.export("proximityPlacementGroupId", example.id) + ``` + :param str name: The name of the Proximity Placement Group. :param str resource_group_name: The name of the resource group in which the Proximity Placement Group exists. diff --git a/sdk/python/pulumi_azure/proximity/placement_group.py b/sdk/python/pulumi_azure/proximity/placement_group.py index b92246de61..429f855551 100644 --- a/sdk/python/pulumi_azure/proximity/placement_group.py +++ b/sdk/python/pulumi_azure/proximity/placement_group.py @@ -301,6 +301,21 @@ def __init__(__self__, """ Manages a proximity placement group for virtual machines, virtual machine scale sets and availability sets. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_placement_group = azure.proximity.PlacementGroup("examplePlacementGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import Proximity Placement Groups can be imported using the `resource id`, e.g. @@ -331,6 +346,21 @@ def __init__(__self__, """ Manages a proximity placement group for virtual machines, virtual machine scale sets and availability sets. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_placement_group = azure.proximity.PlacementGroup("examplePlacementGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tags={ + "environment": "Production", + }) + ``` + ## Import Proximity Placement Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/purview/account.py b/sdk/python/pulumi_azure/purview/account.py index a7bc160c67..f7f0e08c48 100644 --- a/sdk/python/pulumi_azure/purview/account.py +++ b/sdk/python/pulumi_azure/purview/account.py @@ -457,6 +457,21 @@ def __init__(__self__, """ Manages a Purview Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.purview.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.purview.AccountIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Purview Accounts can be imported using the `resource id`, e.g. @@ -486,6 +501,21 @@ def __init__(__self__, """ Manages a Purview Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.purview.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + identity=azure.purview.AccountIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Purview Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/recoveryservices/get_vault.py b/sdk/python/pulumi_azure/recoveryservices/get_vault.py index 74205c4635..921de3fc61 100644 --- a/sdk/python/pulumi_azure/recoveryservices/get_vault.py +++ b/sdk/python/pulumi_azure/recoveryservices/get_vault.py @@ -104,6 +104,16 @@ def get_vault(name: Optional[str] = None, """ Use this data source to access information about an existing Recovery Services Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + vault = azure.recoveryservices.get_vault(name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the Recovery Services Vault. :param str resource_group_name: The name of the resource group in which the Recovery Services Vault resides. @@ -130,6 +140,16 @@ def get_vault_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Recovery Services Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + vault = azure.recoveryservices.get_vault(name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the Recovery Services Vault. :param str resource_group_name: The name of the resource group in which the Recovery Services Vault resides. diff --git a/sdk/python/pulumi_azure/recoveryservices/vault.py b/sdk/python/pulumi_azure/recoveryservices/vault.py index dde9600e68..e4d1266d19 100644 --- a/sdk/python/pulumi_azure/recoveryservices/vault.py +++ b/sdk/python/pulumi_azure/recoveryservices/vault.py @@ -616,6 +616,20 @@ def __init__(__self__, """ Manages a Recovery Services Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard", + soft_delete_enabled=True) + ``` + ## Import Recovery Services Vaults can be imported using the `resource id`, e.g. @@ -654,6 +668,20 @@ def __init__(__self__, """ Manages a Recovery Services Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard", + soft_delete_enabled=True) + ``` + ## Import Recovery Services Vaults can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/recoveryservices/vault_resource_guard_association.py b/sdk/python/pulumi_azure/recoveryservices/vault_resource_guard_association.py index 830c64cd65..bfd8f50943 100644 --- a/sdk/python/pulumi_azure/recoveryservices/vault_resource_guard_association.py +++ b/sdk/python/pulumi_azure/recoveryservices/vault_resource_guard_association.py @@ -195,6 +195,26 @@ def __init__(__self__, """ Manages an association of a Resource Guard and Recovery Services Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_guard = azure.dataprotection.ResourceGuard("exampleResourceGuard", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + vault = azure.recoveryservices.Vault("vault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + soft_delete_enabled=True) + test = azure.recoveryservices.VaultResourceGuardAssociation("test", + vault_id=azurerm_recovery_services_vault["test"]["id"], + resource_guard_id=azurerm_data_protection_resource_guard["test"]["id"]) + ``` + ## Import Resource Guards can be imported using the `resource id`, e.g. @@ -220,6 +240,26 @@ def __init__(__self__, """ Manages an association of a Resource Guard and Recovery Services Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_resource_guard = azure.dataprotection.ResourceGuard("exampleResourceGuard", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + vault = azure.recoveryservices.Vault("vault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + soft_delete_enabled=True) + test = azure.recoveryservices.VaultResourceGuardAssociation("test", + vault_id=azurerm_recovery_services_vault["test"]["id"], + resource_guard_id=azurerm_data_protection_resource_guard["test"]["id"]) + ``` + ## Import Resource Guards can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/redis/_inputs.py b/sdk/python/pulumi_azure/redis/_inputs.py index acbdae951d..75e0d838ff 100644 --- a/sdk/python/pulumi_azure/redis/_inputs.py +++ b/sdk/python/pulumi_azure/redis/_inputs.py @@ -213,6 +213,10 @@ def __init__(__self__, *, :param pulumi.Input[str] aof_storage_connection_string1: Second Storage Account connection string for AOF persistence. Example usage: + + ```python + import pulumi + ``` :param pulumi.Input[bool] enable_authentication: If set to `false`, the Redis instance will be accessible without authentication. Defaults to `true`. > **NOTE:** `enable_authentication` can only be set to `false` if a `subnet_id` is specified; and only works if there aren't existing instances within the subnet with `enable_authentication` set to `true`. @@ -222,6 +226,10 @@ def __init__(__self__, *, :param pulumi.Input[str] maxmemory_policy: How Redis will select what to remove when `maxmemory` is reached. Defaults are shown below. Defaults to `volatile-lru`. :param pulumi.Input[int] maxmemory_reserved: Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below. :param pulumi.Input[str] notify_keyspace_events: Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + + ```python + import pulumi + ``` :param pulumi.Input[bool] rdb_backup_enabled: Is Backup Enabled? Only supported on Premium SKUs. Defaults to `false`. > **NOTE:** If `rdb_backup_enabled` set to `true`, `rdb_storage_connection_string` must also be set. @@ -356,6 +364,10 @@ def aof_storage_connection_string1(self) -> Optional[pulumi.Input[str]]: Second Storage Account connection string for AOF persistence. Example usage: + + ```python + import pulumi + ``` """ return pulumi.get(self, "aof_storage_connection_string1") @@ -442,6 +454,10 @@ def maxmemory_reserved(self, value: Optional[pulumi.Input[int]]): def notify_keyspace_events(self) -> Optional[pulumi.Input[str]]: """ Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + + ```python + import pulumi + ``` """ return pulumi.get(self, "notify_keyspace_events") diff --git a/sdk/python/pulumi_azure/redis/cache.py b/sdk/python/pulumi_azure/redis/cache.py index 95bdf3b948..055d1c36fd 100644 --- a/sdk/python/pulumi_azure/redis/cache.py +++ b/sdk/python/pulumi_azure/redis/cache.py @@ -1055,6 +1055,26 @@ def __init__(__self__, > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines) + ## Example Usage + + This example provisions a Standard Redis Cache. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + # NOTE: the Name used for Redis needs to be globally unique + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=2, + family="C", + sku_name="Standard", + enable_non_ssl_port=False, + minimum_tls_version="1.2", + redis_configuration=azure.redis.CacheRedisConfigurationArgs()) + ``` ## Relevant Links * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq) @@ -1109,6 +1129,26 @@ def __init__(__self__, > **Note:** Redis version 4 is being retired and no longer supports creating new instances. Version 4 will be removed in a future release. [Redis Version 4 Retirement](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-retired-features#important-upgrade-timelines) + ## Example Usage + + This example provisions a Standard Redis Cache. + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + # NOTE: the Name used for Redis needs to be globally unique + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=2, + family="C", + sku_name="Standard", + enable_non_ssl_port=False, + minimum_tls_version="1.2", + redis_configuration=azure.redis.CacheRedisConfigurationArgs()) + ``` ## Relevant Links * [Azure Cache for Redis planning](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-planning-faq) diff --git a/sdk/python/pulumi_azure/redis/enterprise_cluster.py b/sdk/python/pulumi_azure/redis/enterprise_cluster.py index 1c56c7a86a..fabadafc9a 100644 --- a/sdk/python/pulumi_azure/redis/enterprise_cluster.py +++ b/sdk/python/pulumi_azure/redis/enterprise_cluster.py @@ -345,6 +345,19 @@ def __init__(__self__, """ Manages a Redis Enterprise Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_enterprise_cluster = azure.redis.EnterpriseCluster("exampleEnterpriseCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EnterpriseFlash_F300-3") + ``` + ## Import Redis Enterprise Clusters can be imported using the `resource id`, e.g. @@ -372,6 +385,19 @@ def __init__(__self__, """ Manages a Redis Enterprise Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_enterprise_cluster = azure.redis.EnterpriseCluster("exampleEnterpriseCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="EnterpriseFlash_F300-3") + ``` + ## Import Redis Enterprise Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/redis/enterprise_database.py b/sdk/python/pulumi_azure/redis/enterprise_database.py index a3b72ad493..294ec65a2b 100644 --- a/sdk/python/pulumi_azure/redis/enterprise_database.py +++ b/sdk/python/pulumi_azure/redis/enterprise_database.py @@ -523,6 +523,35 @@ def __init__(__self__, """ Manages a Redis Enterprise Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_enterprise_cluster = azure.redis.EnterpriseCluster("exampleEnterpriseCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Enterprise_E20-4") + example1 = azure.redis.EnterpriseCluster("example1", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Enterprise_E20-4") + example_enterprise_database = azure.redis.EnterpriseDatabase("exampleEnterpriseDatabase", + resource_group_name=example_resource_group.name, + cluster_id=example_enterprise_cluster.id, + client_protocol="Encrypted", + clustering_policy="EnterpriseCluster", + eviction_policy="NoEviction", + port=10000, + linked_database_ids=[ + example_enterprise_cluster.id.apply(lambda id: f"{id}/databases/default"), + example1.id.apply(lambda id: f"{id}/databases/default"), + ], + linked_database_group_nickname="tftestGeoGroup") + ``` + ## Import Redis Enterprise Databases can be imported using the `resource id`, e.g. @@ -557,6 +586,35 @@ def __init__(__self__, """ Manages a Redis Enterprise Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_enterprise_cluster = azure.redis.EnterpriseCluster("exampleEnterpriseCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Enterprise_E20-4") + example1 = azure.redis.EnterpriseCluster("example1", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku_name="Enterprise_E20-4") + example_enterprise_database = azure.redis.EnterpriseDatabase("exampleEnterpriseDatabase", + resource_group_name=example_resource_group.name, + cluster_id=example_enterprise_cluster.id, + client_protocol="Encrypted", + clustering_policy="EnterpriseCluster", + eviction_policy="NoEviction", + port=10000, + linked_database_ids=[ + example_enterprise_cluster.id.apply(lambda id: f"{id}/databases/default"), + example1.id.apply(lambda id: f"{id}/databases/default"), + ], + linked_database_group_nickname="tftestGeoGroup") + ``` + ## Import Redis Enterprise Databases can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/redis/firewall_rule.py b/sdk/python/pulumi_azure/redis/firewall_rule.py index b62ab9cba1..7193438195 100644 --- a/sdk/python/pulumi_azure/redis/firewall_rule.py +++ b/sdk/python/pulumi_azure/redis/firewall_rule.py @@ -259,6 +259,38 @@ def __init__(__self__, """ Manages a Firewall Rule associated with a Redis Cache. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=1, + family="P", + sku_name="Premium", + enable_non_ssl_port=False, + redis_configuration=azure.redis.CacheRedisConfigurationArgs( + maxmemory_reserved=2, + maxmemory_delta=2, + maxmemory_policy="allkeys-lru", + )) + example_firewall_rule = azure.redis.FirewallRule("exampleFirewallRule", + redis_cache_name=example_cache.name, + resource_group_name=example_resource_group.name, + start_ip="1.2.3.4", + end_ip="2.3.4.5") + ``` + ## Import Redis Firewall Rules can be imported using the `resource id`, e.g. @@ -284,6 +316,38 @@ def __init__(__self__, """ Manages a Firewall Rule associated with a Redis Cache. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cache = azure.redis.Cache("exampleCache", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + capacity=1, + family="P", + sku_name="Premium", + enable_non_ssl_port=False, + redis_configuration=azure.redis.CacheRedisConfigurationArgs( + maxmemory_reserved=2, + maxmemory_delta=2, + maxmemory_policy="allkeys-lru", + )) + example_firewall_rule = azure.redis.FirewallRule("exampleFirewallRule", + redis_cache_name=example_cache.name, + resource_group_name=example_resource_group.name, + start_ip="1.2.3.4", + end_ip="2.3.4.5") + ``` + ## Import Redis Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/redis/get_cache.py b/sdk/python/pulumi_azure/redis/get_cache.py index 58b04698ee..56147d97a4 100644 --- a/sdk/python/pulumi_azure/redis/get_cache.py +++ b/sdk/python/pulumi_azure/redis/get_cache.py @@ -300,6 +300,18 @@ def get_cache(name: Optional[str] = None, """ Use this data source to access information about an existing Redis Cache + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.redis.get_cache(name="myrediscache", + resource_group_name="redis-cache") + pulumi.export("primaryAccessKey", example.primary_access_key) + pulumi.export("hostname", example.hostname) + ``` + :param str name: The name of the Redis cache :param str resource_group_name: The name of the resource group the Redis cache instance is located in. @@ -343,6 +355,18 @@ def get_cache_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Redis Cache + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.redis.get_cache(name="myrediscache", + resource_group_name="redis-cache") + pulumi.export("primaryAccessKey", example.primary_access_key) + pulumi.export("hostname", example.hostname) + ``` + :param str name: The name of the Redis cache :param str resource_group_name: The name of the resource group the Redis cache instance is located in. diff --git a/sdk/python/pulumi_azure/redis/get_enterprise_database.py b/sdk/python/pulumi_azure/redis/get_enterprise_database.py index 826fe753dc..bc76a12ab1 100644 --- a/sdk/python/pulumi_azure/redis/get_enterprise_database.py +++ b/sdk/python/pulumi_azure/redis/get_enterprise_database.py @@ -135,6 +135,19 @@ def get_enterprise_database(cluster_id: Optional[str] = None, """ Use this data source to access information about an existing Redis Enterprise Database + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.redis.get_enterprise_database(name="default", + resource_group_name=azurerm_resource_group["example"]["name"], + cluster_id=azurerm_redis_enterprise_cluster["example"]["id"]) + pulumi.export("redisEnterpriseDatabasePrimaryKey", example.primary_access_key) + pulumi.export("redisEnterpriseDatabaseSecondaryKey", example.secondary_access_key) + ``` + :param str cluster_id: The resource ID of Redis Enterprise Cluster which hosts the Redis Enterprise Database instance. :param str name: The name of the Redis Enterprise Database. @@ -166,6 +179,19 @@ def get_enterprise_database_output(cluster_id: Optional[pulumi.Input[str]] = Non """ Use this data source to access information about an existing Redis Enterprise Database + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.redis.get_enterprise_database(name="default", + resource_group_name=azurerm_resource_group["example"]["name"], + cluster_id=azurerm_redis_enterprise_cluster["example"]["id"]) + pulumi.export("redisEnterpriseDatabasePrimaryKey", example.primary_access_key) + pulumi.export("redisEnterpriseDatabaseSecondaryKey", example.secondary_access_key) + ``` + :param str cluster_id: The resource ID of Redis Enterprise Cluster which hosts the Redis Enterprise Database instance. :param str name: The name of the Redis Enterprise Database. diff --git a/sdk/python/pulumi_azure/redis/linked_server.py b/sdk/python/pulumi_azure/redis/linked_server.py index 25da503538..f7192dc631 100644 --- a/sdk/python/pulumi_azure/redis/linked_server.py +++ b/sdk/python/pulumi_azure/redis/linked_server.py @@ -282,6 +282,46 @@ def __init__(__self__, """ Manages a Redis Linked Server (ie Geo Location) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_primary_resource_group = azure.core.ResourceGroup("example-primaryResourceGroup", location="East US") + example_primary_cache = azure.redis.Cache("example-primaryCache", + location=example_primary_resource_group.location, + resource_group_name=example_primary_resource_group.name, + capacity=1, + family="P", + sku_name="Premium", + enable_non_ssl_port=False, + redis_configuration=azure.redis.CacheRedisConfigurationArgs( + maxmemory_reserved=2, + maxmemory_delta=2, + maxmemory_policy="allkeys-lru", + )) + example_secondary_resource_group = azure.core.ResourceGroup("example-secondaryResourceGroup", location="West US") + example_secondary_cache = azure.redis.Cache("example-secondaryCache", + location=example_secondary_resource_group.location, + resource_group_name=example_secondary_resource_group.name, + capacity=1, + family="P", + sku_name="Premium", + enable_non_ssl_port=False, + redis_configuration=azure.redis.CacheRedisConfigurationArgs( + maxmemory_reserved=2, + maxmemory_delta=2, + maxmemory_policy="allkeys-lru", + )) + example_link = azure.redis.LinkedServer("example-link", + target_redis_cache_name=example_primary_cache.name, + resource_group_name=example_primary_cache.resource_group_name, + linked_redis_cache_id=example_secondary_cache.id, + linked_redis_cache_location=example_secondary_cache.location, + server_role="Secondary") + ``` + ## Import Redis can be imported using the `resource id`, e.g. @@ -307,6 +347,46 @@ def __init__(__self__, """ Manages a Redis Linked Server (ie Geo Location) + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_primary_resource_group = azure.core.ResourceGroup("example-primaryResourceGroup", location="East US") + example_primary_cache = azure.redis.Cache("example-primaryCache", + location=example_primary_resource_group.location, + resource_group_name=example_primary_resource_group.name, + capacity=1, + family="P", + sku_name="Premium", + enable_non_ssl_port=False, + redis_configuration=azure.redis.CacheRedisConfigurationArgs( + maxmemory_reserved=2, + maxmemory_delta=2, + maxmemory_policy="allkeys-lru", + )) + example_secondary_resource_group = azure.core.ResourceGroup("example-secondaryResourceGroup", location="West US") + example_secondary_cache = azure.redis.Cache("example-secondaryCache", + location=example_secondary_resource_group.location, + resource_group_name=example_secondary_resource_group.name, + capacity=1, + family="P", + sku_name="Premium", + enable_non_ssl_port=False, + redis_configuration=azure.redis.CacheRedisConfigurationArgs( + maxmemory_reserved=2, + maxmemory_delta=2, + maxmemory_policy="allkeys-lru", + )) + example_link = azure.redis.LinkedServer("example-link", + target_redis_cache_name=example_primary_cache.name, + resource_group_name=example_primary_cache.resource_group_name, + linked_redis_cache_id=example_secondary_cache.id, + linked_redis_cache_location=example_secondary_cache.location, + server_role="Secondary") + ``` + ## Import Redis can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/redis/outputs.py b/sdk/python/pulumi_azure/redis/outputs.py index 19e7e2162c..2dcace21dd 100644 --- a/sdk/python/pulumi_azure/redis/outputs.py +++ b/sdk/python/pulumi_azure/redis/outputs.py @@ -270,6 +270,10 @@ def __init__(__self__, *, :param str aof_storage_connection_string1: Second Storage Account connection string for AOF persistence. Example usage: + + ```python + import pulumi + ``` :param bool enable_authentication: If set to `false`, the Redis instance will be accessible without authentication. Defaults to `true`. > **NOTE:** `enable_authentication` can only be set to `false` if a `subnet_id` is specified; and only works if there aren't existing instances within the subnet with `enable_authentication` set to `true`. @@ -279,6 +283,10 @@ def __init__(__self__, *, :param str maxmemory_policy: How Redis will select what to remove when `maxmemory` is reached. Defaults are shown below. Defaults to `volatile-lru`. :param int maxmemory_reserved: Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below. :param str notify_keyspace_events: Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + + ```python + import pulumi + ``` :param bool rdb_backup_enabled: Is Backup Enabled? Only supported on Premium SKUs. Defaults to `false`. > **NOTE:** If `rdb_backup_enabled` set to `true`, `rdb_storage_connection_string` must also be set. @@ -405,6 +413,10 @@ def aof_storage_connection_string1(self) -> Optional[str]: Second Storage Account connection string for AOF persistence. Example usage: + + ```python + import pulumi + ``` """ return pulumi.get(self, "aof_storage_connection_string1") @@ -463,6 +475,10 @@ def maxmemory_reserved(self) -> Optional[int]: def notify_keyspace_events(self) -> Optional[str]: """ Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration) + + ```python + import pulumi + ``` """ return pulumi.get(self, "notify_keyspace_events") diff --git a/sdk/python/pulumi_azure/relay/hybrid_connection.py b/sdk/python/pulumi_azure/relay/hybrid_connection.py index 5cfd2b1065..499ba5cc0c 100644 --- a/sdk/python/pulumi_azure/relay/hybrid_connection.py +++ b/sdk/python/pulumi_azure/relay/hybrid_connection.py @@ -257,6 +257,27 @@ def __init__(__self__, """ Manages an Azure Relay Hybrid Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "managed", + }) + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name, + requires_client_authorization=False, + user_metadata="testmetadata") + ``` + ## Import Relay Hybrid Connection's can be imported using the `resource id`, e.g. @@ -282,6 +303,27 @@ def __init__(__self__, """ Manages an Azure Relay Hybrid Connection. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "managed", + }) + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name, + requires_client_authorization=False, + user_metadata="testmetadata") + ``` + ## Import Relay Hybrid Connection's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/relay/hybrid_connection_authorization_rule.py b/sdk/python/pulumi_azure/relay/hybrid_connection_authorization_rule.py index ceed65aaaf..ca9a435a72 100644 --- a/sdk/python/pulumi_azure/relay/hybrid_connection_authorization_rule.py +++ b/sdk/python/pulumi_azure/relay/hybrid_connection_authorization_rule.py @@ -408,6 +408,34 @@ def __init__(__self__, """ Manages an Azure Relay Hybrid Connection Authorization Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "terraform", + }) + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name, + requires_client_authorization=False, + user_metadata="testmetadata") + example_hybrid_connection_authorization_rule = azure.relay.HybridConnectionAuthorizationRule("exampleHybridConnectionAuthorizationRule", + resource_group_name=example_resource_group.name, + hybrid_connection_name=example_hybrid_connection.name, + namespace_name=example_namespace.name, + listen=True, + send=True, + manage=False) + ``` + ## Import Azure Relay Hybrid Connection Authorization Rules can be imported using the `resource id`, e.g. @@ -435,6 +463,34 @@ def __init__(__self__, """ Manages an Azure Relay Hybrid Connection Authorization Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "terraform", + }) + example_hybrid_connection = azure.relay.HybridConnection("exampleHybridConnection", + resource_group_name=example_resource_group.name, + relay_namespace_name=example_namespace.name, + requires_client_authorization=False, + user_metadata="testmetadata") + example_hybrid_connection_authorization_rule = azure.relay.HybridConnectionAuthorizationRule("exampleHybridConnectionAuthorizationRule", + resource_group_name=example_resource_group.name, + hybrid_connection_name=example_hybrid_connection.name, + namespace_name=example_namespace.name, + listen=True, + send=True, + manage=False) + ``` + ## Import Azure Relay Hybrid Connection Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/relay/namespace.py b/sdk/python/pulumi_azure/relay/namespace.py index ab53067eb9..ccfd7f1f08 100644 --- a/sdk/python/pulumi_azure/relay/namespace.py +++ b/sdk/python/pulumi_azure/relay/namespace.py @@ -349,6 +349,22 @@ def __init__(__self__, """ Manages an Azure Relay Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "example", + }) + ``` + ## Import Azure Relay Namespace's can be imported using the `resource id`, e.g. @@ -374,6 +390,22 @@ def __init__(__self__, """ Manages an Azure Relay Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "example", + }) + ``` + ## Import Azure Relay Namespace's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/relay/namespace_authorization_rule.py b/sdk/python/pulumi_azure/relay/namespace_authorization_rule.py index 5cf4fb47bd..15e9e782a0 100644 --- a/sdk/python/pulumi_azure/relay/namespace_authorization_rule.py +++ b/sdk/python/pulumi_azure/relay/namespace_authorization_rule.py @@ -366,6 +366,28 @@ def __init__(__self__, """ Manages an Azure Relay Namespace Authorization Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "terraform", + }) + example_namespace_authorization_rule = azure.relay.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + resource_group_name=example_resource_group.name, + namespace_name=example_namespace.name, + listen=True, + send=True, + manage=False) + ``` + ## Import Azure Relay Namespace Authorization Rules can be imported using the `resource id`, e.g. @@ -392,6 +414,28 @@ def __init__(__self__, """ Manages an Azure Relay Namespace Authorization Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.relay.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku_name="Standard", + tags={ + "source": "terraform", + }) + example_namespace_authorization_rule = azure.relay.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + resource_group_name=example_resource_group.name, + namespace_name=example_namespace.name, + listen=True, + send=True, + manage=False) + ``` + ## Import Azure Relay Namespace Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/role/assignment.py b/sdk/python/pulumi_azure/role/assignment.py index 6998caedea..77017853c0 100644 --- a/sdk/python/pulumi_azure/role/assignment.py +++ b/sdk/python/pulumi_azure/role/assignment.py @@ -500,6 +500,86 @@ def __init__(__self__, Assigns a given Principal (User or Group) to a given Role. ## Example Usage + ### Using A Built-In Role) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Reader", + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Service Principal) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & User) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Management Group) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=data["azurerm_management_group"]["primary"]["id"], + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` ## Import @@ -540,6 +620,86 @@ def __init__(__self__, Assigns a given Principal (User or Group) to a given Role. ## Example Usage + ### Using A Built-In Role) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_assignment = azure.authorization.Assignment("exampleAssignment", + scope=primary.id, + role_definition_name="Reader", + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Service Principal) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & User) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=primary.id, + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` + ### Custom Role & Management Group) + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example_client_config = azure.core.get_client_config() + example_group = azure.management.get_group(name="00000000-0000-0000-0000-000000000000") + example_role_definition = azure.authorization.RoleDefinition("exampleRoleDefinition", + role_definition_id="00000000-0000-0000-0000-000000000000", + scope=primary.id, + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["Microsoft.Resources/subscriptions/resourceGroups/read"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + example_assignment = azure.authorization.Assignment("exampleAssignment", + name="00000000-0000-0000-0000-000000000000", + scope=data["azurerm_management_group"]["primary"]["id"], + role_definition_id=example_role_definition.role_definition_resource_id, + principal_id=example_client_config.object_id) + ``` ## Import diff --git a/sdk/python/pulumi_azure/role/definition.py b/sdk/python/pulumi_azure/role/definition.py index fd9e2c6545..c870a784a6 100644 --- a/sdk/python/pulumi_azure/role/definition.py +++ b/sdk/python/pulumi_azure/role/definition.py @@ -320,6 +320,23 @@ def __init__(__self__, """ Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example = azure.authorization.RoleDefinition("example", + scope=primary.id, + description="This is a custom role created", + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["*"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + ``` + ## Import Role Definitions can be imported using the `resource id`, e.g. @@ -348,6 +365,23 @@ def __init__(__self__, """ Manages a custom Role Definition, used to assign Roles to Users/Principals. See ['Understand role definitions'](https://docs.microsoft.com/azure/role-based-access-control/role-definitions) in the Azure documentation for more details. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.get_subscription() + example = azure.authorization.RoleDefinition("example", + scope=primary.id, + description="This is a custom role created", + permissions=[azure.authorization.RoleDefinitionPermissionArgs( + actions=["*"], + not_actions=[], + )], + assignable_scopes=[primary.id]) + ``` + ## Import Role Definitions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/search/get_service.py b/sdk/python/pulumi_azure/search/get_service.py index 219d6d3c54..e8210997f0 100644 --- a/sdk/python/pulumi_azure/search/get_service.py +++ b/sdk/python/pulumi_azure/search/get_service.py @@ -156,6 +156,17 @@ def get_service(name: Optional[str] = None, """ Manages a Search Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.get_service_output(name="example-search-service", + resource_group_name=example_resource_group.name) + ``` + :param str name: The Name of the Search Service. :param str resource_group_name: The name of the Resource Group where the Search Service exists. @@ -186,6 +197,17 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, """ Manages a Search Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.get_service_output(name="example-search-service", + resource_group_name=example_resource_group.name) + ``` + :param str name: The Name of the Search Service. :param str resource_group_name: The name of the Resource Group where the Search Service exists. diff --git a/sdk/python/pulumi_azure/search/service.py b/sdk/python/pulumi_azure/search/service.py index bef8ab5eae..e52f321e68 100644 --- a/sdk/python/pulumi_azure/search/service.py +++ b/sdk/python/pulumi_azure/search/service.py @@ -721,6 +721,45 @@ def __init__(__self__, Manages a Search Service. ## Example Usage + ### Supporting API Keys) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.Service("exampleService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + ``` + ### Using Both AzureAD And API Keys) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.Service("exampleService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard", + local_authentication_enabled=True, + authentication_failure_mode="http403") + ``` + ### Supporting Only AzureAD Authentication) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.Service("exampleService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard", + local_authentication_enabled=False) + ``` ## Import @@ -769,6 +808,45 @@ def __init__(__self__, Manages a Search Service. ## Example Usage + ### Supporting API Keys) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.Service("exampleService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard") + ``` + ### Using Both AzureAD And API Keys) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.Service("exampleService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard", + local_authentication_enabled=True, + authentication_failure_mode="http403") + ``` + ### Supporting Only AzureAD Authentication) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.search.Service("exampleService", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="standard", + local_authentication_enabled=False) + ``` ## Import diff --git a/sdk/python/pulumi_azure/search/shared_private_link_service.py b/sdk/python/pulumi_azure/search/shared_private_link_service.py index c66363e55e..9980dd0d92 100644 --- a/sdk/python/pulumi_azure/search/shared_private_link_service.py +++ b/sdk/python/pulumi_azure/search/shared_private_link_service.py @@ -284,6 +284,29 @@ def __init__(__self__, """ Manages the Shared Private Link Service for an Azure Search Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="east us") + test_service = azure.search.Service("testService", + resource_group_name=test_resource_group.name, + location=test_resource_group.location, + sku="standard") + test_account = azure.storage.Account("testAccount", + resource_group_name=test_resource_group.name, + location=test_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + test_shared_private_link_service = azure.search.SharedPrivateLinkService("testSharedPrivateLinkService", + search_service_id=test_service.id, + subresource_name="blob", + target_resource_id=test_account.id, + request_message="please approve") + ``` + ## Import Azure Search Shared Private Link Resource can be imported using the `resource id`, e.g. @@ -311,6 +334,29 @@ def __init__(__self__, """ Manages the Shared Private Link Service for an Azure Search Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="east us") + test_service = azure.search.Service("testService", + resource_group_name=test_resource_group.name, + location=test_resource_group.location, + sku="standard") + test_account = azure.storage.Account("testAccount", + resource_group_name=test_resource_group.name, + location=test_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + test_shared_private_link_service = azure.search.SharedPrivateLinkService("testSharedPrivateLinkService", + search_service_id=test_service.id, + subresource_name="blob", + target_resource_id=test_account.id, + request_message="please approve") + ``` + ## Import Azure Search Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/advanced_threat_protection.py b/sdk/python/pulumi_azure/securitycenter/advanced_threat_protection.py index abcaf0a45a..eed2a4337d 100644 --- a/sdk/python/pulumi_azure/securitycenter/advanced_threat_protection.py +++ b/sdk/python/pulumi_azure/securitycenter/advanced_threat_protection.py @@ -134,6 +134,26 @@ def __init__(__self__, """ Manages a resources Advanced Threat Protection setting. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "example", + }) + example_advanced_threat_protection = azure.securitycenter.AdvancedThreatProtection("exampleAdvancedThreatProtection", + target_resource_id=example_account.id, + enabled=True) + ``` + ## Import Advanced Threat Protection can be imported using the `resource id`, e.g. @@ -156,6 +176,26 @@ def __init__(__self__, """ Manages a resources Advanced Threat Protection setting. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "example", + }) + example_advanced_threat_protection = azure.securitycenter.AdvancedThreatProtection("exampleAdvancedThreatProtection", + target_resource_id=example_account.id, + enabled=True) + ``` + ## Import Advanced Threat Protection can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/assessment.py b/sdk/python/pulumi_azure/securitycenter/assessment.py index f954772e0e..f2d8266831 100644 --- a/sdk/python/pulumi_azure/securitycenter/assessment.py +++ b/sdk/python/pulumi_azure/securitycenter/assessment.py @@ -219,6 +219,62 @@ def __init__(__self__, """ Manages the Security Center Assessment for Azure Security Center. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_username="adminuser", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=internal.id, + )], + )]) + example_assessment_policy = azure.securitycenter.AssessmentPolicy("exampleAssessmentPolicy", + display_name="Test Display Name", + severity="Medium", + description="Test Description") + example_assessment = azure.securitycenter.Assessment("exampleAssessment", + assessment_policy_id=example_assessment_policy.id, + target_resource_id=example_linux_virtual_machine_scale_set.id, + status=azure.securitycenter.AssessmentStatusArgs( + code="Healthy", + )) + ``` + ## Import Security Assessment can be imported using the `resource id`, e.g. @@ -243,6 +299,62 @@ def __init__(__self__, """ Manages the Security Center Assessment for Azure Security Center. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.0.0.0/16"]) + internal = azure.network.Subnet("internal", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_linux_virtual_machine_scale_set = azure.compute.LinuxVirtualMachineScaleSet("exampleLinuxVirtualMachineScaleSet", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku="Standard_F2", + instances=1, + admin_username="adminuser", + admin_ssh_keys=[azure.compute.LinuxVirtualMachineScaleSetAdminSshKeyArgs( + username="adminuser", + public_key=(lambda path: open(path).read())("~/.ssh/id_rsa.pub"), + )], + source_image_reference=azure.compute.LinuxVirtualMachineScaleSetSourceImageReferenceArgs( + publisher="Canonical", + offer="0001-com-ubuntu-server-focal", + sku="20_04-lts", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineScaleSetOsDiskArgs( + storage_account_type="Standard_LRS", + caching="ReadWrite", + ), + network_interfaces=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceArgs( + name="example", + primary=True, + ip_configurations=[azure.compute.LinuxVirtualMachineScaleSetNetworkInterfaceIpConfigurationArgs( + name="internal", + primary=True, + subnet_id=internal.id, + )], + )]) + example_assessment_policy = azure.securitycenter.AssessmentPolicy("exampleAssessmentPolicy", + display_name="Test Display Name", + severity="Medium", + description="Test Description") + example_assessment = azure.securitycenter.Assessment("exampleAssessment", + assessment_policy_id=example_assessment_policy.id, + target_resource_id=example_linux_virtual_machine_scale_set.id, + status=azure.securitycenter.AssessmentStatusArgs( + code="Healthy", + )) + ``` + ## Import Security Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/assessment_policy.py b/sdk/python/pulumi_azure/securitycenter/assessment_policy.py index 565eac4a40..766dc4e6fc 100644 --- a/sdk/python/pulumi_azure/securitycenter/assessment_policy.py +++ b/sdk/python/pulumi_azure/securitycenter/assessment_policy.py @@ -386,6 +386,18 @@ def __init__(__self__, """ Manages the Security Center Assessment Metadata for Azure Security Center. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.AssessmentPolicy("example", + description="Test Description", + display_name="Test Display Name", + severity="Medium") + ``` + ## Import Security Assessments Policy can be imported using the `resource id`, e.g. @@ -414,6 +426,18 @@ def __init__(__self__, """ Manages the Security Center Assessment Metadata for Azure Security Center. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.AssessmentPolicy("example", + description="Test Description", + display_name="Test Display Name", + severity="Medium") + ``` + ## Import Security Assessments Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/auto_provisioning.py b/sdk/python/pulumi_azure/securitycenter/auto_provisioning.py index 9f94745e39..d17476f26c 100644 --- a/sdk/python/pulumi_azure/securitycenter/auto_provisioning.py +++ b/sdk/python/pulumi_azure/securitycenter/auto_provisioning.py @@ -98,6 +98,15 @@ def __init__(__self__, > **NOTE:** There is no resource name required, it will always be "default" + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.AutoProvisioning("example", auto_provision="On") + ``` + ## Import Security Center Auto Provisioning can be imported using the `resource id`, e.g. @@ -121,6 +130,15 @@ def __init__(__self__, > **NOTE:** There is no resource name required, it will always be "default" + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.AutoProvisioning("example", auto_provision="On") + ``` + ## Import Security Center Auto Provisioning can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/automation.py b/sdk/python/pulumi_azure/securitycenter/automation.py index 1b7b93335f..c34fe0927c 100644 --- a/sdk/python/pulumi_azure/securitycenter/automation.py +++ b/sdk/python/pulumi_azure/securitycenter/automation.py @@ -397,6 +397,53 @@ def __init__(__self__, """ Manages Security Center Automation and Continuous Export. This resource supports three types of destination in the `action`, Logic Apps, Log Analytics and Event Hubs + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=2) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + example_automation = azure.securitycenter.Automation("exampleAutomation", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + actions=[azure.securitycenter.AutomationActionArgs( + type="EventHub", + resource_id=example_event_hub.id, + connection_string=example_authorization_rule.primary_connection_string, + )], + sources=[azure.securitycenter.AutomationSourceArgs( + event_source="Alerts", + rule_sets=[azure.securitycenter.AutomationSourceRuleSetArgs( + rules=[azure.securitycenter.AutomationSourceRuleSetRuleArgs( + property_path="properties.metadata.severity", + operator="Equals", + expected_value="High", + property_type="String", + )], + )], + )], + scopes=[f"/subscriptions/{current.subscription_id}"]) + ``` + ## Import Security Center Automations can be imported using the `resource id`, e.g. @@ -426,6 +473,53 @@ def __init__(__self__, """ Manages Security Center Automation and Continuous Export. This resource supports three types of destination in the `action`, Logic Apps, Log Analytics and Event Hubs + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=2) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=2) + example_authorization_rule = azure.eventhub.AuthorizationRule("exampleAuthorizationRule", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name, + listen=True, + send=False, + manage=False) + example_automation = azure.securitycenter.Automation("exampleAutomation", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + actions=[azure.securitycenter.AutomationActionArgs( + type="EventHub", + resource_id=example_event_hub.id, + connection_string=example_authorization_rule.primary_connection_string, + )], + sources=[azure.securitycenter.AutomationSourceArgs( + event_source="Alerts", + rule_sets=[azure.securitycenter.AutomationSourceRuleSetArgs( + rules=[azure.securitycenter.AutomationSourceRuleSetRuleArgs( + property_path="properties.metadata.severity", + operator="Equals", + expected_value="High", + property_type="String", + )], + )], + )], + scopes=[f"/subscriptions/{current.subscription_id}"]) + ``` + ## Import Security Center Automations can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/contact.py b/sdk/python/pulumi_azure/securitycenter/contact.py index ec7ac7ef1a..e32c65ee78 100644 --- a/sdk/python/pulumi_azure/securitycenter/contact.py +++ b/sdk/python/pulumi_azure/securitycenter/contact.py @@ -252,6 +252,19 @@ def __init__(__self__, > **NOTE:** Owner access permission is required. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.Contact("example", + alert_notifications=True, + alerts_to_admins=True, + email="contact@example.com", + phone="+1-555-555-5555") + ``` + ## Import The contact can be imported using the `resource id`, e.g. @@ -279,6 +292,19 @@ def __init__(__self__, > **NOTE:** Owner access permission is required. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.Contact("example", + alert_notifications=True, + alerts_to_admins=True, + email="contact@example.com", + phone="+1-555-555-5555") + ``` + ## Import The contact can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment.py b/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment.py index d22a75d59c..f3f39705fd 100644 --- a/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment.py +++ b/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment.py @@ -157,6 +157,50 @@ def __init__(__self__, > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm-example", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + size="Standard_B1s", + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + network_interface_ids=[example_network_interface.id]) + example_server_vulnerability_assessment = azure.securitycenter.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", virtual_machine_id=example_linux_virtual_machine.id) + ``` + ## Import Server Vulnerability Assessments can be imported using the `resource id`, e.g. @@ -194,6 +238,50 @@ def __init__(__self__, > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm-example", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + size="Standard_B1s", + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + network_interface_ids=[example_network_interface.id]) + example_server_vulnerability_assessment = azure.securitycenter.ServerVulnerabilityAssessment("exampleServerVulnerabilityAssessment", virtual_machine_id=example_linux_virtual_machine.id) + ``` + ## Import Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment_virtual_machine.py b/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment_virtual_machine.py index d422f45e1c..5178ab3fa9 100644 --- a/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment_virtual_machine.py +++ b/sdk/python/pulumi_azure/securitycenter/server_vulnerability_assessment_virtual_machine.py @@ -99,6 +99,50 @@ def __init__(__self__, > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm-example", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + size="Standard_B1s", + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + network_interface_ids=[example_network_interface.id]) + example_server_vulnerability_assessment_virtual_machine = azure.securitycenter.ServerVulnerabilityAssessmentVirtualMachine("exampleServerVulnerabilityAssessmentVirtualMachine", virtual_machine_id=example_linux_virtual_machine.id) + ``` + ## Import Server Vulnerability Assessments can be imported using the `resource id`, e.g. @@ -123,6 +167,50 @@ def __init__(__self__, > **NOTE** Azure Defender has to be enabled on the subscription in order for this resource to work. See this [documentation](https://docs.microsoft.com/azure/security-center/security-center-get-started) to get started. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + example_network_interface = azure.network.NetworkInterface("exampleNetworkInterface", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm-example", + subnet_id=example_subnet.id, + private_ip_address_allocation="Dynamic", + )]) + example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("exampleLinuxVirtualMachine", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + size="Standard_B1s", + admin_username="testadmin", + admin_password="Password1234!", + disable_password_authentication=False, + source_image_reference=azure.compute.LinuxVirtualMachineSourceImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + os_disk=azure.compute.LinuxVirtualMachineOsDiskArgs( + caching="ReadWrite", + storage_account_type="Standard_LRS", + ), + network_interface_ids=[example_network_interface.id]) + example_server_vulnerability_assessment_virtual_machine = azure.securitycenter.ServerVulnerabilityAssessmentVirtualMachine("exampleServerVulnerabilityAssessmentVirtualMachine", virtual_machine_id=example_linux_virtual_machine.id) + ``` + ## Import Server Vulnerability Assessments can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/setting.py b/sdk/python/pulumi_azure/securitycenter/setting.py index 1db83e82a2..b6e4be5c5f 100644 --- a/sdk/python/pulumi_azure/securitycenter/setting.py +++ b/sdk/python/pulumi_azure/securitycenter/setting.py @@ -138,6 +138,17 @@ def __init__(__self__, > **NOTE:** Deletion of this resource disables the setting. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.Setting("example", + enabled=True, + setting_name="MCAS") + ``` + ## Import The setting can be imported using the `resource id`, e.g. @@ -164,6 +175,17 @@ def __init__(__self__, > **NOTE:** Deletion of this resource disables the setting. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.Setting("example", + enabled=True, + setting_name="MCAS") + ``` + ## Import The setting can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/storage_defender.py b/sdk/python/pulumi_azure/securitycenter/storage_defender.py index fbde5b81f2..a28f3bb438 100644 --- a/sdk/python/pulumi_azure/securitycenter/storage_defender.py +++ b/sdk/python/pulumi_azure/securitycenter/storage_defender.py @@ -260,6 +260,21 @@ def __init__(__self__, """ Manages the Defender for Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westus2") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_storage_defender = azure.securitycenter.StorageDefender("exampleStorageDefender", storage_account_id=example_account.id) + ``` + ## Import The setting can be imported using the `resource id`, e.g. @@ -285,6 +300,21 @@ def __init__(__self__, """ Manages the Defender for Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westus2") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_storage_defender = azure.securitycenter.StorageDefender("exampleStorageDefender", storage_account_id=example_account.id) + ``` + ## Import The setting can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/securitycenter/subscription_pricing.py b/sdk/python/pulumi_azure/securitycenter/subscription_pricing.py index c998429d37..1a4ec115d2 100644 --- a/sdk/python/pulumi_azure/securitycenter/subscription_pricing.py +++ b/sdk/python/pulumi_azure/securitycenter/subscription_pricing.py @@ -212,6 +212,43 @@ def __init__(__self__, > **NOTE:** Deletion of this resource will reset the pricing tier to `Free` ## Example Usage + ### Basic usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.SubscriptionPricing("example", + resource_type="VirtualMachines", + tier="Standard") + ``` + ### Using Extensions with Defender CSPM + + ```python + import pulumi + import pulumi_azure as azure + + example1 = azure.securitycenter.SubscriptionPricing("example1", + extensions=[ + azure.securitycenter.SubscriptionPricingExtensionArgs( + name="ContainerRegistriesVulnerabilityAssessments", + ), + azure.securitycenter.SubscriptionPricingExtensionArgs( + additional_extension_properties={ + "ExclusionTags": "[]", + }, + name="AgentlessVmScanning", + ), + azure.securitycenter.SubscriptionPricingExtensionArgs( + name="AgentlessDiscoveryForKubernetes", + ), + azure.securitycenter.SubscriptionPricingExtensionArgs( + name="SensitiveDataDiscovery", + ), + ], + resource_type="CloudPosture", + tier="Standard") + ``` ## Import @@ -240,6 +277,43 @@ def __init__(__self__, > **NOTE:** Deletion of this resource will reset the pricing tier to `Free` ## Example Usage + ### Basic usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.securitycenter.SubscriptionPricing("example", + resource_type="VirtualMachines", + tier="Standard") + ``` + ### Using Extensions with Defender CSPM + + ```python + import pulumi + import pulumi_azure as azure + + example1 = azure.securitycenter.SubscriptionPricing("example1", + extensions=[ + azure.securitycenter.SubscriptionPricingExtensionArgs( + name="ContainerRegistriesVulnerabilityAssessments", + ), + azure.securitycenter.SubscriptionPricingExtensionArgs( + additional_extension_properties={ + "ExclusionTags": "[]", + }, + name="AgentlessVmScanning", + ), + azure.securitycenter.SubscriptionPricingExtensionArgs( + name="AgentlessDiscoveryForKubernetes", + ), + azure.securitycenter.SubscriptionPricingExtensionArgs( + name="SensitiveDataDiscovery", + ), + ], + resource_type="CloudPosture", + tier="Standard") + ``` ## Import diff --git a/sdk/python/pulumi_azure/securitycenter/workspace.py b/sdk/python/pulumi_azure/securitycenter/workspace.py index 98d1be6b7c..7d5d8d9f2a 100644 --- a/sdk/python/pulumi_azure/securitycenter/workspace.py +++ b/sdk/python/pulumi_azure/securitycenter/workspace.py @@ -136,6 +136,22 @@ def __init__(__self__, > **NOTE:** Owner access permission is required. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_workspace = azure.securitycenter.Workspace("exampleWorkspace", + scope="/subscriptions/00000000-0000-0000-0000-000000000000", + workspace_id=example_analytics_workspace.id) + ``` + ## Import The contact can be imported using the `resource id`, e.g. @@ -160,6 +176,22 @@ def __init__(__self__, > **NOTE:** Owner access permission is required. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_workspace = azure.securitycenter.Workspace("exampleWorkspace", + scope="/subscriptions/00000000-0000-0000-0000-000000000000", + workspace_id=example_analytics_workspace.id) + ``` + ## Import The contact can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_built_in.py b/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_built_in.py index bb479dd812..cbc19d17e5 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_built_in.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_built_in.py @@ -490,6 +490,29 @@ def __init__(__self__, name: Optional[pulumi.Input[str]] = None, __props__=None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + workspace_id=example_analytics_workspace.id, + customer_managed_key_enabled=False) + example_alert_rule_anomaly = azure.sentinel.get_alert_rule_anomaly_output(log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="Potential data staging") + example_alert_rule_anomaly_built_in = azure.sentinel.AlertRuleAnomalyBuiltIn("exampleAlertRuleAnomalyBuiltIn", + display_name="Potential data staging", + log_analytics_workspace_id=example_analytics_workspace.id, + mode="Production", + enabled=False) + ``` + ## Import Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. @@ -515,6 +538,29 @@ def __init__(__self__, args: AlertRuleAnomalyBuiltInArgs, opts: Optional[pulumi.ResourceOptions] = None): """ + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + workspace_id=example_analytics_workspace.id, + customer_managed_key_enabled=False) + example_alert_rule_anomaly = azure.sentinel.get_alert_rule_anomaly_output(log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="Potential data staging") + example_alert_rule_anomaly_built_in = azure.sentinel.AlertRuleAnomalyBuiltIn("exampleAlertRuleAnomalyBuiltIn", + display_name="Potential data staging", + log_analytics_workspace_id=example_analytics_workspace.id, + mode="Production", + enabled=False) + ``` + ## Import Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_duplicate.py b/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_duplicate.py index db90f1f74d..82099a1b73 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_duplicate.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_anomaly_duplicate.py @@ -620,6 +620,34 @@ def __init__(__self__, """ Manages a Duplicated Anomaly Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + workspace_id=example_analytics_workspace.id, + customer_managed_key_enabled=False) + example_alert_rule_anomaly = azure.sentinel.get_alert_rule_anomaly_output(log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="UEBA Anomalous Sign In") + example_alert_rule_anomaly_duplicate = azure.sentinel.AlertRuleAnomalyDuplicate("exampleAlertRuleAnomalyDuplicate", + display_name="example duplicated UEBA Anomalous Sign In", + log_analytics_workspace_id=example_analytics_workspace.id, + built_in_rule_id=example_alert_rule_anomaly.id, + enabled=True, + mode="Flighting", + threshold_observations=[azure.sentinel.AlertRuleAnomalyDuplicateThresholdObservationArgs( + name="Anomaly score threshold", + value="0.6", + )]) + ``` + ## Import Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. @@ -651,6 +679,34 @@ def __init__(__self__, """ Manages a Duplicated Anomaly Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + workspace_id=example_analytics_workspace.id, + customer_managed_key_enabled=False) + example_alert_rule_anomaly = azure.sentinel.get_alert_rule_anomaly_output(log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="UEBA Anomalous Sign In") + example_alert_rule_anomaly_duplicate = azure.sentinel.AlertRuleAnomalyDuplicate("exampleAlertRuleAnomalyDuplicate", + display_name="example duplicated UEBA Anomalous Sign In", + log_analytics_workspace_id=example_analytics_workspace.id, + built_in_rule_id=example_alert_rule_anomaly.id, + enabled=True, + mode="Flighting", + threshold_observations=[azure.sentinel.AlertRuleAnomalyDuplicateThresholdObservationArgs( + name="Anomaly score threshold", + value="0.6", + )]) + ``` + ## Import Built In Anomaly Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_fusion.py b/sdk/python/pulumi_azure/sentinel/alert_rule_fusion.py index 9bbaff5e97..2335d5ae3c 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_fusion.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_fusion.py @@ -251,6 +251,32 @@ def __init__(__self__, """ Manages a Sentinel Fusion Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="SecurityInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/SecurityInsights", + )) + example_alert_rule_fusion = azure.sentinel.AlertRuleFusion("exampleAlertRuleFusion", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id, + alert_rule_template_guid="f71aba3d-28fb-450b-b192-4e76a83015c8") + ``` + ## Import Sentinel Fusion Alert Rules can be imported using the `resource id`, e.g. @@ -276,6 +302,32 @@ def __init__(__self__, """ Manages a Sentinel Fusion Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="SecurityInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/SecurityInsights", + )) + example_alert_rule_fusion = azure.sentinel.AlertRuleFusion("exampleAlertRuleFusion", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id, + alert_rule_template_guid="f71aba3d-28fb-450b-b192-4e76a83015c8") + ``` + ## Import Sentinel Fusion Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_machine_learning_behavior_analytics.py b/sdk/python/pulumi_azure/sentinel/alert_rule_machine_learning_behavior_analytics.py index 560668c15a..5b30e4c624 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_machine_learning_behavior_analytics.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_machine_learning_behavior_analytics.py @@ -212,6 +212,23 @@ def __init__(__self__, """ Manages a Sentinel Machine Learning Behavior Analytics Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_machine_learning_behavior_analytics = azure.sentinel.AlertRuleMachineLearningBehaviorAnalytics("exampleAlertRuleMachineLearningBehaviorAnalytics", + log_analytics_workspace_id=example_analytics_workspace.id, + alert_rule_template_guid="737a2ce1-70a3-4968-9e90-3e6aca836abf") + ``` + ## Import Sentinel Machine Learning Behavior Analytics Rules can be imported using the `resource id`, e.g. @@ -236,6 +253,23 @@ def __init__(__self__, """ Manages a Sentinel Machine Learning Behavior Analytics Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_machine_learning_behavior_analytics = azure.sentinel.AlertRuleMachineLearningBehaviorAnalytics("exampleAlertRuleMachineLearningBehaviorAnalytics", + log_analytics_workspace_id=example_analytics_workspace.id, + alert_rule_template_guid="737a2ce1-70a3-4968-9e90-3e6aca836abf") + ``` + ## Import Sentinel Machine Learning Behavior Analytics Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_ms_security_incident.py b/sdk/python/pulumi_azure/sentinel/alert_rule_ms_security_incident.py index b5ed2a1468..6353b0cb0f 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_ms_security_incident.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_ms_security_incident.py @@ -464,6 +464,25 @@ def __init__(__self__, """ Manages a Sentinel MS Security Incident Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_ms_security_incident = azure.sentinel.AlertRuleMsSecurityIncident("exampleAlertRuleMsSecurityIncident", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + product_filter="Microsoft Cloud App Security", + display_name="example rule", + severity_filters=["High"]) + ``` + ## Import Sentinel MS Security Incident Alert Rules can be imported using the `resource id`, e.g. @@ -496,6 +515,25 @@ def __init__(__self__, """ Manages a Sentinel MS Security Incident Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_ms_security_incident = azure.sentinel.AlertRuleMsSecurityIncident("exampleAlertRuleMsSecurityIncident", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + product_filter="Microsoft Cloud App Security", + display_name="example rule", + severity_filters=["High"]) + ``` + ## Import Sentinel MS Security Incident Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_nrt.py b/sdk/python/pulumi_azure/sentinel/alert_rule_nrt.py index 21fa878588..1fe464a2fc 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_nrt.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_nrt.py @@ -823,6 +823,29 @@ def __init__(__self__, """ Manages a Sentinel NRT Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="pergb2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_nrt = azure.sentinel.AlertRuleNrt("exampleAlertRuleNrt", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example", + severity="High", + query=\"\"\"AzureActivity | + where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + where ActivityStatus == "Succeeded" | + make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + \"\"\") + ``` + ## Import Sentinel NRT Alert Rules can be imported using the `resource id`, e.g. @@ -866,6 +889,29 @@ def __init__(__self__, """ Manages a Sentinel NRT Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="pergb2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_nrt = azure.sentinel.AlertRuleNrt("exampleAlertRuleNrt", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example", + severity="High", + query=\"\"\"AzureActivity | + where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + where ActivityStatus == "Succeeded" | + make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + \"\"\") + ``` + ## Import Sentinel NRT Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_scheduled.py b/sdk/python/pulumi_azure/sentinel/alert_rule_scheduled.py index c07567d22b..022aec178f 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_scheduled.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_scheduled.py @@ -999,6 +999,29 @@ def __init__(__self__, """ Manages a Sentinel Scheduled Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_scheduled = azure.sentinel.AlertRuleScheduled("exampleAlertRuleScheduled", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example", + severity="High", + query=\"\"\"AzureActivity | + where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + where ActivityStatus == "Succeeded" | + make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + \"\"\") + ``` + ## Import Sentinel Scheduled Alert Rules can be imported using the `resource id`, e.g. @@ -1048,6 +1071,29 @@ def __init__(__self__, """ Manages a Sentinel Scheduled Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_alert_rule_scheduled = azure.sentinel.AlertRuleScheduled("exampleAlertRuleScheduled", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example", + severity="High", + query=\"\"\"AzureActivity | + where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + where ActivityStatus == "Succeeded" | + make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + \"\"\") + ``` + ## Import Sentinel Scheduled Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/alert_rule_threat_intelligence.py b/sdk/python/pulumi_azure/sentinel/alert_rule_threat_intelligence.py index fdca066ed5..23e511b2f8 100644 --- a/sdk/python/pulumi_azure/sentinel/alert_rule_threat_intelligence.py +++ b/sdk/python/pulumi_azure/sentinel/alert_rule_threat_intelligence.py @@ -212,6 +212,34 @@ def __init__(__self__, """ Manages a Sentinel Threat Intelligence Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="pergb2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="SecurityInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/SecurityInsights", + )) + example_alert_rule_template = azure.sentinel.get_alert_rule_template_output(display_name="(Preview) Microsoft Defender Threat Intelligence Analytics", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id) + example_alert_rule_threat_intelligence = azure.sentinel.AlertRuleThreatIntelligence("exampleAlertRuleThreatIntelligence", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id, + alert_rule_template_guid=example_alert_rule_template.name) + ``` + ## Import Sentinel Threat Intelligence Alert Rules can be imported using the `resource id`, e.g. @@ -236,6 +264,34 @@ def __init__(__self__, """ Manages a Sentinel Threat Intelligence Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="pergb2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="SecurityInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/SecurityInsights", + )) + example_alert_rule_template = azure.sentinel.get_alert_rule_template_output(display_name="(Preview) Microsoft Defender Threat Intelligence Analytics", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id) + example_alert_rule_threat_intelligence = azure.sentinel.AlertRuleThreatIntelligence("exampleAlertRuleThreatIntelligence", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id, + alert_rule_template_guid=example_alert_rule_template.name) + ``` + ## Import Sentinel Threat Intelligence Alert Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/authomation_rule.py b/sdk/python/pulumi_azure/sentinel/authomation_rule.py index eac2cdbad8..98a6981cdd 100644 --- a/sdk/python/pulumi_azure/sentinel/authomation_rule.py +++ b/sdk/python/pulumi_azure/sentinel/authomation_rule.py @@ -564,6 +564,28 @@ def __init__(__self__, """ Manages a Sentinel Automation Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_automation_rule = azure.sentinel.AutomationRule("exampleAutomationRule", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="automation_rule1", + order=1, + action_incidents=[azure.sentinel.AutomationRuleActionIncidentArgs( + order=1, + status="Active", + )]) + ``` + ## Import Sentinel Automation Rules can be imported using the `resource id`, e.g. @@ -600,6 +622,28 @@ def __init__(__self__, """ Manages a Sentinel Automation Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_automation_rule = azure.sentinel.AutomationRule("exampleAutomationRule", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="automation_rule1", + order=1, + action_incidents=[azure.sentinel.AutomationRuleActionIncidentArgs( + order=1, + status="Active", + )]) + ``` + ## Import Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/automation_rule.py b/sdk/python/pulumi_azure/sentinel/automation_rule.py index e828e39dca..66287ecf23 100644 --- a/sdk/python/pulumi_azure/sentinel/automation_rule.py +++ b/sdk/python/pulumi_azure/sentinel/automation_rule.py @@ -559,6 +559,28 @@ def __init__(__self__, """ Manages a Sentinel Automation Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_automation_rule = azure.sentinel.AutomationRule("exampleAutomationRule", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="automation_rule1", + order=1, + action_incidents=[azure.sentinel.AutomationRuleActionIncidentArgs( + order=1, + status="Active", + )]) + ``` + ## Import Sentinel Automation Rules can be imported using the `resource id`, e.g. @@ -595,6 +617,28 @@ def __init__(__self__, """ Manages a Sentinel Automation Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_automation_rule = azure.sentinel.AutomationRule("exampleAutomationRule", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="automation_rule1", + order=1, + action_incidents=[azure.sentinel.AutomationRuleActionIncidentArgs( + order=1, + status="Active", + )]) + ``` + ## Import Sentinel Automation Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_aws_cloud_trail.py b/sdk/python/pulumi_azure/sentinel/data_connector_aws_cloud_trail.py index 311f354e2d..cc0c25ef36 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_aws_cloud_trail.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_aws_cloud_trail.py @@ -175,6 +175,23 @@ def __init__(__self__, """ Manages a AWS CloudTrail Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_aws_cloud_trail = azure.sentinel.DataConnectorAwsCloudTrail("exampleDataConnectorAwsCloudTrail", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + aws_role_arn="arn:aws:iam::000000000000:role/role1") + ``` + ## Import AWS CloudTrail Data Connectors can be imported using the `resource id`, e.g. @@ -198,6 +215,23 @@ def __init__(__self__, """ Manages a AWS CloudTrail Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_aws_cloud_trail = azure.sentinel.DataConnectorAwsCloudTrail("exampleDataConnectorAwsCloudTrail", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + aws_role_arn="arn:aws:iam::000000000000:role/role1") + ``` + ## Import AWS CloudTrail Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_aws_s3.py b/sdk/python/pulumi_azure/sentinel/data_connector_aws_s3.py index 5f6043f764..c49ac936d0 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_aws_s3.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_aws_s3.py @@ -259,6 +259,25 @@ def __init__(__self__, """ Manages a AWS S3 Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_aws_s3 = azure.sentinel.DataConnectorAwsS3("exampleDataConnectorAwsS3", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + aws_role_arn="arn:aws:iam::000000000000:role/role1", + destination_table="AWSGuardDuty", + sqs_urls=["https://sqs.us-east-1.amazonaws.com/000000000000/example"]) + ``` + ## Import AWS S3 Data Connectors can be imported using the `resource id`, e.g. @@ -284,6 +303,25 @@ def __init__(__self__, """ Manages a AWS S3 Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_aws_s3 = azure.sentinel.DataConnectorAwsS3("exampleDataConnectorAwsS3", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + aws_role_arn="arn:aws:iam::000000000000:role/role1", + destination_table="AWSGuardDuty", + sqs_urls=["https://sqs.us-east-1.amazonaws.com/000000000000/example"]) + ``` + ## Import AWS S3 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_azure_active_directory.py b/sdk/python/pulumi_azure/sentinel/data_connector_azure_active_directory.py index 4019e7c4a3..6794a7e75e 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_azure_active_directory.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_azure_active_directory.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages a Azure Active Directory Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_azure_active_directory = azure.sentinel.DataConnectorAzureActiveDirectory("exampleDataConnectorAzureActiveDirectory", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Azure Active Directory Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages a Azure Active Directory Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_azure_active_directory = azure.sentinel.DataConnectorAzureActiveDirectory("exampleDataConnectorAzureActiveDirectory", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Azure Active Directory Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_azure_advanced_thread_protection.py b/sdk/python/pulumi_azure/sentinel/data_connector_azure_advanced_thread_protection.py index f4710ecfe6..3dcfd4d19d 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_azure_advanced_thread_protection.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_azure_advanced_thread_protection.py @@ -184,6 +184,21 @@ def __init__(__self__, !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_azure_advanced_thread_protection = azure.sentinel.DataConnectorAzureAdvancedThreadProtection("exampleDataConnectorAzureAdvancedThreadProtection", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Azure Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. @@ -211,6 +226,21 @@ def __init__(__self__, !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_azure_advanced_thread_protection = azure.sentinel.DataConnectorAzureAdvancedThreadProtection("exampleDataConnectorAzureAdvancedThreadProtection", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Azure Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_azure_security_center.py b/sdk/python/pulumi_azure/sentinel/data_connector_azure_security_center.py index 7f246c21c4..b045ffe959 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_azure_security_center.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_azure_security_center.py @@ -174,6 +174,21 @@ def __init__(__self__, """ Manages a Azure Security Center Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_azure_security_center = azure.sentinel.DataConnectorAzureSecurityCenter("exampleDataConnectorAzureSecurityCenter", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Azure Security Center Data Connectors can be imported using the `resource id`, e.g. @@ -197,6 +212,21 @@ def __init__(__self__, """ Manages a Azure Security Center Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_azure_security_center = azure.sentinel.DataConnectorAzureSecurityCenter("exampleDataConnectorAzureSecurityCenter", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Azure Security Center Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_dynamics365.py b/sdk/python/pulumi_azure/sentinel/data_connector_dynamics365.py index 29f399ecaa..bb19818998 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_dynamics365.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_dynamics365.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages a Dynamics 365 Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_dynamics365 = azure.sentinel.DataConnectorDynamics365("exampleDataConnectorDynamics365", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Dynamics 365 Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages a Dynamics 365 Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_dynamics365 = azure.sentinel.DataConnectorDynamics365("exampleDataConnectorDynamics365", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Dynamics 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_iot.py b/sdk/python/pulumi_azure/sentinel/data_connector_iot.py index a9cabd142a..53878b331d 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_iot.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_iot.py @@ -174,6 +174,21 @@ def __init__(__self__, """ Manages an Iot Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_iot = azure.sentinel.DataConnectorIot("exampleDataConnectorIot", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Iot Data Connectors can be imported using the `resource id`, e.g. @@ -197,6 +212,21 @@ def __init__(__self__, """ Manages an Iot Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_iot = azure.sentinel.DataConnectorIot("exampleDataConnectorIot", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Iot Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_cloud_app_security.py b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_cloud_app_security.py index 41ab1e219c..df1a75ef19 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_cloud_app_security.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_cloud_app_security.py @@ -274,6 +274,21 @@ def __init__(__self__, !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_cloud_app_security = azure.sentinel.DataConnectorMicrosoftCloudAppSecurity("exampleDataConnectorMicrosoftCloudAppSecurity", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Microsoft Cloud App Security Data Connectors can be imported using the `resource id`, e.g. @@ -305,6 +320,21 @@ def __init__(__self__, !> **NOTE:** This resource requires that [Enterprise Mobility + Security E5](https://www.microsoft.com/en-us/microsoft-365/enterprise-mobility-security) is enabled on the tenant being connected to. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_cloud_app_security = azure.sentinel.DataConnectorMicrosoftCloudAppSecurity("exampleDataConnectorMicrosoftCloudAppSecurity", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Microsoft Cloud App Security Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_defender_advanced_threat_protection.py b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_defender_advanced_threat_protection.py index 4886d0e167..bd668ca092 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_defender_advanced_threat_protection.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_defender_advanced_threat_protection.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages a Microsoft Defender Advanced Threat Protection Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_defender_advanced_threat_protection = azure.sentinel.DataConnectorMicrosoftDefenderAdvancedThreatProtection("exampleDataConnectorMicrosoftDefenderAdvancedThreatProtection", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Microsoft Defender Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages a Microsoft Defender Advanced Threat Protection Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_defender_advanced_threat_protection = azure.sentinel.DataConnectorMicrosoftDefenderAdvancedThreatProtection("exampleDataConnectorMicrosoftDefenderAdvancedThreatProtection", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Microsoft Defender Advanced Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_intelligence.py b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_intelligence.py index 6507fae5e3..2b56f3e2ea 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_intelligence.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_intelligence.py @@ -300,6 +300,23 @@ def __init__(__self__, """ Manages a Microsoft Threat Intelligence Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_threat_intelligence = azure.sentinel.DataConnectorMicrosoftThreatIntelligence("exampleDataConnectorMicrosoftThreatIntelligence", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + microsoft_emerging_threat_feed_lookback_date="1970-01-01T00:00:00Z") + ``` + ## Import sentinels can be imported using the `resource id`, e.g. @@ -333,6 +350,23 @@ def __init__(__self__, """ Manages a Microsoft Threat Intelligence Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_threat_intelligence = azure.sentinel.DataConnectorMicrosoftThreatIntelligence("exampleDataConnectorMicrosoftThreatIntelligence", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + microsoft_emerging_threat_feed_lookback_date="1970-01-01T00:00:00Z") + ``` + ## Import sentinels can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_protection.py b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_protection.py index 4685f6fce2..f714bad742 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_protection.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_microsoft_threat_protection.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages a Microsoft Threat Protection Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_threat_protection = azure.sentinel.DataConnectorMicrosoftThreatProtection("exampleDataConnectorMicrosoftThreatProtection", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Microsoft Threat Protection Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages a Microsoft Threat Protection Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_microsoft_threat_protection = azure.sentinel.DataConnectorMicrosoftThreatProtection("exampleDataConnectorMicrosoftThreatProtection", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Microsoft Threat Protection Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_office365.py b/sdk/python/pulumi_azure/sentinel/data_connector_office365.py index 6c30a584bd..73f99da01e 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_office365.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_office365.py @@ -313,6 +313,21 @@ def __init__(__self__, """ Manages a Office 365 Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office365 = azure.sentinel.DataConnectorOffice365("exampleDataConnectorOffice365", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office 365 Data Connectors can be imported using the `resource id`, e.g. @@ -343,6 +358,21 @@ def __init__(__self__, """ Manages a Office 365 Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office365 = azure.sentinel.DataConnectorOffice365("exampleDataConnectorOffice365", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office 365 Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_office365_project.py b/sdk/python/pulumi_azure/sentinel/data_connector_office365_project.py index b277bcde0f..0a1831b47e 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_office365_project.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_office365_project.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages an Office 365 Project Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office365_project = azure.sentinel.DataConnectorOffice365Project("exampleDataConnectorOffice365Project", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office 365 Project Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages an Office 365 Project Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office365_project = azure.sentinel.DataConnectorOffice365Project("exampleDataConnectorOffice365Project", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office 365 Project Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_office_atp.py b/sdk/python/pulumi_azure/sentinel/data_connector_office_atp.py index a7c1287478..8ffe44f37d 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_office_atp.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_office_atp.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages a Office ATP Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office_atp = azure.sentinel.DataConnectorOfficeAtp("exampleDataConnectorOfficeAtp", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office ATP Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages a Office ATP Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office_atp = azure.sentinel.DataConnectorOfficeAtp("exampleDataConnectorOfficeAtp", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office ATP Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_office_irm.py b/sdk/python/pulumi_azure/sentinel/data_connector_office_irm.py index 1fade6efd3..cf6e1f0491 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_office_irm.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_office_irm.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages an Office IRM Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office_irm = azure.sentinel.DataConnectorOfficeIrm("exampleDataConnectorOfficeIrm", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office IRM Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages an Office IRM Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office_irm = azure.sentinel.DataConnectorOfficeIrm("exampleDataConnectorOfficeIrm", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office IRM Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_office_power_bi.py b/sdk/python/pulumi_azure/sentinel/data_connector_office_power_bi.py index c018538586..35d53a18b7 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_office_power_bi.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_office_power_bi.py @@ -182,6 +182,21 @@ def __init__(__self__, """ Manages an Office Power BI Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office_power_bi = azure.sentinel.DataConnectorOfficePowerBi("exampleDataConnectorOfficePowerBi", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office Power BI Data Connectors can be imported using the `resource id`, e.g. @@ -207,6 +222,21 @@ def __init__(__self__, """ Manages an Office Power BI Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_office_power_bi = azure.sentinel.DataConnectorOfficePowerBi("exampleDataConnectorOfficePowerBi", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Office Power BI Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence.py b/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence.py index c9ac5290d1..d0352f4a27 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence.py @@ -223,6 +223,21 @@ def __init__(__self__, """ Manages a Threat Intelligence Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_threat_intelligence = azure.sentinel.DataConnectorThreatIntelligence("exampleDataConnectorThreatIntelligence", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Threat Intelligence Data Connectors can be imported using the `resource id`, e.g. @@ -249,6 +264,21 @@ def __init__(__self__, """ Manages a Threat Intelligence Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_threat_intelligence = azure.sentinel.DataConnectorThreatIntelligence("exampleDataConnectorThreatIntelligence", log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id) + ``` + ## Import Threat Intelligence Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence_taxii.py b/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence_taxii.py index 6234f9ebd0..9bcfb2b3fd 100644 --- a/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence_taxii.py +++ b/sdk/python/pulumi_azure/sentinel/data_connector_threat_intelligence_taxii.py @@ -468,6 +468,25 @@ def __init__(__self__, """ Manages an Threat Intelligence TAXII Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_threat_intelligence_taxii = azure.sentinel.DataConnectorThreatIntelligenceTaxii("exampleDataConnectorThreatIntelligenceTaxii", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example", + api_root_url="https://foo/taxii2/api2/", + collection_id="someid") + ``` + ## Import Threat Intelligence TAXII Data Connectors can be imported using the `resource id`, e.g. @@ -500,6 +519,25 @@ def __init__(__self__, """ Manages an Threat Intelligence TAXII Data Connector. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_data_connector_threat_intelligence_taxii = azure.sentinel.DataConnectorThreatIntelligenceTaxii("exampleDataConnectorThreatIntelligenceTaxii", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example", + api_root_url="https://foo/taxii2/api2/", + collection_id="someid") + ``` + ## Import Threat Intelligence TAXII Data Connectors can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/get_alert_rule.py b/sdk/python/pulumi_azure/sentinel/get_alert_rule.py index e1ef6742f3..f197ee5d41 100644 --- a/sdk/python/pulumi_azure/sentinel/get_alert_rule.py +++ b/sdk/python/pulumi_azure/sentinel/get_alert_rule.py @@ -68,6 +68,19 @@ def get_alert_rule(log_analytics_workspace_id: Optional[str] = None, """ Use this data source to access information about an existing Sentinel Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_analytics_workspace = azure.operationalinsights.get_analytics_workspace(name="example", + resource_group_name="example-resources") + example_alert_rule = azure.sentinel.get_alert_rule(name="existing", + log_analytics_workspace_id=example_analytics_workspace.id) + pulumi.export("id", example_alert_rule.id) + ``` + :param str log_analytics_workspace_id: The ID of the Log Analytics Workspace this Sentinel Alert Rule belongs to. :param str name: The name which should be used for this Sentinel Alert Rule. @@ -91,6 +104,19 @@ def get_alert_rule_output(log_analytics_workspace_id: Optional[pulumi.Input[str] """ Use this data source to access information about an existing Sentinel Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_analytics_workspace = azure.operationalinsights.get_analytics_workspace(name="example", + resource_group_name="example-resources") + example_alert_rule = azure.sentinel.get_alert_rule(name="existing", + log_analytics_workspace_id=example_analytics_workspace.id) + pulumi.export("id", example_alert_rule.id) + ``` + :param str log_analytics_workspace_id: The ID of the Log Analytics Workspace this Sentinel Alert Rule belongs to. :param str name: The name which should be used for this Sentinel Alert Rule. diff --git a/sdk/python/pulumi_azure/sentinel/get_alert_rule_anomaly.py b/sdk/python/pulumi_azure/sentinel/get_alert_rule_anomaly.py index fab88ecefe..cc8c438fbd 100644 --- a/sdk/python/pulumi_azure/sentinel/get_alert_rule_anomaly.py +++ b/sdk/python/pulumi_azure/sentinel/get_alert_rule_anomaly.py @@ -247,6 +247,25 @@ def get_alert_rule_anomaly(display_name: Optional[str] = None, """ Use this data source to access information about an existing Anomaly Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + workspace_id=example_analytics_workspace.id, + customer_managed_key_enabled=False) + example_alert_rule_anomaly = azure.sentinel.get_alert_rule_anomaly_output(log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="Potential data staging") + pulumi.export("id", example_alert_rule_anomaly.id) + ``` + :param str display_name: The display name of this Sentinel Alert Rule Template. Either `display_name` or `name` have to be specified. @@ -290,6 +309,25 @@ def get_alert_rule_anomaly_output(display_name: Optional[pulumi.Input[Optional[s """ Use this data source to access information about an existing Anomaly Alert Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + workspace_id=example_analytics_workspace.id, + customer_managed_key_enabled=False) + example_alert_rule_anomaly = azure.sentinel.get_alert_rule_anomaly_output(log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="Potential data staging") + pulumi.export("id", example_alert_rule_anomaly.id) + ``` + :param str display_name: The display name of this Sentinel Alert Rule Template. Either `display_name` or `name` have to be specified. diff --git a/sdk/python/pulumi_azure/sentinel/get_alert_rule_template.py b/sdk/python/pulumi_azure/sentinel/get_alert_rule_template.py index 70a961d79b..7f1142071f 100644 --- a/sdk/python/pulumi_azure/sentinel/get_alert_rule_template.py +++ b/sdk/python/pulumi_azure/sentinel/get_alert_rule_template.py @@ -115,6 +115,17 @@ def get_alert_rule_template(display_name: Optional[str] = None, """ Use this data source to access information about an existing Sentinel Alert Rule Template. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sentinel.get_alert_rule_template(log_analytics_workspace_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", + display_name="Create incidents based on Azure Security Center for IoT alerts") + pulumi.export("id", example.id) + ``` + :param str display_name: The display name of this Sentinel Alert Rule Template. Either `display_name` or `name` have to be specified. @@ -147,6 +158,17 @@ def get_alert_rule_template_output(display_name: Optional[pulumi.Input[Optional[ """ Use this data source to access information about an existing Sentinel Alert Rule Template. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sentinel.get_alert_rule_template(log_analytics_workspace_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", + display_name="Create incidents based on Azure Security Center for IoT alerts") + pulumi.export("id", example.id) + ``` + :param str display_name: The display name of this Sentinel Alert Rule Template. Either `display_name` or `name` have to be specified. diff --git a/sdk/python/pulumi_azure/sentinel/log_analytics_workspace_onboarding.py b/sdk/python/pulumi_azure/sentinel/log_analytics_workspace_onboarding.py index bfd9dc7c2c..621022ea8d 100644 --- a/sdk/python/pulumi_azure/sentinel/log_analytics_workspace_onboarding.py +++ b/sdk/python/pulumi_azure/sentinel/log_analytics_workspace_onboarding.py @@ -250,6 +250,23 @@ def __init__(__self__, """ Manages a Security Insights Sentinel Onboarding. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name, + customer_managed_key_enabled=False) + ``` + ## Import Security Insights Sentinel Onboarding States can be imported using the `resource id`, e.g. @@ -277,6 +294,23 @@ def __init__(__self__, """ Manages a Security Insights Sentinel Onboarding. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name, + customer_managed_key_enabled=False) + ``` + ## Import Security Insights Sentinel Onboarding States can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/metadata.py b/sdk/python/pulumi_azure/sentinel/metadata.py index 0d5c5f286b..c752a5c264 100644 --- a/sdk/python/pulumi_azure/sentinel/metadata.py +++ b/sdk/python/pulumi_azure/sentinel/metadata.py @@ -869,6 +869,43 @@ def __init__(__self__, """ Manages a Sentinel Metadata. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="pergb2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="SecurityInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/SecurityInsights", + )) + example_alert_rule_nrt = azure.sentinel.AlertRuleNrt("exampleAlertRuleNrt", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id, + display_name="example", + severity="High", + query=\"\"\"AzureActivity | + where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + where ActivityStatus == "Succeeded" | + make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + \"\"\") + example_metadata = azure.sentinel.Metadata("exampleMetadata", + workspace_id=example_analytics_solution.workspace_resource_id, + content_id=example_alert_rule_nrt.name, + kind="AnalyticsRule", + parent_id=example_alert_rule_nrt.id) + ``` + ## Import Sentinel Metadata can be imported using the `resource id`, e.g. @@ -908,6 +945,43 @@ def __init__(__self__, """ Manages a Sentinel Metadata. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="pergb2018") + example_analytics_solution = azure.operationalinsights.AnalyticsSolution("exampleAnalyticsSolution", + solution_name="SecurityInsights", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + workspace_resource_id=example_analytics_workspace.id, + workspace_name=example_analytics_workspace.name, + plan=azure.operationalinsights.AnalyticsSolutionPlanArgs( + publisher="Microsoft", + product="OMSGallery/SecurityInsights", + )) + example_alert_rule_nrt = azure.sentinel.AlertRuleNrt("exampleAlertRuleNrt", + log_analytics_workspace_id=example_analytics_solution.workspace_resource_id, + display_name="example", + severity="High", + query=\"\"\"AzureActivity | + where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" | + where ActivityStatus == "Succeeded" | + make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller + \"\"\") + example_metadata = azure.sentinel.Metadata("exampleMetadata", + workspace_id=example_analytics_solution.workspace_resource_id, + content_id=example_alert_rule_nrt.name, + kind="AnalyticsRule", + parent_id=example_alert_rule_nrt.id) + ``` + ## Import Sentinel Metadata can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/threat_intelligence_indicator.py b/sdk/python/pulumi_azure/sentinel/threat_intelligence_indicator.py index 61976ebed1..222830edd5 100644 --- a/sdk/python/pulumi_azure/sentinel/threat_intelligence_indicator.py +++ b/sdk/python/pulumi_azure/sentinel/threat_intelligence_indicator.py @@ -1002,6 +1002,31 @@ def __init__(__self__, """ Manages a Sentinel Threat Intelligence Indicator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name) + example_threat_intelligence_indicator = azure.sentinel.ThreatIntelligenceIndicator("exampleThreatIntelligenceIndicator", + workspace_id=example_analytics_workspace.id, + pattern_type="domain-name", + pattern="http://example.com", + source="Microsoft Sentinel", + validate_from_utc="2022-12-14T16:00:00Z", + display_name="example-indicator", + opts=pulumi.ResourceOptions(depends_on=[azurerm_sentinel_log_analytics_workspace_onboarding["test"]])) + ``` + ## Import Sentinel Threat Intelligence Indicators can be imported using the `resource id`, e.g. @@ -1042,6 +1067,31 @@ def __init__(__self__, """ Manages a Sentinel Threat Intelligence Indicator. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018", + retention_in_days=30) + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", + resource_group_name=example_resource_group.name, + workspace_name=example_analytics_workspace.name) + example_threat_intelligence_indicator = azure.sentinel.ThreatIntelligenceIndicator("exampleThreatIntelligenceIndicator", + workspace_id=example_analytics_workspace.id, + pattern_type="domain-name", + pattern="http://example.com", + source="Microsoft Sentinel", + validate_from_utc="2022-12-14T16:00:00Z", + display_name="example-indicator", + opts=pulumi.ResourceOptions(depends_on=[azurerm_sentinel_log_analytics_workspace_onboarding["test"]])) + ``` + ## Import Sentinel Threat Intelligence Indicators can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/watchlist.py b/sdk/python/pulumi_azure/sentinel/watchlist.py index 7013ee3631..f452d5ecee 100644 --- a/sdk/python/pulumi_azure/sentinel/watchlist.py +++ b/sdk/python/pulumi_azure/sentinel/watchlist.py @@ -332,6 +332,24 @@ def __init__(__self__, """ Manages a Sentinel Watchlist. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_watchlist = azure.sentinel.Watchlist("exampleWatchlist", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example-wl", + item_search_key="Key") + ``` + ## Import Sentinel Watchlists can be imported using the `resource id`, e.g. @@ -359,6 +377,24 @@ def __init__(__self__, """ Manages a Sentinel Watchlist. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_watchlist = azure.sentinel.Watchlist("exampleWatchlist", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example-wl", + item_search_key="Key") + ``` + ## Import Sentinel Watchlists can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sentinel/watchlist_item.py b/sdk/python/pulumi_azure/sentinel/watchlist_item.py index 9594df9a0c..60460f83b2 100644 --- a/sdk/python/pulumi_azure/sentinel/watchlist_item.py +++ b/sdk/python/pulumi_azure/sentinel/watchlist_item.py @@ -171,6 +171,30 @@ def __init__(__self__, """ Manages a Sentinel Watchlist Item. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_watchlist = azure.sentinel.Watchlist("exampleWatchlist", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example-wl", + item_search_key="Key") + example_watchlist_item = azure.sentinel.WatchlistItem("exampleWatchlistItem", + watchlist_id=example_watchlist.id, + properties={ + "k1": "v1", + "k2": "v2", + }) + ``` + ## Import Sentinel Watchlist Items can be imported using the `resource id`, e.g. @@ -194,6 +218,30 @@ def __init__(__self__, """ Manages a Sentinel Watchlist Item. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="PerGB2018") + example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", workspace_id=example_analytics_workspace.id) + example_watchlist = azure.sentinel.Watchlist("exampleWatchlist", + log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id, + display_name="example-wl", + item_search_key="Key") + example_watchlist_item = azure.sentinel.WatchlistItem("exampleWatchlistItem", + watchlist_id=example_watchlist.id, + properties={ + "k1": "v1", + "k2": "v2", + }) + ``` + ## Import Sentinel Watchlist Items can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/get_namespace.py b/sdk/python/pulumi_azure/servicebus/get_namespace.py index d70c05edc3..10dfba715b 100644 --- a/sdk/python/pulumi_azure/servicebus/get_namespace.py +++ b/sdk/python/pulumi_azure/servicebus/get_namespace.py @@ -190,6 +190,17 @@ def get_namespace(name: Optional[str] = None, """ Use this data source to access information about an existing ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_namespace(name="examplenamespace", + resource_group_name="example-resources") + pulumi.export("location", example.location) + ``` + :param str name: Specifies the name of the ServiceBus Namespace. :param str resource_group_name: Specifies the name of the Resource Group where the ServiceBus Namespace exists. @@ -223,6 +234,17 @@ def get_namespace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_namespace(name="examplenamespace", + resource_group_name="example-resources") + pulumi.export("location", example.location) + ``` + :param str name: Specifies the name of the ServiceBus Namespace. :param str resource_group_name: Specifies the name of the Resource Group where the ServiceBus Namespace exists. diff --git a/sdk/python/pulumi_azure/servicebus/get_namespace_authorization_rule.py b/sdk/python/pulumi_azure/servicebus/get_namespace_authorization_rule.py index b861ef3d69..82d4f47cdb 100644 --- a/sdk/python/pulumi_azure/servicebus/get_namespace_authorization_rule.py +++ b/sdk/python/pulumi_azure/servicebus/get_namespace_authorization_rule.py @@ -166,6 +166,17 @@ def get_namespace_authorization_rule(name: Optional[str] = None, """ Use this data source to access information about an existing ServiceBus Namespace Authorization Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_namespace_authorization_rule(name="examplerule", + namespace_id="examplenamespace") + pulumi.export("ruleId", example.id) + ``` + :param str name: Specifies the name of the ServiceBus Namespace Authorization Rule. :param str namespace_id: Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists. @@ -205,6 +216,17 @@ def get_namespace_authorization_rule_output(name: Optional[pulumi.Input[str]] = """ Use this data source to access information about an existing ServiceBus Namespace Authorization Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_namespace_authorization_rule(name="examplerule", + namespace_id="examplenamespace") + pulumi.export("ruleId", example.id) + ``` + :param str name: Specifies the name of the ServiceBus Namespace Authorization Rule. :param str namespace_id: Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists. diff --git a/sdk/python/pulumi_azure/servicebus/get_queue.py b/sdk/python/pulumi_azure/servicebus/get_queue.py index a13e198171..909951fccd 100644 --- a/sdk/python/pulumi_azure/servicebus/get_queue.py +++ b/sdk/python/pulumi_azure/servicebus/get_queue.py @@ -274,6 +274,17 @@ def get_queue(name: Optional[str] = None, """ Use this data source to access information about an existing Service Bus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_queue(name="existing", + namespace_id="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Service Bus Queue. :param str namespace_id: The ID of the ServiceBus Namespace where the Service Bus Queue exists. @@ -322,6 +333,17 @@ def get_queue_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Service Bus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_queue(name="existing", + namespace_id="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Service Bus Queue. :param str namespace_id: The ID of the ServiceBus Namespace where the Service Bus Queue exists. diff --git a/sdk/python/pulumi_azure/servicebus/get_queue_authorization_rule.py b/sdk/python/pulumi_azure/servicebus/get_queue_authorization_rule.py index 5e1b56bf07..715e021784 100644 --- a/sdk/python/pulumi_azure/servicebus/get_queue_authorization_rule.py +++ b/sdk/python/pulumi_azure/servicebus/get_queue_authorization_rule.py @@ -197,6 +197,19 @@ def get_queue_authorization_rule(name: Optional[str] = None, """ Use this data source to access information about an existing ServiceBus Queue Authorisation Rule within a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_queue_authorization_rule(name="example-tfex_name", + resource_group_name="example-resources", + queue_name="example-servicebus_queue", + namespace_name="example-namespace") + pulumi.export("id", example.id) + ``` + :param str name: The name of this ServiceBus Queue Authorisation Rule. :param str namespace_name: The name of the ServiceBus Namespace. @@ -240,6 +253,19 @@ def get_queue_authorization_rule_output(name: Optional[pulumi.Input[str]] = None """ Use this data source to access information about an existing ServiceBus Queue Authorisation Rule within a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_queue_authorization_rule(name="example-tfex_name", + resource_group_name="example-resources", + queue_name="example-servicebus_queue", + namespace_name="example-namespace") + pulumi.export("id", example.id) + ``` + :param str name: The name of this ServiceBus Queue Authorisation Rule. :param str namespace_name: The name of the ServiceBus Namespace. diff --git a/sdk/python/pulumi_azure/servicebus/get_subscription.py b/sdk/python/pulumi_azure/servicebus/get_subscription.py index f8cadaf92b..4766db8239 100644 --- a/sdk/python/pulumi_azure/servicebus/get_subscription.py +++ b/sdk/python/pulumi_azure/servicebus/get_subscription.py @@ -227,6 +227,17 @@ def get_subscription(name: Optional[str] = None, """ Use this data source to access information about an existing ServiceBus Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_subscription(name="examplesubscription", + topic_id="exampletopic") + pulumi.export("servicebusSubscription", data["azurerm_servicebus_namespace"]["example"]) + ``` + :param str name: Specifies the name of the ServiceBus Subscription. :param str namespace_name: The name of the ServiceBus Namespace. @@ -274,6 +285,17 @@ def get_subscription_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing ServiceBus Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_subscription(name="examplesubscription", + topic_id="exampletopic") + pulumi.export("servicebusSubscription", data["azurerm_servicebus_namespace"]["example"]) + ``` + :param str name: Specifies the name of the ServiceBus Subscription. :param str namespace_name: The name of the ServiceBus Namespace. diff --git a/sdk/python/pulumi_azure/servicebus/get_topic.py b/sdk/python/pulumi_azure/servicebus/get_topic.py index adac0b3933..d568900f91 100644 --- a/sdk/python/pulumi_azure/servicebus/get_topic.py +++ b/sdk/python/pulumi_azure/servicebus/get_topic.py @@ -214,6 +214,17 @@ def get_topic(name: Optional[str] = None, """ Use this data source to access information about an existing Service Bus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_topic(name="existing", + namespace_id="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Service Bus Topic. :param str namespace_id: The ID of the ServiceBus Namespace where the Service Bus Topic exists. @@ -257,6 +268,17 @@ def get_topic_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Service Bus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_topic(name="existing", + namespace_id="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Service Bus Topic. :param str namespace_id: The ID of the ServiceBus Namespace where the Service Bus Topic exists. diff --git a/sdk/python/pulumi_azure/servicebus/get_topic_authorization_rule.py b/sdk/python/pulumi_azure/servicebus/get_topic_authorization_rule.py index 91a320aaab..bff087c073 100644 --- a/sdk/python/pulumi_azure/servicebus/get_topic_authorization_rule.py +++ b/sdk/python/pulumi_azure/servicebus/get_topic_authorization_rule.py @@ -207,6 +207,19 @@ def get_topic_authorization_rule(name: Optional[str] = None, """ Use this data source to access information about a ServiceBus Topic Authorization Rule within a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_topic_authorization_rule(name="example-tfex_name", + resource_group_name="example-resources", + namespace_name="example-namespace", + topic_name="example-servicebus_topic") + pulumi.export("servicebusAuthorizationRuleId", data["azurem_servicebus_topic_authorization_rule"]["example"]["id"]) + ``` + :param str name: The name of the ServiceBus Topic Authorization Rule resource. :param str namespace_name: The name of the ServiceBus Namespace. @@ -253,6 +266,19 @@ def get_topic_authorization_rule_output(name: Optional[pulumi.Input[str]] = None """ Use this data source to access information about a ServiceBus Topic Authorization Rule within a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicebus.get_topic_authorization_rule(name="example-tfex_name", + resource_group_name="example-resources", + namespace_name="example-namespace", + topic_name="example-servicebus_topic") + pulumi.export("servicebusAuthorizationRuleId", data["azurem_servicebus_topic_authorization_rule"]["example"]["id"]) + ``` + :param str name: The name of the ServiceBus Topic Authorization Rule resource. :param str namespace_name: The name of the ServiceBus Namespace. diff --git a/sdk/python/pulumi_azure/servicebus/namespace.py b/sdk/python/pulumi_azure/servicebus/namespace.py index 1f2e71d8d1..df5539a227 100644 --- a/sdk/python/pulumi_azure/servicebus/namespace.py +++ b/sdk/python/pulumi_azure/servicebus/namespace.py @@ -669,6 +669,22 @@ def __init__(__self__, """ Manages a ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + ``` + ## Import Service Bus Namespace can be imported using the `resource id`, e.g. @@ -703,6 +719,22 @@ def __init__(__self__, """ Manages a ServiceBus Namespace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + ``` + ## Import Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/namespace_authorization_rule.py b/sdk/python/pulumi_azure/servicebus/namespace_authorization_rule.py index 22a61c1894..b16bc25d6e 100644 --- a/sdk/python/pulumi_azure/servicebus/namespace_authorization_rule.py +++ b/sdk/python/pulumi_azure/servicebus/namespace_authorization_rule.py @@ -372,6 +372,27 @@ def __init__(__self__, """ Manages a ServiceBus Namespace authorization Rule within a ServiceBus. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + namespace_id=example_namespace.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. @@ -399,6 +420,27 @@ def __init__(__self__, """ Manages a ServiceBus Namespace authorization Rule within a ServiceBus. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + namespace_id=example_namespace.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Namespace authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/namespace_disaster_recovery_config.py b/sdk/python/pulumi_azure/servicebus/namespace_disaster_recovery_config.py index 1846218c01..31388a5112 100644 --- a/sdk/python/pulumi_azure/servicebus/namespace_disaster_recovery_config.py +++ b/sdk/python/pulumi_azure/servicebus/namespace_disaster_recovery_config.py @@ -298,6 +298,34 @@ def __init__(__self__, > **NOTE:** Disaster Recovery Config is a Premium SKU only capability. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.servicebus.Namespace("primary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Premium", + capacity=1) + secondary = azure.servicebus.Namespace("secondary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Premium", + capacity=1) + example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + namespace_id=azurerm_servicebus_namespace["example"]["id"], + listen=True, + send=True, + manage=False) + example_namespace_disaster_recovery_config = azure.servicebus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", + primary_namespace_id=primary.id, + partner_namespace_id=secondary.id, + alias_authorization_rule_id=example_namespace_authorization_rule.id) + ``` + ## Import Service Bus DR configs can be imported using the `resource id`, e.g. @@ -324,6 +352,34 @@ def __init__(__self__, > **NOTE:** Disaster Recovery Config is a Premium SKU only capability. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.servicebus.Namespace("primary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Premium", + capacity=1) + secondary = azure.servicebus.Namespace("secondary", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Premium", + capacity=1) + example_namespace_authorization_rule = azure.servicebus.NamespaceAuthorizationRule("exampleNamespaceAuthorizationRule", + namespace_id=azurerm_servicebus_namespace["example"]["id"], + listen=True, + send=True, + manage=False) + example_namespace_disaster_recovery_config = azure.servicebus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", + primary_namespace_id=primary.id, + partner_namespace_id=secondary.id, + alias_authorization_rule_id=example_namespace_authorization_rule.id) + ``` + ## Import Service Bus DR configs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/namespace_network_rule_set.py b/sdk/python/pulumi_azure/servicebus/namespace_network_rule_set.py index 3e3bc04702..2953894846 100644 --- a/sdk/python/pulumi_azure/servicebus/namespace_network_rule_set.py +++ b/sdk/python/pulumi_azure/servicebus/namespace_network_rule_set.py @@ -311,6 +311,42 @@ def __init__(__self__, """ Manages a ServiceBus Namespace Network Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Premium", + capacity=1) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["172.17.0.0/16"], + dns_servers=[ + "10.0.0.4", + "10.0.0.5", + ]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["172.17.0.0/24"], + service_endpoints=["Microsoft.ServiceBus"]) + example_namespace_network_rule_set = azure.servicebus.NamespaceNetworkRuleSet("exampleNamespaceNetworkRuleSet", + namespace_id=example_namespace.id, + default_action="Deny", + public_network_access_enabled=True, + network_rules=[azure.servicebus.NamespaceNetworkRuleSetNetworkRuleArgs( + subnet_id=example_subnet.id, + ignore_missing_vnet_service_endpoint=False, + )], + ip_rules=["1.1.1.1"]) + ``` + ## Import Service Bus Namespace can be imported using the `resource id`, e.g. @@ -339,6 +375,42 @@ def __init__(__self__, """ Manages a ServiceBus Namespace Network Rule Set. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Premium", + capacity=1) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + address_spaces=["172.17.0.0/16"], + dns_servers=[ + "10.0.0.4", + "10.0.0.5", + ]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["172.17.0.0/24"], + service_endpoints=["Microsoft.ServiceBus"]) + example_namespace_network_rule_set = azure.servicebus.NamespaceNetworkRuleSet("exampleNamespaceNetworkRuleSet", + namespace_id=example_namespace.id, + default_action="Deny", + public_network_access_enabled=True, + network_rules=[azure.servicebus.NamespaceNetworkRuleSetNetworkRuleArgs( + subnet_id=example_subnet.id, + ignore_missing_vnet_service_endpoint=False, + )], + ip_rules=["1.1.1.1"]) + ``` + ## Import Service Bus Namespace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/queue.py b/sdk/python/pulumi_azure/servicebus/queue.py index 81d6064b09..97bc296732 100644 --- a/sdk/python/pulumi_azure/servicebus/queue.py +++ b/sdk/python/pulumi_azure/servicebus/queue.py @@ -833,6 +833,25 @@ def __init__(__self__, """ Manages a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Queue can be imported using the `resource id`, e.g. @@ -875,6 +894,25 @@ def __init__(__self__, """ Manages a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Queue can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/queue_authorization_rule.py b/sdk/python/pulumi_azure/servicebus/queue_authorization_rule.py index 7f73bbdd9b..f1a3b2bfd4 100644 --- a/sdk/python/pulumi_azure/servicebus/queue_authorization_rule.py +++ b/sdk/python/pulumi_azure/servicebus/queue_authorization_rule.py @@ -372,6 +372,30 @@ def __init__(__self__, """ Manages an Authorization Rule for a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_queue_authorization_rule = azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", + queue_id=example_queue.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. @@ -399,6 +423,30 @@ def __init__(__self__, """ Manages an Authorization Rule for a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_queue_authorization_rule = azure.servicebus.QueueAuthorizationRule("exampleQueueAuthorizationRule", + queue_id=example_queue.id, + listen=True, + send=True, + manage=False) + ``` + ## Import ServiceBus Queue Authorization Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/subscription.py b/sdk/python/pulumi_azure/servicebus/subscription.py index cfdbe91562..f66b44b7e4 100644 --- a/sdk/python/pulumi_azure/servicebus/subscription.py +++ b/sdk/python/pulumi_azure/servicebus/subscription.py @@ -673,6 +673,28 @@ def __init__(__self__, """ Manages a ServiceBus Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + ``` + ## Import Service Bus Subscriptions can be imported using the `resource id`, e.g. @@ -710,6 +732,28 @@ def __init__(__self__, """ Manages a ServiceBus Subscription. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + ``` + ## Import Service Bus Subscriptions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/subscription_rule.py b/sdk/python/pulumi_azure/servicebus/subscription_rule.py index ea8025fce7..6b95c99999 100644 --- a/sdk/python/pulumi_azure/servicebus/subscription_rule.py +++ b/sdk/python/pulumi_azure/servicebus/subscription_rule.py @@ -313,6 +313,62 @@ def __init__(__self__, Manages a ServiceBus Subscription Rule. ## Example Usage + ### SQL Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="SqlFilter", + sql_filter="colour = 'red'") + ``` + ### Correlation Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="CorrelationFilter", + correlation_filter=azure.servicebus.SubscriptionRuleCorrelationFilterArgs( + correlation_id="high", + label="red", + properties={ + "customProperty": "value", + }, + )) + ``` ## Import @@ -341,6 +397,62 @@ def __init__(__self__, Manages a ServiceBus Subscription Rule. ## Example Usage + ### SQL Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="SqlFilter", + sql_filter="colour = 'red'") + ``` + ### Correlation Filter) + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_subscription = azure.servicebus.Subscription("exampleSubscription", + topic_id=example_topic.id, + max_delivery_count=1) + example_subscription_rule = azure.servicebus.SubscriptionRule("exampleSubscriptionRule", + subscription_id=example_subscription.id, + filter_type="CorrelationFilter", + correlation_filter=azure.servicebus.SubscriptionRuleCorrelationFilterArgs( + correlation_id="high", + label="red", + properties={ + "customProperty": "value", + }, + )) + ``` ## Import diff --git a/sdk/python/pulumi_azure/servicebus/topic.py b/sdk/python/pulumi_azure/servicebus/topic.py index 900ebd144c..bc8b51121f 100644 --- a/sdk/python/pulumi_azure/servicebus/topic.py +++ b/sdk/python/pulumi_azure/servicebus/topic.py @@ -634,6 +634,25 @@ def __init__(__self__, **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Topics can be imported using the `resource id`, e.g. @@ -674,6 +693,25 @@ def __init__(__self__, **Note** Topics can only be created in Namespaces with an SKU of `standard` or higher. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + ``` + ## Import Service Bus Topics can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicebus/topic_authorization_rule.py b/sdk/python/pulumi_azure/servicebus/topic_authorization_rule.py index 7c4bfd2475..d11d4109cf 100644 --- a/sdk/python/pulumi_azure/servicebus/topic_authorization_rule.py +++ b/sdk/python/pulumi_azure/servicebus/topic_authorization_rule.py @@ -372,6 +372,28 @@ def __init__(__self__, """ Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=True, + send=False, + manage=False) + ``` + ## Import ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. @@ -399,6 +421,28 @@ def __init__(__self__, """ Manages a ServiceBus Topic authorization Rule within a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + tags={ + "source": "example", + }) + example_topic = azure.servicebus.Topic("exampleTopic", namespace_id=example_namespace.id) + example_topic_authorization_rule = azure.servicebus.TopicAuthorizationRule("exampleTopicAuthorizationRule", + topic_id=example_topic.id, + listen=True, + send=False, + manage=False) + ``` + ## Import ServiceBus Topic authorization rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicefabric/cluster.py b/sdk/python/pulumi_azure/servicefabric/cluster.py index bce86dd0cb..09753f1d02 100644 --- a/sdk/python/pulumi_azure/servicefabric/cluster.py +++ b/sdk/python/pulumi_azure/servicefabric/cluster.py @@ -1025,6 +1025,30 @@ def __init__(__self__, """ Manages a Service Fabric Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.servicefabric.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + reliability_level="Bronze", + upgrade_mode="Manual", + cluster_code_version="7.1.456.959", + vm_image="Windows", + management_endpoint="https://example:80", + node_types=[azure.servicefabric.ClusterNodeTypeArgs( + name="first", + instance_count=3, + is_primary=True, + client_endpoint_port=2020, + http_endpoint_port=80, + )]) + ``` + ## Import Service Fabric Clusters can be imported using the `resource id`, e.g. @@ -1072,6 +1096,30 @@ def __init__(__self__, """ Manages a Service Fabric Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.servicefabric.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + reliability_level="Bronze", + upgrade_mode="Manual", + cluster_code_version="7.1.456.959", + vm_image="Windows", + management_endpoint="https://example:80", + node_types=[azure.servicefabric.ClusterNodeTypeArgs( + name="first", + instance_count=3, + is_primary=True, + client_endpoint_port=2020, + http_endpoint_port=80, + )]) + ``` + ## Import Service Fabric Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/servicefabric/managed_cluster.py b/sdk/python/pulumi_azure/servicefabric/managed_cluster.py index c5a39e34c7..5c1b71d523 100644 --- a/sdk/python/pulumi_azure/servicefabric/managed_cluster.py +++ b/sdk/python/pulumi_azure/servicefabric/managed_cluster.py @@ -729,6 +729,39 @@ def __init__(__self__, """ Manages a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicefabric.ManagedCluster("example", + client_connection_port=12345, + http_gateway_port=4567, + lb_rules=[azure.servicefabric.ManagedClusterLbRuleArgs( + backend_port=38080, + frontend_port=80, + probe_protocol="http", + probe_request_path="/test", + protocol="tcp", + )], + location="West Europe", + node_types=[azure.servicefabric.ManagedClusterNodeTypeArgs( + application_port_range="30000-49000", + data_disk_size_gb=130, + ephemeral_port_range="10000-20000", + name="test1", + primary=True, + vm_image_offer="WindowsServer", + vm_image_publisher="MicrosoftWindowsServer", + vm_image_sku="2019-Datacenter-with-Containers", + vm_image_version="latest", + vm_instance_count=5, + vm_size="Standard_DS1_v2", + )], + resource_group_name="example") + ``` + ## Import Resource Groups can be imported using the `resource id`, e.g. @@ -766,6 +799,39 @@ def __init__(__self__, """ Manages a Resource Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.servicefabric.ManagedCluster("example", + client_connection_port=12345, + http_gateway_port=4567, + lb_rules=[azure.servicefabric.ManagedClusterLbRuleArgs( + backend_port=38080, + frontend_port=80, + probe_protocol="http", + probe_request_path="/test", + protocol="tcp", + )], + location="West Europe", + node_types=[azure.servicefabric.ManagedClusterNodeTypeArgs( + application_port_range="30000-49000", + data_disk_size_gb=130, + ephemeral_port_range="10000-20000", + name="test1", + primary=True, + vm_image_offer="WindowsServer", + vm_image_publisher="MicrosoftWindowsServer", + vm_image_sku="2019-Datacenter-with-Containers", + vm_image_version="latest", + vm_instance_count=5, + vm_size="Standard_DS1_v2", + )], + resource_group_name="example") + ``` + ## Import Resource Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/signalr/get_service.py b/sdk/python/pulumi_azure/signalr/get_service.py index 1afaff4821..68025575ff 100644 --- a/sdk/python/pulumi_azure/signalr/get_service.py +++ b/sdk/python/pulumi_azure/signalr/get_service.py @@ -245,6 +245,16 @@ def get_service(name: Optional[str] = None, """ Use this data source to access information about an existing Azure SignalR service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.signalr.get_service(name="test-signalr", + resource_group_name="signalr-resource-group") + ``` + :param str name: Specifies the name of the SignalR service. :param str resource_group_name: Specifies the name of the resource group the SignalR service is located in. @@ -283,6 +293,16 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Azure SignalR service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.signalr.get_service(name="test-signalr", + resource_group_name="signalr-resource-group") + ``` + :param str name: Specifies the name of the SignalR service. :param str resource_group_name: Specifies the name of the resource group the SignalR service is located in. diff --git a/sdk/python/pulumi_azure/signalr/service.py b/sdk/python/pulumi_azure/signalr/service.py index 151d1497cf..44d56b71af 100644 --- a/sdk/python/pulumi_azure/signalr/service.py +++ b/sdk/python/pulumi_azure/signalr/service.py @@ -999,6 +999,38 @@ def __init__(__self__, """ Manages an Azure SignalR service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_service = azure.signalr.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.signalr.ServiceSkuArgs( + name="Free_F1", + capacity=1, + ), + cors=[azure.signalr.ServiceCorArgs( + allowed_origins=["http://www.example.com"], + )], + public_network_access_enabled=False, + connectivity_logs_enabled=True, + messaging_logs_enabled=True, + service_mode="Default", + upstream_endpoints=[azure.signalr.ServiceUpstreamEndpointArgs( + category_patterns=[ + "connections", + "messages", + ], + event_patterns=["*"], + hub_patterns=["hub1"], + url_template="http://foo.com", + )]) + ``` + ## Import SignalR services can be imported using the `resource id`, e.g. @@ -1042,6 +1074,38 @@ def __init__(__self__, """ Manages an Azure SignalR service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US") + example_service = azure.signalr.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.signalr.ServiceSkuArgs( + name="Free_F1", + capacity=1, + ), + cors=[azure.signalr.ServiceCorArgs( + allowed_origins=["http://www.example.com"], + )], + public_network_access_enabled=False, + connectivity_logs_enabled=True, + messaging_logs_enabled=True, + service_mode="Default", + upstream_endpoints=[azure.signalr.ServiceUpstreamEndpointArgs( + category_patterns=[ + "connections", + "messages", + ], + event_patterns=["*"], + hub_patterns=["hub1"], + url_template="http://foo.com", + )]) + ``` + ## Import SignalR services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/signalr/service_custom_certificate.py b/sdk/python/pulumi_azure/signalr/service_custom_certificate.py index 96698c47c6..e5d458f361 100644 --- a/sdk/python/pulumi_azure/signalr/service_custom_certificate.py +++ b/sdk/python/pulumi_azure/signalr/service_custom_certificate.py @@ -211,6 +211,70 @@ def __init__(__self__, """ Manages an Azure SignalR Custom Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.signalr.Service("exampleService", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku=azure.signalr.ServiceSkuArgs( + name="Premium_P1", + capacity=1, + ), + identity=azure.signalr.ServiceIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=azurerm_signalr_service["test"]["identity"][0]["principal_id"], + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + test = azure.signalr.ServiceCustomCertificate("test", + signalr_service_id=example_service.id, + custom_certificate_id=example_certificate.id, + opts=pulumi.ResourceOptions(depends_on=[azurerm_key_vault_access_policy["example"]])) + ``` + ## Import Custom Certificate for a SignalR service can be imported using the `resource id`, e.g. @@ -238,6 +302,70 @@ def __init__(__self__, """ Manages an Azure SignalR Custom Certificate. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.signalr.Service("exampleService", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku=azure.signalr.ServiceSkuArgs( + name="Premium_P1", + capacity=1, + ), + identity=azure.signalr.ServiceIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=azurerm_signalr_service["test"]["identity"][0]["principal_id"], + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + test = azure.signalr.ServiceCustomCertificate("test", + signalr_service_id=example_service.id, + custom_certificate_id=example_certificate.id, + opts=pulumi.ResourceOptions(depends_on=[azurerm_key_vault_access_policy["example"]])) + ``` + ## Import Custom Certificate for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/signalr/service_custom_domain.py b/sdk/python/pulumi_azure/signalr/service_custom_domain.py index 58daf20315..93a445b6fe 100644 --- a/sdk/python/pulumi_azure/signalr/service_custom_domain.py +++ b/sdk/python/pulumi_azure/signalr/service_custom_domain.py @@ -225,6 +225,74 @@ def __init__(__self__, """ Manages an Azure SignalR Custom Domain. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.signalr.Service("exampleService", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku=azure.signalr.ServiceSkuArgs( + name="Premium_P1", + capacity=1, + ), + identity=azure.signalr.ServiceIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=azurerm_signalr_service["test"]["identity"][0]["principal_id"], + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + test_service_custom_certificate = azure.signalr.ServiceCustomCertificate("testServiceCustomCertificate", + signalr_service_id=example_service.id, + custom_certificate_id=example_certificate.id, + opts=pulumi.ResourceOptions(depends_on=[azurerm_key_vault_access_policy["example"]])) + test_service_custom_domain = azure.signalr.ServiceCustomDomain("testServiceCustomDomain", + signalr_service_id=azurerm_signalr_service["test"]["id"], + domain_name="tftest.com", + signalr_custom_certificate_id=test_service_custom_certificate.id) + ``` + ## Import Custom Domain for a SignalR service can be imported using the `resource id`, e.g. @@ -251,6 +319,74 @@ def __init__(__self__, """ Manages an Azure SignalR Custom Domain. + ## Example Usage + + ```python + import pulumi + import base64 + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.signalr.Service("exampleService", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku=azure.signalr.ServiceSkuArgs( + name="Premium_P1", + capacity=1, + ), + identity=azure.signalr.ServiceIdentityArgs( + type="SystemAssigned", + )) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="premium", + access_policies=[ + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=azurerm_signalr_service["test"]["identity"][0]["principal_id"], + certificate_permissions=[ + "Create", + "Get", + "List", + ], + secret_permissions=[ + "Get", + "List", + ], + ), + ]) + example_certificate = azure.keyvault.Certificate("exampleCertificate", + key_vault_id=example_key_vault.id, + certificate=azure.keyvault.CertificateCertificateArgs( + contents=(lambda path: base64.b64encode(open(path).read().encode()).decode())("certificate-to-import.pfx"), + password="", + )) + test_service_custom_certificate = azure.signalr.ServiceCustomCertificate("testServiceCustomCertificate", + signalr_service_id=example_service.id, + custom_certificate_id=example_certificate.id, + opts=pulumi.ResourceOptions(depends_on=[azurerm_key_vault_access_policy["example"]])) + test_service_custom_domain = azure.signalr.ServiceCustomDomain("testServiceCustomDomain", + signalr_service_id=azurerm_signalr_service["test"]["id"], + domain_name="tftest.com", + signalr_custom_certificate_id=test_service_custom_certificate.id) + ``` + ## Import Custom Domain for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/signalr/service_network_acl.py b/sdk/python/pulumi_azure/signalr/service_network_acl.py index 3f0daa6633..f5afd0cc5c 100644 --- a/sdk/python/pulumi_azure/signalr/service_network_acl.py +++ b/sdk/python/pulumi_azure/signalr/service_network_acl.py @@ -223,6 +223,51 @@ def __init__(__self__, """ Manages the Network ACL for a SignalR service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.signalr.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.signalr.ServiceSkuArgs( + name="Standard_S1", + capacity=1, + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.2.0/24"], + enforce_private_link_endpoint_network_policies=True) + example_endpoint = azure.privatelink.Endpoint("exampleEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + private_service_connection=azure.privatelink.EndpointPrivateServiceConnectionArgs( + name="psc-sig-test", + is_manual_connection=False, + private_connection_resource_id=example_service.id, + subresource_names=["signalr"], + )) + example_service_network_acl = azure.signalr.ServiceNetworkAcl("exampleServiceNetworkAcl", + signalr_service_id=example_service.id, + default_action="Deny", + public_network=azure.signalr.ServiceNetworkAclPublicNetworkArgs( + allowed_request_types=["ClientConnection"], + ), + private_endpoints=[azure.signalr.ServiceNetworkAclPrivateEndpointArgs( + id=example_endpoint.id, + allowed_request_types=["ServerConnection"], + )]) + ``` + ## Import Network ACLs for a SignalR service can be imported using the `resource id`, e.g. @@ -247,6 +292,51 @@ def __init__(__self__, """ Manages the Network ACL for a SignalR service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_service = azure.signalr.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku=azure.signalr.ServiceSkuArgs( + name="Standard_S1", + capacity=1, + )) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.2.0/24"], + enforce_private_link_endpoint_network_policies=True) + example_endpoint = azure.privatelink.Endpoint("exampleEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + private_service_connection=azure.privatelink.EndpointPrivateServiceConnectionArgs( + name="psc-sig-test", + is_manual_connection=False, + private_connection_resource_id=example_service.id, + subresource_names=["signalr"], + )) + example_service_network_acl = azure.signalr.ServiceNetworkAcl("exampleServiceNetworkAcl", + signalr_service_id=example_service.id, + default_action="Deny", + public_network=azure.signalr.ServiceNetworkAclPublicNetworkArgs( + allowed_request_types=["ClientConnection"], + ), + private_endpoints=[azure.signalr.ServiceNetworkAclPrivateEndpointArgs( + id=example_endpoint.id, + allowed_request_types=["ServerConnection"], + )]) + ``` + ## Import Network ACLs for a SignalR service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/signalr/shared_private_link_resource.py b/sdk/python/pulumi_azure/signalr/shared_private_link_resource.py index c295d9eb2f..b3cde253a4 100644 --- a/sdk/python/pulumi_azure/signalr/shared_private_link_resource.py +++ b/sdk/python/pulumi_azure/signalr/shared_private_link_resource.py @@ -284,6 +284,40 @@ def __init__(__self__, """ Manages the Shared Private Link Resource for a Signalr service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=["ManageContacts"], + key_permissions=["Create"], + secret_permissions=["Set"], + )]) + test = azure.signalr.Service("test", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku=azure.signalr.ServiceSkuArgs( + name="Standard_S1", + capacity=1, + )) + example_shared_private_link_resource = azure.signalr.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", + signalr_service_id=azurerm_signalr_service["example"]["id"], + sub_resource_name="vault", + target_resource_id=example_key_vault.id) + ``` + ## Import Signalr Shared Private Link Resource can be imported using the `resource id`, e.g. @@ -311,6 +345,40 @@ def __init__(__self__, """ Manages the Shared Private Link Resource for a Signalr service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=["ManageContacts"], + key_permissions=["Create"], + secret_permissions=["Set"], + )]) + test = azure.signalr.Service("test", + location=azurerm_resource_group["test"]["location"], + resource_group_name=azurerm_resource_group["test"]["name"], + sku=azure.signalr.ServiceSkuArgs( + name="Standard_S1", + capacity=1, + )) + example_shared_private_link_resource = azure.signalr.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", + signalr_service_id=azurerm_signalr_service["example"]["id"], + sub_resource_name="vault", + target_resource_id=example_key_vault.id) + ``` + ## Import Signalr Shared Private Link Resource can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/fabric.py b/sdk/python/pulumi_azure/siterecovery/fabric.py index 0fb51e4c5b..faa820a385 100644 --- a/sdk/python/pulumi_azure/siterecovery/fabric.py +++ b/sdk/python/pulumi_azure/siterecovery/fabric.py @@ -212,6 +212,24 @@ def __init__(__self__, """ Manages a Azure Site Recovery Replication Fabric within a Recovery Services vault. Only Azure fabrics are supported at this time. Replication Fabrics serve as a container within an Azure region for other Site Recovery resources such as protection containers, protected items, network mappings. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.ResourceGroup("primary", location="West US") + secondary = azure.core.ResourceGroup("secondary", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary.location, + resource_group_name=secondary.name, + sku="Standard") + fabric = azure.siterecovery.Fabric("fabric", + resource_group_name=secondary.name, + recovery_vault_name=vault.name, + location=primary.location) + ``` + ## Import Site Recovery Fabric can be imported using the `resource id`, e.g. @@ -236,6 +254,24 @@ def __init__(__self__, """ Manages a Azure Site Recovery Replication Fabric within a Recovery Services vault. Only Azure fabrics are supported at this time. Replication Fabrics serve as a container within an Azure region for other Site Recovery resources such as protection containers, protected items, network mappings. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.ResourceGroup("primary", location="West US") + secondary = azure.core.ResourceGroup("secondary", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary.location, + resource_group_name=secondary.name, + sku="Standard") + fabric = azure.siterecovery.Fabric("fabric", + resource_group_name=secondary.name, + recovery_vault_name=vault.name, + location=primary.location) + ``` + ## Import Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/get_fabric.py b/sdk/python/pulumi_azure/siterecovery/get_fabric.py index 75395b2e95..0af9e37c6b 100644 --- a/sdk/python/pulumi_azure/siterecovery/get_fabric.py +++ b/sdk/python/pulumi_azure/siterecovery/get_fabric.py @@ -90,6 +90,17 @@ def get_fabric(name: Optional[str] = None, """ Use this data source to access information about an existing Site Recovery Replication Fabric. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + fabric = azure.siterecovery.get_fabric(name="primary-fabric", + recovery_vault_name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the Site Recovery Replication Fabric. :param str recovery_vault_name: The name of the Recovery Services Vault that the Site Recovery Replication Fabric is associated witth. @@ -118,6 +129,17 @@ def get_fabric_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Site Recovery Replication Fabric. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + fabric = azure.siterecovery.get_fabric(name="primary-fabric", + recovery_vault_name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the Site Recovery Replication Fabric. :param str recovery_vault_name: The name of the Recovery Services Vault that the Site Recovery Replication Fabric is associated witth. diff --git a/sdk/python/pulumi_azure/siterecovery/get_protection_container.py b/sdk/python/pulumi_azure/siterecovery/get_protection_container.py index f7f2af4b07..03e8355e49 100644 --- a/sdk/python/pulumi_azure/siterecovery/get_protection_container.py +++ b/sdk/python/pulumi_azure/siterecovery/get_protection_container.py @@ -88,6 +88,18 @@ def get_protection_container(name: Optional[str] = None, """ Use this data source to access information about an existing site recovery services protection container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + container = azure.siterecovery.get_protection_container(name="primary-container", + recovery_fabric_name="primary-fabric", + recovery_vault_name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the protection container. :param str recovery_fabric_name: The name of the fabric that contains the protection container. @@ -119,6 +131,18 @@ def get_protection_container_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing site recovery services protection container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + container = azure.siterecovery.get_protection_container(name="primary-container", + recovery_fabric_name="primary-fabric", + recovery_vault_name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the protection container. :param str recovery_fabric_name: The name of the fabric that contains the protection container. diff --git a/sdk/python/pulumi_azure/siterecovery/get_replication_policy.py b/sdk/python/pulumi_azure/siterecovery/get_replication_policy.py index b513c7b8fe..c4590f4000 100644 --- a/sdk/python/pulumi_azure/siterecovery/get_replication_policy.py +++ b/sdk/python/pulumi_azure/siterecovery/get_replication_policy.py @@ -102,6 +102,17 @@ def get_replication_policy(name: Optional[str] = None, """ Use this data source to access information about an existing Azure Site Recovery replication policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.siterecovery.get_replication_policy(name="replication-policy", + recovery_vault_name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the Azure Site Recovery replication policy. :param str recovery_vault_name: The name of the Recovery Services Vault that the Azure Site Recovery replication policy is associated witth. @@ -131,6 +142,17 @@ def get_replication_policy_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Azure Site Recovery replication policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + policy = azure.siterecovery.get_replication_policy(name="replication-policy", + recovery_vault_name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + ``` + :param str name: Specifies the name of the Azure Site Recovery replication policy. :param str recovery_vault_name: The name of the Recovery Services Vault that the Azure Site Recovery replication policy is associated witth. diff --git a/sdk/python/pulumi_azure/siterecovery/get_replication_recovery_plan.py b/sdk/python/pulumi_azure/siterecovery/get_replication_recovery_plan.py index 4229eabb10..465f05e247 100644 --- a/sdk/python/pulumi_azure/siterecovery/get_replication_recovery_plan.py +++ b/sdk/python/pulumi_azure/siterecovery/get_replication_recovery_plan.py @@ -127,6 +127,18 @@ def get_replication_recovery_plan(name: Optional[str] = None, """ Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + vault = azure.recoveryservices.get_vault(name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + example = azure.siterecovery.get_replication_recovery_plan(name="example-recovery-plan", + recovery_vault_id=vault.id) + ``` + :param str name: The name of the Replication Plan. :param str recovery_vault_id: The ID of the vault that should be updated. @@ -155,6 +167,18 @@ def get_replication_recovery_plan_output(name: Optional[pulumi.Input[str]] = Non """ Get information about an Azure Site Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + vault = azure.recoveryservices.get_vault(name="tfex-recovery_vault", + resource_group_name="tfex-resource_group") + example = azure.siterecovery.get_replication_recovery_plan(name="example-recovery-plan", + recovery_vault_id=vault.id) + ``` + :param str name: The name of the Replication Plan. :param str recovery_vault_id: The ID of the vault that should be updated. diff --git a/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy.py b/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy.py index 13fb5aa45f..cfbf178e96 100644 --- a/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy.py +++ b/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy.py @@ -251,6 +251,24 @@ def __init__(__self__, """ Manages a Azure Site Recovery replication policy for HyperV within a Recovery Vault. Replication policies define the frequency at which recovery points are created and how long they are stored. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard") + policy = azure.siterecovery.HyperVReplicationPolicy("policy", + recovery_vault_id=vault.id, + recovery_point_retention_in_hours=2, + application_consistent_snapshot_frequency_in_hours=1, + replication_interval_in_seconds=300) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. @@ -275,6 +293,24 @@ def __init__(__self__, """ Manages a Azure Site Recovery replication policy for HyperV within a Recovery Vault. Replication policies define the frequency at which recovery points are created and how long they are stored. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard") + policy = azure.siterecovery.HyperVReplicationPolicy("policy", + recovery_vault_id=vault.id, + recovery_point_retention_in_hours=2, + application_consistent_snapshot_frequency_in_hours=1, + replication_interval_in_seconds=300) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy_association.py b/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy_association.py index 74f9746c67..1c4c9d4750 100644 --- a/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy_association.py +++ b/sdk/python/pulumi_azure/siterecovery/hyper_v_replication_policy_association.py @@ -175,6 +175,28 @@ def __init__(__self__, """ Manages an Azure Site Recovery replication policy for HyperV within a Recovery Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_hyper_v_site = azure.siterecovery.HyperVSite("exampleHyperVSite", recovery_vault_id=example_vault.id) + example_hyper_v_replication_policy = azure.siterecovery.HyperVReplicationPolicy("exampleHyperVReplicationPolicy", + recovery_vault_id=example_vault.id, + recovery_point_retention_in_hours=2, + application_consistent_snapshot_frequency_in_hours=1, + replication_interval_in_seconds=300) + example_hyper_v_replication_policy_association = azure.siterecovery.HyperVReplicationPolicyAssociation("exampleHyperVReplicationPolicyAssociation", + hyperv_site_id=example_hyper_v_site.id, + policy_id=example_hyper_v_replication_policy.id) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. @@ -198,6 +220,28 @@ def __init__(__self__, """ Manages an Azure Site Recovery replication policy for HyperV within a Recovery Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_hyper_v_site = azure.siterecovery.HyperVSite("exampleHyperVSite", recovery_vault_id=example_vault.id) + example_hyper_v_replication_policy = azure.siterecovery.HyperVReplicationPolicy("exampleHyperVReplicationPolicy", + recovery_vault_id=example_vault.id, + recovery_point_retention_in_hours=2, + application_consistent_snapshot_frequency_in_hours=1, + replication_interval_in_seconds=300) + example_hyper_v_replication_policy_association = azure.siterecovery.HyperVReplicationPolicyAssociation("exampleHyperVReplicationPolicyAssociation", + hyperv_site_id=example_hyper_v_site.id, + policy_id=example_hyper_v_replication_policy.id) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/hyper_v_site.py b/sdk/python/pulumi_azure/siterecovery/hyper_v_site.py index 653ffd051f..14f47cf43a 100644 --- a/sdk/python/pulumi_azure/siterecovery/hyper_v_site.py +++ b/sdk/python/pulumi_azure/siterecovery/hyper_v_site.py @@ -133,6 +133,21 @@ def __init__(__self__, """ Manages a HyperV Site in Recovery Service Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + soft_delete_enabled=False) + example_hyper_v_site = azure.siterecovery.HyperVSite("exampleHyperVSite", recovery_vault_id=example_vault.id) + ``` + ## Import Recovery Services can be imported using the `resource id`, e.g. @@ -155,6 +170,21 @@ def __init__(__self__, """ Manages a HyperV Site in Recovery Service Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + soft_delete_enabled=False) + example_hyper_v_site = azure.siterecovery.HyperVSite("exampleHyperVSite", recovery_vault_id=example_vault.id) + ``` + ## Import Recovery Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/hyperv_network_mapping.py b/sdk/python/pulumi_azure/siterecovery/hyperv_network_mapping.py index 16a7d9d3a3..cf6e56c4e6 100644 --- a/sdk/python/pulumi_azure/siterecovery/hyperv_network_mapping.py +++ b/sdk/python/pulumi_azure/siterecovery/hyperv_network_mapping.py @@ -259,6 +259,28 @@ def __init__(__self__, """ Manages a HyperV site recovery network mapping on Azure. A HyperV network mapping decides how to translate connected networks when a VM is migrated from HyperV VMM Center to Azure. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + target_resource_group = azure.core.ResourceGroup("targetResourceGroup", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=target_resource_group.location, + resource_group_name=target_resource_group.name, + sku="Standard") + target_virtual_network = azure.network.VirtualNetwork("targetVirtualNetwork", + resource_group_name=target_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=target_resource_group.location) + recovery_mapping = azure.siterecovery.HypervNetworkMapping("recovery-mapping", + recovery_vault_id=vault.id, + source_system_center_virtual_machine_manager_name="my-vmm-server", + source_network_name="my-vmm-network", + target_network_id=target_virtual_network.id) + ``` + ## Import Site Recovery Network Mapping can be imported using the `resource id`, e.g. @@ -284,6 +306,28 @@ def __init__(__self__, """ Manages a HyperV site recovery network mapping on Azure. A HyperV network mapping decides how to translate connected networks when a VM is migrated from HyperV VMM Center to Azure. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + target_resource_group = azure.core.ResourceGroup("targetResourceGroup", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=target_resource_group.location, + resource_group_name=target_resource_group.name, + sku="Standard") + target_virtual_network = azure.network.VirtualNetwork("targetVirtualNetwork", + resource_group_name=target_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=target_resource_group.location) + recovery_mapping = azure.siterecovery.HypervNetworkMapping("recovery-mapping", + recovery_vault_id=vault.id, + source_system_center_virtual_machine_manager_name="my-vmm-server", + source_network_name="my-vmm-network", + target_network_id=target_virtual_network.id) + ``` + ## Import Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/network_mapping.py b/sdk/python/pulumi_azure/siterecovery/network_mapping.py index 07488872ea..ee5cf560c4 100644 --- a/sdk/python/pulumi_azure/siterecovery/network_mapping.py +++ b/sdk/python/pulumi_azure/siterecovery/network_mapping.py @@ -343,6 +343,45 @@ def __init__(__self__, """ Manages a site recovery network mapping on Azure. A network mapping decides how to translate connected networks when a VM is migrated from one region to another. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location, + opts=pulumi.ResourceOptions(depends_on=[primary_fabric])) + # Avoids issues with creating fabrics simultaneously + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + resource_group_name=primary_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=primary_resource_group.location) + secondary_virtual_network = azure.network.VirtualNetwork("secondaryVirtualNetwork", + resource_group_name=secondary_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=secondary_resource_group.location) + recovery_mapping = azure.siterecovery.NetworkMapping("recovery-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name="primary-fabric", + target_recovery_fabric_name="secondary-fabric", + source_network_id=primary_virtual_network.id, + target_network_id=secondary_virtual_network.id) + ``` + ## Import Site Recovery Network Mapping can be imported using the `resource id`, e.g. @@ -370,6 +409,45 @@ def __init__(__self__, """ Manages a site recovery network mapping on Azure. A network mapping decides how to translate connected networks when a VM is migrated from one region to another. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location, + opts=pulumi.ResourceOptions(depends_on=[primary_fabric])) + # Avoids issues with creating fabrics simultaneously + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + resource_group_name=primary_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=primary_resource_group.location) + secondary_virtual_network = azure.network.VirtualNetwork("secondaryVirtualNetwork", + resource_group_name=secondary_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=secondary_resource_group.location) + recovery_mapping = azure.siterecovery.NetworkMapping("recovery-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name="primary-fabric", + target_recovery_fabric_name="secondary-fabric", + source_network_id=primary_virtual_network.id, + target_network_id=secondary_virtual_network.id) + ``` + ## Import Site Recovery Network Mapping can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/protection_container.py b/sdk/python/pulumi_azure/siterecovery/protection_container.py index f19657a56b..ae69308025 100644 --- a/sdk/python/pulumi_azure/siterecovery/protection_container.py +++ b/sdk/python/pulumi_azure/siterecovery/protection_container.py @@ -217,6 +217,28 @@ def __init__(__self__, """ Manages a Azure Site Recovery protection container. Protection containers serve as containers for replicated VMs and belong to a single region / recovery fabric. Protection containers can contain more than one replicated VM. To replicate a VM, a container must exist in both the source and target Azure regions. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.ResourceGroup("primary", location="West US") + secondary = azure.core.ResourceGroup("secondary", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary.location, + resource_group_name=secondary.name, + sku="Standard") + fabric = azure.siterecovery.Fabric("fabric", + resource_group_name=secondary.name, + recovery_vault_name=vault.name, + location=primary.location) + protection_container = azure.siterecovery.ProtectionContainer("protection-container", + resource_group_name=secondary.name, + recovery_vault_name=vault.name, + recovery_fabric_name=fabric.name) + ``` + ## Import Site Recovery Protection Containers can be imported using the `resource id`, e.g. @@ -241,6 +263,28 @@ def __init__(__self__, """ Manages a Azure Site Recovery protection container. Protection containers serve as containers for replicated VMs and belong to a single region / recovery fabric. Protection containers can contain more than one replicated VM. To replicate a VM, a container must exist in both the source and target Azure regions. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary = azure.core.ResourceGroup("primary", location="West US") + secondary = azure.core.ResourceGroup("secondary", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary.location, + resource_group_name=secondary.name, + sku="Standard") + fabric = azure.siterecovery.Fabric("fabric", + resource_group_name=secondary.name, + recovery_vault_name=vault.name, + location=primary.location) + protection_container = azure.siterecovery.ProtectionContainer("protection-container", + resource_group_name=secondary.name, + recovery_vault_name=vault.name, + recovery_fabric_name=fabric.name) + ``` + ## Import Site Recovery Protection Containers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/protection_container_mapping.py b/sdk/python/pulumi_azure/siterecovery/protection_container_mapping.py index bb469f19e6..3cbcc71f76 100644 --- a/sdk/python/pulumi_azure/siterecovery/protection_container_mapping.py +++ b/sdk/python/pulumi_azure/siterecovery/protection_container_mapping.py @@ -386,6 +386,48 @@ def __init__(__self__, """ Manages a Azure recovery vault protection container mapping. A protection container mapping decides how to translate the protection container when a VM is migrated from one region to another. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location) + primary_protection_container = azure.siterecovery.ProtectionContainer("primaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name) + secondary_protection_container = azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=secondary_fabric.name) + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + container_mapping = azure.siterecovery.ProtectionContainerMapping("container-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name, + recovery_source_protection_container_name=primary_protection_container.name, + recovery_target_protection_container_id=secondary_protection_container.id, + recovery_replication_policy_id=policy.id) + ``` + ## Import Site Recovery Protection Container Mappings can be imported using the `resource id`, e.g. @@ -414,6 +456,48 @@ def __init__(__self__, """ Manages a Azure recovery vault protection container mapping. A protection container mapping decides how to translate the protection container when a VM is migrated from one region to another. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location) + primary_protection_container = azure.siterecovery.ProtectionContainer("primaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name) + secondary_protection_container = azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=secondary_fabric.name) + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + container_mapping = azure.siterecovery.ProtectionContainerMapping("container-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name, + recovery_source_protection_container_name=primary_protection_container.name, + recovery_target_protection_container_id=secondary_protection_container.id, + recovery_replication_policy_id=policy.id) + ``` + ## Import Site Recovery Protection Container Mappings can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/replicated_vm.py b/sdk/python/pulumi_azure/siterecovery/replicated_vm.py index a5d5acde59..82b231f678 100644 --- a/sdk/python/pulumi_azure/siterecovery/replicated_vm.py +++ b/sdk/python/pulumi_azure/siterecovery/replicated_vm.py @@ -1008,6 +1008,147 @@ def __init__(__self__, """ Manages a VM replicated using Azure Site Recovery (Azure to Azure only). A replicated VM keeps a copiously updated image of the VM in another region in order to be able to start the VM in that region in case of a disaster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + resource_group_name=primary_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=primary_resource_group.location) + primary_subnet = azure.network.Subnet("primarySubnet", + resource_group_name=primary_resource_group.name, + virtual_network_name=primary_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + primary_public_ip = azure.network.PublicIp("primaryPublicIp", + allocation_method="Static", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + sku="Basic") + vm_network_interface = azure.network.NetworkInterface("vmNetworkInterface", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm", + subnet_id=primary_subnet.id, + private_ip_address_allocation="Dynamic", + public_ip_address_id=primary_public_ip.id, + )]) + vm_virtual_machine = azure.compute.VirtualMachine("vmVirtualMachine", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + vm_size="Standard_B1s", + network_interface_ids=[vm_network_interface.id], + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="vm-os-disk", + os_type="Linux", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Premium_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + admin_username="test-admin-123", + admin_password="test-pwd-123", + computer_name="vm", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location) + primary_protection_container = azure.siterecovery.ProtectionContainer("primaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name) + secondary_protection_container = azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=secondary_fabric.name) + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + container_mapping = azure.siterecovery.ProtectionContainerMapping("container-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name, + recovery_source_protection_container_name=primary_protection_container.name, + recovery_target_protection_container_id=secondary_protection_container.id, + recovery_replication_policy_id=policy.id) + secondary_virtual_network = azure.network.VirtualNetwork("secondaryVirtualNetwork", + resource_group_name=secondary_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=secondary_resource_group.location) + network_mapping = azure.siterecovery.NetworkMapping("network-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + target_recovery_fabric_name=secondary_fabric.name, + source_network_id=primary_virtual_network.id, + target_network_id=secondary_virtual_network.id) + primary_account = azure.storage.Account("primaryAccount", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + secondary_subnet = azure.network.Subnet("secondarySubnet", + resource_group_name=secondary_resource_group.name, + virtual_network_name=secondary_virtual_network.name, + address_prefixes=["192.168.2.0/24"]) + secondary_public_ip = azure.network.PublicIp("secondaryPublicIp", + allocation_method="Static", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Basic") + vm_replication = azure.siterecovery.ReplicatedVM("vm-replication", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + source_vm_id=vm_virtual_machine.id, + recovery_replication_policy_id=policy.id, + source_recovery_protection_container_name=primary_protection_container.name, + target_resource_group_id=secondary_resource_group.id, + target_recovery_fabric_id=secondary_fabric.id, + target_recovery_protection_container_id=secondary_protection_container.id, + managed_disks=[azure.siterecovery.ReplicatedVMManagedDiskArgs( + disk_id=vm_virtual_machine.storage_os_disk.managed_disk_id, + staging_storage_account_id=primary_account.id, + target_resource_group_id=secondary_resource_group.id, + target_disk_type="Premium_LRS", + target_replica_disk_type="Premium_LRS", + )], + network_interfaces=[azure.siterecovery.ReplicatedVMNetworkInterfaceArgs( + source_network_interface_id=vm_network_interface.id, + target_subnet_name=secondary_subnet.name, + recovery_public_ip_address_id=secondary_public_ip.id, + )], + opts=pulumi.ResourceOptions(depends_on=[ + container_mapping, + network_mapping, + ])) + ``` + ## Import Site Recovery Replicated VM's can be imported using the `resource id`, e.g. @@ -1052,6 +1193,147 @@ def __init__(__self__, """ Manages a VM replicated using Azure Site Recovery (Azure to Azure only). A replicated VM keeps a copiously updated image of the VM in another region in order to be able to start the VM in that region in case of a disaster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + resource_group_name=primary_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=primary_resource_group.location) + primary_subnet = azure.network.Subnet("primarySubnet", + resource_group_name=primary_resource_group.name, + virtual_network_name=primary_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + primary_public_ip = azure.network.PublicIp("primaryPublicIp", + allocation_method="Static", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + sku="Basic") + vm_network_interface = azure.network.NetworkInterface("vmNetworkInterface", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm", + subnet_id=primary_subnet.id, + private_ip_address_allocation="Dynamic", + public_ip_address_id=primary_public_ip.id, + )]) + vm_virtual_machine = azure.compute.VirtualMachine("vmVirtualMachine", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + vm_size="Standard_B1s", + network_interface_ids=[vm_network_interface.id], + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="vm-os-disk", + os_type="Linux", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Premium_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + admin_username="test-admin-123", + admin_password="test-pwd-123", + computer_name="vm", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location) + primary_protection_container = azure.siterecovery.ProtectionContainer("primaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name) + secondary_protection_container = azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=secondary_fabric.name) + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + container_mapping = azure.siterecovery.ProtectionContainerMapping("container-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name, + recovery_source_protection_container_name=primary_protection_container.name, + recovery_target_protection_container_id=secondary_protection_container.id, + recovery_replication_policy_id=policy.id) + secondary_virtual_network = azure.network.VirtualNetwork("secondaryVirtualNetwork", + resource_group_name=secondary_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=secondary_resource_group.location) + network_mapping = azure.siterecovery.NetworkMapping("network-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + target_recovery_fabric_name=secondary_fabric.name, + source_network_id=primary_virtual_network.id, + target_network_id=secondary_virtual_network.id) + primary_account = azure.storage.Account("primaryAccount", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + secondary_subnet = azure.network.Subnet("secondarySubnet", + resource_group_name=secondary_resource_group.name, + virtual_network_name=secondary_virtual_network.name, + address_prefixes=["192.168.2.0/24"]) + secondary_public_ip = azure.network.PublicIp("secondaryPublicIp", + allocation_method="Static", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Basic") + vm_replication = azure.siterecovery.ReplicatedVM("vm-replication", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + source_vm_id=vm_virtual_machine.id, + recovery_replication_policy_id=policy.id, + source_recovery_protection_container_name=primary_protection_container.name, + target_resource_group_id=secondary_resource_group.id, + target_recovery_fabric_id=secondary_fabric.id, + target_recovery_protection_container_id=secondary_protection_container.id, + managed_disks=[azure.siterecovery.ReplicatedVMManagedDiskArgs( + disk_id=vm_virtual_machine.storage_os_disk.managed_disk_id, + staging_storage_account_id=primary_account.id, + target_resource_group_id=secondary_resource_group.id, + target_disk_type="Premium_LRS", + target_replica_disk_type="Premium_LRS", + )], + network_interfaces=[azure.siterecovery.ReplicatedVMNetworkInterfaceArgs( + source_network_interface_id=vm_network_interface.id, + target_subnet_name=secondary_subnet.name, + recovery_public_ip_address_id=secondary_public_ip.id, + )], + opts=pulumi.ResourceOptions(depends_on=[ + container_mapping, + network_mapping, + ])) + ``` + ## Import Site Recovery Replicated VM's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/replication_policy.py b/sdk/python/pulumi_azure/siterecovery/replication_policy.py index b9570598c9..b60968e880 100644 --- a/sdk/python/pulumi_azure/siterecovery/replication_policy.py +++ b/sdk/python/pulumi_azure/siterecovery/replication_policy.py @@ -267,6 +267,24 @@ def __init__(__self__, """ Manages a Azure Site Recovery replication policy within a recovery vault. Replication policies define the frequency at which recovery points are created and how long they are stored. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard") + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=example.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. @@ -294,6 +312,24 @@ def __init__(__self__, """ Manages a Azure Site Recovery replication policy within a recovery vault. Replication policies define the frequency at which recovery points are created and how long they are stored. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="East US") + vault = azure.recoveryservices.Vault("vault", + location=example.location, + resource_group_name=example.name, + sku="Standard") + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=example.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/replication_recovery_plan.py b/sdk/python/pulumi_azure/siterecovery/replication_recovery_plan.py index eee6d1436c..416f808725 100644 --- a/sdk/python/pulumi_azure/siterecovery/replication_recovery_plan.py +++ b/sdk/python/pulumi_azure/siterecovery/replication_recovery_plan.py @@ -468,6 +468,156 @@ def __init__(__self__, """ Manages a Site Recovery Replication Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + resource_group_name=primary_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=primary_resource_group.location) + primary_subnet = azure.network.Subnet("primarySubnet", + resource_group_name=primary_resource_group.name, + virtual_network_name=primary_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + primary_public_ip = azure.network.PublicIp("primaryPublicIp", + allocation_method="Static", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + sku="Basic") + vm_network_interface = azure.network.NetworkInterface("vmNetworkInterface", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm", + subnet_id=primary_subnet.id, + private_ip_address_allocation="Dynamic", + public_ip_address_id=primary_public_ip.id, + )]) + vm_virtual_machine = azure.compute.VirtualMachine("vmVirtualMachine", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + vm_size="Standard_B1s", + network_interface_ids=[vm_network_interface.id], + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="vm-os-disk", + os_type="Linux", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Premium_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + admin_username="test-admin-123", + admin_password="test-pwd-123", + computer_name="vm", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location) + primary_protection_container = azure.siterecovery.ProtectionContainer("primaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name) + secondary_protection_container = azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=secondary_fabric.name) + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + container_mapping = azure.siterecovery.ProtectionContainerMapping("container-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name, + recovery_source_protection_container_name=primary_protection_container.name, + recovery_target_protection_container_id=secondary_protection_container.id, + recovery_replication_policy_id=policy.id) + secondary_virtual_network = azure.network.VirtualNetwork("secondaryVirtualNetwork", + resource_group_name=secondary_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=secondary_resource_group.location) + network_mapping = azure.siterecovery.NetworkMapping("network-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + target_recovery_fabric_name=secondary_fabric.name, + source_network_id=primary_virtual_network.id, + target_network_id=secondary_virtual_network.id) + primary_account = azure.storage.Account("primaryAccount", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + secondary_subnet = azure.network.Subnet("secondarySubnet", + resource_group_name=secondary_resource_group.name, + virtual_network_name=secondary_virtual_network.name, + address_prefixes=["192.168.2.0/24"]) + secondary_public_ip = azure.network.PublicIp("secondaryPublicIp", + allocation_method="Static", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Basic") + vm_replication = azure.siterecovery.ReplicatedVM("vm-replication", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + source_vm_id=vm_virtual_machine.id, + recovery_replication_policy_id=policy.id, + source_recovery_protection_container_name=primary_protection_container.name, + target_resource_group_id=secondary_resource_group.id, + target_recovery_fabric_id=secondary_fabric.id, + target_recovery_protection_container_id=secondary_protection_container.id, + managed_disks=[azure.siterecovery.ReplicatedVMManagedDiskArgs( + disk_id=vm_virtual_machine.storage_os_disk.managed_disk_id, + staging_storage_account_id=primary_account.id, + target_resource_group_id=secondary_resource_group.id, + target_disk_type="Premium_LRS", + target_replica_disk_type="Premium_LRS", + )], + network_interfaces=[azure.siterecovery.ReplicatedVMNetworkInterfaceArgs( + source_network_interface_id=vm_network_interface.id, + target_subnet_name=secondary_subnet.name, + recovery_public_ip_address_id=secondary_public_ip.id, + )], + opts=pulumi.ResourceOptions(depends_on=[ + container_mapping, + network_mapping, + ])) + example = azure.siterecovery.ReplicationRecoveryPlan("example", + recovery_vault_id=vault.id, + source_recovery_fabric_id=primary_fabric.id, + target_recovery_fabric_id=secondary_fabric.id, + shutdown_recovery_group=azure.siterecovery.ReplicationRecoveryPlanShutdownRecoveryGroupArgs(), + failover_recovery_group=azure.siterecovery.ReplicationRecoveryPlanFailoverRecoveryGroupArgs(), + boot_recovery_groups=[azure.siterecovery.ReplicationRecoveryPlanBootRecoveryGroupArgs( + replicated_protected_items=[vm_replication.id], + )]) + ``` + ## Import Site Recovery Fabric can be imported using the `resource id`, e.g. @@ -505,6 +655,156 @@ def __init__(__self__, """ Manages a Site Recovery Replication Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US") + secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US") + primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork", + resource_group_name=primary_resource_group.name, + address_spaces=["192.168.1.0/24"], + location=primary_resource_group.location) + primary_subnet = azure.network.Subnet("primarySubnet", + resource_group_name=primary_resource_group.name, + virtual_network_name=primary_virtual_network.name, + address_prefixes=["192.168.1.0/24"]) + primary_public_ip = azure.network.PublicIp("primaryPublicIp", + allocation_method="Static", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + sku="Basic") + vm_network_interface = azure.network.NetworkInterface("vmNetworkInterface", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs( + name="vm", + subnet_id=primary_subnet.id, + private_ip_address_allocation="Dynamic", + public_ip_address_id=primary_public_ip.id, + )]) + vm_virtual_machine = azure.compute.VirtualMachine("vmVirtualMachine", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + vm_size="Standard_B1s", + network_interface_ids=[vm_network_interface.id], + storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs( + publisher="OpenLogic", + offer="CentOS", + sku="7.5", + version="latest", + ), + storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs( + name="vm-os-disk", + os_type="Linux", + caching="ReadWrite", + create_option="FromImage", + managed_disk_type="Premium_LRS", + ), + os_profile=azure.compute.VirtualMachineOsProfileArgs( + admin_username="test-admin-123", + admin_password="test-pwd-123", + computer_name="vm", + ), + os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs( + disable_password_authentication=False, + )) + vault = azure.recoveryservices.Vault("vault", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Standard") + primary_fabric = azure.siterecovery.Fabric("primaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=primary_resource_group.location) + secondary_fabric = azure.siterecovery.Fabric("secondaryFabric", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + location=secondary_resource_group.location) + primary_protection_container = azure.siterecovery.ProtectionContainer("primaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name) + secondary_protection_container = azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=secondary_fabric.name) + policy = azure.siterecovery.ReplicationPolicy("policy", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_point_retention_in_minutes=24 * 60, + application_consistent_snapshot_frequency_in_minutes=4 * 60) + container_mapping = azure.siterecovery.ProtectionContainerMapping("container-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + recovery_fabric_name=primary_fabric.name, + recovery_source_protection_container_name=primary_protection_container.name, + recovery_target_protection_container_id=secondary_protection_container.id, + recovery_replication_policy_id=policy.id) + secondary_virtual_network = azure.network.VirtualNetwork("secondaryVirtualNetwork", + resource_group_name=secondary_resource_group.name, + address_spaces=["192.168.2.0/24"], + location=secondary_resource_group.location) + network_mapping = azure.siterecovery.NetworkMapping("network-mapping", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + target_recovery_fabric_name=secondary_fabric.name, + source_network_id=primary_virtual_network.id, + target_network_id=secondary_virtual_network.id) + primary_account = azure.storage.Account("primaryAccount", + location=primary_resource_group.location, + resource_group_name=primary_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + secondary_subnet = azure.network.Subnet("secondarySubnet", + resource_group_name=secondary_resource_group.name, + virtual_network_name=secondary_virtual_network.name, + address_prefixes=["192.168.2.0/24"]) + secondary_public_ip = azure.network.PublicIp("secondaryPublicIp", + allocation_method="Static", + location=secondary_resource_group.location, + resource_group_name=secondary_resource_group.name, + sku="Basic") + vm_replication = azure.siterecovery.ReplicatedVM("vm-replication", + resource_group_name=secondary_resource_group.name, + recovery_vault_name=vault.name, + source_recovery_fabric_name=primary_fabric.name, + source_vm_id=vm_virtual_machine.id, + recovery_replication_policy_id=policy.id, + source_recovery_protection_container_name=primary_protection_container.name, + target_resource_group_id=secondary_resource_group.id, + target_recovery_fabric_id=secondary_fabric.id, + target_recovery_protection_container_id=secondary_protection_container.id, + managed_disks=[azure.siterecovery.ReplicatedVMManagedDiskArgs( + disk_id=vm_virtual_machine.storage_os_disk.managed_disk_id, + staging_storage_account_id=primary_account.id, + target_resource_group_id=secondary_resource_group.id, + target_disk_type="Premium_LRS", + target_replica_disk_type="Premium_LRS", + )], + network_interfaces=[azure.siterecovery.ReplicatedVMNetworkInterfaceArgs( + source_network_interface_id=vm_network_interface.id, + target_subnet_name=secondary_subnet.name, + recovery_public_ip_address_id=secondary_public_ip.id, + )], + opts=pulumi.ResourceOptions(depends_on=[ + container_mapping, + network_mapping, + ])) + example = azure.siterecovery.ReplicationRecoveryPlan("example", + recovery_vault_id=vault.id, + source_recovery_fabric_id=primary_fabric.id, + target_recovery_fabric_id=secondary_fabric.id, + shutdown_recovery_group=azure.siterecovery.ReplicationRecoveryPlanShutdownRecoveryGroupArgs(), + failover_recovery_group=azure.siterecovery.ReplicationRecoveryPlanFailoverRecoveryGroupArgs(), + boot_recovery_groups=[azure.siterecovery.ReplicationRecoveryPlanBootRecoveryGroupArgs( + replicated_protected_items=[vm_replication.id], + )]) + ``` + ## Import Site Recovery Fabric can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/vm_ware_replication_policy.py b/sdk/python/pulumi_azure/siterecovery/vm_ware_replication_policy.py index 4806d0459d..9f63e4a195 100644 --- a/sdk/python/pulumi_azure/siterecovery/vm_ware_replication_policy.py +++ b/sdk/python/pulumi_azure/siterecovery/vm_ware_replication_policy.py @@ -217,6 +217,25 @@ def __init__(__self__, """ Manages a VMWare Replication Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + classic_vmware_replication_enabled=True, + soft_delete_enabled=False) + example_vm_ware_replication_policy = azure.siterecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", + recovery_vault_id=example_vault.id, + recovery_point_retention_in_minutes=1440, + application_consistent_snapshot_frequency_in_minutes=240) + ``` + ## Import VMWare Replication Policy can be imported using the `resource id`, e.g. @@ -241,6 +260,25 @@ def __init__(__self__, """ Manages a VMWare Replication Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="eastus") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + classic_vmware_replication_enabled=True, + soft_delete_enabled=False) + example_vm_ware_replication_policy = azure.siterecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", + recovery_vault_id=example_vault.id, + recovery_point_retention_in_minutes=1440, + application_consistent_snapshot_frequency_in_minutes=240) + ``` + ## Import VMWare Replication Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/siterecovery/vmware_replication_policy_association.py b/sdk/python/pulumi_azure/siterecovery/vmware_replication_policy_association.py index 1763110d4e..ce79884409 100644 --- a/sdk/python/pulumi_azure/siterecovery/vmware_replication_policy_association.py +++ b/sdk/python/pulumi_azure/siterecovery/vmware_replication_policy_association.py @@ -187,6 +187,26 @@ def __init__(__self__, """ Manages an Azure Site Recovery replication policy for VMWare within a Recovery Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_vm_ware_replication_policy = azure.siterecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", + recovery_vault_id=example_vault.id, + recovery_point_retention_in_minutes=1440, + application_consistent_snapshot_frequency_in_minutes=240) + example_vmware_replication_policy_association = azure.siterecovery.VmwareReplicationPolicyAssociation("exampleVmwareReplicationPolicyAssociation", + recovery_vault_id=example_vault.id, + policy_id=example_vm_ware_replication_policy.id) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. @@ -213,6 +233,26 @@ def __init__(__self__, """ Manages an Azure Site Recovery replication policy for VMWare within a Recovery Vault. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_vault = azure.recoveryservices.Vault("exampleVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_vm_ware_replication_policy = azure.siterecovery.VMWareReplicationPolicy("exampleVMWareReplicationPolicy", + recovery_vault_id=example_vault.id, + recovery_point_retention_in_minutes=1440, + application_consistent_snapshot_frequency_in_minutes=240) + example_vmware_replication_policy_association = azure.siterecovery.VmwareReplicationPolicyAssociation("exampleVmwareReplicationPolicyAssociation", + recovery_vault_id=example_vault.id, + policy_id=example_vm_ware_replication_policy.id) + ``` + ## Import Site Recovery Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/active_directory_administrator.py b/sdk/python/pulumi_azure/sql/active_directory_administrator.py index 3844f03497..dcd78decc0 100644 --- a/sdk/python/pulumi_azure/sql/active_directory_administrator.py +++ b/sdk/python/pulumi_azure/sql/active_directory_administrator.py @@ -303,6 +303,28 @@ def __init__(__self__, > **Note:** The `sql.ActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azuread_administrator` block of the `mssql.Server` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_active_directory_administrator = azure.sql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", + server_name=example_sql_server.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A SQL Active Directory Administrator can be imported using the `resource id`, e.g. @@ -331,6 +353,28 @@ def __init__(__self__, > **Note:** The `sql.ActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azuread_administrator` block of the `mssql.Server` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_active_directory_administrator = azure.sql.ActiveDirectoryAdministrator("exampleActiveDirectoryAdministrator", + server_name=example_sql_server.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/database.py b/sdk/python/pulumi_azure/sql/database.py index afa2707a99..7ae5ef88fa 100644 --- a/sdk/python/pulumi_azure/sql/database.py +++ b/sdk/python/pulumi_azure/sql/database.py @@ -910,6 +910,36 @@ def __init__(__self__, > **Note:** The `sql.Database` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Database` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd", + tags={ + "environment": "production", + }) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_database = azure.sql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_sql_server.name, + tags={ + "environment": "production", + }) + ``` + ## Import SQL Databases can be imported using the `resource id`, e.g. @@ -952,6 +982,36 @@ def __init__(__self__, > **Note:** The `sql.Database` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Database` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd", + tags={ + "environment": "production", + }) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_database = azure.sql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_sql_server.name, + tags={ + "environment": "production", + }) + ``` + ## Import SQL Databases can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/elastic_pool.py b/sdk/python/pulumi_azure/sql/elastic_pool.py index 55606f195d..eec985737f 100644 --- a/sdk/python/pulumi_azure/sql/elastic_pool.py +++ b/sdk/python/pulumi_azure/sql/elastic_pool.py @@ -470,6 +470,32 @@ def __init__(__self__, > **Note:** The `sql.ElasticPool` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ElasticPool` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_elastic_pool = azure.sql.ElasticPool("exampleElasticPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_sql_server.name, + edition="Basic", + dtu=50, + db_dtu_min=0, + db_dtu_max=5, + pool_size=5000) + ``` + + > **NOTE on `sql.ElasticPool`:** - The values of `edition`, `dtu`, and `pool_size` must be consistent with the [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). Any inconsistent argument configuration will be rejected. + ## Import SQL Elastic Pool's can be imported using the `resource id`, e.g. @@ -502,6 +528,32 @@ def __init__(__self__, > **Note:** The `sql.ElasticPool` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ElasticPool` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_elastic_pool = azure.sql.ElasticPool("exampleElasticPool", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_sql_server.name, + edition="Basic", + dtu=50, + db_dtu_min=0, + db_dtu_max=5, + pool_size=5000) + ``` + + > **NOTE on `sql.ElasticPool`:** - The values of `edition`, `dtu`, and `pool_size` must be consistent with the [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). Any inconsistent argument configuration will be rejected. + ## Import SQL Elastic Pool's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/failover_group.py b/sdk/python/pulumi_azure/sql/failover_group.py index b4972b54fe..1e14e6cb96 100644 --- a/sdk/python/pulumi_azure/sql/failover_group.py +++ b/sdk/python/pulumi_azure/sql/failover_group.py @@ -422,6 +422,42 @@ def __init__(__self__, > **Note:** The `sql.FailoverGroup` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.FailoverGroup` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.sql.SqlServer("primary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="sqladmin", + administrator_login_password="pa$$w0rd") + secondary = azure.sql.SqlServer("secondary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="sqladmin", + administrator_login_password="pa$$w0rd") + db1 = azure.sql.Database("db1", + resource_group_name=primary.resource_group_name, + location=primary.location, + server_name=primary.name) + example_failover_group = azure.sql.FailoverGroup("exampleFailoverGroup", + resource_group_name=primary.resource_group_name, + server_name=primary.name, + databases=[db1.id], + partner_servers=[azure.sql.FailoverGroupPartnerServerArgs( + id=secondary.id, + )], + read_write_endpoint_failover_policy=azure.sql.FailoverGroupReadWriteEndpointFailoverPolicyArgs( + mode="Automatic", + grace_minutes=60, + )) + ``` + ## Import SQL Failover Groups can be imported using the `resource id`, e.g. @@ -454,6 +490,42 @@ def __init__(__self__, > **Note:** The `sql.FailoverGroup` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.FailoverGroup` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + primary = azure.sql.SqlServer("primary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="sqladmin", + administrator_login_password="pa$$w0rd") + secondary = azure.sql.SqlServer("secondary", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="sqladmin", + administrator_login_password="pa$$w0rd") + db1 = azure.sql.Database("db1", + resource_group_name=primary.resource_group_name, + location=primary.location, + server_name=primary.name) + example_failover_group = azure.sql.FailoverGroup("exampleFailoverGroup", + resource_group_name=primary.resource_group_name, + server_name=primary.name, + databases=[db1.id], + partner_servers=[azure.sql.FailoverGroupPartnerServerArgs( + id=secondary.id, + )], + read_write_endpoint_failover_policy=azure.sql.FailoverGroupReadWriteEndpointFailoverPolicyArgs( + mode="Automatic", + grace_minutes=60, + )) + ``` + ## Import SQL Failover Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/firewall_rule.py b/sdk/python/pulumi_azure/sql/firewall_rule.py index 5842541d47..ca2a19a7a2 100644 --- a/sdk/python/pulumi_azure/sql/firewall_rule.py +++ b/sdk/python/pulumi_azure/sql/firewall_rule.py @@ -269,6 +269,26 @@ def __init__(__self__, > **Note:** The `sql.FirewallRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.FirewallRule` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_firewall_rule = azure.sql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + start_ip_address="10.0.17.62", + end_ip_address="10.0.17.62") + ``` + ## Import SQL Firewall Rules can be imported using the `resource id`, e.g. @@ -298,6 +318,26 @@ def __init__(__self__, > **Note:** The `sql.FirewallRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.FirewallRule` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + example_firewall_rule = azure.sql.FirewallRule("exampleFirewallRule", + resource_group_name=example_resource_group.name, + server_name=example_sql_server.name, + start_ip_address="10.0.17.62", + end_ip_address="10.0.17.62") + ``` + ## Import SQL Firewall Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/get_database.py b/sdk/python/pulumi_azure/sql/get_database.py index 19fa92391c..db2d4d8b83 100644 --- a/sdk/python/pulumi_azure/sql/get_database.py +++ b/sdk/python/pulumi_azure/sql/get_database.py @@ -186,6 +186,18 @@ def get_database(name: Optional[str] = None, > **Note:** The `sql.Database` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Database` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sql.get_database(name="example_db", + server_name="example_db_server", + resource_group_name="example-resources") + pulumi.export("sqlDatabaseId", example.id) + ``` + :param str name: The name of the SQL Database. :param str resource_group_name: Specifies the name of the Resource Group where the Azure SQL Database exists. @@ -226,6 +238,18 @@ def get_database_output(name: Optional[pulumi.Input[str]] = None, > **Note:** The `sql.Database` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Database` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sql.get_database(name="example_db", + server_name="example_db_server", + resource_group_name="example-resources") + pulumi.export("sqlDatabaseId", example.id) + ``` + :param str name: The name of the SQL Database. :param str resource_group_name: Specifies the name of the Resource Group where the Azure SQL Database exists. diff --git a/sdk/python/pulumi_azure/sql/get_server.py b/sdk/python/pulumi_azure/sql/get_server.py index 7e9c893ea0..39fc54cc68 100644 --- a/sdk/python/pulumi_azure/sql/get_server.py +++ b/sdk/python/pulumi_azure/sql/get_server.py @@ -143,6 +143,17 @@ def get_server(name: Optional[str] = None, > **Note:** The `sql.SqlServer` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Server` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sql.get_server(name="examplesqlservername", + resource_group_name="example-resources") + pulumi.export("sqlServerId", example.id) + ``` + :param str name: The name of the SQL Server. :param str resource_group_name: Specifies the name of the Resource Group where the SQL Server exists. @@ -174,6 +185,17 @@ def get_server_output(name: Optional[pulumi.Input[str]] = None, > **Note:** The `sql.SqlServer` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.Server` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sql.get_server(name="examplesqlservername", + resource_group_name="example-resources") + pulumi.export("sqlServerId", example.id) + ``` + :param str name: The name of the SQL Server. :param str resource_group_name: Specifies the name of the Resource Group where the SQL Server exists. diff --git a/sdk/python/pulumi_azure/sql/get_sql_managed_instance.py b/sdk/python/pulumi_azure/sql/get_sql_managed_instance.py index 40b907400e..bc05a3f1f1 100644 --- a/sdk/python/pulumi_azure/sql/get_sql_managed_instance.py +++ b/sdk/python/pulumi_azure/sql/get_sql_managed_instance.py @@ -276,6 +276,17 @@ def get_sql_managed_instance(name: Optional[str] = None, > **Note:** The `sql.ManagedInstance` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedInstance` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sql.get_sql_managed_instance(name="example_mi", + resource_group_name="example-resources") + pulumi.export("sqlInstanceId", example.id) + ``` + :param str name: The name of the SQL Managed Instance. :param str resource_group_name: The name of the Resource Group in which the SQL Managed Instance exists. @@ -321,6 +332,17 @@ def get_sql_managed_instance_output(name: Optional[pulumi.Input[str]] = None, > **Note:** The `sql.ManagedInstance` data source is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedInstance` data source instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.sql.get_sql_managed_instance(name="example_mi", + resource_group_name="example-resources") + pulumi.export("sqlInstanceId", example.id) + ``` + :param str name: The name of the SQL Managed Instance. :param str resource_group_name: The name of the Resource Group in which the SQL Managed Instance exists. diff --git a/sdk/python/pulumi_azure/sql/managed_database.py b/sdk/python/pulumi_azure/sql/managed_database.py index 871777e59b..3fcc5a46b8 100644 --- a/sdk/python/pulumi_azure/sql/managed_database.py +++ b/sdk/python/pulumi_azure/sql/managed_database.py @@ -172,6 +172,36 @@ def __init__(__self__, > **Note:** The `sql.ManagedDatabase` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedDatabase` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.sql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + license_type="BasePrice", + subnet_id=example_subnet.id, + sku_name="GP_Gen5", + vcores=4, + storage_size_in_gb=32) + example_managed_database = azure.sql.ManagedDatabase("exampleManagedDatabase", + sql_managed_instance_id=example_managed_instance.id, + location=example_resource_group.location) + ``` + ## Import SQL Managed Databases can be imported using the `resource id`, e.g. @@ -197,6 +227,36 @@ def __init__(__self__, > **Note:** The `sql.ManagedDatabase` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedDatabase` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"]) + example_managed_instance = azure.sql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + license_type="BasePrice", + subnet_id=example_subnet.id, + sku_name="GP_Gen5", + vcores=4, + storage_size_in_gb=32) + example_managed_database = azure.sql.ManagedDatabase("exampleManagedDatabase", + sql_managed_instance_id=example_managed_instance.id, + location=example_resource_group.location) + ``` + ## Import SQL Managed Databases can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/managed_instance.py b/sdk/python/pulumi_azure/sql/managed_instance.py index 53bc32fe80..6f32cf2c33 100644 --- a/sdk/python/pulumi_azure/sql/managed_instance.py +++ b/sdk/python/pulumi_azure/sql/managed_instance.py @@ -841,6 +841,160 @@ def __init__(__self__, > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + allow_management_inbound = azure.network.NetworkSecurityRule("allowManagementInbound", + priority=106, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "9000", + "9003", + "1438", + "1440", + "1452", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_inbound = azure.network.NetworkSecurityRule("allowMisubnetInbound", + priority=200, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_health_probe_inbound = azure.network.NetworkSecurityRule("allowHealthProbeInbound", + priority=300, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="AzureLoadBalancer", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_tds_inbound = azure.network.NetworkSecurityRule("allowTdsInbound", + priority=1000, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="1433", + source_address_prefix="VirtualNetwork", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_inbound = azure.network.NetworkSecurityRule("denyAllInbound", + priority=4096, + direction="Inbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_management_outbound = azure.network.NetworkSecurityRule("allowManagementOutbound", + priority=102, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "80", + "443", + "12000", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_outbound = azure.network.NetworkSecurityRule("allowMisubnetOutbound", + priority=200, + direction="Outbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_outbound = azure.network.NetworkSecurityRule("denyAllOutbound", + priority=4096, + direction="Outbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + opts=pulumi.ResourceOptions(depends_on=[example_subnet])) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + example_managed_instance = azure.sql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + license_type="BasePrice", + subnet_id=example_subnet.id, + sku_name="GP_Gen5", + vcores=4, + storage_size_in_gb=32, + opts=pulumi.ResourceOptions(depends_on=[ + example_subnet_network_security_group_association, + example_subnet_route_table_association, + ])) + ``` + ## Import SQL Servers can be imported using the `resource id`, e.g. @@ -884,6 +1038,160 @@ def __init__(__self__, > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + allow_management_inbound = azure.network.NetworkSecurityRule("allowManagementInbound", + priority=106, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "9000", + "9003", + "1438", + "1440", + "1452", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_inbound = azure.network.NetworkSecurityRule("allowMisubnetInbound", + priority=200, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_health_probe_inbound = azure.network.NetworkSecurityRule("allowHealthProbeInbound", + priority=300, + direction="Inbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="AzureLoadBalancer", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_tds_inbound = azure.network.NetworkSecurityRule("allowTdsInbound", + priority=1000, + direction="Inbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_range="1433", + source_address_prefix="VirtualNetwork", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_inbound = azure.network.NetworkSecurityRule("denyAllInbound", + priority=4096, + direction="Inbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_management_outbound = azure.network.NetworkSecurityRule("allowManagementOutbound", + priority=102, + direction="Outbound", + access="Allow", + protocol="Tcp", + source_port_range="*", + destination_port_ranges=[ + "80", + "443", + "12000", + ], + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + allow_misubnet_outbound = azure.network.NetworkSecurityRule("allowMisubnetOutbound", + priority=200, + direction="Outbound", + access="Allow", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="10.0.0.0/24", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + deny_all_outbound = azure.network.NetworkSecurityRule("denyAllOutbound", + priority=4096, + direction="Outbound", + access="Deny", + protocol="*", + source_port_range="*", + destination_port_range="*", + source_address_prefix="*", + destination_address_prefix="*", + resource_group_name=example_resource_group.name, + network_security_group_name=example_network_security_group.name) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.0.0/24"], + delegations=[azure.network.SubnetDelegationArgs( + name="managedinstancedelegation", + service_delegation=azure.network.SubnetDelegationServiceDelegationArgs( + name="Microsoft.Sql/managedInstances", + actions=[ + "Microsoft.Network/virtualNetworks/subnets/join/action", + "Microsoft.Network/virtualNetworks/subnets/prepareNetworkPolicies/action", + "Microsoft.Network/virtualNetworks/subnets/unprepareNetworkPolicies/action", + ], + ), + )]) + example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", + subnet_id=example_subnet.id, + network_security_group_id=example_network_security_group.id) + example_route_table = azure.network.RouteTable("exampleRouteTable", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + disable_bgp_route_propagation=False, + opts=pulumi.ResourceOptions(depends_on=[example_subnet])) + example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", + subnet_id=example_subnet.id, + route_table_id=example_route_table.id) + example_managed_instance = azure.sql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + license_type="BasePrice", + subnet_id=example_subnet.id, + sku_name="GP_Gen5", + vcores=4, + storage_size_in_gb=32, + opts=pulumi.ResourceOptions(depends_on=[ + example_subnet_network_security_group_association, + example_subnet_route_table_association, + ])) + ``` + ## Import SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/managed_instance_active_directory_administrator.py b/sdk/python/pulumi_azure/sql/managed_instance_active_directory_administrator.py index aada090189..e3ed7a96d5 100644 --- a/sdk/python/pulumi_azure/sql/managed_instance_active_directory_administrator.py +++ b/sdk/python/pulumi_azure/sql/managed_instance_active_directory_administrator.py @@ -303,6 +303,36 @@ def __init__(__self__, > **Note:** The `sql.ManagedInstanceActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedInstanceActiveDirectoryAdministrator` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_instance = azure.sql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + license_type="BasePrice", + subnet_id=azurerm_subnet["example"]["id"], + sku_name="GP_Gen5", + vcores=4, + storage_size_in_gb=32, + opts=pulumi.ResourceOptions(depends_on=[ + azurerm_subnet_network_security_group_association["example"], + azurerm_subnet_route_table_association["example"], + ])) + current = azure.core.get_client_config() + example_managed_instance_active_directory_administrator = azure.sql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", + managed_instance_name=example_managed_instance.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A SQL Active Directory Administrator can be imported using the `resource id`, e.g. @@ -331,6 +361,36 @@ def __init__(__self__, > **Note:** The `sql.ManagedInstanceActiveDirectoryAdministrator` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.ManagedInstanceActiveDirectoryAdministrator` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_managed_instance = azure.sql.ManagedInstance("exampleManagedInstance", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + license_type="BasePrice", + subnet_id=azurerm_subnet["example"]["id"], + sku_name="GP_Gen5", + vcores=4, + storage_size_in_gb=32, + opts=pulumi.ResourceOptions(depends_on=[ + azurerm_subnet_network_security_group_association["example"], + azurerm_subnet_route_table_association["example"], + ])) + current = azure.core.get_client_config() + example_managed_instance_active_directory_administrator = azure.sql.ManagedInstanceActiveDirectoryAdministrator("exampleManagedInstanceActiveDirectoryAdministrator", + managed_instance_name=example_managed_instance.name, + resource_group_name=example_resource_group.name, + login="sqladmin", + tenant_id=current.tenant_id, + object_id=current.object_id) + ``` + ## Import A SQL Active Directory Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/sql_server.py b/sdk/python/pulumi_azure/sql/sql_server.py index 1f79adbfe1..70206834f6 100644 --- a/sdk/python/pulumi_azure/sql/sql_server.py +++ b/sdk/python/pulumi_azure/sql/sql_server.py @@ -470,6 +470,29 @@ def __init__(__self__, """ Manages a Microsoft SQL Azure Database Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + tags={ + "environment": "production", + }) + ``` + ## Import SQL Servers can be imported using the `resource id`, e.g. @@ -500,6 +523,29 @@ def __init__(__self__, """ Manages a Microsoft SQL Azure Database Server. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="mradministrator", + administrator_login_password="thisIsDog11", + tags={ + "environment": "production", + }) + ``` + ## Import SQL Servers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/sql/virtual_network_rule.py b/sdk/python/pulumi_azure/sql/virtual_network_rule.py index 47760cdb10..7825535f17 100644 --- a/sdk/python/pulumi_azure/sql/virtual_network_rule.py +++ b/sdk/python/pulumi_azure/sql/virtual_network_rule.py @@ -292,6 +292,34 @@ def __init__(__self__, > **Note:** The `sql.VirtualNetworkRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.VirtualNetworkRule` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + vnet = azure.network.VirtualNetwork("vnet", + address_spaces=["10.7.29.0/29"], + location=example.location, + resource_group_name=example.name) + subnet = azure.network.Subnet("subnet", + resource_group_name=example.name, + virtual_network_name=vnet.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + sqlserver = azure.sql.SqlServer("sqlserver", + resource_group_name=example.name, + location=example.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + sqlvnetrule = azure.sql.VirtualNetworkRule("sqlvnetrule", + resource_group_name=example.name, + server_name=sqlserver.name, + subnet_id=subnet.id) + ``` + ## Import SQL Virtual Network Rules can be imported using the `resource id`, e.g. @@ -327,6 +355,34 @@ def __init__(__self__, > **Note:** The `sql.VirtualNetworkRule` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `mssql.VirtualNetworkRule` resource instead. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.core.ResourceGroup("example", location="West Europe") + vnet = azure.network.VirtualNetwork("vnet", + address_spaces=["10.7.29.0/29"], + location=example.location, + resource_group_name=example.name) + subnet = azure.network.Subnet("subnet", + resource_group_name=example.name, + virtual_network_name=vnet.name, + address_prefixes=["10.7.29.0/29"], + service_endpoints=["Microsoft.Sql"]) + sqlserver = azure.sql.SqlServer("sqlserver", + resource_group_name=example.name, + location=example.location, + version="12.0", + administrator_login="4dm1n157r470r", + administrator_login_password="4-v3ry-53cr37-p455w0rd") + sqlvnetrule = azure.sql.VirtualNetworkRule("sqlvnetrule", + resource_group_name=example.name, + server_name=sqlserver.name, + subnet_id=subnet.id) + ``` + ## Import SQL Virtual Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/stack/hci_cluster.py b/sdk/python/pulumi_azure/stack/hci_cluster.py index 5e31cf7e4e..1923106ef7 100644 --- a/sdk/python/pulumi_azure/stack/hci_cluster.py +++ b/sdk/python/pulumi_azure/stack/hci_cluster.py @@ -339,6 +339,23 @@ def __init__(__self__, """ Manages an Azure Stack HCI Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_application = azuread.get_application(display_name="Allowed resource types") + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_hci_cluster = azure.stack.HciCluster("exampleHciCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + client_id=example_application.application_id, + tenant_id=current.tenant_id) + ``` + ## Import Azure Stack HCI Clusters can be imported using the `resource id`, e.g. @@ -368,6 +385,23 @@ def __init__(__self__, """ Manages an Azure Stack HCI Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_azuread as azuread + + example_application = azuread.get_application(display_name="Allowed resource types") + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_hci_cluster = azure.stack.HciCluster("exampleHciCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + client_id=example_application.application_id, + tenant_id=current.tenant_id) + ``` + ## Import Azure Stack HCI Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/account.py b/sdk/python/pulumi_azure/storage/account.py index 63f985cf37..0a18c83186 100644 --- a/sdk/python/pulumi_azure/storage/account.py +++ b/sdk/python/pulumi_azure/storage/account.py @@ -2235,6 +2235,56 @@ def __init__(__self__, """ Manages an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + tags={ + "environment": "staging", + }) + ``` + ### With Network Rules + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=[ + "Microsoft.Sql", + "Microsoft.Storage", + ]) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + network_rules=azure.storage.AccountNetworkRulesArgs( + default_action="Deny", + ip_rules=["100.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + ), + tags={ + "environment": "staging", + }) + ``` + ## Import Storage Accounts can be imported using the `resource id`, e.g. @@ -2312,6 +2362,56 @@ def __init__(__self__, """ Manages an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + tags={ + "environment": "staging", + }) + ``` + ### With Network Rules + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=[ + "Microsoft.Sql", + "Microsoft.Storage", + ]) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + network_rules=azure.storage.AccountNetworkRulesArgs( + default_action="Deny", + ip_rules=["100.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + ), + tags={ + "environment": "staging", + }) + ``` + ## Import Storage Accounts can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/account_network_rules.py b/sdk/python/pulumi_azure/storage/account_network_rules.py index 49836ef9e6..03aba3cdc9 100644 --- a/sdk/python/pulumi_azure/storage/account_network_rules.py +++ b/sdk/python/pulumi_azure/storage/account_network_rules.py @@ -346,6 +346,38 @@ def __init__(__self__, > **NOTE:** Deleting this resource updates the storage account back to the default values it had when the storage account was created. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=["Microsoft.Storage"]) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + tags={ + "environment": "staging", + }) + example_account_network_rules = azure.storage.AccountNetworkRules("exampleAccountNetworkRules", + storage_account_id=example_account.id, + default_action="Allow", + ip_rules=["127.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + bypasses=["Metrics"]) + ``` + ## Import Storage Account Network Rules can be imported using the `resource id`, e.g. @@ -388,6 +420,38 @@ def __init__(__self__, > **NOTE:** Deleting this resource updates the storage account back to the default values it had when the storage account was created. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + address_spaces=["10.0.0.0/16"], + location=example_resource_group.location, + resource_group_name=example_resource_group.name) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.0.2.0/24"], + service_endpoints=["Microsoft.Storage"]) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + tags={ + "environment": "staging", + }) + example_account_network_rules = azure.storage.AccountNetworkRules("exampleAccountNetworkRules", + storage_account_id=example_account.id, + default_action="Allow", + ip_rules=["127.0.0.1"], + virtual_network_subnet_ids=[example_subnet.id], + bypasses=["Metrics"]) + ``` + ## Import Storage Account Network Rules can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/blob.py b/sdk/python/pulumi_azure/storage/blob.py index 6eef5ea986..900a5f1269 100644 --- a/sdk/python/pulumi_azure/storage/blob.py +++ b/sdk/python/pulumi_azure/storage/blob.py @@ -645,6 +645,28 @@ def __init__(__self__, """ Manages a Blob within a Storage Container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source=pulumi.FileAsset("some-local-file.zip")) + ``` + ## Import Storage Blob's can be imported using the `resource id`, e.g. @@ -684,6 +706,28 @@ def __init__(__self__, """ Manages a Blob within a Storage Container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source=pulumi.FileAsset("some-local-file.zip")) + ``` + ## Import Storage Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/blob_inventory_policy.py b/sdk/python/pulumi_azure/storage/blob_inventory_policy.py index 356fb32973..748b6091a1 100644 --- a/sdk/python/pulumi_azure/storage/blob_inventory_policy.py +++ b/sdk/python/pulumi_azure/storage/blob_inventory_policy.py @@ -136,6 +136,39 @@ def __init__(__self__, """ Manages a Storage Blob Inventory Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + blob_properties=azure.storage.AccountBlobPropertiesArgs( + versioning_enabled=True, + )) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob_inventory_policy = azure.storage.BlobInventoryPolicy("exampleBlobInventoryPolicy", + storage_account_id=example_account.id, + rules=[azure.storage.BlobInventoryPolicyRuleArgs( + name="rule1", + storage_container_name=example_container.name, + format="Csv", + schedule="Daily", + scope="Container", + schema_fields=[ + "Name", + "Last-Modified", + ], + )]) + ``` + ## Import Storage Blob Inventory Policies can be imported using the `resource id`, e.g. @@ -158,6 +191,39 @@ def __init__(__self__, """ Manages a Storage Blob Inventory Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + blob_properties=azure.storage.AccountBlobPropertiesArgs( + versioning_enabled=True, + )) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob_inventory_policy = azure.storage.BlobInventoryPolicy("exampleBlobInventoryPolicy", + storage_account_id=example_account.id, + rules=[azure.storage.BlobInventoryPolicyRuleArgs( + name="rule1", + storage_container_name=example_container.name, + format="Csv", + schedule="Daily", + scope="Container", + schema_fields=[ + "Name", + "Last-Modified", + ], + )]) + ``` + ## Import Storage Blob Inventory Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/container.py b/sdk/python/pulumi_azure/storage/container.py index 51d77b4718..4cbe44294c 100644 --- a/sdk/python/pulumi_azure/storage/container.py +++ b/sdk/python/pulumi_azure/storage/container.py @@ -271,6 +271,26 @@ def __init__(__self__, """ Manages a Container within an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + ``` + ## Import Storage Containers can be imported using the `resource id`, e.g. @@ -295,6 +315,26 @@ def __init__(__self__, """ Manages a Container within an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + tags={ + "environment": "staging", + }) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + ``` + ## Import Storage Containers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/customer_managed_key.py b/sdk/python/pulumi_azure/storage/customer_managed_key.py index d382c5ba11..e97a3cd18a 100644 --- a/sdk/python/pulumi_azure/storage/customer_managed_key.py +++ b/sdk/python/pulumi_azure/storage/customer_managed_key.py @@ -337,6 +337,82 @@ def __init__(__self__, > **NOTE:** It's possible to define a Customer Managed Key both within the `storage.Account` resource via the `customer_managed_key` block and by using the `storage.CustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Storage Account, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + storage = azure.keyvault.AccessPolicy("storage", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_account.identity.principal_id, + secret_permissions=["Get"], + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=["Get"], + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + "SetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + storage, + ])) + example_customer_managed_key = azure.storage.CustomerManagedKey("exampleCustomerManagedKey", + storage_account_id=example_account.id, + key_vault_id=example_key_vault.id, + key_name=example_key.name) + ``` + ## Import Customer Managed Keys for a Storage Account can be imported using the `resource id` of the Storage Account, e.g. @@ -365,6 +441,82 @@ def __init__(__self__, > **NOTE:** It's possible to define a Customer Managed Key both within the `storage.Account` resource via the `customer_managed_key` block and by using the `storage.CustomerManagedKey` resource. However it's not possible to use both methods to manage a Customer Managed Key for a Storage Account, since there'll be conflicts. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + storage = azure.keyvault.AccessPolicy("storage", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=example_account.identity.principal_id, + secret_permissions=["Get"], + key_permissions=[ + "Get", + "UnwrapKey", + "WrapKey", + ]) + client = azure.keyvault.AccessPolicy("client", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + secret_permissions=["Get"], + key_permissions=[ + "Get", + "Create", + "Delete", + "List", + "Restore", + "Recover", + "UnwrapKey", + "WrapKey", + "Purge", + "Encrypt", + "Decrypt", + "Sign", + "Verify", + "GetRotationPolicy", + "SetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "decrypt", + "encrypt", + "sign", + "unwrapKey", + "verify", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[ + client, + storage, + ])) + example_customer_managed_key = azure.storage.CustomerManagedKey("exampleCustomerManagedKey", + storage_account_id=example_account.id, + key_vault_id=example_key_vault.id, + key_name=example_key.name) + ``` + ## Import Customer Managed Keys for a Storage Account can be imported using the `resource id` of the Storage Account, e.g. diff --git a/sdk/python/pulumi_azure/storage/data_lake_gen2_filesystem.py b/sdk/python/pulumi_azure/storage/data_lake_gen2_filesystem.py index 659711450d..fbd858a1c9 100644 --- a/sdk/python/pulumi_azure/storage/data_lake_gen2_filesystem.py +++ b/sdk/python/pulumi_azure/storage/data_lake_gen2_filesystem.py @@ -293,6 +293,27 @@ def __init__(__self__, > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", + storage_account_id=example_account.id, + properties={ + "hello": "aGVsbG8=", + }) + ``` + ## Import Data Lake Gen2 File System's can be imported using the `resource id`, e.g. @@ -323,6 +344,27 @@ def __init__(__self__, > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", + storage_account_id=example_account.id, + properties={ + "hello": "aGVsbG8=", + }) + ``` + ## Import Data Lake Gen2 File System's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/data_lake_gen2_path.py b/sdk/python/pulumi_azure/storage/data_lake_gen2_path.py index 18f380ae43..66cbba37c7 100644 --- a/sdk/python/pulumi_azure/storage/data_lake_gen2_path.py +++ b/sdk/python/pulumi_azure/storage/data_lake_gen2_path.py @@ -329,6 +329,28 @@ def __init__(__self__, > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_data_lake_gen2_path = azure.storage.DataLakeGen2Path("exampleDataLakeGen2Path", + path="example", + filesystem_name=example_data_lake_gen2_filesystem.name, + storage_account_id=example_account.id, + resource="directory") + ``` + ## Import Data Lake Gen2 Paths can be imported using the `resource id`, e.g. @@ -358,6 +380,28 @@ def __init__(__self__, > **NOTE:** This resource requires some `Storage` specific roles which are not granted by default. Some of the built-ins roles that can be attributed are [`Storage Account Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-account-contributor), [`Storage Blob Data Owner`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-owner), [`Storage Blob Data Contributor`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor), [`Storage Blob Data Reader`](https://docs.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-reader). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_data_lake_gen2_path = azure.storage.DataLakeGen2Path("exampleDataLakeGen2Path", + path="example", + filesystem_name=example_data_lake_gen2_filesystem.name, + storage_account_id=example_account.id, + resource="directory") + ``` + ## Import Data Lake Gen2 Paths can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/encryption_scope.py b/sdk/python/pulumi_azure/storage/encryption_scope.py index f5e1263ec3..434eadaeb3 100644 --- a/sdk/python/pulumi_azure/storage/encryption_scope.py +++ b/sdk/python/pulumi_azure/storage/encryption_scope.py @@ -255,6 +255,26 @@ def __init__(__self__, > **Note:** Storage Encryption Scopes are in Preview [more information can be found here](https://docs.microsoft.com/azure/storage/blobs/encryption-scope-manage). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + example_encryption_scope = azure.storage.EncryptionScope("exampleEncryptionScope", + storage_account_id=example_account.id, + source="Microsoft.Storage") + ``` + ## Import Storage Encryption Scopes can be imported using the `resource id`, e.g. @@ -282,6 +302,26 @@ def __init__(__self__, > **Note:** Storage Encryption Scopes are in Preview [more information can be found here](https://docs.microsoft.com/azure/storage/blobs/encryption-scope-manage). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + identity=azure.storage.AccountIdentityArgs( + type="SystemAssigned", + )) + example_encryption_scope = azure.storage.EncryptionScope("exampleEncryptionScope", + storage_account_id=example_account.id, + source="Microsoft.Storage") + ``` + ## Import Storage Encryption Scopes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/get_account.py b/sdk/python/pulumi_azure/storage/get_account.py index 594ae23bf0..414f47a617 100644 --- a/sdk/python/pulumi_azure/storage/get_account.py +++ b/sdk/python/pulumi_azure/storage/get_account.py @@ -663,6 +663,17 @@ def get_account(min_tls_version: Optional[str] = None, """ Use this data source to access information about an existing Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_account(name="packerimages", + resource_group_name="packer-storage") + pulumi.export("storageAccountTier", example.account_tier) + ``` + :param str min_tls_version: The minimum supported TLS version for this storage account. :param str name: Specifies the name of the Storage Account @@ -738,6 +749,17 @@ def get_account_output(min_tls_version: Optional[pulumi.Input[Optional[str]]] = """ Use this data source to access information about an existing Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_account(name="packerimages", + resource_group_name="packer-storage") + pulumi.export("storageAccountTier", example.account_tier) + ``` + :param str min_tls_version: The minimum supported TLS version for this storage account. :param str name: Specifies the name of the Storage Account diff --git a/sdk/python/pulumi_azure/storage/get_account_blob_container_sas.py b/sdk/python/pulumi_azure/storage/get_account_blob_container_sas.py index 6625514045..8795eabeda 100644 --- a/sdk/python/pulumi_azure/storage/get_account_blob_container_sas.py +++ b/sdk/python/pulumi_azure/storage/get_account_blob_container_sas.py @@ -184,6 +184,43 @@ def get_account_blob_container_sas(cache_control: Optional[str] = None, Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + rg = azure.core.ResourceGroup("rg", location="West Europe") + storage = azure.storage.Account("storage", + resource_group_name=rg.name, + location=rg.location, + account_tier="Standard", + account_replication_type="LRS") + container = azure.storage.Container("container", + storage_account_name=storage.name, + container_access_type="private") + example = azure.storage.get_account_blob_container_sas_output(connection_string=storage.primary_connection_string, + container_name=container.name, + https_only=True, + ip_address="168.1.5.65", + start="2018-03-21", + expiry="2018-03-21", + permissions=azure.storage.GetAccountBlobContainerSASPermissionsArgs( + read=True, + add=True, + create=False, + write=False, + delete=True, + list=True, + ), + cache_control="max-age=5", + content_disposition="inline", + content_encoding="deflate", + content_language="en-US", + content_type="application/json") + pulumi.export("sasUrlQueryString", example.sas) + ``` + :param str cache_control: The `Cache-Control` response header that is sent when this SAS token is used. :param str connection_string: The connection string for the storage account to which this SAS applies. Typically directly from the `primary_connection_string` attribute of an `storage.Account` resource. @@ -252,6 +289,43 @@ def get_account_blob_container_sas_output(cache_control: Optional[pulumi.Input[O Shared access signatures allow fine-grained, ephemeral access control to various aspects of an Azure Storage Account Blob Container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + rg = azure.core.ResourceGroup("rg", location="West Europe") + storage = azure.storage.Account("storage", + resource_group_name=rg.name, + location=rg.location, + account_tier="Standard", + account_replication_type="LRS") + container = azure.storage.Container("container", + storage_account_name=storage.name, + container_access_type="private") + example = azure.storage.get_account_blob_container_sas_output(connection_string=storage.primary_connection_string, + container_name=container.name, + https_only=True, + ip_address="168.1.5.65", + start="2018-03-21", + expiry="2018-03-21", + permissions=azure.storage.GetAccountBlobContainerSASPermissionsArgs( + read=True, + add=True, + create=False, + write=False, + delete=True, + list=True, + ), + cache_control="max-age=5", + content_disposition="inline", + content_encoding="deflate", + content_language="en-US", + content_type="application/json") + pulumi.export("sasUrlQueryString", example.sas) + ``` + :param str cache_control: The `Cache-Control` response header that is sent when this SAS token is used. :param str connection_string: The connection string for the storage account to which this SAS applies. Typically directly from the `primary_connection_string` attribute of an `storage.Account` resource. diff --git a/sdk/python/pulumi_azure/storage/get_account_sas.py b/sdk/python/pulumi_azure/storage/get_account_sas.py index dff3db0df4..28b1ea4a62 100644 --- a/sdk/python/pulumi_azure/storage/get_account_sas.py +++ b/sdk/python/pulumi_azure/storage/get_account_sas.py @@ -157,6 +157,52 @@ def get_account_sas(connection_string: Optional[str] = None, Note that this is an [Account SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas) and *not* a [Service SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-a-service-sas). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + tags={ + "environment": "staging", + }) + example_account_sas = azure.storage.get_account_sas_output(connection_string=example_account.primary_connection_string, + https_only=True, + signed_version="2017-07-29", + resource_types=azure.storage.GetAccountSASResourceTypesArgs( + service=True, + container=False, + object=False, + ), + services=azure.storage.GetAccountSASServicesArgs( + blob=True, + queue=False, + table=False, + file=False, + ), + start="2018-03-21T00:00:00Z", + expiry="2020-03-21T00:00:00Z", + permissions=azure.storage.GetAccountSASPermissionsArgs( + read=True, + write=True, + delete=False, + list=False, + add=True, + create=True, + update=False, + process=False, + tag=False, + filter=False, + )) + pulumi.export("sasUrlQueryString", example_account_sas.sas) + ``` + :param str connection_string: The connection string for the storage account to which this SAS applies. Typically directly from the `primary_connection_string` attribute of a `storage.Account` resource. :param str expiry: The expiration time and date of this SAS. Must be a valid ISO-8601 format time/date string. @@ -216,6 +262,52 @@ def get_account_sas_output(connection_string: Optional[pulumi.Input[str]] = None Note that this is an [Account SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-an-account-sas) and *not* a [Service SAS](https://docs.microsoft.com/rest/api/storageservices/constructing-a-service-sas). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS", + tags={ + "environment": "staging", + }) + example_account_sas = azure.storage.get_account_sas_output(connection_string=example_account.primary_connection_string, + https_only=True, + signed_version="2017-07-29", + resource_types=azure.storage.GetAccountSASResourceTypesArgs( + service=True, + container=False, + object=False, + ), + services=azure.storage.GetAccountSASServicesArgs( + blob=True, + queue=False, + table=False, + file=False, + ), + start="2018-03-21T00:00:00Z", + expiry="2020-03-21T00:00:00Z", + permissions=azure.storage.GetAccountSASPermissionsArgs( + read=True, + write=True, + delete=False, + list=False, + add=True, + create=True, + update=False, + process=False, + tag=False, + filter=False, + )) + pulumi.export("sasUrlQueryString", example_account_sas.sas) + ``` + :param str connection_string: The connection string for the storage account to which this SAS applies. Typically directly from the `primary_connection_string` attribute of a `storage.Account` resource. :param str expiry: The expiration time and date of this SAS. Must be a valid ISO-8601 format time/date string. diff --git a/sdk/python/pulumi_azure/storage/get_blob.py b/sdk/python/pulumi_azure/storage/get_blob.py index 839cc9a391..dc3c2a8510 100644 --- a/sdk/python/pulumi_azure/storage/get_blob.py +++ b/sdk/python/pulumi_azure/storage/get_blob.py @@ -151,6 +151,17 @@ def get_blob(metadata: Optional[Mapping[str, str]] = None, """ Use this data source to access information about an existing Storage Blob. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_blob(name="example-blob-name", + storage_account_name="example-storage-account-name", + storage_container_name="example-storage-container-name") + ``` + :param Mapping[str, str] metadata: A map of custom blob metadata. :param str name: The name of the Blob. @@ -187,6 +198,17 @@ def get_blob_output(metadata: Optional[pulumi.Input[Optional[Mapping[str, str]]] """ Use this data source to access information about an existing Storage Blob. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_blob(name="example-blob-name", + storage_account_name="example-storage-account-name", + storage_container_name="example-storage-container-name") + ``` + :param Mapping[str, str] metadata: A map of custom blob metadata. :param str name: The name of the Blob. diff --git a/sdk/python/pulumi_azure/storage/get_encryption_scope.py b/sdk/python/pulumi_azure/storage/get_encryption_scope.py index 64ff906077..a8521808c3 100644 --- a/sdk/python/pulumi_azure/storage/get_encryption_scope.py +++ b/sdk/python/pulumi_azure/storage/get_encryption_scope.py @@ -92,6 +92,19 @@ def get_encryption_scope(name: Optional[str] = None, """ Use this data source to access information about an existing Storage Encryption Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.storage.get_account(name="storageaccountname", + resource_group_name="resourcegroupname") + example_encryption_scope = azure.storage.get_encryption_scope(name="existingStorageES", + storage_account_id=example_account.id) + pulumi.export("id", example_encryption_scope.id) + ``` + :param str name: The name of this Storage Encryption Scope. :param str storage_account_id: The ID of the Storage Account where this Storage Encryption Scope exists. @@ -117,6 +130,19 @@ def get_encryption_scope_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Storage Encryption Scope. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.storage.get_account(name="storageaccountname", + resource_group_name="resourcegroupname") + example_encryption_scope = azure.storage.get_encryption_scope(name="existingStorageES", + storage_account_id=example_account.id) + pulumi.export("id", example_encryption_scope.id) + ``` + :param str name: The name of this Storage Encryption Scope. :param str storage_account_id: The ID of the Storage Account where this Storage Encryption Scope exists. diff --git a/sdk/python/pulumi_azure/storage/get_policy.py b/sdk/python/pulumi_azure/storage/get_policy.py index 9a937a06e5..845396195f 100644 --- a/sdk/python/pulumi_azure/storage/get_policy.py +++ b/sdk/python/pulumi_azure/storage/get_policy.py @@ -71,6 +71,17 @@ def get_policy(storage_account_id: Optional[str] = None, """ Use this data source to access information about an existing Storage Management Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.storage.get_account(name="storageaccountname", + resource_group_name="resourcegroupname") + example_policy = azure.storage.get_policy(storage_account_id=example_account.id) + ``` + :param str storage_account_id: Specifies the id of the storage account to retrieve the management policy for. """ @@ -91,6 +102,17 @@ def get_policy_output(storage_account_id: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Storage Management Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_account = azure.storage.get_account(name="storageaccountname", + resource_group_name="resourcegroupname") + example_policy = azure.storage.get_policy(storage_account_id=example_account.id) + ``` + :param str storage_account_id: Specifies the id of the storage account to retrieve the management policy for. """ diff --git a/sdk/python/pulumi_azure/storage/get_share.py b/sdk/python/pulumi_azure/storage/get_share.py index d08837030d..c9156f050b 100644 --- a/sdk/python/pulumi_azure/storage/get_share.py +++ b/sdk/python/pulumi_azure/storage/get_share.py @@ -117,6 +117,17 @@ def get_share(acls: Optional[Sequence[pulumi.InputType['GetShareAclArgs']]] = No """ Use this data source to access information about an existing File Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_share(name="existing", + storage_account_name="existing") + pulumi.export("id", example.id) + ``` + :param Sequence[pulumi.InputType['GetShareAclArgs']] acls: One or more acl blocks as defined below. :param Mapping[str, str] metadata: A map of custom file share metadata. @@ -150,6 +161,17 @@ def get_share_output(acls: Optional[pulumi.Input[Optional[Sequence[pulumi.InputT """ Use this data source to access information about an existing File Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_share(name="existing", + storage_account_name="existing") + pulumi.export("id", example.id) + ``` + :param Sequence[pulumi.InputType['GetShareAclArgs']] acls: One or more acl blocks as defined below. :param Mapping[str, str] metadata: A map of custom file share metadata. diff --git a/sdk/python/pulumi_azure/storage/get_storage_container.py b/sdk/python/pulumi_azure/storage/get_storage_container.py index 304a7e2f14..2c90c124fd 100644 --- a/sdk/python/pulumi_azure/storage/get_storage_container.py +++ b/sdk/python/pulumi_azure/storage/get_storage_container.py @@ -129,6 +129,16 @@ def get_storage_container(metadata: Optional[Mapping[str, str]] = None, """ Use this data source to access information about an existing Storage Container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_storage_container(name="example-container-name", + storage_account_name="example-storage-account-name") + ``` + :param Mapping[str, str] metadata: A mapping of MetaData for this Container. :param str name: The name of the Container. @@ -160,6 +170,16 @@ def get_storage_container_output(metadata: Optional[pulumi.Input[Optional[Mappin """ Use this data source to access information about an existing Storage Container. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_storage_container(name="example-container-name", + storage_account_name="example-storage-account-name") + ``` + :param Mapping[str, str] metadata: A mapping of MetaData for this Container. :param str name: The name of the Container. diff --git a/sdk/python/pulumi_azure/storage/get_sync.py b/sdk/python/pulumi_azure/storage/get_sync.py index 8a65eebcfa..8e690836f2 100644 --- a/sdk/python/pulumi_azure/storage/get_sync.py +++ b/sdk/python/pulumi_azure/storage/get_sync.py @@ -104,6 +104,17 @@ def get_sync(name: Optional[str] = None, """ Use this data source to access information about an existing Storage Sync. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_sync(name="existingStorageSyncName", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Storage Sync. :param str resource_group_name: The name of the Resource Group where the Storage Sync exists. @@ -130,6 +141,17 @@ def get_sync_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Storage Sync. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_sync(name="existingStorageSyncName", + resource_group_name="existingResGroup") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Storage Sync. :param str resource_group_name: The name of the Resource Group where the Storage Sync exists. diff --git a/sdk/python/pulumi_azure/storage/get_sync_group.py b/sdk/python/pulumi_azure/storage/get_sync_group.py index 62e0e1a404..46429eae2c 100644 --- a/sdk/python/pulumi_azure/storage/get_sync_group.py +++ b/sdk/python/pulumi_azure/storage/get_sync_group.py @@ -68,6 +68,17 @@ def get_sync_group(name: Optional[str] = None, """ Use this data source to access information about an existing Storage Sync Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_sync_group(name="existing-ss-group", + storage_sync_id="existing-ss-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Storage Sync Group. :param str storage_sync_id: The resource ID of the Storage Sync where this Storage Sync Group is. @@ -91,6 +102,17 @@ def get_sync_group_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Storage Sync Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_sync_group(name="existing-ss-group", + storage_sync_id="existing-ss-id") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Storage Sync Group. :param str storage_sync_id: The resource ID of the Storage Sync where this Storage Sync Group is. diff --git a/sdk/python/pulumi_azure/storage/get_table_entity.py b/sdk/python/pulumi_azure/storage/get_table_entity.py index 131318ac94..8935c34659 100644 --- a/sdk/python/pulumi_azure/storage/get_table_entity.py +++ b/sdk/python/pulumi_azure/storage/get_table_entity.py @@ -100,6 +100,18 @@ def get_table_entity(partition_key: Optional[str] = None, """ Use this data source to access information about an existing Storage Table Entity. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_table_entity(partition_key="example-partition-key", + row_key="example-row-key", + storage_account_name="example-storage-account-name", + table_name="example-table-name") + ``` + :param str partition_key: The key for the partition where the entity will be retrieved. :param str row_key: The key for the row where the entity will be retrieved. @@ -132,6 +144,18 @@ def get_table_entity_output(partition_key: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Storage Table Entity. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.storage.get_table_entity(partition_key="example-partition-key", + row_key="example-row-key", + storage_account_name="example-storage-account-name", + table_name="example-table-name") + ``` + :param str partition_key: The key for the partition where the entity will be retrieved. :param str row_key: The key for the row where the entity will be retrieved. diff --git a/sdk/python/pulumi_azure/storage/local_user.py b/sdk/python/pulumi_azure/storage/local_user.py index c5e86854c9..1258ebc16b 100644 --- a/sdk/python/pulumi_azure/storage/local_user.py +++ b/sdk/python/pulumi_azure/storage/local_user.py @@ -376,6 +376,46 @@ def __init__(__self__, """ Manages a Storage Account Local User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="WestEurope") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="StorageV2", + account_tier="Standard", + account_replication_type="LRS", + is_hns_enabled=True) + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_local_user = azure.storage.LocalUser("exampleLocalUser", + storage_account_id=example_account.id, + ssh_key_enabled=True, + ssh_password_enabled=True, + home_directory="example_path", + ssh_authorized_keys=[ + azure.storage.LocalUserSshAuthorizedKeyArgs( + description="key1", + key=local["first_public_key"], + ), + azure.storage.LocalUserSshAuthorizedKeyArgs( + description="key2", + key=local["second_public_key"], + ), + ], + permission_scopes=[azure.storage.LocalUserPermissionScopeArgs( + permissions=azure.storage.LocalUserPermissionScopePermissionsArgs( + read=True, + create=True, + ), + service="blob", + resource_name=example_container.name, + )]) + ``` + ## Import Storage Account Local Users can be imported using the `resource id`, e.g. @@ -403,6 +443,46 @@ def __init__(__self__, """ Manages a Storage Account Local User. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="WestEurope") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="StorageV2", + account_tier="Standard", + account_replication_type="LRS", + is_hns_enabled=True) + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_local_user = azure.storage.LocalUser("exampleLocalUser", + storage_account_id=example_account.id, + ssh_key_enabled=True, + ssh_password_enabled=True, + home_directory="example_path", + ssh_authorized_keys=[ + azure.storage.LocalUserSshAuthorizedKeyArgs( + description="key1", + key=local["first_public_key"], + ), + azure.storage.LocalUserSshAuthorizedKeyArgs( + description="key2", + key=local["second_public_key"], + ), + ], + permission_scopes=[azure.storage.LocalUserPermissionScopeArgs( + permissions=azure.storage.LocalUserPermissionScopePermissionsArgs( + read=True, + create=True, + ), + service="blob", + resource_name=example_container.name, + )]) + ``` + ## Import Storage Account Local Users can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/management_policy.py b/sdk/python/pulumi_azure/storage/management_policy.py index b97349e337..658792058c 100644 --- a/sdk/python/pulumi_azure/storage/management_policy.py +++ b/sdk/python/pulumi_azure/storage/management_policy.py @@ -135,6 +135,76 @@ def __init__(__self__, """ Manages an Azure Storage Account Management Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_management_policy = azure.storage.ManagementPolicy("exampleManagementPolicy", + storage_account_id=example_account.id, + rules=[ + azure.storage.ManagementPolicyRuleArgs( + name="rule1", + enabled=True, + filters=azure.storage.ManagementPolicyRuleFiltersArgs( + prefix_matches=["container1/prefix1"], + blob_types=["blockBlob"], + match_blob_index_tags=[azure.storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs( + name="tag1", + operation="==", + value="val1", + )], + ), + actions=azure.storage.ManagementPolicyRuleActionsArgs( + base_blob=azure.storage.ManagementPolicyRuleActionsBaseBlobArgs( + tier_to_cool_after_days_since_modification_greater_than=10, + tier_to_archive_after_days_since_modification_greater_than=50, + delete_after_days_since_modification_greater_than=100, + ), + snapshot=azure.storage.ManagementPolicyRuleActionsSnapshotArgs( + delete_after_days_since_creation_greater_than=30, + ), + ), + ), + azure.storage.ManagementPolicyRuleArgs( + name="rule2", + enabled=False, + filters=azure.storage.ManagementPolicyRuleFiltersArgs( + prefix_matches=[ + "container2/prefix1", + "container2/prefix2", + ], + blob_types=["blockBlob"], + ), + actions=azure.storage.ManagementPolicyRuleActionsArgs( + base_blob=azure.storage.ManagementPolicyRuleActionsBaseBlobArgs( + tier_to_cool_after_days_since_modification_greater_than=11, + tier_to_archive_after_days_since_modification_greater_than=51, + delete_after_days_since_modification_greater_than=101, + ), + snapshot=azure.storage.ManagementPolicyRuleActionsSnapshotArgs( + change_tier_to_archive_after_days_since_creation=90, + change_tier_to_cool_after_days_since_creation=23, + delete_after_days_since_creation_greater_than=31, + ), + version=azure.storage.ManagementPolicyRuleActionsVersionArgs( + change_tier_to_archive_after_days_since_creation=9, + change_tier_to_cool_after_days_since_creation=90, + delete_after_days_since_creation=3, + ), + ), + ), + ]) + ``` + ## Import Storage Account Management Policies can be imported using the `resource id`, e.g. @@ -157,6 +227,76 @@ def __init__(__self__, """ Manages an Azure Storage Account Management Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_management_policy = azure.storage.ManagementPolicy("exampleManagementPolicy", + storage_account_id=example_account.id, + rules=[ + azure.storage.ManagementPolicyRuleArgs( + name="rule1", + enabled=True, + filters=azure.storage.ManagementPolicyRuleFiltersArgs( + prefix_matches=["container1/prefix1"], + blob_types=["blockBlob"], + match_blob_index_tags=[azure.storage.ManagementPolicyRuleFiltersMatchBlobIndexTagArgs( + name="tag1", + operation="==", + value="val1", + )], + ), + actions=azure.storage.ManagementPolicyRuleActionsArgs( + base_blob=azure.storage.ManagementPolicyRuleActionsBaseBlobArgs( + tier_to_cool_after_days_since_modification_greater_than=10, + tier_to_archive_after_days_since_modification_greater_than=50, + delete_after_days_since_modification_greater_than=100, + ), + snapshot=azure.storage.ManagementPolicyRuleActionsSnapshotArgs( + delete_after_days_since_creation_greater_than=30, + ), + ), + ), + azure.storage.ManagementPolicyRuleArgs( + name="rule2", + enabled=False, + filters=azure.storage.ManagementPolicyRuleFiltersArgs( + prefix_matches=[ + "container2/prefix1", + "container2/prefix2", + ], + blob_types=["blockBlob"], + ), + actions=azure.storage.ManagementPolicyRuleActionsArgs( + base_blob=azure.storage.ManagementPolicyRuleActionsBaseBlobArgs( + tier_to_cool_after_days_since_modification_greater_than=11, + tier_to_archive_after_days_since_modification_greater_than=51, + delete_after_days_since_modification_greater_than=101, + ), + snapshot=azure.storage.ManagementPolicyRuleActionsSnapshotArgs( + change_tier_to_archive_after_days_since_creation=90, + change_tier_to_cool_after_days_since_creation=23, + delete_after_days_since_creation_greater_than=31, + ), + version=azure.storage.ManagementPolicyRuleActionsVersionArgs( + change_tier_to_archive_after_days_since_creation=9, + change_tier_to_cool_after_days_since_creation=90, + delete_after_days_since_creation=3, + ), + ), + ), + ]) + ``` + ## Import Storage Account Management Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/mover.py b/sdk/python/pulumi_azure/storage/mover.py index 8168a791a4..76004f2f9e 100644 --- a/sdk/python/pulumi_azure/storage/mover.py +++ b/sdk/python/pulumi_azure/storage/mover.py @@ -244,6 +244,22 @@ def __init__(__self__, """ Manages a Storage Mover. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location="West Europe", + description="Example Storage Mover Description", + tags={ + "key": "value", + }) + ``` + ## Import Storage Mover can be imported using the `resource id`, e.g. @@ -269,6 +285,22 @@ def __init__(__self__, """ Manages a Storage Mover. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location="West Europe", + description="Example Storage Mover Description", + tags={ + "key": "value", + }) + ``` + ## Import Storage Mover can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/mover_agent.py b/sdk/python/pulumi_azure/storage/mover_agent.py index 5dafaa1893..97627c5866 100644 --- a/sdk/python/pulumi_azure/storage/mover_agent.py +++ b/sdk/python/pulumi_azure/storage/mover_agent.py @@ -254,6 +254,21 @@ def __init__(__self__, """ Manages a Storage Mover Agent. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_mover = azure.storage.Mover("exampleMover", resource_group_name=example_resource_group.name) + example_mover_agent = azure.storage.MoverAgent("exampleMoverAgent", + storage_mover_id=example_mover.id, + arc_virtual_machine_id=example_resource_group.id.apply(lambda id: f"{id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName"), + arc_virtual_machine_uuid="3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", + description="Example Agent Description") + ``` + ## Import Storage Mover Agent can be imported using the `resource id`, e.g. @@ -279,6 +294,21 @@ def __init__(__self__, """ Manages a Storage Mover Agent. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US") + example_mover = azure.storage.Mover("exampleMover", resource_group_name=example_resource_group.name) + example_mover_agent = azure.storage.MoverAgent("exampleMoverAgent", + storage_mover_id=example_mover.id, + arc_virtual_machine_id=example_resource_group.id.apply(lambda id: f"{id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName"), + arc_virtual_machine_uuid="3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9", + description="Example Agent Description") + ``` + ## Import Storage Mover Agent can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/mover_job_definition.py b/sdk/python/pulumi_azure/storage/mover_job_definition.py index 8dfae0b14e..bc8ae7d19f 100644 --- a/sdk/python/pulumi_azure/storage/mover_job_definition.py +++ b/sdk/python/pulumi_azure/storage/mover_job_definition.py @@ -419,6 +419,48 @@ def __init__(__self__, """ Manages a Storage Mover Job Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_mover_agent = azure.storage.MoverAgent("exampleMoverAgent", + storage_mover_id=example_mover.id, + arc_virtual_machine_id=example_resource_group.id.apply(lambda id: f"{id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName"), + arc_virtual_machine_uuid="3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + allow_nested_items_to_be_public=True) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="blob") + example_mover_target_endpoint = azure.storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", + storage_mover_id=example_mover.id, + storage_account_id=example_account.id, + storage_container_name=example_container.name) + example_mover_source_endpoint = azure.storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", + storage_mover_id=example_mover.id, + host="192.168.0.1") + example_mover_project = azure.storage.MoverProject("exampleMoverProject", storage_mover_id=example_mover.id) + example_mover_job_definition = azure.storage.MoverJobDefinition("exampleMoverJobDefinition", + storage_mover_project_id=example_mover_project.id, + agent_name=example_mover_agent.name, + copy_mode="Additive", + source_name=example_mover_source_endpoint.name, + source_sub_path="/", + target_name=example_mover_target_endpoint.name, + target_sub_path="/", + description="Example Job Definition Description") + ``` + ## Import Storage Mover Job Definition can be imported using the `resource id`, e.g. @@ -448,6 +490,48 @@ def __init__(__self__, """ Manages a Storage Mover Job Definition. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_mover_agent = azure.storage.MoverAgent("exampleMoverAgent", + storage_mover_id=example_mover.id, + arc_virtual_machine_id=example_resource_group.id.apply(lambda id: f"{id}/providers/Microsoft.HybridCompute/machines/examples-hybridComputeName"), + arc_virtual_machine_uuid="3bb2c024-eba9-4d18-9e7a-1d772fcc5fe9") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + allow_nested_items_to_be_public=True) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="blob") + example_mover_target_endpoint = azure.storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", + storage_mover_id=example_mover.id, + storage_account_id=example_account.id, + storage_container_name=example_container.name) + example_mover_source_endpoint = azure.storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", + storage_mover_id=example_mover.id, + host="192.168.0.1") + example_mover_project = azure.storage.MoverProject("exampleMoverProject", storage_mover_id=example_mover.id) + example_mover_job_definition = azure.storage.MoverJobDefinition("exampleMoverJobDefinition", + storage_mover_project_id=example_mover_project.id, + agent_name=example_mover_agent.name, + copy_mode="Additive", + source_name=example_mover_source_endpoint.name, + source_sub_path="/", + target_name=example_mover_target_endpoint.name, + target_sub_path="/", + description="Example Job Definition Description") + ``` + ## Import Storage Mover Job Definition can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/mover_project.py b/sdk/python/pulumi_azure/storage/mover_project.py index 64c0815c28..fc1803e490 100644 --- a/sdk/python/pulumi_azure/storage/mover_project.py +++ b/sdk/python/pulumi_azure/storage/mover_project.py @@ -170,6 +170,21 @@ def __init__(__self__, """ Manages a Storage Mover Project. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_mover_project = azure.storage.MoverProject("exampleMoverProject", + storage_mover_id=example_mover.id, + description="Example Project Description") + ``` + ## Import Storage Mover Project can be imported using the `resource id`, e.g. @@ -193,6 +208,21 @@ def __init__(__self__, """ Manages a Storage Mover Project. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_mover_project = azure.storage.MoverProject("exampleMoverProject", + storage_mover_id=example_mover.id, + description="Example Project Description") + ``` + ## Import Storage Mover Project can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/mover_source_endpoint.py b/sdk/python/pulumi_azure/storage/mover_source_endpoint.py index c825179487..85884bb0ac 100644 --- a/sdk/python/pulumi_azure/storage/mover_source_endpoint.py +++ b/sdk/python/pulumi_azure/storage/mover_source_endpoint.py @@ -286,6 +286,23 @@ def __init__(__self__, """ Manages a Storage Mover Source Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location="West Europe") + example_mover_source_endpoint = azure.storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", + storage_mover_id=example_mover.id, + export="/", + host="192.168.0.1", + nfs_version="NFSv3") + ``` + ## Import Storage Mover Source Endpoint can be imported using the `resource id`, e.g. @@ -312,6 +329,23 @@ def __init__(__self__, """ Manages a Storage Mover Source Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location="West Europe") + example_mover_source_endpoint = azure.storage.MoverSourceEndpoint("exampleMoverSourceEndpoint", + storage_mover_id=example_mover.id, + export="/", + host="192.168.0.1", + nfs_version="NFSv3") + ``` + ## Import Storage Mover Source Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/mover_target_endpoint.py b/sdk/python/pulumi_azure/storage/mover_target_endpoint.py index e3b4f90829..ebd3b413a7 100644 --- a/sdk/python/pulumi_azure/storage/mover_target_endpoint.py +++ b/sdk/python/pulumi_azure/storage/mover_target_endpoint.py @@ -254,6 +254,32 @@ def __init__(__self__, """ Manages a Storage Mover Target Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + allow_nested_items_to_be_public=True) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="blob") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location="West Europe") + example_mover_target_endpoint = azure.storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", + storage_mover_id=example_mover.id, + storage_account_id=example_account.id, + storage_container_name=example_container.name, + description="Example Storage Container Endpoint Description") + ``` + ## Import Storage Mover Target Endpoint can be imported using the `resource id`, e.g. @@ -279,6 +305,32 @@ def __init__(__self__, """ Manages a Storage Mover Target Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + allow_nested_items_to_be_public=True) + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="blob") + example_mover = azure.storage.Mover("exampleMover", + resource_group_name=example_resource_group.name, + location="West Europe") + example_mover_target_endpoint = azure.storage.MoverTargetEndpoint("exampleMoverTargetEndpoint", + storage_mover_id=example_mover.id, + storage_account_id=example_account.id, + storage_container_name=example_container.name, + description="Example Storage Container Endpoint Description") + ``` + ## Import Storage Mover Target Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/object_replication.py b/sdk/python/pulumi_azure/storage/object_replication.py index a533833110..6206bbc651 100644 --- a/sdk/python/pulumi_azure/storage/object_replication.py +++ b/sdk/python/pulumi_azure/storage/object_replication.py @@ -218,6 +218,47 @@ def __init__(__self__, """ Manages a Storage Object Replication. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + src_resource_group = azure.core.ResourceGroup("srcResourceGroup", location="West Europe") + src_account = azure.storage.Account("srcAccount", + resource_group_name=src_resource_group.name, + location=src_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + blob_properties=azure.storage.AccountBlobPropertiesArgs( + versioning_enabled=True, + change_feed_enabled=True, + )) + src_container = azure.storage.Container("srcContainer", + storage_account_name=src_account.name, + container_access_type="private") + dst_resource_group = azure.core.ResourceGroup("dstResourceGroup", location="East US") + dst_account = azure.storage.Account("dstAccount", + resource_group_name=dst_resource_group.name, + location=dst_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + blob_properties=azure.storage.AccountBlobPropertiesArgs( + versioning_enabled=True, + change_feed_enabled=True, + )) + dst_container = azure.storage.Container("dstContainer", + storage_account_name=dst_account.name, + container_access_type="private") + example = azure.storage.ObjectReplication("example", + source_storage_account_id=src_account.id, + destination_storage_account_id=dst_account.id, + rules=[azure.storage.ObjectReplicationRuleArgs( + source_container_name=src_container.name, + destination_container_name=dst_container.name, + )]) + ``` + ## Import Storage Object Replication Policies can be imported using the `resource id`, e.g. @@ -241,6 +282,47 @@ def __init__(__self__, """ Manages a Storage Object Replication. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + src_resource_group = azure.core.ResourceGroup("srcResourceGroup", location="West Europe") + src_account = azure.storage.Account("srcAccount", + resource_group_name=src_resource_group.name, + location=src_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + blob_properties=azure.storage.AccountBlobPropertiesArgs( + versioning_enabled=True, + change_feed_enabled=True, + )) + src_container = azure.storage.Container("srcContainer", + storage_account_name=src_account.name, + container_access_type="private") + dst_resource_group = azure.core.ResourceGroup("dstResourceGroup", location="East US") + dst_account = azure.storage.Account("dstAccount", + resource_group_name=dst_resource_group.name, + location=dst_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + blob_properties=azure.storage.AccountBlobPropertiesArgs( + versioning_enabled=True, + change_feed_enabled=True, + )) + dst_container = azure.storage.Container("dstContainer", + storage_account_name=dst_account.name, + container_access_type="private") + example = azure.storage.ObjectReplication("example", + source_storage_account_id=src_account.id, + destination_storage_account_id=dst_account.id, + rules=[azure.storage.ObjectReplicationRuleArgs( + source_container_name=src_container.name, + destination_container_name=dst_container.name, + )]) + ``` + ## Import Storage Object Replication Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/queue.py b/sdk/python/pulumi_azure/storage/queue.py index ea3984c7cb..5ad40bcd15 100644 --- a/sdk/python/pulumi_azure/storage/queue.py +++ b/sdk/python/pulumi_azure/storage/queue.py @@ -190,6 +190,21 @@ def __init__(__self__, """ Manages a Queue within an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + ``` + ## Import Storage Queue's can be imported using the `resource id`, e.g. @@ -213,6 +228,21 @@ def __init__(__self__, """ Manages a Queue within an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_queue = azure.storage.Queue("exampleQueue", storage_account_name=example_account.name) + ``` + ## Import Storage Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/share.py b/sdk/python/pulumi_azure/storage/share.py index 5f3b139332..8ffbcb663c 100644 --- a/sdk/python/pulumi_azure/storage/share.py +++ b/sdk/python/pulumi_azure/storage/share.py @@ -401,6 +401,31 @@ def __init__(__self__, > **Note:** The storage share supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts. For further information, refer to the section "What storage tiers are supported in Azure Files?" of [documentation](https://docs.microsoft.com/azure/storage/files/storage-files-faq#general). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50, + acls=[azure.storage.ShareAclArgs( + id="MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI", + access_policies=[azure.storage.ShareAclAccessPolicyArgs( + permissions="rwdl", + start="2019-07-02T09:38:21.0000000Z", + expiry="2019-07-02T10:38:21.0000000Z", + )], + )]) + ``` + ## Import Storage Shares can be imported using the `resource id`, e.g. @@ -438,6 +463,31 @@ def __init__(__self__, > **Note:** The storage share supports two storage tiers: premium and standard. Standard file shares are created in general purpose (GPv1 or GPv2) storage accounts and premium file shares are created in FileStorage storage accounts. For further information, refer to the section "What storage tiers are supported in Azure Files?" of [documentation](https://docs.microsoft.com/azure/storage/files/storage-files-faq#general). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50, + acls=[azure.storage.ShareAclArgs( + id="MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI", + access_policies=[azure.storage.ShareAclAccessPolicyArgs( + permissions="rwdl", + start="2019-07-02T09:38:21.0000000Z", + expiry="2019-07-02T10:38:21.0000000Z", + )], + )]) + ``` + ## Import Storage Shares can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/share_directory.py b/sdk/python/pulumi_azure/storage/share_directory.py index 25c060779f..8c594cea12 100644 --- a/sdk/python/pulumi_azure/storage/share_directory.py +++ b/sdk/python/pulumi_azure/storage/share_directory.py @@ -212,6 +212,26 @@ def __init__(__self__, """ Manages a Directory within an Azure Storage File Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50) + example_share_directory = azure.storage.ShareDirectory("exampleShareDirectory", + share_name=example_share.name, + storage_account_name=example_account.name) + ``` + ## Import Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. @@ -236,6 +256,26 @@ def __init__(__self__, """ Manages a Directory within an Azure Storage File Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50) + example_share_directory = azure.storage.ShareDirectory("exampleShareDirectory", + share_name=example_share.name, + storage_account_name=example_account.name) + ``` + ## Import Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/share_file.py b/sdk/python/pulumi_azure/storage/share_file.py index 9b57eafd7e..d9308e7eb1 100644 --- a/sdk/python/pulumi_azure/storage/share_file.py +++ b/sdk/python/pulumi_azure/storage/share_file.py @@ -428,6 +428,26 @@ def __init__(__self__, """ Manages a File within an Azure Storage File Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50) + example_share_file = azure.storage.ShareFile("exampleShareFile", + storage_share_id=example_share.id, + source="some-local-file.zip") + ``` + ## Import Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. @@ -457,6 +477,26 @@ def __init__(__self__, """ Manages a File within an Azure Storage File Share. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50) + example_share_file = azure.storage.ShareFile("exampleShareFile", + storage_share_id=example_share.id, + source="some-local-file.zip") + ``` + ## Import Directories within an Azure Storage File Share can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/sync.py b/sdk/python/pulumi_azure/storage/sync.py index 4d3ce2bd45..85b2fb2b88 100644 --- a/sdk/python/pulumi_azure/storage/sync.py +++ b/sdk/python/pulumi_azure/storage/sync.py @@ -248,6 +248,21 @@ def __init__(__self__, """ Manages a Storage Sync. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sync = azure.storage.Sync("exampleSync", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "foo": "bar", + }) + ``` + ## Import Storage Syncs can be imported using the `resource id`, e.g. @@ -273,6 +288,21 @@ def __init__(__self__, """ Manages a Storage Sync. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sync = azure.storage.Sync("exampleSync", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + tags={ + "foo": "bar", + }) + ``` + ## Import Storage Syncs can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/sync_cloud_endpoint.py b/sdk/python/pulumi_azure/storage/sync_cloud_endpoint.py index 560c67ac31..4443b74780 100644 --- a/sdk/python/pulumi_azure/storage/sync_cloud_endpoint.py +++ b/sdk/python/pulumi_azure/storage/sync_cloud_endpoint.py @@ -260,6 +260,37 @@ def __init__(__self__, > **NOTE:** Please ensure Azure File Sync has access to the storage account in your subscription, which indicates that `Microsoft.StorageSync` is assigned role `Reader and Data Access` ( refer to details [here](https://docs.microsoft.com/azure/storage/files/storage-sync-files-troubleshoot?tabs=portal1%2Cazure-portal#common-troubleshooting-steps)). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sync = azure.storage.Sync("exampleSync", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_sync_group = azure.storage.SyncGroup("exampleSyncGroup", storage_sync_id=example_sync.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50, + acls=[azure.storage.ShareAclArgs( + id="GhostedRecall", + access_policies=[azure.storage.ShareAclAccessPolicyArgs( + permissions="r", + )], + )]) + example_sync_cloud_endpoint = azure.storage.SyncCloudEndpoint("exampleSyncCloudEndpoint", + storage_sync_group_id=example_sync_group.id, + file_share_name=example_share.name, + storage_account_id=example_account.id) + ``` + ## Import Storage Sync Cloud Endpoints can be imported using the `resource id`, e.g. @@ -287,6 +318,37 @@ def __init__(__self__, > **NOTE:** Please ensure Azure File Sync has access to the storage account in your subscription, which indicates that `Microsoft.StorageSync` is assigned role `Reader and Data Access` ( refer to details [here](https://docs.microsoft.com/azure/storage/files/storage-sync-files-troubleshoot?tabs=portal1%2Cazure-portal#common-troubleshooting-steps)). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sync = azure.storage.Sync("exampleSync", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_sync_group = azure.storage.SyncGroup("exampleSyncGroup", storage_sync_id=example_sync.id) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_share = azure.storage.Share("exampleShare", + storage_account_name=example_account.name, + quota=50, + acls=[azure.storage.ShareAclArgs( + id="GhostedRecall", + access_policies=[azure.storage.ShareAclAccessPolicyArgs( + permissions="r", + )], + )]) + example_sync_cloud_endpoint = azure.storage.SyncCloudEndpoint("exampleSyncCloudEndpoint", + storage_sync_group_id=example_sync_group.id, + file_share_name=example_share.name, + storage_account_id=example_account.id) + ``` + ## Import Storage Sync Cloud Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/sync_group.py b/sdk/python/pulumi_azure/storage/sync_group.py index 6981f51b59..9d6ddf2027 100644 --- a/sdk/python/pulumi_azure/storage/sync_group.py +++ b/sdk/python/pulumi_azure/storage/sync_group.py @@ -133,6 +133,19 @@ def __init__(__self__, """ Manages a Storage Sync Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sync = azure.storage.Sync("exampleSync", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_sync_group = azure.storage.SyncGroup("exampleSyncGroup", storage_sync_id=example_sync.id) + ``` + ## Import Storage Sync Groups can be imported using the `resource id`, e.g. @@ -155,6 +168,19 @@ def __init__(__self__, """ Manages a Storage Sync Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_sync = azure.storage.Sync("exampleSync", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_sync_group = azure.storage.SyncGroup("exampleSyncGroup", storage_sync_id=example_sync.id) + ``` + ## Import Storage Sync Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/table.py b/sdk/python/pulumi_azure/storage/table.py index d3ac2d21f2..aa6d54933e 100644 --- a/sdk/python/pulumi_azure/storage/table.py +++ b/sdk/python/pulumi_azure/storage/table.py @@ -172,6 +172,21 @@ def __init__(__self__, """ Manages a Table within an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_table = azure.storage.Table("exampleTable", storage_account_name=example_account.name) + ``` + ## Import Table's within a Storage Account can be imported using the `resource id`, e.g. @@ -195,6 +210,21 @@ def __init__(__self__, """ Manages a Table within an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_table = azure.storage.Table("exampleTable", storage_account_name=example_account.name) + ``` + ## Import Table's within a Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/storage/table_entity.py b/sdk/python/pulumi_azure/storage/table_entity.py index 7f1900fc3e..7c318ceb58 100644 --- a/sdk/python/pulumi_azure/storage/table_entity.py +++ b/sdk/python/pulumi_azure/storage/table_entity.py @@ -260,6 +260,29 @@ def __init__(__self__, """ Manages an Entity within a Table in an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_table = azure.storage.Table("exampleTable", storage_account_name=example_account.name) + example_table_entity = azure.storage.TableEntity("exampleTableEntity", + storage_account_name=example_account.name, + table_name=example_table.name, + partition_key="examplepartition", + row_key="examplerow", + entity={ + "example": "example", + }) + ``` + ## Import Entities within a Table in an Azure Storage Account can be imported using the `resource id`, e.g. @@ -285,6 +308,29 @@ def __init__(__self__, """ Manages an Entity within a Table in an Azure Storage Account. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_table = azure.storage.Table("exampleTable", storage_account_name=example_account.name) + example_table_entity = azure.storage.TableEntity("exampleTableEntity", + storage_account_name=example_account.name, + table_name=example_table.name, + partition_key="examplepartition", + row_key="examplerow", + entity={ + "example": "example", + }) + ``` + ## Import Entities within a Table in an Azure Storage Account can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/cluster.py b/sdk/python/pulumi_azure/streamanalytics/cluster.py index e14f8b65f3..1a7c9d36eb 100644 --- a/sdk/python/pulumi_azure/streamanalytics/cluster.py +++ b/sdk/python/pulumi_azure/streamanalytics/cluster.py @@ -249,6 +249,19 @@ def __init__(__self__, """ Manages a Stream Analytics Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.streamanalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + streaming_capacity=36) + ``` + ## Import Stream Analytics Clusters can be imported using the `resource id`, e.g. @@ -274,6 +287,19 @@ def __init__(__self__, """ Manages a Stream Analytics Cluster. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_cluster = azure.streamanalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + streaming_capacity=36) + ``` + ## Import Stream Analytics Clusters can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/function_java_script_udf.py b/sdk/python/pulumi_azure/streamanalytics/function_java_script_udf.py index c7b44980cd..3561309fd1 100644 --- a/sdk/python/pulumi_azure/streamanalytics/function_java_script_udf.py +++ b/sdk/python/pulumi_azure/streamanalytics/function_java_script_udf.py @@ -291,6 +291,30 @@ def __init__(__self__, """ Manages a JavaScript UDF Function within Stream Analytics Streaming Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.get_resource_group(name="example-resources") + example_job = azure.streamanalytics.get_job(name="example-job", + resource_group_name=example_resource_group.name) + example_function_java_script_udf = azure.streamanalytics.FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + script=\"\"\"function getRandomNumber(in) { + return in; + } + \"\"\", + inputs=[azure.streamanalytics.FunctionJavaScriptUDFInputArgs( + type="bigint", + )], + output=azure.streamanalytics.FunctionJavaScriptUDFOutputArgs( + type="bigint", + )) + ``` + ## Import Stream Analytics JavaScript UDF Functions can be imported using the `resource id`, e.g. @@ -317,6 +341,30 @@ def __init__(__self__, """ Manages a JavaScript UDF Function within Stream Analytics Streaming Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.get_resource_group(name="example-resources") + example_job = azure.streamanalytics.get_job(name="example-job", + resource_group_name=example_resource_group.name) + example_function_java_script_udf = azure.streamanalytics.FunctionJavaScriptUDF("exampleFunctionJavaScriptUDF", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + script=\"\"\"function getRandomNumber(in) { + return in; + } + \"\"\", + inputs=[azure.streamanalytics.FunctionJavaScriptUDFInputArgs( + type="bigint", + )], + output=azure.streamanalytics.FunctionJavaScriptUDFOutputArgs( + type="bigint", + )) + ``` + ## Import Stream Analytics JavaScript UDF Functions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/function_javascript_uda.py b/sdk/python/pulumi_azure/streamanalytics/function_javascript_uda.py index 0d0add62f4..183640844d 100644 --- a/sdk/python/pulumi_azure/streamanalytics/function_javascript_uda.py +++ b/sdk/python/pulumi_azure/streamanalytics/function_javascript_uda.py @@ -249,6 +249,39 @@ def __init__(__self__, """ Manages a JavaScript UDA Function within a Stream Analytics Streaming Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.get_resource_group(name="example-resources") + example_job = azure.streamanalytics.get_job(name="example-job", + resource_group_name=example_resource_group.name) + example_function_javascript_uda = azure.streamanalytics.FunctionJavascriptUda("exampleFunctionJavascriptUda", + stream_analytics_job_id=example_job.id, + script=\"\"\"function main() { + this.init = function () { + this.state = 0; + } + + this.accumulate = function (value, timestamp) { + this.state += value; + } + + this.computeResult = function () { + return this.state; + } + } + \"\"\", + inputs=[azure.streamanalytics.FunctionJavascriptUdaInputArgs( + type="bigint", + )], + output=azure.streamanalytics.FunctionJavascriptUdaOutputArgs( + type="bigint", + )) + ``` + ## Import Stream Analytics JavaScript UDA Functions can be imported using the `resource id`, e.g. @@ -274,6 +307,39 @@ def __init__(__self__, """ Manages a JavaScript UDA Function within a Stream Analytics Streaming Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.get_resource_group(name="example-resources") + example_job = azure.streamanalytics.get_job(name="example-job", + resource_group_name=example_resource_group.name) + example_function_javascript_uda = azure.streamanalytics.FunctionJavascriptUda("exampleFunctionJavascriptUda", + stream_analytics_job_id=example_job.id, + script=\"\"\"function main() { + this.init = function () { + this.state = 0; + } + + this.accumulate = function (value, timestamp) { + this.state += value; + } + + this.computeResult = function () { + return this.state; + } + } + \"\"\", + inputs=[azure.streamanalytics.FunctionJavascriptUdaInputArgs( + type="bigint", + )], + output=azure.streamanalytics.FunctionJavascriptUdaOutputArgs( + type="bigint", + )) + ``` + ## Import Stream Analytics JavaScript UDA Functions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/get_job.py b/sdk/python/pulumi_azure/streamanalytics/get_job.py index a3f7648aa4..f08a84ba6e 100644 --- a/sdk/python/pulumi_azure/streamanalytics/get_job.py +++ b/sdk/python/pulumi_azure/streamanalytics/get_job.py @@ -237,6 +237,17 @@ def get_job(name: Optional[str] = None, """ Use this data source to access information about an existing Stream Analytics Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.streamanalytics.get_job(name="example-job", + resource_group_name="example-resources") + pulumi.export("jobId", example.job_id) + ``` + :param str name: Specifies the name of the Stream Analytics Job. :param str resource_group_name: Specifies the name of the resource group the Stream Analytics Job is located in. @@ -274,6 +285,17 @@ def get_job_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Stream Analytics Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.streamanalytics.get_job(name="example-job", + resource_group_name="example-resources") + pulumi.export("jobId", example.job_id) + ``` + :param str name: Specifies the name of the Stream Analytics Job. :param str resource_group_name: Specifies the name of the resource group the Stream Analytics Job is located in. diff --git a/sdk/python/pulumi_azure/streamanalytics/job.py b/sdk/python/pulumi_azure/streamanalytics/job.py index d6eb23e438..461c73e22c 100644 --- a/sdk/python/pulumi_azure/streamanalytics/job.py +++ b/sdk/python/pulumi_azure/streamanalytics/job.py @@ -779,6 +779,32 @@ def __init__(__self__, """ Manages a Stream Analytics Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.Job("exampleJob", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + compatibility_level="1.2", + data_locale="en-GB", + events_late_arrival_max_delay_in_seconds=60, + events_out_of_order_max_delay_in_seconds=50, + events_out_of_order_policy="Adjust", + output_error_policy="Drop", + streaming_units=3, + tags={ + "environment": "Example", + }, + transformation_query=\"\"\" SELECT * + INTO [YourOutputAlias] + FROM [YourInputAlias] + \"\"\") + ``` + ## Import Stream Analytics Job's can be imported using the `resource id`, e.g. @@ -822,6 +848,32 @@ def __init__(__self__, """ Manages a Stream Analytics Job. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.Job("exampleJob", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + compatibility_level="1.2", + data_locale="en-GB", + events_late_arrival_max_delay_in_seconds=60, + events_out_of_order_max_delay_in_seconds=50, + events_out_of_order_policy="Adjust", + output_error_policy="Drop", + streaming_units=3, + tags={ + "environment": "Example", + }, + transformation_query=\"\"\" SELECT * + INTO [YourOutputAlias] + FROM [YourInputAlias] + \"\"\") + ``` + ## Import Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/job_schedule.py b/sdk/python/pulumi_azure/streamanalytics/job_schedule.py index 60d9a754c3..d7986662c1 100644 --- a/sdk/python/pulumi_azure/streamanalytics/job_schedule.py +++ b/sdk/python/pulumi_azure/streamanalytics/job_schedule.py @@ -207,6 +207,80 @@ def __init__(__self__, """ Manages a Stream Analytics Job Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source=pulumi.FileAsset("example.csv")) + example_job = azure.streamanalytics.Job("exampleJob", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + compatibility_level="1.2", + data_locale="en-GB", + events_late_arrival_max_delay_in_seconds=60, + events_out_of_order_max_delay_in_seconds=50, + events_out_of_order_policy="Adjust", + output_error_policy="Drop", + streaming_units=3, + tags={ + "environment": "Example", + }, + transformation_query=\"\"\" SELECT * + INTO [exampleoutput] + FROM [exampleinput] + \"\"\") + example_stream_input_blob = azure.streamanalytics.StreamInputBlob("exampleStreamInputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="", + date_format="yyyy/MM/dd", + time_format="HH", + serialization=azure.streamanalytics.StreamInputBlobSerializationArgs( + type="Csv", + encoding="UTF8", + field_delimiter=",", + )) + example_output_blob = azure.streamanalytics.OutputBlob("exampleOutputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="example-{date}-{time}", + date_format="yyyy-MM-dd", + time_format="HH", + serialization=azure.streamanalytics.OutputBlobSerializationArgs( + type="Avro", + )) + example_job_schedule = azure.streamanalytics.JobSchedule("exampleJobSchedule", + stream_analytics_job_id=example_job.id, + start_mode="CustomTime", + start_time="2022-09-21T00:00:00Z", + opts=pulumi.ResourceOptions(depends_on=[ + example_job, + example_stream_input_blob, + example_output_blob, + ])) + ``` + ## Import Stream Analytics Job's can be imported using the `resource id`, e.g. @@ -232,6 +306,80 @@ def __init__(__self__, """ Manages a Stream Analytics Job Schedule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_blob = azure.storage.Blob("exampleBlob", + storage_account_name=example_account.name, + storage_container_name=example_container.name, + type="Block", + source=pulumi.FileAsset("example.csv")) + example_job = azure.streamanalytics.Job("exampleJob", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + compatibility_level="1.2", + data_locale="en-GB", + events_late_arrival_max_delay_in_seconds=60, + events_out_of_order_max_delay_in_seconds=50, + events_out_of_order_policy="Adjust", + output_error_policy="Drop", + streaming_units=3, + tags={ + "environment": "Example", + }, + transformation_query=\"\"\" SELECT * + INTO [exampleoutput] + FROM [exampleinput] + \"\"\") + example_stream_input_blob = azure.streamanalytics.StreamInputBlob("exampleStreamInputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="", + date_format="yyyy/MM/dd", + time_format="HH", + serialization=azure.streamanalytics.StreamInputBlobSerializationArgs( + type="Csv", + encoding="UTF8", + field_delimiter=",", + )) + example_output_blob = azure.streamanalytics.OutputBlob("exampleOutputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="example-{date}-{time}", + date_format="yyyy-MM-dd", + time_format="HH", + serialization=azure.streamanalytics.OutputBlobSerializationArgs( + type="Avro", + )) + example_job_schedule = azure.streamanalytics.JobSchedule("exampleJobSchedule", + stream_analytics_job_id=example_job.id, + start_mode="CustomTime", + start_time="2022-09-21T00:00:00Z", + opts=pulumi.ResourceOptions(depends_on=[ + example_job, + example_stream_input_blob, + example_output_blob, + ])) + ``` + ## Import Stream Analytics Job's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/managed_private_endpoint.py b/sdk/python/pulumi_azure/streamanalytics/managed_private_endpoint.py index c02fdec7de..54f04c735e 100644 --- a/sdk/python/pulumi_azure/streamanalytics/managed_private_endpoint.py +++ b/sdk/python/pulumi_azure/streamanalytics/managed_private_endpoint.py @@ -259,6 +259,31 @@ def __init__(__self__, """ Manages a Stream Analytics Managed Private Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_cluster = azure.streamanalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + streaming_capacity=36) + example_managed_private_endpoint = azure.streamanalytics.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", + resource_group_name=example_resource_group.name, + stream_analytics_cluster_name=example_cluster.name, + target_resource_id=example_account.id, + subresource_name="blob") + ``` + ## Import Stream Analytics Private Endpoints can be imported using the `resource id`, e.g. @@ -284,6 +309,31 @@ def __init__(__self__, """ Manages a Stream Analytics Managed Private Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_cluster = azure.streamanalytics.Cluster("exampleCluster", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + streaming_capacity=36) + example_managed_private_endpoint = azure.streamanalytics.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", + resource_group_name=example_resource_group.name, + stream_analytics_cluster_name=example_cluster.name, + target_resource_id=example_account.id, + subresource_name="blob") + ``` + ## Import Stream Analytics Private Endpoints can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_blob.py b/sdk/python/pulumi_azure/streamanalytics/output_blob.py index c026d080f4..fb1a94aa0b 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_blob.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_blob.py @@ -589,6 +589,39 @@ def __init__(__self__, """ Manages a Stream Analytics Output to Blob Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_output_blob = azure.streamanalytics.OutputBlob("exampleOutputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="some-pattern", + date_format="yyyy-MM-dd", + time_format="HH", + serialization=azure.streamanalytics.OutputBlobSerializationArgs( + type="Csv", + encoding="UTF8", + field_delimiter=",", + )) + ``` + ## Import Stream Analytics Outputs to Blob Storage can be imported using the `resource id`, e.g. @@ -622,6 +655,39 @@ def __init__(__self__, """ Manages a Stream Analytics Output to Blob Storage. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_output_blob = azure.streamanalytics.OutputBlob("exampleOutputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="some-pattern", + date_format="yyyy-MM-dd", + time_format="HH", + serialization=azure.streamanalytics.OutputBlobSerializationArgs( + type="Csv", + encoding="UTF8", + field_delimiter=",", + )) + ``` + ## Import Stream Analytics Outputs to Blob Storage can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_cosmosdb.py b/sdk/python/pulumi_azure/streamanalytics/output_cosmosdb.py index 751fc20f48..9264dc81f0 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_cosmosdb.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_cosmosdb.py @@ -341,6 +341,46 @@ def __init__(__self__, """ Manages a Stream Analytics Output to CosmosDB. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.cosmosdb.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="foo") + example_output_cosmosdb = azure.streamanalytics.OutputCosmosdb("exampleOutputCosmosdb", + stream_analytics_job_id=example_job.id, + cosmosdb_account_key=example_account.primary_key, + cosmosdb_sql_database_id=example_sql_database.id, + container_name=example_sql_container.name, + document_id="exampledocumentid") + ``` + ## Import Stream Analytics Outputs for CosmosDB can be imported using the `resource id`, e.g. @@ -368,6 +408,46 @@ def __init__(__self__, """ Manages a Stream Analytics Output to CosmosDB. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.cosmosdb.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + offer_type="Standard", + kind="GlobalDocumentDB", + consistency_policy=azure.cosmosdb.AccountConsistencyPolicyArgs( + consistency_level="BoundedStaleness", + max_interval_in_seconds=10, + max_staleness_prefix=200, + ), + geo_locations=[azure.cosmosdb.AccountGeoLocationArgs( + location=example_resource_group.location, + failover_priority=0, + )]) + example_sql_database = azure.cosmosdb.SqlDatabase("exampleSqlDatabase", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + throughput=400) + example_sql_container = azure.cosmosdb.SqlContainer("exampleSqlContainer", + resource_group_name=example_account.resource_group_name, + account_name=example_account.name, + database_name=example_sql_database.name, + partition_key_path="foo") + example_output_cosmosdb = azure.streamanalytics.OutputCosmosdb("exampleOutputCosmosdb", + stream_analytics_job_id=example_job.id, + cosmosdb_account_key=example_account.primary_key, + cosmosdb_sql_database_id=example_sql_database.id, + container_name=example_sql_container.name, + document_id="exampledocumentid") + ``` + ## Import Stream Analytics Outputs for CosmosDB can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_event_hub.py b/sdk/python/pulumi_azure/streamanalytics/output_event_hub.py index 28742f3b22..ce04bb960c 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_event_hub.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_event_hub.py @@ -504,6 +504,37 @@ def __init__(__self__, """ Manages a Stream Analytics Output to an EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_output_event_hub = azure.streamanalytics.OutputEventHub("exampleOutputEventHub", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + eventhub_name=example_event_hub.name, + servicebus_namespace=example_event_hub_namespace.name, + shared_access_policy_key=example_event_hub_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.OutputEventHubSerializationArgs( + type="Avro", + )) + ``` + ## Import Stream Analytics Outputs to an EventHub can be imported using the `resource id`, e.g. @@ -535,6 +566,37 @@ def __init__(__self__, """ Manages a Stream Analytics Output to an EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_output_event_hub = azure.streamanalytics.OutputEventHub("exampleOutputEventHub", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + eventhub_name=example_event_hub.name, + servicebus_namespace=example_event_hub_namespace.name, + shared_access_policy_key=example_event_hub_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.OutputEventHubSerializationArgs( + type="Avro", + )) + ``` + ## Import Stream Analytics Outputs to an EventHub can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_function.py b/sdk/python/pulumi_azure/streamanalytics/output_function.py index 099d9eab67..f3a934c825 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_function.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_function.py @@ -383,6 +383,51 @@ def __init__(__self__, """ Manages a Stream Analytics Output Function. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="FunctionApp", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + os_type="linux", + version="~3") + example_job = azure.streamanalytics.Job("exampleJob", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + streaming_units=3, + transformation_query=\"\"\" SELECT * + INTO [YourOutputAlias] + FROM [YourInputAlias] + \"\"\") + example_output_function = azure.streamanalytics.OutputFunction("exampleOutputFunction", + resource_group_name=example_job.resource_group_name, + stream_analytics_job_name=example_job.name, + function_app=example_function_app.name, + function_name="examplefunctionname", + api_key="exampleapikey") + ``` + ## Import Stream Analytics Output Functions can be imported using the `resource id`, e.g. @@ -411,6 +456,51 @@ def __init__(__self__, """ Manages a Stream Analytics Output Function. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_plan = azure.appservice.Plan("examplePlan", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + kind="FunctionApp", + reserved=True, + sku=azure.appservice.PlanSkuArgs( + tier="Dynamic", + size="Y1", + )) + example_function_app = azure.appservice.FunctionApp("exampleFunctionApp", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + app_service_plan_id=example_plan.id, + storage_account_name=example_account.name, + storage_account_access_key=example_account.primary_access_key, + os_type="linux", + version="~3") + example_job = azure.streamanalytics.Job("exampleJob", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + streaming_units=3, + transformation_query=\"\"\" SELECT * + INTO [YourOutputAlias] + FROM [YourInputAlias] + \"\"\") + example_output_function = azure.streamanalytics.OutputFunction("exampleOutputFunction", + resource_group_name=example_job.resource_group_name, + stream_analytics_job_name=example_job.name, + function_app=example_function_app.name, + function_name="examplefunctionname", + api_key="exampleapikey") + ``` + ## Import Stream Analytics Output Functions can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_mssql.py b/sdk/python/pulumi_azure/streamanalytics/output_mssql.py index 6e3f56583e..ebe171abce 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_mssql.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_mssql.py @@ -486,6 +486,39 @@ def __init__(__self__, """ Manages a Stream Analytics Output to Microsoft SQL Server Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="dbadmin", + administrator_login_password="example-password") + example_database = azure.sql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_sql_server.name, + requested_service_objective_name="S0", + collation="SQL_LATIN1_GENERAL_CP1_CI_AS", + max_size_bytes="268435456000", + create_mode="Default") + example_output_mssql = azure.streamanalytics.OutputMssql("exampleOutputMssql", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + server=example_sql_server.fully_qualified_domain_name, + user=example_sql_server.administrator_login, + password=example_sql_server.administrator_login_password, + database=example_database.name, + table="ExampleTable") + ``` + ## Import Stream Analytics Outputs to Microsoft SQL Server Database can be imported using the `resource id`, e.g. @@ -517,6 +550,39 @@ def __init__(__self__, """ Manages a Stream Analytics Output to Microsoft SQL Server Database. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_sql_server = azure.sql.SqlServer("exampleSqlServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="dbadmin", + administrator_login_password="example-password") + example_database = azure.sql.Database("exampleDatabase", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + server_name=example_sql_server.name, + requested_service_objective_name="S0", + collation="SQL_LATIN1_GENERAL_CP1_CI_AS", + max_size_bytes="268435456000", + create_mode="Default") + example_output_mssql = azure.streamanalytics.OutputMssql("exampleOutputMssql", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + server=example_sql_server.fully_qualified_domain_name, + user=example_sql_server.administrator_login, + password=example_sql_server.administrator_login_password, + database=example_database.name, + table="ExampleTable") + ``` + ## Import Stream Analytics Outputs to Microsoft SQL Server Database can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_powerbi.py b/sdk/python/pulumi_azure/streamanalytics/output_powerbi.py index 2c78fbe9d8..d6b32255a4 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_powerbi.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_powerbi.py @@ -375,6 +375,23 @@ def __init__(__self__, """ Manages a Stream Analytics Output powerBI. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.get_resource_group(name="example-resources") + example_job = azure.streamanalytics.get_job(name="example-job", + resource_group_name=example_resource_group.name) + example_output_powerbi = azure.streamanalytics.OutputPowerbi("exampleOutputPowerbi", + stream_analytics_job_id=example_job.id, + dataset="example-dataset", + table="example-table", + group_id="00000000-0000-0000-0000-000000000000", + group_name="some-group-name") + ``` + ## Import Stream Analytics Output to Power BI can be imported using the `resource id`, e.g. @@ -403,6 +420,23 @@ def __init__(__self__, """ Manages a Stream Analytics Output powerBI. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.get_resource_group(name="example-resources") + example_job = azure.streamanalytics.get_job(name="example-job", + resource_group_name=example_resource_group.name) + example_output_powerbi = azure.streamanalytics.OutputPowerbi("exampleOutputPowerbi", + stream_analytics_job_id=example_job.id, + dataset="example-dataset", + table="example-table", + group_id="00000000-0000-0000-0000-000000000000", + group_name="some-group-name") + ``` + ## Import Stream Analytics Output to Power BI can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_service_bus_queue.py b/sdk/python/pulumi_azure/streamanalytics/output_service_bus_queue.py index b1d3b56bd0..fc4a9b97b0 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_service_bus_queue.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_service_bus_queue.py @@ -512,6 +512,35 @@ def __init__(__self__, """ Manages a Stream Analytics Output to a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_output_service_bus_queue = azure.streamanalytics.OutputServiceBusQueue("exampleOutputServiceBusQueue", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + queue_name=example_queue.name, + servicebus_namespace=example_namespace.name, + shared_access_policy_key=example_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.OutputServiceBusQueueSerializationArgs( + type="Csv", + format="Array", + )) + ``` + ## Import Stream Analytics Output ServiceBus Queue's can be imported using the `resource id`, e.g. @@ -545,6 +574,35 @@ def __init__(__self__, """ Manages a Stream Analytics Output to a ServiceBus Queue. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_queue = azure.servicebus.Queue("exampleQueue", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_output_service_bus_queue = azure.streamanalytics.OutputServiceBusQueue("exampleOutputServiceBusQueue", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + queue_name=example_queue.name, + servicebus_namespace=example_namespace.name, + shared_access_policy_key=example_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.OutputServiceBusQueueSerializationArgs( + type="Csv", + format="Array", + )) + ``` + ## Import Stream Analytics Output ServiceBus Queue's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_servicebus_topic.py b/sdk/python/pulumi_azure/streamanalytics/output_servicebus_topic.py index fb122f7fa3..564f16a489 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_servicebus_topic.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_servicebus_topic.py @@ -512,6 +512,39 @@ def __init__(__self__, """ Manages a Stream Analytics Output to a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_output_servicebus_topic = azure.streamanalytics.OutputServicebusTopic("exampleOutputServicebusTopic", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + topic_name=example_topic.name, + servicebus_namespace=example_namespace.name, + shared_access_policy_key=example_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + property_columns=[ + "col1", + "col2", + ], + serialization=azure.streamanalytics.OutputServicebusTopicSerializationArgs( + type="Csv", + format="Array", + )) + ``` + ## Import Stream Analytics Output ServiceBus Topic's can be imported using the `resource id`, e.g. @@ -545,6 +578,39 @@ def __init__(__self__, """ Manages a Stream Analytics Output to a ServiceBus Topic. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_namespace = azure.servicebus.Namespace("exampleNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard") + example_topic = azure.servicebus.Topic("exampleTopic", + namespace_id=example_namespace.id, + enable_partitioning=True) + example_output_servicebus_topic = azure.streamanalytics.OutputServicebusTopic("exampleOutputServicebusTopic", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + topic_name=example_topic.name, + servicebus_namespace=example_namespace.name, + shared_access_policy_key=example_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + property_columns=[ + "col1", + "col2", + ], + serialization=azure.streamanalytics.OutputServicebusTopicSerializationArgs( + type="Csv", + format="Array", + )) + ``` + ## Import Stream Analytics Output ServiceBus Topic's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_synapse.py b/sdk/python/pulumi_azure/streamanalytics/output_synapse.py index 5fad60dcac..229aa73c78 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_synapse.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_synapse.py @@ -365,6 +365,42 @@ def __init__(__self__, """ Manages a Stream Analytics Output to an Azure Synapse Analytics Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_output_synapse = azure.streamanalytics.OutputSynapse("exampleOutputSynapse", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + server=example_workspace.connectivity_endpoints["sqlOnDemand"], + user=example_workspace.sql_administrator_login, + password=example_workspace.sql_administrator_login_password, + database="master", + table="ExampleTable") + ``` + ## Import A Stream Analytics Output to an Azure Synapse Analytics Workspace can be imported using the `resource id`, e.g. @@ -393,6 +429,42 @@ def __init__(__self__, """ Manages a Stream Analytics Output to an Azure Synapse Analytics Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_output_synapse = azure.streamanalytics.OutputSynapse("exampleOutputSynapse", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + server=example_workspace.connectivity_endpoints["sqlOnDemand"], + user=example_workspace.sql_administrator_login, + password=example_workspace.sql_administrator_login_password, + database="master", + table="ExampleTable") + ``` + ## Import A Stream Analytics Output to an Azure Synapse Analytics Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/output_table.py b/sdk/python/pulumi_azure/streamanalytics/output_table.py index b0c234e2f2..3543efea34 100644 --- a/sdk/python/pulumi_azure/streamanalytics/output_table.py +++ b/sdk/python/pulumi_azure/streamanalytics/output_table.py @@ -464,6 +464,32 @@ def __init__(__self__, """ Manages a Stream Analytics Output Table. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_table = azure.storage.Table("exampleTable", storage_account_name=example_account.name) + example_output_table = azure.streamanalytics.OutputTable("exampleOutputTable", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + table=example_table.name, + partition_key="foo", + row_key="bar", + batch_size=100) + ``` + ## Import Stream Analytics Output to Table can be imported using the `resource id`, e.g. @@ -494,6 +520,32 @@ def __init__(__self__, """ Manages a Stream Analytics Output Table. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_table = azure.storage.Table("exampleTable", storage_account_name=example_account.name) + example_output_table = azure.streamanalytics.OutputTable("exampleOutputTable", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + table=example_table.name, + partition_key="foo", + row_key="bar", + batch_size=100) + ``` + ## Import Stream Analytics Output to Table can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/reference_input_blob.py b/sdk/python/pulumi_azure/streamanalytics/reference_input_blob.py index 8c002369b6..e9ba07bfef 100644 --- a/sdk/python/pulumi_azure/streamanalytics/reference_input_blob.py +++ b/sdk/python/pulumi_azure/streamanalytics/reference_input_blob.py @@ -507,6 +507,38 @@ def __init__(__self__, """ Manages a Stream Analytics Reference Input Blob. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-blob-storage). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + test = azure.streamanalytics.ReferenceInputBlob("test", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="some-random-pattern", + date_format="yyyy/MM/dd", + time_format="HH", + serialization=azure.streamanalytics.ReferenceInputBlobSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Reference Input Blob's can be imported using the `resource id`, e.g. @@ -538,6 +570,38 @@ def __init__(__self__, """ Manages a Stream Analytics Reference Input Blob. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-blob-storage). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + test = azure.streamanalytics.ReferenceInputBlob("test", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="some-random-pattern", + date_format="yyyy/MM/dd", + time_format="HH", + serialization=azure.streamanalytics.ReferenceInputBlobSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Reference Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/reference_input_mssql.py b/sdk/python/pulumi_azure/streamanalytics/reference_input_mssql.py index a4d204a89e..9e40fa16af 100644 --- a/sdk/python/pulumi_azure/streamanalytics/reference_input_mssql.py +++ b/sdk/python/pulumi_azure/streamanalytics/reference_input_mssql.py @@ -530,6 +530,37 @@ def __init__(__self__, """ Manages a Stream Analytics Reference Input from MS SQL. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-sql-database). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="admin", + administrator_login_password="password") + example_database = azure.mssql.Database("exampleDatabase", server_id=example_server.id) + example_reference_input_mssql = azure.streamanalytics.ReferenceInputMssql("exampleReferenceInputMssql", + resource_group_name=example_job.resource_group_name, + stream_analytics_job_name=example_job.name, + server=example_server.fully_qualified_domain_name, + database=example_database.name, + username="exampleuser", + password="examplepassword", + refresh_type="RefreshPeriodicallyWithFull", + refresh_interval_duration="00:20:00", + full_snapshot_query=\"\"\" SELECT * + INTO [YourOutputAlias] + FROM [YourInputAlias] + \"\"\") + ``` + ## Import Stream Analytics can be imported using the `resource id`, e.g. @@ -562,6 +593,37 @@ def __init__(__self__, """ Manages a Stream Analytics Reference Input from MS SQL. Reference data (also known as a lookup table) is a finite data set that is static or slowly changing in nature, used to perform a lookup or to correlate with your data stream. Learn more [here](https://docs.microsoft.com/azure/stream-analytics/stream-analytics-use-reference-data#azure-sql-database). + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_server = azure.mssql.Server("exampleServer", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + version="12.0", + administrator_login="admin", + administrator_login_password="password") + example_database = azure.mssql.Database("exampleDatabase", server_id=example_server.id) + example_reference_input_mssql = azure.streamanalytics.ReferenceInputMssql("exampleReferenceInputMssql", + resource_group_name=example_job.resource_group_name, + stream_analytics_job_name=example_job.name, + server=example_server.fully_qualified_domain_name, + database=example_database.name, + username="exampleuser", + password="examplepassword", + refresh_type="RefreshPeriodicallyWithFull", + refresh_interval_duration="00:20:00", + full_snapshot_query=\"\"\" SELECT * + INTO [YourOutputAlias] + FROM [YourInputAlias] + \"\"\") + ``` + ## Import Stream Analytics can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/stream_input_blob.py b/sdk/python/pulumi_azure/streamanalytics/stream_input_blob.py index 464aa3103c..2847a89ffd 100644 --- a/sdk/python/pulumi_azure/streamanalytics/stream_input_blob.py +++ b/sdk/python/pulumi_azure/streamanalytics/stream_input_blob.py @@ -467,6 +467,38 @@ def __init__(__self__, """ Manages a Stream Analytics Stream Input Blob. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_stream_input_blob = azure.streamanalytics.StreamInputBlob("exampleStreamInputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="some-random-pattern", + date_format="yyyy/MM/dd", + time_format="HH", + serialization=azure.streamanalytics.StreamInputBlobSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input Blob's can be imported using the `resource id`, e.g. @@ -497,6 +529,38 @@ def __init__(__self__, """ Manages a Stream Analytics Stream Input Blob. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_stream_input_blob = azure.streamanalytics.StreamInputBlob("exampleStreamInputBlob", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + storage_account_name=example_account.name, + storage_account_key=example_account.primary_access_key, + storage_container_name=example_container.name, + path_pattern="some-random-pattern", + date_format="yyyy/MM/dd", + time_format="HH", + serialization=azure.streamanalytics.StreamInputBlobSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input Blob's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub.py b/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub.py index 40080833e1..e66eabe9eb 100644 --- a/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub.py +++ b/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub.py @@ -506,6 +506,43 @@ def __init__(__self__, Manages a Stream Analytics Stream Input EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_stream_input_event_hub = azure.streamanalytics.StreamInputEventHub("exampleStreamInputEventHub", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + eventhub_consumer_group_name=example_consumer_group.name, + eventhub_name=example_event_hub.name, + servicebus_namespace=example_event_hub_namespace.name, + shared_access_policy_key=example_event_hub_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.StreamInputEventHubSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. @@ -539,6 +576,43 @@ def __init__(__self__, Manages a Stream Analytics Stream Input EventHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_stream_input_event_hub = azure.streamanalytics.StreamInputEventHub("exampleStreamInputEventHub", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + eventhub_consumer_group_name=example_consumer_group.name, + eventhub_name=example_event_hub.name, + servicebus_namespace=example_event_hub_namespace.name, + shared_access_policy_key=example_event_hub_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.StreamInputEventHubSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub_v2.py b/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub_v2.py index bbd1cc5d9a..eb927c8348 100644 --- a/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub_v2.py +++ b/sdk/python/pulumi_azure/streamanalytics/stream_input_event_hub_v2.py @@ -464,6 +464,42 @@ def __init__(__self__, Manages a Stream Analytics Stream Input EventHub V2. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_stream_input_event_hub_v2 = azure.streamanalytics.StreamInputEventHubV2("exampleStreamInputEventHubV2", + stream_analytics_job_id=example_job.id, + eventhub_consumer_group_name=example_consumer_group.name, + eventhub_name=example_event_hub.name, + servicebus_namespace=example_event_hub_namespace.name, + shared_access_policy_key=example_event_hub_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.StreamInputEventHubV2SerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. @@ -496,6 +532,42 @@ def __init__(__self__, Manages a Stream Analytics Stream Input EventHub V2. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_event_hub_namespace = azure.eventhub.EventHubNamespace("exampleEventHubNamespace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard", + capacity=1) + example_event_hub = azure.eventhub.EventHub("exampleEventHub", + namespace_name=example_event_hub_namespace.name, + resource_group_name=example_resource_group.name, + partition_count=2, + message_retention=1) + example_consumer_group = azure.eventhub.ConsumerGroup("exampleConsumerGroup", + namespace_name=example_event_hub_namespace.name, + eventhub_name=example_event_hub.name, + resource_group_name=example_resource_group.name) + example_stream_input_event_hub_v2 = azure.streamanalytics.StreamInputEventHubV2("exampleStreamInputEventHubV2", + stream_analytics_job_id=example_job.id, + eventhub_consumer_group_name=example_consumer_group.name, + eventhub_name=example_event_hub.name, + servicebus_namespace=example_event_hub_namespace.name, + shared_access_policy_key=example_event_hub_namespace.default_primary_key, + shared_access_policy_name="RootManageSharedAccessKey", + serialization=azure.streamanalytics.StreamInputEventHubV2SerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input EventHub's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/streamanalytics/stream_input_iot_hub.py b/sdk/python/pulumi_azure/streamanalytics/stream_input_iot_hub.py index 73ef1ced2b..7c1f59a277 100644 --- a/sdk/python/pulumi_azure/streamanalytics/stream_input_iot_hub.py +++ b/sdk/python/pulumi_azure/streamanalytics/stream_input_iot_hub.py @@ -421,6 +421,36 @@ def __init__(__self__, """ Manages a Stream Analytics Stream Input IoTHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_stream_input_iot_hub = azure.streamanalytics.StreamInputIotHub("exampleStreamInputIotHub", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + endpoint="messages/events", + eventhub_consumer_group_name="$Default", + iothub_namespace=example_io_t_hub.name, + shared_access_policy_key=example_io_t_hub.shared_access_policies[0].primary_key, + shared_access_policy_name="iothubowner", + serialization=azure.streamanalytics.StreamInputIotHubSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input IoTHub's can be imported using the `resource id`, e.g. @@ -450,6 +480,36 @@ def __init__(__self__, """ Manages a Stream Analytics Stream Input IoTHub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_job = azure.streamanalytics.get_job_output(name="example-job", + resource_group_name=example_resource_group.name) + example_io_t_hub = azure.iot.IoTHub("exampleIoTHub", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + sku=azure.iot.IoTHubSkuArgs( + name="S1", + capacity=1, + )) + example_stream_input_iot_hub = azure.streamanalytics.StreamInputIotHub("exampleStreamInputIotHub", + stream_analytics_job_name=example_job.name, + resource_group_name=example_job.resource_group_name, + endpoint="messages/events", + eventhub_consumer_group_name="$Default", + iothub_namespace=example_io_t_hub.name, + shared_access_policy_key=example_io_t_hub.shared_access_policies[0].primary_key, + shared_access_policy_name="iothubowner", + serialization=azure.streamanalytics.StreamInputIotHubSerializationArgs( + type="Json", + encoding="UTF8", + )) + ``` + ## Import Stream Analytics Stream Input IoTHub's can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/firewall_rule.py b/sdk/python/pulumi_azure/synapse/firewall_rule.py index 2f6cf5a13b..eeda1feb0c 100644 --- a/sdk/python/pulumi_azure/synapse/firewall_rule.py +++ b/sdk/python/pulumi_azure/synapse/firewall_rule.py @@ -233,6 +233,36 @@ def __init__(__self__, """ Allows you to Manages a Synapse Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + ``` + ## Import Synapse Firewall Rule can be imported using the `resource id`, e.g. @@ -261,6 +291,36 @@ def __init__(__self__, """ Allows you to Manages a Synapse Firewall Rule. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + ``` + ## Import Synapse Firewall Rule can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/get_workspace.py b/sdk/python/pulumi_azure/synapse/get_workspace.py index 1ced3659ac..0cd81f87eb 100644 --- a/sdk/python/pulumi_azure/synapse/get_workspace.py +++ b/sdk/python/pulumi_azure/synapse/get_workspace.py @@ -117,6 +117,17 @@ def get_workspace(name: Optional[str] = None, """ Use this data source to access information about an existing Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.synapse.get_workspace(name="existing", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Synapse Workspace. :param str resource_group_name: The name of the Resource Group where the Synapse Workspace exists. @@ -144,6 +155,17 @@ def get_workspace_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.synapse.get_workspace(name="existing", + resource_group_name="example-resource-group") + pulumi.export("id", example.id) + ``` + :param str name: The name of this Synapse Workspace. :param str resource_group_name: The name of the Resource Group where the Synapse Workspace exists. diff --git a/sdk/python/pulumi_azure/synapse/integration_runtime_azure.py b/sdk/python/pulumi_azure/synapse/integration_runtime_azure.py index d9c1bf20a6..0f33c70c8e 100644 --- a/sdk/python/pulumi_azure/synapse/integration_runtime_azure.py +++ b/sdk/python/pulumi_azure/synapse/integration_runtime_azure.py @@ -330,6 +330,41 @@ def __init__(__self__, """ Manages a Synapse Azure Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_integration_runtime_azure = azure.synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", + synapse_workspace_id=example_workspace.id, + location=example_resource_group.location) + ``` + ## Import Synapse Azure Integration Runtimes can be imported using the `resource id`, e.g. @@ -357,6 +392,41 @@ def __init__(__self__, """ Manages a Synapse Azure Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_integration_runtime_azure = azure.synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", + synapse_workspace_id=example_workspace.id, + location=example_resource_group.location) + ``` + ## Import Synapse Azure Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/integration_runtime_self_hosted.py b/sdk/python/pulumi_azure/synapse/integration_runtime_self_hosted.py index b5f77bcec5..733477e3f5 100644 --- a/sdk/python/pulumi_azure/synapse/integration_runtime_self_hosted.py +++ b/sdk/python/pulumi_azure/synapse/integration_runtime_self_hosted.py @@ -210,6 +210,39 @@ def __init__(__self__, """ Manages a Synapse Self-hosted Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_integration_runtime_self_hosted = azure.synapse.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", synapse_workspace_id=example_workspace.id) + ``` + ## Import Synapse Self-hosted Integration Runtimes can be imported using the `resource id`, e.g. @@ -233,6 +266,39 @@ def __init__(__self__, """ Manages a Synapse Self-hosted Integration Runtime. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + account_tier="Standard", + account_replication_type="LRS") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_integration_runtime_self_hosted = azure.synapse.IntegrationRuntimeSelfHosted("exampleIntegrationRuntimeSelfHosted", synapse_workspace_id=example_workspace.id) + ``` + ## Import Synapse Self-hosted Integration Runtimes can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/linked_service.py b/sdk/python/pulumi_azure/synapse/linked_service.py index a4383441ad..81b0e8689b 100644 --- a/sdk/python/pulumi_azure/synapse/linked_service.py +++ b/sdk/python/pulumi_azure/synapse/linked_service.py @@ -440,6 +440,50 @@ def __init__(__self__, """ Manages a Synapse Linked Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_integration_runtime_azure = azure.synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", + synapse_workspace_id=example_workspace.id, + location=example_resource_group.location) + example_linked_service = azure.synapse.LinkedService("exampleLinkedService", + synapse_workspace_id=example_workspace.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString": "{primary_connection_string}" + }} + \"\"\"), + integration_runtime=azure.synapse.LinkedServiceIntegrationRuntimeArgs( + name=example_integration_runtime_azure.name, + ), + opts=pulumi.ResourceOptions(depends_on=[example_firewall_rule])) + ``` + ## Import Synapse Linked Services can be imported using the `resource id`, e.g. @@ -477,6 +521,50 @@ def __init__(__self__, """ Manages a Synapse Linked Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_integration_runtime_azure = azure.synapse.IntegrationRuntimeAzure("exampleIntegrationRuntimeAzure", + synapse_workspace_id=example_workspace.id, + location=example_resource_group.location) + example_linked_service = azure.synapse.LinkedService("exampleLinkedService", + synapse_workspace_id=example_workspace.id, + type="AzureBlobStorage", + type_properties_json=example_account.primary_connection_string.apply(lambda primary_connection_string: f\"\"\"{{ + "connectionString": "{primary_connection_string}" + }} + \"\"\"), + integration_runtime=azure.synapse.LinkedServiceIntegrationRuntimeArgs( + name=example_integration_runtime_azure.name, + ), + opts=pulumi.ResourceOptions(depends_on=[example_firewall_rule])) + ``` + ## Import Synapse Linked Services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/managed_private_endpoint.py b/sdk/python/pulumi_azure/synapse/managed_private_endpoint.py index e308dc0e65..37c3582ad7 100644 --- a/sdk/python/pulumi_azure/synapse/managed_private_endpoint.py +++ b/sdk/python/pulumi_azure/synapse/managed_private_endpoint.py @@ -233,6 +233,48 @@ def __init__(__self__, """ Manages a Synapse Managed Private Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_connect = azure.storage.Account("exampleConnect", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_managed_private_endpoint = azure.synapse.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", + synapse_workspace_id=example_workspace.id, + target_resource_id=example_connect.id, + subresource_name="blob", + opts=pulumi.ResourceOptions(depends_on=[example_firewall_rule])) + ``` + ## Import Synapse Managed Private Endpoint can be imported using the `resource id`, e.g. @@ -261,6 +303,48 @@ def __init__(__self__, """ Manages a Synapse Managed Private Endpoint. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + managed_virtual_network_enabled=True, + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + example_connect = azure.storage.Account("exampleConnect", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_managed_private_endpoint = azure.synapse.ManagedPrivateEndpoint("exampleManagedPrivateEndpoint", + synapse_workspace_id=example_workspace.id, + target_resource_id=example_connect.id, + subresource_name="blob", + opts=pulumi.ResourceOptions(depends_on=[example_firewall_rule])) + ``` + ## Import Synapse Managed Private Endpoint can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/private_link_hub.py b/sdk/python/pulumi_azure/synapse/private_link_hub.py index 9c905ebc8a..e15ed8fc38 100644 --- a/sdk/python/pulumi_azure/synapse/private_link_hub.py +++ b/sdk/python/pulumi_azure/synapse/private_link_hub.py @@ -207,6 +207,17 @@ def __init__(__self__, """ Manages a Synapse Private Link Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.synapse.PrivateLinkHub("example", + location="West Europe", + resource_group_name="example-rg") + ``` + ## Import Synapse Private Link Hub can be imported using the `resource id`, e.g. @@ -231,6 +242,17 @@ def __init__(__self__, """ Manages a Synapse Private Link Hub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.synapse.PrivateLinkHub("example", + location="West Europe", + resource_group_name="example-rg") + ``` + ## Import Synapse Private Link Hub can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/role_assignment.py b/sdk/python/pulumi_azure/synapse/role_assignment.py index 06541a53b1..e72375bd63 100644 --- a/sdk/python/pulumi_azure/synapse/role_assignment.py +++ b/sdk/python/pulumi_azure/synapse/role_assignment.py @@ -244,6 +244,42 @@ def __init__(__self__, """ Manages a Synapse Role Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + current = azure.core.get_client_config() + example_role_assignment = azure.synapse.RoleAssignment("exampleRoleAssignment", + synapse_workspace_id=example_workspace.id, + role_name="Synapse SQL Administrator", + principal_id=current.object_id, + opts=pulumi.ResourceOptions(depends_on=[example_firewall_rule])) + ``` + ## Import Synapse Role Assignment can be imported using the `resource id`, e.g. @@ -274,6 +310,42 @@ def __init__(__self__, """ Manages a Synapse Role Assignment. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_firewall_rule = azure.synapse.FirewallRule("exampleFirewallRule", + synapse_workspace_id=example_workspace.id, + start_ip_address="0.0.0.0", + end_ip_address="255.255.255.255") + current = azure.core.get_client_config() + example_role_assignment = azure.synapse.RoleAssignment("exampleRoleAssignment", + synapse_workspace_id=example_workspace.id, + role_name="Synapse SQL Administrator", + principal_id=current.object_id, + opts=pulumi.ResourceOptions(depends_on=[example_firewall_rule])) + ``` + ## Import Synapse Role Assignment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/sql_pool.py b/sdk/python/pulumi_azure/synapse/sql_pool.py index 7698948d4b..d9921e5152 100644 --- a/sdk/python/pulumi_azure/synapse/sql_pool.py +++ b/sdk/python/pulumi_azure/synapse/sql_pool.py @@ -493,6 +493,36 @@ def __init__(__self__, """ Manages a Synapse SQL Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default", + storage_account_type="GRS") + ``` + ## Import Synapse SQL Pool can be imported using the `resource id`, e.g. @@ -524,6 +554,36 @@ def __init__(__self__, """ Manages a Synapse SQL Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default", + storage_account_type="GRS") + ``` + ## Import Synapse SQL Pool can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/sql_pool_extended_auditing_policy.py b/sdk/python/pulumi_azure/synapse/sql_pool_extended_auditing_policy.py index dc68396900..33ba3a5457 100644 --- a/sdk/python/pulumi_azure/synapse/sql_pool_extended_auditing_policy.py +++ b/sdk/python/pulumi_azure/synapse/sql_pool_extended_auditing_policy.py @@ -301,6 +301,46 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_pool_extended_auditing_policy = azure.synapse.SqlPoolExtendedAuditingPolicy("exampleSqlPoolExtendedAuditingPolicy", + sql_pool_id=example_sql_pool.id, + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ## Import Synapse SQL Pool Extended Auditing Policys can be imported using the `resource id`, e.g. @@ -327,6 +367,46 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_pool_extended_auditing_policy = azure.synapse.SqlPoolExtendedAuditingPolicy("exampleSqlPoolExtendedAuditingPolicy", + sql_pool_id=example_sql_pool.id, + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ## Import Synapse SQL Pool Extended Auditing Policys can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/sql_pool_security_alert_policy.py b/sdk/python/pulumi_azure/synapse/sql_pool_security_alert_policy.py index 8ee2eebcdb..b36e6c7f4e 100644 --- a/sdk/python/pulumi_azure/synapse/sql_pool_security_alert_policy.py +++ b/sdk/python/pulumi_azure/synapse/sql_pool_security_alert_policy.py @@ -384,6 +384,59 @@ def __init__(__self__, """ Manages a Security Alert Policy for a Synapse SQL Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_pool_security_alert_policy = azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", + sql_pool_id=example_sql_pool.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import Synapse SQL Pool Security Alert Policies can be imported using the `resource id`, e.g. @@ -412,6 +465,59 @@ def __init__(__self__, """ Manages a Security Alert Policy for a Synapse SQL Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_pool_security_alert_policy = azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", + sql_pool_id=example_sql_pool.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import Synapse SQL Pool Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment.py b/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment.py index 991493255b..4a1960ecec 100644 --- a/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment.py +++ b/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment.py @@ -263,6 +263,72 @@ def __init__(__self__, """ Manages the Vulnerability Assessment for a Synapse SQL Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_pool_security_alert_policy = azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", + sql_pool_id=example_sql_pool.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + example_sql_pool_vulnerability_assessment = azure.synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", + sql_pool_security_alert_policy_id=example_sql_pool_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.synapse.SqlPoolVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins_enabled=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + )) + ``` + ## Import Synapse SQL Pool Vulnerability Assessment can be imported using the `resource id`, e.g. @@ -288,6 +354,72 @@ def __init__(__self__, """ Manages the Vulnerability Assessment for a Synapse SQL Pool. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_sql_pool_security_alert_policy = azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", + sql_pool_id=example_sql_pool.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + example_sql_pool_vulnerability_assessment = azure.synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", + sql_pool_security_alert_policy_id=example_sql_pool_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.synapse.SqlPoolVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins_enabled=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + )) + ``` + ## Import Synapse SQL Pool Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment_baseline.py b/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment_baseline.py index f729a3bb2b..009d5aed64 100644 --- a/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment_baseline.py +++ b/sdk/python/pulumi_azure/synapse/sql_pool_vulnerability_assessment_baseline.py @@ -214,6 +214,64 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Vulnerability Assessment Rule Baseline. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_sql_pool_security_alert_policy = azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", + sql_pool_id=example_sql_pool.id, + policy_state="Enabled", + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key) + example_sql_pool_vulnerability_assessment = azure.synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", + sql_pool_security_alert_policy_id=example_sql_pool_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key) + example_sql_pool_vulnerability_assessment_baseline = azure.synapse.SqlPoolVulnerabilityAssessmentBaseline("exampleSqlPoolVulnerabilityAssessmentBaseline", + rule_name="VA1017", + sql_pool_vulnerability_assessment_id=example_sql_pool_vulnerability_assessment.id, + baselines=[ + azure.synapse.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs( + results=[ + "userA", + "SELECT", + ], + ), + azure.synapse.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs( + results=[ + "userB", + "SELECT", + ], + ), + ]) + ``` + ## Import Synapse SQL Pool Vulnerability Assessment Rule Baselines can be imported using the `resource id`, e.g. @@ -238,6 +296,64 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Vulnerability Assessment Rule Baseline. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + example_container = azure.storage.Container("exampleContainer", + storage_account_name=example_account.name, + container_access_type="private") + example_sql_pool_security_alert_policy = azure.synapse.SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", + sql_pool_id=example_sql_pool.id, + policy_state="Enabled", + storage_endpoint=example_account.primary_blob_endpoint, + storage_account_access_key=example_account.primary_access_key) + example_sql_pool_vulnerability_assessment = azure.synapse.SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", + sql_pool_security_alert_policy_id=example_sql_pool_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key) + example_sql_pool_vulnerability_assessment_baseline = azure.synapse.SqlPoolVulnerabilityAssessmentBaseline("exampleSqlPoolVulnerabilityAssessmentBaseline", + rule_name="VA1017", + sql_pool_vulnerability_assessment_id=example_sql_pool_vulnerability_assessment.id, + baselines=[ + azure.synapse.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs( + results=[ + "userA", + "SELECT", + ], + ), + azure.synapse.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs( + results=[ + "userB", + "SELECT", + ], + ), + ]) + ``` + ## Import Synapse SQL Pool Vulnerability Assessment Rule Baselines can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/sql_pool_workload_classifier.py b/sdk/python/pulumi_azure/synapse/sql_pool_workload_classifier.py index d852d6f158..f2d97f915d 100644 --- a/sdk/python/pulumi_azure/synapse/sql_pool_workload_classifier.py +++ b/sdk/python/pulumi_azure/synapse/sql_pool_workload_classifier.py @@ -368,6 +368,51 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Workload Classifier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + example_sql_pool_workload_group = azure.synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", + sql_pool_id=example_sql_pool.id, + importance="normal", + max_resource_percent=100, + min_resource_percent=0, + max_resource_percent_per_request=3, + min_resource_percent_per_request=3, + query_execution_timeout_in_seconds=0) + example_sql_pool_workload_classifier = azure.synapse.SqlPoolWorkloadClassifier("exampleSqlPoolWorkloadClassifier", + workload_group_id=example_sql_pool_workload_group.id, + context="example_context", + end_time="14:00", + importance="high", + label="example_label", + member_name="dbo", + start_time="12:00") + ``` + ## Import Synapse SQL Pool Workload Classifiers can be imported using the `resource id`, e.g. @@ -396,6 +441,51 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Workload Classifier. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + example_sql_pool_workload_group = azure.synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", + sql_pool_id=example_sql_pool.id, + importance="normal", + max_resource_percent=100, + min_resource_percent=0, + max_resource_percent_per_request=3, + min_resource_percent_per_request=3, + query_execution_timeout_in_seconds=0) + example_sql_pool_workload_classifier = azure.synapse.SqlPoolWorkloadClassifier("exampleSqlPoolWorkloadClassifier", + workload_group_id=example_sql_pool_workload_group.id, + context="example_context", + end_time="14:00", + importance="high", + label="example_label", + member_name="dbo", + start_time="12:00") + ``` + ## Import Synapse SQL Pool Workload Classifiers can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/sql_pool_workload_group.py b/sdk/python/pulumi_azure/synapse/sql_pool_workload_group.py index 2a442cc638..0bbff62c3e 100644 --- a/sdk/python/pulumi_azure/synapse/sql_pool_workload_group.py +++ b/sdk/python/pulumi_azure/synapse/sql_pool_workload_group.py @@ -377,6 +377,43 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Workload Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + example_sql_pool_workload_group = azure.synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", + sql_pool_id=example_sql_pool.id, + importance="normal", + max_resource_percent=100, + min_resource_percent=0, + max_resource_percent_per_request=3, + min_resource_percent_per_request=3, + query_execution_timeout_in_seconds=0) + ``` + ## Import Synapse SQL Pool Workload Groups can be imported using the `resource id`, e.g. @@ -405,6 +442,43 @@ def __init__(__self__, """ Manages a Synapse SQL Pool Workload Group. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="west europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_kind="BlobStorage", + account_tier="Standard", + account_replication_type="LRS") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + example_sql_pool = azure.synapse.SqlPool("exampleSqlPool", + synapse_workspace_id=example_workspace.id, + sku_name="DW100c", + create_mode="Default") + example_sql_pool_workload_group = azure.synapse.SqlPoolWorkloadGroup("exampleSqlPoolWorkloadGroup", + sql_pool_id=example_sql_pool.id, + importance="normal", + max_resource_percent=100, + min_resource_percent=0, + max_resource_percent_per_request=3, + min_resource_percent_per_request=3, + query_execution_timeout_in_seconds=0) + ``` + ## Import Synapse SQL Pool Workload Groups can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/workspace.py b/sdk/python/pulumi_azure/synapse/workspace.py index d901a8e8ad..4c5cb0de1d 100644 --- a/sdk/python/pulumi_azure/synapse/workspace.py +++ b/sdk/python/pulumi_azure/synapse/workspace.py @@ -923,6 +923,120 @@ def __init__(__self__, """ Manages a Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + ``` + ### Creating A Workspace With Customer Managed Key And Azure AD Admin + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + customer_managed_key=azure.synapse.WorkspaceCustomerManagedKeyArgs( + key_versionless_id=example_key.versionless_id, + key_name="enckey", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + workspace_policy = azure.keyvault.AccessPolicy("workspacePolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_workspace.identity.tenant_id, + object_id=example_workspace.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ]) + example_workspace_key = azure.synapse.WorkspaceKey("exampleWorkspaceKey", + customer_managed_key_versionless_id=example_key.versionless_id, + synapse_workspace_id=example_workspace.id, + active=True, + customer_managed_key_name="enckey", + opts=pulumi.ResourceOptions(depends_on=[workspace_policy])) + example_workspace_aad_admin = azure.synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", + synapse_workspace_id=example_workspace.id, + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + opts=pulumi.ResourceOptions(depends_on=[example_workspace_key])) + ``` + ## Import Synapse Workspace can be imported using the `resource id`, e.g. @@ -964,6 +1078,120 @@ def __init__(__self__, """ Manages a Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + ``` + ### Creating A Workspace With Customer Managed Key And Azure AD Admin + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + customer_managed_key=azure.synapse.WorkspaceCustomerManagedKeyArgs( + key_versionless_id=example_key.versionless_id, + key_name="enckey", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + workspace_policy = azure.keyvault.AccessPolicy("workspacePolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_workspace.identity.tenant_id, + object_id=example_workspace.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ]) + example_workspace_key = azure.synapse.WorkspaceKey("exampleWorkspaceKey", + customer_managed_key_versionless_id=example_key.versionless_id, + synapse_workspace_id=example_workspace.id, + active=True, + customer_managed_key_name="enckey", + opts=pulumi.ResourceOptions(depends_on=[workspace_policy])) + example_workspace_aad_admin = azure.synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", + synapse_workspace_id=example_workspace.id, + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + opts=pulumi.ResourceOptions(depends_on=[example_workspace_key])) + ``` + ## Import Synapse Workspace can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/workspace_aad_admin.py b/sdk/python/pulumi_azure/synapse/workspace_aad_admin.py index 4eaaad4249..5f563899e5 100644 --- a/sdk/python/pulumi_azure/synapse/workspace_aad_admin.py +++ b/sdk/python/pulumi_azure/synapse/workspace_aad_admin.py @@ -218,6 +218,67 @@ def __init__(__self__, """ Manages an Azure Active Directory Administrator setting for a Synapse Workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_workspace_aad_admin = azure.synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", + synapse_workspace_id=example_workspace.id, + login="AzureAD Admin", + object_id=current.object_id, + tenant_id=current.tenant_id) + ``` + ## Import Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. @@ -242,6 +303,67 @@ def __init__(__self__, """ Manages an Azure Active Directory Administrator setting for a Synapse Workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_workspace_aad_admin = azure.synapse.WorkspaceAadAdmin("exampleWorkspaceAadAdmin", + synapse_workspace_id=example_workspace.id, + login="AzureAD Admin", + object_id=current.object_id, + tenant_id=current.tenant_id) + ``` + ## Import Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/workspace_extended_auditing_policy.py b/sdk/python/pulumi_azure/synapse/workspace_extended_auditing_policy.py index e41bcbe14f..90e82b0cf0 100644 --- a/sdk/python/pulumi_azure/synapse/workspace_extended_auditing_policy.py +++ b/sdk/python/pulumi_azure/synapse/workspace_extended_auditing_policy.py @@ -301,6 +301,42 @@ def __init__(__self__, """ Manages a Synapse Workspace Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_workspace_extended_auditing_policy = azure.synapse.WorkspaceExtendedAuditingPolicy("exampleWorkspaceExtendedAuditingPolicy", + synapse_workspace_id=example_workspace.id, + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ## Import Synapse Workspace Extended Auditing Policies can be imported using the `resource id`, e.g. @@ -327,6 +363,42 @@ def __init__(__self__, """ Manages a Synapse Workspace Extended Auditing Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="BlobStorage") + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + )) + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_workspace_extended_auditing_policy = azure.synapse.WorkspaceExtendedAuditingPolicy("exampleWorkspaceExtendedAuditingPolicy", + synapse_workspace_id=example_workspace.id, + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + storage_account_access_key_is_secondary=False, + retention_in_days=6) + ``` + ## Import Synapse Workspace Extended Auditing Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/workspace_key.py b/sdk/python/pulumi_azure/synapse/workspace_key.py index 65dfa987fe..998fedc73e 100644 --- a/sdk/python/pulumi_azure/synapse/workspace_key.py +++ b/sdk/python/pulumi_azure/synapse/workspace_key.py @@ -227,6 +227,81 @@ def __init__(__self__, > **Note:** Keys that are actively protecting a workspace cannot be deleted. When the keys resource is deleted, if the key is inactive it will be deleted, if it is active it will not be deleted. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + customer_managed_key=azure.synapse.WorkspaceCustomerManagedKeyArgs( + key_versionless_id=example_key.versionless_id, + key_name="enckey", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + workspace_policy = azure.keyvault.AccessPolicy("workspacePolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_workspace.identity.tenant_id, + object_id=example_workspace.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ]) + example_workspace_key = azure.synapse.WorkspaceKey("exampleWorkspaceKey", + customer_managed_key_versionless_id=example_key.versionless_id, + synapse_workspace_id=example_workspace.id, + active=True, + customer_managed_key_name="enckey", + opts=pulumi.ResourceOptions(depends_on=[workspace_policy])) + ``` + ## Import Synapse Workspace Keys can be imported using the `resource id`, e.g. @@ -255,6 +330,81 @@ def __init__(__self__, > **Note:** Keys that are actively protecting a workspace cannot be deleted. When the keys resource is deleted, if the key is inactive it will be deleted, if it is active it will not be deleted. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + customer_managed_key=azure.synapse.WorkspaceCustomerManagedKeyArgs( + key_versionless_id=example_key.versionless_id, + key_name="enckey", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + workspace_policy = azure.keyvault.AccessPolicy("workspacePolicy", + key_vault_id=example_key_vault.id, + tenant_id=example_workspace.identity.tenant_id, + object_id=example_workspace.identity.principal_id, + key_permissions=[ + "Get", + "WrapKey", + "UnwrapKey", + ]) + example_workspace_key = azure.synapse.WorkspaceKey("exampleWorkspaceKey", + customer_managed_key_versionless_id=example_key.versionless_id, + synapse_workspace_id=example_workspace.id, + active=True, + customer_managed_key_name="enckey", + opts=pulumi.ResourceOptions(depends_on=[workspace_policy])) + ``` + ## Import Synapse Workspace Keys can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/workspace_security_alert_policy.py b/sdk/python/pulumi_azure/synapse/workspace_security_alert_policy.py index e7e14b108c..d0ac10a31e 100644 --- a/sdk/python/pulumi_azure/synapse/workspace_security_alert_policy.py +++ b/sdk/python/pulumi_azure/synapse/workspace_security_alert_policy.py @@ -384,6 +384,55 @@ def __init__(__self__, """ Manages a Security Alert Policy for a Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_workspace_security_alert_policy = azure.synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", + synapse_workspace_id=example_workspace.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import Synapse Workspace Security Alert Policies can be imported using the `resource id`, e.g. @@ -412,6 +461,55 @@ def __init__(__self__, """ Manages a Security Alert Policy for a Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_workspace_security_alert_policy = azure.synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", + synapse_workspace_id=example_workspace.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + ``` + ## Import Synapse Workspace Security Alert Policies can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/workspace_sql_aad_admin.py b/sdk/python/pulumi_azure/synapse/workspace_sql_aad_admin.py index c28431dc76..a0ff56366c 100644 --- a/sdk/python/pulumi_azure/synapse/workspace_sql_aad_admin.py +++ b/sdk/python/pulumi_azure/synapse/workspace_sql_aad_admin.py @@ -218,6 +218,67 @@ def __init__(__self__, """ Manages an Azure Active Directory SQL Administrator setting for a Synapse Workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_workspace_sql_aad_admin = azure.synapse.WorkspaceSqlAadAdmin("exampleWorkspaceSqlAadAdmin", + synapse_workspace_id=example_workspace.id, + login="AzureAD Admin", + object_id=current.object_id, + tenant_id=current.tenant_id) + ``` + ## Import Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. @@ -242,6 +303,67 @@ def __init__(__self__, """ Manages an Azure Active Directory SQL Administrator setting for a Synapse Workspace + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + current = azure.core.get_client_config() + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + purge_protection_enabled=True) + deployer = azure.keyvault.AccessPolicy("deployer", + key_vault_id=example_key_vault.id, + tenant_id=current.tenant_id, + object_id=current.object_id, + key_permissions=[ + "Create", + "Get", + "Delete", + "Purge", + "GetRotationPolicy", + ]) + example_key = azure.keyvault.Key("exampleKey", + key_vault_id=example_key_vault.id, + key_type="RSA", + key_size=2048, + key_opts=[ + "unwrapKey", + "wrapKey", + ], + opts=pulumi.ResourceOptions(depends_on=[deployer])) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + example_workspace_sql_aad_admin = azure.synapse.WorkspaceSqlAadAdmin("exampleWorkspaceSqlAadAdmin", + synapse_workspace_id=example_workspace.id, + login="AzureAD Admin", + object_id=current.object_id, + tenant_id=current.tenant_id) + ``` + ## Import Synapse Workspace Azure AD Administrator can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/synapse/workspace_vulnerability_assessment.py b/sdk/python/pulumi_azure/synapse/workspace_vulnerability_assessment.py index c2033ee071..c0ae33690a 100644 --- a/sdk/python/pulumi_azure/synapse/workspace_vulnerability_assessment.py +++ b/sdk/python/pulumi_azure/synapse/workspace_vulnerability_assessment.py @@ -263,6 +263,68 @@ def __init__(__self__, """ Manages the Vulnerability Assessment for a Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_workspace_security_alert_policy = azure.synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", + synapse_workspace_id=example_workspace.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + example_workspace_vulnerability_assessment = azure.synapse.WorkspaceVulnerabilityAssessment("exampleWorkspaceVulnerabilityAssessment", + workspace_security_alert_policy_id=example_workspace_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.synapse.WorkspaceVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins_enabled=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + )) + ``` + ## Import Synapse Workspace Vulnerability Assessment can be imported using the `resource id`, e.g. @@ -288,6 +350,68 @@ def __init__(__self__, """ Manages the Vulnerability Assessment for a Synapse Workspace. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS", + account_kind="StorageV2", + is_hns_enabled=True) + example_container = azure.storage.Container("exampleContainer", storage_account_name=example_account.name) + example_data_lake_gen2_filesystem = azure.storage.DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", storage_account_id=example_account.id) + example_workspace = azure.synapse.Workspace("exampleWorkspace", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + storage_data_lake_gen2_filesystem_id=example_data_lake_gen2_filesystem.id, + sql_administrator_login="sqladminuser", + sql_administrator_login_password="H@Sh1CoR3!", + aad_admin=azure.synapse.WorkspaceAadAdminArgs( + login="AzureAD Admin", + object_id="00000000-0000-0000-0000-000000000000", + tenant_id="00000000-0000-0000-0000-000000000000", + ), + identity=azure.synapse.WorkspaceIdentityArgs( + type="SystemAssigned", + ), + tags={ + "Env": "production", + }) + audit_logs = azure.storage.Account("auditLogs", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="LRS") + example_workspace_security_alert_policy = azure.synapse.WorkspaceSecurityAlertPolicy("exampleWorkspaceSecurityAlertPolicy", + synapse_workspace_id=example_workspace.id, + policy_state="Enabled", + storage_endpoint=audit_logs.primary_blob_endpoint, + storage_account_access_key=audit_logs.primary_access_key, + disabled_alerts=[ + "Sql_Injection", + "Data_Exfiltration", + ], + retention_days=20) + example_workspace_vulnerability_assessment = azure.synapse.WorkspaceVulnerabilityAssessment("exampleWorkspaceVulnerabilityAssessment", + workspace_security_alert_policy_id=example_workspace_security_alert_policy.id, + storage_container_path=pulumi.Output.all(example_account.primary_blob_endpoint, example_container.name).apply(lambda primary_blob_endpoint, name: f"{primary_blob_endpoint}{name}/"), + storage_account_access_key=example_account.primary_access_key, + recurring_scans=azure.synapse.WorkspaceVulnerabilityAssessmentRecurringScansArgs( + enabled=True, + email_subscription_admins_enabled=True, + emails=[ + "email@example1.com", + "email@example2.com", + ], + )) + ``` + ## Import Synapse Workspace Vulnerability Assessment can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/trafficmanager/get_geographical_location.py b/sdk/python/pulumi_azure/trafficmanager/get_geographical_location.py index 37370a4ad5..d9dc02f5a4 100644 --- a/sdk/python/pulumi_azure/trafficmanager/get_geographical_location.py +++ b/sdk/python/pulumi_azure/trafficmanager/get_geographical_location.py @@ -61,6 +61,15 @@ def get_geographical_location(name: Optional[str] = None, Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. ## Example Usage + ### World) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_traffic_manager(name="World") + pulumi.export("locationCode", example.id) + ``` :param str name: Specifies the name of the Location, for example `World`, `Europe` or `Germany`. @@ -83,6 +92,15 @@ def get_geographical_location_output(name: Optional[pulumi.Input[str]] = None, Use this data source to access the ID of a specified Traffic Manager Geographical Location within the Geographical Hierarchy. ## Example Usage + ### World) + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.network.get_traffic_manager(name="World") + pulumi.export("locationCode", example.id) + ``` :param str name: Specifies the name of the Location, for example `World`, `Europe` or `Germany`. diff --git a/sdk/python/pulumi_azure/trafficmanager/profile.py b/sdk/python/pulumi_azure/trafficmanager/profile.py index 98110c46c0..82e2ce12b0 100644 --- a/sdk/python/pulumi_azure/trafficmanager/profile.py +++ b/sdk/python/pulumi_azure/trafficmanager/profile.py @@ -452,6 +452,39 @@ def __init__(__self__, """ Manages a Traffic Manager Profile to which multiple endpoints can be attached. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name=server.hex, + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + ``` + ## Import Traffic Manager Profiles can be imported using the `resource id`, e.g. @@ -483,6 +516,39 @@ def __init__(__self__, """ Manages a Traffic Manager Profile to which multiple endpoints can be attached. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + import pulumi_random as random + + server = random.RandomId("server", + keepers={ + "azi_id": 1, + }, + byte_length=8) + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_traffic_manager_profile = azure.network.TrafficManagerProfile("exampleTrafficManagerProfile", + resource_group_name=example_resource_group.name, + traffic_routing_method="Weighted", + dns_config=azure.network.TrafficManagerProfileDnsConfigArgs( + relative_name=server.hex, + ttl=100, + ), + monitor_config=azure.network.TrafficManagerProfileMonitorConfigArgs( + protocol="HTTP", + port=80, + path="/", + interval_in_seconds=30, + timeout_in_seconds=9, + tolerated_number_of_failures=3, + ), + tags={ + "environment": "Production", + }) + ``` + ## Import Traffic Manager Profiles can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/videoanalyzer/analyzer.py b/sdk/python/pulumi_azure/videoanalyzer/analyzer.py index 66eb6f88f5..0747090ef5 100644 --- a/sdk/python/pulumi_azure/videoanalyzer/analyzer.py +++ b/sdk/python/pulumi_azure/videoanalyzer/analyzer.py @@ -291,6 +291,49 @@ def __init__(__self__, !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `videoanalyzer.Analyzer` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + contributor = azure.authorization.Assignment("contributor", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_user_assigned_identity.principal_id) + reader = azure.authorization.Assignment("reader", + scope=example_account.id, + role_definition_name="Reader", + principal_id=example_user_assigned_identity.principal_id) + example_analyzer = azure.videoanalyzer.Analyzer("exampleAnalyzer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account=azure.videoanalyzer.AnalyzerStorageAccountArgs( + id=example_account.id, + user_assigned_identity_id=example_user_assigned_identity.id, + ), + identity=azure.videoanalyzer.AnalyzerIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "environment": "staging", + }, + opts=pulumi.ResourceOptions(depends_on=[ + contributor, + reader, + ])) + ``` + ## Import Video Analyzer can be imported using the `resource id`, e.g. @@ -319,6 +362,49 @@ def __init__(__self__, !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `videoanalyzer.Analyzer` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + contributor = azure.authorization.Assignment("contributor", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_user_assigned_identity.principal_id) + reader = azure.authorization.Assignment("reader", + scope=example_account.id, + role_definition_name="Reader", + principal_id=example_user_assigned_identity.principal_id) + example_analyzer = azure.videoanalyzer.Analyzer("exampleAnalyzer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account=azure.videoanalyzer.AnalyzerStorageAccountArgs( + id=example_account.id, + user_assigned_identity_id=example_user_assigned_identity.id, + ), + identity=azure.videoanalyzer.AnalyzerIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "environment": "staging", + }, + opts=pulumi.ResourceOptions(depends_on=[ + contributor, + reader, + ])) + ``` + ## Import Video Analyzer can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/videoanalyzer/edge_module.py b/sdk/python/pulumi_azure/videoanalyzer/edge_module.py index 59aa6661db..97b615b8e0 100644 --- a/sdk/python/pulumi_azure/videoanalyzer/edge_module.py +++ b/sdk/python/pulumi_azure/videoanalyzer/edge_module.py @@ -177,6 +177,53 @@ def __init__(__self__, !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `videoanalyzer.EdgeModule` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + contributor = azure.authorization.Assignment("contributor", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_user_assigned_identity.principal_id) + reader = azure.authorization.Assignment("reader", + scope=example_account.id, + role_definition_name="Reader", + principal_id=example_user_assigned_identity.principal_id) + example_analyzer = azure.videoanalyzer.Analyzer("exampleAnalyzer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account=azure.videoanalyzer.AnalyzerStorageAccountArgs( + id=example_account.id, + user_assigned_identity_id=example_user_assigned_identity.id, + ), + identity=azure.videoanalyzer.AnalyzerIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "environment": "staging", + }, + opts=pulumi.ResourceOptions(depends_on=[ + example_user_assigned_identity, + contributor, + reader, + ])) + example_edge_module = azure.videoanalyzer.EdgeModule("exampleEdgeModule", + resource_group_name=example_resource_group.name, + video_analyzer_name=example_analyzer.name) + ``` + ## Import Video Analyzer Edge Module can be imported using the `resource id`, e.g. @@ -202,6 +249,53 @@ def __init__(__self__, !> Video Analyzer (Preview) is now Deprecated and will be Retired on 2022-11-30 - as such the `videoanalyzer.EdgeModule` resource is deprecated and will be removed in v4.0 of the AzureRM Provider. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_account = azure.storage.Account("exampleAccount", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + account_tier="Standard", + account_replication_type="GRS") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + contributor = azure.authorization.Assignment("contributor", + scope=example_account.id, + role_definition_name="Storage Blob Data Contributor", + principal_id=example_user_assigned_identity.principal_id) + reader = azure.authorization.Assignment("reader", + scope=example_account.id, + role_definition_name="Reader", + principal_id=example_user_assigned_identity.principal_id) + example_analyzer = azure.videoanalyzer.Analyzer("exampleAnalyzer", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + storage_account=azure.videoanalyzer.AnalyzerStorageAccountArgs( + id=example_account.id, + user_assigned_identity_id=example_user_assigned_identity.id, + ), + identity=azure.videoanalyzer.AnalyzerIdentityArgs( + type="UserAssigned", + identity_ids=[example_user_assigned_identity.id], + ), + tags={ + "environment": "staging", + }, + opts=pulumi.ResourceOptions(depends_on=[ + example_user_assigned_identity, + contributor, + reader, + ])) + example_edge_module = azure.videoanalyzer.EdgeModule("exampleEdgeModule", + resource_group_name=example_resource_group.name, + video_analyzer_name=example_analyzer.name) + ``` + ## Import Video Analyzer Edge Module can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/voice/services_communications_gateway.py b/sdk/python/pulumi_azure/voice/services_communications_gateway.py index 8eb112d28b..c9e857a8b0 100644 --- a/sdk/python/pulumi_azure/voice/services_communications_gateway.py +++ b/sdk/python/pulumi_azure/voice/services_communications_gateway.py @@ -616,6 +616,53 @@ def __init__(__self__, !> **NOTE:** Access to Azure Communications Gateway is restricted, see [`Get access to Azure Communications Gateway for your Azure subscription`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#9-get-access-to-azure-communications-gateway-for-your-azure-subscription) for details. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_services_communications_gateway = azure.voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", + location="West Europe", + resource_group_name=example_resource_group.name, + connectivity="PublicAddress", + codecs="PCMA", + e911_type="DirectToEsrp", + platforms=[ + "OperatorConnect", + "TeamsPhoneMobile", + ], + service_locations=[ + azure.voice.ServicesCommunicationsGatewayServiceLocationArgs( + location="eastus", + allowed_media_source_address_prefixes=["10.1.2.0/24"], + allowed_signaling_source_address_prefixes=["10.1.1.0/24"], + esrp_addresses=["198.51.100.3"], + operator_addresses=["198.51.100.1"], + ), + azure.voice.ServicesCommunicationsGatewayServiceLocationArgs( + location="eastus2", + allowed_media_source_address_prefixes=["10.2.2.0/24"], + allowed_signaling_source_address_prefixes=["10.2.1.0/24"], + esrp_addresses=["198.51.100.4"], + operator_addresses=["198.51.100.2"], + ), + ], + auto_generated_domain_name_label_scope="SubscriptionReuse", + api_bridge=json.dumps({}), + emergency_dial_strings=[ + "911", + "933", + ], + on_prem_mcp_enabled=False, + tags={ + "key": "value", + }, + microsoft_teams_voicemail_pilot_number="1") + ``` + ## Import Voice Services Communications Gateways can be imported using the `resource id`, e.g. @@ -654,6 +701,53 @@ def __init__(__self__, !> **NOTE:** Access to Azure Communications Gateway is restricted, see [`Get access to Azure Communications Gateway for your Azure subscription`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#9-get-access-to-azure-communications-gateway-for-your-azure-subscription) for details. + ## Example Usage + + ```python + import pulumi + import json + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_services_communications_gateway = azure.voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", + location="West Europe", + resource_group_name=example_resource_group.name, + connectivity="PublicAddress", + codecs="PCMA", + e911_type="DirectToEsrp", + platforms=[ + "OperatorConnect", + "TeamsPhoneMobile", + ], + service_locations=[ + azure.voice.ServicesCommunicationsGatewayServiceLocationArgs( + location="eastus", + allowed_media_source_address_prefixes=["10.1.2.0/24"], + allowed_signaling_source_address_prefixes=["10.1.1.0/24"], + esrp_addresses=["198.51.100.3"], + operator_addresses=["198.51.100.1"], + ), + azure.voice.ServicesCommunicationsGatewayServiceLocationArgs( + location="eastus2", + allowed_media_source_address_prefixes=["10.2.2.0/24"], + allowed_signaling_source_address_prefixes=["10.2.1.0/24"], + esrp_addresses=["198.51.100.4"], + operator_addresses=["198.51.100.2"], + ), + ], + auto_generated_domain_name_label_scope="SubscriptionReuse", + api_bridge=json.dumps({}), + emergency_dial_strings=[ + "911", + "933", + ], + on_prem_mcp_enabled=False, + tags={ + "key": "value", + }, + microsoft_teams_voicemail_pilot_number="1") + ``` + ## Import Voice Services Communications Gateways can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/voice/services_communications_gateway_test_line.py b/sdk/python/pulumi_azure/voice/services_communications_gateway_test_line.py index 93a3fd8812..309b19882b 100644 --- a/sdk/python/pulumi_azure/voice/services_communications_gateway_test_line.py +++ b/sdk/python/pulumi_azure/voice/services_communications_gateway_test_line.py @@ -287,6 +287,24 @@ def __init__(__self__, """ Manages a Voice Services Communications Gateway Test Line. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Central US") + example_services_communications_gateway = azure.voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", resource_group_name=example_resource_group.name) + example_services_communications_gateway_test_line = azure.voice.ServicesCommunicationsGatewayTestLine("exampleServicesCommunicationsGatewayTestLine", + location="West Central US", + voice_services_communications_gateway_id=example_services_communications_gateway.id, + phone_number="123456789", + purpose="Automated", + tags={ + "key": "value", + }) + ``` + ## Import Voice Services Communications Gateway Test Line can be imported using the `resource id`, e.g. @@ -313,6 +331,24 @@ def __init__(__self__, """ Manages a Voice Services Communications Gateway Test Line. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Central US") + example_services_communications_gateway = azure.voice.ServicesCommunicationsGateway("exampleServicesCommunicationsGateway", resource_group_name=example_resource_group.name) + example_services_communications_gateway_test_line = azure.voice.ServicesCommunicationsGatewayTestLine("exampleServicesCommunicationsGatewayTestLine", + location="West Central US", + voice_services_communications_gateway_id=example_services_communications_gateway.id, + phone_number="123456789", + purpose="Automated", + tags={ + "key": "value", + }) + ``` + ## Import Voice Services Communications Gateway Test Line can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/waf/get_firewall_policy.py b/sdk/python/pulumi_azure/waf/get_firewall_policy.py index 7032aea8ac..91a641b280 100644 --- a/sdk/python/pulumi_azure/waf/get_firewall_policy.py +++ b/sdk/python/pulumi_azure/waf/get_firewall_policy.py @@ -87,6 +87,17 @@ def get_firewall_policy(name: Optional[str] = None, """ Use this data source to access information about an existing Web Application Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.waf.get_firewall_policy(resource_group_name="existing", + name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of the Web Application Firewall Policy :param str resource_group_name: The name of the Resource Group where the Web Application Firewall Policy exists. @@ -114,6 +125,17 @@ def get_firewall_policy_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Web Application Firewall Policy. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.waf.get_firewall_policy(resource_group_name="existing", + name="existing") + pulumi.export("id", example.id) + ``` + :param str name: The name of the Web Application Firewall Policy :param str resource_group_name: The name of the Resource Group where the Web Application Firewall Policy exists. diff --git a/sdk/python/pulumi_azure/waf/policy.py b/sdk/python/pulumi_azure/waf/policy.py index 83ec57387a..82acde4e4d 100644 --- a/sdk/python/pulumi_azure/waf/policy.py +++ b/sdk/python/pulumi_azure/waf/policy.py @@ -373,6 +373,102 @@ def __init__(__self__, """ Manages a Azure Web Application Firewall Policy instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_policy = azure.waf.Policy("examplePolicy", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + custom_rules=[ + azure.waf.PolicyCustomRuleArgs( + name="Rule1", + priority=1, + rule_type="MatchRule", + match_conditions=[azure.waf.PolicyCustomRuleMatchConditionArgs( + match_variables=[azure.waf.PolicyCustomRuleMatchConditionMatchVariableArgs( + variable_name="RemoteAddr", + )], + operator="IPMatch", + negation_condition=False, + match_values=[ + "192.168.1.0/24", + "10.0.0.0/24", + ], + )], + action="Block", + ), + azure.waf.PolicyCustomRuleArgs( + name="Rule2", + priority=2, + rule_type="MatchRule", + match_conditions=[ + azure.waf.PolicyCustomRuleMatchConditionArgs( + match_variables=[azure.waf.PolicyCustomRuleMatchConditionMatchVariableArgs( + variable_name="RemoteAddr", + )], + operator="IPMatch", + negation_condition=False, + match_values=["192.168.1.0/24"], + ), + azure.waf.PolicyCustomRuleMatchConditionArgs( + match_variables=[azure.waf.PolicyCustomRuleMatchConditionMatchVariableArgs( + variable_name="RequestHeaders", + selector="UserAgent", + )], + operator="Contains", + negation_condition=False, + match_values=["Windows"], + ), + ], + action="Block", + ), + ], + policy_settings=azure.waf.PolicyPolicySettingsArgs( + enabled=True, + mode="Prevention", + request_body_check=True, + file_upload_limit_in_mb=100, + max_request_body_size_in_kb=128, + ), + managed_rules=azure.waf.PolicyManagedRulesArgs( + exclusions=[ + azure.waf.PolicyManagedRulesExclusionArgs( + match_variable="RequestHeaderNames", + selector="x-company-secret-header", + selector_match_operator="Equals", + ), + azure.waf.PolicyManagedRulesExclusionArgs( + match_variable="RequestCookieNames", + selector="too-tasty", + selector_match_operator="EndsWith", + ), + ], + managed_rule_sets=[azure.waf.PolicyManagedRulesManagedRuleSetArgs( + type="OWASP", + version="3.2", + rule_group_overrides=[azure.waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs( + rule_group_name="REQUEST-920-PROTOCOL-ENFORCEMENT", + rules=[ + azure.waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs( + id="920300", + enabled=True, + action="Log", + ), + azure.waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs( + id="920440", + enabled=True, + action="Block", + ), + ], + )], + )], + )) + ``` + ## Import Web Application Firewall Policy can be imported using the `resource id`, e.g. @@ -400,6 +496,102 @@ def __init__(__self__, """ Manages a Azure Web Application Firewall Policy instance. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe") + example_policy = azure.waf.Policy("examplePolicy", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + custom_rules=[ + azure.waf.PolicyCustomRuleArgs( + name="Rule1", + priority=1, + rule_type="MatchRule", + match_conditions=[azure.waf.PolicyCustomRuleMatchConditionArgs( + match_variables=[azure.waf.PolicyCustomRuleMatchConditionMatchVariableArgs( + variable_name="RemoteAddr", + )], + operator="IPMatch", + negation_condition=False, + match_values=[ + "192.168.1.0/24", + "10.0.0.0/24", + ], + )], + action="Block", + ), + azure.waf.PolicyCustomRuleArgs( + name="Rule2", + priority=2, + rule_type="MatchRule", + match_conditions=[ + azure.waf.PolicyCustomRuleMatchConditionArgs( + match_variables=[azure.waf.PolicyCustomRuleMatchConditionMatchVariableArgs( + variable_name="RemoteAddr", + )], + operator="IPMatch", + negation_condition=False, + match_values=["192.168.1.0/24"], + ), + azure.waf.PolicyCustomRuleMatchConditionArgs( + match_variables=[azure.waf.PolicyCustomRuleMatchConditionMatchVariableArgs( + variable_name="RequestHeaders", + selector="UserAgent", + )], + operator="Contains", + negation_condition=False, + match_values=["Windows"], + ), + ], + action="Block", + ), + ], + policy_settings=azure.waf.PolicyPolicySettingsArgs( + enabled=True, + mode="Prevention", + request_body_check=True, + file_upload_limit_in_mb=100, + max_request_body_size_in_kb=128, + ), + managed_rules=azure.waf.PolicyManagedRulesArgs( + exclusions=[ + azure.waf.PolicyManagedRulesExclusionArgs( + match_variable="RequestHeaderNames", + selector="x-company-secret-header", + selector_match_operator="Equals", + ), + azure.waf.PolicyManagedRulesExclusionArgs( + match_variable="RequestCookieNames", + selector="too-tasty", + selector_match_operator="EndsWith", + ), + ], + managed_rule_sets=[azure.waf.PolicyManagedRulesManagedRuleSetArgs( + type="OWASP", + version="3.2", + rule_group_overrides=[azure.waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs( + rule_group_name="REQUEST-920-PROTOCOL-ENFORCEMENT", + rules=[ + azure.waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs( + id="920300", + enabled=True, + action="Log", + ), + azure.waf.PolicyManagedRulesManagedRuleSetRuleGroupOverrideRuleArgs( + id="920440", + enabled=True, + action="Block", + ), + ], + )], + )], + )) + ``` + ## Import Web Application Firewall Policy can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/webpubsub/get_private_link_resource.py b/sdk/python/pulumi_azure/webpubsub/get_private_link_resource.py index 13b245eff4..dafd2891e7 100644 --- a/sdk/python/pulumi_azure/webpubsub/get_private_link_resource.py +++ b/sdk/python/pulumi_azure/webpubsub/get_private_link_resource.py @@ -71,6 +71,21 @@ def get_private_link_resource(web_pubsub_id: Optional[str] = None, """ Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="east us") + test_service = azure.webpubsub.Service("testService", + location=test_resource_group.location, + resource_group_name=test_resource_group.name, + sku="Standard_S1", + capacity=1) + test_private_link_resource = azure.webpubsub.get_private_link_resource_output(web_pubsub_id=test_service.id) + ``` + :param str web_pubsub_id: The ID of an existing Web Pubsub Resource which Private Link Resource should be retrieved for. """ @@ -91,6 +106,21 @@ def get_private_link_resource_output(web_pubsub_id: Optional[pulumi.Input[str]] """ Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + test_resource_group = azure.core.ResourceGroup("testResourceGroup", location="east us") + test_service = azure.webpubsub.Service("testService", + location=test_resource_group.location, + resource_group_name=test_resource_group.name, + sku="Standard_S1", + capacity=1) + test_private_link_resource = azure.webpubsub.get_private_link_resource_output(web_pubsub_id=test_service.id) + ``` + :param str web_pubsub_id: The ID of an existing Web Pubsub Resource which Private Link Resource should be retrieved for. """ diff --git a/sdk/python/pulumi_azure/webpubsub/get_service.py b/sdk/python/pulumi_azure/webpubsub/get_service.py index 9c8841c8a3..586787e39e 100644 --- a/sdk/python/pulumi_azure/webpubsub/get_service.py +++ b/sdk/python/pulumi_azure/webpubsub/get_service.py @@ -245,6 +245,16 @@ def get_service(name: Optional[str] = None, """ Use this data source to access information about an existing Azure Web Pubsub service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.webpubsub.get_service(name="test-webpubsub", + resource_group_name="wps-resource-group") + ``` + :param str name: Specifies the name of the Web Pubsub service. :param str resource_group_name: Specifies the name of the resource group the Web Pubsub service is located in. @@ -285,6 +295,16 @@ def get_service_output(name: Optional[pulumi.Input[str]] = None, """ Use this data source to access information about an existing Azure Web Pubsub service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example = azure.webpubsub.get_service(name="test-webpubsub", + resource_group_name="wps-resource-group") + ``` + :param str name: Specifies the name of the Web Pubsub service. :param str resource_group_name: Specifies the name of the resource group the Web Pubsub service is located in. diff --git a/sdk/python/pulumi_azure/webpubsub/hub.py b/sdk/python/pulumi_azure/webpubsub/hub.py index f61d3a1ded..f1846a3e9b 100644 --- a/sdk/python/pulumi_azure/webpubsub/hub.py +++ b/sdk/python/pulumi_azure/webpubsub/hub.py @@ -278,6 +278,68 @@ def __init__(__self__, """ Manages the hub settings for a Web Pubsub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1) + example_hub = azure.webpubsub.Hub("exampleHub", + web_pubsub_id=example_service.id, + event_handlers=[ + azure.webpubsub.HubEventHandlerArgs( + url_template="https://test.com/api/{hub}/{event}", + user_event_pattern="*", + system_events=[ + "connect", + "connected", + ], + ), + azure.webpubsub.HubEventHandlerArgs( + url_template="https://test.com/api/{hub}/{event}", + user_event_pattern="event1, event2", + system_events=["connected"], + auth=azure.webpubsub.HubEventHandlerAuthArgs( + managed_identity_id=example_user_assigned_identity.id, + ), + ), + ], + event_listeners=[ + azure.webpubsub.HubEventListenerArgs( + system_event_name_filters=["connected"], + user_event_name_filters=[ + "event1", + "event2", + ], + eventhub_namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test1"]["name"], + ), + azure.webpubsub.HubEventListenerArgs( + system_event_name_filters=["connected"], + user_event_name_filters=["*"], + eventhub_namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test1"]["name"], + ), + azure.webpubsub.HubEventListenerArgs( + system_event_name_filters=["connected"], + user_event_name_filters=["event1"], + eventhub_namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test1"]["name"], + ), + ], + anonymous_connections_enabled=True, + opts=pulumi.ResourceOptions(depends_on=[example_service])) + ``` + ## Import Web Pubsub Hub can be imported using the `resource id`, e.g. @@ -308,6 +370,68 @@ def __init__(__self__, """ Manages the hub settings for a Web Pubsub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_user_assigned_identity = azure.authorization.UserAssignedIdentity("exampleUserAssignedIdentity", + resource_group_name=example_resource_group.name, + location=example_resource_group.location) + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1) + example_hub = azure.webpubsub.Hub("exampleHub", + web_pubsub_id=example_service.id, + event_handlers=[ + azure.webpubsub.HubEventHandlerArgs( + url_template="https://test.com/api/{hub}/{event}", + user_event_pattern="*", + system_events=[ + "connect", + "connected", + ], + ), + azure.webpubsub.HubEventHandlerArgs( + url_template="https://test.com/api/{hub}/{event}", + user_event_pattern="event1, event2", + system_events=["connected"], + auth=azure.webpubsub.HubEventHandlerAuthArgs( + managed_identity_id=example_user_assigned_identity.id, + ), + ), + ], + event_listeners=[ + azure.webpubsub.HubEventListenerArgs( + system_event_name_filters=["connected"], + user_event_name_filters=[ + "event1", + "event2", + ], + eventhub_namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test1"]["name"], + ), + azure.webpubsub.HubEventListenerArgs( + system_event_name_filters=["connected"], + user_event_name_filters=["*"], + eventhub_namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test1"]["name"], + ), + azure.webpubsub.HubEventListenerArgs( + system_event_name_filters=["connected"], + user_event_name_filters=["event1"], + eventhub_namespace_name=azurerm_eventhub_namespace["test"]["name"], + eventhub_name=azurerm_eventhub["test1"]["name"], + ), + ], + anonymous_connections_enabled=True, + opts=pulumi.ResourceOptions(depends_on=[example_service])) + ``` + ## Import Web Pubsub Hub can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/webpubsub/network_acl.py b/sdk/python/pulumi_azure/webpubsub/network_acl.py index 053ece5d95..86926842bb 100644 --- a/sdk/python/pulumi_azure/webpubsub/network_acl.py +++ b/sdk/python/pulumi_azure/webpubsub/network_acl.py @@ -222,6 +222,53 @@ def __init__(__self__, """ Manages the Network ACL for a Web Pubsub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.2.0/24"], + enforce_private_link_endpoint_network_policies=True) + example_endpoint = azure.privatelink.Endpoint("exampleEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + private_service_connection=azure.privatelink.EndpointPrivateServiceConnectionArgs( + name="psc-sig-test", + is_manual_connection=False, + private_connection_resource_id=example_service.id, + subresource_names=["webpubsub"], + )) + example_network_acl = azure.webpubsub.NetworkAcl("exampleNetworkAcl", + web_pubsub_id=example_service.id, + default_action="Allow", + public_network=azure.webpubsub.NetworkAclPublicNetworkArgs( + denied_request_types=["ClientConnection"], + ), + private_endpoints=[azure.webpubsub.NetworkAclPrivateEndpointArgs( + id=example_endpoint.id, + denied_request_types=[ + "RESTAPI", + "ClientConnection", + ], + )], + opts=pulumi.ResourceOptions(depends_on=[example_endpoint])) + ``` + ## Import Network ACLs for a Web Pubsub service can be imported using the `resource id`, e.g. @@ -246,6 +293,53 @@ def __init__(__self__, """ Manages the Network ACL for a Web Pubsub. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1) + example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + address_spaces=["10.5.0.0/16"]) + example_subnet = azure.network.Subnet("exampleSubnet", + resource_group_name=example_resource_group.name, + virtual_network_name=example_virtual_network.name, + address_prefixes=["10.5.2.0/24"], + enforce_private_link_endpoint_network_policies=True) + example_endpoint = azure.privatelink.Endpoint("exampleEndpoint", + resource_group_name=example_resource_group.name, + location=example_resource_group.location, + subnet_id=example_subnet.id, + private_service_connection=azure.privatelink.EndpointPrivateServiceConnectionArgs( + name="psc-sig-test", + is_manual_connection=False, + private_connection_resource_id=example_service.id, + subresource_names=["webpubsub"], + )) + example_network_acl = azure.webpubsub.NetworkAcl("exampleNetworkAcl", + web_pubsub_id=example_service.id, + default_action="Allow", + public_network=azure.webpubsub.NetworkAclPublicNetworkArgs( + denied_request_types=["ClientConnection"], + ), + private_endpoints=[azure.webpubsub.NetworkAclPrivateEndpointArgs( + id=example_endpoint.id, + denied_request_types=[ + "RESTAPI", + "ClientConnection", + ], + )], + opts=pulumi.ResourceOptions(depends_on=[example_endpoint])) + ``` + ## Import Network ACLs for a Web Pubsub service can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/webpubsub/service.py b/sdk/python/pulumi_azure/webpubsub/service.py index b6d763fd3e..2eb2620770 100644 --- a/sdk/python/pulumi_azure/webpubsub/service.py +++ b/sdk/python/pulumi_azure/webpubsub/service.py @@ -698,6 +698,29 @@ def __init__(__self__, """ Manages an Azure Web PubSub Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1, + public_network_access_enabled=False, + live_trace=azure.webpubsub.ServiceLiveTraceArgs( + enabled=True, + messaging_logs_enabled=True, + connectivity_logs_enabled=False, + ), + identity=azure.webpubsub.ServiceIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Web PubSub services can be imported using the `resource id`, e.g. @@ -730,6 +753,29 @@ def __init__(__self__, """ Manages an Azure Web PubSub Service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1, + public_network_access_enabled=False, + live_trace=azure.webpubsub.ServiceLiveTraceArgs( + enabled=True, + messaging_logs_enabled=True, + connectivity_logs_enabled=False, + ), + identity=azure.webpubsub.ServiceIdentityArgs( + type="SystemAssigned", + )) + ``` + ## Import Web PubSub services can be imported using the `resource id`, e.g. diff --git a/sdk/python/pulumi_azure/webpubsub/shared_private_link_resource.py b/sdk/python/pulumi_azure/webpubsub/shared_private_link_resource.py index fd2d430c26..502d081d1f 100644 --- a/sdk/python/pulumi_azure/webpubsub/shared_private_link_resource.py +++ b/sdk/python/pulumi_azure/webpubsub/shared_private_link_resource.py @@ -292,6 +292,38 @@ def __init__(__self__, """ Manages the Shared Private Link Resource for a Web Pubsub service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=["managecontacts"], + key_permissions=["create"], + secret_permissions=["set"], + )]) + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1) + example_shared_private_link_resource = azure.webpubsub.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", + web_pubsub_id=example_service.id, + subresource_name="vault", + target_resource_id=example_key_vault.id) + ``` + ## Import Web Pubsub Shared Private Link Resource can be imported using the `resource id`, e.g. @@ -321,6 +353,38 @@ def __init__(__self__, """ Manages the Shared Private Link Resource for a Web Pubsub service. + ## Example Usage + + ```python + import pulumi + import pulumi_azure as azure + + current = azure.core.get_client_config() + example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="east us") + example_key_vault = azure.keyvault.KeyVault("exampleKeyVault", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + tenant_id=current.tenant_id, + sku_name="standard", + soft_delete_retention_days=7, + access_policies=[azure.keyvault.KeyVaultAccessPolicyArgs( + tenant_id=current.tenant_id, + object_id=current.object_id, + certificate_permissions=["managecontacts"], + key_permissions=["create"], + secret_permissions=["set"], + )]) + example_service = azure.webpubsub.Service("exampleService", + location=example_resource_group.location, + resource_group_name=example_resource_group.name, + sku="Standard_S1", + capacity=1) + example_shared_private_link_resource = azure.webpubsub.SharedPrivateLinkResource("exampleSharedPrivateLinkResource", + web_pubsub_id=example_service.id, + subresource_name="vault", + target_resource_id=example_key_vault.id) + ``` + ## Import Web Pubsub Shared Private Link Resource can be imported using the `resource id`, e.g.